From 2b3d347c96975b6c5d2ffcc62689c0bc2114493f Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 01/55] test(casework): bound PostgreSQL lease observation Signed-off-by: Jeremi Joslin --- .../tests/review_postgres.rs | 203 +++++++++++++----- 1 file changed, 148 insertions(+), 55 deletions(-) diff --git a/crates/registry-casework/tests/review_postgres.rs b/crates/registry-casework/tests/review_postgres.rs index 18fdd1f3f0..898f72a1ff 100644 --- a/crates/registry-casework/tests/review_postgres.rs +++ b/crates/registry-casework/tests/review_postgres.rs @@ -514,19 +514,20 @@ fn bind_request( request } +fn review_test_database_url() -> String { + env::var("CASEWORK_REVIEW_TEST_DATABASE_URL") + .expect("CASEWORK_REVIEW_TEST_DATABASE_URL is required for review PostgreSQL tests") +} + async fn fixture() -> Fixture { - let base = env::var("CASEWORK_REVIEW_TEST_DATABASE_URL") - .expect("CASEWORK_REVIEW_TEST_DATABASE_URL is required for review PostgreSQL tests"); + let base = review_test_database_url(); let schema = format!("review_{}", Uuid::new_v4().simple()); let application_name = format!("casework-review-{}", Uuid::new_v4().simple()); let separator = if base.contains('?') { '&' } else { '?' }; let scoped_url = format!( "{base}{separator}options=-csearch_path%3D{schema}&application_name={application_name}" ); - let (admin, admin_connection) = tokio_postgres::connect(&base, NoTls) - .await - .expect("connect dedicated review test database"); - tokio::spawn(async move { admin_connection.await.expect("admin connection") }); + let admin = connect_review_test_database(&base).await; admin .batch_execute(&format!("CREATE SCHEMA {schema}")) .await @@ -551,7 +552,7 @@ async fn fixture() -> Fixture { let store = PostgresStore::connect_runtime(&database_config, &secrets, None) .expect("runtime store") .with_audit(registry_casework::CaseworkAudit::capture().0); - let database = connect_scoped(&scoped_url).await; + let database = connect_review_test_database(&scoped_url).await; database .batch_execute( "INSERT INTO casework_teams(team_id,revision) VALUES('review-team',1); @@ -612,11 +613,11 @@ async fn fixture() -> Fixture { } } -async fn connect_scoped(url: &str) -> tokio_postgres::Client { +async fn connect_review_test_database(url: &str) -> tokio_postgres::Client { let (client, connection) = tokio_postgres::connect(url, NoTls) .await - .expect("schema connection"); - tokio::spawn(async move { connection.await.expect("schema connection task") }); + .expect("connect review test database"); + tokio::spawn(async move { connection.await.expect("review test database connection") }); client } @@ -696,50 +697,57 @@ async fn assert_terminal_atomic(fixture: &Fixture, request_id: Uuid, completion_ ); } -async fn assert_store_sessions_hold_no_transaction_or_row_lock(fixture: &Fixture) { - let sessions = fixture - .database - .query_one( - "SELECT count(*), - count(*) FILTER (WHERE xact_start IS NOT NULL), - count(*) FILTER (WHERE state <> 'idle') - FROM pg_stat_activity - WHERE datname=current_database() AND application_name=$1 - AND pid<>pg_backend_pid()", - &[&fixture.application_name], - ) - .await - .expect("inspect completion dispatcher database sessions"); - assert!(sessions.get::<_, i64>(0) > 0, "observe the dispatcher pool"); - assert_eq!( - sessions.get::<_, i64>(1), - 0, - "completion delivery must not retain an open database transaction" - ); - assert_eq!( - sessions.get::<_, i64>(2), - 0, - "completion delivery must leave its database sessions idle" - ); - - let row_locks: i64 = fixture - .database - .query_one( - "SELECT count(*) - FROM pg_locks l - JOIN pg_stat_activity a ON a.pid=l.pid - WHERE a.datname=current_database() AND a.application_name=$1 - AND a.pid<>pg_backend_pid() AND l.granted - AND l.locktype IN ('tuple','transactionid')", - &[&fixture.application_name], - ) - .await - .expect("inspect completion dispatcher row locks") - .get(0); - assert_eq!( - row_locks, 0, - "completion delivery must not retain a row or transaction-id lock" - ); +async fn wait_for_idle_store_sessions( + observer: &tokio_postgres::Client, + application_name: &str, + budget: std::time::Duration, +) -> Result<(), String> { + let mut last_observation = None; + tokio::time::timeout(budget, async { + loop { + // Each autocommit query takes a fresh activity snapshot. The backend + // can still report an active transaction briefly after commit returns. + let observation = observer + .query_one( + "WITH sessions AS MATERIALIZED ( + SELECT pid, xact_start, state + FROM pg_stat_activity + WHERE datname=current_database() AND application_name=$1 + AND pid<>pg_backend_pid() + ) + SELECT count(*), + count(*) FILTER (WHERE xact_start IS NOT NULL), + count(*) FILTER (WHERE state IS DISTINCT FROM 'idle'), + (SELECT count(*) FROM pg_locks l + JOIN sessions s ON s.pid=l.pid + WHERE l.granted AND l.locktype IN ('tuple','transactionid')) + FROM sessions", + &[&application_name], + ) + .await + .expect("inspect completion dispatcher database sessions and locks"); + let sessions: i64 = observation.get(0); + let transactions: i64 = observation.get(1); + let busy_sessions: i64 = observation.get(2); + let locks: i64 = observation.get(3); + if sessions > 0 && transactions == 0 && busy_sessions == 0 && locks == 0 { + return; + } + last_observation = Some((sessions, transactions, busy_sessions, locks)); + tokio::time::sleep(std::time::Duration::from_millis(25)).await; + } + }) + .await + .map_err(|_| { + let details = match last_observation { + Some((sessions, transactions, busy_sessions, locks)) => format!( + "sessions={sessions}, transactions={transactions}, busy_sessions={busy_sessions}, \ + tuple_or_transaction_id_locks={locks}" + ), + None => "no PostgreSQL activity observation completed".to_owned(), + }; + format!("timed out waiting for the dispatcher pool to be idle without transactions or locks ({details})") + }) } #[derive(Default)] @@ -1270,6 +1278,85 @@ async fn at_least_once_completion_durably_deduplicates_after_lost_ack_and_exhaus } } +#[tokio::test] +async fn completion_lease_observer_bounds_a_stalled_database_query() { + let fixture = fixture().await; + let blocker = connect_review_test_database(&review_test_database_url()).await; + let pid: i32 = fixture + .database + .query_one("SELECT pg_backend_pid()", &[]) + .await + .expect("read the observer backend PID") + .get(0); + blocker + .query_one("SELECT pg_advisory_lock(2828, $1)", &[&pid]) + .await + .expect("hold the observer's advisory lock"); + + let bounded = tokio::time::timeout(std::time::Duration::from_secs(5), async { + tokio::select! { + biased; + // Queue a lock wait ahead of the observer query on the same connection. + result = async { + fixture.database.query_one("SELECT pg_advisory_xact_lock(2828, $1)", &[&pid]).await + } => { + panic!("the queued query must remain blocked: {result:?}"); + } + result = wait_for_idle_store_sessions( + &fixture.database, + &fixture.application_name, + std::time::Duration::from_millis(250), + ) => result, + } + }) + .await; + let unlocked: bool = blocker + .query_one("SELECT pg_advisory_unlock(2828, $1)", &[&pid]) + .await + .expect("release the observer's advisory lock") + .get(0); + assert!(unlocked); + let diagnostic = bounded + .expect("the observer must finish while its database query is stalled") + .expect_err("a stalled observer must time out"); + assert!( + diagnostic.contains("no PostgreSQL activity observation completed"), + "expected the stalled query in the diagnostic: {diagnostic}" + ); +} + +#[tokio::test] +async fn completion_lease_observer_refuses_a_held_row_lock_until_rollback() { + let mut fixture = fixture().await; + let request_id = settle_review_for_completion(&fixture, "held-completion-row").await; + let observer = connect_review_test_database(&review_test_database_url()).await; + let transaction = fixture + .database + .transaction() + .await + .expect("begin row locker"); + transaction + .query_one( + "SELECT request_id FROM casework_review_completion_outbox + WHERE request_id=$1 FOR UPDATE", + &[&request_id], + ) + .await + .expect("lock the completion row"); + + let budget = std::time::Duration::from_secs(2); + let observed = wait_for_idle_store_sessions(&observer, &fixture.application_name, budget).await; + transaction.rollback().await.expect("release the row lock"); + let diagnostic = observed.expect_err("a held transaction must exhaust the observer timeout"); + assert!( + diagnostic.contains("transactions=1, busy_sessions=1, tuple_or_transaction_id_locks=1"), + "expected the held transaction and lock in the diagnostic: {diagnostic}" + ); + wait_for_idle_store_sessions(&observer, &fixture.application_name, budget) + .await + .expect("observe fresh idle activity after rollback"); +} + #[tokio::test] async fn completion_dispatcher_leases_one_at_a_time_and_fences_a_stale_owner() { let fixture = fixture().await; @@ -1329,7 +1416,13 @@ async fn completion_dispatcher_leases_one_at_a_time_and_fences_a_stale_owner() { ) .await .expect("completion receiver observes the first leased delivery"); - assert_store_sessions_hold_no_transaction_or_row_lock(&fixture).await; + wait_for_idle_store_sessions( + &fixture.database, + &fixture.application_name, + std::time::Duration::from_secs(2), + ) + .await + .unwrap_or_else(|diagnostic| panic!("{diagnostic}")); let first_pass_states = fixture .database .query( From 1e2a900a380e2bb562898eff331c80d784ba58bd Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 02/55] test(breg): expect the missing array claim admission refusal Signed-off-by: Jeremi Joslin --- .../fixtures/multi-reference-array-claim/tests/journeys.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products/breg/fixtures/multi-reference-array-claim/tests/journeys.yaml b/products/breg/fixtures/multi-reference-array-claim/tests/journeys.yaml index 622bdf5a95..e237d1a750 100644 --- a/products/breg/fixtures/multi-reference-array-claim/tests/journeys.yaml +++ b/products/breg/fixtures/multi-reference-array-claim/tests/journeys.yaml @@ -100,4 +100,4 @@ journeys: sourceAuthorityId: {recordCapture: north-authority} destinationAuthorityId: {recordCapture: south-authority} transferReference: TRANSFER-004 - expect: {outcome: refusal, status: 404, problemCode: resource.not-found} + expect: {outcome: refusal, status: 403, problemCode: profile.not-authorized} From 7fc3d8964db596947f0a06b2b622021f9fadf13a Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 03/55] test(breg): qualify the released licence public check Folds these reviewed commits: - test(breg): qualify the released licence public check - test(breg): let the released launcher cancel public-check startup Signed-off-by: Jeremi Joslin --- products/breg/evidence/README.md | 8 + .../public-check/bregctl-v0.49.0.SHA256SUMS | 9 + .../evidence/tests/test_verify_composition.py | 83 +++++ .../breg/evidence/tests/verify-composition.py | 339 ++++++++++++++++-- 4 files changed, 406 insertions(+), 33 deletions(-) create mode 100644 products/breg/evidence/public-check/bregctl-v0.49.0.SHA256SUMS create mode 100644 products/breg/evidence/tests/test_verify_composition.py diff --git a/products/breg/evidence/README.md b/products/breg/evidence/README.md index 628ae53494..613d04fe98 100644 --- a/products/breg/evidence/README.md +++ b/products/breg/evidence/README.md @@ -95,6 +95,14 @@ outputs privately. The runner starts no services and proves: version, refused fact rules, its 10 fixtures, and Evidence's refusal of the same definition over the ordinary export. +For the served synthetic licence check, give the same runner matching released +v0.49.0 binaries for all five options, including `--breg` and `--rstack`. It +starts a disposable BReg and Evidence run with Docker, compares two native +exports to the pinned inventory in `public-check/bregctl-v0.49.0.SHA256SUMS`, +and calls the public route on loopback. The run exercises a valid licence, a +missing request member, a wrong code, a record issued without a code, and an +absent record. Use `--work-dir` to retain the generated authoring artifacts. + The offline runner does not establish successful retained-session attachment, HTTP authorization, live signing or service operation. Those need the separate native local lifecycle journey. Value changes need no new export; changes to a diff --git a/products/breg/evidence/public-check/bregctl-v0.49.0.SHA256SUMS b/products/breg/evidence/public-check/bregctl-v0.49.0.SHA256SUMS new file mode 100644 index 0000000000..ea25da318c --- /dev/null +++ b/products/breg/evidence/public-check/bregctl-v0.49.0.SHA256SUMS @@ -0,0 +1,9 @@ +ac5787573469a1d1afe5b1bcfb7c2f5c2e24c901b7efa17005c6f120f5439d94 adapter-packs/registry-check/pack.yaml +de5da14df16cbd9f8fc37a8580330242d50409aa15d28749904bc9c2823b41b2 adapter-packs/registry-check/protocols/registry-lookup.json +66e7e32afae2a7e10e61d1d2439c6d0af49f580411f25e08315bfbc01cf0e1a3 adapter-packs/registry-check/schemas/facts.json +64f09226eeb333e756f9da69b93179fe4afeecb76306d589b605eedf7d951e0f adapter-packs/registry-check/schemas/inputs.json +0ae29920c88d5bb7878c42b24ca4c1f417068ca5b81ee0ab1d5835a59622042d adapter-packs/registry-check/schemas/response.json +7b14e4c20acfeee66678ede2cfe34a03bd8c101e9cefce610cc6574c200125ce adapter-packs/registry-check/scripts/lookup.rhai +3912ec5c8bfeb077878266397a2c0f9f8cb991a200de92acba5bc31036c30300 selectors/breg-8-registry-6-record-7-by-code.yaml +f70ce6a8ce5660b940b1f98d0f50777984479303347fd4f110959129de439c8e source-export.json +bb03772f29474a51baf4d1b0637bcd0ab0af6b303e324f76b55e217d25ad8eb8 sources/registry-check.yaml diff --git a/products/breg/evidence/tests/test_verify_composition.py b/products/breg/evidence/tests/test_verify_composition.py new file mode 100644 index 0000000000..6b123b454a --- /dev/null +++ b/products/breg/evidence/tests/test_verify_composition.py @@ -0,0 +1,83 @@ +# SPDX-License-Identifier: Apache-2.0 + +import importlib.util +from pathlib import Path +import signal +import subprocess +import tempfile +import unittest +from unittest.mock import patch + + +spec = importlib.util.spec_from_file_location( + "verify_composition", Path(__file__).with_name("verify-composition.py"), +) +composition = importlib.util.module_from_spec(spec) +spec.loader.exec_module(composition) + + +class DevelopmentStartupTest(unittest.TestCase): + def test_slow_launch_gets_the_native_startup_window(self): + argv = ["rstack", "dev", "start", "/fixture"] + with patch.object(composition.subprocess, "Popen") as start: + process = start.return_value.__enter__.return_value + process.communicate.return_value = (b'{"status":"ready"}', b"") + process.returncode = 0 + output, interrupted = composition.start_development(argv, {}) + self.assertIsNone(interrupted) + self.assertEqual(output.stdout, b'{"status":"ready"}') + self.assertGreater(process.communicate.call_args.kwargs["timeout"], 360) + process.send_signal.assert_not_called() + + def test_timed_out_launch_can_return_a_ready_run_for_cleanup(self): + argv = ["rstack", "dev", "start", "/fixture"] + deadline = subprocess.TimeoutExpired(argv, 390) + with patch.object(composition.subprocess, "Popen") as start: + process = start.return_value.__enter__.return_value + process.communicate.side_effect = [deadline, (b'{"status":"ready"}', b"")] + process.returncode = 0 + output, interrupted = composition.start_development(argv, {}) + process.send_signal.assert_called_once_with(signal.SIGINT) + process.kill.assert_not_called() + self.assertIs(interrupted, deadline) + self.assertEqual(output.returncode, 0) + + def test_stalled_cancellation_reports_uncertain_cleanup(self): + argv = ["rstack", "dev", "start", "/fixture"] + with patch.object(composition.subprocess, "Popen") as start: + process = start.return_value.__enter__.return_value + process.communicate.side_effect = [ + subprocess.TimeoutExpired(argv, 390), + subprocess.TimeoutExpired(argv, 30), + ] + with self.assertRaises(composition.DevCleanupPending): + composition.start_development(argv, {}) + process.send_signal.assert_called_once_with(signal.SIGINT) + process.kill.assert_called_once() + process.wait.assert_called_once() + + def test_ready_run_returned_after_timeout_is_stopped_before_the_error(self): + argv = ["rstack", "dev", "start", "/fixture"] + deadline = subprocess.TimeoutExpired(argv, 390) + run = subprocess.CompletedProcess( + argv, 0, b'{"status":"ready","run_id":"synthetic-run","database":{"mode":"managed"}}', + ) + stopped = subprocess.CompletedProcess(argv, 0, b'{"status":"stopped"}') + binaries = {name: Path(name) for name in ("rstack", "evidence", "evidencectl", "breg", "bregctl")} + with patch.object(composition, "start_development", return_value=(run, deadline)), \ + patch.object(composition.subprocess, "run", return_value=stopped) as launcher: + with self.assertRaises(subprocess.TimeoutExpired): + with composition.managed_product(binaries, Path("/state"), Path("/fixture"), "breg"): + self.fail("the timed-out run must not execute a fixture") + self.assertEqual(launcher.call_args.args[0][-3:], ["stop", "synthetic-run", "--clean"]) + + def test_uncertain_cleanup_preserves_the_private_run_directory(self): + with tempfile.TemporaryDirectory() as parent: + with self.assertRaisesRegex(composition.DevCleanupPending, "Private recovery state"): + with composition.dev_workspace(Path(parent)) as scratch: + raise composition.DevCleanupPending("launcher cancellation did not settle") + self.assertTrue(scratch.is_dir()) + + +if __name__ == "__main__": + unittest.main() diff --git a/products/breg/evidence/tests/verify-composition.py b/products/breg/evidence/tests/verify-composition.py index ec52eb961d..b2f040d3c4 100644 --- a/products/breg/evidence/tests/verify-composition.py +++ b/products/breg/evidence/tests/verify-composition.py @@ -1,19 +1,23 @@ #!/usr/bin/env python3 -"""Offline native BReg-to-Evidence composition proof with matching binaries. +"""Native BReg-to-Evidence composition proof with matching binaries. -Requires bregctl, evidencectl, evidence and PyYAML. Starts no services. The -adopter flow uses ordinary authored files and public CLIs, not this harness. +Requires bregctl, evidencectl, evidence and PyYAML. With breg and rstack, also +serve a synthetic licence public check against a disposable PostgreSQL database. """ from __future__ import annotations import argparse +from contextlib import contextmanager import hashlib import json import os from pathlib import Path import shutil +import signal import subprocess import tempfile +from urllib.error import HTTPError +from urllib.request import build_opener, ProxyHandler, Request import yaml @@ -122,15 +126,7 @@ def facts_schema(pack_root: Path) -> dict: return read(pack_root / pack["sourceRoutes"][0]["evidence"]["factsSchema"]["path"]) -def verify_public_check(workspace: Path, binaries: dict[str, Path], - environment: dict[str, str], offline_cases: dict[str, int]) -> dict: - """A public check reads the registry through a `--public-check` export. - - Evidence compares the check code only after the Source lookup succeeds, so - this export states types only and the definition's derivation checks content. - """ - registry, project = workspace / "check-registry", workspace / "check-evidence" - target, candidate = workspace / "check-target", workspace / "check-candidate" +def public_check_registry(registry: Path) -> None: shutil.copytree(INPUTS / "registry", registry) model = read(registry / "registry.yaml") model["recordTypes"]["record"]["fields"].append({ @@ -140,14 +136,47 @@ def verify_public_check(workspace: Path, binaries: dict[str, Path], for profile in model["accessProfiles"].values(): for permission in profile["permissions"]["records"]: permission["readableFields"].append("check-code") + if "create" in permission["operations"]: + permission["writableFields"].append("check-code") write(registry / "registry.yaml", model) - arguments = ( + + +def public_check_arguments(registry: Path, authentication: str) -> tuple: + return ( "generate", "evidence-source", registry, "--access-profile", "evidence-source", "--record-type", "record", "--selector", "by-code", "--fields", "status,check-code", "--source-id", "registry-check", "--connection", "registry", - "--authentication", "oauth2-private-key-jwt", + "--authentication", authentication, ) + + +def author_public_check(project: Path, export: Path, binaries: dict[str, Path], + environment: dict[str, str]) -> None: + run(binaries["evidencectl"], "init", project, "--starter", + INPUTS / "offline-starter", "--profile", "local", environment=environment) + run(binaries["evidencectl"], "source", "import", export, "--project", project, + environment=environment) + authored = read(project / "evidence.yaml") + fragment = read(PUBLIC_CHECK / "definitions.yaml.fragment") + authored["functions"].update(fragment["functions"]) + authored["assertionDefinitions"].update(fragment["assertionDefinitions"]) + write(project / "evidence.yaml", authored) + for name in ["functions", "fixtures", "schemas"]: + shutil.copytree(PUBLIC_CHECK / name, project / name, dirs_exist_ok=True) + + +def verify_public_check(workspace: Path, binaries: dict[str, Path], + environment: dict[str, str], offline_cases: dict[str, int]) -> dict: + """A public check reads the registry through a `--public-check` export. + + Evidence compares the check code only after the Source lookup succeeds, so + this export states types only and the definition's derivation checks content. + """ + registry, project = workspace / "check-registry", workspace / "check-evidence" + target, candidate = workspace / "check-target", workspace / "check-candidate" + public_check_registry(registry) + arguments = public_check_arguments(registry, "oauth2-private-key-jwt") ordinary, exported = workspace / "check-ordinary-export", workspace / "check-export" run(binaries["bregctl"], *arguments, "--output", ordinary, environment=environment) run(binaries["bregctl"], *arguments, "--public-check", "--output", exported, @@ -174,28 +203,14 @@ def verify_public_check(workspace: Path, binaries: dict[str, Path], assert "breg.evidence-source.refused" in refused, refused assert not (workspace / "check-refused-export").exists() - fragment = read(PUBLIC_CHECK / "definitions.yaml.fragment") - - def author(directory: Path, export: Path) -> None: - run(binaries["evidencectl"], "init", directory, "--starter", - INPUTS / "offline-starter", "--profile", "local", environment=environment) - run(binaries["evidencectl"], "source", "import", export, "--project", directory, - environment=environment) - authored = read(directory / "evidence.yaml") - authored["functions"].update(fragment["functions"]) - authored["assertionDefinitions"].update(fragment["assertionDefinitions"]) - write(directory / "evidence.yaml", authored) - for name in ["functions", "fixtures", "schemas"]: - shutil.copytree(PUBLIC_CHECK / name, directory / name, dirs_exist_ok=True) - # Evidence refuses the same definition over the ordinary export. mistaken = workspace / "check-ordinary-evidence" - author(mistaken, ordinary) + author_public_check(mistaken, ordinary, binaries, environment) refused = run(binaries["evidencectl"], "check", mistaken, environment=environment, refused=True) assert "public-check-facts-content" in refused, refused - author(project, exported) + author_public_check(project, exported, binaries, environment) new_local_target(project, target, binaries, environment) # Declaring publicCheck opens nothing. The target authority activates it. settings = read(target / "target.yaml") @@ -231,6 +246,256 @@ def author(directory: Path, export: Path) -> None: } +class DevCleanupPending(RuntimeError): + """Keep the private launcher state available for recovery.""" + + +def start_development(command: list[str], env: dict[str, str]): + interrupted = None + with subprocess.Popen(command, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + start_new_session=True) as process: + try: + # The released launcher owns the first deadline (360 seconds). + stdout, stderr = process.communicate(timeout=390) + except (KeyboardInterrupt, subprocess.TimeoutExpired) as error: + interrupted = error + process.send_signal(signal.SIGINT) + try: + stdout, stderr = process.communicate(timeout=30) + except (KeyboardInterrupt, subprocess.TimeoutExpired) as cleanup: + process.kill() + process.wait() + raise DevCleanupPending("launcher cancellation did not settle") from cleanup + return subprocess.CompletedProcess(command, process.returncode, stdout, stderr), interrupted + + +@contextmanager +def dev_workspace(parent: Path): + scratch = Path(tempfile.mkdtemp(prefix="licence-run-", dir=parent)) + preserve = False + try: + yield scratch + except DevCleanupPending as error: + preserve = True + raise DevCleanupPending(f"{error}. Private recovery state: {scratch}") from error + finally: + if not preserve: + shutil.rmtree(scratch) + + +@contextmanager +def managed_product(binaries: dict[str, Path], state: Path, project: Path, product: str): + env = dict(os.environ) + env.pop("RSTACK_DEV_DATABASE_URL", None) + env.pop("RSTACK_DEV_DATABASE_CA", None) + env["RSTACK_DEV_STATE_DIR"] = str(state) + env["EVIDENCE_BIN"] = str(binaries["evidence"]) + for name in ("breg", "bregctl", "evidence", "evidencectl"): + env[f"RSTACK_{name.upper()}_BIN"] = str(binaries[name]) + command = [str(binaries["rstack"]), "--install-root", str(state.parent / "install"), + "--format", "json", "dev"] + + def decode(result: subprocess.CompletedProcess, action: str) -> dict: + report = json.loads(result.stdout) + if result.returncode: + detail = report.get("error", {}).get("message") if action != "token" else None + raise RuntimeError(f"{product} dev {action} exited {result.returncode}: {detail}") + return report + + def dev(action: str, *args: object) -> dict: + result = subprocess.run( + [*command, action, *map(str, args)], env=env, capture_output=True, timeout=180, check=False, + ) + return decode(result, action) + + start, interrupted = start_development([*command, "start", str(project), "--ttl", "5m"], env) + if interrupted is not None and start.returncode: + if start.returncode < 0: + raise DevCleanupPending(f"{product} launcher exited on a signal") from interrupted + raise interrupted + try: + started = decode(start, "start") + run_id = started["run_id"] + except (ValueError, KeyError) as error: + raise DevCleanupPending(f"{product} launcher returned no recoverable run ID") from error + + try: + if interrupted is not None: + # Readiness can race cancellation. Stop a run whose ID was returned. + raise interrupted + assert started["status"] == "ready" + origin = started["products"][product] + assert origin.startswith("http://127.0.0.1:") + yield origin, lambda alias: dev("token", run_id, "--as", alias) + finally: + try: + clean = ["--clean"] if started["database"]["mode"] == "managed" else [] + stopped = dev("stop", run_id, *clean) + assert stopped["status"] == "stopped" + except (Exception, KeyboardInterrupt) as error: + raise DevCleanupPending(f"{product} run {run_id} could not be confirmed stopped") from error + + +def verify_live_public_check(workspace: Path, binaries: dict[str, Path]) -> dict: + environment = dict(os.environ) + versions = { + name: run(path, "--version", environment=environment).strip().split()[-1] + for name, path in binaries.items() + } + assert len(set(versions.values())) == 1, versions + expected_file = PUBLIC_CHECK / f"bregctl-v{versions['bregctl']}.SHA256SUMS" + assert expected_file.is_file(), f"no reviewed export for bregctl {versions['bregctl']}" + expected = { + name: digest + for digest, name in (line.split(maxsplit=1) for line in expected_file.read_text().splitlines()) + } + registry = workspace / "licence-registry" + public_check_registry(registry) + journey_path = registry / "dev-journeys.yaml" + journey = read(journey_path) + active, no_code, _ = journey["journeys"][0]["steps"] + code = "K7QWM4XRT5PZ3NB6VHJYDC2A" + number, legacy_number = "SYNTHETIC-LICENCE-001", "SYNTHETIC-LICENCE-LEGACY" + active["body"]["data"].update(code=number, checkCode=code) + no_code["body"]["data"]["code"] = legacy_number + write(journey_path, journey) + + arguments = public_check_arguments(registry, "static-authorization") + exported = workspace / "licence-source" + repeated = workspace / "licence-source-repeat" + for output in (exported, repeated): + run(binaries["bregctl"], *arguments, "--public-check", "--output", output, + environment=environment) + export_bytes = authored_snapshot(exported) + snapshot = { + name: hashlib.sha256(content).hexdigest() + for name, content in sorted(export_bytes.items()) + } + assert export_bytes == authored_snapshot(repeated) + assert snapshot == expected, "the native export differs from the reviewed release inventory" + facts = facts_schema(exported / "adapter-packs/registry-check") + assert facts["properties"] == { + "check-code": {"type": "string"}, "status": {"type": "string"}, + } + assert not facts.get("required") + project = workspace / "licence-evidence" + author_public_check(project, exported, binaries, environment) + project_path = project / "evidence.yaml" + authored = read(project_path) + authored["assertionDefinitions"].pop("extract-record-active") + authored["functions"].pop("extract-record-active") + authored["lookups"].pop("record-by-code-v1") + authored["sources"].pop("record-status") + write(project_path, authored) + fixture_path = project / "fixtures/record-check.yaml" + fixture = read(fixture_path) + for case in fixture["cases"]: + acquisition = case.get("acquisition") + if acquisition is not None: + acquisition["intercepts"] = [ + entry for entry in acquisition["intercepts"] if entry["type"] != "token-endpoint" + ] + acquisition["exchanges"] = [ + exchange for exchange in acquisition["exchanges"] + if not exchange["request"].get("tokenRequest") + ] + write(fixture_path, fixture) + + with dev_workspace(workspace.parent) as scratch: + local = scratch / "evidence" + shutil.copytree(project, local) + with managed_product(binaries, scratch / "breg-state", registry, "breg") as (origin, token): + target_path = local / "local-target.yaml" + target = read(target_path) + authority_path = local / target["authority"] + authority = read(authority_path) + authority["publicCheck"] = {"definition": "record-check"} + # Packaging also exercises signed synthetic fixtures. They enter + # through the ordinary relying-service profile. + [grant] = authority["accessProfiles"]["local-service"]["grants"] + grant["definition"] = "record-check" + [subject] = grant["subjects"] + subject["lookup"] = "breg-8-registry-6-record-7-by-code" + write(authority_path, authority) + target.pop("extracts") + target["connections"].pop("record-status-extract") + target["connections"]["registry"] = {"endpoints": {"registry": { + "origin": origin, + "authentication": {"type": "static-authorization", + "tokenRef": "secret:file/licence-source-token"}, + }}} + write(target_path, target) + write(local / "dev.yaml", { + "apiVersion": "id.registrystack.org/formats/rstack/dev/v1alpha1", + "kind": "RStackDev", "issuer": "run", + "products": [{"product": "evidence", "project": ".", + "audience": "urn:example:licence-public-check"}], + "journeyFile": "dev-journeys.yaml", + "people": {"caller": { + "subject": "urn:example:caller:public-check-fixture", + "client": "caller", + "grants": {"evidence": { + "profile": "local-service", + "scopes": ["evidence:request"], + "claims": {"evidence_audience": "urn:example:audience:local-evidence"}, + }}, + }}, + }) + write(local / "dev-journeys.yaml", { + "apiVersion": "id.registrystack.org/formats/rstack/journeys/v1alpha1", + "kind": "RStackJourneys", + "journeys": [{"id": "public-check-ready", "steps": [{ + "id": "definitions", "product": "evidence", "as": "caller", + "method": "GET", "path": "/v1/evidence-definitions", + "expect": {"status": 200}, + }]}], + }) + # rstack creates this short-lived fixture credential. Keep it + # out of retained authoring artifacts and diagnostic output. + [credential] = token("source")["credentials"] + header = Path(credential["header_file"]).read_text().strip() + name, scheme, value = header.split(maxsplit=2) + assert name.lower() == "authorization:" and scheme == "Bearer" + secret_path = local / ".generated/secrets/licence-source-token" + secret_path.parent.mkdir(mode=0o700, parents=True, exist_ok=True) + fd = os.open(secret_path, os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o600) + with os.fdopen(fd, "w") as secret: + secret.write(value) + + with managed_product(binaries, scratch / "evidence-state", local, "evidence") as (evidence, _): + client = build_opener(ProxyHandler({})) + + def check(document_number: str, **fields: str) -> tuple[int, dict]: + request = Request( + evidence + "/v1/public-check", + data=json.dumps({"documentNumber": document_number, **fields}).encode(), + headers={"Content-Type": "application/json"}, + ) + try: + with client.open(request, timeout=15) as result: + return result.status, json.load(result) + except HTTPError as error: + with error: + return error.code, json.load(error) + + status, result = check(number, checkCode=code) + assert status == 200 and result.pop("observedAt"), (status, result) + assert result == {"schema": "registry.evidence.public-check/v1alpha1", + "status": "valid", "fields": {"recordStatus": "active"}} + missing_status, missing = check(number) + assert (missing_status, missing["code"]) == (400, "evidence.invalid-request") + unresolved = [] + for document_number, check_code in [ + (number, "A" * 24), (legacy_number, code), ("SYNTHETIC-LICENCE-ABSENT", code), + ]: + status, problem = check(document_number, checkCode=check_code) + assert (status, problem["code"]) == (404, "resource.not-found") + problem.pop("traceId", None) + unresolved.append(problem) + assert unresolved[0] == unresolved[1] == unresolved[2] + return {"versions": versions, "publicCheckExportSha256": snapshot, "servedCases": 5} + + def verify(workspace: Path, binaries: dict[str, Path]) -> dict: environment = dict(os.environ) environment.pop("REGISTRY_EVIDENCE_RUNTIME", None) @@ -481,10 +746,17 @@ def main() -> None: parser = argparse.ArgumentParser(description=__doc__) for name in ["bregctl", "evidencectl", "evidence"]: parser.add_argument(f"--{name}", type=Path, default=shutil.which(name)) + parser.add_argument("--breg", type=Path, help="native BReg runtime for the served licence check") + parser.add_argument("--rstack", type=Path, help="native launcher for the served licence check") parser.add_argument("--work-dir", type=Path, help="new private directory retaining synthetic outputs") args = parser.parse_args() binaries = {} - for name in ["bregctl", "evidencectl", "evidence"]: + if bool(args.breg) != bool(args.rstack): + parser.error("provide both --breg and --rstack for the served licence check") + names = ["bregctl", "evidencectl", "evidence"] + if args.breg: + names.extend(["breg", "rstack"]) + for name in names: path = getattr(args, name) if path is None or not path.is_file(): parser.error(f"provide --{name} with a matching native executable") @@ -492,10 +764,11 @@ def main() -> None: if args.work_dir: workspace = args.work_dir.resolve() workspace.mkdir(mode=0o700) - report = verify(workspace, binaries) + report = verify_live_public_check(workspace, binaries) if args.breg else verify(workspace, binaries) else: with tempfile.TemporaryDirectory(prefix="breg-evidence-composition-") as directory: - report = verify(Path(directory).resolve(), binaries) + workspace = Path(directory).resolve() + report = verify_live_public_check(workspace, binaries) if args.breg else verify(workspace, binaries) print(json.dumps(report, indent=2)) From 603b652cc3ff36aba5033f6233a5f39f42c84f4f Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 04/55] feat(breg): select stored readable fields by classification ceiling Folds these reviewed commits: - feat(breg): select stored readable fields by classification - fix(breg): scope classification ceilings to owned stored fields - test(breg): cover module ceilings and default traversal - fix(breg): keep consent-scoped field grants explicit - test(breg): bind consent ceiling guidance to apply controls Signed-off-by: Jeremi Joslin --- crates/registry-breg/src/compiler.rs | 72 +++++++ .../registry-breg/src/compiler/statistics.rs | 1 + crates/registry-breg/src/contract.rs | 17 +- .../src/contract/readable_fields.rs | 92 +++++++++ crates/registry-breg/src/contract/sentinel.rs | 102 ++++++++-- crates/registry-breg/src/fixtures.rs | 1 + crates/registry-breg/src/immediate_actions.rs | 1 + crates/registry-breg/src/odrl_export.rs | 1 + .../registry-breg/tests/compiler_contract.rs | 141 +++++++++++++- crates/registry-breg/tests/consent_access.rs | 26 +++ .../registry-breg/tests/disclosure/fields.rs | 93 ++++++++- crates/registry-breg/tests/external_views.rs | 26 +++ .../tests/package_change_plan.rs | 179 ++++++++++++++++++ .../tests/postgres_client_relationships.rs | 58 +++++- .../content/docs/configure/breg-access.mdx | 11 ++ .../content/docs/configure/breg-consent.mdx | 2 + .../src/content/docs/operate/breg-changes.mdx | 12 ++ docs/site/src/content/docs/security/breg.mdx | 15 +- products/breg/CHANGELOG.md | 4 + .../contracts/security-invariant-matrix.yaml | 1 + .../contracts/security-test-traceability.yaml | 1 + .../authoring/registry-module.schema.json | 52 +++-- .../authoring/registry-project.schema.json | 52 +++-- .../breg/scripts/test_validate_product.py | 2 +- products/breg/scripts/validate_product.py | 2 +- 25 files changed, 894 insertions(+), 70 deletions(-) create mode 100644 crates/registry-breg/src/contract/readable_fields.rs diff --git a/crates/registry-breg/src/compiler.rs b/crates/registry-breg/src/compiler.rs index 142294ec20..97f8008b7e 100644 --- a/crates/registry-breg/src/compiler.rs +++ b/crates/registry-breg/src/compiler.rs @@ -329,6 +329,7 @@ pub fn compile_project_with_assets( disclosure::validate_module_access_reason_operations(&sources, &mut diagnostics); let module_profiles = crate::access::module_profile_keys(&sources); expand_project_access(project, &mut sources, &mut diagnostics); + resolve_readable_fields(&mut sources, &mut diagnostics); resolve_vocabularies(project, &mut sources, &mut action_sources, &mut diagnostics); validate_entities( &project.project.id, @@ -4188,6 +4189,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_fields_ceiling: grant.readable_fields_ceiling, readable_attachments: grant.readable_attachments.clone(), writable_fields: grant.writable_fields.clone(), filterable_fields: grant.filterable_fields.clone(), @@ -4208,6 +4210,76 @@ pub(crate) fn expand_project_access( } } +// Resolve against the composed record types, so grants include fields supplied +// by extensions and paths see the fields of their target record type. +fn resolve_readable_fields( + entities: &mut BTreeMap, + errors: &mut Vec, +) { + for id in entities.keys().cloned().collect::>() { + if entities[&id].access_profiles.iter().all(|profile| { + profile.readable_fields_ceiling.is_none() + && profile + .read_paths + .iter() + .all(|grant| grant.readable_fields_ceiling.is_none()) + }) { + continue; + } + let mut profiles = std::mem::take(&mut entities.get_mut(&id).unwrap().access_profiles); + let entity = &entities[&id]; + for profile in &mut profiles { + let consent_scope = (!profile.require_consent.is_empty()) + .then(|| format!("recordTypes[id={id}].accessProfiles[id={}]", profile.id)); + if let Some(ceiling) = profile.readable_fields_ceiling.take() { + if let Some(path) = &consent_scope { + errors.push(consent_ceiling_refusal(format!("{path}.readableFields"))); + } + profile.readable_fields = ceiling.select( + entity + .fields + .iter() + .map(|field| (&field.id, field.classification)), + ); + } + for grant in &mut profile.read_paths { + let Some(ceiling) = grant.readable_fields_ceiling.take() else { + continue; + }; + if let Some(path) = &consent_scope { + errors.push(consent_ceiling_refusal(format!( + "{path}.readPaths[path={}].readableFields", + grant.path + ))); + } + let target = entity + .read_paths + .iter() + .rfind(|path| path.id == grant.path) + .and_then(|path| entities.get(&path.to)); + // Existing path validation reports an unknown path or target. + if let Some(target) = target { + grant.readable_fields = ceiling.select( + target + .fields + .iter() + .map(|field| (&field.id, field.classification)), + ); + } + } + } + entities.get_mut(&id).unwrap().access_profiles = profiles; + } +} + +fn consent_ceiling_refusal(path: String) -> Diagnostic { + Diagnostic::error( + "breg.consent.readable-fields-explicit-required", + path, + "a permission with requireConsent needs an explicit readableFields list for it and its read paths, so the existing consent scope cannot grow when fields change", + ) +} + fn resolve_vocabularies( project: &RegistryProject, entities: &mut BTreeMap, diff --git a/crates/registry-breg/src/compiler/statistics.rs b/crates/registry-breg/src/compiler/statistics.rs index 6ae477f835..c885ffb1e3 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_fields_ceiling: None, readable_attachments: Default::default(), writable_fields: Default::default(), filterable_fields: Default::default(), diff --git a/crates/registry-breg/src/contract.rs b/crates/registry-breg/src/contract.rs index fddf2a5ffb..2f64f56487 100644 --- a/crates/registry-breg/src/contract.rs +++ b/crates/registry-breg/src/contract.rs @@ -19,7 +19,10 @@ use time::{format_description::well_known::Rfc3339, OffsetDateTime}; use crate::diagnostics::{CompileFailure, Diagnostic}; pub use crate::unique_set::UniqueSet; -pub(crate) mod sentinel; +pub(crate) mod readable_fields; +mod sentinel; + +pub use readable_fields::{ReadableFields, ReadableFieldsCeiling}; /// Serialize a union read by `tagged_union!` in its authored form: one /// mapping whose `tag` member names the variant. `external` is the variant as @@ -5437,6 +5440,8 @@ pub struct AccessProfileSource { pub operations: UniqueSet, #[serde(default)] pub readable_fields: UniqueSet, + #[serde(skip)] + pub(crate) readable_fields_ceiling: Option, /// Record attachment slots the profile may download. Requires `get`. #[serde(default, skip_serializing_if = "UniqueSet::is_empty")] pub readable_attachments: UniqueSet, @@ -5999,6 +6004,7 @@ pub struct CompiledTaskGrantPermissionSource { #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde( try_from = "sentinel::AuthoredEntityPermission", + into = "sentinel::AuthoredEntityPermission", rename_all = "camelCase" )] pub struct EntityPermissionSource { @@ -6006,6 +6012,8 @@ pub struct EntityPermissionSource { pub entity: String, pub operations: UniqueSet, pub readable_fields: UniqueSet, + #[serde(skip)] + pub(crate) readable_fields_ceiling: Option, /// Record attachment slots the profile may download. Requires `get`. #[serde(skip_serializing_if = "UniqueSet::is_empty")] pub readable_attachments: UniqueSet, @@ -6096,10 +6104,13 @@ pub enum LookupValueOrigin { #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(deny_unknown_fields, rename_all = "camelCase")] -pub struct ReadPathPermissionSource { +pub struct ReadPathPermissionSource> { pub path: String, #[serde(default)] - pub readable_fields: UniqueSet, + #[cfg_attr(feature = "schema", schemars(extend("default" = [])))] + pub readable_fields: Fields, + #[serde(skip)] + pub(crate) readable_fields_ceiling: Option, #[serde(default)] pub filterable_fields: UniqueSet, #[serde(default)] diff --git a/crates/registry-breg/src/contract/readable_fields.rs b/crates/registry-breg/src/contract/readable_fields.rs new file mode 100644 index 0000000000..f49f3676d9 --- /dev/null +++ b/crates/registry-breg/src/contract/readable_fields.rs @@ -0,0 +1,92 @@ +// SPDX-License-Identifier: Apache-2.0 + +use registry_platform_yaml::shape_union; +use serde::{Deserialize, Serialize}; + +use super::{Classification, ReadPathPermissionSource, UniqueSet}; + +/// Include stored fields classified at or below this level. +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[serde(deny_unknown_fields, rename_all = "camelCase")] +pub struct ReadableFieldsCeiling { + pub up_to_classification: Classification, +} + +impl ReadableFieldsCeiling { + pub(crate) fn select<'a>( + self, + fields: impl Iterator, + ) -> UniqueSet { + fields + .filter(|(_, classification)| *classification <= self.up_to_classification) + .map(|(id, _)| id.clone()) + .collect() + } +} + +/// An explicit field list or an inclusive ceiling on stored field classification. +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[derive(Clone, Debug, Eq, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ReadableFields { + Explicit(UniqueSet), + Ceiling(ReadableFieldsCeiling), +} + +shape_union!(ReadableFields { list => Explicit, mapping => Ceiling }); + +impl Default for ReadableFields { + fn default() -> Self { + Self::Explicit(UniqueSet::new()) + } +} + +impl ReadableFields { + pub(super) fn into_parts(self) -> (UniqueSet, Option) { + match self { + Self::Explicit(fields) => (fields, None), + Self::Ceiling(ceiling) => (UniqueSet::new(), Some(ceiling)), + } + } + + pub(super) fn from_parts( + fields: UniqueSet, + ceiling: Option, + ) -> Self { + match ceiling { + Some(ceiling) => Self::Ceiling(ceiling), + None => Self::Explicit(fields), + } + } +} + +impl From> for ReadPathPermissionSource { + fn from(authored: ReadPathPermissionSource) -> Self { + let (readable_fields, readable_fields_ceiling) = authored.readable_fields.into_parts(); + Self { + path: authored.path, + readable_fields, + readable_fields_ceiling, + filterable_fields: authored.filterable_fields, + sortable_fields: authored.sortable_fields, + allow_count: authored.allow_count, + } + } +} + +impl From for ReadPathPermissionSource { + fn from(source: ReadPathPermissionSource) -> Self { + Self { + path: source.path, + readable_fields: ReadableFields::from_parts( + source.readable_fields, + source.readable_fields_ceiling, + ), + readable_fields_ceiling: None, + filterable_fields: source.filterable_fields, + sortable_fields: source.sortable_fields, + allow_count: source.allow_count, + } + } +} diff --git a/crates/registry-breg/src/contract/sentinel.rs b/crates/registry-breg/src/contract/sentinel.rs index 49546f7dad..df263029e3 100644 --- a/crates/registry-breg/src/contract/sentinel.rs +++ b/crates/registry-breg/src/contract/sentinel.rs @@ -22,7 +22,7 @@ use super::{ AccessProfileSource, AccessRequirementsSource, ActorKindSource, CompiledTaskGrantSource, ConsentRequirementSource, EntityPermissionSource, LookupPermissionSource, MembershipBoundarySource, Operation, PermissionsSource, ProvenanceFieldSource, - ReadPathPermissionSource, RequiredFilterSource, RowBoundarySource, + ReadPathPermissionSource, ReadableFields, RequiredFilterSource, RowBoundarySource, SpatialQueryPermissionSource, UniqueSet, }; @@ -491,7 +491,7 @@ pub(super) struct AuthoredModuleProfile { require_access_reason: bool, operations: UniqueSet, #[serde(default)] - readable_fields: UniqueSet, + readable_fields: ReadableFields, /// Record attachment slots the profile may download. Requires `get`. #[serde(default, skip_serializing_if = "UniqueSet::is_empty")] readable_attachments: UniqueSet, @@ -531,7 +531,7 @@ pub(super) struct AuthoredModuleProfile { #[serde(default, skip_serializing_if = "Vec::is_empty")] lookups: Vec, #[serde(default, skip_serializing_if = "Vec::is_empty")] - read_paths: Vec, + read_paths: Vec>, #[serde(default, skip_serializing_if = "super::is_false")] allow_count: bool, #[serde(default)] @@ -552,6 +552,7 @@ pub(super) struct AuthoredModuleProfile { impl From for AccessProfileSource { fn from(authored: AuthoredModuleProfile) -> Self { + let (readable_fields, readable_fields_ceiling) = authored.readable_fields.into_parts(); Self { id: authored.id, display: authored.display, @@ -564,7 +565,8 @@ impl From for AccessProfileSource { required_purposes: authored.required_purposes, require_access_reason: authored.require_access_reason, operations: authored.operations, - readable_fields: authored.readable_fields, + readable_fields, + readable_fields_ceiling, readable_attachments: authored.readable_attachments, writable_fields: authored.writable_fields, filterable_fields: authored.filterable_fields, @@ -575,7 +577,7 @@ impl From for AccessProfileSource { membership_boundaries: authored.membership_boundaries, require_consent: authored.require_consent, lookups: authored.lookups, - read_paths: authored.read_paths, + read_paths: authored.read_paths.into_iter().map(Into::into).collect(), allow_count: authored.allow_count, revision_access: authored.revision_access, provenance_fields: authored.provenance_fields, @@ -598,7 +600,10 @@ impl From for AuthoredModuleProfile { required_purposes: profile.required_purposes, require_access_reason: profile.require_access_reason, operations: profile.operations, - readable_fields: profile.readable_fields, + readable_fields: ReadableFields::from_parts( + profile.readable_fields, + profile.readable_fields_ceiling, + ), readable_attachments: profile.readable_attachments, writable_fields: profile.writable_fields, filterable_fields: profile.filterable_fields, @@ -609,7 +614,7 @@ impl From for AuthoredModuleProfile { membership_boundaries: profile.membership_boundaries, require_consent: profile.require_consent, lookups: profile.lookups, - read_paths: profile.read_paths, + read_paths: profile.read_paths.into_iter().map(Into::into).collect(), allow_count: profile.allow_count, revision_access: profile.revision_access, provenance_fields: profile.provenance_fields, @@ -688,14 +693,14 @@ pub(super) fn permissions<'de, D: Deserializer<'de>>( /// What a profile may do with one entity. #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schema", schemars(rename = "EntityPermissionSource"))] -#[derive(Deserialize)] +#[derive(Deserialize, Serialize)] #[serde(deny_unknown_fields, rename_all = "camelCase")] pub(super) struct AuthoredEntityPermission { #[serde(rename = "recordType")] entity: String, operations: UniqueSet, #[serde(default)] - readable_fields: UniqueSet, + readable_fields: ReadableFields, /// Record attachment slots the profile may download. Requires `get`. #[serde(default, skip_serializing_if = "UniqueSet::is_empty")] readable_attachments: UniqueSet, @@ -721,35 +726,57 @@ pub(super) struct AuthoredEntityPermission { required_filters: Vec, #[serde(default)] sortable_fields: UniqueSet, - #[serde(default)] + #[serde(default, skip_serializing_if = "Option::is_none")] spatial_queries: Option, /// Row reach: `unrestricted`, or a list of at least one row boundary. + #[serde(serialize_with = "serialize_entity_rows")] #[cfg_attr(feature = "schema", schemars(with = "RowBoundaries"))] row_boundaries: Option, /// Current active membership required for each stored reference key. - #[serde(default)] + #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[cfg_attr(feature = "schema", schemars(extend("default" = [])))] membership_boundaries: Vec, /// Current subject-issued consent required for each row, ANDed. - #[serde(default)] + #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[cfg_attr(feature = "schema", schemars(extend("default" = [])))] require_consent: Vec, - #[serde(default)] + #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[cfg_attr(feature = "schema", schemars(extend("default" = [])))] lookups: Vec, - #[serde(default)] - read_paths: Vec, - #[serde(default)] + #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[cfg_attr(feature = "schema", schemars(extend("default" = [])))] + read_paths: Vec>, + #[serde(default, skip_serializing_if = "super::is_false")] + #[cfg_attr(feature = "schema", schemars(extend("default" = false)))] allow_count: bool, #[serde(default)] revision_access: bool, - #[serde(default, deserialize_with = "super::unique_items")] + #[serde( + default, + deserialize_with = "super::unique_items", + skip_serializing_if = "Vec::is_empty" + )] #[cfg_attr( feature = "schema", - schemars(with = "UniqueSet") + schemars(with = "UniqueSet", extend("default" = [])) )] provenance_fields: Vec, #[serde(default)] allow_data_export: bool, } +fn serialize_entity_rows( + rows: &Option, + serializer: S, +) -> Result { + match rows { + Some(RowBoundaries::Unrestricted(_)) => serializer.serialize_str(UNRESTRICTED), + Some(RowBoundaries::Listed(Listed(rows, _))) => rows.serialize(serializer), + Some(RowBoundaries::Reference(_)) => Err(serde::ser::Error::custom(UNRESOLVED_REFERENCE)), + None => serializer.serialize_none(), + } +} + impl TryFrom for EntityPermissionSource { type Error = Invalid; @@ -760,10 +787,12 @@ impl TryFrom for EntityPermissionSource { "Declare rowBoundaries on the permission: list the row boundaries that bind rows to the caller's claims, or write unrestricted to reach every row.", )); }; + let (readable_fields, readable_fields_ceiling) = authored.readable_fields.into_parts(); Ok(Self { entity: authored.entity, operations: authored.operations, - readable_fields: authored.readable_fields, + readable_fields, + readable_fields_ceiling, readable_attachments: authored.readable_attachments, writable_fields: authored.writable_fields, filterable_fields: authored.filterable_fields, @@ -774,7 +803,7 @@ impl TryFrom for EntityPermissionSource { membership_boundaries: authored.membership_boundaries, require_consent: authored.require_consent, lookups: authored.lookups, - read_paths: authored.read_paths, + read_paths: authored.read_paths.into_iter().map(Into::into).collect(), allow_count: authored.allow_count, revision_access: authored.revision_access, provenance_fields: authored.provenance_fields, @@ -782,3 +811,36 @@ impl TryFrom for EntityPermissionSource { }) } } + +impl From for AuthoredEntityPermission { + fn from(source: EntityPermissionSource) -> Self { + let rows = if source.row_boundaries.is_empty() { + RowBoundaries::Unrestricted(Unrestricted(PhantomData)) + } else { + RowBoundaries::Listed(Listed(source.row_boundaries, PhantomData)) + }; + Self { + entity: source.entity, + operations: source.operations, + readable_fields: ReadableFields::from_parts( + source.readable_fields, + source.readable_fields_ceiling, + ), + readable_attachments: source.readable_attachments, + writable_fields: source.writable_fields, + filterable_fields: source.filterable_fields, + required_filters: source.required_filters, + sortable_fields: source.sortable_fields, + spatial_queries: source.spatial_queries, + row_boundaries: Some(rows), + membership_boundaries: source.membership_boundaries, + require_consent: source.require_consent, + lookups: source.lookups, + read_paths: source.read_paths.into_iter().map(Into::into).collect(), + allow_count: source.allow_count, + revision_access: source.revision_access, + provenance_fields: source.provenance_fields, + allow_data_export: source.allow_data_export, + } + } +} diff --git a/crates/registry-breg/src/fixtures.rs b/crates/registry-breg/src/fixtures.rs index 4e1a5e5900..41648f7de5 100644 --- a/crates/registry-breg/src/fixtures.rs +++ b/crates/registry-breg/src/fixtures.rs @@ -1908,6 +1908,7 @@ fn action_profile_from_grant( required_purposes: grant.required_purposes.clone().into(), operations: grant.operations.clone().into(), readable_fields: Default::default(), + readable_fields_ceiling: None, readable_attachments: Default::default(), writable_fields: Default::default(), filterable_fields: Default::default(), diff --git a/crates/registry-breg/src/immediate_actions.rs b/crates/registry-breg/src/immediate_actions.rs index f2f746cba9..c6bb79acc3 100644 --- a/crates/registry-breg/src/immediate_actions.rs +++ b/crates/registry-breg/src/immediate_actions.rs @@ -2653,6 +2653,7 @@ fn validate_permission_access_requirements( require_access_reason: profile.require_access_reason, operations: [Operation::Invoke].into(), readable_fields: Default::default(), + readable_fields_ceiling: None, readable_attachments: Default::default(), writable_fields: Default::default(), filterable_fields: Default::default(), diff --git a/crates/registry-breg/src/odrl_export.rs b/crates/registry-breg/src/odrl_export.rs index b2f853c422..cd537817bd 100644 --- a/crates/registry-breg/src/odrl_export.rs +++ b/crates/registry-breg/src/odrl_export.rs @@ -351,6 +351,7 @@ fn audit_access_profile(access: &AccessProfileSource) { required_purposes: _, operations: _, readable_fields: _, + readable_fields_ceiling: _, // The export describes record field projections only. A profile's // file downloads are not part of the exported permission. readable_attachments: _, diff --git a/crates/registry-breg/tests/compiler_contract.rs b/crates/registry-breg/tests/compiler_contract.rs index a5f3d54153..f8a763d765 100644 --- a/crates/registry-breg/tests/compiler_contract.rs +++ b/crates/registry-breg/tests/compiler_contract.rs @@ -1702,9 +1702,7 @@ fn constraint_unions_refuse_at_the_member_inside_the_form() { } } -#[test] -fn derived_fields_selectors_and_read_paths_compile_to_route_specific_inventories() { - let project = br#"{"datasets":{"test-dataset": {}}, +const DERIVED_HOUSEHOLD_PROJECT: &[u8] = br#"{"datasets":{"test-dataset": {}}, "apiVersion":"id.registrystack.org/formats/breg/project/v1alpha1", "kind":"BRegProject", "project":{"id":"household-demo","version":"1","defaultLanguage":"en","canonicalBaseIri":"https://authoring.example.test"}, @@ -1761,7 +1759,114 @@ fn derived_fields_selectors_and_read_paths_compile_to_route_specific_inventories }]} }} }"#; - let sql = "SELECT h.id AS id, count(p.id)::bigint AS child_count, false AS single_headed, 1::bigint AS registry_derived_key_cardinality FROM registry_source.household h LEFT JOIN registry_source.group_membership gm ON gm.household = h.id LEFT JOIN registry_source.person p ON p.id = gm.person GROUP BY h.id"; +const DERIVED_HOUSEHOLD_SQL: &str = "SELECT h.id AS id, count(p.id)::bigint AS child_count, false AS single_headed, 1::bigint AS registry_derived_key_cardinality FROM registry_source.household h LEFT JOIN registry_source.group_membership gm ON gm.household = h.id LEFT JOIN registry_source.person p ON p.id = gm.person GROUP BY h.id"; + +#[test] +fn a_module_ceiling_round_trips_and_selects_only_eligible_stored_fields() { + let mut source: Value = serde_json::from_slice(DERIVED_HOUSEHOLD_PROJECT).unwrap(); + let mut derived = source["recordTypes"]["household"] + .as_object_mut() + .unwrap() + .remove("derived") + .unwrap(); + derived[0]["fields"][0]["classification"] = json!("internal"); + let ceiling = json!({"upToClassification": "internal"}); + let mut module_source = json!({ + "apiVersion": "id.registrystack.org/formats/breg/module/v1alpha1", + "kind": "BRegModule", + "id": "disclosure-extension", + "version": "1", + "extendRecordTypes": {"household": { + "fields": [ + {"id": "extension-note", "type": "string", "maximumLength": 64, "classification": "internal"}, + {"id": "restricted-note", "type": "string", "maximumLength": 64, "classification": "restricted"} + ], + "derived": derived, + "accessProfiles": {"module-reader": { + "principalClaim": "registry_principal", "requiredScopes": ["module:read"], + "operations": ["get", "list"], "rowBoundaries": "unrestricted", + "readableFields": ceiling + }} + }} + }); + let module = parse_module_json(&serde_json::to_vec(&module_source).unwrap()).unwrap(); + let mut round_trip: Value = + serde_json::from_slice(&source_bytes::source_bytes(&module)).unwrap(); + round_trip["apiVersion"] = json!(MODULE_API_VERSION); + round_trip["kind"] = json!(MODULE_KIND); + assert_eq!( + round_trip["extendRecordTypes"]["household"]["accessProfiles"]["module-reader"] + ["readableFields"], + ceiling, + ); + let reread = parse_module_json(&serde_json::to_vec(&round_trip).unwrap()).unwrap(); + assert_eq!(reread, module); + let assets = [ModuleAssetSource { + module: Some("disclosure-extension".to_owned()), + path: "sql/household-demographics.sql".to_owned(), + bytes: DERIVED_HOUSEHOLD_SQL.as_bytes().to_vec(), + }]; + let mut compile_module = |module| { + let digest = registry_breg::compiler::module_digest_with_assets(&module, &assets); + source["modules"] = json!({"disclosure-extension": {"version": "1", "digest": digest}}); + let project = parse_project_json(&serde_json::to_vec(&source).unwrap()).unwrap(); + compile_project_with_assets(&project, &[module], &assets, CompileProfile::Authoring) + .expect("the module extension and its lock compile") + }; + let compiled = compile_module(reread); + module_source["extendRecordTypes"]["household"]["accessProfiles"]["module-reader"] + ["readableFields"] = json!([ + "administrative-area", + "extension-note", + "household-code", + "local-household-number" + ]); + let explicit = + compile_module(parse_module_json(&serde_json::to_vec(&module_source).unwrap()).unwrap()); + assert_eq!(compiled.access(), explicit.access()); + assert_ne!( + compiled.revision(), + explicit.revision(), + "the authored module lock changes" + ); + assert_eq!( + compiled + .artifacts() + .get("generated/openapi.json") + .unwrap() + .bytes, + explicit + .artifacts() + .get("generated/openapi.json") + .unwrap() + .bytes, + ); + let household = &compiled.entities()["household"]; + assert!(household.fields.contains_key("restricted-note")); + assert!(household.derived_fields.contains_key("child-count")); + + let openapi = &compiled + .artifacts() + .get("generated/openapi.json") + .unwrap() + .bytes; + let openapi = parse_json_strict(openapi).unwrap(); + assert_eq!( + openapi["paths"]["/v1/records/households"]["get"]["x-registry-queryProfiles"] + ["module-reader"]["selectableProperties"], + json!([ + "administrativeArea", + "extensionNote", + "householdCode", + "localHouseholdNumber" + ]), + ); +} + +#[test] +fn derived_fields_selectors_and_read_paths_compile_to_route_specific_inventories() { + let project = DERIVED_HOUSEHOLD_PROJECT; + let sql = DERIVED_HOUSEHOLD_SQL; let compiled = compile_json_with_assets( project, vec![derived_sql_asset("sql/household-demographics.sql", sql)], @@ -1890,6 +1995,34 @@ fn derived_fields_selectors_and_read_paths_compile_to_route_specific_inventories assert!(path.allow_count); assert!(path.processing_fields.contains(&"household".to_owned())); assert!(path.processing_fields.contains(&"person".to_owned())); + + let compile = |source: &Value| { + compile_json_with_assets( + &serde_json::to_vec(source).unwrap(), + vec![derived_sql_asset("sql/household-demographics.sql", sql)], + ) + }; + let mut source: Value = serde_json::from_slice(project).unwrap(); + source["recordTypes"]["household"]["derived"][0]["fields"][0]["classification"] = + json!("internal"); + let grant = &mut source["accessProfiles"]["operator"]["permissions"]["records"][0]; + grant["readableFields"] = json!([ + "household-code", + "administrative-area", + "local-household-number" + ]); + grant["filterableFields"] = json!([]); + grant["sortableFields"] = json!([]); + let explicit = compile(&source).expect("the explicit stored fields compile"); + let grant = &mut source["accessProfiles"]["operator"]["permissions"]["records"][0]; + grant["readableFields"] = json!({"upToClassification": "internal"}); + grant["readPaths"][0]["readableFields"] = json!({"upToClassification": "internal"}); + let ceiling = compile(&source).expect("the classification ceiling compiles"); + assert_eq!(explicit.revision(), ceiling.revision()); + assert_eq!(explicit.artifacts(), ceiling.artifacts()); + assert!(!ceiling.entities()["household"].access_profiles["operator"] + .readable_fields + .contains("child-count")); } #[test] diff --git a/crates/registry-breg/tests/consent_access.rs b/crates/registry-breg/tests/consent_access.rs index 0da8cd5d28..8c62320169 100644 --- a/crates/registry-breg/tests/consent_access.rs +++ b/crates/registry-breg/tests/consent_access.rs @@ -547,6 +547,32 @@ fn gated_permissions_refuse_spatial_queries() { assert_refused(&value, "breg.consent.require-spatial-unsupported"); } +#[test] +fn a_consent_scope_requires_explicit_fields_on_direct_reads_and_read_paths() { + compile(&source()).expect("the explicit direct and path grants remain valid"); + let base = "recordTypes[id=person].accessProfiles[id=food-targeting]"; + for (member, expected) in [ + ("/readableFields", format!("{base}.readableFields")), + ( + "/readPaths/0/readableFields", + format!("{base}.readPaths[path=households].readableFields"), + ), + ] { + let mut value = source(); + let grant = &mut value["accessProfiles"][FOOD_TARGETING]["permissions"]["records"][0]; + *grant.pointer_mut(member).unwrap() = json!({"upToClassification": "restricted"}); + let Err(failure) = compile(&value) else { + panic!("the consent scope must keep explicit fields at {expected}"); + }; + let finding = failure + .diagnostics() + .iter() + .find(|diagnostic| diagnostic.code == "breg.consent.readable-fields-explicit-required") + .expect("the compiler identifies the ceiling on the consent scope"); + assert_eq!(finding.path, expected); + } +} + #[test] fn gated_permissions_refuse_data_export() { let mut value = source(); diff --git a/crates/registry-breg/tests/disclosure/fields.rs b/crates/registry-breg/tests/disclosure/fields.rs index 009c6c06f4..6f01d64af3 100644 --- a/crates/registry-breg/tests/disclosure/fields.rs +++ b/crates/registry-breg/tests/disclosure/fields.rs @@ -65,7 +65,10 @@ fn the_fixture_withholds_contacts_from_the_registrar_only() { /// The fixture project with create and patch granted on `person`. fn writable_project() -> registry_breg::CompiledRegistry { - let mut source = project_source(); + compile_writable_project(project_source()) +} + +fn compile_writable_project(mut source: Value) -> registry_breg::CompiledRegistry { source["recordTypes"]["person"]["batch"] = json!({"maximumItems": 4, "maximumBytes": 8192}); for profile in source["accessProfiles"] .as_object_mut() @@ -92,7 +95,10 @@ impl ReadinessProbe for Ready { /// The fixture rows installed under the writable project, with the router that /// serves them. async fn serve() -> (Fixture, axum::Router) { - let registry = writable_project(); + serve_project(writable_project()).await +} + +async fn serve_project(registry: registry_breg::CompiledRegistry) -> (Fixture, axum::Router) { let database = TestDatabase::create(4).await; let (migration, task) = database.connect_migration().await; install_compiled_schema(&migration, ®istry, &database.runtime_role) @@ -279,6 +285,89 @@ fn api_names(fixture: &Fixture, fields: &[&str]) -> BTreeSet { .collect() } +fn project_with_stored_field_ceiling() -> Value { + let mut source = project_source(); + let fields = source["recordTypes"]["person"]["fields"] + .as_array_mut() + .unwrap(); + fields[0]["classification"] = json!("public"); + fields[4]["classification"] = json!("restricted"); + source["accessProfiles"][REGISTRAR]["permissions"]["records"][0]["readableFields"] = + json!({"upToClassification": "internal"}); + source +} + +#[test] +fn classification_ceiling_keeps_the_authored_shape_and_refuses_unknown_members() { + let mut source = project_with_stored_field_ceiling(); + let project = parse_project_json(&serde_json::to_vec(&source).unwrap()).unwrap(); + assert_eq!( + serde_json::to_value(project).unwrap()["accessProfiles"][REGISTRAR]["permissions"] + ["records"][0]["readableFields"], + json!({"upToClassification": "internal"}) + ); + source["accessProfiles"][REGISTRAR]["permissions"]["records"][0]["readableFields"] + ["unexpected"] = json!("restricted"); + assert!(parse_project_json(&serde_json::to_vec(&source).unwrap()).is_err()); +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn stored_field_classification_ceiling_limits_the_served_profile() { + let (fixture, app) = + serve_project(compile_writable_project(project_with_stored_field_ceiling())).await; + + let open = send( + &app, + Method::GET, + &person_path(OPEN_PERSON_ID), + REGISTRAR, + &[], + None, + ) + .await; + assert_eq!(open.status, StatusCode::OK, "{}", open.text); + assert_eq!( + data_members(&open), + api_names(&fixture, &PERSON_FIELDS[..4]) + ); + assert_eq!( + find_object(&open.body, "domainData").unwrap()["familyName"], + "Open" + ); + + let protected = send( + &app, + Method::GET, + &person_path(PERSON_ID), + REGISTRAR, + &[], + None, + ) + .await; + assert_eq!(protected.status, StatusCode::OK, "{}", protected.text); + assert_eq!( + find_object(&protected.body, "domainData").unwrap()["emailAddress"], + Value::Null + ); + assert_no_sentinel(&protected.text); + + let officer = send( + &app, + Method::GET, + &person_path(PERSON_ID), + PROTECTION_OFFICER, + &[], + None, + ) + .await; + assert_eq!(officer.status, StatusCode::OK, "{}", officer.text); + assert_eq!( + find_object(&officer.body, "domainData").unwrap()["phoneNumber"], + CANARY_PHONE + ); + fixture.database.cleanup().await; +} + #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn a_get_nulls_withheld_members_only_while_the_condition_matches() { let (fixture, app) = serve().await; diff --git a/crates/registry-breg/tests/external_views.rs b/crates/registry-breg/tests/external_views.rs index ea7609e71a..bdf1fbd2e9 100644 --- a/crates/registry-breg/tests/external_views.rs +++ b/crates/registry-breg/tests/external_views.rs @@ -102,6 +102,32 @@ fn external_views_are_compiled_separately_from_owned_fields_and_permissions() { .is_some()); } +#[test] +fn both_external_projection_modes_require_explicit_readable_fields() { + let indexed = PROJECT.to_owned(); + let live = PROJECT + .replace("mode: indexed", "mode: live") + .replace(" cacheTtlSeconds: 600\n", "") + .replace(" filterableFields: [label]\n", ""); + for source in [indexed, live] { + compile(&source).expect("an explicit external field list compiles"); + let ceiling = source.replace( + "readableFields: [label]", + "readableFields: {upToClassification: internal}", + ); + let error = + parse_project_yaml(ceiling.as_bytes()).expect_err("external ceiling is refused"); + assert!( + error.diagnostics().iter().any(|diagnostic| { + diagnostic.code == "config.invalid-type" + && diagnostic.path + == "project.accessProfiles.reader.permissions.externalViews[0].links[0].readableFields" + }), + "{error:?}" + ); + } +} + #[test] fn query_grant_cannot_use_a_hidden_external_field() { rejects( diff --git a/crates/registry-breg/tests/package_change_plan.rs b/crates/registry-breg/tests/package_change_plan.rs index dc9f3ab060..2be5fc3237 100644 --- a/crates/registry-breg/tests/package_change_plan.rs +++ b/crates/registry-breg/tests/package_change_plan.rs @@ -96,6 +96,185 @@ fn geojson_binding_changes_are_classified_as_disclosure_even_for_get_only_profil } } +#[cfg(feature = "tooling")] +#[test] +fn stored_field_ceiling_widens_compiled_access_on_successor_field_changes() { + use registry_breg::tooling::{ + classify_registry_diff, AccessChangeDirection, DiffClassification, + }; + + let source = json!({ + "apiVersion":"id.registrystack.org/formats/breg/project/v1alpha1", + "kind":"BRegProject", + "project":{"id":"ceiling-change", "version":"1", "defaultLanguage":"en", + "canonicalBaseIri":"https://ceiling.example.test"}, + "datasets":{"records":{}}, + "recordTypes":{"record":{ + "primaryDataset":"records","route":"records", + "mutationMode":"mutable","classification":"internal", + "fields":[{"id":"label","type":"string","maximumLength":64,"classification":"internal"}] + }}, + "accessProfiles":{"reader":{ + "principalClaim":"sub","requiredScopes":["records:read"], + "permissions":{"records":[{ + "recordType":"record","operations":["get"],"rowBoundaries":"unrestricted", + "readableFields":{"upToClassification":"internal"} + }]} + }} + }); + let compile = |value: &serde_json::Value| { + let project = parse_project_json(&serde_json::to_vec(value).unwrap()).unwrap(); + compile_project(&project, &[], CompileProfile::Authoring).unwrap() + }; + let mut restricted = source.clone(); + restricted["recordTypes"]["record"]["fields"] + .as_array_mut() + .unwrap() + .push( + json!({"id":"note","type":"string","maximumLength":64,"classification":"restricted"}), + ); + let mut included = restricted.clone(); + included["recordTypes"]["record"]["fields"][1]["classification"] = json!("internal"); + let candidate = compile(&included); + for predecessor in [source, restricted] { + assert_eq!(predecessor["accessProfiles"], included["accessProfiles"]); + let previous = compile(&predecessor); + assert!(!previous.entities()["record"].access_profiles["reader"] + .readable_fields + .contains("note")); + assert!(candidate.entities()["record"].access_profiles["reader"] + .readable_fields + .contains("note")); + let diff = classify_registry_diff(&previous, &candidate, PRIOR_REVISION); + let change = diff + .changes + .iter() + .find(|change| change.change.code == CompiledRegistryChangeCode::AccessProfileChanged) + .expect("the unchanged authored ceiling widens the compiled grant"); + assert_eq!( + change.classification, + DiffClassification::DisclosureWidening + ); + assert_eq!( + change.change.target.record_type_id.as_deref(), + Some("record") + ); + assert_eq!(change.change.target.member_id.as_deref(), Some("reader")); + let detail = change + .access_details + .iter() + .find(|detail| detail.field == "readableFields") + .expect("the report identifies the field grant that widens"); + assert_eq!(detail.direction, AccessChangeDirection::Widening); + assert_eq!(detail.before, json!(["label"])); + assert_eq!(detail.after, json!(["label", "note"])); + } +} + +#[cfg(feature = "tooling")] +#[test] +fn a_widened_list_or_read_path_ceiling_requires_review_before_apply() { + use serde_json::Value; + + let fixture = json!({ + "apiVersion":"id.registrystack.org/formats/breg/project/v1alpha1", + "kind":"BRegProject", + "project":{"id":"ceiling-change", "version":"1", "defaultLanguage":"en", + "canonicalBaseIri":"https://ceiling.example.test"}, + "package":{"sourceRevision":SOURCE_REVISION}, + "datasets":{"records":{}}, + "recordTypes":{ + "record":{"primaryDataset":"records","route":"records","mutationMode":"mutable", + "fields":[{"id":"label","type":"string","maximumLength":64,"classification":"internal"}]}, + "target":{"primaryDataset":"records","route":"targets","mutationMode":"mutable", + "fields":[{"id":"label","type":"string","maximumLength":64,"classification":"internal"}]}, + "link":{"primaryDataset":"records","route":"links","mutationMode":"mutable","fields":[ + {"id":"record","type":"reference","target":"record","classification":"internal"}, + {"id":"target","type":"reference","target":"target","classification":"internal"} + ]} + }, + "accessProfiles":{"reader":{ + "principalClaim":"sub","requiredScopes":["records:read"], + "permissions":{"records":[{ + "recordType":"record","operations":["get"],"rowBoundaries":"unrestricted", + "readableFields":["label"] + }]} + }} + }); + let compile = |value: &Value| { + let project = parse_project_json(&serde_json::to_vec(value).unwrap()).unwrap(); + compile_project(&project, &[], CompileProfile::Production).unwrap() + }; + for (record, query) in [ + ("record", "records.record.reader.list"), + ("target", "records.record.reader.path.targets"), + ] { + let mut before = fixture.clone(); + let ceiling = json!({"upToClassification": "internal"}); + if record == "record" { + let grant = &mut before["accessProfiles"]["reader"]["permissions"]["records"][0]; + grant["operations"] = json!(["get", "list"]); + grant["readableFields"] = ceiling; + } else { + before["recordTypes"]["record"]["readPaths"] = + json!([{"id":"targets","route":"targets","through":"link","to":"target"}]); + before["accessProfiles"]["reader"]["permissions"]["records"][0]["readPaths"] = + json!([{"path":"targets","readableFields":ceiling}]); + } + let mut after = before.clone(); + after["recordTypes"][record]["fields"] + .as_array_mut() + .unwrap() + .push( + json!({"id":"note","type":"string","maximumLength":64,"classification":"internal"}), + ); + let previous = compile(&before); + let candidate = compile(&after); + let mut explicit = after.clone(); + let pointers = "/accessProfiles/reader/permissions/records/0"; + let readable_fields = if record == "record" { + format!("{pointers}/readableFields") + } else { + format!("{pointers}/readPaths/0/readableFields") + }; + *explicit.pointer_mut(&readable_fields).unwrap() = json!(["label"]); + let explicit = compile(&explicit); + let control = compiled_registry_change_set(&previous, &explicit, PRIOR_REVISION); + assert!( + change_set_to_applicable_migration_plan(&control).is_ok(), + "the same new field stays automatic when an explicit grant leaves the query unchanged: {query}" + ); + let change_set = compiled_registry_change_set(&previous, &candidate, PRIOR_REVISION); + assert!( + change_set.changes.iter().any(|change| { + change.code == CompiledRegistryChangeCode::QueryInventoryChanged + && change.target.member_id.as_deref() == Some(query) + }), + "the existing query projection changes for {query}" + ); + assert_eq!( + change_set_to_applicable_migration_plan(&change_set), + Err(PackageError::MigrationPlan), + "an automatic apply plan must refuse this change for {query}" + ); + + let mut request = build_request( + Some(PRIOR_REVISION), + serde_json::to_vec(&after).unwrap(), + Vec::new(), + PackageMigrationPlanInput::Successor { + prior_registry: Box::new(previous), + }, + ); + request.modules.clear(); + assert_eq!( + prepare_package(request).unwrap_err(), + PackageError::MigrationPlan, + "a package suitable for apply needs a reviewed migration for {query}" + ); + } +} + #[cfg(feature = "tooling")] #[test] fn geojson_only_successor_uses_existing_metadata_review_without_dummy_sql() { diff --git a/crates/registry-breg/tests/postgres_client_relationships.rs b/crates/registry-breg/tests/postgres_client_relationships.rs index e07e559127..53fe6690cb 100644 --- a/crates/registry-breg/tests/postgres_client_relationships.rs +++ b/crates/registry-breg/tests/postgres_client_relationships.rs @@ -105,6 +105,50 @@ async fn sdk_relationship_continuation_keeps_source_path_authority_and_target_pr .iter() .all(|record| !record.domain_data.contains_key("personCode"))); + let openapi: Value = serde_json::from_slice( + &fixture + .registry + .artifacts() + .get("generated/openapi.json") + .unwrap() + .bytes, + ) + .unwrap(); + let selectable = openapi["paths"]["/v1/records/households/{record_id}/people"]["get"] + ["x-registry-queryProfiles"]["operator"]["selectableProperties"] + .as_array() + .unwrap() + .iter() + .map(|field| field.as_str().unwrap()) + .collect::>(); + assert_eq!(selectable, BTreeSet::from(["personCode"])); + let default_page = client + .list_relationship_records( + "households", + &household.value.data.record_id, + "people", + &BRegRelationshipListRequest::default().options( + BRegRecordOptions::default() + .access_profile("operator") + .unwrap(), + ), + ) + .await + .unwrap(); + let mut default_ids = BTreeSet::new(); + for record in default_page.value.value.items { + assert!(default_ids.insert(record.record_id)); + assert_eq!( + record + .domain_data + .keys() + .map(String::as_str) + .collect::>(), + selectable, + ); + } + assert_eq!(default_ids, linked_ids); + let request = BRegRelationshipListRequest::default() .options( BRegRecordOptions::default() @@ -168,6 +212,16 @@ async fn sdk_relationship_continuation_keeps_source_path_authority_and_target_pr } assert_eq!(seen, linked_ids); assert!(!seen.contains(&unlinked.value.data.record_id)); + let refused = client + .list_relationship_records( + "households", + &household.value.data.record_id, + "people", + &relationship_request("operator", "sensitiveNote"), + ) + .await + .expect_err("an explicit select cannot exceed the path's classification ceiling"); + assert_eq!(refused.status(), Some(400)); fixture.finish().await; } @@ -399,7 +453,7 @@ fn compiled_registry() -> registry_breg::CompiledRegistry { }, "person": {"primaryDataset":"test-dataset","route":"people","mutationMode":"mutable","classification":"restricted", "fields":[ - {"id":"person-code","type":"string","required":true,"maximumLength":64,"classification":"restricted"}, + {"id":"person-code","type":"string","required":true,"maximumLength":64,"classification":"internal"}, {"id":"sensitive-note","type":"string","required":true,"maximumLength":64,"classification":"restricted"} ] } @@ -411,7 +465,7 @@ fn compiled_registry() -> registry_breg::CompiledRegistry { { "recordType":"household","rowBoundaries":"unrestricted","operations":["create","get","list"], "readableFields":["household-code"],"writableFields":["household-code"], - "readPaths":[{"path":"people","readableFields":["person-code"],"sortableFields":["person-code"],"allowCount":true}] + "readPaths":[{"path":"people","readableFields":{"upToClassification":"internal"},"sortableFields":["person-code"],"allowCount":true}] }, {"recordType":"membership","rowBoundaries":"unrestricted","operations":["create"],"readableFields":["household","person"],"writableFields":["household","person"]}, { diff --git a/docs/site/src/content/docs/configure/breg-access.mdx b/docs/site/src/content/docs/configure/breg-access.mdx index e24d3a7e6a..fefeb9de0f 100644 --- a/docs/site/src/content/docs/configure/breg-access.mdx +++ b/docs/site/src/content/docs/configure/breg-access.mdx @@ -114,6 +114,17 @@ response discloses and `writableFields` what a create or patch may set; `filtera `sortableFields`, and `allowCount` each enable one query feature. Field lists use the field `id`, not its `apiName`. A write never reveals a field the profile cannot read. +For stored fields, you can write `readableFields: {upToClassification: internal}`. +BReg includes fields whose classification is at or below your ceiling. +On a read path, the ceiling applies to stored fields of the target Record type. +Name derived fields and external view fields in explicit lists. +For a permission with `requireConsent`, list the direct and read-path fields explicitly. +Review the resulting grants when you [apply a successor package](../../operate/breg-changes/#compare-the-candidate-with-the-active-package). + +{/* Evidence: crates/registry-breg/src/contract/readable_fields.rs, ReadableFieldsCeiling; + crates/registry-breg/src/compiler.rs, resolve_readable_fields(); + crates/registry-breg/tests/postgres_client_relationships.rs, sdk_relationship_continuation_keeps_source_path_authority_and_target_projection. */} + A [row boundary](../../reference/glossary/#row-boundary) compares a Record field with a token claim. `equals` compares with one scalar claim value. `in` requires a claim whose value is a JSON array; in a development plan, write the array as a YAML sequence under `claims.breg`. diff --git a/docs/site/src/content/docs/configure/breg-consent.mdx b/docs/site/src/content/docs/configure/breg-consent.mdx index 660cf8248a..5d401e0004 100644 --- a/docs/site/src/content/docs/configure/breg-consent.mdx +++ b/docs/site/src/content/docs/configure/breg-consent.mdx @@ -340,6 +340,7 @@ Enforced, and refused at compilation where the shape is configuration: - Gated Record permissions are read-only (`breg.consent.require-read-only`). Writes, Actions, and Proposal lifecycle operations require separate authority. A gated profile may grant `get-review-context`: Record and Changes projections still apply current ordinary disclosure and consent to each snapshot, while Input projections require their own explicit context-field grant. +- Each gated permission needs explicit `readableFields` lists for its direct reads and read paths (`breg.consent.readable-fields-explicit-required`). - Spatial bbox queries are refused on gated permissions (`breg.consent.require-spatial-unsupported`), because they run under a separate database authority role that cannot evaluate consent. - Bulk data export is refused (`breg.consent.require-export-unsupported`), and so is exporting a gated profile as an Evidence source (`breg.consent.require-evidence-source-unsupported`). - A read path cannot reach a gated Record type through an intermediate or target step (`breg.consent.require-read-path-target`). @@ -367,6 +368,7 @@ Not enforced: The self Actions answer an unknown subject exactly like a subject the caller's link does not cover, so a self Action is not an existence oracle. {/* Evidence: crates/registry-breg/tests/consent_access.rs gated_permissions_are_read_only; + crates/registry-breg/tests/consent_access.rs a_consent_scope_requires_explicit_fields_on_direct_reads_and_read_paths; crates/registry-breg/tests/consent_access.rs gated_permissions_refuse_spatial_queries; crates/registry-breg/tests/consent_access.rs gated_permissions_refuse_data_export; crates/registry-breg/tests/consent_access.rs breg.consent.require-read-path-target; diff --git a/docs/site/src/content/docs/operate/breg-changes.mdx b/docs/site/src/content/docs/operate/breg-changes.mdx index 554b8f4952..a7f812fbb7 100644 --- a/docs/site/src/content/docs/operate/breg-changes.mdx +++ b/docs/site/src/content/docs/operate/breg-changes.mdx @@ -122,6 +122,18 @@ credentials; the report says `integrity-only`. Pass `--runtime-config` instead t the package the database has activated. For an access change the diff also marks each detail as `widening`, `narrowing`, or `review-required`. +When a permission uses `readableFields.upToClassification`, compare its compiled grant in both packages. +The compiler includes newly eligible stored fields in the successor grant. +A field addition or a lower classification can make a field eligible. +The diff lists a widened direct field grant as `widening` and a changed read path as `review-required`. +If the ceiling changes an existing list or read-path query's projection, prepare a reviewed migration before applying the successor. +The holder of the migration credential reviews the changed access before applying the successor. + +{/* Evidence: crates/registry-breg/src/compiler.rs, resolve_readable_fields(); + crates/registry-breg/src/tooling.rs, classify_registry_diff(); + crates/registry-breg/tests/package_change_plan.rs, stored_field_ceiling_widens_compiled_access_on_successor_field_changes, + a_widened_list_or_read_path_ceiling_requires_review_before_apply. */} + Removing a field or a Record type is not erasure. The successor drops the live column or table, but every earlier revision snapshot and every backup still holds the removed values, and the diff warns with `diff.history.removed-values-retained`. When the removal is for data minimisation, also diff --git a/docs/site/src/content/docs/security/breg.mdx b/docs/site/src/content/docs/security/breg.mdx index 898775d3f2..db85899f9b 100644 --- a/docs/site/src/content/docs/security/breg.mdx +++ b/docs/site/src/content/docs/security/breg.mdx @@ -862,6 +862,19 @@ and its ancestors. Deny other write access in every posture and group write acce If data subjects must see Proposal review reads and attachment downloads, cover them in your own audit, because they write no subject-log entry. +23. Review compiled classification ceilings before applying a successor. + BReg resolves the ceiling to stored Record fields at package compilation and applies the usual disclosure checks. + As the migration credential holder, compare the effective fields of each affected direct grant and read path. + Additions and reclassification can widen the grant under the same authored ceiling. + Revisions use the current grant, so lowering a classification can expose earlier values to a profile with history access. + For each permission with `requireConsent`, list the direct and path fields explicitly. + [Compare the candidate with the active package](../../operate/breg-changes/#compare-the-candidate-with-the-active-package). + {/* Evidence: crates/registry-breg/src/compiler.rs, resolve_readable_fields(), consent_ceiling_refusal(); + crates/registry-breg/src/postgres/history_read.rs, readable_fields; + crates/registry-breg/tests/disclosure/fields.rs, stored_field_classification_ceiling_limits_the_served_profile; + crates/registry-breg/tests/consent_access.rs, a_consent_scope_requires_explicit_fields_on_direct_reads_and_read_paths; + crates/registry-breg/tests/package_change_plan.rs, stored_field_ceiling_widens_compiled_access_on_successor_field_changes. */} + ## Accepted residuals The residuals are ordered by operator impact. @@ -913,7 +926,7 @@ Each lists the condition, the consequence, the mitigation, and the related matri A database restored to an earlier activation names that activation's package as active, so the successor applied after it applies again; it is the same transition. - Mitigation: guard the migration credential, pin `--expected-digest`, and check release provenance - in the deploy step. + in the deploy step. Review effective field changes under classification ceilings (obligation 23). - Related: `BREG-SEC-02`, `BREG-SEC-120`, `BREG-SEC-121`. {/* Evidence: crates/registry-breg/tests/postgres_package.rs, diff --git a/products/breg/CHANGELOG.md b/products/breg/CHANGELOG.md index 5f688e05c8..dcedadc563 100644 --- a/products/breg/CHANGELOG.md +++ b/products/breg/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +- Record and read-path permissions can select stored fields with + `readableFields.upToClassification`. Consent-gated permissions require + explicit fields. + ## 0.49.0 - 2026-12-01 - BREAKING: `bregctl data export` JSONL uses `recordId` and `revisionId` in place of v0.48.0's `recordIdentifier` and `revisionIdentifier`. Migration: Update export file consumers for both keys. Finish an in-progress export with the matching v0.48.0 `bregctl`, serving runtime, and compiled package before upgrading, or start a fresh output and checkpoint pair after upgrading. Convert archived exports on a separate copy to preserve any checkpoint digest. diff --git a/products/breg/contracts/security-invariant-matrix.yaml b/products/breg/contracts/security-invariant-matrix.yaml index 7c25b6c224..f2fcaf4178 100644 --- a/products/breg/contracts/security-invariant-matrix.yaml +++ b/products/breg/contracts/security-invariant-matrix.yaml @@ -261,3 +261,4 @@ invariants: - {"id":"BREG-SEC-242","state":"enforced","targetWave":"W4","threat":"A claim, ask or decide preflight discloses answers and audits a disclosure nobody displayed.","enforcementPoint":"Single review-context read includes intrinsic answers only with include=answers and existing human review authority.","refusal":"Omit asks and their disclosure marker on preflight; audit actual displayed answers.","negativeId":"BREG-NEG-242","negativeTest":{"path":"crates/registry-breg/tests/support/proposal_review_asks_final.rs","name":"only_an_explicit_display_read_serves_and_audits_intrinsic_answers"}} - {"id":"BREG-SEC-243","state":"enforced","targetWave":"W4","threat":"Pruning value-free dedupe receipts causes a cursor reset to fetch or duplicate a retained ask.","enforcementPoint":"Maintenance uses the observation recovery window; feed processing checks the stored mirror before network I/O.","refusal":"Prune exact bounded receipt counts while preserving mirrored questions and answers and skipping stored observations.","negativeId":"BREG-NEG-243","negativeTest":{"path":"crates/registry-breg/tests/support/proposal_review_asks_final.rs","name":"pruning_a_receipt_then_resetting_the_cursor_never_refetches_or_duplicates_its_stored_ask"}} - {id: BREG-SEC-244, state: enforced, targetWave: W5, threat: "A signed hook is sent in plaintext to a non-loopback destination.", enforcementPoint: "BReg networkProfile decoding and shared destination policy construction before key resolution.", refusal: "Refuse non-loopback HTTP in both postures, including when the origin falls within allowedPrivateCidrs.", negativeId: BREG-NEG-244, negativeTest: {path: crates/registry-breg/tests/runtime_config.rs, name: event_destinations_refuse_non_loopback_plaintext_in_both_postures}} + - {id: BREG-SEC-245, state: enforced, targetWave: W5, threat: "A field addition or reclassification widens a gated permission under the same consent scope.", enforcementPoint: "The compiler checks direct and read-path readableFields on every composed permission with requireConsent.", refusal: "Refuse a classification ceiling with breg.consent.readable-fields-explicit-required. Require explicit field lists on the gated permission.", negativeId: BREG-NEG-245, negativeTest: {path: crates/registry-breg/tests/consent_access.rs, name: a_consent_scope_requires_explicit_fields_on_direct_reads_and_read_paths}} diff --git a/products/breg/contracts/security-test-traceability.yaml b/products/breg/contracts/security-test-traceability.yaml index 93605c4fa7..e30f32be5a 100644 --- a/products/breg/contracts/security-test-traceability.yaml +++ b/products/breg/contracts/security-test-traceability.yaml @@ -302,3 +302,4 @@ traceability: - {"id":"BREG-SEC-242","state":"enforced","negativeId":"BREG-NEG-242","negativeTest":{"path":"crates/registry-breg/tests/support/proposal_review_asks_final.rs","name":"only_an_explicit_display_read_serves_and_audits_intrinsic_answers"}} - {"id":"BREG-SEC-243","state":"enforced","negativeId":"BREG-NEG-243","negativeTest":{"path":"crates/registry-breg/tests/support/proposal_review_asks_final.rs","name":"pruning_a_receipt_then_resetting_the_cursor_never_refetches_or_duplicates_its_stored_ask"}} - {id: BREG-SEC-244, state: enforced, negativeId: BREG-NEG-244, negativeTest: {path: crates/registry-breg/tests/runtime_config.rs, name: event_destinations_refuse_non_loopback_plaintext_in_both_postures}} + - {id: BREG-SEC-245, state: enforced, negativeId: BREG-NEG-245, negativeTest: {path: crates/registry-breg/tests/consent_access.rs, name: a_consent_scope_requires_explicit_fields_on_direct_reads_and_read_paths}} diff --git a/products/breg/generated/authoring/registry-module.schema.json b/products/breg/generated/authoring/registry-module.schema.json index 49c574bb84..2ae04de68e 100644 --- a/products/breg/generated/authoring/registry-module.schema.json +++ b/products/breg/generated/authoring/registry-module.schema.json @@ -3421,12 +3421,8 @@ "type": "string" }, "readableFields": { - "default": [], - "items": { - "type": "string" - }, - "type": "array", - "uniqueItems": true + "$ref": "#/$defs/ReadableFields", + "default": [] }, "sortableFields": { "default": [], @@ -3466,6 +3462,34 @@ ], "type": "object" }, + "ReadableFields": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array", + "uniqueItems": true + }, + { + "$ref": "#/$defs/ReadableFieldsCeiling" + } + ], + "description": "An explicit field list or an inclusive ceiling on stored field classification." + }, + "ReadableFieldsCeiling": { + "additionalProperties": false, + "description": "Include stored fields classified at or below this level.", + "properties": { + "upToClassification": { + "$ref": "#/$defs/Classification" + } + }, + "required": [ + "upToClassification" + ], + "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.", @@ -4538,12 +4562,8 @@ "uniqueItems": true }, "readableFields": { - "default": [], - "items": { - "type": "string" - }, - "type": "array", - "uniqueItems": true + "$ref": "#/$defs/ReadableFields", + "default": [] }, "requesterClients": { "description": "The OAuth clients whose tokens may select this profile. Omit to accept every client.", @@ -4844,12 +4864,8 @@ "uniqueItems": true }, "readableFields": { - "default": [], - "items": { - "type": "string" - }, - "type": "array", - "uniqueItems": true + "$ref": "#/$defs/ReadableFields", + "default": [] }, "requesterClients": { "description": "The OAuth clients whose tokens may select this profile. Omit to accept every client.", diff --git a/products/breg/generated/authoring/registry-project.schema.json b/products/breg/generated/authoring/registry-project.schema.json index 1357ab5c4f..d660e07e08 100644 --- a/products/breg/generated/authoring/registry-project.schema.json +++ b/products/breg/generated/authoring/registry-project.schema.json @@ -2349,12 +2349,8 @@ "uniqueItems": true }, "readableFields": { - "default": [], - "items": { - "type": "string" - }, - "type": "array", - "uniqueItems": true + "$ref": "#/$defs/ReadableFields", + "default": [] }, "recordType": { "type": "string" @@ -4493,12 +4489,8 @@ "type": "string" }, "readableFields": { - "default": [], - "items": { - "type": "string" - }, - "type": "array", - "uniqueItems": true + "$ref": "#/$defs/ReadableFields", + "default": [] }, "sortableFields": { "default": [], @@ -4538,6 +4530,34 @@ ], "type": "object" }, + "ReadableFields": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array", + "uniqueItems": true + }, + { + "$ref": "#/$defs/ReadableFieldsCeiling" + } + ], + "description": "An explicit field list or an inclusive ceiling on stored field classification." + }, + "ReadableFieldsCeiling": { + "additionalProperties": false, + "description": "Include stored fields classified at or below this level.", + "properties": { + "upToClassification": { + "$ref": "#/$defs/Classification" + } + }, + "required": [ + "upToClassification" + ], + "type": "object" + }, "RecipientGroupSource": { "additionalProperties": false, "description": "A frozen, named list of declared organizations. Groups do not nest.", @@ -6451,12 +6471,8 @@ "uniqueItems": true }, "readableFields": { - "default": [], - "items": { - "type": "string" - }, - "type": "array", - "uniqueItems": true + "$ref": "#/$defs/ReadableFields", + "default": [] }, "requesterClients": { "description": "The OAuth clients whose tokens may select this profile. Omit to accept every client.", diff --git a/products/breg/scripts/test_validate_product.py b/products/breg/scripts/test_validate_product.py index 7db7fbf2dc..f7610da015 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_and_negative_ids_are_closed(self) -> None: ) extension_rows = matrix["invariants"][24:] self.assertEqual( - [f"BREG-NEG-{index:02d}" for index in range(25, 245) if index not in {61, 62}], + [f"BREG-NEG-{index:02d}" for index in range(25, 246) if index not in {61, 62}], [invariant["negativeId"] for invariant in extension_rows], ) for invariant in extension_rows: diff --git a/products/breg/scripts/validate_product.py b/products/breg/scripts/validate_product.py index c8d8b8949d..0082f48510 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, 245) if index not in {61, 62}) +SECURITY_INVARIANT_IDS = tuple(f"BREG-SEC-{index:02d}" for index in range(1, 246) 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"), From 399222ff092d7e887f3c9d4a281952a16586c714 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 05/55] feat(bregctl): publish the completed identity facts report and its schema Folds these reviewed commits: - test(breg): verify the native role facts writer against compiled grants - feat(bregctl): publish completed identity facts report schema Signed-off-by: Jeremi Joslin --- crates/registry-bregctl/src/check.rs | 1 + crates/registry-bregctl/src/identity_facts.rs | 8 +- crates/registry-bregctl/src/lib.rs | 6 +- crates/registry-bregctl/src/tool_schema.rs | 134 +++++++- .../registry-bregctl/tests/identity_facts.rs | 185 ++++++++++ crates/registry-bregctl/tests/tool_schema.rs | 65 +++- .../formats/identity-facts-report.json | 44 +++ .../tools/ctl-report.v1alpha1.schema.json | 319 ++++++++++++++++++ products/platform/config-formats.yaml | 11 +- 9 files changed, 752 insertions(+), 21 deletions(-) create mode 100644 products/breg/examples/formats/identity-facts-report.json create mode 100644 products/breg/generated/tools/ctl-report.v1alpha1.schema.json diff --git a/crates/registry-bregctl/src/check.rs b/crates/registry-bregctl/src/check.rs index a0386cd661..b7802f0f00 100644 --- a/crates/registry-bregctl/src/check.rs +++ b/crates/registry-bregctl/src/check.rs @@ -100,6 +100,7 @@ pub(super) struct RankedDiagnostic<'a> { } #[derive(Clone, Copy, Serialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[serde(rename_all = "kebab-case")] pub(super) enum FindingRank { WidensAccess, diff --git a/crates/registry-bregctl/src/identity_facts.rs b/crates/registry-bregctl/src/identity_facts.rs index e53df5460b..d359a0f2ad 100644 --- a/crates/registry-bregctl/src/identity_facts.rs +++ b/crates/registry-bregctl/src/identity_facts.rs @@ -565,13 +565,15 @@ fn refuse_unissuable_claim( ))) } -/// Write `facts` to a new file. An existing file is never replaced. -pub(crate) fn write(facts: &IdentityFacts, output: &Path) -> Result<(), FactsError> { +/// Write `facts` to a new file and return the exact YAML written. +/// An existing file is never replaced. +pub(crate) fn write(facts: &IdentityFacts, output: &Path) -> Result { let yaml = facts.to_yaml().map_err(|_| FactsError::Encode)?; let mut file = OpenOptions::new() .write(true) .create_new(true) .open(output) .map_err(FactsError::Write)?; - file.write_all(yaml.as_bytes()).map_err(FactsError::Write) + file.write_all(yaml.as_bytes()).map_err(FactsError::Write)?; + Ok(yaml) } diff --git a/crates/registry-bregctl/src/lib.rs b/crates/registry-bregctl/src/lib.rs index 05cb3335ea..064bcde286 100644 --- a/crates/registry-bregctl/src/lib.rs +++ b/crates/registry-bregctl/src/lib.rs @@ -1965,6 +1965,7 @@ enum ExplainSubject { } #[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Serialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] enum ProfileArg { #[default] @@ -2224,6 +2225,7 @@ where } #[derive(Serialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] struct RankedProjectFinding<'a> { #[serde(flatten)] diagnostic: &'a registry_platform_yaml::Diagnostic, @@ -10035,7 +10037,7 @@ fn generate_identity_facts( ) })?; let facts = stated.facts; - identity_facts::write(&facts, &args.output).map_err(|error| { + let yaml = identity_facts::write(&facts, &args.output).map_err(|error| { fail( error.code(), &error.to_string(), @@ -10057,7 +10059,7 @@ fn generate_identity_facts( artifacts: vec![artifact_report( &args.output.display().to_string(), "application/yaml", - facts.to_yaml().unwrap_or_default().as_bytes(), + yaml.as_bytes(), )], explanation: Some(json!({ "identityFacts": { diff --git a/crates/registry-bregctl/src/tool_schema.rs b/crates/registry-bregctl/src/tool_schema.rs index 46c675b886..32a22191e6 100644 --- a/crates/registry-bregctl/src/tool_schema.rs +++ b/crates/registry-bregctl/src/tool_schema.rs @@ -1,22 +1,34 @@ // SPDX-License-Identifier: Apache-2.0 -//! Generated JSON Schemas for the tool files `bregctl` reads. +//! Generated JSON Schemas for BReg tooling contracts. //! -//! Each schema is derived from the types its reader decodes and published -//! with the header the reader checks before decoding them. The committed -//! copies under `products/breg/generated/tools` come from the `tool-schema` -//! example; `products/breg/scripts/check-tool-schemas.sh` fails when they -//! differ from what the reader types generate. +//! Each schema publishes the version and kind a reader checks along with the +//! members it accepts. The committed copies under `products/breg/generated/tools` +//! come from the `tool-schema` example and are checked by +//! `products/breg/scripts/check-tool-schemas.sh`. use std::collections::BTreeMap; use registry_breg::{fixtures, migration_plan}; -use registry_platform_yaml::{EnvelopeRule, FormatSpec, VersionStatus}; +use registry_platform_config::identity_facts::{MAXIMUM_CLAIMS, MAXIMUM_PROFILES}; +use registry_platform_yaml::{ApiVersion, EnvelopeRule, FormatSpec, VersionStatus}; +use schemars::generate::SchemaSettings; use serde_json::{json, Map, Value}; -use crate::{examples, init_from_model, test_lifecycle}; +use crate::{ + examples, init_from_model, test_lifecycle, ProfileArg, RankedProjectFinding, + CTL_REPORT_API_VERSION, CTL_REPORT_KIND, +}; const SCHEMA_DIALECT: &str = "https://json-schema.org/draft/2020-12/schema"; const SCHEMA_ID_BASE: &str = "https://id.registrystack.org/schemas/"; +const CTL_REPORT_FORMAT: FormatSpec<'static> = FormatSpec { + kind: CTL_REPORT_KIND, + envelope: EnvelopeRule::ApiVersionKind { + api_versions: &[ApiVersion::current(CTL_REPORT_API_VERSION)], + retired_api_versions: &[], + }, + removed_keys: &[], +}; /// One published tool schema. struct Tool { @@ -28,7 +40,7 @@ struct Tool { members: fn() -> schemars::Schema, } -fn tools() -> [Tool; 6] { +fn tools() -> [Tool; 7] { [ Tool { namespace: "breg", @@ -72,9 +84,108 @@ fn tools() -> [Tool; 6] { spec: migration_plan::MIGRATION_DESCRIPTOR_FORMAT, members: migration_plan::migration_descriptor_schema, }, + Tool { + namespace: "breg", + format: "ctl-report", + title: "Completed BReg identity facts command report", + spec: CTL_REPORT_FORMAT, + members: completed_identity_facts_report_schema, + }, ] } +fn completed_identity_facts_report_schema() -> schemars::Schema { + let mut generator = SchemaSettings::draft2020_12() + .for_serialize() + .into_generator(); + let profile = generator.subschema_for::(); + let diagnostic = generator.subschema_for::>(); + let definitions = generator.take_definitions(true); + let mut schema = json!({ + "type": "object", + "additionalProperties": false, + "description": "The completed report from bregctl generate identity-facts. Validation describes the report structure; its artifact metadata does not establish the path or contents of a file.", + "required": ["ok", "command", "status", "version", "profile", "revision", "posture", "diagnostics", "artifacts", "explanation"], + "properties": { + "ok": {"type": "boolean", "const": true}, + "command": {"type": "string", "const": "generate"}, + "status": {"type": "string", "const": registry_cli_report::Status::Complete.as_str()}, + "version": {"type": "string", "minLength": 1}, + "profile": profile, + "revision": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$", "minLength": 71, "maxLength": 71}, + "posture": { + "type": "object", "additionalProperties": false, + "required": ["value", "source"], + "properties": { + "value": {"type": "string", "enum": ["production", "development"]}, + "source": {"type": "string", "enum": ["default", "environment", "flag"]} + } + }, + "diagnostics": {"type": "array", "items": diagnostic}, + "artifacts": { + "type": "array", "minItems": 1, "maxItems": 1, + "items": { + "type": "object", "additionalProperties": false, + "required": ["path", "mediaType", "byteLength", "sha256"], + "properties": { + "path": {"type": "string", "minLength": 1}, + "mediaType": {"type": "string", "const": "application/yaml"}, + "byteLength": {"type": "integer", "minimum": 1, "maximum": registry_platform_yaml::MAXIMUM_DOCUMENT_BYTES}, + "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$", "minLength": 64, "maxLength": 64} + } + } + }, + "explanation": { + "type": "object", "additionalProperties": false, + "required": ["identityFacts"], + "properties": { + "identityFacts": { + "type": "object", "additionalProperties": false, + "required": ["accessProfiles", "claims"], + "properties": { + "accessProfiles": {"type": "integer", "minimum": 0, "maximum": MAXIMUM_PROFILES}, + "claims": {"type": "integer", "minimum": 0, "maximum": MAXIMUM_CLAIMS} + } + } + } + }, + "nextSteps": {"type": "array", "minItems": 1, "items": {"type": "string"}} + }, + "$defs": definitions + }); + close_diagnostic_objects(&mut schema["$defs"]); + // Positioned findings point into a bounded source or runtime document. + // Coordinates start at one and may point just past its last character. + let maximum_coordinate = registry_platform_yaml::MAXIMUM_DOCUMENT_BYTES + 1; + for definition in ["Source", "Related"] { + let properties = &mut schema["$defs"][definition]["properties"]; + for name in ["line", "column"] { + let coordinate = properties + .get_mut(name) + .expect("diagnostic source defines this coordinate"); + coordinate["minimum"] = json!(1); + coordinate["maximum"] = json!(maximum_coordinate); + } + } + schemars::Schema::try_from(schema).expect("the report schema is an object") +} + +/// Saved reports require exact members even for the shared diagnostic types. +fn close_diagnostic_objects(schema: &mut Value) { + match schema { + Value::Object(object) => { + if object.contains_key("properties") { + object.insert("additionalProperties".to_owned(), Value::Bool(false)); + } + for value in object.values_mut() { + close_diagnostic_objects(value); + } + } + Value::Array(values) => values.iter_mut().for_each(close_diagnostic_objects), + _ => {} + } +} + /// Every tool schema under its committed file name, /// `..schema.json`. pub fn documents() -> Result, serde_json::Error> { @@ -112,9 +223,8 @@ fn current_api_version(spec: &FormatSpec<'static>) -> &'static str { } } -/// The reader checks `apiVersion` and `kind` and removes them before it -/// decodes the members, so the derived schema lacks them; the published one -/// requires both, each with the one value this release reads. +/// Require the envelope in the published schema. The member definition covers +/// the body that remains after the reader checks the version and kind. fn with_header(mut derived: Value, api_version: &str, kind: &str) -> Value { let Value::Object(object) = &mut derived else { unreachable!("a reader type derives an object schema") diff --git a/crates/registry-bregctl/tests/identity_facts.rs b/crates/registry-bregctl/tests/identity_facts.rs index 945e5ece46..05ec8c6f38 100644 --- a/crates/registry-bregctl/tests/identity_facts.rs +++ b/crates/registry-bregctl/tests/identity_facts.rs @@ -151,6 +151,191 @@ fn an_existing_output_is_refused_and_left_unchanged() { assert_eq!(std::fs::read_to_string(&output).unwrap(), "keep"); } +#[test] +fn native_inventory_report_matches_the_independently_compiled_external_views_project() { + use std::collections::{BTreeMap, BTreeSet}; + use std::fmt::Write as _; + use std::process::Command; + + use registry_breg::compiler::{compile_project, CompileProfile}; + use registry_breg::contract::parse_project_yaml; + use registry_thunderid_tooling::identity_facts::ClaimType; + use serde_json::{json, Value}; + use sha2::{Digest, Sha256}; + + // The archived witness used a copy of this project. Check the maintained + // source directly so the publisher and witness exercise the same input. + let project = Path::new(env!("CARGO_MANIFEST_DIR")) + .join("../../products/breg/examples/external-views") + .canonicalize() + .unwrap(); + let authored = parse_project_yaml(&std::fs::read(project.join("registry.yaml")).unwrap()) + .expect("the donor is readable"); + let compiled = compile_project(&authored, &[], CompileProfile::Authoring) + .expect("the separate compiler produces the donor inventory"); + let scratch = tempfile::tempdir().unwrap(); + let runtime = runtime(scratch.path()); + edit_runtime( + &runtime, + "allowedClients: [generic-registry-client]", + "allowedClients: [officer, restricted, licensing-refresh, staff-app]", + ); + let first = scratch.path().join("first-facts.yaml"); + let second = scratch.path().join("second-facts.yaml"); + let native = |output: &Path| { + Command::new(env!("CARGO_BIN_EXE_bregctl")) + .args(["--format", "json", "generate", "identity-facts"]) + .arg(&project) + .arg("--runtime-config") + .arg(&runtime) + .arg("--output") + .arg(output) + .env_remove("REGISTRY_STACK_POSTURE") + .output() + .expect("native bregctl starts") + }; + let report = |output: &Path| { + let result = native(output); + assert!(result.status.success(), "native writer refused the fixture"); + assert!(result.stderr.is_empty(), "unexpected native writer stderr"); + let mut report: Value = registry_platform_canonical_json::parse_json_strict(&result.stdout) + .expect("the completed report is unique-member JSON"); + assert_eq!(report["kind"], "BRegCtlReport"); + assert_eq!( + report["apiVersion"], + registry_bregctl::CTL_REPORT_API_VERSION + ); + assert_eq!(report["command"], "generate"); + assert_eq!(report["status"], "complete"); + assert_eq!(report["ok"], true); + assert_eq!(report["revision"], compiled.revision()); + #[cfg(feature = "schema")] + { + let schemas = registry_bregctl::tool_schema::documents().unwrap(); + let schema = serde_json::from_str(&schemas["ctl-report.v1alpha1.schema.json"]) + .expect("generated report schema is JSON"); + let validator = jsonschema::JSONSchema::options() + .with_draft(jsonschema::Draft::Draft202012) + .compile(&schema) + .expect("generated report schema compiles"); + assert!( + validator.is_valid(&report), + "native report violates its schema" + ); + } + let bytes = std::fs::read(output).unwrap(); + let mut digest = String::new(); + for byte in Sha256::digest(&bytes) { + write!(digest, "{byte:02x}").unwrap(); + } + let artifact = &mut report["artifacts"][0]; + assert_eq!( + *artifact, + json!({ + "path": output, + "byteLength": bytes.len(), + "mediaType": "application/yaml", + "sha256": digest, + }) + ); + artifact["path"] = json!("identity-facts.yaml"); + (bytes, report) + }; + let (facts_bytes, first_report) = report(&first); + assert_eq!((facts_bytes.clone(), first_report.clone()), report(&second)); + let facts = read_facts(&first); + assert_eq!( + first_report["explanation"]["identityFacts"], + json!({"accessProfiles": facts.access_profiles.len(), "claims": facts.claims.len()}) + ); + + let mut expected = BTreeMap::new(); + for entity in compiled.entities().values() { + for profile in entity.access_profiles.values() { + let entry = expected.entry(profile.id.as_str()).or_insert_with(|| { + ( + profile.required_scopes.as_set(), + profile.required_purposes.as_set(), + profile.requester_clients.as_set(), + BTreeSet::new(), + ) + }); + entry.3.insert(profile.principal_claim.as_str()); + entry.3.extend( + profile + .row_boundaries + .iter() + .map(|boundary| boundary.claim.as_str()), + ); + } + } + assert_eq!(facts.access_profiles.len(), expected.len()); + for profile in &facts.access_profiles { + let (scopes, purposes, clients, required_claims) = &expected[profile.id.as_str()]; + assert_eq!( + profile.scopes.iter().cloned().collect::>(), + **scopes + ); + assert_eq!( + profile.purposes.iter().cloned().collect::>(), + **purposes + ); + assert_eq!( + profile + .requester_clients + .iter() + .flatten() + .cloned() + .collect::>(), + **clients, + ); + assert_eq!( + profile + .required_claims + .iter() + .map(String::as_str) + .collect::>(), + *required_claims, + ); + } + let authority = registry_breg::authority::authority_inventory(&compiled).unwrap(); + for (name, claim) in authority.direct_claims { + let kind = if claim.multi_value { + ClaimType::StringArray + } else { + ClaimType::String + }; + assert_eq!(facts.claims[&name], kind); + } + + let schema = serde_json::from_str(include_str!( + "../../../products/platform/schemas/identity-facts.schema.json" + )) + .unwrap(); + let validator = jsonschema::JSONSchema::options() + .with_draft(jsonschema::Draft::Draft202012) + .compile(&schema) + .unwrap(); + let facts_value = serde_json::to_value(facts).unwrap(); + assert!(validator.is_valid(&facts_value)); + let mut malformed = facts_value; + malformed["unrecognized"] = json!("synthetic-refusal"); + assert!(!validator.is_valid(&malformed)); + assert!(registry_thunderid_tooling::identity_facts::read( + "malformed", + &serde_json::to_vec(&malformed).unwrap(), + ) + .is_err()); + let refusal = native(&first); + assert_eq!(refusal.status.code(), Some(1)); + let refusal = registry_platform_canonical_json::parse_json_strict(&refusal.stdout).unwrap(); + assert_eq!( + refusal["diagnostics"][0]["code"], + "identity-facts.output-exists" + ); + assert_eq!(std::fs::read(first).unwrap(), facts_bytes); +} + #[test] fn an_unrestricted_runtime_states_unrestricted_admission() { let scratch = tempfile::tempdir().unwrap(); diff --git a/crates/registry-bregctl/tests/tool_schema.rs b/crates/registry-bregctl/tests/tool_schema.rs index 365c9b3737..d4f6bbc454 100644 --- a/crates/registry-bregctl/tests/tool_schema.rs +++ b/crates/registry-bregctl/tests/tool_schema.rs @@ -36,6 +36,10 @@ const EXAMPLES: &[(&str, &str)] = &[ "products/breg/examples/formats/retire-legacy-field-binding.json", ), ("migration-descriptor.v1alpha1.schema.json", DESCRIPTOR), + ( + "ctl-report.v1alpha1.schema.json", + "products/breg/examples/formats/identity-facts-report.json", + ), ]; const DESCRIPTOR: &str = "products/breg/examples/formats/reviewed-migrations/modules/asset-site-placement-core/migrations/read-maintenance-note/descriptor.json"; @@ -79,6 +83,64 @@ fn every_committed_example_satisfies_its_generated_schema() { } } +#[test] +fn identity_facts_report_schema_refuses_other_reports_and_undeclared_members() { + let documents = documents().expect("the tool schemas generate"); + let schema = compile(&documents["ctl-report.v1alpha1.schema.json"]); + let valid = example("products/breg/examples/formats/identity-facts-report.json"); + for (path, refused) in [ + ("/kind", json!("PlatformIdentityFacts")), + ("/command", json!("check")), + ("/status", json!("domain-refusal")), + ("/ok", json!(false)), + ("/artifacts", json!([])), + ("/artifacts/0/byteLength", json!(-1)), + ("/artifacts/0/sha256", json!("unexpected")), + ("/explanation/identityFacts/accessProfiles", json!("3")), + ("/explanation/identityFacts/accessProfiles", json!(65)), + ( + "/diagnostics/0/source", + json!({"file": "registry.yaml", "extra": true}), + ), + ] { + let mut changed = valid.clone(); + *changed + .pointer_mut(path) + .expect("member is present in fixture") = refused; + assert!(!schema.is_valid(&changed), "accepted a change at {path}"); + } + let mut extra = valid.clone(); + extra["explanation"]["identityFacts"]["unrecognised"] = json!(true); + assert!(!schema.is_valid(&extra)); + let mut missing = valid; + missing.as_object_mut().unwrap().remove("explanation"); + assert!(!schema.is_valid(&missing)); +} + +#[test] +fn identity_facts_report_schema_bounds_document_coordinates() { + let documents = documents().expect("the tool schemas generate"); + let schema = compile(&documents["ctl-report.v1alpha1.schema.json"]); + let mut report = example("products/breg/examples/formats/identity-facts-report.json"); + report["diagnostics"][0]["related"] = json!([{ + "file": "registry.yaml", "path": "", "message": "Check the project", "line": 1, "column": 1 + }]); + let maximum = registry_platform_yaml::MAXIMUM_DOCUMENT_BYTES + 1; + for path in [ + "/diagnostics/0/source/line", + "/diagnostics/0/source/column", + "/diagnostics/0/related/0/line", + "/diagnostics/0/related/0/column", + ] { + for (coordinate, admitted) in [(0, false), (1, true), (maximum, true), (maximum + 1, false)] + { + let mut changed = report.clone(); + *changed.pointer_mut(path).expect("coordinate exists") = json!(coordinate); + assert_eq!(schema.is_valid(&changed), admitted, "{path}: {coordinate}"); + } + } +} + #[test] fn example_scenario_schema_uses_bounded_display_text() { let documents = documents().expect("the tool schemas generate"); @@ -382,8 +444,9 @@ fn a_wrong_header_a_missing_header_and_an_explicit_null_are_refused() { } /// The identifiers the catalog records, in file-name order. -const IDENTIFIERS: [&str; 6] = [ +const IDENTIFIERS: [&str; 7] = [ "https://id.registrystack.org/schemas/breg/backup-binding/backup-binding.v1alpha1.schema.json", + "https://id.registrystack.org/schemas/breg/ctl-report/ctl-report.v1alpha1.schema.json", "https://id.registrystack.org/schemas/breg/example-scenarios/example-scenarios.v1alpha1.schema.json", "https://id.registrystack.org/schemas/breg/journeys/journeys.v1.schema.json", "https://id.registrystack.org/schemas/breg/migration-descriptor/migration-descriptor.v1alpha1.schema.json", diff --git a/products/breg/examples/formats/identity-facts-report.json b/products/breg/examples/formats/identity-facts-report.json new file mode 100644 index 0000000000..d9dd14156c --- /dev/null +++ b/products/breg/examples/formats/identity-facts-report.json @@ -0,0 +1,44 @@ +{ + "ok": true, + "command": "generate", + "status": "complete", + "apiVersion": "id.registrystack.org/formats/breg/ctl-report/v1alpha1", + "kind": "BRegCtlReport", + "version": "0.49.0", + "artifacts": [ + { + "byteLength": 802, + "mediaType": "application/yaml", + "path": "identity-facts.yaml", + "sha256": "d6061ec53e023e24401cbff448cfea3f900c78747956ec97265b6b3da64a4f62" + } + ], + "explanation": { + "identityFacts": { + "accessProfiles": 3, + "claims": 4 + } + }, + "profile": "authoring", + "revision": "sha256:a850cc821c54ce783ab57c4d271edb7e8f8d2fc16fc8dca172bc6320f137a385", + "posture": { + "value": "production", + "source": "default" + }, + "diagnostics": [ + { + "artifact": "BRegModule", + "code": "breg.record-type.stored-field-unfillable", + "message": "this optional stored field has no writable access grant, fixed Action set, function-plan write, or import that can supply a value; add the field to one of those writers, or remove the field", + "path": "/extendRecordTypes/record/fields/0", + "rank": "hygiene", + "severity": "warning", + "source": { + "column": 9, + "file": "modules/record-notes/module.yaml", + "line": 19 + }, + "suggestedAction": "Add the field to a grant's writableFields, a fixed Action set, a function plan write, or an import permission, or remove the field." + } + ] +} diff --git a/products/breg/generated/tools/ctl-report.v1alpha1.schema.json b/products/breg/generated/tools/ctl-report.v1alpha1.schema.json new file mode 100644 index 0000000000..5642d5ce12 --- /dev/null +++ b/products/breg/generated/tools/ctl-report.v1alpha1.schema.json @@ -0,0 +1,319 @@ +{ + "$defs": { + "CheckScope": { + "additionalProperties": false, + "description": "A source file relative to the project and the resource path a check reports.", + "properties": { + "file": { + "minLength": 1, + "type": "string" + }, + "path": { + "description": "A pointer whose list positions use existing unique identifiers when available.", + "type": "string" + } + }, + "required": [ + "file", + "path" + ], + "type": "object" + }, + "FindingRank": { + "enum": [ + "widens-access", + "performance", + "hygiene" + ], + "type": "string" + }, + "ProfileArg": { + "enum": [ + "authoring", + "production" + ], + "type": "string" + }, + "RankedProjectFinding": { + "additionalProperties": false, + "description": "One problem, in the shape every checking command reports (CFG-DIAG-1).\n\nMessages name keys, paths, accepted values, bounds, and the expected\nenvelope without repeating rejected scalar values (CFG-SEC-3). Warning\nacceptance metadata separately identifies the resource and carries the\nproject's deliberately authored reason.", + "properties": { + "acceptedReason": { + "description": "The project's reason for accepting this advisory warning.", + "type": "string" + }, + "artifact": { + "description": "The document's `kind`, or the expected kind when the document's own is\nabsent or wrong and the reader expected exactly one.", + "type": "string" + }, + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "path": { + "description": "RFC 6901 JSON pointer into the document as written; `\"\"` is the root.", + "type": "string" + }, + "rank": { + "$ref": "#/$defs/FindingRank" + }, + "related": { + "items": { + "$ref": "#/$defs/Related" + }, + "type": "array" + }, + "scope": { + "$ref": "#/$defs/CheckScope", + "description": "Project-relative identity copied into a check acceptance." + }, + "severity": { + "$ref": "#/$defs/Severity" + }, + "source": { + "$ref": "#/$defs/Source" + }, + "suggestedAction": { + "type": "string" + } + }, + "required": [ + "severity", + "code", + "path", + "message", + "suggestedAction", + "rank" + ], + "type": "object" + }, + "Related": { + "additionalProperties": false, + "description": "A second place that explains a diagnostic, such as the first occurrence\nof a duplicate. Human output prints it as a `note:` line.", + "properties": { + "column": { + "format": "uint", + "maximum": 1048577, + "minimum": 1, + "type": "integer" + }, + "file": { + "type": "string" + }, + "line": { + "format": "uint", + "maximum": 1048577, + "minimum": 1, + "type": "integer" + }, + "message": { + "type": "string" + }, + "path": { + "type": "string" + } + }, + "required": [ + "file", + "path", + "message" + ], + "type": "object" + }, + "Severity": { + "description": "Whether a diagnostic refuses the input.", + "enum": [ + "error", + "warning" + ], + "type": "string" + }, + "Source": { + "additionalProperties": false, + "description": "Where a diagnostic points. `file` is the path exactly as the caller gave\nit; `line` and `column` are 1-based and absent when the problem concerns\nthe file as a whole.", + "properties": { + "column": { + "format": "uint", + "maximum": 1048577, + "minimum": 1, + "type": "integer" + }, + "file": { + "type": "string" + }, + "line": { + "format": "uint", + "maximum": 1048577, + "minimum": 1, + "type": "integer" + } + }, + "required": [ + "file" + ], + "type": "object" + } + }, + "$id": "https://id.registrystack.org/schemas/breg/ctl-report/ctl-report.v1alpha1.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "The completed report from bregctl generate identity-facts. Validation describes the report structure; its artifact metadata does not establish the path or contents of a file.", + "properties": { + "apiVersion": { + "const": "id.registrystack.org/formats/breg/ctl-report/v1alpha1", + "description": "The format and version this file is written in.", + "type": "string" + }, + "artifacts": { + "items": { + "additionalProperties": false, + "properties": { + "byteLength": { + "maximum": 1048576, + "minimum": 1, + "type": "integer" + }, + "mediaType": { + "const": "application/yaml", + "type": "string" + }, + "path": { + "minLength": 1, + "type": "string" + }, + "sha256": { + "maxLength": 64, + "minLength": 64, + "pattern": "^[0-9a-f]{64}$", + "type": "string" + } + }, + "required": [ + "path", + "mediaType", + "byteLength", + "sha256" + ], + "type": "object" + }, + "maxItems": 1, + "minItems": 1, + "type": "array" + }, + "command": { + "const": "generate", + "type": "string" + }, + "diagnostics": { + "items": { + "$ref": "#/$defs/RankedProjectFinding" + }, + "type": "array" + }, + "explanation": { + "additionalProperties": false, + "properties": { + "identityFacts": { + "additionalProperties": false, + "properties": { + "accessProfiles": { + "maximum": 64, + "minimum": 0, + "type": "integer" + }, + "claims": { + "maximum": 64, + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "accessProfiles", + "claims" + ], + "type": "object" + } + }, + "required": [ + "identityFacts" + ], + "type": "object" + }, + "kind": { + "const": "BRegCtlReport", + "description": "The kind of document this file is.", + "type": "string" + }, + "nextSteps": { + "items": { + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "ok": { + "const": true, + "type": "boolean" + }, + "posture": { + "additionalProperties": false, + "properties": { + "source": { + "enum": [ + "default", + "environment", + "flag" + ], + "type": "string" + }, + "value": { + "enum": [ + "production", + "development" + ], + "type": "string" + } + }, + "required": [ + "value", + "source" + ], + "type": "object" + }, + "profile": { + "$ref": "#/$defs/ProfileArg" + }, + "revision": { + "maxLength": 71, + "minLength": 71, + "pattern": "^sha256:[0-9a-f]{64}$", + "type": "string" + }, + "status": { + "const": "complete", + "type": "string" + }, + "version": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "apiVersion", + "kind", + "ok", + "command", + "status", + "version", + "profile", + "revision", + "posture", + "diagnostics", + "artifacts", + "explanation" + ], + "title": "Completed BReg identity facts command report", + "type": "object" +} diff --git a/products/platform/config-formats.yaml b/products/platform/config-formats.yaml index c507fc67da..dec8050c23 100644 --- a/products/platform/config-formats.yaml +++ b/products/platform/config-formats.yaml @@ -1400,7 +1400,7 @@ formats: restrictingMembers: [] - id: breg/ctl-report product: breg - title: bregctl --format json report + title: Completed bregctl generate identity-facts JSON report files: [] syntax: json audience: generated @@ -1414,13 +1414,18 @@ formats: target: apiVersion: id.registrystack.org/formats/breg/ctl-report/v1alpha1 kind: BRegCtlReport - schema: none + schema: + path: products/breg/generated/tools/ctl-report.v1alpha1.schema.json + id: https://id.registrystack.org/schemas/breg/ctl-report/ctl-report.v1alpha1.schema.json + origin: generated + generator: cargo run -p registry-bregctl --features schema --example tool-schema -- --output products/breg/generated/tools + driftCheck: products/breg/scripts/check-tool-schemas.sh reader: none emittedBy: file: crates/registry-bregctl/src/lib.rs symbol: write_ctl_report check: none - example: products/breg/examples/formats/ctl-report.json + example: products/breg/examples/formats/identity-facts-report.json conformance: none securityMembers: [] restrictingMembers: [] From 865c65458366ee82d5dfab76849e0dcc0d07cfd2 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 06/55] fix(identity): validate product references in unused roles Folds these reviewed commits: - fix(identity): validate product references in unused roles - fix(identity): point role diagnostics to their authoring inputs Signed-off-by: Jeremi Joslin --- .../src/service_roles.rs | 88 +++++++++++++++---- .../src/service_roles/tests.rs | 37 ++++++++ crates/registry-rstack-dev/src/roles.rs | 2 +- crates/registry-rstack/tests/dev_run.rs | 50 ++++++++++- .../src/identity_check.rs | 59 ++++++++++++- .../run-a-project-with-rstack-dev.mdx | 13 ++- 6 files changed, 224 insertions(+), 25 deletions(-) diff --git a/crates/registry-platform-config/src/service_roles.rs b/crates/registry-platform-config/src/service_roles.rs index 507da8e82e..6a55da1787 100644 --- a/crates/registry-platform-config/src/service_roles.rs +++ b/crates/registry-platform-config/src/service_roles.rs @@ -123,31 +123,66 @@ impl RoleDocument { Ok(Self { roles, document }) } - /// Validate profiles against the products with supplied facts. Assigned roles - /// also require facts for every product they reference. + /// Validate every product reference and check profiles wherever facts are supplied. + /// Assigned roles also require facts for each product they reference. pub fn validate_references( &self, assigned: &BTreeSet<&str>, has_profile: impl Fn(&str, &str) -> Option, + ) -> Result<(), Report> { + self.validate_references_with_actions( + assigned, + has_profile, + "Supply identity facts for this product or change the role in service.yaml.", + "Use a recognized product or supply its identity facts to the hosted check.", + ) + } + + /// Apply the same role validation with remedies for a development plan. + pub fn validate_development_references( + &self, + assigned: &BTreeSet<&str>, + has_profile: impl Fn(&str, &str) -> Option, + ) -> Result<(), Report> { + self.validate_references_with_actions( + assigned, + has_profile, + "List this product in dev.yaml if supported, or change the role in service.yaml.", + "Use a recognized product key in service.yaml or remove this reference.", + ) + } + + fn validate_references_with_actions( + &self, + assigned: &BTreeSet<&str>, + has_profile: impl Fn(&str, &str) -> Option, + missing_facts_action: &str, + unknown_product_action: &str, ) -> Result<(), Report> { let mut findings = Vec::new(); for (role_id, role) in &self.roles { for (product, profiles) in &role.access_profiles { - let Some((code, message, action)) = profiles - .iter() - .find_map(|profile| match has_profile(product, profile) { - None if assigned.contains(role_id.as_str()) => Some(( - "identity.deployment.unknown-product", - "The role names a product with no identity facts.", - "Supply identity facts for this product or change the role in service.yaml.", - )), - Some(false) => Some(( - "identity.deployment.unknown-profile", - "The product declares no identity facts for this access profile.", - "Use a profile declared in the product's identity facts.", - )), - _ => None, - }) + let Some((code, message, action)) = + profiles + .iter() + .find_map(|profile| match has_profile(product, profile) { + None if assigned.contains(role_id.as_str()) => Some(( + "identity.deployment.unknown-product", + "The role names a product with no identity facts.", + missing_facts_action, + )), + None if !known_role_product(product) => Some(( + "identity.deployment.unknown-product", + "The role names an unknown product.", + unknown_product_action, + )), + Some(false) => Some(( + "identity.deployment.unknown-profile", + "The product declares no identity facts for this access profile.", + "Use a profile declared in the product's identity facts.", + )), + _ => None, + }) else { continue; }; @@ -173,6 +208,25 @@ impl RoleDocument { } } +/// Native service role products remain known when a check loads only some facts. +/// A supplied facts document can also identify an external product. +fn known_role_product(product: &str) -> bool { + matches!( + product, + "adapter" + | "breg" + | "breg-mcp" + | "casework" + | "coordinator" + | "discovery" + | "documents" + | "evidence" + | "messaging" + | "render" + | "scheduling" + ) +} + /// Validate the roles section of a service document read by a caller. pub fn roles_from_document(document: &Document) -> Result { if document.root().get("roles").is_none() { diff --git a/crates/registry-platform-config/src/service_roles/tests.rs b/crates/registry-platform-config/src/service_roles/tests.rs index 72cf796140..ce4e71a660 100644 --- a/crates/registry-platform-config/src/service_roles/tests.rs +++ b/crates/registry-platform-config/src/service_roles/tests.rs @@ -79,6 +79,43 @@ fn validates_profiles_for_supplied_products_and_requires_facts_for_assigned_role assert_eq!(diagnostic.path, "/roles/reader/accessProfiles/breg"); } +#[test] +fn an_unassigned_role_requires_a_known_product_or_supplied_facts() { + let authored = |product| { + format!( + "{HEADER}roles:\n unused:\n actorKind: human\n accessProfiles:\n {product}: [read]\n" + ) + }; + let assigned = BTreeSet::new(); + let known = authored("messaging"); + decode_role_document("service.yaml", known.as_bytes()) + .unwrap() + .validate_references(&assigned, |_, _| None) + .unwrap(); + + let external = authored("external-registry"); + let document = decode_role_document("service.yaml", external.as_bytes()).unwrap(); + let refused = document + .validate_references(&assigned, |_, _| None) + .unwrap_err(); + let [diagnostic] = refused.diagnostics() else { + panic!("expected one service reference diagnostic: {refused}"); + }; + assert_eq!(diagnostic.code, "identity.deployment.unknown-product"); + assert_eq!( + diagnostic.path, + "/roles/unused/accessProfiles/external-registry" + ); + let source = diagnostic.source.as_ref().unwrap(); + assert_eq!(source.file, "service.yaml"); + assert_eq!((source.line, source.column), (Some(7), Some(7))); + document + .validate_references(&assigned, |product, profile| { + (product == "external-registry").then_some(profile == "read") + }) + .unwrap(); +} + #[test] fn rejects_empty_duplicate_and_authority_bearing_role_members() { for body in [ diff --git a/crates/registry-rstack-dev/src/roles.rs b/crates/registry-rstack-dev/src/roles.rs index 292c02571f..5a4b0c28ad 100644 --- a/crates/registry-rstack-dev/src/roles.rs +++ b/crates/registry-rstack-dev/src/roles.rs @@ -236,7 +236,7 @@ pub(super) fn resolve( .values() .flat_map(|person| person.roles.iter().map(String::as_str)) .collect(); - service.validate_references(&assigned, |product, id| { + service.validate_development_references(&assigned, |product, id| { facts.get(product).map(|facts| { facts .facts diff --git a/crates/registry-rstack/tests/dev_run.rs b/crates/registry-rstack/tests/dev_run.rs index ad381c9433..ad5f858371 100644 --- a/crates/registry-rstack/tests/dev_run.rs +++ b/crates/registry-rstack/tests/dev_run.rs @@ -2153,6 +2153,47 @@ fn semantic_diagnostic_escapes_authored_mapping_keys_only_in_its_pointer() { assert!(!state.exists()); } +#[test] +fn dev_check_reports_unknown_products_in_unassigned_service_roles() { + let scratch = tempfile::tempdir().unwrap(); + let state = scratch.path().join("state"); + semantic_project(scratch.path(), "breg", ""); + for (product, code) in [("casework", 0), ("unknown-role-product", 1)] { + service( + scratch.path(), + &format!( + " operator: {{actorKind: service, accessProfiles: {{breg: [operator]}}}}\n unused:\n actorKind: human\n accessProfiles:\n {product}: [private-profile-marker]\n" + ), + ); + let checked = check(scratch.path(), &state, true); + assert_eq!(checked.status.code(), Some(code), "{checked:?}"); + let report: serde_json::Value = serde_json::from_slice(&checked.stdout).unwrap(); + if code == 1 { + let [diagnostic] = report["diagnostics"].as_array().unwrap().as_slice() else { + panic!("expected one service reference diagnostic: {report}"); + }; + assert_eq!(diagnostic["code"], "identity.deployment.unknown-product"); + assert_eq!(diagnostic["artifact"], "RStackService"); + assert_eq!( + diagnostic["path"], + "/roles/unused/accessProfiles/unknown-role-product" + ); + assert_eq!( + diagnostic["source"]["file"], + utf8(&scratch.path().join("service.yaml")) + ); + assert_eq!(diagnostic["source"]["line"], 8); + assert_eq!(diagnostic["source"]["column"], 7); + assert_eq!( + diagnostic["suggestedAction"], + "Use a recognized product key in service.yaml or remove this reference." + ); + assert!(!diagnostic.to_string().contains("private-profile-marker")); + } + assert!(!state.exists()); + } +} + #[test] fn start_reports_an_actionable_value_free_role_for_an_unstarted_product() { let scratch = tempfile::tempdir().unwrap(); @@ -2172,6 +2213,10 @@ fn start_reports_an_actionable_value_free_role_for_an_unstarted_product() { .as_str() .unwrap() .ends_with("/service.yaml")); + assert_eq!( + diagnostic["suggestedAction"], + "List this product in dev.yaml if supported, or change the role in service.yaml." + ); assert!(!diagnostic.to_string().contains("private-profile-marker")); assert!(!state.exists()); @@ -2191,8 +2236,9 @@ fn start_reports_an_actionable_value_free_role_for_an_unstarted_product() { "{error}" ); assert!( - error - .contains("Supply identity facts for this product or change the role in service.yaml."), + error.contains( + "List this product in dev.yaml if supported, or change the role in service.yaml." + ), "{error}" ); for supplied in [ diff --git a/crates/registry-thunderid-tooling/src/identity_check.rs b/crates/registry-thunderid-tooling/src/identity_check.rs index 340bcc214f..1245f7c281 100644 --- a/crates/registry-thunderid-tooling/src/identity_check.rs +++ b/crates/registry-thunderid-tooling/src/identity_check.rs @@ -10,7 +10,10 @@ //! the cross-file rules too (grants against admitted clients, claim types, //! issuer), writing nothing. -use std::path::{Path, PathBuf}; +use std::{ + collections::BTreeSet, + path::{Path, PathBuf}, +}; use registry_platform_yaml::{Diagnostic, Expect, Reader, Report, Severity, Source}; @@ -64,16 +67,19 @@ fn check_bytes(file: &str, bytes: &[u8], path: &Path, facts: &[PathBuf]) -> Repo bytes: &service_bytes, }; if facts.is_empty() { - let roles = match registry_platform_config::service_roles::decode_service_roles( + let service = match registry_platform_config::service_roles::decode_role_document( service.label, service.bytes, ) { - Ok(roles) => roles, + Ok(service) => service, Err(refused) => { report.extend(refused); return report; } }; + if let Err(refused) = service.validate_references(&BTreeSet::new(), |_, _| None) { + report.extend(refused); + } for (group, principals) in [ ( "clients", @@ -110,7 +116,7 @@ fn check_bytes(file: &str, bytes: &[u8], path: &Path, facts: &[PathBuf]) -> Repo ] { for (index, ids) in principals.into_iter().enumerate() { if let Err(error) = - registry_platform_config::service_roles::assign_roles(&roles, ids) + registry_platform_config::service_roles::assign_roles(&service.roles, ids) { report.push(document.diagnostic_at_value( Severity::Error, @@ -323,6 +329,51 @@ mod tests { ); } + #[test] + fn hosted_check_reports_unknown_products_in_unassigned_service_roles() { + for facts in [Vec::new(), vec![example("identity-facts.yaml")]] { + let dir = deployment_dir(|text| text); + let deployment = dir.path().join("deployment.yaml"); + let service = dir.path().join("service.yaml"); + let original = std::fs::read_to_string(&service).unwrap(); + let unused = |product| { + format!( + "{original} unused:\n actorKind: human\n accessProfiles:\n {product}: [private-profile-marker]\n" + ) + }; + std::fs::write(&service, unused("messaging")).unwrap(); + let checked = check_file(&deployment, &facts); + assert!(!checked.report.has_errors(), "{}", checked.report); + + std::fs::write(&service, unused("unknown-role-product")).unwrap(); + let checked = check_file(&deployment, &facts); + let [diagnostic] = checked.report.diagnostics() else { + panic!( + "expected one service reference diagnostic: {}", + checked.report + ); + }; + assert_eq!(diagnostic.code, "identity.deployment.unknown-product"); + assert_eq!( + diagnostic.suggested_action, + "Use a recognized product or supply its identity facts to the hosted check." + ); + assert_eq!(diagnostic.artifact.as_deref(), Some("RStackService")); + assert_eq!( + diagnostic.path, + "/roles/unused/accessProfiles/unknown-role-product" + ); + let source = diagnostic.source.as_ref().unwrap(); + assert_eq!(source.file, service.to_string_lossy()); + assert_eq!(source.line, Some(original.lines().count() + 4)); + assert_eq!(source.column, Some(7)); + assert!(!checked + .report + .render_human() + .contains("private-profile-marker")); + } + } + #[test] fn a_facts_document_is_checked_beyond_its_types() { let dir = tempfile::tempdir().unwrap(); diff --git a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx index b9bd5b2f13..8120ec7716 100644 --- a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx +++ b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx @@ -634,7 +634,18 @@ When each step names its actor and the run uses its own issuer, the rehearsal ob The run obtains the normal schema-test receipt before packaging. A role may refer to a profile that grants only proposal permissions. -Dev runs and hosted identity generation check all role references for products whose identity facts they load, including references in unassigned roles. Every assigned role must have identity facts for each product it names. Invalid references point to the corresponding `accessProfiles` entry in `service.yaml`. +Dev loads the sibling `service.yaml` when `dev.yaml` declares at least one test person. +Dev and hosted identity checks validate product references in that role file, including references in unassigned roles. +A known product can appear in an unassigned role when its identity facts are outside the current run. +The checks validate access profiles wherever they load identity facts. +Every assigned role must have facts for each product it names when you run a full identity check. +An invalid reference points to its `accessProfiles` entry in `service.yaml`. + +{/* Evidence: crates/registry-platform-config/src/service_roles.rs, RoleDocument::validate_references(), + RoleDocument::validate_development_references(); + crates/registry-rstack-dev/src/roles.rs, resolve; + crates/registry-rstack/tests/dev_run.rs, dev_check_reports_unknown_products_in_unassigned_service_roles; + crates/registry-thunderid-tooling/src/identity_check.rs, hosted_check_reports_unknown_products_in_unassigned_service_roles. */} When migrating an existing plan, move profile references to `service.yaml` and replace each person's `grants` with their role IDs. Remove the per-person scopes and actor kind. From e4e8fca1d23f92f6ebbe66d69641b295e542fae8 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 07/55] feat(rstack-dev): verify offline owner role evidence Folds these reviewed commits: - feat(rstack-dev): verify offline owner role evidence - test(rstack-dev): pin offline reports to owner formats Signed-off-by: Jeremi Joslin --- crates/registry-adapterctl/src/report.rs | 6 + crates/registry-rstack-dev/src/dev_facts.rs | 466 +++++++++++++++++- .../src/dev_facts/offline_tests.rs | 218 ++++++++ crates/registry-rstack-dev/src/plan.rs | 8 +- crates/registry-rstack-dev/src/products.rs | 31 +- crates/registry-rstack-dev/src/roles.rs | 2 + .../run-a-project-with-rstack-dev.mdx | 10 + .../adapter/examples/formats/ctl-report.json | 16 + products/platform/CHANGELOG.md | 3 + 9 files changed, 732 insertions(+), 28 deletions(-) create mode 100644 crates/registry-rstack-dev/src/dev_facts/offline_tests.rs create mode 100644 products/adapter/examples/formats/ctl-report.json diff --git a/crates/registry-adapterctl/src/report.rs b/crates/registry-adapterctl/src/report.rs index 45ec3e6462..3756ef71d3 100644 --- a/crates/registry-adapterctl/src/report.rs +++ b/crates/registry-adapterctl/src/report.rs @@ -311,6 +311,12 @@ mod tests { let report: Value = serde_json::from_slice(&out).unwrap(); assert_eq!(report["apiVersion"], ADAPTER_CTL_REPORT_API_VERSION); assert_eq!(report["kind"], ADAPTER_CTL_REPORT_KIND); + let example: Value = serde_json::from_slice(include_bytes!( + "../../../products/adapter/examples/formats/ctl-report.json" + )) + .unwrap(); + assert_eq!(example["apiVersion"], report["apiVersion"]); + assert_eq!(example["kind"], report["kind"]); assert_eq!(report.as_object().unwrap().len(), 5); } diff --git a/crates/registry-rstack-dev/src/dev_facts.rs b/crates/registry-rstack-dev/src/dev_facts.rs index a1f471cd14..233ce5de95 100644 --- a/crates/registry-rstack-dev/src/dev_facts.rs +++ b/crates/registry-rstack-dev/src/dev_facts.rs @@ -4,6 +4,9 @@ use std::{ collections::{BTreeMap, BTreeSet}, ffi::OsStr, + fs::{File, OpenOptions}, + io::Read, + os::unix::fs::OpenOptionsExt, path::Path, process::Stdio, sync::atomic::{AtomicBool, Ordering}, @@ -14,14 +17,19 @@ use anyhow::{anyhow, ensure, Context, Result}; use registry_platform_config::identity_facts::{ self, AccessProfile, ActorKind, Admission, ClaimType, IdentityFacts, }; +use registry_platform_config::package::{verify_package, PackageLimits}; use registry_platform_yaml::{Reader, MAXIMUM_DOCUMENT_BYTES}; use serde::Deserialize; use serde_json::{json, Value}; +use sha2::{Digest, Sha256}; use super::{ plan::{self, Plan, Product, ProductPlan}, product_tool, - products::{child_command, inspection_failed, issuer_set, tool_report, wait_for_tool}, + products::{ + child_command, inspection_failed, issuer_set, strict_tool_report, tool_report, + wait_for_tool, + }, signals, write_private, }; @@ -40,6 +48,7 @@ pub(super) fn load( external_jwks_uri: Option<&str>, products: &[ProductPlan], clients: &BTreeSet, + offline_check: bool, ) -> Result> { let scratch = tempfile::tempdir()?; let scratch_root = scratch.path().canonicalize()?; @@ -73,6 +82,7 @@ pub(super) fn load( external_jwks_uri, clients, &terminate, + offline_check, ) })(); let result = facts_result.map_err(|error: anyhow::Error| { @@ -106,6 +116,7 @@ fn load_product_facts( external_jwks_uri: Option<&str>, clients: &BTreeSet, terminate: &AtomicBool, + offline_check: bool, ) -> Result { let product = plan.product; if product == Product::Breg { @@ -115,11 +126,12 @@ fn load_product_facts( "explain", &[OsStr::new("access"), project.as_os_str()], terminate, + offline_check, )?; return breg_explanation(&report["explanation"], issuer, &plan.audience); } let file = scratch.join(format!("{}-identity-facts.yaml", product.name())); - native_facts( + let report = native_facts( tool, plan, project, @@ -129,19 +141,27 @@ fn load_product_facts( clients, &file, terminate, + offline_check, )?; - let bytes = plan::read(&file, MAXIMUM_DOCUMENT_BYTES as u64)?; + let bytes = if offline_check { + read_offline_facts(&file)? + } else { + plan::read(&file, MAXIMUM_DOCUMENT_BYTES as u64)? + }; let facts = identity_facts::read(&file.to_string_lossy(), &bytes)?; - ensure!( - facts.product == product.name(), - "the owning tool wrote facts for a different product" - ); - ensure!( - facts.issuer == issuer && facts.audience == plan.audience, - "the owning tool wrote facts for a different issuer or audience" - ); + validate_facts_context(&facts, product, issuer, &plan.audience)?; + if let Some(report) = report { + validate_written_facts(product, &report, &file, &facts)?; + } let principal_claims = if product == Product::Casework { - let report = checked_report(tool, product, "explain", &[project.as_os_str()], terminate)?; + let report = checked_report( + tool, + product, + "explain", + &[project.as_os_str()], + terminate, + offline_check, + )?; principals(&report)? } else { BTreeMap::new() @@ -164,8 +184,17 @@ fn checked_report( command: &str, args: &[&OsStr], terminate: &AtomicBool, + offline_check: bool, ) -> Result { - let (status, report) = tool_report(tool, product.name(), command, args, terminate)?; + let read = if offline_check { + strict_tool_report + } else { + tool_report + }; + let (status, report) = read(tool, product.name(), command, args, terminate)?; + if offline_check && (status.success() || status.code() == Some(1)) { + validate_offline_report(&report, product, command, status.success())?; + } if !status.success() { let codes: Vec<_> = report["diagnostics"] .as_array() @@ -207,11 +236,15 @@ fn native_facts( clients: &BTreeSet, output: &Path, terminate: &AtomicBool, -) -> Result<()> { + offline_check: bool, +) -> Result> { let product = plan.product; let package = scratch.join(format!("{}-package", product.name())); - if matches!(product, Product::Messaging | Product::Scheduling) { - checked_report( + let messaging_tool = (offline_check && product == Product::Messaging) + .then(|| tool_digest(tool)) + .transpose()?; + let package_report = if matches!(product, Product::Messaging | Product::Scheduling) { + let report = checked_report( tool, product, "package", @@ -221,15 +254,45 @@ fn native_facts( package.as_os_str(), ], terminate, + offline_check, )?; - } + if offline_check { + ensure!( + package + .to_str() + .is_some_and(|path| report["output"] == path) + && report["dryRun"] == false, + "the owning tool reported a different package output" + ); + } + Some(report) + } else { + None + }; let runtime = scratch.join(format!("{}-runtime.yaml", product.name())); - let config_file = if product == Product::Evidence { - evidence_target(project, scratch, issuer, external_jwks_uri, &plan.audience)? + let (config_file, messaging_pins) = if product == Product::Evidence { + ( + evidence_target(project, scratch, issuer, external_jwks_uri, &plan.audience)?, + None, + ) } else { let config = runtime_for_facts(plan, project, scratch, &package, issuer, clients)?; - write_private(&runtime, &serde_json::to_vec(&config)?)?; - runtime + let bytes = serde_json::to_vec(&config)?; + write_private(&runtime, &bytes)?; + let pins = if let Some(tool) = messaging_tool { + let digest = package_report + .as_ref() + .and_then(|report| report["projectDigest"].as_str()) + .context("missing Messaging package digest")?; + Some(MessagingPins { + tool, + runtime: Sha256::digest(&bytes).into(), + package: digest.to_owned(), + }) + } else { + None + }; + (runtime, pins) }; let mut args = vec![OsStr::new("identity-facts")]; if matches!( @@ -273,12 +336,194 @@ fn native_facts( status.success(), "Render refused the development facts input" ); + return Ok(None); + } + if let Some(pins) = &messaging_pins { + pins.check(tool, &package, &config_file)?; + } + let report = checked_report(tool, product, "generate", &args, terminate, offline_check); + if let Some(pins) = &messaging_pins { + pins.check(tool, &package, &config_file)?; + } + Ok(offline_check.then_some(report?)) +} + +fn validate_facts_context( + facts: &IdentityFacts, + product: Product, + issuer: &str, + audience: &str, +) -> Result<()> { + ensure!( + facts.product == product.name(), + "the owning tool wrote facts for a different product" + ); + ensure!( + facts.issuer == issuer && facts.audience == audience, + "the owning tool wrote facts for a different issuer or audience" + ); + Ok(()) +} + +fn validate_offline_report( + report: &Value, + product: Product, + command: &str, + success: bool, +) -> Result<()> { + let (kind, format) = match product { + Product::Adapter => ("AdapterCtlReport", "adapter/ctl-report/v1alpha1"), + Product::Breg => ("BRegCtlReport", "breg/ctl-report/v1alpha1"), + Product::Casework => ("CaseworkReport", "casework/report/v1alpha2"), + Product::Coordinator => ("CoordinatorCtlReport", "coordinator/ctl-report/v1alpha1"), + Product::Documents => ("DocumentsCtlReport", "documents/ctl-report/v1alpha1"), + Product::Evidence => ("EvidenceCtlReport", "evidence/ctl-report/v1alpha1"), + Product::Messaging => ("MessagingCtlReport", "messaging/ctl-report/v1alpha1"), + Product::Scheduling => ("SchedulingCtlReport", "scheduling/ctl-report/v1alpha1"), + Product::Discovery | Product::Render => { + anyhow::bail!( + "{} has no JSON owner identity facts receipt", + product.name() + ) + } + }; + let status = if !success { + "domain-refusal" + } else if product == Product::Coordinator && command == "generate" { + "generated" } else { - checked_report(tool, product, "generate", &args, terminate)?; + "complete" + }; + let command = match (product, command) { + (Product::Casework, "generate") => "generate-identity-facts", + (_, "generate") => "generate identity-facts", + (_, other) => other, + }; + let version = format!("id.registrystack.org/formats/{format}"); + ensure!( + report["kind"] == kind + && report["apiVersion"] == version + && report["command"] == command + && report["status"] == status + && report["ok"] == success, + "the owning tool did not return the expected offline report" + ); + Ok(()) +} + +fn validate_written_facts( + product: Product, + report: &Value, + output: &Path, + facts: &IdentityFacts, +) -> Result<()> { + ensure!( + output.to_str().is_some_and(|path| report["output"] == path), + "the owning tool reported a different identity facts output" + ); + // Coordinator's receipt names the output. The shared typed file carries + // the actual inventory, as it does for the other writers. + if product != Product::Coordinator { + ensure!( + report["accessProfiles"].as_u64() == Some(facts.access_profiles.len() as u64) + && report["claims"].as_u64() == Some(facts.claims.len() as u64), + "the owning tool report does not match the written identity facts inventory" + ); + } + if matches!(product, Product::Casework | Product::Evidence) { + ensure!( + report["product"] == product.name() + && report["assertionIssuers"].as_u64() + == Some(facts.assertion_issuers.len() as u64), + "the owning tool report does not match the written assertion issuer inventory" + ); } Ok(()) } +// Messaging derives admitted clients from the package built for this inspection. +struct MessagingPins { + tool: [u8; 32], + runtime: [u8; 32], + package: String, +} + +impl MessagingPins { + fn check(&self, tool: &Path, package: &Path, runtime: &Path) -> Result<()> { + ensure!( + tool_digest(tool)? == self.tool, + "the Messaging owner tool changed" + ); + ensure!( + runtime_digest(runtime)? == self.runtime, + "the Messaging runtime input changed" + ); + let verified = + verify_package(package, &PackageLimits::default(), "messagingctl package") + .map_err(|_| anyhow!("the Messaging package changed or could not be verified"))?; + ensure!( + verified.digest() == self.package, + "the Messaging package changed" + ); + Ok(()) + } +} + +fn open_offline_file(path: &Path) -> Result { + let flags = rustix::fs::OFlags::NOFOLLOW | rustix::fs::OFlags::NONBLOCK; + let file = OpenOptions::new() + .read(true) + .custom_flags(flags.bits() as i32) + .open(path)?; + ensure!( + file.metadata()?.is_file(), + "the offline inspection input is not a regular file" + ); + Ok(file) +} + +fn read_offline_facts(path: &Path) -> Result> { + let limit = MAXIMUM_DOCUMENT_BYTES as u64; + let mut bytes = Vec::new(); + open_offline_file(path)? + .take(limit + 1) + .read_to_end(&mut bytes)?; + ensure!( + bytes.len() as u64 <= limit, + "the offline identity facts exceed their read bound" + ); + Ok(bytes) +} + +fn file_digest(path: &Path, limit: u64) -> Result<[u8; 32]> { + let mut file = open_offline_file(path)?.take(limit + 1); + let mut hasher = Sha256::new(); + let mut buffer = [0; 8192]; + loop { + let count = file.read(&mut buffer)?; + if count == 0 { + break; + } + hasher.update(&buffer[..count]); + } + ensure!( + file.limit() > 0, + "the offline inspection input exceeds its read bound" + ); + Ok(hasher.finalize().into()) +} + +fn tool_digest(tool: &Path) -> Result<[u8; 32]> { + // Includes debug tools while bounding read time and memory for this offline check. + const MAX_TOOL_BYTES: u64 = 512 * 1024 * 1024; + file_digest(tool, MAX_TOOL_BYTES).context("cannot read the Messaging owner tool") +} + +fn runtime_digest(runtime: &Path) -> Result<[u8; 32]> { + file_digest(runtime, MAXIMUM_DOCUMENT_BYTES as u64) + .context("cannot read the Messaging runtime input") +} + fn evidence_target( project: &Path, scratch: &Path, @@ -700,10 +945,187 @@ fn breg_explanation(explanation: &Value, issuer: &str, audience: &str) -> Result }) } +#[cfg(test)] +#[path = "dev_facts/offline_tests.rs"] +mod offline_tests; + #[cfg(test)] mod tests { use super::*; + #[test] + fn offline_owner_report_refuses_an_incomplete_or_outdated_report() { + let complete = json!({ + "apiVersion": "id.registrystack.org/formats/casework/report/v1alpha2", + "kind": "CaseworkReport", "command": "generate-identity-facts", + "status": "complete", "ok": true, "product": "casework", + "output": "/fixture/facts.yaml", "accessProfiles": 2, "claims": 3, + "assertionIssuers": 0 + }); + validate_offline_report(&complete, Product::Casework, "generate", true).unwrap(); + let mut incomplete = complete.clone(); + incomplete.as_object_mut().unwrap().remove("ok"); + assert!(validate_offline_report(&incomplete, Product::Casework, "generate", true).is_err()); + for (field, wrong) in [ + ( + "apiVersion", + json!("id.registrystack.org/formats/casework/report/v1alpha1"), + ), + ("kind", json!("OtherReport")), + ("command", json!("explain")), + ("status", json!("domain-refusal")), + ("ok", json!(false)), + ] { + let mut outdated = complete.clone(); + outdated[field] = wrong; + assert!( + validate_offline_report(&outdated, Product::Casework, "generate", true).is_err(), + "{field}" + ); + } + let mut refusal = complete; + refusal["ok"] = json!(false); + refusal["status"] = json!("domain-refusal"); + refusal["diagnostics"] = json!([{"code": "casework.identity.refused"}]); + validate_offline_report(&refusal, Product::Casework, "generate", false).unwrap(); + } + + #[test] + fn offline_report_requires_unique_members_from_owner_subprocess() { + use std::{fs, os::unix::fs::PermissionsExt}; + + let scratch = tempfile::tempdir().unwrap(); + let tool = scratch.path().join("offline-report"); + let body = r#"{"ok":false,"ok":true,"command":"explain","status":"complete", + "kind":"BRegCtlReport","apiVersion":"id.registrystack.org/formats/breg/ctl-report/v1alpha1"}"#; + fs::write(&tool, format!("#!/bin/sh\nprintf '%s' '{body}'\n")).unwrap(); + fs::set_permissions(&tool, fs::Permissions::from_mode(0o700)).unwrap(); + let terminate = AtomicBool::new(false); + checked_report(&tool, Product::Breg, "explain", &[], &terminate, false).unwrap(); + let error = + checked_report(&tool, Product::Breg, "explain", &[], &terminate, true).unwrap_err(); + assert_eq!(error.to_string(), "breg explain did not emit a JSON report"); + } + + #[test] + fn offline_owner_report_correlates_exact_output_and_facts() { + let product = Product::Messaging; + let output = Path::new("/fixture/facts.yaml"); + let facts = IdentityFacts::new( + product.name(), + "https://issuer.example.test", + "urn:fixture:messages", + Admission::Unrestricted, + ); + let report = json!({"output": output, "accessProfiles": 0, "claims": 0}); + validate_written_facts(product, &report, output, &facts).unwrap(); + for (field, value) in [ + ("output", json!("/other/facts.yaml")), + ("accessProfiles", json!(1)), + ("claims", json!(1)), + ] { + let mut stale = report.clone(); + stale[field] = value; + assert!( + validate_written_facts(product, &stale, output, &facts).is_err(), + "{field}" + ); + } + for (issuer, audience) in [ + ("https://outdated.example.test", facts.audience.as_str()), + (facts.issuer.as_str(), "urn:outdated"), + ] { + assert!(validate_facts_context(&facts, product, issuer, audience).is_err()); + } + validate_facts_context(&facts, product, &facts.issuer, &facts.audience).unwrap(); + } + + #[test] + fn offline_messaging_pins_refuse_independent_changes() { + use registry_platform_config::package::write_package; + + let scratch = tempfile::tempdir().unwrap(); + let package = scratch.path().join("package"); + let manifest = package.join("messaging.yaml"); + let tool = scratch.path().join("messagingctl"); + let runtime = scratch.path().join("runtime.yaml"); + let verified = write_package( + &package, + &BTreeMap::from([("messaging.yaml".to_owned(), b"package".to_vec())]), + None, + &PackageLimits::default(), + "messagingctl package", + ) + .unwrap(); + std::fs::write(&tool, b"owner tool").unwrap(); + std::fs::write(&runtime, b"runtime").unwrap(); + let pins = MessagingPins { + tool: tool_digest(&tool).unwrap(), + runtime: runtime_digest(&runtime).unwrap(), + package: verified.digest().to_owned(), + }; + pins.check(&tool, &package, &runtime).unwrap(); + for (path, expected) in [ + (&tool, "tool changed"), + (&runtime, "runtime input changed"), + (&manifest, "package changed"), + ] { + let original = std::fs::read(path).unwrap(); + std::fs::write(path, b"outdated").unwrap(); + assert!(pins + .check(&tool, &package, &runtime) + .unwrap_err() + .to_string() + .contains(expected)); + std::fs::write(path, original).unwrap(); + } + pins.check(&tool, &package, &runtime).unwrap(); + } + + #[test] + #[ignore = "requires the matched messagingctl via RSTACK_MESSAGINGCTL_BIN"] + fn offline_messaging_native_facts_retain_actorless_owner_profile() { + use identity_facts::ACTOR_KIND_CLAIM; + + let project = Path::new(env!("CARGO_MANIFEST_DIR")) + .join("../../products/messaging/examples/starter") + .canonicalize() + .unwrap(); + let scratch = tempfile::tempdir().unwrap(); + let plan = ProductPlan { + product: Product::Messaging, + project: ".".into(), + audience: "urn:example:messaging".into(), + }; + let observed = load_product_facts( + &product_tool(Product::Messaging).unwrap(), + &plan, + &project, + &scratch.path().canonicalize().unwrap(), + "https://issuer.example.test", + None, + &BTreeSet::new(), + &AtomicBool::new(false), + true, + ) + .unwrap(); + let operation = observed + .facts + .access_profiles + .iter() + .find(|profile| profile.id == "operations") + .unwrap(); + assert_eq!(operation.scopes, ["messaging:operate"]); + assert!(operation.actor_kind.is_none()); + assert!(operation.admitted_actor_kinds.is_empty()); + assert!(!operation.selected_by.contains_key(ACTOR_KIND_CLAIM)); + assert!(!operation + .required_claims + .iter() + .chain(&operation.refused_claims) + .any(|claim| claim == ACTOR_KIND_CLAIM)); + } + #[test] fn breg_facts_keep_exact_empty_scopes_and_claim_types() { let explanation = json!({ diff --git a/crates/registry-rstack-dev/src/dev_facts/offline_tests.rs b/crates/registry-rstack-dev/src/dev_facts/offline_tests.rs new file mode 100644 index 0000000000..f6a05c71a4 --- /dev/null +++ b/crates/registry-rstack-dev/src/dev_facts/offline_tests.rs @@ -0,0 +1,218 @@ +// SPDX-License-Identifier: Apache-2.0 + +use registry_platform_config::service_roles::{self, decode_role_document}; + +use super::*; + +const ISSUER: &str = "https://issuer.example.test"; +const PROFILE: &str = "fixture-reader"; +const AUDIENCE: &str = "urn:fixture:owner"; + +fn parse(bytes: &[u8]) -> Value { + serde_json::from_slice(bytes).expect("owner artifact is JSON") +} + +fn casework_generator_envelope() -> Value { + let contract = parse(include_bytes!( + "../../../../products/casework/contracts/cli/report.schema.json" + )); + let properties = contract["oneOf"] + .as_array() + .unwrap() + .iter() + .find(|branch| branch["properties"]["command"]["const"] == "generate-identity-facts") + .expect("Casework's maintained schema names the facts writer") + .get("properties") + .unwrap(); + json!({ + "kind": properties["kind"]["const"], + "apiVersion": properties["apiVersion"]["const"], + "command": properties["command"]["const"], + }) +} + +#[test] +fn offline_role_checks_match_the_nine_owner_contracts() { + // The envelopes are read from owner artifacts. The facts and the related + // role assignment are synthetic so this matrix runs without owner tools. + let owners = [ + ( + Product::Adapter, + Some(parse(include_bytes!( + "../../../../products/adapter/examples/formats/ctl-report.json" + ))), + ), + ( + Product::Breg, + Some(parse(include_bytes!( + "../../../../products/breg/examples/formats/ctl-report.json" + ))), + ), + (Product::Casework, Some(casework_generator_envelope())), + ( + Product::Coordinator, + Some(parse(include_bytes!( + "../../../../products/coordinator/examples/formats/ctl-report.json" + ))), + ), + ( + Product::Documents, + Some(parse(include_bytes!( + "../../../../products/documents/examples/formats/ctl-report.json" + ))), + ), + ( + Product::Evidence, + Some(parse(include_bytes!( + "../../../../products/evidence/examples/formats/ctl-report.json" + ))), + ), + ( + Product::Messaging, + Some(parse(include_bytes!( + "../../../../products/messaging/examples/formats/ctl-report.json" + ))), + ), + ( + Product::Scheduling, + Some(parse(include_bytes!( + "../../../../products/scheduling/examples/formats/ctl-report.json" + ))), + ), + (Product::Render, None), + ]; + for (product, report) in owners { + let facts = + if product == Product::Breg { + breg_explanation(&json!({ + "claimContract": {"principalClaims": ["sub"], "directClaims": {}}, + "recordTypes": [{"profiles": [{ + "id": PROFILE, "requiredScopes": ["records:read"], "principalClaim": "sub" + }]}], + "statisticalDatasets": [], "actions": {"actions": []}, + }), ISSUER, AUDIENCE).unwrap().facts + } else { + let facts = json!({ + "apiVersion": "id.registrystack.org/formats/platform/identity-facts/v1", + "kind": "PlatformIdentityFacts", + "product": product.name(), + "issuer": ISSUER, + "audience": AUDIENCE, + "allowedClients": ["fixture-client"], + "accessProfiles": [{"id": PROFILE, "scopes": ["records:read"]}] + }); + identity_facts::read("facts.yaml", &serde_json::to_vec(&facts).unwrap()) + .expect("the product facts decode on the native typed reader") + }; + validate_facts_context(&facts, product, ISSUER, AUDIENCE).unwrap(); + assert!( + validate_facts_context(&facts, product, "https://stale.example.test", AUDIENCE) + .is_err(), + "{} outdated issuer", + product.name(), + ); + assert!( + validate_facts_context(&facts, product, ISSUER, "urn:stale").is_err(), + "{} outdated audience", + product.name(), + ); + if let Some(report) = report { + check_receipt_and_drift(report, product, &facts); + } else { + assert!( + validate_offline_report(&Value::Null, product, "generate", true) + .unwrap_err() + .to_string() + .contains("has no JSON owner identity facts receipt") + ); + } + + let service = |profile| { + json!({ + "apiVersion": service_roles::API_VERSION, + "kind": service_roles::KIND, + "roles": {"fixture-role": { + "actorKind": "human", + "accessProfiles": {(product.name()): [profile]} + }} + }) + }; + let decode_service = |profile| { + decode_role_document( + "service.yaml", + &serde_json::to_vec(&service(profile)).unwrap(), + ) + .expect("the authored service roles decode") + }; + let has_profile = |name: &str, profile: &str| { + (name == facts.product).then(|| { + facts + .access_profiles + .iter() + .any(|entry| entry.id == profile) + }) + }; + let assigned = BTreeSet::from(["fixture-role"]); + decode_service(PROFILE) + .validate_references(&assigned, has_profile) + .unwrap(); + let failure = decode_service("absent-profile") + .validate_references(&assigned, has_profile) + .unwrap_err(); + let [diagnostic] = failure.diagnostics() else { + panic!("expected one assignment diagnostic for {}", product.name()); + }; + assert_eq!(diagnostic.code, "identity.deployment.unknown-profile"); + assert_eq!( + diagnostic.path, + format!("/roles/fixture-role/accessProfiles/{}", product.name()) + ); + } +} + +fn check_receipt_and_drift(mut report: Value, product: Product, facts: &IdentityFacts) { + // Casework derives its command from the exact selected schema branch. + if product != Product::Casework { + report["command"] = json!(if product == Product::Breg { + "explain" + } else { + "generate identity-facts" + }); + } + report["ok"] = json!(true); + report["status"] = json!(if product == Product::Coordinator { + "generated" + } else { + "complete" + }); + let command = if product == Product::Breg { + "explain" + } else { + "generate" + }; + validate_offline_report(&report, product, command, true).unwrap_or_else(|error| { + panic!( + "{} report differs from the owner artifact: {error}", + product.name() + ) + }); + + let mut incomplete = report.clone(); + incomplete.as_object_mut().unwrap().remove("ok"); + assert!(validate_offline_report(&incomplete, product, command, true).is_err()); + let mut old = report.clone(); + old["apiVersion"] = json!("id.registrystack.org/formats/stale/report/v1"); + assert!(validate_offline_report(&old, product, command, true).is_err()); + + if product != Product::Breg { + let output = Path::new("/fixture/facts.yaml"); + report["output"] = json!(output); + report["product"] = json!(product.name()); + report["accessProfiles"] = json!(facts.access_profiles.len()); + report["claims"] = json!(facts.claims.len()); + report["assertionIssuers"] = json!(facts.assertion_issuers.len()); + validate_written_facts(product, &report, output, facts).unwrap(); + report["output"] = json!("/stale/facts.yaml"); + assert!(validate_written_facts(product, &report, output, facts).is_err()); + } +} diff --git a/crates/registry-rstack-dev/src/plan.rs b/crates/registry-rstack-dev/src/plan.rs index 2508dd2f53..951eee14ee 100644 --- a/crates/registry-rstack-dev/src/plan.rs +++ b/crates/registry-rstack-dev/src/plan.rs @@ -1032,7 +1032,7 @@ struct AuthoredPlan { sources: Option, } -fn read_plan(root: &Path) -> Result<(AuthoredPlan, AuthoredDigests)> { +fn read_plan(root: &Path, offline_check: bool) -> Result<(AuthoredPlan, AuthoredDigests)> { let (authored, dev) = decode_authored_plan(root)?; authored .value @@ -1060,7 +1060,7 @@ fn read_plan(root: &Path) -> Result<(AuthoredPlan, AuthoredDigests)> { document, sources, } = authored; - let resolved = super::roles::resolve(root, &document, value); + let resolved = super::roles::resolve(root, &document, value, offline_check); if resolved.is_err() { if let Some((source, expected)) = native_source.as_deref().zip(preview_native) { super::preview::verify_native_source(source, expected)?; @@ -1211,7 +1211,7 @@ pub(super) struct LoadedPlan { } pub(crate) fn check(root: &Path) -> Result { - let (decoded, authored_digests) = read_plan(root)?; + let (decoded, authored_digests) = read_plan(root, true)?; validate_plan(root, &decoded)?; read_journeys(root, &decoded.value)?; let preview = preview_plan(root, &decoded, &authored_digests)?; @@ -1238,7 +1238,7 @@ pub(crate) fn check(root: &Path) -> Result { } pub(super) fn load(root: &Path) -> Result { - let (decoded, authored_digests) = read_plan(root)?; + let (decoded, authored_digests) = read_plan(root, false)?; validate_plan(root, &decoded)?; let (scenarios, scenario_digest) = read_journeys(root, &decoded.value)?; let preview = preview_plan(root, &decoded, &authored_digests)?; diff --git a/crates/registry-rstack-dev/src/products.rs b/crates/registry-rstack-dev/src/products.rs index 667e2caeef..b6d93ef07a 100644 --- a/crates/registry-rstack-dev/src/products.rs +++ b/crates/registry-rstack-dev/src/products.rs @@ -2966,6 +2966,29 @@ pub(super) fn tool_report( command: &str, arguments: &[&std::ffi::OsStr], terminate: &AtomicBool, +) -> Result<(ExitStatus, Value)> { + read_tool_report(tool, name, command, arguments, terminate, false) +} + +/// The offline owner check uses unique-member JSON while preserving existing +/// readers for other product inspection paths. +pub(super) fn strict_tool_report( + tool: &Path, + name: &str, + command: &str, + arguments: &[&std::ffi::OsStr], + terminate: &AtomicBool, +) -> Result<(ExitStatus, Value)> { + read_tool_report(tool, name, command, arguments, terminate, true) +} + +fn read_tool_report( + tool: &Path, + name: &str, + command: &str, + arguments: &[&std::ffi::OsStr], + terminate: &AtomicBool, + strict: bool, ) -> Result<(ExitStatus, Value)> { let mut child = child_command(tool) .args(["--format", "json", command]) @@ -2995,8 +3018,12 @@ pub(super) fn tool_report( bytes.len() as u64 <= MAX_TOOL_REPORT, "the {name} {command} report exceeds the size limit" ); - let report = serde_json::from_slice(&bytes) - .map_err(|_| anyhow::anyhow!("{name} {command} did not emit a JSON report"))?; + let malformed = || anyhow::anyhow!("{name} {command} did not emit a JSON report"); + let report = if strict { + registry_platform_crypto::parse_json_strict(&bytes).map_err(|_| malformed())? + } else { + serde_json::from_slice(&bytes).map_err(|_| malformed())? + }; Ok((status, report)) } diff --git a/crates/registry-rstack-dev/src/roles.rs b/crates/registry-rstack-dev/src/roles.rs index 5a4b0c28ad..1d0bbf4c8e 100644 --- a/crates/registry-rstack-dev/src/roles.rs +++ b/crates/registry-rstack-dev/src/roles.rs @@ -163,6 +163,7 @@ pub(super) fn resolve( root: &Path, document: &Document, authored: Plan, + offline_check: bool, ) -> Result<(Plan, Option)> { let Plan { issuer, @@ -229,6 +230,7 @@ pub(super) fn resolve( .values() .map(|person| person.client.clone()) .collect(), + offline_check, )? }; if let Some(service) = &service_roles { diff --git a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx index 8120ec7716..d13675d190 100644 --- a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx +++ b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx @@ -649,6 +649,16 @@ An invalid reference points to its `accessProfiles` entry in `service.yaml`. When migrating an existing plan, move profile references to `service.yaml` and replace each person's `grants` with their role IDs. Remove the per-person scopes and actor kind. +Use the matching product tools when you run `rstack dev check`. The offline check verifies the +owner reports it uses and matches generated identity facts to the run's issuer and product audience. +For BReg it reads the compiled access explanation and takes issuer and audience from your development plan. +For Render it reads the generated identity facts file. For Messaging it also checks the staged package, +runtime input and owner tool for changes around facts generation. +If the check reports an incompatible owner report, select the matching product tool and run the check again. + +{/* Evidence: crates/registry-rstack-dev/src/dev_facts.rs load_product_facts, + validate_offline_report, validate_facts_context, validate_written_facts, MessagingPins. */} + For synthetic refusal fixtures, a person can narrow the derived scopes or omit a claim using `tokenFixtures` under the product key. The facility statistics acceptance test also uses this field to carry a purpose for audit and cursor context. The purpose must not qualify the bearer diff --git a/products/adapter/examples/formats/ctl-report.json b/products/adapter/examples/formats/ctl-report.json new file mode 100644 index 0000000000..2d742aafb2 --- /dev/null +++ b/products/adapter/examples/formats/ctl-report.json @@ -0,0 +1,16 @@ +{ + "ok": true, + "command": "check", + "status": "complete", + "apiVersion": "id.registrystack.org/formats/adapter/ctl-report/v1alpha1", + "kind": "AdapterCtlReport", + "diagnostics": [], + "filesChecked": 4, + "fixtures": "contracts only, replay not run", + "posture": { + "source": "default", + "value": "production" + }, + "explicitProductionSettings": [], + "project": "." +} diff --git a/products/platform/CHANGELOG.md b/products/platform/CHANGELOG.md index c8768fa0a8..6c9c5c95b0 100644 --- a/products/platform/CHANGELOG.md +++ b/products/platform/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +- `rstack dev check` refuses incompatible owner reports and mismatched identity facts. + For Messaging it also checks the staged package, runtime input and tool around facts generation. + ## 0.50.0 - 2026-12-01 - BREAKING: Projects with authored development people must replace their grants with roles defined in `service.yaml` and assigned under `people..roles` in `dev.yaml`. See the [Stack migration notes](../../release/notes/v0.50.0.md#service-roles). From b77677dc000cda702b131711733a2ccbc1b436f7 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 08/55] test(auth): cover browser callback tokens in both postures Folds these reviewed commits: - test(auth): cover browser callback tokens in both postures - docs(auth): scope negative token fixtures to bearer admission Signed-off-by: Jeremi Joslin --- .github/scripts/ci_changes.py | 1 + crates/registry-breg-review/Cargo.toml | 2 +- .../tests/review_pages.rs | 3 + .../review_pages/token_characterisation.rs | 187 ++++++++++++++++++ .../registry-breg-review/tests/support/mod.rs | 180 +++++++++++++---- .../src/access/token_characterisation.rs | 25 ++- .../platform/conformance/tokens/README.md | 19 +- .../tokens/browser-callback-expected.json | 18 ++ .../tokens/token-fixture.schema.json | 2 +- 9 files changed, 387 insertions(+), 50 deletions(-) create mode 100644 crates/registry-breg-review/tests/review_pages/token_characterisation.rs create mode 100644 products/platform/conformance/tokens/browser-callback-expected.json diff --git a/.github/scripts/ci_changes.py b/.github/scripts/ci_changes.py index 4ec532d27b..3eb7b16a70 100644 --- a/.github/scripts/ci_changes.py +++ b/.github/scripts/ci_changes.py @@ -276,6 +276,7 @@ def literal(node: ast.expr | None) -> Any: "registry-platform-testing", "registry-adapter", "registry-breg", + "registry-breg-review", "registry-casework", "registry-coordinator", "registry-documents", diff --git a/crates/registry-breg-review/Cargo.toml b/crates/registry-breg-review/Cargo.toml index d57a86b809..673a26e344 100644 --- a/crates/registry-breg-review/Cargo.toml +++ b/crates/registry-breg-review/Cargo.toml @@ -59,7 +59,7 @@ zeroize.workspace = true [dev-dependencies] jsonschema.workspace = true registry-platform-canonical-json.workspace = true -registry-platform-testing = { workspace = true, features = ["test-authorization-server"] } +registry-platform-testing = { workspace = true, features = ["test-authorization-server", "token-fixtures"] } reqwest.workspace = true tempfile.workspace = true diff --git a/crates/registry-breg-review/tests/review_pages.rs b/crates/registry-breg-review/tests/review_pages.rs index 44f6386d7f..6b0818512b 100644 --- a/crates/registry-breg-review/tests/review_pages.rs +++ b/crates/registry-breg-review/tests/review_pages.rs @@ -4,6 +4,9 @@ mod support; +#[path = "review_pages/token_characterisation.rs"] +mod token_characterisation; + use std::time::Duration; use axum::http::StatusCode; diff --git a/crates/registry-breg-review/tests/review_pages/token_characterisation.rs b/crates/registry-breg-review/tests/review_pages/token_characterisation.rs new file mode 100644 index 0000000000..43fca21968 --- /dev/null +++ b/crates/registry-breg-review/tests/review_pages/token_characterisation.rs @@ -0,0 +1,187 @@ +// SPDX-License-Identifier: Apache-2.0 + +//! Authorization-code callback outcomes for the shared token shapes. The +//! bearer expectations stay in the shared resource-server corpus. + +use std::{collections::BTreeSet, sync::Arc}; + +use registry_platform_config::Posture; +use registry_platform_testing::{TokenCorpus, TokenSigner}; +use serde::Deserialize; + +use super::*; +use support::Callback; + +#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq)] +#[serde(rename_all = "kebab-case")] +enum Outcome { + SignedIn, + Refused, +} + +#[derive(Deserialize)] +#[serde(deny_unknown_fields)] +struct PostureOutcomes { + production: Outcome, + development: Outcome, +} + +#[derive(Deserialize)] +#[serde(deny_unknown_fields)] +struct Row { + fixture: String, + callback: Callback, + #[serde(rename = "breg-review")] + review: PostureOutcomes, +} + +#[derive(Deserialize)] +#[serde(deny_unknown_fields)] +struct Expectations { + schema: String, + rows: Vec, +} + +#[tokio::test] +async fn review_callback_matches_the_browser_token_corpus() { + use support::start_callback_corpus_provider; + + let corpus = TokenCorpus::load().expect("the bearer token corpus is valid"); + let source = include_bytes!( + "../../../../products/platform/conformance/tokens/browser-callback-expected.json" + ); + let strict = registry_platform_canonical_json::parse_json_strict(source) + .expect("the callback table is unique-member JSON"); + let expectations: Expectations = + serde_json::from_value(strict).expect("the callback table is well formed"); + assert_eq!( + expectations.schema, + "registry.browser-callback-expectations/v1" + ); + let mut keys = BTreeSet::new(); + for row in &expectations.rows { + assert!( + keys.insert((row.fixture.as_str(), row.callback)), + "duplicate callback row" + ); + let fixture = corpus + .fixture(&row.fixture) + .expect("unknown callback fixture"); + if fixture.token_use != "id" { + assert_eq!(row.review.production, Outcome::Refused); + assert_eq!(row.review.development, Outcome::Refused); + } + } + for fixture in corpus + .fixtures() + .iter() + .filter(|fixture| fixture.token_use == "id") + { + assert!( + keys.iter().any(|(id, _)| *id == fixture.id), + "missing callback row for {}", + fixture.id + ); + } + + let signer = Arc::new(TokenSigner::new()); + for posture in [Posture::Production, Posture::Development] { + let mut signed_in = 0; + let mut refused = 0; + for row in &expectations.rows { + let fixture = corpus.fixture(&row.fixture).unwrap().clone(); + let provider = + start_callback_corpus_provider(Arc::clone(&signer), fixture, row.callback).await; + let page = build_custom_issuer_page(&provider.issuer, posture, false) + .await + .unwrap(); + let response = redeem_corpus_callback(&page, &provider).await; + let expected = match posture { + Posture::Production => row.review.production, + Posture::Development => row.review.development, + }; + let context = format!("{posture:?} / {} / {:?}", row.fixture, row.callback); + assert_eq!(provider.token_calls(), 1, "{context}"); + let session_cookie_name = match posture { + Posture::Production => "__Host-breg-review-session", + Posture::Development => "breg-review-session", + }; + let cookie = response.set_cookie(session_cookie_name); + let audit = std::fs::read_to_string(&page.audit_path).unwrap(); + let terminal: serde_json::Value = + serde_json::from_str(audit.lines().last().expect("terminal callback audit")) + .unwrap(); + assert_eq!(terminal["phase"], "response", "{context}"); + assert_eq!(terminal["record"]["action"], "sign-in", "{context}"); + match expected { + Outcome::SignedIn => { + signed_in += 1; + assert_eq!(response.status, StatusCode::OK, "{context}"); + let cookie = cookie.expect("successful callback issues a session cookie"); + assert!(cookie.contains("HttpOnly"), "{context}"); + assert_eq!( + cookie.contains("; Secure"), + posture == Posture::Production, + "{context}" + ); + assert_eq!(terminal["record"]["outcome"], "ok", "{context}"); + } + Outcome::Refused => { + refused += 1; + assert_eq!(response.status, StatusCode::BAD_REQUEST, "{context}"); + assert_eq!(response.error_code(), Some("sign-in-refused"), "{context}"); + assert!(cookie.is_none(), "{context}"); + assert_eq!(terminal["record"]["outcome"], "refused", "{context}"); + } + } + } + assert!(signed_in > 0 && refused > 0); + println!("breg-review callback {posture:?}: {signed_in} signed in, {refused} refused"); + } +} + +async fn redeem_corpus_callback( + page: &CustomIssuerPage, + provider: &support::NarrowScopeProvider, +) -> support::Page { + let sign_in = page + .http + .get(format!("{}{}", page.origin, sign_in_location())) + .send() + .await + .unwrap(); + assert_eq!(sign_in.status(), StatusCode::SEE_OTHER); + let cookie = cookie_pair( + sign_in.headers()[reqwest::header::SET_COOKIE] + .to_str() + .unwrap(), + ); + // The test provider gives the browser a local authorization code. In + // production-shaped runtime config its advertised redirect is HTTPS. + let redirect = url::Url::parse( + sign_in.headers()[reqwest::header::LOCATION] + .to_str() + .unwrap(), + ) + .unwrap(); + let state = redirect + .query_pairs() + .find(|(key, _)| key == "state") + .unwrap() + .1; + let nonce = redirect + .query_pairs() + .find(|(key, _)| key == "nonce") + .unwrap() + .1; + let code = provider.issue_code(&nonce); + let callback = page + .http + .get(format!("{}/signin/callback", page.origin)) + .query(&[("state", state.as_ref()), ("code", &code)]) + .header(reqwest::header::COOKIE, cookie) + .send() + .await + .unwrap(); + support::page(callback).await +} diff --git a/crates/registry-breg-review/tests/support/mod.rs b/crates/registry-breg-review/tests/support/mod.rs index 4edfcb3fd9..04eacacd8b 100644 --- a/crates/registry-breg-review/tests/support/mod.rs +++ b/crates/registry-breg-review/tests/support/mod.rs @@ -821,20 +821,22 @@ struct NarrowScopeCode { redirect_uri: String, } -/// A minimal single-origin OpenID Connect provider whose token response -/// always states a scope narrower than the one the request asked for. -/// -/// The shared `TestAuthorizationServer` always echoes back exactly the scope -/// a request asked for, so it cannot produce this response; this provider -/// exists only to prove the sign-in client refuses a narrowed grant. +type IssueIdToken = dyn Fn(&str, NarrowScopeCode) -> String + Send + Sync; + +struct CallbackTokens { + jwks: Value, + issue: Box, +} + +/// A minimal OpenID Connect provider for callback responses the shared +/// authorization test server cannot issue. struct NarrowScopeState { issuer: String, authorization_endpoint: String, - signing_key: registry_platform_crypto::PrivateJwk, + tokens: CallbackTokens, codes: Arc>>, token_calls: Arc, scope: &'static str, - development_id_token: bool, } pub struct NarrowScopeProvider { @@ -880,21 +882,108 @@ pub async fn start_narrow_scope_provider() -> NarrowScopeProvider { pub async fn start_narrow_scope_provider_with_authorization( authorization_endpoint: Option<&str>, ) -> NarrowScopeProvider { - start_custom_provider(authorization_endpoint, "citizen:profile", false).await + start_custom_provider( + authorization_endpoint, + "citizen:profile", + synthetic_callback_tokens(false), + ) + .await } pub async fn start_development_id_token_provider( authorization_endpoint: Option<&str>, ) -> NarrowScopeProvider { - start_custom_provider(authorization_endpoint, SCOPE, true).await + start_custom_provider( + authorization_endpoint, + SCOPE, + synthetic_callback_tokens(true), + ) + .await +} + +#[derive(Clone, Copy, Debug, serde::Deserialize, Eq, Ord, PartialEq, PartialOrd)] +#[serde(rename_all = "kebab-case")] +pub enum Callback { + Bound, + ForeignIssuer, + MissingNonce, + WrongNonce, + WrongAudience, + DevelopmentMarked, +} + +pub async fn start_callback_corpus_provider( + signer: Arc, + fixture: registry_platform_testing::TokenFixture, + callback: Callback, +) -> NarrowScopeProvider { + use registry_platform_testing::{BindTarget, Binding, ClaimValue}; + + let tokens = CallbackTokens { + jwks: signer.public_key_set(), + issue: Box::new(move |issuer, pending| { + let mut projected = fixture.clone(); + // The test issues the provider's claim shape for the actual + // callback client and the pending browser exchange. + let expected_audience = if callback == Callback::WrongAudience { + "other-browser-client" + } else { + CLIENT_ID + }; + projected + .claims + .insert("aud".to_owned(), ClaimValue::Bind(BindTarget::Audience)); + if let Some(azp) = projected.claims.get_mut("azp") { + *azp = ClaimValue::Literal(json!(CLIENT_ID)); + } + if callback != Callback::ForeignIssuer { + projected + .claims + .insert("iss".to_owned(), ClaimValue::Bind(BindTarget::Issuer)); + } + projected.claims.remove("nonce"); + match callback { + Callback::MissingNonce => {} + Callback::WrongNonce => { + projected.claims.insert( + "nonce".to_owned(), + ClaimValue::Literal(json!("other-callback-nonce")), + ); + } + _ => { + let nonce = pending.nonce.expect("the page requested a nonce"); + projected + .claims + .insert("nonce".to_owned(), ClaimValue::Literal(json!(nonce))); + } + } + if callback == Callback::DevelopmentMarked { + projected.claims.insert( + "registry_posture".to_owned(), + ClaimValue::Literal(json!(registry_platform_config::DEVELOPMENT)), + ); + } + signer + .sign( + &projected, + &Binding { + issuer: issuer.to_owned(), + audience: expected_audience.to_owned(), + }, + ) + .expect("sign local callback fixture") + .expose() + .to_owned() + }), + }; + start_custom_provider(Some("https://issuer.example/authorize"), SCOPE, tokens).await } async fn start_custom_provider( authorization_endpoint: Option<&str>, scope: &'static str, - development_id_token: bool, + tokens: CallbackTokens, ) -> NarrowScopeProvider { - let (signing_key, _) = fixtures::ed25519_pair(); let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap(); let address = listener.local_addr().unwrap(); let issuer = format!("http://{address}"); @@ -904,11 +993,10 @@ async fn start_custom_provider( issuer: issuer.clone(), authorization_endpoint: authorization_endpoint .map_or_else(|| format!("{issuer}/authorize"), str::to_owned), - signing_key, + tokens, codes: Arc::clone(&codes), token_calls: Arc::clone(&token_calls), scope, - development_id_token, }); let app = Router::new() .route( @@ -943,11 +1031,7 @@ async fn narrow_scope_metadata(State(state): State>) -> Re } async fn narrow_scope_jwks(State(state): State>) -> Response { - json_response( - StatusCode::OK, - ®istry_platform_testing::jwks_from_private_jwk(&state.signing_key), - &[], - ) + json_response(StatusCode::OK, &state.tokens.jwks, &[]) } async fn narrow_scope_authorize( @@ -1007,30 +1091,7 @@ async fn narrow_scope_token(State(state): State>, body: By &[], ); }; - let now = narrow_scope_unix_now(); - let expires_at = now + 300; - let mut id_claims = serde_json::Map::new(); - id_claims.insert("iss".to_owned(), json!(state.issuer)); - id_claims.insert("sub".to_owned(), json!(pending.subject)); - id_claims.insert("aud".to_owned(), json!(CLIENT_ID)); - id_claims.insert("azp".to_owned(), json!(CLIENT_ID)); - id_claims.insert("exp".to_owned(), json!(expires_at)); - id_claims.insert("iat".to_owned(), json!(now)); - if let Some(nonce) = &pending.nonce { - id_claims.insert("nonce".to_owned(), json!(nonce)); - } - if state.development_id_token { - id_claims.insert( - "registry_posture".to_owned(), - json!(registry_platform_config::DEVELOPMENT), - ); - } - let id_token = registry_platform_testing::sign_ed25519_compact_jwt_with_key( - &state.signing_key, - "JWT", - "registry-platform-testing-ed25519-1", - Value::Object(id_claims), - ); + let id_token = (state.tokens.issue)(&state.issuer, pending); json_response( StatusCode::OK, &json!({ @@ -1044,6 +1105,39 @@ async fn narrow_scope_token(State(state): State>, body: By ) } +fn synthetic_callback_tokens(development: bool) -> CallbackTokens { + let (signing_key, _) = fixtures::ed25519_pair(); + CallbackTokens { + jwks: registry_platform_testing::jwks_from_private_jwk(&signing_key), + issue: Box::new(move |issuer, pending| { + let now = narrow_scope_unix_now(); + let expires_at = now + 300; + let mut id_claims = serde_json::Map::new(); + id_claims.insert("iss".to_owned(), json!(issuer)); + id_claims.insert("sub".to_owned(), json!(pending.subject)); + id_claims.insert("aud".to_owned(), json!(CLIENT_ID)); + id_claims.insert("azp".to_owned(), json!(CLIENT_ID)); + id_claims.insert("exp".to_owned(), json!(expires_at)); + id_claims.insert("iat".to_owned(), json!(now)); + if let Some(nonce) = &pending.nonce { + id_claims.insert("nonce".to_owned(), json!(nonce)); + } + if development { + id_claims.insert( + "registry_posture".to_owned(), + json!(registry_platform_config::DEVELOPMENT), + ); + } + registry_platform_testing::sign_ed25519_compact_jwt_with_key( + &signing_key, + "JWT", + "registry-platform-testing-ed25519-1", + Value::Object(id_claims), + ) + }), + } +} + pub struct Options { pub token_lifetime: Duration, /// Top-level blocks appended to the runtime document, such as `rateLimits`. diff --git a/crates/registry-coordinator/src/access/token_characterisation.rs b/crates/registry-coordinator/src/access/token_characterisation.rs index 8773788073..94bc03bcf8 100644 --- a/crates/registry-coordinator/src/access/token_characterisation.rs +++ b/crates/registry-coordinator/src/access/token_characterisation.rs @@ -15,8 +15,8 @@ use registry_platform_config::{DeclaredPosture, Posture, PostureSource}; use registry_platform_oidc::ActorKind; use registry_platform_testing::{ assert_token_refusal, golden_with_request_trace, request_token_route, Binding, ClaimValue, - Configuration, FixtureCase, FixtureClass, Observation, Outcome, Stage, TokenCorpus, - TokenFixture, TokenSigner, + Configuration, FixtureCase, FixtureClass, Observation, Outcome, RowConfiguration, Stage, + TokenCorpus, TokenFixture, TokenSigner, }; use serde_json::json; use serde_json::Value; @@ -394,6 +394,27 @@ async fn caller_authentication_matches_the_token_corpus() { ) .await .expect("the corpus runs"); + for (fixture, stage) in [ + ("thunderid-id-token", Stage::Audience), + ("keycloak-id-token", Stage::Audience), + ("supabase-id-token", Stage::Audience), + ("entra-id-token", Stage::TokenType), + ] { + let row = report + .rows + .iter() + .find(|row| { + row.fixture == fixture + && row.against == registry_platform_testing::Against::PlainRead + && row.configuration == RowConfiguration::JwtAccepted + }) + .expect("each ID-token refusal has a JWT-accepted row"); + assert_eq!( + row.observed, + Some(Outcome::Refused(stage)), + "{posture:?} / {fixture}" + ); + } report.print_counts(posture); reports.push(report); } diff --git a/products/platform/conformance/tokens/README.md b/products/platform/conformance/tokens/README.md index c69844bd00..7d9f10402e 100644 --- a/products/platform/conformance/tokens/README.md +++ b/products/platform/conformance/tokens/README.md @@ -9,7 +9,8 @@ A fixture is data. The test loader signs it in memory when a test runs. Each con | Path | Content | | --- | --- | | `fixtures/.json` | One decoded token shape per file. | -| `expected.yaml` | The expected result for each fixture, product and configuration. | +| `expected.yaml` | The expected bearer result for each fixture, product and configuration. | +| `browser-callback-expected.json` | The BReg Review callback column, using the same token shapes in the authorization-code response. | | `token-fixture.schema.json` | The JSON Schema every fixture must satisfy. | The loader, the signer and the test driver live in `crates/registry-platform-testing`, behind the `token-fixtures` feature. Each product's test passes its own authenticator to that driver. @@ -18,7 +19,7 @@ The loader, the signer and the test driver live in `crates/registry-platform-tes A **positive** fixture is a token that a correctly configured product can admit for a plain read. It is here to show what a product must accept from a provider's stock output, or what it refuses today and why. -A **negative** fixture is a token that every product must refuse, in every configuration. Examples are an ID token, a refresh token, an API key, and a token from an issuer that no product trusts. A negative fixture admitted by any product is a security defect. Report it through `SECURITY.md`. Do not open a public issue or pull request. +A **negative** bearer fixture is a token that every resource server must refuse in every corpus configuration. Examples include an ID token, a refresh token, an API key and a token from an issuer that no product trusts. Bearer admission of any negative fixture is a security defect. Report it through `SECURITY.md`. Do not open a public issue or pull request. ## Providers covered @@ -116,6 +117,17 @@ The head of `expected.yaml` lists the choices the driver makes for every row, su 5. Add a row to `expected.yaml` for each configuration you want to cover, with a cell for every product. If you could not read a product's code to the end, write `unknown` and give the reason. Do not guess. 6. Run the corpus test. It checks that every fixture has a row and every row has every product, and that negative fixtures have no admission expectations. +## BReg Review sign-in callback + +The browser callback table gives BReg Review its own column in production and development. +An authorization-code response carries an ID token for the Review client. The callback verifies the token and creates a browser session. +The bearer table continues to refuse those same ID token shapes at resource servers. + +The callback test reuses the loaded corpus fixtures and binds the test issuer, the Review client audience and the pending browser nonce. +A foreign-issuer row retains the fixture's literal issuer. The fixture records use synthetic values. +The test crosses the actual callback and code redemption over loopback. +It asserts the HTML result, session cookie and terminal sign-in audit, including no cookie after a refusal. + ## Surfaces with dedicated credential tests | Surface | Credential and test that verifies it | @@ -131,7 +143,7 @@ The head of `expected.yaml` lists the choices the driver makes for every row, su | Coordinator signed webhook ingress | Signed event and correlated delivery envelope. [Event trigger tests](../../../../crates/registry-coordinator/src/event_trigger_tests.rs). | | BReg signed webhook ingress | Signed review completion bound to its recipient. [Authentication refusal goldens](../../../../crates/registry-breg/tests/authentication_refusals.rs). | | Messaging provider callbacks | Provider-configured HMAC or path token. [PostgreSQL callback tests](../../../../crates/registry-messaging/tests/postgres_callbacks.rs). | -| BReg Review browser routes | Authorization-code sign-in, callback state and browser session cookies. [Review page tests](../../../../crates/registry-breg-review/tests/review_pages.rs). | +| BReg Review browser routes | Authorization-code sign-in, callback state and browser session cookies. [Callback corpus](../../../../crates/registry-breg-review/tests/review_pages/token_characterisation.rs) and [review page tests](../../../../crates/registry-breg-review/tests/review_pages.rs). | | Registry Session browser routes | Authorization-code sign-in and host-only session cookies. [Public session tests](../../../../crates/registry-session/tests/public.rs). | | Discovery public routes | Public unauthenticated search and resolution. [HTTP journey](../../../../crates/registry-discovery/tests/http_journey.rs). | @@ -149,6 +161,7 @@ cargo test --locked -p registry-breg --features runtime --lib token_characterisa cargo test --locked -p registry-casework -p registry-documents -p registry-evidence -p registry-evidence-oid4vci -p registry-messaging -p registry-scheduling --lib token_characterisation -- --nocapture cargo test --locked -p registry-adapter -p registry-coordinator -p registry-mcp-edge -p registry-render --lib token_characterisation -- --nocapture cargo test --locked -p registry-evidence-oid4vp --lib token_characterisation -- --nocapture +cargo test --locked -p registry-breg-review --test review_pages token_characterisation -- --nocapture cargo test --locked -p registry-mcp --test serve production_and_development_refusals_preserve_status_and_posture_detail cargo test --locked -p registry-breg-mcp --test mcp_gateway production_and_development_refusals_preserve_status_and_posture_detail ``` diff --git a/products/platform/conformance/tokens/browser-callback-expected.json b/products/platform/conformance/tokens/browser-callback-expected.json new file mode 100644 index 0000000000..f14cc9b844 --- /dev/null +++ b/products/platform/conformance/tokens/browser-callback-expected.json @@ -0,0 +1,18 @@ +{ + "schema": "registry.browser-callback-expectations/v1", + "rows": [ + {"fixture": "thunderid-id-token", "callback": "bound", "breg-review": {"production": "signed-in", "development": "signed-in"}}, + {"fixture": "keycloak-id-token", "callback": "bound", "breg-review": {"production": "signed-in", "development": "signed-in"}}, + {"fixture": "supabase-id-token", "callback": "bound", "breg-review": {"production": "signed-in", "development": "signed-in"}}, + {"fixture": "entra-id-token", "callback": "bound", "breg-review": {"production": "signed-in", "development": "signed-in"}}, + {"fixture": "esignet-id-token", "callback": "foreign-issuer", "breg-review": {"production": "refused", "development": "refused"}}, + {"fixture": "esignet-standin-id-token", "callback": "foreign-issuer", "breg-review": {"production": "refused", "development": "refused"}}, + {"fixture": "thunderid-id-token", "callback": "missing-nonce", "breg-review": {"production": "refused", "development": "refused"}}, + {"fixture": "thunderid-id-token", "callback": "wrong-nonce", "breg-review": {"production": "refused", "development": "refused"}}, + {"fixture": "thunderid-id-token", "callback": "wrong-audience", "breg-review": {"production": "refused", "development": "refused"}}, + {"fixture": "thunderid-id-token", "callback": "development-marked", "breg-review": {"production": "refused", "development": "signed-in"}}, + {"fixture": "thunderid-user-access", "callback": "bound", "breg-review": {"production": "refused", "development": "refused"}}, + {"fixture": "thunderid-refresh-token", "callback": "bound", "breg-review": {"production": "refused", "development": "refused"}}, + {"fixture": "supabase-api-key-opaque", "callback": "bound", "breg-review": {"production": "refused", "development": "refused"}} + ] +} diff --git a/products/platform/conformance/tokens/token-fixture.schema.json b/products/platform/conformance/tokens/token-fixture.schema.json index 5f0f80ca88..e81c8d79ba 100644 --- a/products/platform/conformance/tokens/token-fixture.schema.json +++ b/products/platform/conformance/tokens/token-fixture.schema.json @@ -11,7 +11,7 @@ "id": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" }, "class": { "enum": ["positive", "negative"], - "description": "A positive fixture is one a correctly configured product can admit for a plain read. A negative fixture is one every product must refuse." + "description": "A positive fixture is one a correctly configured product can admit for a plain read. Every resource server must refuse a negative fixture for bearer admission." }, "provider": { "enum": ["keycloak", "thunderid", "entra", "supabase-auth", "esignet", "rstack-dev", "synthetic"] }, "kind": { "enum": ["user-access", "client-access", "user-id", "user-refresh", "api-key"] }, From 68b0563ff133596973a344b39c5597bfc1b01cce Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 09/55] feat(rstack): prove holder renewal and bind holder preparation to one BReg Action Folds these reviewed commits: - test(breg): prove holder renewal and crossed authority refusals - feat(rstack): bind holder preparation to one BReg action Signed-off-by: Jeremi Joslin --- clients/typescript/holder-function.ts | 132 +++++++++ .../typescript/tests/holder-function.test.ts | 279 ++++++++++++++++++ .../holder-authorized-action/README.md | 16 + .../dev-journeys.yaml | 12 + .../holder-authorized-action/dev.yaml | 26 ++ .../holder-authorized-action/service.yaml | 12 + .../holder-authorized-action/verify.sh | 119 ++++++++ 7 files changed, 596 insertions(+) create mode 100644 clients/typescript/holder-function.ts create mode 100644 clients/typescript/tests/holder-function.test.ts create mode 100644 products/breg/fixtures/holder-authorized-action/README.md create mode 100644 products/breg/fixtures/holder-authorized-action/dev-journeys.yaml create mode 100644 products/breg/fixtures/holder-authorized-action/dev.yaml create mode 100644 products/breg/fixtures/holder-authorized-action/service.yaml create mode 100755 products/breg/fixtures/holder-authorized-action/verify.sh diff --git a/clients/typescript/holder-function.ts b/clients/typescript/holder-function.ts new file mode 100644 index 0000000000..eb69f84a5a --- /dev/null +++ b/clients/typescript/holder-function.ts @@ -0,0 +1,132 @@ +import { RegistryError } from './core.ts' + +const uuid = /^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/u +const strongTag = /^"[\x21\x23-\x7e]{1,254}"$/u +const maximumRequestBytes = 32_768 +const bodyTooLarge = Symbol('body too large') + +interface HolderSubmission { + recordId: string + ifMatch: string + preparation: Preparation +} + +interface HolderCommand { + recordId: string + ifMatch: string + idempotencyKey: string + input: Input + signal: AbortSignal +} + +/** Host-owned parsing and invocation for one generated BReg Action and its fixed access profile. */ +interface HolderActionBinding { + path: string + parseSubmission: (body: unknown) => HolderSubmission | undefined + parsePreparation: (body: unknown) => Input | undefined + invoke: (credential: string, command: HolderCommand) => Promise<{ recordId: string }> +} + +function reply(body: object, status: number): Response { + return Response.json(body, { status, headers: { 'Cache-Control': 'no-store' } }) +} + +function parseJson(source: string): unknown { + const value: unknown = JSON.parse(source, (_key, member: unknown) => { + if (typeof member === 'number' && + (!Number.isFinite(member) || Number.isInteger(member) && !Number.isSafeInteger(member))) { + throw new SyntaxError('Unsupported JSON number.') + } + return member + }) + // On valid JSON, a quoted token followed by a colon is an object key. + // Decode the key before comparing so Unicode escapes cannot hide duplicates. + const objects: Set[] = [] + for (const [token, quoted, colon] of source.matchAll(/("(?:[^"\\]|\\.)*")(\s*:)?|[{}]/gu)) { + if (token === '{') objects.push(new Set()) + if (token === '}') objects.pop() + if (quoted && colon) { + const keys = objects.at(-1)! + const key: string = JSON.parse(quoted) + if (keys.has(key)) throw new SyntaxError('Duplicate JSON member.') + keys.add(key) + } + } + return value +} + +async function readSubmission(request: Request): Promise { + if (!request.body) return undefined + const reader = request.body.getReader() + const decoder = new TextDecoder('utf-8', { fatal: true }) + let bytes = 0 + let body = '' + try { + for (let chunk = await reader.read(); !chunk.done; chunk = await reader.read()) { + bytes += chunk.value.byteLength + if (bytes > maximumRequestBytes) { + await reader.cancel() + return bodyTooLarge + } + body += decoder.decode(chunk.value, { stream: true }) + } + return parseJson(body + decoder.decode()) + } finally { + reader.releaseLock() + } +} + +/** Use on the trusted invoker's gateway-only listener. Preparation must reproduce the same input on retry. */ +export function createHolderActionHandler( + { path, parseSubmission, parsePreparation, invoke }: HolderActionBinding, + prepare: (input: Preparation) => unknown | Promise, +): (request: Request) => Promise { + if (!/^\/api\/functions\/[a-z][a-z0-9_-]{0,63}$/u.test(path)) throw new TypeError('Expected a declared function path.') + + return async request => { + const url = new URL(request.url) + if (request.method !== 'POST' || url.pathname !== path || url.search || url.hash) { + return reply({ message: 'Unknown function route.' }, 404) + } + const credential = /^Bearer ([A-Za-z0-9._-]+)$/u.exec(request.headers.get('authorization') ?? '')?.[1] + if (!credential) return reply({ message: 'Sign in to continue.' }, 401) + + const idempotencyKey = request.headers.get('idempotency-key') + const mediaType = request.headers.get('content-type')?.split(';', 1)[0]?.trim().toLowerCase() + if (!idempotencyKey || !uuid.test(idempotencyKey.toLowerCase()) || mediaType !== 'application/json') { + return reply({ message: 'Send a JSON request with its attempt key.' }, 400) + } + let submission: HolderSubmission | undefined + try { + const body = await readSubmission(request) + if (body === bodyTooLarge) return reply({ message: 'The request is too large.' }, 413) + if (body !== undefined) submission = parseSubmission(body) + } catch { + return reply({ message: 'Send a valid JSON request.' }, 400) + } + if (!submission || !uuid.test(submission.recordId) || !strongTag.test(submission.ifMatch)) { + return reply({ message: 'Send a record and its reviewed condition.' }, 400) + } + const { recordId, ifMatch, preparation } = submission + + let input: Input | undefined + try { + request.signal.throwIfAborted() + input = parsePreparation(await prepare(preparation)) + } catch { + return reply({ message: 'The function could not prepare the request.' }, 502) + } + if (!input || request.signal.aborted) return reply({ message: 'The function could not prepare the request.' }, 502) + + try { + const result = await invoke(credential, { recordId, ifMatch, idempotencyKey, input, signal: request.signal }) + if (result.recordId === recordId) return reply({ recordId }, 200) + } catch (error) { + if (error instanceof RegistryError && error.kind === 'refused' && !error.outcomeUnknown && + error.status !== undefined && error.status >= 400 && error.status < 500) { + return reply({ message: 'BReg refused the request.' }, error.status) + } + } + return reply({ message: 'The Action outcome is unavailable. Retry the same attempt.' }, 502) + } +} diff --git a/clients/typescript/tests/holder-function.test.ts b/clients/typescript/tests/holder-function.test.ts new file mode 100644 index 0000000000..86abc8e5f4 --- /dev/null +++ b/clients/typescript/tests/holder-function.test.ts @@ -0,0 +1,279 @@ +import assert from 'node:assert/strict' +import test from 'node:test' +import { Transport, type Operation } from '../core.ts' +import { createHolderActionHandler } from '../holder-function.ts' + +const route = '/api/functions/renew' +const licenceId = 'c137aa49-8a74-4d63-9f38-47fde38b2949' +const otherLicenceId = 'a4d5b3fe-eaf4-456e-ae33-9ef6b85fa4b2' +const reviewedExpiresOn = '2027-06-30' +const newExpiresOn = '2028-06-30' +const ifMatch = '"reviewed-revision"' +const otherIfMatch = '"other-reviewed-revision"' +const idempotencyKey = '08114403-75d2-48d3-961a-5d4fb8b19687' +const holderAuthorization = 'Bearer synthetic-holder' +const submission = { licenceId, reviewedExpiresOn, preconditions: { licenceId: { ifMatch } } } +const holder = { subject: 'person-a', holderRef: 'holder-a', actor: 'human', client: 'licence-holder', + profile: 'licence-holder', audience: 'licences' } +const identities = new Map([ + [holderAuthorization, holder], + ['Bearer synthetic-other-subject', { ...holder, subject: 'person-b', holderRef: 'holder-b' }], + ['Bearer synthetic-agent', { ...holder, actor: 'agent' }], + ['Bearer synthetic-officer', { ...holder, profile: 'licence-officer' }], + ['Bearer synthetic-other-client', { ...holder, client: 'other' }], + ['Bearer synthetic-other-audience', { ...holder, audience: 'other' }], +]) +const records = new Map([[licenceId, { holderRef: 'holder-a', ifMatch }], + [otherLicenceId, { holderRef: 'holder-b', ifMatch: otherIfMatch }]]) +const otherSubmission = { ...submission, licenceId: otherLicenceId, preconditions: { licenceId: { ifMatch: otherIfMatch } } } + +const renewal: Operation = { + method: 'POST', path: '/v1/actions/renew', product: 'breg', + accessProfileParameter: true, accessProfileRequired: true, + keyed: true, mutating: true, requestMediaType: 'application/json', + problemValidators: { default: value => exactObject(value, ['code', 'detail', 'status']) }, + responses: { 200: [{ mode: 'json', mediaType: 'application/json' }] }, +} + +function exactObject(value: unknown, keys: readonly string[]): value is Record { + return value !== null && typeof value === 'object' && !Array.isArray(value) + && Object.keys(value).length === keys.length && keys.every(key => Object.hasOwn(value, key)) +} + +function parseSubmission(value: unknown) { + if (!exactObject(value, ['licenceId', 'reviewedExpiresOn', 'preconditions']) || + typeof value.licenceId !== 'string' || typeof value.reviewedExpiresOn !== 'string' || + !exactObject(value.preconditions, ['licenceId']) || !exactObject(value.preconditions.licenceId, ['ifMatch']) || + typeof value.preconditions.licenceId.ifMatch !== 'string') return undefined + return { + recordId: value.licenceId, ifMatch: value.preconditions.licenceId.ifMatch, + preparation: { reviewedExpiresOn: value.reviewedExpiresOn }, + } +} + +function parsePreparation(value: unknown) { + if (!exactObject(value, ['newExpiresOn']) || typeof value.newExpiresOn !== 'string') return undefined + return { newExpiresOn: value.newExpiresOn } +} + +function request(options: { path?: string; authorization?: string | null; body?: unknown; key?: string } = {}) { + const { path = route, authorization = holderAuthorization, body = submission, key = idempotencyKey } = options + const headers = new Headers({ + 'Content-Type': 'application/json', 'Idempotency-Key': key, + 'Registry-Client': 'page', Cookie: 'synthetic-cookie', 'X-Actor': 'synthetic-spoofed-actor', + }) + if (authorization !== null) headers.set('Authorization', authorization) + return new Request('https://service.test' + path, { method: 'POST', headers, body: JSON.stringify(body) }) +} + +function prepareRenewal({ reviewedExpiresOn }: { reviewedExpiresOn: string }) { + const year = Number(reviewedExpiresOn.slice(0, 4)) + return { newExpiresOn: String(year + 1) + reviewedExpiresOn.slice(4) } +} + +function setup(prepare: (input: { reviewedExpiresOn: string }) => unknown = prepareRenewal, + { loseFirstReceipt = false, parse = parseSubmission, receiptRecordId = '' } = {}, +) { + const preparations: unknown[][] = [] + const calls: { url: string; method: string | undefined; headers: Record; body: unknown }[] = [] + const writes: string[] = [] + const committed = new Map() + + const fetchProduct: typeof fetch = async (target, options) => { + const url = new URL(String(target)) + const headers = new Headers(options?.headers) + const body = JSON.parse(String(options?.body)) + calls.push({ url: url.href, method: options?.method, headers: Object.fromEntries(headers), body }) + if (url.pathname !== renewal.path || options?.method !== 'POST' || url.searchParams.get('accessProfile') !== 'licence-holder') { + throw new Error('The caller changed the checked Action contract.') + } + const refuse = (status: number, code = 'synthetic.refusal') => Response.json({ status, code, detail: 'product-only detail' }, + { status, headers: { 'Content-Type': 'application/problem+json' } }) + const identity = identities.get(headers.get('authorization') ?? '') + if (!identity || identity.audience !== 'licences') return refuse(401) + if (identity.actor !== 'human' || identity.client !== 'licence-holder' || identity.profile !== 'licence-holder') return refuse(403) + const record = records.get(body.input.licenceId) + if (record?.holderRef !== identity.holderRef || body.preconditions.licenceId.ifMatch !== record.ifMatch) return refuse(412) + if (body.input.newExpiresOn !== newExpiresOn) return refuse(412, 'synthetic.guard') + const receiptKey = identity.subject + ':' + headers.get('idempotency-key') + const command = JSON.stringify(body) + if (committed.has(receiptKey)) { + if (committed.get(receiptKey) !== command) return refuse(409) + return Response.json({ recordId: body.input.licenceId }) + } + committed.set(receiptKey, command) + writes.push(body.input.licenceId) + if (loseFirstReceipt && writes.length === 1) throw new Error('Simulated lost product receipt') + return Response.json({ recordId: receiptRecordId || body.input.licenceId, detail: 'product-only detail' }) + } + + const handle = createHolderActionHandler({ + path: route, + parseSubmission: parse, + parsePreparation, + async invoke(credential, command) { + const { recordId, ifMatch, input, idempotencyKey, signal } = command + const client = new Transport({ baseUrl: 'https://licences.test', token: () => credential, fetch: fetchProduct }) + const { data } = await client.call<{ recordId: string }>(renewal, { + query: { accessProfile: 'licence-holder' }, + body: { input: { licenceId: recordId, newExpiresOn: input.newExpiresOn }, preconditions: { licenceId: { ifMatch } } }, + idempotencyKey, + signal, + }) + return data + }, + }, (...args) => { + preparations.push(args) + return prepare(...args) + }) + return { handle, preparations, calls, writes } +} + +test('preparation receives one projected value and the checked Action receives the holder command', async () => { + const { handle, preparations, calls, writes } = setup() + const result = await handle(request()) + assert.equal(result.status, 200) + assert.deepEqual(await result.json(), { recordId: licenceId }) + assert.deepEqual(preparations, [[{ reviewedExpiresOn }]]) + assert.equal(calls.length, 1) + const call = calls[0]! + assert.equal(call.url, 'https://licences.test/v1/actions/renew?accessProfile=licence-holder') + assert.equal(call.method, 'POST') + assert.equal(call.headers.authorization, holderAuthorization) + assert.equal(call.headers['idempotency-key'], idempotencyKey) + for (const header of ['cookie', 'registry-client', 'x-actor']) assert.equal(call.headers[header], undefined) + assert.deepEqual(call.body, { input: { licenceId, newExpiresOn }, preconditions: { licenceId: { ifMatch } } }) + assert.deepEqual(writes, [licenceId]) +}) + +test('a missing caller or request outside the declared binding never reaches preparation or BReg', async () => { + const { handle, preparations, calls } = setup() + const cases = [ + [request({ authorization: null }), 401], + [request({ path: route + '/other' }), 404], + [request({ path: route + '?accessProfile=licence-officer' }), 404], + [request({ path: '/api/functions/issue' }), 404], + [request({ body: { ...submission, action: 'issue' } }), 400], + [request({ body: { ...submission, product: 'other' } }), 400], + [request({ body: { ...submission, accessProfile: 'licence-officer' } }), 400], + [request({ body: { ...submission, subject: 'other' } }), 400], + [request({ body: { ...submission, licenceId: licenceId.toUpperCase() } }), 400], + [request({ key: 'wrong' }), 400], + ] as const + for (const [incoming, expected] of cases) assert.equal((await handle(incoming)).status, expected) + assert.deepEqual(preparations, []) + assert.deepEqual(calls, []) +}) + +test('a preparation result outside its projection cannot substitute the target or invoke BReg', async () => { + const { handle, preparations, calls } = setup(() => ({ newExpiresOn, licenceId: otherLicenceId })) + assert.equal((await handle(request())).status, 502) + assert.deepEqual(preparations, [[{ reviewedExpiresOn }]]) + assert.deepEqual(calls, []) +}) + +test('a throwing submission parser returns a fixed refusal before preparation or BReg', async () => { + const { handle, preparations, calls } = setup(prepareRenewal, { + parse() { throw new Error('submitted values excluded from the reply') }, + }) + const response = await handle(request()) + assert.equal(response.status, 400) + assert.doesNotMatch(await response.text(), /submitted values/u) + assert.deepEqual(preparations, []) + assert.deepEqual(calls, []) +}) + +test('absent and oversized bodies are refused before the submission parser', async () => { + let parsed = 0 + const { handle, preparations, calls } = setup(prepareRenewal, { + parse() { parsed++; return parseSubmission(submission) }, + }) + const { url, headers, method } = request() + assert.equal((await handle(new Request(url, { headers, method }))).status, 400) + assert.equal((await handle(request({ body: 'x'.repeat(32_768) }))).status, 413) + assert.equal(parsed, 0) + assert.deepEqual(preparations, []) + assert.deepEqual(calls, []) +}) + +test('ambiguous request JSON is refused before the submission parser', async () => { + let parsed = 0 + const { handle, preparations, calls } = setup(prepareRenewal, { + parse() { parsed++; return parseSubmission(submission) }, + }) + const { url, headers, method } = request() + const cases = [ + '{"preconditions":{"licenceId":{"ifMatch":"a","ifM\\u0061tch":"b"}}}', + '{"input":9007199254740993}', + ] + for (const body of cases) assert.equal((await handle(new Request(url, { headers, method, body }))).status, 400) + assert.equal(parsed, 0) + assert.deepEqual(preparations, []) + assert.deepEqual(calls, []) +}) + +test('the owning product refuses a wrong subject, actor, role, client, audience, target, or condition', async () => { + const { handle, calls, writes } = setup() + const refusals = [ + [request({ authorization: 'Bearer synthetic-other-subject' }), 412], + [request({ authorization: 'Bearer synthetic-agent' }), 403], + [request({ authorization: 'Bearer synthetic-officer' }), 403], + [request({ authorization: 'Bearer synthetic-other-client' }), 403], + [request({ authorization: 'Bearer synthetic-other-audience' }), 401], + [request({ body: otherSubmission }), 412], + [request({ authorization: 'Bearer synthetic-other-subject', body: { ...submission, licenceId: otherLicenceId } }), 412], + [request({ body: { ...submission, preconditions: { licenceId: { ifMatch: '"stale-revision"' } } } }), 412], + ] as const + for (const [incoming, expected] of refusals) { + const response = await handle(incoming) + assert.equal(response.status, expected) + assert.doesNotMatch(await response.text(), /product-only detail|synthetic/u) + } + assert.equal(calls.length, refusals.length) + assert.deepEqual(writes, []) +}) + +test('overlapping requests keep each captured holder and exact target together', async () => { + const { handle, calls, writes } = setup() + const [first, second] = await Promise.all([ + handle(request()), + handle(request({ authorization: 'Bearer synthetic-other-subject', body: otherSubmission })), + ]) + assert.deepEqual([first.status, second.status], [200, 200]) + assert.deepEqual(await first.json(), { recordId: licenceId }) + assert.deepEqual(await second.json(), { recordId: otherLicenceId }) + assert.deepEqual(calls.map(call => call.headers.authorization).sort(), + [holderAuthorization, 'Bearer synthetic-other-subject'].sort()) + assert.deepEqual(writes.sort(), [licenceId, otherLicenceId].sort()) +}) + +test('a product refusal of the prepared value stays a refusal', async () => { + const { handle, calls, writes } = setup(() => ({ newExpiresOn: '2031-07-01' })) + const response = await handle(request()) + assert.equal(response.status, 412) + assert.deepEqual(await response.json(), { message: 'BReg refused the request.' }) + assert.equal(calls.length, 1) + assert.deepEqual(writes, []) +}) + +test('a product receipt for a different record leaves the original attempt unconfirmed', async () => { + const { handle, calls } = setup(prepareRenewal, { receiptRecordId: otherLicenceId }) + const response = await handle(request()) + assert.equal(response.status, 502) + assert.doesNotMatch(await response.text(), new RegExp(otherLicenceId, 'u')) + assert.equal(calls.length, 1) +}) + +test('after a lost product receipt the same renewal prepares the same command and reads back one effect', async () => { + const { handle, calls, preparations, writes } = setup(prepareRenewal, { loseFirstReceipt: true }) + const first = await handle(request()) + assert.equal(first.status, 502) + assert.doesNotMatch(await first.text(), /Simulated/u) + const retry = await handle(request()) + assert.equal(retry.status, 200) + assert.deepEqual(await retry.json(), { recordId: licenceId }) + assert.equal(calls.length, 2) + assert.deepEqual(calls[0], calls[1]) + assert.deepEqual(preparations, [[{ reviewedExpiresOn }], [{ reviewedExpiresOn }]]) + assert.deepEqual(writes, [licenceId]) +}) diff --git a/products/breg/fixtures/holder-authorized-action/README.md b/products/breg/fixtures/holder-authorized-action/README.md new file mode 100644 index 0000000000..a1f2f47f88 --- /dev/null +++ b/products/breg/fixtures/holder-authorized-action/README.md @@ -0,0 +1,16 @@ +# Holder-authorized renewal fixture + +Pass `verify.sh` the absolute paths to matching `rstack`, `breg`, and +`bregctl` binaries with named-role support. Then pass the medical-renewal +preview's `project` directory and a new private work directory. The script +copies the preview's Record types and Actions and starts disposable PostgreSQL +with Docker. + +The fixture exercises the served BReg routes with two holders and an officer. +A holder reads a target condition, renews their own licence and retries the same +command. The other licence's condition and write remain protected. The officer's +credential is refused on the holder profile. The other holder verifies that +the refused requests leave both the expiry and target condition unchanged. + +The separate holder-functions journey proves the function input and credential +boundary. This fixture reaches BReg directly. diff --git a/products/breg/fixtures/holder-authorized-action/dev-journeys.yaml b/products/breg/fixtures/holder-authorized-action/dev-journeys.yaml new file mode 100644 index 0000000000..e1967bc4fb --- /dev/null +++ b/products/breg/fixtures/holder-authorized-action/dev-journeys.yaml @@ -0,0 +1,12 @@ +# yaml-language-server: $schema=https://id.registrystack.org/schemas/rstack/journeys/journeys.v1alpha1.schema.json +apiVersion: id.registrystack.org/formats/rstack/journeys/v1alpha1 +kind: RStackJourneys +journeys: + - id: holder-profile + steps: + - id: holder-lists-licences + product: breg + as: holder + method: GET + path: /v1/records/licences + expect: {status: 200} diff --git a/products/breg/fixtures/holder-authorized-action/dev.yaml b/products/breg/fixtures/holder-authorized-action/dev.yaml new file mode 100644 index 0000000000..cb99483002 --- /dev/null +++ b/products/breg/fixtures/holder-authorized-action/dev.yaml @@ -0,0 +1,26 @@ +# yaml-language-server: $schema=https://id.registrystack.org/schemas/rstack/dev/dev.v1alpha1.schema.json +apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 +kind: RStackDev +issuer: https://identity.licences.example.test +products: + - {product: breg, project: ., audience: "urn:example:licence-registry"} +people: + holder: + subject: 00000000-0000-4000-8000-000000000101 + client: licence-holder + roles: [licence-holder] + claims: + breg: {holder_ref: synthetic-doctor-holder} + officer: + subject: 00000000-0000-4000-8000-000000000102 + client: licence-officer + roles: [licence-officer] + claims: + breg: {jurisdiction: north} + other-holder: + subject: 00000000-0000-4000-8000-000000000103 + client: licence-holder + roles: [licence-holder] + claims: + breg: {holder_ref: synthetic-other-holder} +journeyFile: dev-journeys.yaml diff --git a/products/breg/fixtures/holder-authorized-action/service.yaml b/products/breg/fixtures/holder-authorized-action/service.yaml new file mode 100644 index 0000000000..8f1f73c816 --- /dev/null +++ b/products/breg/fixtures/holder-authorized-action/service.yaml @@ -0,0 +1,12 @@ +# yaml-language-server: $schema=https://id.registrystack.org/schemas/rstack/service/service.v1alpha1.schema.json +apiVersion: id.registrystack.org/formats/rstack/service/v1alpha1 +kind: RStackService +roles: + licence-holder: + actorKind: human + claims: [holder_ref] + accessProfiles: {breg: [licence-holder]} + licence-officer: + actorKind: human + claims: [jurisdiction] + accessProfiles: {breg: [licence-officer]} diff --git a/products/breg/fixtures/holder-authorized-action/verify.sh b/products/breg/fixtures/holder-authorized-action/verify.sh new file mode 100755 index 0000000000..36aaf51405 --- /dev/null +++ b/products/breg/fixtures/holder-authorized-action/verify.sh @@ -0,0 +1,119 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ $# != 5 ]]; then + printf 'Usage: %s ABSOLUTE_RSTACK ABSOLUTE_BREG ABSOLUTE_BREGCTL ABSOLUTE_MEDICAL_PROJECT ABSOLUTE_NEW_WORK_DIR\n' "$0" >&2 + exit 2 +fi + +rstack="$1" +export RSTACK_BREG_BIN="$2" RSTACK_BREGCTL_BIN="$3" +donor="$4" +scratch="$5" +for path in "$rstack" "$RSTACK_BREG_BIN" "$RSTACK_BREGCTL_BIN" "$donor" "$scratch"; do + [[ "$path" = /* ]] +done +fixture="${BASH_SOURCE[0]%/*}" +mkdir -m 700 "$scratch" +cp -R "$donor" "$scratch/project" +cp "$fixture/dev.yaml" "$fixture/dev-journeys.yaml" "$fixture/service.yaml" "$scratch/project/" +unset RSTACK_DEV_DATABASE_URL RSTACK_DEV_DATABASE_CA +export RSTACK_DEV_STATE_DIR="$scratch/state" +dev=("$rstack" --install-root "$scratch/install" --format json dev) +run_id='' + +cleanup() { + if [[ -n "$run_id" ]]; then + "${dev[@]}" stop "$run_id" --clean >"$scratch/stop.json" + jq -e '.status == "stopped"' "$scratch/stop.json" >/dev/null + fi +} +trap cleanup EXIT + +"${dev[@]}" start "$scratch/project" --ttl 5m >"$scratch/start.json" +run_id="$(jq -er '.run_id' "$scratch/start.json")" +origin="$(jq -er '.products.breg' "$scratch/start.json")" +[[ "$origin" =~ ^http://127\.0\.0\.1:[0-9]+$ ]] + +credential_file() { + local actor="$1" file + file="$("${dev[@]}" token "$run_id" --as "$actor" | jq -er '.credentials[0].header_file')" || return + [[ "$file" = "$scratch/"* && -f "$file" ]] || return + printf '%s\n' "$file" +} + +holder="$(credential_file holder)" +other_holder="$(credential_file other-holder)" +officer="$(credential_file officer)" +response="$scratch/response.json" + +http() { + local credential="$1" method="$2" route="$3" expected="$4" body="${5:-}" key="${6:-}" + local status + local -a arguments=(--silent --show-error --noproxy '*' --max-time 10 --request "$method" + --header "@$credential" --output "$response" --write-out '%{http_code}') + if [[ -n "$body" ]]; then + arguments+=(--header 'Content-Type: application/json' --data "$body") + fi + if [[ -n "$key" ]]; then + arguments+=(--header "Idempotency-Key: $key") + fi + status="$(curl "${arguments[@]}" "$origin$route")" + if [[ "$status" != "$expected" ]]; then + printf 'Expected HTTP %s, received %s\n' "$expected" "$status" >&2 + jq -c '{code, status}' "$response" >&2 + return 1 + fi +} + +issue() { + local number="$1" holder_ref="$2" body + body="$(jq -cn --arg number "$number" --arg holder "$holder_ref" ' + {input:{licenceNumber:$number,holderRef:$holder,holderName:"Example Holder", + profession:"doctor",jurisdiction:"north",issuedOn:"2026-07-01",expiresOn:"2027-06-30"}} + ')" + http "$officer" POST '/v1/actions/issue?accessProfile=licence-officer' 200 "$body" "issue-$number" || return + jq -er '.results.licence.recordId' "$response" +} + +conditions() { + local credential="$1" licence="$2" expected="$3" body + body="$(jq -cn --arg id "$licence" '{input:{licenceId:$id}}')" + http "$credential" POST '/v1/actions/renew/target-conditions?accessProfile=licence-holder' "$expected" "$body" +} + +renewal() { + jq -cn --arg id "$1" --arg tag "$2" ' + {input:{licenceId:$id,newExpiresOn:"2028-06-30"},preconditions:{licenceId:{ifMatch:$tag}}} + ' +} + +own="$(issue MED-2026-001 synthetic-doctor-holder)" +foreign="$(issue MED-2026-002 synthetic-other-holder)" +[[ "$own" != "$foreign" ]] + +conditions "$holder" "$own" 200 +own_tag="$(jq -er '.preconditions.licenceId.ifMatch' "$response")" +own_body="$(renewal "$own" "$own_tag")" +renew='/v1/actions/renew?accessProfile=licence-holder' +http "$holder" POST "$renew" 200 "$own_body" renew-med-2026-001-to-2028 +http "$holder" POST "$renew" 200 "$own_body" renew-med-2026-001-to-2028 +http "$holder" GET "/v1/records/licences/$own?accessProfile=licence-holder" 200 +jq -e '.data.domainData.expiresOn == "2028-06-30"' "$response" >/dev/null + +conditions "$holder" "$foreign" 404 +jq -e '.code == "resource.not-found"' "$response" >/dev/null +conditions "$other_holder" "$foreign" 200 +foreign_tag="$(jq -er '.preconditions.licenceId.ifMatch' "$response")" +foreign_body="$(renewal "$foreign" "$foreign_tag")" +http "$holder" POST "$renew" 412 "$foreign_body" holder-crossed-record +jq -e '.code == "precondition.failed"' "$response" >/dev/null +http "$officer" POST "$renew" 403 "$foreign_body" officer-crossed-profile +jq -e '.code == "profile.not-authorized"' "$response" >/dev/null + +conditions "$other_holder" "$foreign" 200 +jq -e --arg original "$foreign_tag" '.preconditions.licenceId.ifMatch == $original' "$response" >/dev/null +http "$other_holder" GET "/v1/records/licences/$foreign?accessProfile=licence-holder" 200 +jq -e '.data.domainData.expiresOn == "2027-06-30"' "$response" >/dev/null + +printf '%s\n' 'Holder renewal and replay succeeded. Crossed target and profile refused. Foreign expiry and condition unchanged.' From a554cab0ff31727086cba4dcf6a7eb9472c08b45 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 10/55] test: fix the BReg and Casework journey checks hosted CI found Folds these reviewed commits: - test(breg): bind the public check to its release fixtures - test(docs): classify the bregctl report schema among BReg tool schemas - test(rstack): name the holder test attempt without a secret keyword - chore(identifiers): catalog the completed BReg identity facts report schema - test(bregctl): hold the explain report example to current output - test(breg-mcp): enable token fixtures for the native citizen test - test(rstack): give the synthetic caseworkctl its complete owner report Signed-off-by: Jeremi Joslin --- .../typescript/tests/holder-function.test.ts | 6 +- crates/registry-breg-mcp/Cargo.toml | 2 +- .../tests/explain_contract.rs | 6 +- crates/registry-rstack/tests/dev_run.rs | 6 +- .../generate-breg-configuration.test.mjs | 5 +- products/breg/evidence/README.md | 3 +- .../public-check/breg-journeys-v0.49.0.yaml | 86 +++++++++++++++++++ .../evidence/public-check/dev-v0.49.0.yaml | 32 +++++++ .../breg/evidence/tests/verify-composition.py | 4 + .../identifiers/generated/catalog.v1.json | 34 ++++++-- 10 files changed, 166 insertions(+), 18 deletions(-) create mode 100644 products/breg/evidence/public-check/breg-journeys-v0.49.0.yaml create mode 100644 products/breg/evidence/public-check/dev-v0.49.0.yaml diff --git a/clients/typescript/tests/holder-function.test.ts b/clients/typescript/tests/holder-function.test.ts index 86abc8e5f4..ca598b6139 100644 --- a/clients/typescript/tests/holder-function.test.ts +++ b/clients/typescript/tests/holder-function.test.ts @@ -10,7 +10,7 @@ const reviewedExpiresOn = '2027-06-30' const newExpiresOn = '2028-06-30' const ifMatch = '"reviewed-revision"' const otherIfMatch = '"other-reviewed-revision"' -const idempotencyKey = '08114403-75d2-48d3-961a-5d4fb8b19687' +const attemptId = '08114403-75d2-48d3-961a-5d4fb8b19687' const holderAuthorization = 'Bearer synthetic-holder' const submission = { licenceId, reviewedExpiresOn, preconditions: { licenceId: { ifMatch } } } const holder = { subject: 'person-a', holderRef: 'holder-a', actor: 'human', client: 'licence-holder', @@ -57,7 +57,7 @@ function parsePreparation(value: unknown) { } function request(options: { path?: string; authorization?: string | null; body?: unknown; key?: string } = {}) { - const { path = route, authorization = holderAuthorization, body = submission, key = idempotencyKey } = options + const { path = route, authorization = holderAuthorization, body = submission, key = attemptId } = options const headers = new Headers({ 'Content-Type': 'application/json', 'Idempotency-Key': key, 'Registry-Client': 'page', Cookie: 'synthetic-cookie', 'X-Actor': 'synthetic-spoofed-actor', @@ -140,7 +140,7 @@ test('preparation receives one projected value and the checked Action receives t assert.equal(call.url, 'https://licences.test/v1/actions/renew?accessProfile=licence-holder') assert.equal(call.method, 'POST') assert.equal(call.headers.authorization, holderAuthorization) - assert.equal(call.headers['idempotency-key'], idempotencyKey) + assert.equal(call.headers['idempotency-key'], attemptId) for (const header of ['cookie', 'registry-client', 'x-actor']) assert.equal(call.headers[header], undefined) assert.deepEqual(call.body, { input: { licenceId, newExpiresOn }, preconditions: { licenceId: { ifMatch } } }) assert.deepEqual(writes, [licenceId]) diff --git a/crates/registry-breg-mcp/Cargo.toml b/crates/registry-breg-mcp/Cargo.toml index 0a0487e053..ecee2ecd7f 100644 --- a/crates/registry-breg-mcp/Cargo.toml +++ b/crates/registry-breg-mcp/Cargo.toml @@ -74,7 +74,7 @@ jsonschema.workspace = true # The composed journey test serves the citizen review page beside the gateway; # the gateway itself never links the page. registry-breg-review.workspace = true -registry-platform-testing = { workspace = true, features = ["test-authorization-server"] } +registry-platform-testing = { workspace = true, features = ["test-authorization-server", "token-fixtures"] } reqwest.workspace = true registry-mcp-edge = { workspace = true, features = ["test-support"] } # The test client reaches the gateway over plain loopback HTTP. rmcp's diff --git a/crates/registry-bregctl/tests/explain_contract.rs b/crates/registry-bregctl/tests/explain_contract.rs index cfb95544c1..cf323b2aa7 100644 --- a/crates/registry-bregctl/tests/explain_contract.rs +++ b/crates/registry-bregctl/tests/explain_contract.rs @@ -1321,7 +1321,7 @@ fn authored_display_examples_pin_every_presentation_surface() { } #[test] -fn registered_ctl_report_example_matches_current_actions_report() { +fn ctl_report_explain_example_matches_current_actions_report() { let root = repo_root(); let registry = format_registry(&root); let registration = registry["formats"] @@ -1330,7 +1330,9 @@ fn registered_ctl_report_example_matches_current_actions_report() { .iter() .find(|format| format["id"] == "breg/ctl-report") .expect("ctl report is registered"); - let path = root.join(registration["example"].as_str().unwrap()); + // The registration's example and schema are the completed identity facts report. + // This explain report shares its apiVersion and kind and is held to current output here. + let path = root.join("products/breg/examples/formats/ctl-report.json"); let bytes = std::fs::read(&path).unwrap(); let example: Value = serde_json::from_slice(&bytes).expect("registered report parses"); assert_eq!(example["apiVersion"], registration["current"]["apiVersion"]); diff --git a/crates/registry-rstack/tests/dev_run.rs b/crates/registry-rstack/tests/dev_run.rs index ad5f858371..82fd5bcb49 100644 --- a/crates/registry-rstack/tests/dev_run.rs +++ b/crates/registry-rstack/tests/dev_run.rs @@ -1139,7 +1139,9 @@ fn start_with_casework_tool( } // The synthetic Casework helper projects the known reviewer profile and -// echoes the issuer and audience in the runner's facts-only input. +// echoes the issuer and audience in the runner's facts-only input. Its receipt +// is the complete owner report an offline check requires, counting the facts +// it wrote. const CASEWORK_FACTS_COMMAND: &str = concat!( r#"if [[ $3 == generate ]]; then"#, "\n", @@ -1161,7 +1163,7 @@ const CASEWORK_FACTS_COMMAND: &str = concat!( "\n", r#" printf '{"apiVersion":"id.registrystack.org/formats/platform/identity-facts/v1","kind":"PlatformIdentityFacts","product":"casework","issuer":"%s","audience":"%s","allowedClients":"unrestricted","claims":{"registry_actor_kind":"string"},"accessProfiles":[{"id":"reviewer","scopes":["casework:review"],"actorKind":"human"}]}\n' "$issuer" "$audience" >"$9""#, "\n", - r#" printf '%s\n' '{"ok":true}'"#, + r#" printf '{"ok":true,"command":"generate-identity-facts","status":"complete","apiVersion":"id.registrystack.org/formats/casework/report/v1alpha2","kind":"CaseworkReport","accessProfiles":1,"assertionIssuers":0,"claims":1,"output":"%s","product":"casework","posture":{"value":"development","source":"environment"},"diagnostics":[]}\n' "$9""#, "\n", " exit 0\n", "fi\n", diff --git a/docs/site/scripts/generate-breg-configuration.test.mjs b/docs/site/scripts/generate-breg-configuration.test.mjs index dcc80f4d31..60e0ede0fd 100644 --- a/docs/site/scripts/generate-breg-configuration.test.mjs +++ b/docs/site/scripts/generate-breg-configuration.test.mjs @@ -59,10 +59,13 @@ test('BReg reference includes module extensions, hook conditions, and runtime de test('BReg covers every committed tool schema, in the order an adopter meets the files', async () => { const committed = async (directory) => (await readdir(new URL(`../../../${directory}/`, import.meta.url))) .map((name) => `${directory}/${name}`); + // Report formats bregctl writes. An adopter reads them and never authors one, so the + // configuration reference leaves them out; every other tool schema must be a contract. + const reportSchemas = ['products/breg/generated/tools/ctl-report.v1alpha1.schema.json']; assert.deepEqual([ ...await committed('products/breg/generated/tools'), ...await committed('products/platform/generated/dev'), - ].sort(), TOOL_CONTRACTS.map((entry) => entry.file).sort()); + ].sort(), [...TOOL_CONTRACTS.map((entry) => entry.file), ...reportSchemas].sort()); assert.deepEqual(TOOL_CONTRACTS.map((entry) => entry.id), ['rstack-dev', 'rstack-service', 'rstack-journeys', 'example-scenarios', 'journeys', 'schema-test-credentials', 'migration-descriptor', 'backup-binding', 'model-selection']); }); diff --git a/products/breg/evidence/README.md b/products/breg/evidence/README.md index 613d04fe98..0aa46c7249 100644 --- a/products/breg/evidence/README.md +++ b/products/breg/evidence/README.md @@ -99,7 +99,8 @@ For the served synthetic licence check, give the same runner matching released v0.49.0 binaries for all five options, including `--breg` and `--rstack`. It starts a disposable BReg and Evidence run with Docker, compares two native exports to the pinned inventory in `public-check/bregctl-v0.49.0.SHA256SUMS`, -and calls the public route on loopback. The run exercises a valid licence, a +and calls the public route on loopback. The served run also uses the Dev plan +and BReg test journeys pinned for that release in `public-check/`. The run exercises a valid licence, a missing request member, a wrong code, a record issued without a code, and an absent record. Use `--work-dir` to retain the generated authoring artifacts. diff --git a/products/breg/evidence/public-check/breg-journeys-v0.49.0.yaml b/products/breg/evidence/public-check/breg-journeys-v0.49.0.yaml new file mode 100644 index 0000000000..cbb0d197ae --- /dev/null +++ b/products/breg/evidence/public-check/breg-journeys-v0.49.0.yaml @@ -0,0 +1,86 @@ +apiVersion: id.registrystack.org/formats/breg/journeys/v1 +kind: BRegJourneys +# Journeys rehearse the native request schema, so every field appears under the +# identifier registry.yaml declares. `registration-number` also declares +# `apiName: registrationNumber`, the property name the HTTP API uses and the one +# the seed records in ../dev/scenarios.yaml carry. +journeys: +- id: source-lookup-boundary + steps: + - id: operator-creates-record + recordType: record + accessProfile: operator + claims: + principal: generic-registry-operator + purpose: registry-operations + scopes: + - registry:generic:operate + request: + type: create + data: + code: SYNTHETIC-JOURNEY + registration-number: SYNTHETIC-JOURNEY-REG + status: active + label: SYNTHETIC-PRIVATE-LABEL + expect: + outcome: success + status: 201 + fields: + code: SYNTHETIC-JOURNEY + status: active + capture: record + - id: source-looks-up-by-code + recordType: record + accessProfile: evidence-source + claims: + principal: evidence-source + purpose: evidence-source-read + scopes: + - registry:evidence:lookup + request: + type: lookup + selector: by-code + values: + code: SYNTHETIC-JOURNEY + expect: + outcome: success + status: 200 + fields: + code: SYNTHETIC-JOURNEY + status: active + - id: source-looks-up-by-registration-number + recordType: record + accessProfile: evidence-source + claims: + principal: evidence-source + purpose: evidence-source-read + scopes: + - registry:evidence:lookup + request: + type: lookup + selector: by-registration-number + values: + registration-number: SYNTHETIC-JOURNEY-REG + expect: + outcome: success + status: 200 + fields: + registration-number: SYNTHETIC-JOURNEY-REG + status: active + - id: source-unresolved-is-not-a-negative-status + recordType: record + accessProfile: evidence-source + claims: + principal: evidence-source + purpose: evidence-source-read + scopes: + - registry:evidence:lookup + request: + type: lookup + selector: by-code + values: + code: SYNTHETIC-NOT-REGISTERED + expect: + outcome: refusal + status: 404 + problemCode: lookup.unresolved diff --git a/products/breg/evidence/public-check/dev-v0.49.0.yaml b/products/breg/evidence/public-check/dev-v0.49.0.yaml new file mode 100644 index 0000000000..d7aaeb0c08 --- /dev/null +++ b/products/breg/evidence/public-check/dev-v0.49.0.yaml @@ -0,0 +1,32 @@ +# yaml-language-server: $schema=https://id.registrystack.org/schemas/rstack/dev/dev.v1alpha1.schema.json +apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 +kind: RStackDev +issuer: https://identity.evidence.example.test +products: + - product: breg + project: . + audience: urn:example:evidence-registry +people: + operator: + subject: generic-registry-operator + client: operator + grants: + breg: + profile: operator + scopes: + - registry:generic:operate + claims: + registry_purpose: registry-operations + registry_actor_kind: service + source: + subject: evidence-source + client: source + grants: + breg: + profile: evidence-source + scopes: + - registry:evidence:lookup + claims: + registry_purpose: evidence-source-read + registry_actor_kind: service +journeyFile: dev-journeys.yaml diff --git a/products/breg/evidence/tests/verify-composition.py b/products/breg/evidence/tests/verify-composition.py index b2f040d3c4..7167397bc2 100644 --- a/products/breg/evidence/tests/verify-composition.py +++ b/products/breg/evidence/tests/verify-composition.py @@ -351,6 +351,10 @@ def verify_live_public_check(workspace: Path, binaries: dict[str, Path]) -> dict } registry = workspace / "licence-registry" public_check_registry(registry) + # Keep release-specific fixture authoring paired with the checked binaries. + version = versions["rstack"] + shutil.copyfile(PUBLIC_CHECK / f"dev-v{version}.yaml", registry / "dev.yaml") + shutil.copyfile(PUBLIC_CHECK / f"breg-journeys-v{version}.yaml", registry / "tests/journeys.yaml") journey_path = registry / "dev-journeys.yaml" journey = read(journey_path) active, no_code, _ = journey["journeys"][0]["steps"] diff --git a/products/identifiers/generated/catalog.v1.json b/products/identifiers/generated/catalog.v1.json index 23eec07fc8..ad5294efad 100644 --- a/products/identifiers/generated/catalog.v1.json +++ b/products/identifiers/generated/catalog.v1.json @@ -5533,7 +5533,7 @@ "description": "Base Registry Engine tool-file JSON Schemas at version v1alpha1.", "source": { "path": "crates/registry-bregctl/src/tool_schema.rs", - "sha256": "7b301a42961b96b2ba696f0c6a412275ed7dc21fb03e18d42e66a57e7c05440a" + "sha256": "d9192db9db98a1242472bbc5002b6998a3dec17dfb05d7fbd2068d1353a52684" }, "artifact": { "path": "products/breg/generated/tools/backup-binding.v1alpha1.schema.json", @@ -5541,6 +5541,24 @@ "mediaType": "application/schema+json" } }, + { + "uri": "https://id.registrystack.org/schemas/breg/ctl-report/ctl-report.v1alpha1.schema.json", + "kind": "schema", + "status": "active", + "compatibilityLine": "v1alpha1", + "owner": "breg", + "title": "Completed BReg identity facts command report", + "description": "Base Registry Engine tool-file JSON Schemas at version v1alpha1.", + "source": { + "path": "crates/registry-bregctl/src/tool_schema.rs", + "sha256": "d9192db9db98a1242472bbc5002b6998a3dec17dfb05d7fbd2068d1353a52684" + }, + "artifact": { + "path": "products/breg/generated/tools/ctl-report.v1alpha1.schema.json", + "sha256": "6513298c7020104c036804abd150c61f28d18b7b38113a489b84f67335dc40ef", + "mediaType": "application/schema+json" + } + }, { "uri": "https://id.registrystack.org/schemas/breg/event-record-view/event-record-view.v1alpha1.schema.json", "kind": "schema", @@ -5587,7 +5605,7 @@ "description": "Base Registry Engine tool-file JSON Schemas at version v1alpha1.", "source": { "path": "crates/registry-bregctl/src/tool_schema.rs", - "sha256": "7b301a42961b96b2ba696f0c6a412275ed7dc21fb03e18d42e66a57e7c05440a" + "sha256": "d9192db9db98a1242472bbc5002b6998a3dec17dfb05d7fbd2068d1353a52684" }, "artifact": { "path": "products/breg/generated/tools/example-scenarios.v1alpha1.schema.json", @@ -5605,7 +5623,7 @@ "description": "Base Registry Engine tool-file JSON Schemas at version v1.", "source": { "path": "crates/registry-bregctl/src/tool_schema.rs", - "sha256": "7b301a42961b96b2ba696f0c6a412275ed7dc21fb03e18d42e66a57e7c05440a" + "sha256": "d9192db9db98a1242472bbc5002b6998a3dec17dfb05d7fbd2068d1353a52684" }, "artifact": { "path": "products/breg/generated/tools/journeys.v1.schema.json", @@ -5659,7 +5677,7 @@ "description": "Base Registry Engine tool-file JSON Schemas at version v1alpha1.", "source": { "path": "crates/registry-bregctl/src/tool_schema.rs", - "sha256": "7b301a42961b96b2ba696f0c6a412275ed7dc21fb03e18d42e66a57e7c05440a" + "sha256": "d9192db9db98a1242472bbc5002b6998a3dec17dfb05d7fbd2068d1353a52684" }, "artifact": { "path": "products/breg/generated/tools/migration-descriptor.v1alpha1.schema.json", @@ -5695,7 +5713,7 @@ "description": "Base Registry Engine tool-file JSON Schemas at version v1alpha1.", "source": { "path": "crates/registry-bregctl/src/tool_schema.rs", - "sha256": "7b301a42961b96b2ba696f0c6a412275ed7dc21fb03e18d42e66a57e7c05440a" + "sha256": "d9192db9db98a1242472bbc5002b6998a3dec17dfb05d7fbd2068d1353a52684" }, "artifact": { "path": "products/breg/generated/tools/model-selection.v1alpha1.schema.json", @@ -5717,7 +5735,7 @@ }, "artifact": { "path": "products/breg/generated/authoring/registry-module.schema.json", - "sha256": "543316774c84e783eda4a79f87a037ecc2c94d2df14a906feaacdd9552cfc7e0", + "sha256": "135e6f4fb68281ce84ad8a15ad87ad464d96722e37a89ad2bd697fc382bcbca9", "mediaType": "application/schema+json" } }, @@ -5735,7 +5753,7 @@ }, "artifact": { "path": "products/breg/generated/authoring/registry-project.schema.json", - "sha256": "940c6e30dadf260f209ad059d9bc21239f43fe7d3b58fdbc9f941bf91aa28822", + "sha256": "cc701340565561324fb44b9db9f65b0f08f137e4a0754ba86c19ef9502fb9c76", "mediaType": "application/schema+json" } }, @@ -5839,7 +5857,7 @@ "description": "Base Registry Engine tool-file JSON Schemas at version v1.", "source": { "path": "crates/registry-bregctl/src/tool_schema.rs", - "sha256": "7b301a42961b96b2ba696f0c6a412275ed7dc21fb03e18d42e66a57e7c05440a" + "sha256": "d9192db9db98a1242472bbc5002b6998a3dec17dfb05d7fbd2068d1353a52684" }, "artifact": { "path": "products/breg/generated/tools/schema-test-credentials.v1.schema.json", From f83c674697fafec173dc55f616caf23c631accc2 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 11/55] test(journeys): qualify product promotions, signed hooks and first-hour endpoints Folds these reviewed commits: - fix(journeys): report unexercised local hooks accurately [skip ci] - test(render): qualify signed document delivery - docs(scheduling): qualify Keycloak catalogue access - test(render): qualify Transit and HTTPS timestamp delivery - test(discovery): pin catalog transport behavior - fix(journeys): complete Render promotion with zero refusals - fix(journeys): verify Adapter promotion and count production refusals - fix(journeys): report verified first-hour endpoints - test(journeys): gate hook reporting through the real local walk - refactor(discovery): select numeric loopback catalog transport - docs(platform): document integrity checks for public trust files - fix(journeys): bind both standalone Casework issuer defaults - fix(journeys): pair Evidence checks with the selected runtime - test(journeys): correlate the local BReg hook receipt - docs(dev): explain when to use a function or a flow Signed-off-by: Jeremi Joslin --- crates/registry-discoveryctl/src/build.rs | 39 +- .../run-a-project-with-rstack-dev.mdx | 14 + .../content/docs/operate/registry-render.mdx | 36 ++ .../src/content/docs/operate/scheduling.mdx | 28 ++ .../docs/security/hardening-checklist.mdx | 20 + .../scripts/test_catalog_transport.py | 181 ++++++++ products/platform/journeys/README.md | 32 +- .../platform/journeys/expected-failures.yaml | 36 +- products/platform/journeys/lib.sh | 26 +- products/platform/journeys/own-provider.sh | 111 ++--- products/platform/journeys/promote.sh | 53 ++- products/platform/journeys/rstack-dev.sh | 38 +- .../platform/journeys/test_journey_tables.py | 180 +++++++- products/platform/journeys/test_lib.sh | 34 +- products/render/README.md | 10 + .../render/scripts/test_signed_delivery.py | 422 ++++++++++++++++++ .../render/scripts/test_transit_delivery.py | 256 +++++++++++ 17 files changed, 1391 insertions(+), 125 deletions(-) create mode 100644 products/discovery/scripts/test_catalog_transport.py create mode 100644 products/render/scripts/test_signed_delivery.py create mode 100644 products/render/scripts/test_transit_delivery.py diff --git a/crates/registry-discoveryctl/src/build.rs b/crates/registry-discoveryctl/src/build.rs index a0c6320cc5..b528cb7361 100644 --- a/crates/registry-discoveryctl/src/build.rs +++ b/crates/registry-discoveryctl/src/build.rs @@ -14,10 +14,11 @@ use registry_platform_config::{ write_package, DeclaredPosture, PackageError, PackageLimits, Posture, PostureReport, VerifiedPackage, }; +use registry_platform_httputil::select::{select_destination, validate_selected_fetch}; use registry_platform_httputil::{ read_bounded, validate_response_headers, FetchUrlPolicy, PeerPolicy, ResponseHeaderError, }; -use reqwest::header::{ACCEPT, CONTENT_ENCODING, CONTENT_TYPE}; +use reqwest::header::{HeaderValue, ACCEPT, CONTENT_ENCODING, CONTENT_TYPE}; use sha2::{Digest as _, Sha256}; use thiserror::Error; use time::{format_description::well_known::Rfc3339, OffsetDateTime}; @@ -200,17 +201,31 @@ async fn fetch_origins( for approved in project.origins.iter().filter(|origin| origin.enabled) { let url = approved.catalog_url.to_url(); - let validated = policy - .validate_dns_pinned_for_immediate_fetch_with_timeout(&url, dns_timeout) - .await - .map_err(|_| BuildError::Fetch)?; - let response = validated - .immediate_get_with_timeout(fetch_timeout) - .map_err(|_| BuildError::Fetch)? - .header(ACCEPT, registry_discovery_profile::MEDIA_TYPE) - .send() - .await - .map_err(|_| BuildError::Fetch)?; + // Named hosts and HTTPS keep their existing DNS admission policy. + let response = if url.scheme() == "http" + && matches!(url.host_str(), Some("127.0.0.1" | "[::1]")) + { + let selected = select_destination(&url, None, &[]).map_err(|_| BuildError::Fetch)?; + validate_selected_fetch(&selected) + .map_err(|_| BuildError::Fetch)? + .get( + &HeaderValue::from_static(registry_discovery_profile::MEDIA_TYPE), + fetch_timeout, + ) + .await + .map_err(|_| BuildError::Fetch)? + } else { + policy + .validate_dns_pinned_for_immediate_fetch_with_timeout(&url, dns_timeout) + .await + .map_err(|_| BuildError::Fetch)? + .immediate_get_with_timeout(fetch_timeout) + .map_err(|_| BuildError::Fetch)? + .header(ACCEPT, registry_discovery_profile::MEDIA_TYPE) + .send() + .await + .map_err(|_| BuildError::Fetch)? + }; validate_response_headers(response.headers(), peer_policy).map_err( |error| match error { ResponseHeaderError::DevelopmentPeer => BuildError::DevelopmentPeer, diff --git a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx index d13675d190..78c38b67e6 100644 --- a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx +++ b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx @@ -868,6 +868,20 @@ A later `start` creates a fresh application run. Product data on managed Postgre crates/registry-rstack-dev/src/lib.rs application-root; crates/registry-rstack-dev/src/products.rs PreparedApplication. */} +### Choose a function or a flow + +Use a server-side function for work that finishes within one request. Use a Coordinator flow when +work waits for a person or a date, or when each step needs review. Call function code from the +flow when the flow cannot express an individual step. + +A function owns no product authority. The product authorises every call the function makes. +When the whole procedure lives in function code, you lose the Coordinator diagram and its +record of each step. + +{/* Evidence: crates/registry-coordinator/src/operations.rs, operation_catalog; + products/coordinator/AGENTS.md, Registry Coordinator product; + docs/site/src/content/docs/configure/coordinator.mdx. */} + ### Browser issuer The browser issuer presents only the plan's synthetic test people. diff --git a/docs/site/src/content/docs/operate/registry-render.mdx b/docs/site/src/content/docs/operate/registry-render.mdx index 8d06e83260..65a9abbcaf 100644 --- a/docs/site/src/content/docs/operate/registry-render.mdx +++ b/docs/site/src/content/docs/operate/registry-render.mdx @@ -461,6 +461,42 @@ document type the route takes as `seal`, so a client can tell them apart first. [configuration reference](../../reference/render-configuration/#seal-documents) lists the keys, problems, and response shapes. +### Verify a delivered PDF + +Save the exact PDF bytes. For a JSON response, base64-decode `pdfBase64` to get those bytes. +Keep the delivery record for the same response. Use `X-Registry-Signed-File-Digest` or +`signedFileDigest` to identify the complete file. Use `X-Registry-Document-Digest` or +`documentDigest` to identify its first revision. + +Obtain the trust roots and expected seal identity from your institution's trusted configuration. +For a shared issuing CA, confirm the signature's leaf certificate against the expected +fingerprint. Render's `certificateDigest` is the SHA-256 of that certificate in DER form. +A digest supplied with the PDF can confirm the file matches the delivery record. +The signature and independently established trust establish who sealed it. + +Set `SIGNED_FILE_DIGEST` and `DOCUMENT_DIGEST` to the labelled digests from the delivery record. +Run these commands from a Registry Stack source checkout with the received `signed.pdf` and +your institution's `seal-root.pem`: + +```bash +printf '%s %s\n' "${SIGNED_FILE_DIGEST#sha256:}" signed.pdf | sha256sum --check --strict +uv run --script products/render/scripts/validate-seal.py \ + --pdf signed.pdf --trust-root seal-root.pem --document-digest "$DOCUMENT_DIGEST" +``` + +Accept the file only if both commands succeed and the verified seal matches your policy. +The validator reports `"ok": true` and the verified level. For B-T, include the approved timestamp +trust root with another `--trust-root` if needed and require the reported level `B-T`. +The validator checks full-file signature coverage and works offline with soft-fail revocation. +Use your institution's revocation policy when it calls for fresh revocation evidence. +If a digest or signature check fails, obtain the original signed file and its delivery record again. +If trust or identity fails, confirm the expected signer and trust roots with the issuing institution. + +{/* Evidence: crates/registry-render/src/server.rs, respond_sealed; + crates/registry-render/src/seal.rs, Seal::certificate_digest; + products/render/scripts/validate-seal.py, validate; + products/render/scripts/test_signed_delivery.py, verify_delivery. */} + ### Use a test seal in development Issue a test certificate from your own test authority and set `assuranceProfile: local` in the runtime file. diff --git a/docs/site/src/content/docs/operate/scheduling.mdx b/docs/site/src/content/docs/operate/scheduling.mdx index 6ac31ea9d1..dde5ad4ca3 100644 --- a/docs/site/src/content/docs/operate/scheduling.mdx +++ b/docs/site/src/content/docs/operate/scheduling.mdx @@ -153,6 +153,34 @@ databaseAccess: false networkAccess: false ``` +### Use Keycloak for catalogue reads + +Follow the [Keycloak issuer recipe](../advanced/connect-an-oidc-issuer/#keycloak) +for the entry under `authentication.oidc.issuers`. Set `audience` to your +Scheduling API client ID in Keycloak. Give the calling client's service account +a role on that API client so Keycloak includes it in the access token's +audience. Attach `scheduling:read` as a default client scope to the calling +client, or use the scope you configured in `readsScope`. + +After Scheduling is ready, obtain a client-credentials access token and call +`GET /v1/locations`. Expect HTTP `200`. If you receive +`authentication.refused`, check the issuer URL, token type, audience and +`allowedClients`. If you receive `profile.not-authorized`, check that the +token contains the read scope in the configured `scopeClaim`. + +A hold or appointment requires a token carrying a [Scheduling task +grant](../../reference/scheduling-task-grants/). A catalogue token without the +grant receives HTTP `403` with `operation.not-authorized` on a hold request. +To book with Keycloak, provision and verify a grant flow that binds the token +to the exact Scheduling resource and action. The catalogue setup above issues +the identity used for the read. + +{/* Evidence: products/platform/journeys/own-provider.sh, write_keycloak_recipe, + keycloak_default_scope, step_token, call_request; + products/platform/journeys/keycloak/realm.json, scheduling-booking-agent; + crates/registry-scheduling/src/auth.rs; crates/registry-scheduling/src/http.rs, + create_hold; products/scheduling/generated/registry-scheduling.openapi.json. */} + ## Package the policy ```sh diff --git a/docs/site/src/content/docs/security/hardening-checklist.mdx b/docs/site/src/content/docs/security/hardening-checklist.mdx index 1463b3ffce..3e8a54adec 100644 --- a/docs/site/src/content/docs/security/hardening-checklist.mdx +++ b/docs/site/src/content/docs/security/hardening-checklist.mdx @@ -133,6 +133,26 @@ refusal holds in development. Production refuses all of them. deploy/helm/registry-stack/templates/evidence-deployment.yaml, stage-evidence-inputs; deploy/helm/registry-stack/README.md, Images and workload security. */} +## Public configuration files + +Protect who can replace public trust material. Replacing an issuer's static JWKS or a CA bundle +changes which keys or certificates your deployment trusts. + +- If an input such as `jwksSource.documentRef` or `database.caBundleRef` references + `secret:file/`, stage it with the same owner, mode and link rules as the other files under + `secretProviders.file.root`. +- If a runtime checks its configuration path with the shared trusted path rule, give it an absolute, + normalised path without symbolic links. In production, root or the runtime user must own the file + and its ancestors. Clear group and other write access. The rule permits a root-owned sticky + ancestor. +- In a container deployment, check the owner and mode as seen by the runtime user. Run the + product's production configuration check, then confirm readiness. To verify a CA or key set, + also exercise an operation that connects to the configured peer or verifies its token. + +{/* Evidence: crates/registry-platform-config/src/blocks.rs, JwksSource, DatabaseConfig; + crates/registry-platform-config/src/loader.rs, require_trusted_runtime_path; + crates/registry-platform-config/src/secrets.rs, SecretResolver, open_secret_file. */} + ## Check BReg and Casework authority 1. Use separate migration and runtime database roles with TLS. Run the product's doctor against diff --git a/products/discovery/scripts/test_catalog_transport.py b/products/discovery/scripts/test_catalog_transport.py new file mode 100644 index 0000000000..1f120aa96b --- /dev/null +++ b/products/discovery/scripts/test_catalog_transport.py @@ -0,0 +1,181 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Check Discovery catalog transport using a verified discoveryctl executable. + +Run with --discoveryctl --scratch . +The regression needs IPv4 and IPv6 loopback and performs no external fetches. +""" + +import argparse +import hashlib +import json +import os +import socket +import subprocess +import tempfile +import threading +from contextlib import contextmanager +from http.server import BaseHTTPRequestHandler, HTTPServer +from pathlib import Path + +PRODUCT = Path(__file__).resolve().parents[1] +PROFILE = "registry-discovery-v1alpha1" +MEDIA_TYPE = 'application/ld+json;profile="https://registrystack.org/discovery/profile/v1alpha1"' +CATALOG = PRODUCT / "fixtures/descriptions/evidence.jsonld" + + +@contextmanager +def catalog_server(host, url_host, family): + seen = [] + connections = [] + description = CATALOG.read_bytes() + + class CatalogHandler(BaseHTTPRequestHandler): + def do_GET(self): + seen.append((self.path, self.headers.get("Accept"), "Authorization" in self.headers)) + if self.path == "/redirect": + self.send_response_only(302) + self.send_header("Location", "/catalog.jsonld") + self.end_headers() + elif self.path == "/catalog.jsonld": + self.send_response_only(200) + self.send_header("Content-Type", MEDIA_TYPE) + self.send_header("Content-Length", str(len(description))) + self.end_headers() + self.wfile.write(description) + else: + self.send_response_only(404) + self.end_headers() + + class CatalogServer(HTTPServer): + address_family = family + + def get_request(self): + connection, address = super().get_request() + connection.settimeout(3) + connections.append(address) + return connection, address + + with CatalogServer((host, 0), CatalogHandler) as server: + thread = threading.Thread(target=server.serve_forever) + thread.start() + try: + yield f"{url_host}:{server.server_port}", seen, connections + finally: + server.shutdown() + thread.join() + + +def project_for(directory, url): + project = directory / "project" + project.mkdir(parents=True) + (project / "origins.yaml").write_text(f"""\ +apiVersion: id.registrystack.org/formats/discovery/origins/v1alpha1 +kind: DiscoveryOrigins +origins: + fixture: + catalogUrl: {json.dumps(url)} + profile: {PROFILE} +""") + (project / "mappings").mkdir() + mapping = PRODUCT / "examples/starter/mappings/adult-status.yaml" + (project / "mappings/adult-status.yaml").write_bytes(mapping.read_bytes()) + return project + + +def run_package(binary, directory, url, posture, *, proxy=None): + project = project_for(directory, url) + output = directory / "package" + env = os.environ.copy() + env.pop("REGISTRY_STACK_POSTURE", None) + if proxy is not None: + for key in ("HTTP_PROXY", "http_proxy", "ALL_PROXY", "all_proxy"): + env[key] = proxy + for key in ("NO_PROXY", "no_proxy"): + env.pop(key, None) + result = subprocess.run( + [binary, "package", "--project", project, "--output", output, "--posture", posture], + capture_output=True, text=True, timeout=30, env=env, + ) + return result, output + + +def require_refusal(result, output, diagnostic): + assert result.returncode == 1, (result.returncode, result.stdout, result.stderr) + assert diagnostic in result.stderr, result.stderr + assert not output.exists(), output + + +def loopback_cases(binary, directory, host, url_host, family): + with catalog_server(host, url_host, family) as (authority, seen, connections): + url = f"http://{authority}/catalog.jsonld" + request = ("/catalog.jsonld", MEDIA_TYPE, False) + result, output = run_package( + binary, directory / "development", url, "development", + proxy=f"http://{authority}", + ) + assert result.returncode == 0, (result.stdout, result.stderr) + assert seen == [request], seen + assert len(connections) == 1, connections + index_path = output / "discovery-index.json" + index_bytes = index_path.read_bytes() + index = json.loads(index_bytes) + assert len(index["services"]) == 1, index + assert index["origins"][0]["catalogUrl"] == url, index["origins"] + digest = hashlib.sha256(index_bytes).hexdigest() + checksums = (output / "SHA256SUMS").read_text().splitlines() + assert f"{digest} {index_path.name}" in checksums, checksums + + for scheme in ("http", "https"): + result, output = run_package( + binary, directory / f"production-{scheme}", + f"{scheme}://{authority}/catalog.jsonld", "production", + ) + require_refusal(result, output, "discovery.posture.loopback-catalog-url") + assert seen == [request], seen + assert len(connections) == 1, connections + + result, output = run_package( + binary, directory / "redirect", f"http://{authority}/redirect", "development", + ) + require_refusal(result, output, "an approved Discovery origin could not be fetched safely") + assert seen == [request, ("/redirect", MEDIA_TYPE, False)], seen + assert len(connections) == 2, connections + + +def spelling_cases(binary, directory): + for label, url, expected in ( + ("short-ipv4", "http://127.1:9/catalog.jsonld", "config.invalid-value"), + ("other-ipv4", "http://127.0.0.2:9/catalog.jsonld", + "discovery.origins.catalog-url-not-allowed"), + ("mapped-ipv6", "http://[::ffff:127.0.0.1]:9/catalog.jsonld", + "discovery.origins.catalog-url-not-allowed"), + ): + project = project_for(directory / label, url) + result = subprocess.run( + [binary, "check", "--project", project, "--posture", "development", "--format", "json"], + capture_output=True, text=True, timeout=10, + ) + assert result.returncode == 1, (result.returncode, result.stdout, result.stderr) + diagnostics = json.loads(result.stdout)["diagnostics"] + assert [(item["code"], item["path"]) for item in diagnostics] == [ + (expected, "/origins/fixture/catalogUrl") + ], diagnostics + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--discoveryctl", type=Path, required=True) + parser.add_argument("--scratch", type=Path, required=True) + args = parser.parse_args() + binary = args.discoveryctl.resolve(strict=True) + with tempfile.TemporaryDirectory(prefix="discovery-transport-", dir=args.scratch) as temporary: + directory = Path(temporary).resolve() + loopback_cases(binary, directory / "v4", "127.0.0.1", "127.0.0.1", socket.AF_INET) + loopback_cases(binary, directory / "v6", "::1", "[::1]", socket.AF_INET6) + spelling_cases(binary, directory) + print("Discovery catalog transport passed: two exact loopback fetches and nine refusal cases") + + +if __name__ == "__main__": + main() diff --git a/products/platform/journeys/README.md b/products/platform/journeys/README.md index c5ec25dbc0..83d416787a 100644 --- a/products/platform/journeys/README.md +++ b/products/platform/journeys/README.md @@ -44,7 +44,7 @@ identity provider. | `rstack-dev.sh` | The `rstack dev` journey, with a recipe per product for the steps from `start` on. | | `own-provider.sh` | The own-provider journey: a stock Keycloak (`--issuer keycloak`) or pinned ThunderID (`--issuer thunderid`) plus a stock PostgreSQL started on loopback, then each product from its starter to authenticated calls and hooks. | | `lib-assists.sh` | The assists, sourced only when `--assist` names one: `sql` (provisioning statements through psql), `certificate` (a private CA and a TLS server certificate for the pg container), `token-type` (Keycloak's at+jwt header setting) and `mapper` (a hardcoded actor-kind claim mapper). The only journey file allowed to call psql, openssl or docker exec. Each use counts as a pass-rule violation. | -| `promote.sh` | The promote journey: `promote.sh --from RUN_DIR --bin-dir DIR`, paired with a kept Keycloak `own-provider.sh` run directory (`run.json` journey `own-provider` and `own-provider.json` issuer `keycloak`). Mismatched provider run directories (such as `--issuer thunderid`) are refused explicitly. It tries the files in place with no development declaration, compares startup and check diagnostics, and applies each remedy. Casework, Messaging, Scheduling, Documents, and Coordinator inputs that start successfully and pass the production check with zero diagnostics continue to a fresh production process and repeat the authenticated call. A product whose development cell did not finish stops at `input`. | +| `promote.sh` | The promote journey: `promote.sh --from RUN_DIR --bin-dir DIR`, paired with a kept Keycloak `own-provider.sh` run directory (`run.json` journey `own-provider` and `own-provider.json` issuer `keycloak`). Mismatched provider run directories (such as `--issuer thunderid`) are refused explicitly. It tries the files in place with no development declaration, compares startup and check diagnostics, and applies each remedy. Adapter, Casework, Messaging, Scheduling, Documents, Coordinator, and Render inputs that start successfully and pass the production check with zero diagnostics continue to a fresh production process and repeat the authenticated call. A product whose development cell did not finish stops at `input`. | | `keycloak/realm.json` | The realm the Keycloak own-provider journey imports: per product, one caller client with a service account and one API client for the product's audience. Documents also has a service-account client that exercises the human staff profile's refusal. The realm holds no protocol mappers. | | `projects/` | The runtime files and pure-data fixture helpers the own-provider journey uses (Render, Coordinator, loopback hook and source receivers, and the composed BReg + Casework + Scheduling fixture writer). | @@ -108,6 +108,21 @@ and grant exchange, commit a hold and an appointment, and verify a signed appointment hook correlated to that appointment. A skipped hook cannot satisfy the ThunderID cell. +## Adapter promotion + +The Adapter facade uses loopback PostgreSQL and a disposable Basic Auth source. +The harness keeps file-backed references in the development run for promotion. +`adapterctl provision` creates the database and roles. The runtime applies its +schema at startup, and `/ready` checks it. The standalone `database.connect` +step and the hook step are marked `unexercised`. The authenticated +`POST /v1/records/person` proves a write and leaves the first authenticated +read measurement empty. + +The development run stops the source after saving the HTTP 201 response. The +production run presents the same request and idempotency key with the source +stopped. It checks HTTP 201 and matches the response body against the saved +development response. + ## Reading the ratchet table A cell fails at its first failing step with one code. The code has one of these @@ -145,9 +160,22 @@ lists the outcome, verdict, and each counter's value, threshold, direction, and status. An unrecorded planted-error measurement is missing. A recorded zero is compared against the minimum. +T1 is captured at the first successful authenticated read. If the local +journey's first operation is a write, its authenticated readback can provide +T1. T2 is captured after the runner has verified the write across a restart +and checked delivery for paths that exercise a hook. The current local T2 +receipts cover BReg, Coordinator, and Messaging. + Threshold outcomes are report-only in CI. The functional ratchet controls journey acceptance, and comparison code errors fail the harness. Promote -uses its functional ratchet. +uses its functional ratchet. Its `productionRefusals` field counts distinct +codes matched by the initial production startup and check. It is `null` until +the comparison was measured, and `0` when the comparison found no refusals. +The existing `total.refusalsMet` counts refusals across the cell. + +In `rstack-dev`, the run log and `cells.tsv` mark the hook step `unexercised` +when the journey has no hook delivery to check. The cell still runs its later +steps, including retention and cleanup. ## Running the static check diff --git a/products/platform/journeys/expected-failures.yaml b/products/platform/journeys/expected-failures.yaml index 9c1984e4ed..86960f7d46 100644 --- a/products/platform/journeys/expected-failures.yaml +++ b/products/platform/journeys/expected-failures.yaml @@ -59,14 +59,6 @@ expectedFailures: basis: observed observedOn: "journey run 20261128141250-8151" reason: "prepare, issuer, and database.provision pass (bregctl provision accepts loopback-plaintext on the reader's plain PostgreSQL server). database.connect runs bregctl test to produce the receipt bregctl package requires, and bregctl test refuses because the package.root directory in runtime.yaml does not exist yet before bregctl package creates it." - - journey: own-provider - product: adapter - step: database.provision - code: product.config.refused - removedBy: rstack-dev-products - basis: observed - observedOn: "PR #2798, journey run 20261128120405-7e2e" - reason: "prepare and issuer pass (adapterctl check of the facade-recovery example with the breg-records profile). adapterctl provision (added in PR #2798) resolves database.migrationUrlRef from the runtime file's secret provider; runtime.example.yaml references secret:env/ADAPTER_DB_MIGRATION while own-provider writes secret files and leaves that environment variable unset, so provision refuses with config.refused." - journey: own-provider product: evidence step: issuer @@ -92,22 +84,6 @@ expectedFailures: basis: observed observedOn: "origin/main cd83550e, journey run 20261127023442-18b4 against own-provider run 20261127021546-ddef" reason: "The development journey did not finish for this product, so there are no files to promote." - - journey: promote - product: adapter - step: input - code: journey.promote.no-input - removedBy: rstack-dev-products - basis: observed - observedOn: "origin/main cd83550e, journey run 20261127023442-18b4 against own-provider run 20261127021546-ddef" - reason: "The development journey did not finish for this product, so there are no files to promote." - - journey: promote - product: render - step: refusals - code: journey.promote.nothing-refused - removedBy: rstack-dev-products - basis: observed - observedOn: "PR #2798, promote run 20261128133333-b78e on own-provider run 20261128133312-c739" - reason: "Render passes own-provider with a runtime file that carries no development-only setting (loopback listener, loopback HTTP issuer, explicit allowedClients, no database), so registry-render check and serve accept it under the default production posture and refuse nothing." - journey: promote product: discovery step: input @@ -253,6 +229,18 @@ unreached: # observedOn: "origin/main cd83550e, promote run 20261127025000-816f on own-provider run 20261127024425-265d (assisted: sql, certificate, token-type, mapper)" # reason: "The assisted Scheduling cell reached T1. Started with no development declaration, schedulingctl check (which has no --production flag) lists no refusal and the server starts and answers /readyz, so zero refusals are listed. No shared posture exists on main, so nothing can refuse. The count becomes meaningful once the posture change lands." passes: + - journey: own-provider + product: adapter + basis: observed + observedOn: "v0.49.0 binaries, own-provider run 20261201143319-b2e1" + - journey: promote + product: adapter + basis: observed + observedOn: "v0.49.0 binaries, promote run 20261201143356-36b6" + - journey: promote + product: render + basis: observed + observedOn: "v0.49.0 binaries, promote run 20261201091716-e777" - journey: own-provider product: casework basis: observed diff --git a/products/platform/journeys/lib.sh b/products/platform/journeys/lib.sh index d3a7d21a14..0cdf66ad8a 100644 --- a/products/platform/journeys/lib.sh +++ b/products/platform/journeys/lib.sh @@ -1552,6 +1552,7 @@ journey_cell_begin() { _jc_idp=0 _jc_certs=0 _jc_refusals=0 + _jc_production_refusals=null _jc_named=null _jc_assist_count=0 _jc_seconds=0.000 @@ -2295,6 +2296,17 @@ journey_unreached() { _jc_reason=$reason } +# journey_unexercised STEP: record an optional step and continue the cell. +journey_unexercised() { + local step=${1:-} + journey__require_step_start "$step" + [[ "$step" != "$_journey_last_step" ]] || + journey__script_error "the final step of $_jc_product cannot be marked unexercised" + journey__record_line "$step" unexercised - 0.000 + _jc_recorded+="$step"$'\n' + journey__say "$_jc_product $step: unexercised" +} + # journey_assist_enabled NAME: true when --assist lists NAME. journey_assist_enabled() { [[ ",$JOURNEY_ASSISTS," == *",${1:-},"* ]] @@ -2342,7 +2354,9 @@ journey_blocker() { # journey_count COUNTER [N]: add N (default 1) to a counted quantity the # library cannot see: identity-provider-changes, certificates, -# documentation-words, refusals or errors-that-say-what-to-change. +# documentation-words, refusals or errors-that-say-what-to-change. The +# production-refusals counter records the initial comparison once and adds +# its measured count to the total refusals. journey_count() { local counter=${1:-} amount=${2:-1} journey__require_cell @@ -2352,6 +2366,12 @@ journey_count() { certificates) _jc_certs=$((_jc_certs + amount)) ;; documentation-words) _jc_doc_words=$((_jc_doc_words + amount)) ;; refusals) _jc_refusals=$((_jc_refusals + amount)) ;; + production-refusals) + [[ "$JOURNEY_NAME" == promote && "$_jc_production_refusals" == null ]] || + journey__script_error "production refusals are recorded once per promote cell" + _jc_production_refusals=$amount + _jc_refusals=$((_jc_refusals + amount)) + ;; errors-that-say-what-to-change) [[ "$_jc_named" != null ]] || _jc_named=0 _jc_named=$((_jc_named + amount)) @@ -2428,6 +2448,7 @@ journey_cell_end() { --arg product "$_jc_product" --arg outcome "$outcome" \ --arg step "${_jc_fail_step:-$_jc_unreached}" --arg code "$_jc_fail_code" --arg reason "$_jc_reason" \ --argjson blockers "$_jc_blockers_json" --argjson t1 "$_jc_t1_json" --argjson t2 "$_jc_t2_json" \ + --arg journey "$JOURNEY_NAME" --argjson productionRefusals "$_jc_production_refusals" \ --argjson total "$total" \ 'def opt: if . == "" then null else . end; { @@ -2444,7 +2465,8 @@ journey_cell_end() { "machine-time-to-t1": (if $t1 == null then null else ($t1.machineSeconds / 60) end), "errors-that-say-what-to-change": $total.errorsThatSayWhatToChange } - }' >"$JOURNEY_OUT/$_jc_product/cell.json" || journey_harness_failure "cannot write the cell of $_jc_product" + } + (if $journey == "promote" then {$productionRefusals} else {} end)' \ + >"$JOURNEY_OUT/$_jc_product/cell.json" || journey_harness_failure "cannot write the cell of $_jc_product" if journey__first_hour_column "$JOURNEY_NAME" >/dev/null; then public="$JOURNEY_OUT/public-cell-receipts/$_jc_product" receipt="$(journey__first_hour_receipt "$JOURNEY_NAME" "$JOURNEY_OUT/$_jc_product/cell.json")" || diff --git a/products/platform/journeys/own-provider.sh b/products/platform/journeys/own-provider.sh index 73d24db5bf..5d733cdba4 100755 --- a/products/platform/journeys/own-provider.sh +++ b/products/platform/journeys/own-provider.sh @@ -885,12 +885,12 @@ recipe() { CALL_PATH=/v1/workflows/coordinator ;; adapter) + TOOL=adapterctl CLIENT=registry-adapter-example-client + CALL_METHOD=POST CALL_PATH=/v1/records/person if [[ "$ISSUER_KIND" == thunderid ]]; then - TOOL=adapterctl CLIENT=registry-adapter-example-client AUDIENCE=urn:example:adapter SCOPE=records:write - CALL_METHOD=POST CALL_PATH=/v1/records/person + AUDIENCE=urn:example:adapter SCOPE=records:write else - TOOL=adapterctl CLIENT=registry-adapter-example-client AUDIENCE=registry-adapter-example SCOPE=records.write - CALL_PATH=/v1/records/person + AUDIENCE=registry-adapter-example SCOPE=records.write fi ;; evidence) @@ -1003,6 +1003,16 @@ unrecognized_subcommand() { # --------------------------------------------------------------------------- # The steps +# Bind the standalone producer to the issuer and subject this run provisions. +bind_casework_producer() { + local path=$1 issuer=$2 subject=$3 starter_issuer=https://identity.casework.example.test + if ! grep -Fxq " issuer: $starter_issuer" "$path"; then + starter_issuer=http://127.0.0.1:8093 + fi + edit "$path" " issuer: $starter_issuer" " issuer: $issuer" issuer-url + edit "$path" " subject: b75315b2-5854-70f3-8867-511dd771a6da" " subject: $subject" +} + # prepare: the product's starter, its package and its runtime file, with the # paths and ports of this machine. step_prepare() { @@ -1031,8 +1041,7 @@ step_prepare() { casework) reader_command prepare --concepts project -- "$TOOL_BIN" init "$PROJECT" [[ $CELL_OVER -eq 0 ]] || return 0 - edit "$PROJECT/casework.yaml" " issuer: http://127.0.0.1:8093" " issuer: $ACTIVE_ISSUER" issuer-url - edit "$PROJECT/casework.yaml" " subject: b75315b2-5854-70f3-8867-511dd771a6da" " subject: $CASEWORK_SUBJECT" + bind_casework_producer "$PROJECT/casework.yaml" "$ACTIVE_ISSUER" "$CASEWORK_SUBJECT" reader_command prepare --concepts package -- "$TOOL_BIN" package --output "$PROJECT/.casework/package" "$PROJECT" [[ $CELL_OVER -eq 0 ]] || return 0 RUNTIME_FILE=$PROJECT/runtime.yaml @@ -1121,12 +1130,17 @@ step_prepare() { copy_file "$PROJECT/runtime.example.yaml" "$RUNTIME_FILE" [[ $CELL_OVER -eq 0 ]] || return 0 edit "$RUNTIME_FILE" " bind: 127.0.0.1:8080" " bind: 127.0.0.1:$PORT" listener-bind + free_port ADAPTER_SOURCE_PORT + edit "$RUNTIME_FILE" " baseUrl: https://reference.example.invalid" " baseUrl: http://127.0.0.1:$ADAPTER_SOURCE_PORT" if [[ "$ISSUER_KIND" == thunderid ]]; then - free_port ADAPTER_SOURCE_PORT edit "$PROJECT/project.yaml" " scopes: [records.write]" " scopes: [records:write]" scopes - edit "$RUNTIME_FILE" " baseUrl: https://reference.example.invalid" " baseUrl: http://127.0.0.1:$ADAPTER_SOURCE_PORT" edit "$RUNTIME_FILE" " audience: registry-adapter-example" " audience: $AUDIENCE" audience fi + harness_edit "$RUNTIME_FILE" $'\nendpoints:\n' $'\nsecretProviders:\n file:\n root: '"$SECRETS"$'\nendpoints:\n' + harness_edit "$RUNTIME_FILE" secret:env/REFERENCE_USERNAME secret:file/reference-username + harness_edit "$RUNTIME_FILE" secret:env/REFERENCE_PASSWORD secret:file/reference-password + harness_edit "$RUNTIME_FILE" secret:env/ADAPTER_DB_RUNTIME secret:file/runtime-database-url + harness_edit "$RUNTIME_FILE" secret:env/ADAPTER_DB_MIGRATION secret:file/migration-database-url ;; evidence) PRODUCT_KEY_DIRS+=("$PROJECT/.generated/secrets") @@ -1302,6 +1316,8 @@ step_issuer() { --pack "$PROJECT/pack.yaml" --runtime "$RUNTIME_FILE" ;; evidence) + # The check and package commands resolve their matching runtime as a child. + local -x EVIDENCE_BIN="$SERVER_BIN" if [[ "$ISSUER_KIND" == thunderid ]]; then edit "$RUNTIME_FILE" " uri: http://127.0.0.1:8081/oauth2/jwks" \ " uri: $TID_ISSUER/oauth2/jwks" jwks-uri @@ -1314,7 +1330,7 @@ step_issuer() { reader_command issuer -- "$TOOL_BIN" check "$PROJECT" --target "$RUNTIME_FILE" --posture development --format json [[ $CELL_OVER -eq 0 ]] || return 0 local candidate=$WORK/candidate installed=$WORK/installed-package - reader_command issuer -- env EVIDENCE_BIN="$SERVER_BIN" "$TOOL_BIN" package "$PROJECT" \ + reader_command issuer -- "$TOOL_BIN" package "$PROJECT" \ --target "$RUNTIME_FILE" --output "$candidate" --posture development --format json [[ $CELL_OVER -eq 0 ]] || return 0 SEALED_DIRS+=("$candidate") @@ -1396,10 +1412,6 @@ write_product_secrets() { fi journey_secret_new "$name" "$bytes" done < <(secret_references "$RUNTIME_FILE") - if [[ "$ISSUER_KIND" == thunderid && "$product" == adapter ]]; then - journey_secret_new adapter-reference-username 16 - journey_secret_new adapter-reference-password 24 - fi } # breg_schema_test_credentials: acquire real client tokens for BReg's schema @@ -1529,21 +1541,6 @@ step_database() { journey_pass database.connect return 0 fi - if [[ "$ISSUER_KIND" == thunderid && "$product" == adapter ]]; then - local mig_url run_url ref_user ref_pass - mig_url=$(<"$MIGRATION_URL_FILE") - run_url=$(<"$RUNTIME_URL_FILE") - read_secret adapter-reference-username ref_user - read_secret adapter-reference-password ref_pass - ADAPTER_DB_MIGRATION="$mig_url" ADAPTER_DB_RUNTIME="$run_url" \ - REFERENCE_USERNAME="$ref_user" REFERENCE_PASSWORD="$ref_pass" \ - database_step database.provision "$TOOL provision --runtime-config $RUNTIME_FILE --admin-url-file $ADMIN_URL_FILE" -- \ - "$TOOL_BIN" provision --runtime-config "$RUNTIME_FILE" --admin-url-file "$ADMIN_URL_FILE" - [[ $CELL_OVER -eq 0 ]] || return 0 - # Adapter applies its journal and idempotency schema at startup; it has no apply command. - journey_pass database.connect - return 0 - fi database_step database.provision "$TOOL provision --runtime-config $RUNTIME_FILE --admin-url-file $ADMIN_URL_FILE" -- \ "$TOOL_BIN" provision --runtime-config "$RUNTIME_FILE" --admin-url-file "$ADMIN_URL_FILE" [[ $CELL_OVER -eq 0 ]] || return 0 @@ -1610,7 +1607,8 @@ step_database() { "$TOOL_BIN" --format json apply --initial --runtime-config "$RUNTIME_FILE" --package "$build/package" ;; adapter) - journey_harness_failure "no database.connect recipe is written for adapter: it has no apply command, and its runtime reads the database URLs from secret:env references; extend step_database in own-provider.sh" + # Adapter applies its journal and idempotency schema at startup. + journey_unexercised database.connect ;; esac } @@ -1623,14 +1621,10 @@ serve_command() { casework | messaging | scheduling | documents) SERVE_COMMAND=("$SERVER_BIN" --runtime-config "$RUNTIME_FILE" serve) ;; render) SERVE_COMMAND=("$SERVER_BIN" serve --runtime-config "$RUNTIME_FILE") ;; adapter) - if [[ "$ISSUER_KIND" == thunderid ]]; then - SERVE_COMMAND=("$SERVER_BIN" serve --runtime-config "$RUNTIME_FILE" - --project "$PROJECT" - --profile "$JOURNEY_ROOT/products/adapter/profiles/breg-records/profile.yaml" - --pack "$PROJECT/pack.yaml") - else - journey_harness_failure "no start recipe is written for $product; add one to serve_command in own-provider.sh" - fi + SERVE_COMMAND=("$SERVER_BIN" serve --runtime-config "$RUNTIME_FILE" + --project "$PROJECT" + --profile "$JOURNEY_ROOT/products/adapter/profiles/breg-records/profile.yaml" + --pack "$PROJECT/pack.yaml") ;; evidence) if [[ "$ISSUER_KIND" == thunderid ]]; then @@ -1703,24 +1697,15 @@ step_start() { local product=$1 status=0 ready_url serve_command "$product" port_is_free "$PORT" || journey_harness_failure "port $PORT is in use; the journey cannot start $product on it" - if [[ "$ISSUER_KIND" == thunderid && "$product" == adapter ]]; then - local mig_url run_url ref_user ref_pass - mig_url=$(<"$MIGRATION_URL_FILE") - run_url=$(<"$RUNTIME_URL_FILE") - read_secret adapter-reference-username ref_user - read_secret adapter-reference-password ref_pass + if [[ "$product" == adapter ]]; then journey_start start adapter-source -- python3 "$PROJECTS_DIR/adapter-source.py" \ "$ADAPTER_SOURCE_PORT" "$SECRETS/adapter-reference-username" "$SECRETS/adapter-reference-password" || journey_harness_failure "the Adapter loopback source failed to start" journey_ready start adapter-source --timeout 30 -- \ curl --silent --show-error --fail --output /dev/null "http://127.0.0.1:$ADAPTER_SOURCE_PORT/ready" || journey_harness_failure "the Adapter loopback source did not answer /ready" - ADAPTER_DB_MIGRATION="$mig_url" ADAPTER_DB_RUNTIME="$run_url" \ - REFERENCE_USERNAME="$ref_user" REFERENCE_PASSWORD="$ref_pass" \ - journey_start start server --settle 3 -- "${SERVE_COMMAND[@]}" || status=$? - else - journey_start start server --settle 3 -- "${SERVE_COMMAND[@]}" || status=$? fi + journey_start start server --settle 3 -- "${SERVE_COMMAND[@]}" || status=$? SERVER_LOG_OUT=$JOURNEY_STEP_STDOUT SERVER_LOG_ERR=$JOURNEY_STEP_STDERR if [[ $status -ne 0 ]]; then @@ -1868,11 +1853,9 @@ call_request() { options+=(--header 'Content-Type: application/json' --data-file "$WORK/request.json") ;; adapter) - if [[ "$ISSUER_KIND" == thunderid ]]; then - options+=(--header 'Content-Type: application/json' - --header 'Idempotency-Key: journey-adapter-first-call' - --data-file "$WORK/adapter-call-body.json") - fi + options+=(--header 'Content-Type: application/json' + --header 'Idempotency-Key: journey-adapter-first-call' + --data-file "$WORK/adapter-call-body.json") ;; esac local status=0 @@ -1881,8 +1864,13 @@ call_request() { if [[ "$CELL" == scheduling && "$CALL_METHOD" == GET && "$CALL_PATH" == /v1/locations && "$JOURNEY_HTTP_STATUS" == 200 ]]; then scheduling_catalogue_ok=1 fi - if [[ "$ISSUER_KIND" == thunderid && "$CELL" == adapter && "$JOURNEY_HTTP_STATUS" != 201 ]]; then - journey_harness_failure "Adapter POST /v1/records/person returned HTTP $JOURNEY_HTTP_STATUS instead of 201" + if [[ "$CELL" == adapter ]]; then + [[ "$JOURNEY_HTTP_STATUS" == 201 ]] || + journey_harness_failure "Adapter POST /v1/records/person returned HTTP $JOURNEY_HTTP_STATUS instead of 201" + jq -e '.data == {name: "Example Person"} and .meta.recordTypeId == "person"' "$JOURNEY_STEP_STDOUT" >/dev/null || + journey_harness_failure "Adapter did not return the source fixture's person record" + cp -- "$JOURNEY_STEP_STDOUT" "$WORK/call.response" || + journey_harness_failure "cannot preserve the Adapter response for promotion" fi journey_request_contract "$CALL_METHOD" "$CALL_PATH" "${options[@]+"${options[@]}"}" >"$WORK/call.contract" journey_claim_names ACCESS_TOKEN >"$WORK/call.claims" @@ -1968,10 +1956,8 @@ step_call() { journey_harness_failure "cannot build the Render request body; see $JOURNEY_STEP_STDERR" ;; adapter) - if [[ "$ISSUER_KIND" == thunderid ]]; then - journey_write_file "$WORK/adapter-call-body.json" < <(printf '%s\n' \ - '{"data":{"recordId":"person-1","domainData":{"name":"Example Person"}}}') - fi + journey_write_file "$WORK/adapter-call-body.json" < <(printf '%s\n' \ + '{"data":{"recordId":"person-1","domainData":{"name":"Example Person"}}}') ;; esac call_request || status=$? @@ -1982,7 +1968,7 @@ step_call() { fi check_wrong_kind journey_pass call - journey_reached t1 + [[ "$CALL_METHOD" != GET ]] || journey_reached t1 return 0 fi [[ "$JOURNEY_HTTP_STATUS" != 000 ]] || @@ -2021,7 +2007,7 @@ step_call() { status=0 call_request || status=$? if [[ $status -eq 0 ]]; then - journey_reached t1 + [[ "$CALL_METHOD" != GET ]] || journey_reached t1 return 0 fi # The refusal of this call is logged after the response is written, and @@ -2759,12 +2745,13 @@ step_hook() { documents_hook journey_pass hook ;; + adapter) journey_unexercised hook ;; *) journey_pass hook ;; esac } step_stop() { - if [[ "$ISSUER_KIND" == thunderid && "$CELL" == adapter ]] && journey_process_running adapter-source; then + if [[ "$CELL" == adapter ]] && journey_process_running adapter-source; then journey_stop stop adapter-source || journey_harness_failure "the Adapter loopback source ignored SIGTERM" fi if journey_stop stop server; then diff --git a/products/platform/journeys/promote.sh b/products/platform/journeys/promote.sh index 41d0f250a5..411e98aac1 100755 --- a/products/platform/journeys/promote.sh +++ b/products/platform/journeys/promote.sh @@ -21,8 +21,8 @@ # production check and the list from the start. The two # lists must be equal, or the run stops as a harness # failure. The explicit production-compatible cases can continue -# with zero diagnostics. The count goes to refusalsMet -# in summary.json. +# with zero diagnostics. The number of distinct matched +# codes goes to productionRefusals in summary.json. # fix each refusal is fixed by the function fix_. A # code with no function is a harness failure that names # it, so a new refusal is looked at and never recorded @@ -36,7 +36,8 @@ # http... # same-contract the request line, the headers other than the token # and the token's claim names equal the original authenticated -# call's recorded contract and claim names. +# call's recorded contract and claim names. Adapter also +# replays the original HTTP 201 response with the source stopped. # # The input. --from RUN_DIR is a run directory of own-provider.sh that ended # with --keep, under the same JOURNEY_CONTAINER_PREFIX. Without --from this run @@ -211,6 +212,12 @@ recipe() { case "$product" in breg | coordinator) SERVE_COMMAND=("$SERVER_BIN" --runtime-config "$RUNTIME_FILE") ;; casework | messaging | scheduling | documents) SERVE_COMMAND=("$SERVER_BIN" --runtime-config "$RUNTIME_FILE" serve) ;; + adapter) + SERVE_COMMAND=("$SERVER_BIN" serve --runtime-config "$RUNTIME_FILE" + --project "$PROJECT" + --profile "$JOURNEY_ROOT/products/adapter/profiles/breg-records/profile.yaml" + --pack "$PROJECT/pack.yaml") + ;; render) SERVE_COMMAND=("$SERVER_BIN" serve --runtime-config "$RUNTIME_FILE") ;; *) journey_harness_failure "no start recipe is written for $product; add one to recipe in promote.sh" ;; esac @@ -319,7 +326,7 @@ production_outcome() { printf '%s\n' remediate elif [[ "$state" == started && "$status" == 0 && -z "$codes" ]]; then case "$product" in - casework | messaging | scheduling | documents | coordinator) printf '%s\n' compatible ;; + casework | messaging | scheduling | documents | coordinator | render | adapter) printf '%s\n' compatible ;; *) printf '%s\n' missing-refusal ;; esac else @@ -379,6 +386,16 @@ call_recipe() { CLIENT="coordinator-producer" CALL_PATH=/v1/workflows/coordinator ;; + adapter) + CLIENT=registry-adapter-example-client + CALL_METHOD=POST + CALL_PATH=/v1/records/person + [[ -f "$FROM/work/adapter/adapter-call-body.json" ]] || + journey_harness_failure "the Adapter input holds no request body" + CALL_OPTIONS=(--header 'Content-Type: application/json' + --header 'Idempotency-Key: journey-adapter-first-call' + --data-file "$FROM/work/adapter/adapter-call-body.json") + ;; render) CLIENT="portal" CALL_METHOD=POST @@ -463,7 +480,7 @@ promote_call_failure() { } walk_product() { - local product=$1 tier outcome count code dev_claims dev_contract check_status production_case + local product=$1 tier outcome count=0 code dev_claims dev_contract check_status production_case journey_product_field "$product" tier tier CELL=$product journey_cell_begin "$product" @@ -515,20 +532,17 @@ walk_product() { invalid) journey_harness_failure "the production check of $product returned status $check_status for diagnostic codes [$CHECK_CODES]; see $JOURNEY_STEP_STDERR" ;; - missing-refusal) - journey_fail refusals journey.promote.nothing-refused - journey_cell_end - return 0 - ;; - compatible) - count=0 - printf 'promote: %s passed the production check with zero diagnostics; no remediation required\n' "$product" - ;; remediate) count=$(printf '%s\n' "$CHECK_CODES" | wc -l | tr -d ' ') ;; esac - journey_count refusals "$count" + journey_count production-refusals "$count" + printf 'promote: %s measured %s production refusal(s)\n' "$product" "$count" + if [[ "$production_case" == missing-refusal ]]; then + journey_fail refusals journey.promote.nothing-refused + journey_cell_end + return 0 + fi journey_pass refusals # fix: first the contract as the development files give it (the claim names @@ -545,6 +559,9 @@ walk_product() { elif [[ "$production_case" == compatible ]]; then journey_harness_failure "the production-compatible case for $product requires the original development request and claim names; rerun own-provider" fi + if [[ "$product" == adapter && ! -s "$recorded/call.response" ]]; then + journey_harness_failure "Adapter promotion requires the recorded development response; rerun own-provider" + fi if [[ "$production_case" == remediate ]]; then while IFS= read -r code; do apply_fix "$code" @@ -586,6 +603,12 @@ walk_product() { journey_harness_failure "the token claims of $product differ between the development files and the production start" fi [[ "$(journey_request_contract "$CALL_METHOD" "$CALL_PATH" "${CALL_OPTIONS[@]+"${CALL_OPTIONS[@]}"}")" == "$dev_contract" ]] || journey_harness_failure "the request of $product changed between the development files and the production start" + if [[ "$product" == adapter ]]; then + [[ "$JOURNEY_HTTP_STATUS" == 201 ]] || + journey_harness_failure "the promoted Adapter returned HTTP $JOURNEY_HTTP_STATUS instead of 201" + cmp -s -- "$recorded/call.response" "$JOURNEY_STEP_STDOUT" || + journey_harness_failure "the promoted Adapter response differs from the development response" + fi journey_stop same-contract server || journey_harness_failure "the server of $product ignored SIGTERM" journey_pass same-contract journey_cell_end diff --git a/products/platform/journeys/rstack-dev.sh b/products/platform/journeys/rstack-dev.sh index 215fafa518..39dc3a52cd 100755 --- a/products/platform/journeys/rstack-dev.sh +++ b/products/platform/journeys/rstack-dev.sh @@ -50,6 +50,8 @@ for name in breg casework evidence messaging scheduling documents coordinator ad export "RSTACK_${upper}CTL_BIN=$JOURNEY_BIN_DIR/${name}ctl" done export RSTACK_RENDER_BIN=$JOURNEY_BIN_DIR/registry-render +# Evidence's authoring CLI invokes the runtime when checking the selected target. +export EVIDENCE_BIN=$JOURNEY_BIN_DIR/evidence # Runs this script started and has not yet stopped, one id per line. LIVE_RUNS='' @@ -479,6 +481,7 @@ unexpected_answer() { walk_product() { # shellcheck disable=SC2034 # token and token2 are set by name through issue_token local product=$1 work project tier plan_capable status=0 url message_id='' token='' token2='' workflow_revision='' uses_postgres + local first_read=0 journey_product_field "$product" tier tier journey_product_field "$product" rstackDevPlan plan_capable journey_product_field "$product" usesPostgres uses_postgres @@ -596,17 +599,25 @@ walk_product() { unexpected_answer call fi journey_pass call - journey_reached t1 + if [[ "$CALL_METHOD" == GET && -n "$PERSON" ]]; then + journey_reached t1 + first_read=1 + fi # hook: BReg's keep write also triggers its local sink. if [[ "$product" == breg ]]; then local sink write_keep "$product" "$work" "$project" "$url" "$run" sink=$(jq -er '.bregHookSink.receivedUrl' "$START_FILE") - journey_poll 30 -- hook_received "$sink" "A retained contact" + journey_poll 30 -- hook_received "$sink" "$KEEP_EXPECT" || + journey_harness_failure "the BReg hook sink did not receive the retained contact's creation event" journey_http hook GET "$sink" || unexpected_answer hook + breg_hook_matches "$KEEP_EXPECT" "$JOURNEY_STEP_STDOUT" || + journey_harness_failure "the BReg hook receipt does not contain the retained contact's creation event" + journey_pass hook + else + journey_unexercised hook fi - journey_pass hook if [[ "$uses_postgres" == true ]]; then if [[ "$product" != breg ]]; then @@ -661,10 +672,17 @@ walk_product() { fi jq -e --arg expected "$KEEP_EXPECT" '[.. | strings] | index($expected) != null' "$JOURNEY_STEP_STDOUT" >/dev/null || journey_harness_failure "the retained $product response did not contain the written record" - journey_reached t2 + if [[ "$method" == GET && $first_read -eq 0 ]]; then + journey_reached t1 + fi if [[ -n "$audit" ]]; then journey_step keep -- audit_was_appended "$work/audit-before-restart.jsonl" "$audit" fi + # These paths have written and read back a record across a restart. + # BReg also delivered its observer hook before the restart. + case "$product" in + breg | coordinator | messaging) journey_reached t2 ;; + esac else printf '%s\n' "$product has no PostgreSQL state to retain." fi @@ -737,8 +755,18 @@ assert all(json.loads(line)["eventId"] for line in after[len(before):].splitline PYAUDIT } +# breg_hook_matches RECORD_ID [FILE]: find the exact creation event in the +# sink's capture. Without FILE, read the current poll response from stdin. +breg_hook_matches() { + local record_id=$1 + shift + jq -e --arg record "$record_id" 'any(.[] | .body | fromjson?; + .type == "contact-created" and .data.recordId == $record and + .data.values.name == "A retained contact")' "$@" >/dev/null +} + hook_received() { - curl --silent --fail --max-time 3 "$1" | jq -e --arg name "$2" 'any(.[] | .body | fromjson? | .. | strings; . == $name)' >/dev/null + curl --silent --fail --max-time 3 "$1" | breg_hook_matches "$2" } # attach_database PROJECT: start PROJECT against a PostgreSQL server the reader diff --git a/products/platform/journeys/test_journey_tables.py b/products/platform/journeys/test_journey_tables.py index 50d1a89fcb..933b233676 100644 --- a/products/platform/journeys/test_journey_tables.py +++ b/products/platform/journeys/test_journey_tables.py @@ -507,7 +507,12 @@ def test_zero_diagnostics_requires_a_successful_check_and_an_explicit_case(self) ("messaging", "started", 0, "", "compatible"), ("scheduling", "started", 0, "", "compatible"), ("coordinator", "started", 0, "", "compatible"), - ("render", "started", 0, "", "missing-refusal"), + ("render", "started", 0, "", "compatible"), + ("adapter", "started", 0, "", "compatible"), + ("adapter", "refused", 1, "config.refused", "remediate"), + ("adapter", "started", 1, "", "invalid"), + ("render", "refused", 1, "render.config.refused", "remediate"), + ("breg", "started", 0, "", "missing-refusal"), ("messaging", "started", 1, "", "invalid"), ("scheduling", "refused", 1, "", "invalid"), ("coordinator", "refused", 1, "config.dev-only", "remediate"), @@ -829,6 +834,179 @@ def test_promote_refuses_thunderid_run_directory(self): self.assertIn("keycloak", result.stderr) +class CaseworkProducerFixture(unittest.TestCase): + def test_binds_either_standalone_starter_issuer(self): + script = (TABLES / "own-provider.sh").read_text(encoding="utf-8") + functions = [] + for name in ("harness_edit", "bind_casework_producer"): + match = re.search(rf"^{name}\(\) \{{\n.*?^\}}\n", script, re.M | re.S) + self.assertIsNotNone(match, name) + functions.append(match.group(0)) + driver = r""" +journey_harness_failure() { printf '%s\n' "$1" >&2; exit 3; } +edit() { harness_edit "$1" "$2" "$3"; } +bind_casework_producer "$1" http://127.0.0.1:19000/realms/registry fixture-subject +""" + for issuer in ("http://127.0.0.1:8093", "https://identity.casework.example.test"): + with self.subTest(issuer=issuer), tempfile.TemporaryDirectory() as directory: + path = Path(directory) / "casework.yaml" + path.write_text( + "trustedProducers:\n requester:\n profile: requester\n" + f" issuer: {issuer}\n subject: b75315b2-5854-70f3-8867-511dd771a6da\n" + " sourceNamespaces: [standalone]\n", encoding="utf-8", + ) + result = subprocess.run( + ["bash", "-eu", "-c", "\n".join(functions) + driver, "casework-producer", str(path)], + capture_output=True, text=True, timeout=10, + ) + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual(yaml.safe_load(path.read_text(encoding="utf-8"))["trustedProducers"]["requester"], { + "profile": "requester", "issuer": "http://127.0.0.1:19000/realms/registry", + "subject": "fixture-subject", "sourceNamespaces": ["standalone"], + }) + + +class LocalHookWalk(unittest.TestCase): + def walk(self, product, delivered): + script = (TABLES / "rstack-dev.sh").read_text(encoding="utf-8") + functions = [] + for name in ("walk_product", "recipe", "hook_received", "breg_hook_matches"): + match = re.search(rf"^{name}\(\) \{{\n.*?^\}}\n", script, re.M | re.S) + self.assertIsNotNone(match, name) + functions.append(match.group(0)) + driver = r""" +source "$1/lib.sh" +scratch=$2 product=$3 delivered=$4 +trace=$scratch/trace +LIVE_RUNS='' +printf '{"authentication":{"oidc":{"issuers":{"fixture":{}}}},"audit":{"path":"%s/audit.jsonl"}}\n' \ + "$scratch" >"$scratch/runtime.json" +: >"$scratch/audit.jsonl" +: >"$scratch/audit.schedulingctl.jsonl" +init_command() { INIT_COMMAND=(true); } +add_contact_hook() { :; } +start_run() { + local result=passed + [[ "$1" != keep ]] || result=skipped + RUN=$1-run + START_FILE=$scratch/$1.json + jq -n --arg product "$CELL" --arg runtime "$scratch/runtime.json" --arg result "$result" ' + {runtimeConfigs: {($product): $runtime}, scenarios: [{id: "starter", result: $result}], + bregHookSink: {receivedUrl: "http://127.0.0.1:49191/received"}}' >"$START_FILE" + LIVE_RUNS+="$RUN"$'\n' +} +run_url() { printf '%s\n' 'http://127.0.0.1:49192'; } +issue_token() { :; } +write_keep() { + KEEP_PERSON=$PERSON + KEEP_PATH=/retained + KEEP_EXPECT=retained-id + printf 'write %s\n' "$1" >>"$trace" +} +sink_response() { + local record + case "$delivered" in + yes | missing-on-read) record=retained-id ;; + wrong-record) record=other-id ;; + *) printf '%s\n' '[]'; return ;; + esac + jq -nc --arg record "$record" '[{body: ({type: "contact-created", data: { + recordId: $record, values: {name: "A retained contact"}}} | tojson)}]' +} +curl() { + [[ "${!#}" == http://127.0.0.1:49191/received ]] + printf '%s\n' 'poll sink' >>"$trace" + sink_response +} +journey_poll() { + # One deterministic poll attempt runs the real predicate and models a timeout on failure. + shift 2 + "$@" +} +journey_http() { + JOURNEY_STEP_STDOUT=$scratch/response.json + case "$1" in + call) printf '%s\n' '{}' >"$JOURNEY_STEP_STDOUT" ;; + hook) + [[ "${!#}" == http://127.0.0.1:49191/received ]] + printf '%s\n' 'read sink' >>"$trace" + if [[ "$delivered" == missing-on-read ]]; then + printf '%s\n' '[]' >"$JOURNEY_STEP_STDOUT" + else + sink_response >"$JOURNEY_STEP_STDOUT" + fi + ;; + keep) + printf '%s\n' 'read retained record' >>"$trace" + printf '%s\n' '{"recordId":"retained-id"}' >"$JOURNEY_STEP_STDOUT" + ;; + *) return 1 ;; + esac +} +rstack_dev() { :; } +state_is_empty() { :; } +edit_for_restart() { :; } +audit_was_appended() { :; } +attach_database() { journey_pass attach; } +run_containers() { printf '%s\n' 'fake-container'; } +journey_check_absent() { :; } + +journey_init rstack-dev -- --product "$product" --out "$scratch/run" +if [[ "$delivered" == terminal-step ]]; then + journey_cell_begin "$product" + journey_unexercised stop +else + walk_product "$product" +fi +journey_finish +""" + with tempfile.TemporaryDirectory() as directory: + scratch = Path(directory) + result = subprocess.run( + ["bash", "-euo", "pipefail", "-c", "\n".join(functions) + driver, + "local-hook-walk", str(TABLES), directory, product, delivered], + env={**os.environ, "JOURNEY_TABLES_DIR": str(TABLES)}, + capture_output=True, text=True, timeout=15, + ) + cells = (scratch / "run" / "cells.tsv").read_text(encoding="utf-8") + outcomes = [tuple(row.split("\t")[1:3]) for row in cells.splitlines()[1:]] + trace_file = scratch / "trace" + trace = trace_file.read_text(encoding="utf-8").splitlines() if trace_file.exists() else [] + return result, outcomes, trace + + def test_scheduling_reports_unexercised_and_keeps_walking(self): + result, outcomes, trace = self.walk("scheduling", "no") + self.assertEqual(result.returncode, 0, result.stdout + result.stderr) + self.assertEqual([row for row in outcomes if row[0] == "hook"], [("hook", "unexercised")]) + self.assertIn("scheduling hook: unexercised", result.stderr) + self.assertEqual(outcomes[-3:], [("keep", "pass"), ("attach", "pass"), ("stop", "pass")]) + self.assertEqual(trace, ["write scheduling", "read retained record"]) + + def test_breg_passes_hook_after_payload_arrives(self): + result, outcomes, trace = self.walk("breg", "yes") + self.assertEqual(result.returncode, 0, result.stdout + result.stderr) + self.assertEqual([row for row in outcomes if row[0] == "hook"], [("hook", "pass")]) + self.assertEqual(outcomes[-3:], [("keep", "pass"), ("attach", "pass"), ("stop", "pass")]) + self.assertEqual(trace, ["write breg", "poll sink", "read sink", "read retained record"]) + + def test_breg_does_not_pass_hook_without_payload(self): + for delivered in ("no", "wrong-record", "missing-on-read"): + with self.subTest(delivered=delivered): + result, outcomes, trace = self.walk("breg", delivered) + self.assertEqual(result.returncode, 3, result.stdout + result.stderr) + self.assertFalse(any(step in {"hook", "keep", "stop"} for step, _ in outcomes)) + expected = ["write breg", "poll sink"] + if delivered == "missing-on-read": + expected.append("read sink") + self.assertEqual(trace, expected) + + def test_final_step_cannot_be_unexercised(self): + result, outcomes, _ = self.walk("scheduling", "terminal-step") + self.assertEqual(result.returncode, 3, result.stdout + result.stderr) + self.assertIn("the final step of scheduling cannot be marked unexercised", result.stderr) + self.assertEqual(outcomes, []) + + class HookReceiverAndAdapterSource(unittest.TestCase): def test_hook_receiver_signature_verification(self): spec = importlib.util.spec_from_file_location( diff --git a/products/platform/journeys/test_lib.sh b/products/platform/journeys/test_lib.sh index 7a16c5f522..fc94e323fa 100644 --- a/products/platform/journeys/test_lib.sh +++ b/products/platform/journeys/test_lib.sh @@ -398,8 +398,8 @@ driver_binaries() { # The cell of PRODUCT as CELL_ describes it: pass, fail:STEP:CODE, # needs:STEP:THING, poll:STEP (a journey_poll that runs out of time), -# unreached:STEP, blocker:STEP:CODE:ASSIST or harness:STEP. The default is the -# product's row in the synthetic table. +# unreached:STEP, unexercised:STEP, blocker:STEP:CODE:ASSIST or harness:STEP. +# The default is the product's row in the synthetic table. driver_cell() { local product=$1 plan_name plan kind stop code assist step plan_name="CELL_$product" @@ -421,6 +421,10 @@ driver_cell() { journey_unreached "$step" "runs beside its parent" break ;; + unexercised) + journey_unexercised "$step" + continue + ;; fail) if ! journey_step "$step" -- "$alpha" fail; then journey_fail "$step" "$code" @@ -802,6 +806,9 @@ driver_replay() { esac break fi + if [[ "$step" == refusals && -n "${REPLAY_PRODUCTION_REFUSALS:-}" ]]; then + journey_count production-refusals "$REPLAY_PRODUCTION_REFUSALS" + fi journey_pass "$step" done <<<"$steps" if [[ "$kind" == pass && ${REPLAY_COUNTERS:-0} != 0 ]]; then @@ -1875,6 +1882,16 @@ case_modes() { drive 1 CELL_gamma=unreached:start -- "${run_args[@]}" --expected "$table" check_equal "unreached at another step is a mismatch" mismatch "$(json '.cells[] | select(.product == "gamma") | .verdict' "$out/summary.json")" + begin_case unexercised-step + drive 0 CELL_alpha=unexercised:call -- "${run_args[@]}" --product alpha --expected "$table" --strict + check "the skipped step is recorded" has $'alpha\tcall\tunexercised\t-' "$out/cells.tsv" + check "later steps still run" has $'alpha\tstop\tpass\t-' "$out/cells.tsv" + check "the log identifies the unexercised step" has "alpha call: unexercised" "$last_err" + + begin_case final-step-must-run + drive 3 CELL_alpha=unexercised:stop -- "${run_args[@]}" --product alpha + check "the required final step cannot be skipped" has "the final step of alpha cannot be marked unexercised" "$last_err" + begin_case ratchet-stale drive 0 CELL_beta=pass -- "${run_args[@]}" --expected "$table" check "a listed failure that passes is a warning" has "warning: a listed failure no longer fails" "$last_err" @@ -2023,6 +2040,19 @@ case_real_tables() { check_equal "every product has a cell" "$(value replayed)" "$(json '.cells | length' "$out/summary.json")" check_equal "every cell equals its row" 0 "$(json '[.cells[] | select(.verdict != "ok")] | length' "$out/summary.json")" + begin_case production-refusal-count + local count + for count in 0 2; do + drive 0 TEST_JOURNEY=promote SCENARIO=replay REPLAY_PRODUCTION_REFUSALS="$count" JOURNEY_TABLES_DIR= -- \ + --product render --product breg --expected "$lib_dir/expected-failures.yaml" --strict + check_equal "the blocked cell explicitly records an unmeasured comparison" true \ + "$(json '.cells[] | select(.product == "breg") | has("productionRefusals") and .productionRefusals == null' "$out/summary.json")" + check_equal "the completed comparison records its measured count" "$count" \ + "$(json '.cells[] | select(.product == "render") | .productionRefusals' "$out/summary.json")" + check_equal "the production refusals are also included in the aggregate" "$count" \ + "$(json '.cells[] | select(.product == "render") | .total.refusalsMet' "$out/summary.json")" + done + begin_case real-table-missing-first-hour-measurements drive 0 TEST_JOURNEY=rstack-dev SCENARIO=replay JOURNEY_TABLES_DIR= -- --expected "$lib_dir/expected-failures.yaml" --strict check_equal "every functional cell equals its row" 0 "$(json '[.cells[] | select(.verdict != "ok")] | length' "$out/summary.json")" diff --git a/products/render/README.md b/products/render/README.md index 855511d07e..a97d8b917e 100644 --- a/products/render/README.md +++ b/products/render/README.md @@ -63,6 +63,16 @@ The scaffold compiles offline out of the box: the binary embeds a baseline Latin font set. Scripts beyond Latin (Arabic, Hebrew, …) need a bundle font (see `registry-render init`'s note) and `registry-render check` names the gap. +## Qualify signed delivery + +Check development B-B and B-T delivery from the repository root with +`uv run --script products/render/scripts/test_signed_delivery.py`. +Pass `--render ` and `--scratch `. +Use the same arguments with `products/render/scripts/test_transit_delivery.py` +to check production-posture B-T through OpenBao Transit and an HTTPS timestamp +authority. The Transit check needs a local Linux Docker engine and the +OpenBao image pinned in the script. + ## Where to read next - [Deploy Registry Render](https://docs.registrystack.org/operate/registry-render/): install, diff --git a/products/render/scripts/test_signed_delivery.py b/products/render/scripts/test_signed_delivery.py new file mode 100644 index 0000000000..b571ee3b54 --- /dev/null +++ b/products/render/scripts/test_signed_delivery.py @@ -0,0 +1,422 @@ +#!/usr/bin/env python3 +# /// script +# requires-python = ">=3.11" +# dependencies = ["pyhanko==0.38.1"] +# /// +# SPDX-License-Identifier: Apache-2.0 +"""Exercise the published Render seal endpoint and verify the delivered PDF.""" + +import argparse +import base64 +import hashlib +import http.client +import json +import os +import socket +import subprocess +import sys +import tempfile +import threading +import time +from contextlib import contextmanager +from datetime import datetime, timedelta, timezone +from http.server import BaseHTTPRequestHandler, HTTPServer +from pathlib import Path + +from asn1crypto import keys, tsp +from asn1crypto import x509 as asn1_x509 +from cryptography import x509 +from cryptography.hazmat.primitives import hashes, serialization +from cryptography.hazmat.primitives.asymmetric import ec, rsa, utils +from cryptography.x509.oid import ExtendedKeyUsageOID, NameOID, ObjectIdentifier +from pyhanko.pdf_utils.reader import PdfFileReader +from pyhanko.sign.timestamps import DummyTimeStamper + +HERE = Path(__file__).resolve().parent +NOTICE = HERE.parents[2] / "crates/registry-render/tests/fixtures/sealed-notice" +ISSUER = "https://issuer.example.test" +AUDIENCE = "urn:render:qualification" +CLIENT = "records-service" +DOCUMENT_SIGNING = ObjectIdentifier("1.3.6.1.5.5.7.3.36") +REQUEST = json.dumps({ + "issuedAt": "2026-01-01T00:00:00Z", + "data": {"reference": "SYNTHETIC-01", "body": "Fictional qualification notice."}, +}) + + +def b64url(data): + return base64.urlsafe_b64encode(data).rstrip(b"=").decode() + + +def sign_token(key, scope): + now = int(time.time()) + header = {"alg": "ES256", "kid": "fixture", "typ": "at+jwt"} + claims = { + "iss": ISSUER, "sub": "qualification-caller", "aud": AUDIENCE, + "client_id": CLIENT, "iat": now, "exp": now + 300, "scope": scope, + } + data = ".".join(b64url(json.dumps(value).encode()) for value in (header, claims)) + r, s = utils.decode_dss_signature(key.sign(data.encode(), ec.ECDSA(hashes.SHA256()))) + return data + "." + b64url(r.to_bytes(32, "big") + s.to_bytes(32, "big")) + + +def issue_certificate(public_key, name, issuer, issuer_key, *, purpose=None, names=None): + now = datetime.now(timezone.utc) + subject = x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, name)]) + is_root = issuer is None + builder = ( + x509.CertificateBuilder() + .subject_name(subject) + .issuer_name(subject if is_root else issuer.subject) + .public_key(public_key) + .serial_number(x509.random_serial_number()) + .not_valid_before(now - timedelta(minutes=5)) + .not_valid_after(now + timedelta(days=90)) + .add_extension(x509.BasicConstraints(ca=is_root, path_length=None), critical=True) + .add_extension(x509.KeyUsage( + digital_signature=not is_root, content_commitment=not is_root, + key_encipherment=False, data_encipherment=False, key_agreement=False, + key_cert_sign=is_root, crl_sign=is_root, encipher_only=False, decipher_only=False, + ), critical=True) + ) + if purpose is not None: + builder = builder.add_extension( + x509.ExtendedKeyUsage([purpose]), critical=purpose == ExtendedKeyUsageOID.TIME_STAMPING + ) + if names is not None: + builder = builder.add_extension(x509.SubjectAlternativeName(names), critical=False) + return builder.sign(issuer_key, hashes.SHA256()) + + +def write_fixture(binary, directory, *, transit_socket=None): + def run(*args): + subprocess.run([binary, *args], check=True, stdout=subprocess.DEVNULL, timeout=30) + + run("package", "--bundle", NOTICE, "--output", directory / "package") + secrets = directory / "secrets" + secrets.mkdir(mode=0o700) + csr_path = directory / "seal.csr" + key_settings = ["--key", secrets / "seal.jwk"] + if transit_socket is not None: + key_settings = [ + "--transit-unix-socket-path", transit_socket, "--transit-mount", "transit", + "--transit-key-name", "render-seal", "--transit-key-version", "1", + ] + run("keygen", *key_settings, "--csr", csr_path, + "--common-name", "Qualification test seal", "--country", "FR") + signer_key = x509.load_pem_x509_csr(csr_path.read_bytes()).public_key() + root_key = ec.generate_private_key(ec.SECP256R1()) + root = issue_certificate(root_key.public_key(), "Qualification root", None, root_key) + other_key = ec.generate_private_key(ec.SECP256R1()) + other = issue_certificate(other_key.public_key(), "Unrelated root", None, other_key) + leaf = issue_certificate( + signer_key, "Qualification test seal", root, root_key, purpose=DOCUMENT_SIGNING + ) + for name, certificates in ( + ("root.pem", [root]), ("other-root.pem", [other]), ("chain.pem", [leaf, root]) + ): + (directory / name).write_bytes(b"".join( + certificate.public_bytes(serialization.Encoding.PEM) for certificate in certificates + )) + + issuer_key = ec.generate_private_key(ec.SECP256R1()) + point = issuer_key.public_key().public_numbers() + jwks = {"keys": [{ + "kty": "EC", "crv": "P-256", "alg": "ES256", "kid": "fixture", + "x": b64url(point.x.to_bytes(32, "big")), "y": b64url(point.y.to_bytes(32, "big")), + }]} + (secrets / "jwks.json").write_text(json.dumps(jwks)) + return issuer_key, "sha256:" + leaf.fingerprint(hashes.SHA256()).hex() + + +@contextmanager +def timestamp_authority(directory, *, tls=None): + root_key = ec.generate_private_key(ec.SECP256R1()) + root = issue_certificate(root_key.public_key(), "Qualification TSA root", None, root_key) + (directory / "tsa-root.pem").write_bytes(root.public_bytes(serialization.Encoding.PEM)) + tsa_key = rsa.generate_private_key(public_exponent=65537, key_size=2048) + leaf = issue_certificate( + tsa_key.public_key(), "Qualification TSA", root, root_key, + purpose=ExtendedKeyUsageOID.TIME_STAMPING, + ) + fixture = DummyTimeStamper( + asn1_x509.Certificate.load(leaf.public_bytes(serialization.Encoding.DER)), + keys.PrivateKeyInfo.load(tsa_key.private_bytes( + serialization.Encoding.DER, serialization.PrivateFormat.PKCS8, + serialization.NoEncryption(), + )), + ) + timestamp_digests = [] + + class TimestampHandler(BaseHTTPRequestHandler): + def do_POST(self): + self.connection.settimeout(3) + assert self.path == "/timestamp" + assert self.headers["Content-Type"] == "application/timestamp-query" + data = self.rfile.read(int(self.headers["Content-Length"])) + reply = fixture.request_tsa_response(tsp.TimeStampReq.load(data)) + timestamp_digests.append( + "sha256:" + hashlib.sha256(reply["time_stamp_token"].dump()).hexdigest() + ) + response = reply.dump() + self.send_response_only(200) + self.send_header("Content-Type", "application/timestamp-reply") + self.send_header("Content-Length", str(len(response))) + self.end_headers() + self.wfile.write(response) + + with HTTPServer(("127.0.0.1", 0), TimestampHandler) as server: + scheme = "http" + if tls is not None: + server.socket = tls.wrap_socket(server.socket, server_side=True) + scheme = "https" + thread = threading.Thread(target=server.serve_forever) + thread.start() + try: + yield f"{scheme}://127.0.0.1:{server.server_port}/timestamp", timestamp_digests + finally: + server.shutdown() + thread.join() + + +def request(port, path, *, token=None): + connection = http.client.HTTPConnection("127.0.0.1", port, timeout=25) + try: + if token is None: + connection.request("GET", path) + else: + connection.request("POST", path, REQUEST, { + "Authorization": "Bearer " + token, + "Accept": "application/pdf", + "Content-Type": "application/json", + }) + response = connection.getresponse() + return response.status, response.headers, response.read() + finally: + connection.close() + + +def delivery( + binary, directory, issuer_key, *, tsa_url=None, transit_socket=None, + tsa_ca=False, expect_timestamp_failure=False, +): + with socket.socket() as reservation: + reservation.bind(("127.0.0.1", 0)) + port = reservation.getsockname()[1] + audit = directory / "audit.jsonl" + runtime = directory / "runtime.yaml" + if tsa_url is None: + timestamp_settings = "withoutTimestamp: seal-stops-validating-when-certificate-expires" + else: + timestamp_settings = f"timestampAuthority:\n url: {tsa_url}" + if tsa_ca: + timestamp_settings += "\n caBundleRef: secret:file/tsa-tls-root.pem" + posture = "development" + assurance = "local" + signer = "type: local-jwk\n privateKeyRef: secret:file/seal.jwk" + expected_warnings = ["render.posture.local-assurance"] + if transit_socket is not None: + posture = assurance = "production" + signer = ( + f"type: transit\n unixSocketPath: {json.dumps(str(transit_socket))}\n" + " mount: transit\n keyName: render-seal\n keyVersion: 1\n" + " attemptTimeoutMilliseconds: 2000" + ) + expected_warnings = [] + runtime.write_text(f"""\ +apiVersion: id.registrystack.org/formats/render/runtime/v1alpha1 +kind: RenderRuntimeConfig +listener: + bind: 127.0.0.1:{port} +package: + root: {json.dumps(str(directory / 'package'))} +secretProviders: + file: + root: {json.dumps(str(directory / 'secrets'))} +authentication: + oidc: + issuers: + fixture: + issuer: {ISSUER} + audience: {AUDIENCE} + allowedClients: [{CLIENT}] + jwksSource: + type: static + documentRef: secret:file/jwks.json +audit: + path: {json.dumps(str(audit))} +assuranceProfile: {assurance} +signing: + seals: + ministry: + signer: + {signer} + certificateChainFile: {json.dumps(str(directory / 'chain.pem'))} + {timestamp_settings} + allowedClients: [{CLIENT}] +""") + checked = subprocess.run( + [binary, "check", "--bundle", directory / "package", "--runtime-config", runtime, + "--environment", "--posture", posture, "--format", "json"], + capture_output=True, timeout=30, + ) + report = json.loads(checked.stdout) + assert checked.returncode == 0 and report["ok"], report + assert [item["code"] for item in report["diagnostics"]] == expected_warnings, report + log_path = directory / "serve.jsonl" + with log_path.open("w") as log, subprocess.Popen( + [binary, "serve", "--runtime-config", runtime, "--posture", posture], + stdout=subprocess.DEVNULL, stderr=log, + ) as server: + try: + for _ in range(100): + if server.poll() is not None: + raise RuntimeError(f"Render exited before readiness ({server.returncode})") + try: + status, _, body = request(port, "/ready") + except ConnectionRefusedError: + time.sleep(0.1) + continue + if status == 200 and json.loads(body)["signing"]["ministry"]["status"] == "ready": + break + time.sleep(0.1) + else: + raise RuntimeError("Render seal did not become ready") + + path = "/v1/seal/notice" + status, headers, body = request(port, path, token=sign_token(issuer_key, "render:seal")) + if expect_timestamp_failure: + assert status == 502 and headers.get_content_type() == "application/problem+json" + assert json.loads(body)["code"] == "render.timestamp-failed" + else: + assert status == 200, f"seal returned HTTP {status}" + assert headers.get_content_type() == "application/pdf" + assert headers["X-Registry-Seal-Id"] == "ministry" + assert headers["X-Registry-Seal-Level"] == ("B-B" if tsa_url is None else "B-T") + assert ("X-Registry-Timestamped-At" in headers) == (tsa_url is not None) + if posture == "development": + assert headers["Registry-Posture"] == "development" + assert headers["X-Registry-Seal-Test-Only"] == "true" + else: + assert "Registry-Posture" not in headers + assert "X-Registry-Seal-Test-Only" not in headers + refused, _, problem = request(port, path, token=sign_token(issuer_key, "render:render")) + assert refused == 403, f"wrong scope returned HTTP {refused}" + refusal = json.loads(problem) + assert refusal["code"] == "render.forbidden" + if posture == "development": + assert refusal["failedCheck"] == "scope" + else: + assert "failedCheck" not in refusal + finally: + if server.poll() is None: + server.terminate() + try: + server.wait(timeout=10) + except subprocess.TimeoutExpired: + server.kill() + server.wait() + raise + assert server.returncode == 0, f"Render shutdown exited {server.returncode}" + warnings = [ + event["fields"].get("error_code") or event["fields"].get("problem") + for event in map(json.loads, log_path.read_text().splitlines()) + if event["level"] in ("WARN", "ERROR") + ] + if expect_timestamp_failure: + expected_warnings.append("timestamp-failed") + assert warnings == expected_warnings, warnings + entries = [json.loads(line) for line in audit.read_text().splitlines()] + if expect_timestamp_failure: + assert not any(entry["record"].get("outcome") == "sealed" for entry in entries) + assert any(entry["record"].get("problem") == "timestamp-failed" for entry in entries) + return headers, body, None + sealed, = (entry for entry in entries if entry["record"].get("outcome") == "sealed") + matching = [entry["phase"] for entry in entries + if entry["correlation"] == sealed["correlation"]] + assert matching == ["request", "response"], matching + for name, header in ( + ("documentDigest", "X-Registry-Document-Digest"), + ("signedFileDigest", "X-Registry-Signed-File-Digest"), + ("certificateDigest", "X-Registry-Certificate-Digest"), + ): + assert sealed["record"][name] == headers[header], name + return headers, body, sealed["record"] + + +def verify_delivery(directory, headers, pdf, expected_certificate, *, tsa_root=None): + signed_digest = "sha256:" + hashlib.sha256(pdf).hexdigest() + assert headers["X-Registry-Signed-File-Digest"] == signed_digest + assert headers["X-Registry-Certificate-Digest"] == expected_certificate + signed = directory / "document.pdf" + signed.write_bytes(pdf) + with signed.open("rb") as stream: + signature, = PdfFileReader(stream).embedded_signatures + certificate_digest = "sha256:" + hashlib.sha256(signature.signer_cert.dump()).hexdigest() + assert certificate_digest == expected_certificate + + def verify(path, *trust_roots): + roots = [argument for root in trust_roots for argument in ("--trust-root", root)] + result = subprocess.run( + [sys.executable, HERE / "validate-seal.py", "--pdf", path, + *roots, "--document-digest", + headers["X-Registry-Document-Digest"]], + capture_output=True, timeout=30, + ) + return result.returncode, json.loads(result.stdout) + + root = directory / "root.pem" + roots = [root] + if tsa_root is not None: + roots.append(tsa_root) + code, report = verify(signed, root) + assert code == 1 and not report["ok"], report + assert any( + check["name"] == "signature-timestamp-valid" and not check["ok"] + for check in report["checks"] + ), report + code, report = verify(signed, *roots) + assert (code, report["ok"], report["level"]) == ( + 0, True, headers["X-Registry-Seal-Level"] + ), report + code, report = verify(signed, directory / "other-root.pem") + assert code == 1 and not report["ok"], report + assert any(check["name"] == "trusted" and not check["ok"] for check in report["checks"]) + + # Change a byte in the original revision without breaking PDF syntax. + tampered = directory / "tampered.pdf" + assert pdf.startswith(b"%PDF-") and pdf[7:8].isdigit() + replacement = b"6" if pdf[7:8] != b"6" else b"7" + tampered.write_bytes(pdf[:7] + replacement + pdf[8:]) + code, report = verify(tampered, *roots) + assert code == 1 and not report["ok"], report + assert any(check["name"] == "intact" and not check["ok"] for check in report["checks"]), report + assert "sha256:" + hashlib.sha256(tampered.read_bytes()).hexdigest() != signed_digest + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--render", type=Path, required=True, help="published Render executable") + parser.add_argument("--scratch", type=Path, required=True, help="parent for a private fixture") + args = parser.parse_args() + binary = args.render.resolve(strict=True) + os.umask(0o077) + with tempfile.TemporaryDirectory(prefix="render-delivery-", dir=args.scratch) as temporary: + directory = Path(temporary).resolve() + issuer_key, certificate = write_fixture(binary, directory) + headers, pdf, audit = delivery(binary, directory, issuer_key) + verify_delivery(directory, headers, pdf, certificate) + assert "timestampTokenDigest" not in audit + (directory / "timestamped").mkdir() + with timestamp_authority(directory) as (tsa_url, timestamp_digests): + # Each runtime needs its own audit file and a single fixture key set. + timestamped = directory / "timestamped" + issuer_key, certificate = write_fixture(binary, timestamped) + headers, pdf, audit = delivery(binary, timestamped, issuer_key, tsa_url=tsa_url) + verify_delivery(timestamped, headers, pdf, certificate, tsa_root=directory / "tsa-root.pem") + assert timestamp_digests == [audit["timestampTokenDigest"]] + print("B-B and B-T signed delivery passed: exact PDF, first revision, signer, audit, and refusals") + + +if __name__ == "__main__": + main() diff --git a/products/render/scripts/test_transit_delivery.py b/products/render/scripts/test_transit_delivery.py new file mode 100644 index 0000000000..68646662cc --- /dev/null +++ b/products/render/scripts/test_transit_delivery.py @@ -0,0 +1,256 @@ +#!/usr/bin/env python3 +# /// script +# requires-python = ">=3.11" +# dependencies = ["pyhanko==0.38.1"] +# /// +# SPDX-License-Identifier: Apache-2.0 +"""Qualify production-posture Render with disposable OpenBao and an HTTPS TSA.""" + +import argparse +import http.client +import ipaddress +import json +import os +import socket +import ssl +import subprocess +import tempfile +import time +from contextlib import contextmanager +from pathlib import Path + +from cryptography import x509 +from cryptography.hazmat.primitives import serialization +from cryptography.hazmat.primitives.asymmetric import ec +from cryptography.x509.oid import ExtendedKeyUsageOID + +from test_signed_delivery import ( + delivery, + issue_certificate, + timestamp_authority, + verify_delivery, + write_fixture, +) + +OPENBAO = "ghcr.io/openbao/openbao@sha256:09f1eaaee351c329d75a5a89654d6e1ad4792998650c3cbf0c3513a76d9d9b6e" +POLICY = """ +path "transit/keys/render-seal" { + capabilities = ["read"] +} + +path "transit/sign/render-seal/sha2-256" { + capabilities = ["update"] + required_parameters = ["input", "key_version", "marshaling_algorithm", "prehashed"] + allowed_parameters = { + "input" = [] + "key_version" = ["1"] + "marshaling_algorithm" = ["jws"] + "prehashed" = [true] + } +} +""" + + +@contextmanager +def bao_process(config, command): + directory = config.parent + identity = f"{os.getuid()}:{os.getgid()}" + container_id = subprocess.check_output( + ["docker", "run", "--pull", "never", "--rm", "--detach", + "--network", "host", "--user", identity, + "--mount", f"type=bind,source={directory},target={directory}", + "--entrypoint", "bao", OPENBAO, command, "-config", config], + text=True, timeout=30, + ).strip() + try: + yield + finally: + subprocess.run(["docker", "stop", "--time", "3", container_id], + check=True, stdout=subprocess.DEVNULL, timeout=15) + + +def bao_request(connection, method, path, *, token=None, data=None): + headers = {"X-Vault-Request": "true", "Content-Type": "application/json"} + if token is not None: + headers["X-Vault-Token"] = token + try: + connection.request(method, "/v1/" + path, json.dumps(data) if data is not None else None, + headers) + response = connection.getresponse() + payload = response.read() + return response.status, json.loads(payload) if payload else None + finally: + connection.close() + + +def wait_for(probe, expected): + for _ in range(50): + try: + status, result = probe() + except (ConnectionRefusedError, FileNotFoundError): + time.sleep(0.1) + continue + if status == expected: + return result + time.sleep(0.1) + raise RuntimeError(f"OpenBao did not return HTTP {expected} for the readiness probe") + + +class UnixHttpConnection(http.client.HTTPConnection): + def __init__(self, path): + super().__init__("localhost", timeout=3) + self.path = path + + def connect(self): + self.sock = socket.socket(socket.AF_UNIX) + self.sock.settimeout(self.timeout) + self.sock.connect(str(self.path)) + + +@contextmanager +def transit_proxy(directory): + with socket.socket() as reservation: + reservation.bind(("127.0.0.1", 0)) + port = reservation.getsockname()[1] + server = directory / "bao.hcl" + server.write_text(f""" +disable_mlock = true +api_addr = "http://127.0.0.1:{port}" +storage "inmem" {{}} +listener "tcp" {{ + address = "127.0.0.1:{port}" + tls_disable = true +}} +""") + root_token = None + + def request(method, path, expected, data=None): + status, response = bao_request( + http.client.HTTPConnection("127.0.0.1", port, timeout=3), + method, path, token=root_token, data=data, + ) + assert status == expected, f"OpenBao {method} {path}: HTTP {status}, expected {expected}" + return response + + with bao_process(server, "server"): + def health(): + return bao_request(http.client.HTTPConnection("127.0.0.1", port, timeout=3), + "GET", "sys/health") + + wait_for(health, 501) + init = request("PUT", "sys/init", 200, {"secret_shares": 1, "secret_threshold": 1}) + root_token = init["root_token"] + request("PUT", "sys/unseal", 200, {"key": init["keys_base64"][0]}) + request("POST", "sys/mounts/transit", 204, {"type": "transit"}) + request("POST", "transit/keys/render-seal", 200, { + "type": "ecdsa-p256", "derived": False, "exportable": False, + "allow_plaintext_backup": False, + }) + request("PUT", "sys/policies/acl/render-seal", 204, {"policy": POLICY}) + request("POST", "sys/auth/approle", 204, {"type": "approle"}) + request("POST", "auth/approle/role/render-seal", 204, { + "token_policies": ["render-seal"], "token_ttl": "10m", "token_max_ttl": "10m", + "secret_id_ttl": "10m", + }) + role = request("GET", "auth/approle/role/render-seal/role-id", 200) + secret = request("POST", "auth/approle/role/render-seal/secret-id", 200) + (directory / "role-id").write_text(role["data"]["role_id"]) + (directory / "secret-id").write_text(secret["data"]["secret_id"]) + unix_socket = directory / "bao.sock" + agent = directory / "agent.hcl" + agent.write_text(f""" +vault {{ + address = "http://127.0.0.1:{port}" + retry {{ num_retries = -1 }} +}} +auto_auth {{ + method "approle" {{ + config = {{ + role_id_file_path = {json.dumps(str(directory / 'role-id'))} + secret_id_file_path = {json.dumps(str(directory / 'secret-id'))} + }} + }} +}} +api_proxy {{ use_auto_auth_token = "force" }} +listener "unix" {{ + address = {json.dumps(str(unix_socket))} + tls_disable = true + socket_mode = "0660" + socket_user = "{os.getuid()}" + socket_group = "{os.getgid()}" + require_request_header = true +}} +""") + with bao_process(agent, "agent"): + metadata = wait_for(lambda: bao_request( + UnixHttpConnection(unix_socket), "GET", "transit/keys/render-seal" + ), 200)["data"] + assert metadata["type"] == "ecdsa-p256" and metadata["latest_version"] == 1 + for setting in ("derived", "exportable", "allow_plaintext_backup"): + assert metadata[setting] is False, setting + owner = unix_socket.stat() + mode = owner.st_mode & 0o777 + assert mode == 0o660, f"OpenBao Agent socket has mode {mode:#o}" + assert (owner.st_uid, owner.st_gid) == (os.getuid(), os.getgid()) + forced, _ = bao_request(UnixHttpConnection(unix_socket), "GET", "sys/mounts", + token=root_token) + assert forced == 403, f"proxy forwarded the caller token, HTTP {forced}" + yield unix_socket + + +def tsa_tls(directory): + root_key = ec.generate_private_key(ec.SECP256R1()) + root = issue_certificate(root_key.public_key(), "Qualification TLS root", None, root_key) + key = ec.generate_private_key(ec.SECP256R1()) + leaf = issue_certificate( + key.public_key(), "Qualification RFC 3161 server", root, root_key, + purpose=ExtendedKeyUsageOID.SERVER_AUTH, + names=[x509.IPAddress(ipaddress.IPv4Address("127.0.0.1"))], + ) + chain = directory / "tls-chain.pem" + chain.write_bytes(leaf.public_bytes(serialization.Encoding.PEM)) + private = directory / "tls-key.pem" + private.write_bytes(key.private_bytes( + serialization.Encoding.PEM, serialization.PrivateFormat.PKCS8, serialization.NoEncryption() + )) + context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) + context.load_cert_chain(chain, private) + return context, root.public_bytes(serialization.Encoding.PEM) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--render", type=Path, required=True, help="published Render executable") + parser.add_argument("--scratch", type=Path, required=True, help="parent for a private fixture") + args = parser.parse_args() + binary = args.render.resolve(strict=True) + os.umask(0o077) + with tempfile.TemporaryDirectory(prefix="transit-", dir=args.scratch) as temporary: + directory = Path(temporary).resolve() + tls, tls_root = tsa_tls(directory) + with transit_proxy(directory) as proxy, timestamp_authority(directory, tls=tls) as tsa: + url, digests = tsa + untrusted = directory / "untrusted" + untrusted.mkdir() + issuer, _ = write_fixture(binary, untrusted, transit_socket=proxy) + delivery(binary, untrusted, issuer, tsa_url=url, transit_socket=proxy, + expect_timestamp_failure=True) + assert digests == [], "a timestamp query crossed the untrusted TLS connection" + + trusted = directory / "trusted" + trusted.mkdir() + issuer, certificate = write_fixture(binary, trusted, transit_socket=proxy) + (trusted / "secrets/tsa-tls-root.pem").write_bytes(tls_root) + headers, pdf, audit = delivery( + binary, trusted, issuer, tsa_url=url, transit_socket=proxy, tsa_ca=True + ) + verify_delivery(trusted, headers, pdf, certificate, tsa_root=directory / "tsa-root.pem") + assert digests == [audit["timestampTokenDigest"]] + assert { + path.name for path in (trusted / "secrets").iterdir() + } == {"jwks.json", "tsa-tls-root.pem"} + print("Production-posture Render passed with OpenBao Transit and an independently trusted HTTPS TSA") + + +if __name__ == "__main__": + main() From 2e2fe762c2124cb700e338e551cb4dfc4f49ab7c Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 12/55] feat(session): generate a checked standalone Envoy configuration Folds these reviewed commits: - feat(session): generate a checked standalone Envoy configuration - fix(casework): align the standalone starter and development issuer - feat(dev): attach BReg hooks without replacing the managed issuer - refactor(messaging): select HTTP provider transports centrally Signed-off-by: Jeremi Joslin --- crates/registry-caseworkctl/src/project.rs | 31 ++- crates/registry-cli-docs/catalog.json | 121 ++++++++++- .../src/http_provider/settings.rs | 49 +++-- crates/registry-rstack-dev/src/plan.rs | 31 ++- crates/registry-rstack/tests/dev_run.rs | 158 ++++++++++++++ crates/registry-session/Cargo.toml | 2 +- crates/registry-session/README.md | 7 + crates/registry-session/src/gateway.rs | 2 +- crates/registry-session/src/gateway/verify.rs | 193 +++++++++++++++++- crates/registry-session/src/lib.rs | 48 ++++- crates/registry-session/src/main.rs | 11 + crates/registry-session/tests/binary.rs | 155 ++++++++++++++ .../docs/configure/casework-directory.mdx | 2 +- .../run-a-project-with-rstack-dev.mdx | 16 +- .../src/content/docs/configure/session.mdx | 29 ++- .../content/docs/tutorials/first-casework.mdx | 48 +---- 16 files changed, 824 insertions(+), 79 deletions(-) diff --git a/crates/registry-caseworkctl/src/project.rs b/crates/registry-caseworkctl/src/project.rs index d6c7ab1fe8..8bbe66a7f2 100644 --- a/crates/registry-caseworkctl/src/project.rs +++ b/crates/registry-caseworkctl/src/project.rs @@ -145,7 +145,7 @@ reviewPolicies: trustedProducers: requester: profile: requester - issuer: http://127.0.0.1:8093 + issuer: https://identity.casework.example.test subject: b75315b2-5854-70f3-8867-511dd771a6da sourceNamespaces: [standalone] reviewPolicies: [decision] @@ -315,8 +315,7 @@ fn development_plan(project: &CaseworkProject) -> Result<(String, String, String .iter() .find(|profile| profile.acts_as == CaseworkActsAs::Staff) .context("the template needs a staff profile for the development journey")?; - // A logical HTTPS issuer for the run. The starter's producer pins may - // identify a different teaching issuer and stay in the authored policy. + // The logical HTTPS issuer matches the standalone requester binding. let issuer = "https://identity.casework.example.test"; let mut people = BTreeMap::new(); let mut roles = BTreeMap::new(); @@ -1240,6 +1239,32 @@ pub(super) fn doctor(path: &Path, declared: DeclaredPosture) -> Result { mod display_integrity_tests { use super::*; + #[test] + fn standalone_starter_pins_its_generated_development_requester() { + let root = crate::canonical_tempdir(); + let project_path = root.path().join("project"); + init(&project_path, "standalone-decision").unwrap(); + + let project = load_and_check_policy(&project_path).unwrap(); + let producer = project + .trusted_producers + .iter() + .find(|producer| producer.profile.as_str() == "requester") + .expect("the standalone requester has a producer binding"); + let plan_path = project_path.join("dev.yaml"); + let plan = registry_platform_yaml::Reader::new(plan_path.display().to_string()) + .scan(&fs::read(&plan_path).unwrap()) + .unwrap() + .unwrap() + .to_json_value(); + + assert_eq!(plan["issuer"].as_str(), Some(producer.issuer.as_str())); + assert_eq!( + plan["people"]["requester"]["subject"].as_str(), + Some(producer.subject.as_str()) + ); + } + fn assert_typed_authoring_refusal(error: anyhow::Error) { let (exit, diagnostic) = crate::classify_failure(crate::CommandKind::Authoring, &error); assert_eq!(exit, crate::DOMAIN_REFUSAL_EXIT); diff --git a/crates/registry-cli-docs/catalog.json b/crates/registry-cli-docs/catalog.json index abb867c811..1db71b3d5f 100644 --- a/crates/registry-cli-docs/catalog.json +++ b/crates/registry-cli-docs/catalog.json @@ -27519,9 +27519,9 @@ { "name": "envoy", "invocation": "registry-session gateway envoy", - "about": "Write or compare the Envoy configuration fragments", + "about": "Generate or verify the Envoy configuration", "long_about": null, - "usage": "registry-session gateway envoy [OPTIONS] <--out |--check |--verify-assembled >", + "usage": "registry-session gateway envoy [OPTIONS] <--out |--check |--verify-assembled |--standalone-out >", "arguments": [], "options": [ { @@ -27551,6 +27551,33 @@ "possible_values": [], "environment": null }, + { + "display": "--standalone-out ", + "description": "Write one complete Envoy JSON configuration using loopback listeners and upstreams", + "always_required": false, + "repeatable": false, + "default_values": [], + "possible_values": [], + "environment": null + }, + { + "display": "--listen
", + "description": "Numeric loopback socket address for Envoy", + "always_required": false, + "repeatable": false, + "default_values": [], + "possible_values": [], + "environment": null + }, + { + "display": "--upstream ", + "description": "Numeric loopback socket for one configured module or page cluster. Repeat for each cluster", + "always_required": false, + "repeatable": true, + "default_values": [], + "possible_values": [], + "environment": null + }, { "display": "--posture ", "description": "Declared posture: development or production. Unset means production.", @@ -27577,7 +27604,31 @@ "arguments": [ "--out ", "--check ", - "--verify-assembled " + "--verify-assembled ", + "--standalone-out " + ] + }, + { + "kind": "requires-all", + "when": "--standalone-out ", + "arguments": [ + "--listen
" + ] + }, + { + "kind": "requires-all", + "when": "--upstream ", + "arguments": [ + "--listen
", + "--standalone-out " + ] + }, + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--check ", + "--listen
" ] }, { @@ -27593,6 +27644,38 @@ "when": null, "arguments": [ "--check ", + "--standalone-out " + ] + }, + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--check ", + "--upstream " + ] + }, + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--check ", + "--verify-assembled " + ] + }, + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--listen
", + "--out " + ] + }, + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--listen
", "--verify-assembled " ] }, @@ -27601,6 +27684,38 @@ "when": null, "arguments": [ "--out ", + "--standalone-out " + ] + }, + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--out ", + "--upstream " + ] + }, + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--out ", + "--verify-assembled " + ] + }, + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--standalone-out ", + "--verify-assembled " + ] + }, + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--upstream ", "--verify-assembled " ] } diff --git a/crates/registry-messaging/src/http_provider/settings.rs b/crates/registry-messaging/src/http_provider/settings.rs index 6a5ddeb319..1b8acd421b 100644 --- a/crates/registry-messaging/src/http_provider/settings.rs +++ b/crates/registry-messaging/src/http_provider/settings.rs @@ -29,6 +29,9 @@ use registry_platform_httputil::destination::{ is_script_visible_response_header_name, is_script_writable_request_header_name, MAX_DESTINATION_OPERATION_TIMEOUT, MAX_DESTINATION_PRIVATE_CIDRS, }; +use registry_platform_httputil::select::{ + select_destination, DestinationSelectionError, TransportClass, +}; use registry_platform_yaml::{ ApiVersion, Decoded, EnvelopeRule, Expect, FormatSpec, Invalid, Reader, RemovedKey, Report, UniqueList, @@ -1287,23 +1290,16 @@ fn split_base_url( "must not carry credentials, a query, or a fragment", )); } - let development = match parsed.scheme() { - "https" => false, - "http" => { - let loopback = parsed - .host_str() - .and_then(registry_platform_httputil::loopback::loopback_host) - .is_some(); - if !loopback { - return Err(invalid( - field, - "http is allowed only to a loopback host; use https", - )); + let selected = select_destination(&parsed, None, &[]).map_err(|error| { + let message = match error { + DestinationSelectionError::PrivateNetworkNotDeclared => { + "http is allowed only to a loopback host; use https" } - true - } - _ => return Err(invalid(field, "must use https, or http to a loopback host")), - }; + _ => "must use https, or http to a loopback host", + }; + invalid(field, message) + })?; + let development = selected.transport() == TransportClass::LoopbackPlaintext; // The URL parser resolves dot segments and their escapes, so the // configured text is checked too: the path sent is the path written. let path = parsed.path().to_owned(); @@ -1414,6 +1410,27 @@ fn token_form_body( mod tests { use super::*; + #[test] + fn provider_and_token_paths_keep_the_configured_https_origin() { + let expected_origin = "https://provider.example.test:8443/".to_owned(); + let (origin, path, development) = + split_base_url("baseUrl", "https://provider.example.test:8443/v1/", true).unwrap(); + assert_eq!( + (origin, path, development), + (expected_origin.clone(), "/v1/".to_owned(), false) + ); + let (origin, path, development) = split_base_url( + "authentication.tokenEndpoint", + "https://provider.example.test:8443/issuer/token", + false, + ) + .unwrap(); + assert_eq!( + (origin, path, development), + (expected_origin, "/issuer/token".to_owned(), false) + ); + } + #[test] fn plain_http_is_allowed_only_to_a_loopback_host() { for base_url in [ diff --git a/crates/registry-rstack-dev/src/plan.rs b/crates/registry-rstack-dev/src/plan.rs index 951eee14ee..b45317b899 100644 --- a/crates/registry-rstack-dev/src/plan.rs +++ b/crates/registry-rstack-dev/src/plan.rs @@ -1334,12 +1334,16 @@ impl Plan { "Set issuer to the exact numeric loopback HTTP origin for an external key endpoint, or use `run` or a fixed HTTPS issuer for runner-managed keys.", )?; if let Some(bindings) = &self.external_breg { + let hook_only = !bindings.hooks.is_empty() + && bindings.review_authority.is_none() + && bindings.task_grant.is_none() + && bindings.schema_test_headers.is_empty(); require( - self.jwks_uri().is_some() + (self.jwks_uri().is_some() || hook_only) && self.products.iter().any(|p| p.product == Product::Breg), "/externalBreg", - "External BReg connections require BReg and an external issuer.", - "Add BReg and externalJwksUri to this plan, or remove externalBreg.", + "External BReg connections require BReg. A binding other than a hook also requires an external issuer.", + "Add BReg to the plan, and add externalJwksUri for any bindings other than hooks.", )?; bindings.validate(root)?; } @@ -2325,6 +2329,27 @@ mod tests { } } + #[test] + fn a_fixed_external_hook_may_use_the_managed_development_issuer() { + let (root, mut plan) = plan(json!({"id": "read", "product": "breg", + "as": "operator", "method": "GET", "path": "/v1/records", "expect": {"status": 200}})); + fs::create_dir(root.path().join("fixture")).unwrap(); + crate::write_private(&root.path().join("fixture/key"), b"synthetic fixture").unwrap(); + let mut external = json!({"hooks": {"events": { + "origin": "http://127.0.0.1:41000", + "path": "/events", + "keyRef": "secret:file/key", + }}}); + plan.external_breg = Some(serde_json::from_value(external.clone()).unwrap()); + plan.validate(root.path()).expect("hook-only attachment"); + + external["schemaTestHeaders"] = json!({"operator": "secret:file/key"}); + plan.external_breg = Some(serde_json::from_value(external).unwrap()); + let error = plan.validate(root.path()).unwrap_err(); + assert_eq!(error.field, "/externalBreg"); + assert!(error.reason.contains("external issuer")); + } + #[test] fn external_breg_peers_require_numeric_loopback_http() { for pointer in [ diff --git a/crates/registry-rstack/tests/dev_run.rs b/crates/registry-rstack/tests/dev_run.rs index 82fd5bcb49..5635aba592 100644 --- a/crates/registry-rstack/tests/dev_run.rs +++ b/crates/registry-rstack/tests/dev_run.rs @@ -3529,6 +3529,164 @@ fn breg_alone_runs_end_to_end() { ); } +#[test] +#[cfg(target_os = "linux")] +#[ignore = "requires Docker, its pinned receiver image, and built BReg binaries"] +fn breg_attaches_to_an_independent_signed_hook_receiver() { + let scratch = tempfile::tempdir().unwrap(); + let state = scratch.path().join("state"); + let project = scratch.path().join("project"); + copy_tree(&example_project("breg/examples/minimal"), &project); + let fixture = project.join("fixture"); + fs::create_dir(&fixture).unwrap(); + let key = fixture.join("event-hmac"); + use std::io::Write; + fs::OpenOptions::new() + .write(true) + .create_new(true) + .mode(0o600) + .open(&key) + .unwrap() + .write_all(b"synthetic attach-test signing material") + .unwrap(); + let listener = std::net::TcpListener::bind("127.0.0.1:0").unwrap(); + let port = listener.local_addr().unwrap().port(); + let plan = project.join("dev.yaml"); + let mut text = fs::read_to_string(&plan).unwrap(); + text.push_str(&format!( + "\nexternalBreg:\n hooks:\n contact-sink: {{origin: \"http://127.0.0.1:{port}\", path: /events, keyRef: \"secret:file/event-hmac\"}}\n" + )); + fs::write(plan, text).unwrap(); + let registry = project.join("registry.yaml"); + let text = fs::read_to_string(®istry).unwrap().replacen( + "\nactions:\n", + "\n hooks:\n - id: contact-created\n phase: after\n trigger: created\n projection: [name, jurisdiction]\n handler: {type: url, destinationId: contact-sink}\n\nactions:\n", + 1, + ); + fs::write(registry, text).unwrap(); + let command = |arguments: &[&str]| { + rstack_dev(&state, true) + .env("PATH", std::env::var_os("PATH").unwrap_or_default()) + .env("RSTACK_BREG_BIN", host("breg")) + .env_remove("REGISTRY_STACK_POSTURE") + .args(arguments) + .output() + .unwrap() + }; + let checked = command(&["check", utf8(&project)]); + assert!( + checked.status.success(), + "check refused the hook attachment: {}", + String::from_utf8_lossy(&checked.stdout) + ); + + let receiver = example_project("platform/journeys/projects/hook-receiver.py"); + let receiver_mount = format!( + "type=bind,source={},target=/receiver.py,readonly", + receiver.display() + ); + let fixture_mount = format!("type=bind,source={},target=/fixture", fixture.display()); + let name = format!( + "v051-hook-{}", + scratch.path().file_name().unwrap().to_string_lossy() + ); + let docker = |args: &[&str]| Command::new("docker").args(args).output().unwrap(); + let image = "mcr.microsoft.com/playwright:v1.60.0-noble@sha256:9bd26ad900bb5e0f4dee75839e957a89ae89c2b7ab1e76050e559790e946b948"; + drop(listener); + let started = docker(&[ + "run", + "--detach", + "--rm", + "--pull=never", + "--network=host", + "--name", + &name, + "--mount", + &receiver_mount, + "--mount", + &fixture_mount, + "--entrypoint", + "python3", + image, + "/receiver.py", + &port.to_string(), + "/events", + "contact-created", + "/fixture/event-hmac", + "/fixture/event.json", + ]); + assert!( + started.status.success(), + "{}", + String::from_utf8_lossy(&started.stderr) + ); + let origin = format!("http://127.0.0.1:{port}"); + let ready = Command::new("curl") + .args([ + "--fail", + "--silent", + "--noproxy", + "*", + "--retry", + "5", + "--retry-connrefused", + "--max-time", + "2", + ]) + .arg(format!("{origin}/ready")) + .output() + .unwrap(); + let run = ready + .status + .success() + .then(|| command(&["start", utf8(&project), "--ttl", "1m"])); + let receipt_path = fixture.join("event.json"); + let receipt = run + .as_ref() + .filter(|output| output.status.success()) + .and_then(|_| { + let deadline = Instant::now() + Duration::from_secs(15); + while Instant::now() < deadline { + if let Some(event) = fs::read(&receipt_path) + .ok() + .and_then(|bytes| serde_json::from_slice::(&bytes).ok()) + .filter(|event| event["data"]["values"]["name"] == "Example contact") + { + return Some(event); + } + thread::sleep(Duration::from_millis(100)); + } + None + }); + let report = run + .as_ref() + .and_then(|output| serde_json::from_slice::(&output.stdout).ok()); + let stopped = report + .as_ref() + .and_then(|report| report["run_id"].as_str()) + .map(|id| command(&["stop", id, "--clean"])); + let receiver_stopped = docker(&["stop", &name]); + + assert!(receiver_stopped.status.success(), "receiver did not stop"); + assert!( + ready.status.success(), + "the sibling receiver did not become ready" + ); + let started = run.expect("start was attempted"); + assert!( + started.status.success(), + "start refused the hook attachment: {}", + String::from_utf8_lossy(&started.stdout) + ); + let run = report.expect("valid start report"); + assert!(run["bregHookSink"].is_null()); + assert_eq!(run["scenarios"][0]["result"], "passed"); + assert!(stopped.expect("BReg stopped and cleaned").status.success()); + let event = receipt.expect("signed event received"); + assert_eq!(event["type"], "contact-created"); + assert_eq!(event["data"]["values"]["name"], "Example contact"); +} + #[test] #[ignore = "requires RSTACK_DEV_DATABASE_URL, RSTACK_DEV_DATABASE_CA and built caseworkctl and casework binaries"] fn casework_alone_runs_end_to_end() { diff --git a/crates/registry-session/Cargo.toml b/crates/registry-session/Cargo.toml index dc1419efbd..cbc2295a76 100644 --- a/crates/registry-session/Cargo.toml +++ b/crates/registry-session/Cargo.toml @@ -43,6 +43,7 @@ schemars = { workspace = true, optional = true } serde.workspace = true serde_json.workspace = true sha2.workspace = true +tempfile.workspace = true thiserror.workspace = true tokio.workspace = true tracing.workspace = true @@ -54,7 +55,6 @@ zeroize.workspace = true jsonschema.workspace = true registry-platform-testing.workspace = true reqwest.workspace = true -tempfile.workspace = true tower = { workspace = true, features = ["util"] } [[example]] diff --git a/crates/registry-session/README.md b/crates/registry-session/README.md index 63f38ece6d..ae746385a3 100644 --- a/crates/registry-session/README.md +++ b/crates/registry-session/README.md @@ -55,6 +55,13 @@ them byte for byte. `--verify-assembled /absolute/path/envoy.yaml` checks the assembled static gateway configuration against the runtime file. Regenerate, splice and verify after every runtime change. +For a gateway and upstreams on one host, use `gateway envoy --standalone-out +/absolute/path/envoy.json --listen 127.0.0.1:8080 --upstream +registry=127.0.0.1:8100`. Set `gateway.service.host` to a numeric loopback +address. Supply one `--upstream` for every cluster named by a module or page, +then run `envoy --mode validate --config-path /absolute/path/envoy.json`. +Place an HTTPS-terminating reverse proxy on the same host for a public origin. + The session cookie is `__Host-registry-session` and holds an opaque 256-bit identifier. The temporary sign-in cookie is `__Host-registry-signin`. Both cookies carry `Secure`, `HttpOnly`, `SameSite=Lax` and `Path=/` in both diff --git a/crates/registry-session/src/gateway.rs b/crates/registry-session/src/gateway.rs index f56fa53fc1..f8278d29de 100644 --- a/crates/registry-session/src/gateway.rs +++ b/crates/registry-session/src/gateway.rs @@ -813,7 +813,7 @@ fn array<'a>(value: &'a Value, key: &str) -> &'a [Value] { } mod verify; -pub use verify::verify_assembled; +pub use verify::{verify_assembled, write_standalone}; #[cfg(test)] mod tests { diff --git a/crates/registry-session/src/gateway/verify.rs b/crates/registry-session/src/gateway/verify.rs index 096e7de25e..f40a953c46 100644 --- a/crates/registry-session/src/gateway/verify.rs +++ b/crates/registry-session/src/gateway/verify.rs @@ -10,10 +10,16 @@ //! refused with a finding that names the member and says why. It does not try //! to model the rest of Envoy. -use std::{fs, io::Read, path::Path}; +use std::{ + collections::{BTreeMap, BTreeSet}, + fs, + io::{Read, Write}, + net::{IpAddr, SocketAddr}, + path::Path, +}; use registry_platform_yaml::{Reader, Refusal, ScalarHook, ScalarSite, ScalarStyle}; -use serde_json::Value; +use serde_json::{json, Value}; use super::*; use crate::wire::SOURCE_PROFILE_HEADER; @@ -106,6 +112,8 @@ struct Expected { routes: Vec, /// The generated local reply mappers, which come first and in order. mappers: Vec, + /// The two Session clusters, in generation order. + clusters: Vec, /// The host's own filters the generated routes switch off. host_filters: Vec, /// The host filters some generated route keeps on. @@ -171,7 +179,7 @@ impl Expected { ); } } - fragment("clusters.yaml")?; + let clusters = items(fragment("clusters.yaml")?); Ok(Self { authority: config .gateway_authority() @@ -179,6 +187,7 @@ impl Expected { filters: items(fragment("http-filters.yaml")?), routes: items(fragment("routes.yaml")?), mappers, + clusters, host_filters: config .gateway .iter() @@ -196,6 +205,178 @@ impl Expected { } } +/// Write a static Envoy configuration for a loopback deployment. The same +/// checked routes, filters and reply mappers are used for fragment integration. +pub fn write_standalone<'a>( + runtime_config: &Path, + output: &Path, + listen: SocketAddr, + upstreams: impl IntoIterator, + posture: DeclaredPosture, +) -> Result { + let loaded = load_for_gateway(runtime_config, posture)?; + let mut expected = Expected::new(&loaded.config)?; + let gateway = loaded + .config + .gateway + .as_ref() + .ok_or(GatewayError::NoGatewayBlock)?; + if !expected.host_filters.is_empty() { + return Err(standalone_refusal( + "Remove gateway.hostFilters or integrate the generated fragments.", + )); + } + if !loopback_socket(listen) { + return Err(standalone_refusal( + "Set --listen to a numeric loopback address and nonzero port.", + )); + } + if !gateway + .service + .host + .as_str() + .parse::() + .is_ok_and(|ip| ip.is_loopback()) + { + return Err(standalone_refusal( + "Set gateway.service.host to a numeric loopback address.", + )); + } + let required = expected + .protected + .iter() + .map(String::as_str) + .filter(|name| !matches!(*name, PUBLIC_CLUSTER | CHECK_CLUSTER)) + .collect::>(); + let addresses = standalone_upstreams(&required, upstreams)?; + let mut definitions = String::new(); + for (name, address) in addresses { + cluster( + &mut definitions, + name, + &address.ip().to_string(), + u32::from(address.port()), + ); + } + if !definitions.is_empty() { + expected.clusters.extend( + parse_fragment(&GeneratedFile { + name: "standalone-clusters", + content: definitions, + })? + .as_array() + .cloned() + .ok_or_else(|| standalone_refusal("Could not assemble the upstream clusters."))?, + ); + } + + let strip_port = !expected + .authority + .rsplit_once(':') + .is_some_and(|(_, port)| port.parse::().is_ok()); + let mut filters = expected.filters.clone(); + filters.push(json!({ + "name": "envoy.filters.http.router", + "typed_config": {"@type": ROUTER_TYPE}, + })); + let document = json!({ + "static_resources": { + "listeners": [{ + "name": "registry-session", + "address": {"socket_address": { + "address": listen.ip().to_string(), "port_value": listen.port(), + }}, + "filter_chains": [{"filters": [{ + "name": "envoy.filters.network.http_connection_manager", + "typed_config": { + "@type": MANAGER_TYPE, + "stat_prefix": "registry_session", + "strip_trailing_host_dot": true, + "strip_matching_host_port": strip_port, + "route_config": { + "name": "registry-session", + "virtual_hosts": [{ + "name": "registry-session", + "domains": [&expected.authority], + "routes": &expected.routes, + }], + }, + "local_reply_config": {"mappers": &expected.mappers}, + "http_filters": filters, + }, + }]}], + }], + "clusters": &expected.clusters, + }, + }); + let bytes = serde_json::to_vec_pretty(&document) + .map_err(|_| standalone_refusal("Could not serialize the configuration."))?; + let document = scan_assembly(output, &bytes)?; + verify_document(&expected, &document)?; + + let parent = output + .parent() + .filter(|path| !path.as_os_str().is_empty()) + .unwrap_or_else(|| Path::new(".")); + let mut staged = + tempfile::NamedTempFile::new_in(parent).map_err(|error| io_error(output, &error))?; + staged + .write_all(&bytes) + .and_then(|()| staged.write_all(b"\n")) + .map_err(|error| io_error(output, &error))?; + staged + .persist(output) + .map_err(|error| io_error(output, &error.error))?; + Ok(loaded.posture) +} + +fn loopback_socket(address: SocketAddr) -> bool { + address.ip().is_loopback() && address.port() != 0 +} + +fn standalone_refusal(finding: impl Into) -> GatewayError { + GatewayError::Refused(vec![finding.into()]) +} + +fn standalone_upstreams<'a>( + required: &BTreeSet<&str>, + upstreams: impl IntoIterator, +) -> Result, GatewayError> { + let mut bindings = BTreeMap::new(); + for binding in upstreams { + let (name, socket) = binding + .split_once('=') + .ok_or_else(|| standalone_refusal("Pass each --upstream as CLUSTER=ADDRESS."))?; + if !required.contains(name) { + return Err(standalone_refusal( + "Name a configured module or page cluster in --upstream.", + )); + } + let address = socket + .parse() + .ok() + .filter(|address| loopback_socket(*address)) + .ok_or_else(|| { + standalone_refusal(format!( + "Set --upstream for {name} to a numeric loopback address and nonzero port." + )) + })?; + if bindings.insert(name, address).is_some() { + return Err(standalone_refusal(format!( + "Cluster {name} is supplied more than once." + ))); + } + } + for &name in required { + if !bindings.contains_key(name) { + return Err(standalone_refusal(format!( + "Pass --upstream for the required cluster {name}." + ))); + } + } + Ok(bindings) +} + /// Check an assembled Envoy configuration offline against what the runtime /// file generates now. /// @@ -238,6 +419,10 @@ fn read_assembly(assembled: &Path) -> Result { file.take(MAXIMUM_ASSEMBLED_BYTES + 1) .read_to_end(&mut bytes) .map_err(|error| io_error(assembled, &error))?; + scan_assembly(assembled, &bytes) +} + +fn scan_assembly(assembled: &Path, bytes: &[u8]) -> Result { if bytes.len() as u64 > MAXIMUM_ASSEMBLED_BYTES { return Err(GatewayError::Assembled(vec![ "the assembled configuration is larger than 16 MiB".to_owned(), @@ -246,7 +431,7 @@ fn read_assembly(assembled: &Path) -> Result { let mut reading = EnvoyReading; let document = Reader::new(assembled.display().to_string()) .with_hook(&mut reading) - .scan(&bytes) + .scan(bytes) .map_err(GatewayError::AssembledSyntax)? .ok_or_else(|| { GatewayError::Assembled(vec!["the assembled configuration is empty".to_owned()]) diff --git a/crates/registry-session/src/lib.rs b/crates/registry-session/src/lib.rs index 182ae27c8e..59cf14d7d3 100644 --- a/crates/registry-session/src/lib.rs +++ b/crates/registry-session/src/lib.rs @@ -25,7 +25,7 @@ mod signin; pub mod store; pub mod wire; -use std::path::PathBuf; +use std::{net::SocketAddr, path::PathBuf}; use clap::{value_parser, Arg, ArgAction, ArgGroup, Command}; use registry_platform_posture::POSTURE_FLAG; @@ -106,10 +106,10 @@ pub fn command() -> Command { .subcommand_required(true) .subcommand( Command::new("envoy") - .about("Write or compare the Envoy configuration fragments") + .about("Generate or verify the Envoy configuration") .group( ArgGroup::new("mode") - .args(["out", "check", "verify-assembled"]) + .args(["out", "check", "verify-assembled", "standalone-out"]) .required(true) .multiple(false), ) @@ -136,6 +136,32 @@ pub fn command() -> Command { runtime file generates", ) .value_parser(value_parser!(PathBuf)), + ) + .arg( + Arg::new("standalone-out") + .long("standalone-out") + .value_name("FILE") + .help("Write one complete Envoy JSON configuration using loopback listeners and upstreams") + .requires("listen") + .value_parser(value_parser!(PathBuf)), + ) + .arg( + Arg::new("listen") + .long("listen") + .value_name("ADDRESS") + .help("Numeric loopback socket address for Envoy") + .requires("standalone-out") + .conflicts_with_all(["out", "check", "verify-assembled"]) + .value_parser(value_parser!(SocketAddr)), + ) + .arg( + Arg::new("upstream") + .long("upstream") + .value_name("CLUSTER=ADDRESS") + .help("Numeric loopback socket for one configured module or page cluster. Repeat for each cluster") + .requires("standalone-out") + .conflicts_with_all(["out", "check", "verify-assembled"]) + .action(ArgAction::Append), ), ), ) @@ -157,12 +183,26 @@ mod tests { } #[test] - fn a_gateway_mode_is_exactly_one_of_out_check_and_verify_assembled() { + fn a_gateway_mode_is_exactly_one_of_the_four_outputs_or_checks() { let envoy = ["--runtime-config", "/r.yaml", "gateway", "envoy"]; let with = |extra: &[&str]| parses(&[&envoy[..], extra].concat()); assert!(with(&["--out", "/d"])); assert!(with(&["--check", "/d"])); assert!(with(&["--verify-assembled", "/e.yaml"])); + assert!(with(&[ + "--standalone-out", + "/e.json", + "--listen", + "127.0.0.1:8080" + ])); + assert!(!with(&["--standalone-out", "/e.json"])); + assert!(!with(&["--out", "/d", "--listen", "127.0.0.1:8080"])); + assert!(!with(&[ + "--check", + "/d", + "--upstream", + "api=127.0.0.1:8100" + ])); assert!(!with(&[])); assert!(!with(&["--out", "/d", "--check", "/d"])); assert!(!with(&["--out", "/d", "--verify-assembled", "/e.yaml"])); diff --git a/crates/registry-session/src/main.rs b/crates/registry-session/src/main.rs index eea80bdfe9..7fd0345682 100644 --- a/crates/registry-session/src/main.rs +++ b/crates/registry-session/src/main.rs @@ -1,5 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 +use std::net::SocketAddr; use std::path::PathBuf; use std::process::ExitCode; @@ -96,6 +97,16 @@ async fn main() -> ExitCode { }; let result = if let Some(assembled) = arguments.get_one::("verify-assembled") { gateway::verify_assembled(path, assembled, posture) + } else if let Some(out) = arguments.get_one::("standalone-out") { + let listen = *arguments + .get_one::("listen") + .expect("standalone output requires --listen"); + let upstreams = arguments + .get_many::("upstream") + .into_iter() + .flatten() + .map(String::as_str); + gateway::write_standalone(path, out, listen, upstreams, posture) } else { let mode = match ( arguments.get_one::("out"), diff --git a/crates/registry-session/tests/binary.rs b/crates/registry-session/tests/binary.rs index 66a6436f59..4c82831ab5 100644 --- a/crates/registry-session/tests/binary.rs +++ b/crates/registry-session/tests/binary.rs @@ -233,6 +233,161 @@ async fn the_check_reports_a_refused_file_without_serving() { const GATEWAY_FIXTURE: &str = include_str!("gateway/runtime.yaml"); +#[test] +fn gateway_writes_a_deterministic_checked_standalone_configuration() { + let root = tempfile::tempdir().expect("directory"); + let runtime = root.path().join("runtime.yaml"); + std::fs::write(&runtime, standalone_runtime()).expect("runtime"); + let config = root.path().join("envoy.json"); + + generate_standalone(&runtime, &config); + let first = std::fs::read(&config).expect("read Envoy configuration"); + generate_standalone(&runtime, &config); + assert_eq!( + std::fs::read(&config).expect("read regenerated configuration"), + first + ); + + let verified = runtime_command(&runtime) + .args(["gateway", "envoy", "--verify-assembled"]) + .arg(&config) + .output() + .expect("check complete Envoy configuration"); + assert!( + verified.status.success(), + "{}", + String::from_utf8_lossy(&verified.stderr) + ); + + let document: serde_json::Value = serde_json::from_slice(&first).expect("JSON configuration"); + assert_eq!( + document.pointer("/static_resources/listeners/0/address/socket_address/address"), + Some(&serde_json::json!("127.0.0.1")) + ); + assert_eq!( + document + .pointer("/static_resources/clusters") + .and_then(serde_json::Value::as_array) + .map(Vec::len), + Some(4) + ); +} + +#[test] +#[ignore = "requires Docker and the pinned Envoy image"] +fn envoy_validates_the_generated_standalone_configuration() { + let root = tempfile::tempdir().expect("directory"); + let runtime = root.path().join("runtime.yaml"); + std::fs::write(&runtime, standalone_runtime()).expect("runtime"); + let config = root.path().join("envoy.json"); + generate_standalone(&runtime, &config); + + let image = "envoyproxy/envoy:v1.39.6@sha256:1fde8efee875e4e4f6a39a90fe49d9338e1caacce5762034ef9fb4bbb9ad6aed"; + let mount = format!( + "type=bind,source={},target=/envoy.json,readonly", + config.display() + ); + let output = Command::new("docker") + .args([ + "run", + "--rm", + "--pull=never", + "--network=none", + "--mount", + &mount, + "--entrypoint", + "/usr/local/bin/envoy", + image, + "--mode", + "validate", + "--config-path", + "/envoy.json", + ]) + .output() + .expect("run the pinned Envoy validator"); + assert!( + output.status.success(), + "{}{}", + String::from_utf8_lossy(&output.stdout), + String::from_utf8_lossy(&output.stderr) + ); +} + +fn generate_standalone(runtime: &std::path::Path, config: &std::path::Path) { + let output = runtime_command(runtime) + .args(["gateway", "envoy", "--standalone-out"]) + .arg(config) + .args([ + "--listen", + "127.0.0.1:8080", + "--upstream", + "registry=127.0.0.1:8100", + "--upstream", + "pages=[::1]:8200", + ]) + .output() + .expect("write complete Envoy configuration"); + assert!( + output.status.success(), + "{}", + String::from_utf8_lossy(&output.stderr) + ); +} + +#[test] +fn standalone_generation_refuses_missing_or_undeclared_clusters_and_public_binds() { + let root = tempfile::tempdir().expect("directory"); + let runtime = root.path().join("runtime.yaml"); + std::fs::write(&runtime, standalone_runtime()).expect("runtime"); + let config = root.path().join("envoy.json"); + + for (listen, upstreams, expected) in [ + ("127.0.0.1:8080", vec!["registry=127.0.0.1:8100"], "pages"), + ( + "127.0.0.1:8080", + vec!["registry=127.0.0.1:8100", "bogus=127.0.0.1:8200"], + "configured module or page cluster", + ), + ("0.0.0.0:8080", vec![], "loopback"), + ( + "127.0.0.1:8080", + vec!["registry=127.0.0.1:8100", "registry=127.0.0.1:8101"], + "more than once", + ), + ] { + let mut command = runtime_command(&runtime); + command + .args(["gateway", "envoy", "--standalone-out"]) + .arg(&config) + .args(["--listen", listen]); + for upstream in upstreams { + command.args(["--upstream", upstream]); + } + let output = command.output().expect("run standalone generator"); + let stderr = String::from_utf8_lossy(&output.stderr); + assert_eq!(output.status.code(), Some(1), "{stderr}"); + assert!(stderr.contains(expected), "{stderr}"); + assert!(!config.exists()); + } +} + +fn standalone_runtime() -> String { + include_str!("../../../products/platform/examples/session/runtime.yaml") + .replace("10.0.0.5", "127.0.0.1") + .replace( + "modules:\n", + "gateway:\n service: {host: 127.0.0.1, publicPort: 8120, checkPort: 8121}\nmodules:\n", + ) + .replace( + " audience: person\n", + " audience: person\n upstream: {cluster: registry, prefixRewrite: /}\n", + ) + .replace( + " signIn: citizen\n", + " signIn: citizen\n upstream: {cluster: pages}\n", + ) +} + /// Run `gateway envoy` on `runtime_text`, with the sentinel secrets in the /// process environment and in the file provider's directory. Returns the exit /// code, everything the command printed, and the content of every file it diff --git a/docs/site/src/content/docs/configure/casework-directory.mdx b/docs/site/src/content/docs/configure/casework-directory.mdx index 04cabd5cd0..3b393598df 100644 --- a/docs/site/src/content/docs/configure/casework-directory.mdx +++ b/docs/site/src/content/docs/configure/casework-directory.mdx @@ -42,7 +42,7 @@ bootstrap call a deployment uses, as the plan's `administrator` person: ```yaml title="dev-journeys.yaml" test-excerpt="tutorial-work/casework/dev-journeys.yaml" body: teamId: decisions-team - staff: [{issuer: https://identity.standalone.example.test, subject: staff}] + staff: [{issuer: https://identity.casework.example.test, subject: staff}] supervisors: [] queueId: decisions ``` diff --git a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx index 78c38b67e6..2b86ee494e 100644 --- a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx +++ b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx @@ -482,7 +482,6 @@ When a BReg project declares the corresponding connection, the plan can bind ext - `externalBreg.reviewAuthority` names the Casework producer, token endpoint and private-key JWT credentials. - `externalBreg.taskGrant` pairs the exact assertion issuer and client with the Casework status connection. -- `externalBreg.hooks` binds declared destination IDs to signed outbound requests to a loopback event proxy. For BReg schema rehearsals, `externalBreg.schemaTestHeaders` maps each selected person to an owner-only bearer header obtained from the external issuer. @@ -493,6 +492,21 @@ Use `secret:file/NAME` for fixture keys and headers. Put each file under the pro For a Messaging throughput rehearsal, set `RSTACK_DEV_MESSAGING_MOCK_LATENCY_MS` before starting the run. The local mock gateway delays its responses by this many milliseconds. +## Use a BReg hook receiver you run + +Set `externalBreg.hooks` when you run a separate BReg hook receiver. You can use the development +runner's issuer for a plan that attaches only hooks. Bind every declared destination ID to its +numeric loopback origin, exact event path, and `secret:file/NAME` under `fixture/`. Give the +receiver the matching HMAC key. For a sibling container, publish the receiver port on the host's +loopback interface. + +Run `rstack dev check` before starting the project. Make an authorised change that emits the event +and check that the receiver verifies its signature and records the expected event. + +{/* Evidence: crates/registry-rstack-dev/src/plan.rs, a_fixed_external_hook_may_use_the_managed_development_issuer; + crates/registry-rstack-dev/src/products.rs, prepare_breg_hooks; + crates/registry-rstack-dev/src/external_breg.rs, Hook, hook_key. */} + ## The managed PostgreSQL server The run starts PostgreSQL for BReg, Casework, Messaging, Scheduling, Documents, Coordinator and diff --git a/docs/site/src/content/docs/configure/session.mdx b/docs/site/src/content/docs/configure/session.mdx index e006f55066..cf4a163a57 100644 --- a/docs/site/src/content/docs/configure/session.mdx +++ b/docs/site/src/content/docs/configure/session.mdx @@ -249,7 +249,34 @@ If a value uses an environment expression, add `--environment` with that variabl crates/registry-session/src/offline.rs run, receipt_diagnostics, receipt_findings; crates/registry-session/src/lib.rs command. */} -## 3. Generate and splice the gateway fragments +## 3. Generate the Envoy configuration + +### Standalone gateway on one host + +Use the standalone generator when Envoy, Session, and the module and page services share one +host. Set `gateway.service.host` to a numeric loopback address in the Session runtime file. +For a public HTTPS origin, terminate TLS in a reverse proxy on the same host and preserve the +public authority when forwarding to Envoy. Supply the socket for each distinct cluster named +by the configured modules and pages. + +```bash +registry-session --runtime-config /etc/registry-session/runtime.yaml gateway envoy \ + --standalone-out /etc/envoy/envoy.json --listen 127.0.0.1:8080 \ + --upstream registry=127.0.0.1:8100 --upstream pages=127.0.0.1:8200 +registry-session --runtime-config /etc/registry-session/runtime.yaml gateway envoy \ + --verify-assembled /etc/envoy/envoy.json +envoy --mode validate --config-path /etc/envoy/envoy.json +``` + +The generator verifies the complete configuration before replacing the output file. +The Envoy command validates the file against the installed Envoy binary. Registry Stack tests +it with Envoy 1.39.6. Use the fragment workflow when you need custom HTTP filters or upstreams +on other hosts. + +{/* Evidence: crates/registry-session/src/gateway/verify.rs, write_standalone; + crates/registry-session/tests/binary.rs, envoy_validates_the_generated_standalone_configuration. */} + +### Integrate with an existing gateway Generate into a directory you reserve for these files. The command writes or replaces the four fragments there: diff --git a/docs/site/src/content/docs/tutorials/first-casework.mdx b/docs/site/src/content/docs/tutorials/first-casework.mdx index 105d9aac0f..4b118a1ad1 100644 --- a/docs/site/src/content/docs/tutorials/first-casework.mdx +++ b/docs/site/src/content/docs/tutorials/first-casework.mdx @@ -110,47 +110,13 @@ Casework keeps the snapshot the producer sends and refuses each listed case. ## Describe the local run -`rstack dev` runs the project on your machine from a plan file. First tell Casework which issuer -and subject the producer's tokens carry. The template trusts a fixed local address, and a run signs -its test tokens under an HTTPS issuer name of your choosing: - -```diff test-edit title="casework.yaml" - trustedProducers: - requester: - profile: requester -- issuer: http://127.0.0.1:8093 -- subject: b75315b2-5854-70f3-8867-511dd771a6da -+ issuer: https://identity.standalone.example.test -+ subject: requester -``` +`rstack dev` uses the generated `dev.yaml`. The plan issues test tokens under the requester's +issuer and subject in `casework.yaml`. -Replace the generated plan with the following plan. It lists the product, test people and the roles they hold. It names a journey file, which -runs when the run starts: - -```yaml title="dev.yaml" test-file -apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 -kind: RStackDev -issuer: https://identity.standalone.example.test -products: - - {product: casework, project: ., audience: "urn:example:standalone-decision"} -people: - administrator: - subject: administrator - client: standalone-workbench - roles: [administrator] - staff: - subject: staff - client: standalone-workbench - roles: [staff] - requester: - subject: requester - client: standalone-requester - roles: [requester] -journeyFile: dev-journeys.yaml -``` +{/* Evidence: crates/registry-caseworkctl/src/project.rs, STANDALONE_YAML, development_plan. */} -A new Casework directory has no staff. The journey has the administrator seat one team on the -`decisions` queue and put the person `staff` in it: +A new Casework directory has no staff. Replace `dev-journeys.yaml` to have the administrator +seat one team on the `decisions` queue and put the person `staff` in it: ```yaml title="dev-journeys.yaml" test-file apiVersion: id.registrystack.org/formats/rstack/journeys/v1alpha1 @@ -166,7 +132,7 @@ journeys: headers: {If-Match: '"0"', Idempotency-Key: staff-the-queue} body: teamId: decisions-team - staff: [{issuer: https://identity.standalone.example.test, subject: staff}] + staff: [{issuer: https://identity.casework.example.test, subject: staff}] supervisors: [] queueId: decisions expect: {status: 200} @@ -293,7 +259,7 @@ claimed_revision="$(jq -r .revision claimed.json)" ```json test-excerpt { "revision": 2, - "state": {"held": {"holder": {"issuer": "https://identity.standalone.example.test", "subject": "staff"}}} + "state": {"held": {"holder": {"issuer": "https://identity.casework.example.test", "subject": "staff"}}} } ``` From 716c45e75b56c2c3d893157b41988d820f512b57 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 13/55] feat(coordinator): name in-flow Rhai computations transforms Folds these reviewed commits: - feat(coordinator): name in-flow Rhai computations transforms - fix(coordinator): align generated path parameter names - fix(coordinator-client): name the Idempotency-Key header in refusals - chore(coordinator): regenerate explicit path parameter contracts - docs(dev): describe the available external flow call Signed-off-by: Jeremi Joslin --- .../typescript/tests/live/products.live.ts | 6 +- clients/typescript/tests/media.test.ts | 12 +- clients/typescript/tests/page.test.ts | 2 +- .../registry-coordinator-client/src/client.rs | 4 +- .../registry-coordinator-client/tests/http.rs | 5 +- crates/registry-coordinator/src/authoring.rs | 114 ++++++------ crates/registry-coordinator/src/cli.rs | 22 +-- crates/registry-coordinator/src/compare.rs | 4 +- crates/registry-coordinator/src/completion.rs | 4 +- crates/registry-coordinator/src/contracts.rs | 10 +- crates/registry-coordinator/src/definition.rs | 76 ++++---- .../registry-coordinator/src/event_trigger.rs | 6 +- .../src/event_trigger_tests.rs | 6 +- .../registry-coordinator/src/external_http.rs | 12 +- crates/registry-coordinator/src/functions.rs | 100 +++++------ crates/registry-coordinator/src/http.rs | 73 ++++++-- .../src/http/admission_contracts.rs | 4 +- .../registry-coordinator/src/mapping_check.rs | 12 +- crates/registry-coordinator/src/problem.rs | 6 +- crates/registry-coordinator/src/protocol.rs | 2 +- .../registry-coordinator/src/read_in_force.rs | 2 +- crates/registry-coordinator/src/scenarios.rs | 24 +-- crates/registry-coordinator/src/worker.rs | 2 +- .../tests/authored_project.rs | 64 +++---- .../registry-coordinator/tests/authoring.rs | 77 +++++++-- .../tests/authoring_findings.rs | 40 ++--- .../tests/breg_action_native.rs | 8 +- .../tests/canonical_model.rs | 44 ++--- .../tests/cli_authoring.rs | 2 +- .../tests/external_command_project.rs | 6 +- .../fixtures/external-command/workflow.yaml | 6 +- .../tests/fixtures/review-wait/workflow.yaml | 6 +- .../tests/helper_functions.rs | 46 ++--- .../tests/instant_functions.rs | 12 +- .../tests/mapping_checks.rs | 10 +- .../tests/mapping_grammar.rs | 34 ++-- .../tests/nested_fields.rs | 16 +- .../tests/postgres_state.rs | 61 ++++--- .../tests/process_restart.rs | 6 +- .../tests/product_contract_imports.rs | 5 +- .../tests/recovery_audit.rs | 4 +- .../tests/review_wait_postgres.rs | 2 +- .../tests/runtime_config.rs | 4 +- .../tests/scheduling_event_native.rs | 4 +- .../tests/support/breg_service.rs | 4 +- .../tests/support/decision_evaluation.rs | 8 +- .../tests/support/leased_wait_deadline.rs | 10 +- .../tests/support/restore_pending.rs | 4 +- .../tests/support/snapshot_boundary.rs | 4 +- .../tests/wait_for_authoring.rs | 2 +- .../src/products/catalog_coordinator.rs | 55 +++--- .../tests/coordinator_navigation.rs | 20 +-- .../content/docs/configure/adapter-jobs.mdx | 2 +- .../content/docs/configure/coordinator.mdx | 65 +++---- .../run-a-project-with-rstack-dev.mdx | 6 +- .../src/content/docs/operate/coordinator.mdx | 6 +- .../content/docs/reference/api-stability.mdx | 8 +- .../reference/apis/registry-coordinator.mdx | 10 +- .../src/content/docs/reference/glossary.mdx | 5 +- .../src/content/docs/security/coordinator.mdx | 30 ++-- .../src/content/docs/start/coordinator.mdx | 8 +- .../kobotoolbox-job/workflow/workflow.yaml | 22 +-- products/coordinator/AGENTS.md | 4 +- products/coordinator/CHANGELOG.md | 2 + .../examples/decision-follow-up/README.md | 2 +- .../examples/decision-follow-up/workflow.yaml | 14 +- .../deferred-appointment/workflow.yaml | 18 +- .../examples/delayed-follow-up/workflow.yaml | 10 +- .../earlier-appointment-alerts/workflow.yaml | 66 +++---- .../examples/external-directory/workflow.yaml | 10 +- .../examples/external-job/README.md | 4 +- .../examples/external-job/workflow.yaml | 6 +- .../governed-action-follow-up/README.md | 2 +- .../governed-action-follow-up/workflow.yaml | 14 +- .../accept-invitation/workflow.yaml | 34 ++-- .../issue-invitation/workflow.yaml | 10 +- .../request-only/workflow.yaml | 22 +-- .../examples/reviewed-notice/workflow.yaml | 18 +- .../generated/fixture/fixture.schema.json | 6 +- .../openapi/coordinator.openapi.json | 34 ++-- .../generated/operations/catalog.json | 2 +- .../external.command.v1.output.schema.json | 2 +- .../generated/project/project.schema.json | 162 +++++++++--------- 83 files changed, 902 insertions(+), 774 deletions(-) diff --git a/clients/typescript/tests/live/products.live.ts b/clients/typescript/tests/live/products.live.ts index 2a8f564d44..85488bea88 100644 --- a/clients/typescript/tests/live/products.live.ts +++ b/clients/typescript/tests/live/products.live.ts @@ -157,7 +157,7 @@ export function registerServerLiveMatrix( token: () => manifest.tokens.coordinatorCaller, })) const workflow = await client.call('workflowContract', { - path: { workflow: manifest.metadata.coordinatorWorkflow }, + path: { workflowId: manifest.metadata.coordinatorWorkflow }, }) assert.equal(workflow.status, 200) assert.equal(workflow.developmentPeer, true) @@ -180,12 +180,12 @@ export function registerServerLiveMatrix( }) assert.equal(replayed.data.runId, started.data.runId) - const status = await client.call('runStatus', { path: { run: started.data.runId } }) + const status = await client.call('runStatus', { path: { runId: started.data.runId } }) assert.equal(status.data.runId, started.data.runId) const anon = new CoordinatorClient(new Transport({ baseUrl: manifest.products.coordinator, token: () => undefined })) await expectUnauthorized(anon.call('workflowContract', { - path: { workflow: manifest.metadata.coordinatorWorkflow }, + path: { workflowId: manifest.metadata.coordinatorWorkflow }, })) }) diff --git a/clients/typescript/tests/media.test.ts b/clients/typescript/tests/media.test.ts index 84d7160587..b6895891cc 100644 --- a/clients/typescript/tests/media.test.ts +++ b/clients/typescript/tests/media.test.ts @@ -177,20 +177,22 @@ test('Scheduling receipt lookup needs the original key and sends exactly it as a test('a signed Coordinator event sends the signed bytes unchanged and no bearer credential', async () => { const signed = new TextEncoder().encode('{ "id" : "evt-1",\n "type": "fixture" }\n') let asked = 0 - let seen: { body: unknown; authorization: string | null; credentials: unknown } | undefined + let seen: { path: string; body: unknown; authorization: string | null; credentials: unknown } | undefined const coordinator = make(Coordinator, { baseUrl: 'https://registry.example', token: () => { asked++; return 'bearer' }, - fetch: async (_url, init) => { - seen = { body: init?.body, authorization: new Headers(init?.headers).get('authorization'), credentials: init?.credentials } + fetch: async (url, init) => { + seen = { path: new URL(String(url)).pathname, body: init?.body, + authorization: new Headers(init?.headers).get('authorization'), credentials: init?.credentials } return new Response(null, { status: 204 }) } }) const headers = { 'webhook-id': '00000000-0000-4000-8000-000000000001', 'webhook-timestamp': '1614265330', 'webhook-signature': 'v1,fixture' } - const answer = await coordinator.call('admitEvent', { path: { workflow: 'w', trigger: 't' }, headers, body: signed }) + const answer = await coordinator.call('admitEvent', { path: { workflowId: 'w', triggerId: 't' }, headers, body: signed }) assert.equal(answer.status, 204) assert.ok(seen?.body instanceof Uint8Array) + assert.equal(seen.path, '/v1/events/w/t') assert.deepEqual(seen.body, signed) assert.equal(seen.authorization, null) assert.equal(seen.credentials, 'omit') assert.equal(asked, 0) - await assert.rejects(coordinator.call('admitEvent', { path: { workflow: 'w', trigger: 't' }, headers, + await assert.rejects(coordinator.call('admitEvent', { path: { workflowId: 'w', triggerId: 't' }, headers, body: { id: 'evt-1' } as never }), { name: 'TypeError', message: 'Signed request body must be the signed bytes' }) }) diff --git a/clients/typescript/tests/page.test.ts b/clients/typescript/tests/page.test.ts index 5ba0bc7139..7c2f649dce 100644 --- a/clients/typescript/tests/page.test.ts +++ b/clients/typescript/tests/page.test.ts @@ -310,7 +310,7 @@ test('a signed operation omits cookies and keeps a 401 as a signature refusal in const { seen, fetch } = recording(() => new Response(null, { status: 401 })) const coordinator = make(Coordinator, { baseUrl, fetch }) const headers = { 'webhook-id': '00000000-0000-4000-8000-000000000001', 'webhook-timestamp': '1', 'webhook-signature': 'v1,x' } - await assert.rejects(coordinator.call('admitEvent', { path: { workflow: 'w', trigger: 't' }, headers, body: Uint8Array.of(123, 125) }), + await assert.rejects(coordinator.call('admitEvent', { path: { workflowId: 'w', triggerId: 't' }, headers, body: Uint8Array.of(123, 125) }), { reason: 'status', status: 401 }) assert.deepEqual(seen, [{ authorization: null, credentials: 'omit', page: 'page' }]) }) diff --git a/crates/registry-coordinator-client/src/client.rs b/crates/registry-coordinator-client/src/client.rs index 2a17003fcc..7ac0020be3 100644 --- a/crates/registry-coordinator-client/src/client.rs +++ b/crates/registry-coordinator-client/src/client.rs @@ -121,7 +121,9 @@ impl CoordinatorClient { return Err(Error::invalid_request("the workflow identifier is invalid")); } if key.is_empty() || key.len() > 256 || !key.bytes().all(|b| (0x20..=0x7e).contains(&b)) { - return Err(Error::invalid_request("the admission key is invalid")); + return Err(Error::invalid_request( + "Idempotency-Key must contain 1 to 256 printable ASCII characters", + )); } if !valid_revision(&request.workflow_revision) { return Err(Error::invalid_request("the workflow revision is invalid")); diff --git a/crates/registry-coordinator-client/tests/http.rs b/crates/registry-coordinator-client/tests/http.rs index 679e8c136c..717ed310c9 100644 --- a/crates/registry-coordinator-client/tests/http.rs +++ b/crates/registry-coordinator-client/tests/http.rs @@ -1423,11 +1423,14 @@ async fn invalid_admission_and_recovery_fail_before_io() { "", "contains\tcontrol", "injected\r\nheader", + "mañana", &"a".repeat(257), ] { assert!(matches!( client.start(&token(), key, &request()).await, - Err(CoordinatorClientError::InvalidRequest { .. }) + Err(CoordinatorClientError::InvalidRequest { + reason: "Idempotency-Key must contain 1 to 256 printable ASCII characters", + }) )); } let mut input = request(); diff --git a/crates/registry-coordinator/src/authoring.rs b/crates/registry-coordinator/src/authoring.rs index 16df88a480..339fbcc310 100644 --- a/crates/registry-coordinator/src/authoring.rs +++ b/crates/registry-coordinator/src/authoring.rs @@ -45,16 +45,19 @@ const FORMAT: FormatSpec<'static> = FormatSpec { RemovedKey { pointer: "/title", replacement: "Write project.label." }, RemovedKey { pointer: "/label", replacement: "Move label to project.label." }, RemovedKey { pointer: "/description", replacement: "Move description to project.description." }, - RemovedKey { pointer: "/functions/*/title", replacement: "Write label." }, + RemovedKey { pointer: "/functions", replacement: "Rename functions to transforms, then replace each type: function and function member with type: transform and transform." }, + RemovedKey { pointer: "/transforms/*/title", replacement: "Write label." }, + RemovedKey { pointer: "/workflow/steps/*/*/function", replacement: "Write type: transform and name the Transform in the transform member." }, + RemovedKey { pointer: "/workflow/eventTriggers/*/input/function", replacement: "Write type: transform and name the Transform in the transform member." }, RemovedKey { pointer: "/operations/*/title", replacement: "Write label." }, RemovedKey { pointer: "/workflow/steps/*/title", replacement: "Write label." }, RemovedKey { pointer: "/connections", replacement: "Declare logical connections on Operation aliases under operations, then bind them in runtime.yaml." }, - RemovedKey { pointer: "/functionsFile", replacement: "Declare named typed Functions under functions, each with its source asset." }, + RemovedKey { pointer: "/functionsFile", replacement: "Declare named typed Transforms under transforms, each with its source asset." }, RemovedKey { pointer: "/deadlineSeconds", replacement: "Move deadlineSeconds to workflow.deadlineSeconds." }, RemovedKey { pointer: "/start", replacement: "Move start to workflow.start." }, RemovedKey { pointer: "/steps", replacement: "Move steps to workflow.steps and use Operation aliases." }, RemovedKey { pointer: "/outcomes", replacement: "Move outcomes to workflow.outcomes." }, - RemovedKey { pointer: "/workflow/steps/*/*/arguments", replacement: "Use inputs with the Function signature's named references." }, + RemovedKey { pointer: "/workflow/steps/*/*/arguments", replacement: "Use inputs with the Transform signature's named references." }, ], }; @@ -74,7 +77,7 @@ pub struct CoordinatorProject { types: BTreeMap, /// Named typed bounded pure computations over one object of named inputs. #[serde(default)] - functions: BTreeMap, + transforms: BTreeMap, /// Local aliases for exact versioned host Operations and logical deployment connections. #[serde(default)] operations: BTreeMap, @@ -164,7 +167,7 @@ struct AuthoredOperation { /// or external command Operation. #[serde(default)] response_schema: Option, - /// The typed pure Function that interprets an external command's provider + /// The typed pure Transform that interprets an external command's provider /// response into an accepted result, a declared refusal or an uncertain /// outcome. Required on, and accepted only on, `external.command/v1`. #[serde(default)] @@ -194,7 +197,7 @@ struct AuthoredOperation { enum AuthoredCompletion { /// Repeats the accepted read under host-owned transport and credentials. BoundedPoll { - /// The typed pure Function that turns the saved command and response into an observation. + /// The typed pure Transform that turns the saved command and response into an observation. interpret: LocalId, /// Seconds between pending observations; the host may impose a stricter minimum. interval_seconds: BoundedU32<1, 86_400>, @@ -205,16 +208,16 @@ registry_platform_yaml::tagged_union!(AuthoredCompletion); #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase", deny_unknown_fields)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] -struct AuthoredFunction { +struct AuthoredTransform { /// The pinned pure runtime; rhai has no clock, network, database or credential capability. - runtime: FunctionRuntime, + runtime: TransformRuntime, /// A local reviewed source asset inside the project directory. source: String, /// One public source function taking exactly one named-input object. entrypoint: String, /// Named input schemas or references; every declared input is required exactly once. inputs: BTreeMap, - /// The declared result schema or mapping; Functions and the host enforce it. + /// The declared result schema or mapping; Transforms and the host enforce it. output: Schema, /// Optional narrowing of the bounded pure profile; omitted limits retain the default ceiling. #[serde(default)] @@ -232,7 +235,7 @@ struct AuthoredFunction { #[derive(Debug, Deserialize)] #[serde(rename_all = "kebab-case")] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] -enum FunctionRuntime { +enum TransformRuntime { Rhai, } @@ -424,7 +427,7 @@ enum Member { /// A literal JSON value; it remains subject to bounded value checks. value: ForeignValue, }, - /// Builds a nested object member by member, never with a Function. + /// Builds a nested object member by member, never with a Transform. Fields { /// Object members built from typed references, literals or nested fields. fields: Fields, @@ -442,10 +445,10 @@ registry_platform_yaml::tagged_union!(Member); #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schema", schemars(!remote, tag = "type"))] enum AuthoredMapping { - /// Computes a value with a declared typed pure Function. - Function { - /// A declared pure Function called with an object of named inputs. - function: LocalId, + /// Computes a value with a declared typed pure Transform. + Transform { + /// A declared pure Transform called with an object of named inputs. + transform: LocalId, /// Named input schemas or references; every declared input is required exactly once. inputs: BTreeMap, }, @@ -617,7 +620,7 @@ enum AuthoredStep { Finish { /// One declared terminal outcome name. outcome: LocalId, - /// The declared result schema or mapping; Functions and the host enforce it. + /// The declared result schema or mapping; Transforms and the host enforce it. #[serde(default)] output: Option, /// An optional human label; it changes neither stable identity nor behavior revision. @@ -799,9 +802,9 @@ impl From for crate::compare::Condition { impl From for Mapping { fn from(mapping: AuthoredMapping) -> Self { let reference = match mapping { - AuthoredMapping::Function { function, inputs } => { + AuthoredMapping::Transform { transform, inputs } => { return Self::Function { - function: function.into_string(), + function: transform.into_string(), inputs: inputs .into_iter() .map(|(id, reference)| (id.into_string(), reference.into())) @@ -855,7 +858,7 @@ pub(crate) fn asset_path(root: &Path, asset: &str) -> Result CoordinatorError::new("definition.read", "the project asset is unavailable") .with_exit(3) .suggest( - "Restore the named generated contract or Function source asset inside the project.", + "Restore the named generated contract or Transform source asset inside the project.", ) })?; if !candidate.starts_with(&root) || !candidate.is_file() { @@ -960,8 +963,8 @@ fn project_integrity_diagnostics( map_ids("/types", &project.types), ), ( - "coordinator.project.function-id-collision", - map_ids("/functions", &project.functions), + "coordinator.project.transform-id-collision", + map_ids("/transforms", &project.transforms), ), ( "coordinator.project.operation-id-collision", @@ -1002,13 +1005,13 @@ fn project_integrity_diagnostics( ), )); } - for (id, function) in &project.functions { + for (id, function) in &project.transforms { errors.extend(collisions( document, - "coordinator.project.function-input-id-collision", + "coordinator.project.transform-input-id-collision", &map_ids( &format!( - "/functions/{}/inputs", + "/transforms/{}/inputs", registry_platform_yaml::escape_pointer_segment(id.as_str()) ), &function.inputs, @@ -1054,15 +1057,15 @@ fn project_integrity_diagnostics( let groups = [ ( - "coordinator.project.duplicate-function-label", - "functions", + "coordinator.project.duplicate-transform-label", + "transforms", project - .functions + .transforms .iter() .filter_map(|(id, item)| { item.label.as_ref().map(|label| { let pointer = format!( - "/functions/{}/label", + "/transforms/{}/label", registry_platform_yaml::escape_pointer_segment(id.as_str()) ); (id.as_str().to_owned(), label.clone(), pointer) @@ -1292,13 +1295,13 @@ fn compile(project: CoordinatorProject, path: &Path) -> Result { (Operation::ExternalCommand, None) => { return Err(schema_error( format!("/operations/{id}/interpret"), - "external.command/v1 requires interpret: the Function that turns the provider response into an accepted result, a declared refusal or an uncertain outcome", + "external.command/v1 requires interpret: the Transform that turns the provider response into an accepted result, a declared refusal or an uncertain outcome", )); } (_, Some(_)) => { return Err(schema_error( format!("/operations/{id}/interpret"), - "only external.command/v1 accepts an interpretation Function", + "only external.command/v1 accepts an interpretation Transform", )); } (_, None) => {} @@ -1366,7 +1369,7 @@ fn compile(project: CoordinatorProject, path: &Path) -> Result { }, ); } - // Base operation schemas resolve before Function signatures. No completion + // Base operation schemas resolve before Transform signatures. No completion // output may take part in that graph, so a completion cannot define itself. let raw_operations = operations.clone(); let resolver = Schemas { @@ -1385,8 +1388,8 @@ fn compile(project: CoordinatorProject, path: &Path) -> Result { .transpose()?; } let base = operations.clone(); - // Interpretation Functions can see only resolved base Operation schemas - // and host-owned completions. Downstream Functions resolve after bounded + // Interpretation Transforms can see only resolved base Operation schemas + // and host-owned completions. Downstream Transforms resolve after bounded // completion bindings, so ordinary mappings can consume their typed output. let resolver = Schemas { types: &raw_types, @@ -1407,7 +1410,7 @@ fn compile(project: CoordinatorProject, path: &Path) -> Result { .collect::>(); let mut functions = BTreeMap::new(); let mut downstream = Vec::new(); - for (id, function) in project.functions { + for (id, function) in project.transforms { if interpreters.contains(id.as_str()) { functions.insert( id.as_str().to_owned(), @@ -1425,16 +1428,19 @@ fn compile(project: CoordinatorProject, path: &Path) -> Result { .expect("the base alias exists"); let field = format!("/operations/{operation_id}/interpret"); let function = functions.get(interpret.as_str()).ok_or_else(|| { - schema_error(field.clone(), "the interpretation Function is not declared") + schema_error( + field.clone(), + "the interpretation Transform is not declared", + ) })?; if function.inputs.len() != 2 || function.inputs.get("command") != Some(&operation.input) || function.inputs.get("response") != Some(&operation.output) { - return Err(schema_error(field, "the interpretation Function must take command and response with the command's exact input and response schemas")); + return Err(schema_error(field, "the interpretation Transform must take command and response with the command's exact input and response schemas")); } let (output, refusal) = - command_interpretation(&function.output, &format!("/functions/{interpret}/output"))?; + command_interpretation(&function.output, &format!("/transforms/{interpret}/output"))?; operation.response = Some(std::mem::replace(&mut operation.output, output)); operation.refusal = refusal; operation.interpret = Some(interpret.into_string()); @@ -1464,17 +1470,17 @@ fn compile(project: CoordinatorProject, path: &Path) -> Result { let function = functions.get(interpret.as_str()).ok_or_else(|| { schema_error( format!("/operations/{operation_id}/completions/{name}/interpret"), - "the interpretation Function is not declared", + "the interpretation Transform is not declared", ) })?; if function.inputs.len() != 2 || function.inputs.get("command") != Some(&operation.input) || function.inputs.get("response") != Some(&operation.output) { - return Err(schema_error(format!("/operations/{operation_id}/completions/{name}/interpret"), "the interpretation Function must take command and response with the owning Operation's exact schemas")); + return Err(schema_error(format!("/operations/{operation_id}/completions/{name}/interpret"), "the interpretation Transform must take command and response with the owning Operation's exact schemas")); } let output = - terminal_schema(&function.output, &format!("/functions/{interpret}/output"))?; + terminal_schema(&function.output, &format!("/transforms/{interpret}/output"))?; operation.completions.insert( name, CompletionDefinition { @@ -1755,7 +1761,7 @@ fn compile(project: CoordinatorProject, path: &Path) -> Result { fn resolve_function( id: &str, - function: AuthoredFunction, + function: AuthoredTransform, resolver: &Schemas<'_>, ) -> Result { let _runtime = function.runtime; @@ -1767,14 +1773,14 @@ fn resolve_function( resolver .resolve( &schema.0.into_value(), - &format!("/functions/{id}/inputs/{name}"), + &format!("/transforms/{id}/inputs/{name}"), ) .map(|schema| (name, schema)) }) .collect::>>()?; let output = resolver.resolve( &function.output.0.into_value(), - &format!("/functions/{id}/output"), + &format!("/transforms/{id}/output"), )?; Ok(FunctionDefinition { runtime: "rhai".into(), @@ -1816,8 +1822,8 @@ fn reference_sites(document: &Document) -> BTreeMap { - Some(format!("/functions/{id}")) + ("transform" | "interpret", Some(id)) if !schema => { + Some(format!("/transforms/{id}")) } ( "next" | "onTimeout" | "onCancel" | "onDeclaredRefusal" | "step", @@ -1851,7 +1857,7 @@ fn reference_sites(document: &Document) -> BTreeMap { Some(format!("asset:{asset}")) @@ -1936,8 +1942,8 @@ fn reference_sites(document: &Document) -> BTreeMap Result<()> { } /// The step output and declared refusal an external command's interpretation -/// establishes. The Function returns one closed object per state: `accepted` +/// establishes. The Transform returns one closed object per state: `accepted` /// with a required `result`, and optionally `refused` with a required closed /// enum `code` and `uncertain`. The step output is the accepted result, still /// bound to the interpretation's own local definitions; the refusal admits only @@ -2385,10 +2391,10 @@ pub(crate) fn positioned(document: &Document, error: CoordinatorError) -> Coordi } // A function's own definition is placed in functions.rhai; a function // that fails while a step evaluates it is placed at that step. - if error.code.starts_with("function.") + if error.code.starts_with("transform.") && !matches!( error.code.as_str(), - "function.value-limit" | "function.json" + "transform.value-limit" | "transform.json" ) && error.file.as_deref().map(std::path::PathBuf::as_path) != Some(Path::new("workflow.yaml")) @@ -2490,7 +2496,7 @@ pub fn project_schema() -> std::result::Result { maps(&mut schema); for (pointer, minimum, maximum) in [ ("/properties/operations", 0, 64), - ("/properties/functions", 0, 128), + ("/properties/transforms", 0, 128), ("/properties/types", 0, 128), ("/$defs/AuthoredWorkflow/properties/eventTriggers", 0, 16), ("/$defs/AuthoredWorkflow/properties/calendarTriggers", 0, 1), @@ -2510,13 +2516,13 @@ pub fn project_schema() -> std::result::Result { if variant .pointer("/properties/type/const") .and_then(Value::as_str) - == Some("function") + == Some("transform") { variant["properties"]["inputs"]["maxProperties"] = json!(16); } } } - if let Some(inputs) = schema.pointer_mut("/$defs/AuthoredFunction/properties/inputs") { + if let Some(inputs) = schema.pointer_mut("/$defs/AuthoredTransform/properties/inputs") { inputs["maxProperties"] = json!(16); } let mut text = serde_json::to_string_pretty(&schema)?; diff --git a/crates/registry-coordinator/src/cli.rs b/crates/registry-coordinator/src/cli.rs index af486e8715..accdfc4ccb 100644 --- a/crates/registry-coordinator/src/cli.rs +++ b/crates/registry-coordinator/src/cli.rs @@ -106,8 +106,8 @@ impl ListTurn { /// What `explain` describes without a project. #[derive(Subcommand)] enum ExplainTopic { - /// List the helpers a pure Function may call, with the interpreter ABI and limits. - Functions, + /// List the helpers a pure Transform may call, with the interpreter ABI and limits. + Transforms, } mod identity_facts; @@ -155,7 +155,7 @@ enum Command { #[command(subcommand)] topic: GenerateTopic, }, - /// Validate the workflow, functions and root YAML companions offline. + /// Validate the workflow, Transforms and root YAML companions offline. Check { #[arg(long)] /// Directory containing workflow.yaml and its declared code and contract assets. @@ -174,7 +174,7 @@ enum Command { /// Check under the production posture. production: bool, }, - /// Explain a checked graph, mappings and execution bounds offline, or the helpers Functions may call. + /// Explain a checked graph, mappings and execution bounds offline, or the helpers Transforms may call. #[command(args_conflicts_with_subcommands = true, subcommand_negates_reqs = true)] Explain { #[arg(long, required = true)] @@ -971,7 +971,7 @@ async fn execute( Ok(json!({"status":"generated","output":output})) } Command::Check { project, explain, deny_warnings, environment, .. } => check(project.as_deref(), runtime_config(cli)?.as_deref(), *explain, *deny_warnings, *environment, declared, explicit_settings), - Command::Explain { topic: Some(ExplainTopic::Functions), .. } => Ok(crate::functions::explain()), + Command::Explain { topic: Some(ExplainTopic::Transforms), .. } => Ok(crate::functions::explain()), Command::Explain { project, .. } => check(project.as_deref(), runtime_config(cli)?.as_deref(), true, false, false, declared, explicit_settings), Command::Test { project, fixtures } => test(project, fixtures.as_deref()), Command::Package { project, output } => { @@ -1623,9 +1623,9 @@ fn render_human(cli: &Cli, value: &Value) -> String { render_explain(value) } Command::Explain { - topic: Some(ExplainTopic::Functions), + topic: Some(ExplainTopic::Transforms), .. - } => render_functions(value), + } => render_transforms(value), Command::Check { .. } => { let mut out = String::new(); if let Some(workflow) = value["workflow"].as_str() { @@ -1780,15 +1780,15 @@ fn render_explain(value: &Value) -> String { .map(|(limit, bound)| format!("{limit} {bound}")) .collect::>() .join(", "); - out.push_str(&format!("Function limits: {limits}\n")); + out.push_str(&format!("Transform limits: {limits}\n")); out.push_str(&format!("Recovery: {}\n", text(&value["recovery"]))); out } /// The profile, then its helper names in lines a terminal can show. -fn render_functions(value: &Value) -> String { +fn render_transforms(value: &Value) -> String { let mut out = format!( - "Pure function helpers, profile {}\nInterpreter ABI: {}\nFunction limits: {}\nHelpers:\n", + "Transform helpers, profile {}\nInterpreter ABI: {}\nFunction limits: {}\nHelpers:\n", text(&value["profile"]), text(&value["interpreterAbi"]), value["limits"] @@ -1822,7 +1822,7 @@ fn render_functions(value: &Value) -> String { /// A step mapping as one phrase: `f(input, step a /b)`, `{m: input /n}` or /// one reference. fn mapping(value: &Value) -> String { - if let Some(function) = value["function"].as_str() { + if let Some(function) = value["transform"].as_str() { let arguments = value["arguments"] .as_array() .into_iter() diff --git a/crates/registry-coordinator/src/compare.rs b/crates/registry-coordinator/src/compare.rs index 217cfb2985..8aaa762fa6 100644 --- a/crates/registry-coordinator/src/compare.rs +++ b/crates/registry-coordinator/src/compare.rs @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 //! The compare decision of a choose step: an ordered list of tests over typed -//! values that routes to `matched` or `unmatched`. A compare holds no Function, +//! values that routes to `matched` or `unmatched`. A compare holds no Transform, //! no nesting and no clock, so the same input and step outputs always take the //! same route. //! @@ -358,7 +358,7 @@ mod tests { fn only_a_compare_that_cannot_test_its_value_is_a_failed_choice() { let choice = CoordinatorError::new("mapping.choice", "the value is missing"); assert_eq!(failure_code(&choice), "choice-invalid"); - for code in ["mapping.path", "mapping.branch", "function.failed"] { + for code in ["mapping.path", "mapping.branch", "transform.failed"] { let error = CoordinatorError::new(code, "refused"); assert_eq!(failure_code(&error), "mapping-invalid", "{code}"); } diff --git a/crates/registry-coordinator/src/completion.rs b/crates/registry-coordinator/src/completion.rs index a6013d1308..6771c5a16e 100644 --- a/crates/registry-coordinator/src/completion.rs +++ b/crates/registry-coordinator/src/completion.rs @@ -23,7 +23,7 @@ use registry_platform_crypto::delivery_signature::{ use registry_review_protocol::ReviewCompletion; use uuid::Uuid; -/// Interpret one bounded external observation using the pinned pure Function. +/// Interpret one bounded external observation using the pinned pure Transform. /// The original saved command is the only correlation input; mappings are not /// evaluated again while waiting. Invalid evidence remains a recovery hold. pub(crate) fn interpret_poll( @@ -65,7 +65,7 @@ pub(crate) fn interpret_poll( }; match value.get("state").and_then(serde_json::Value::as_str) { Some("pending") => CompletionObservation::Pending { retry_after: None }, - // The Function's complete interpretation envelope has been checked. + // The Transform's complete interpretation envelope has been checked. // The worker or scenario checks the cached terminal contract once. Some("complete" | "refused") => CompletionObservation::Settled(value), _ => hold(), diff --git a/crates/registry-coordinator/src/contracts.rs b/crates/registry-coordinator/src/contracts.rs index f95bfb593f..efa16f2389 100644 --- a/crates/registry-coordinator/src/contracts.rs +++ b/crates/registry-coordinator/src/contracts.rs @@ -28,7 +28,7 @@ pub struct OperationContract { output_validator: JSONSchema, refusal_validator: Option, /// The complete provider response an `external.command/v1` interpretation - /// Function reads, before it becomes an accepted result or a refusal. + /// Transform reads, before it becomes an accepted result or a refusal. response_validator: Option, } @@ -172,7 +172,7 @@ impl OperationContract { Ok(self) } - /// Checks a provider response before an interpretation Function reads it. + /// Checks a provider response before an interpretation Transform reads it. /// An operation without a declared response accepts none. pub fn check_response(&self, value: &Value) -> Result<(), Violation> { match &self.response_validator { @@ -1255,13 +1255,13 @@ mod derived { (input::(), output::()) } - /// The command body is a JSON object a pinned pure Function builds; the + /// The command body is a JSON object a pinned pure Transform builds; the /// output is the bounded provider response the pinned interpretation - /// Function receives, never the step result itself. + /// Transform receives, never the step result itself. pub(super) fn external_command() -> (Value, Value) { let mut response = output::(); response["description"] = json!( - "The bounded provider response. The operation's interpret Function \ + "The bounded provider response. The operation's interpret Transform \ receives it with the command and returns the step result, a declared \ refusal, or an uncertain outcome." ); diff --git a/crates/registry-coordinator/src/definition.rs b/crates/registry-coordinator/src/definition.rs index 813d9326ee..2b3d45be7c 100644 --- a/crates/registry-coordinator/src/definition.rs +++ b/crates/registry-coordinator/src/definition.rs @@ -17,7 +17,7 @@ use serde_json::Value; use crate::{ functions::{ - check_value, Functions, INTERPRETER_ABI, MAXIMUM_FUNCTION_ARRAY_ITEMS, + check_value, Transforms, INTERPRETER_ABI, MAXIMUM_FUNCTION_ARRAY_ITEMS, MAXIMUM_FUNCTION_CALL_LEVELS, MAXIMUM_FUNCTION_EXPRESSION_DEPTH, MAXIMUM_FUNCTION_MAP_ENTRIES, MAXIMUM_FUNCTION_OPERATIONS, MAXIMUM_FUNCTION_SOURCE_BYTES, MAXIMUM_FUNCTION_STRING_BYTES, @@ -53,7 +53,7 @@ pub struct Definition { pub workflow: Workflow, pub digest: String, frozen: Snapshot, - functions: Functions, + functions: Transforms, input_schema: Arc, outcome_schemas: BTreeMap>, operation_contracts: BTreeMap>, @@ -94,12 +94,14 @@ pub struct ServiceDeadline { pub next: String, } -/// How a step computes its value: a pure function over references, an +/// How a step computes its value: a pure Transform over references, an /// object built member by member from references and nested objects, or one /// reference. #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] #[serde(untagged, deny_unknown_fields)] pub enum Mapping { + // Frozen v1alpha1 snapshots and semantic revisions keep this member. + // Authoring and operator explanations use the Transform vocabulary. Function { function: String, inputs: BTreeMap, @@ -114,7 +116,7 @@ pub enum Mapping { } /// One member of a fields mapping: a reference, or a nested object built -/// the same way. A member never calls a Function. +/// the same way. A member never calls a Transform. #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] #[serde(untagged)] pub enum Member { @@ -188,6 +190,15 @@ pub(crate) fn valid_field_name(name: &str) -> bool { } impl Mapping { + fn explain(&self) -> Value { + match self { + Self::Function { function, inputs } => { + serde_json::json!({"transform":function,"inputs":inputs}) + } + mapping => serde_json::json!(mapping), + } + } + /// Each reference with its member path below the mapping. pub(crate) fn references(&self) -> Vec<(String, &Reference)> { match self { @@ -370,13 +381,13 @@ pub struct ResolvedOperation { pub refusal: Option, pub completions: BTreeMap, pub revision: String, - /// The pinned pure Function that turns an external command's saved + /// The pinned pure Transform that turns an external command's saved /// command and bounded provider response into an accepted result, a /// declared refusal or an uncertain outcome. Present only on /// `external.command/v1`. #[serde(default, skip_serializing_if = "Option::is_none")] pub interpret: Option, - /// The bounded provider response the interpretation Function reads. + /// The bounded provider response the interpretation Transform reads. /// Present only on `external.command/v1`, whose `output` is the /// interpreted accepted result. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -680,14 +691,14 @@ impl Definition { .map_err(|error| { crate::authoring::positioned( &document, - error.at(&path, format!("/functions/{name}/source")), + error.at(&path, format!("/transforms/{name}/source")), ) })?; let source = read_text(&source_path, MAXIMUM_FUNCTION_SOURCE_BYTES as usize) .map_err(|error| { crate::authoring::positioned( &document, - error.at(&path, format!("/functions/{name}/source")), + error.at(&path, format!("/transforms/{name}/source")), ) })?; sources.insert(function.source.clone(), source); @@ -813,7 +824,7 @@ impl Definition { Err(error) => findings.push(error), _ => {} } - let functions = Functions::compile(&frozen.sources, &frozen.workflow.functions) + let functions = Transforms::compile(&frozen.sources, &frozen.workflow.functions) .map_err(|refused| findings.extend(refused)) .ok(); let input_schema = compile_schema(&frozen.workflow.input) @@ -967,10 +978,7 @@ impl Definition { }; let mut item = serde_json::json!({"id":id,"kind":kind,"next":step.targets()}); if let Some(mapping) = step.mapping() { - item["mapping"] = serde_json::json!(mapping); - if let Mapping::Function { inputs, .. } = mapping { - item["mapping"]["inputs"] = serde_json::json!(inputs); - } + item["mapping"] = mapping.explain(); } match step { Step::Call { @@ -1026,9 +1034,13 @@ impl Definition { item }) .collect::>(); + let mut event_triggers = serde_json::json!(self.workflow.event_triggers); + for (id, trigger) in &self.workflow.event_triggers { + event_triggers[id]["input"] = trigger.input.explain(); + } let mut report = serde_json::json!({"workflow":self.workflow.id,"version":self.workflow.version,"workflowRevision":self.digest, "start":self.workflow.start,"deadlineSeconds":parse_duration(&self.workflow.deadline)?.num_seconds(), - "contracts":contracts,"operations":self.workflow.operations,"operationContracts":operation_contracts,"calendarTriggers":self.workflow.calendar_triggers,"eventTriggers":self.workflow.event_triggers,"functions":self.workflow.functions,"types":self.workflow.types,"references":self.workflow.references,"presentation":self.workflow.presentation,"connections":self.workflow.connections,"outcomes":self.workflow.outcomes.keys().collect::>(),"steps":steps, + "contracts":contracts,"operations":self.workflow.operations,"operationContracts":operation_contracts,"calendarTriggers":self.workflow.calendar_triggers,"eventTriggers":event_triggers,"transforms":self.workflow.functions,"types":self.workflow.types,"references":self.workflow.references,"presentation":self.workflow.presentation,"connections":self.workflow.connections,"outcomes":self.workflow.outcomes.keys().collect::>(),"steps":steps, "limits":crate::functions::limits(),"valueLimits":crate::functions::value_limits(),"interpreterAbi":self.frozen.interpreter_abi,"schemaAbi":self.frozen.schema_abi,"adapterAbi":self.frozen.adapter_abi, "recovery":"A run restores this exact snapshot. retry-same preserves a frozen command and cannot adopt edited mappings or repeat an uncertain hold-after-dispatch evaluation."}); @@ -1355,7 +1367,7 @@ fn seal_revisions(workflow: &mut Workflow, sources: &BTreeMap) - for function in workflow.functions.values_mut() { let source = sources .get(&function.source) - .ok_or_else(|| fail("function.definition"))?; + .ok_or_else(|| fail("transform.definition"))?; function.revision = crate::functions::revision(function, source)?; } for operation in workflow.operations.values_mut() { @@ -1395,9 +1407,9 @@ fn seal_revisions(workflow: &mut Workflow, sources: &BTreeMap) - Ok(()) } -/// An external command pins one interpretation Function over its exact +/// An external command pins one interpretation Transform over its exact /// command and response schemas, and its output and refusal are exactly what -/// that Function declares. No other operation carries an interpretation. +/// that Transform declares. No other operation carries an interpretation. fn command_interpretation_valid(flow: &Workflow, operation: &ResolvedOperation) -> bool { if operation.uses != Operation::ExternalCommand { return operation.interpret.is_none() && operation.response.is_none(); @@ -1579,7 +1591,7 @@ fn build_fields( /// What computed a mapping's value, as a refusal names it. fn producer(mapping: &Mapping) -> String { match mapping { - Mapping::Function { function, .. } => format!("function {function}"), + Mapping::Function { function, .. } => format!("Transform {function}"), Mapping::Fields { .. } => "the fields mapping".into(), Mapping::Compare { .. } => "the compare".into(), Mapping::Reference(_) => "the reference".into(), @@ -1679,7 +1691,7 @@ fn workflow_findings(flow: &Workflow) -> Vec { ("connections", flow.connections.len(), 0, 16), ("outcomes", flow.outcomes.len(), 1, 64), ("operations", flow.operations.len(), 0, 64), - ("functions", flow.functions.len(), 0, 128), + ("transforms", flow.functions.len(), 0, 128), ("types", flow.types.len(), 0, 128), ("contracts", flow.contracts.len(), 0, 16), ] { @@ -1878,11 +1890,11 @@ fn workflow_findings(flow: &Workflow) -> Vec { } if let Some(Mapping::Function { function, inputs }) = step.mapping() { match flow.functions.get(function) { - None => findings.push(authored("mapping.function", &format!("steps.{name}.{}.function", step.role()), - &format!("Function {function} is not declared; available Functions are {}", listed(flow.functions.keys().map(String::as_str))), - "Name one of the declared Functions, or add its typed signature and reviewed source asset.")), - Some(signature) if inputs.keys().ne(signature.inputs.keys()) => findings.push(authored("mapping.function", &format!("steps.{name}.{}.inputs",step.role()), - "the named Function inputs must match its declared signature exactly", "Supply every declared input name once and remove undeclared names.")), + None => findings.push(authored("mapping.transform", &format!("steps.{name}.{}.transform", step.role()), + &format!("Transform {function} is not declared; available Transforms are {}", listed(flow.functions.keys().map(String::as_str))), + "Name one of the declared Transforms, or add its typed signature and reviewed source asset.")), + Some(signature) if inputs.keys().ne(signature.inputs.keys()) => findings.push(authored("mapping.transform", &format!("steps.{name}.{}.inputs",step.role()), + "the named Transform inputs must match its declared signature exactly", "Supply every declared input name once and remove undeclared names.")), _ => {}, } } @@ -2332,12 +2344,12 @@ pub(crate) fn validate_mapping( return Err(authored( "mapping.reference", &base, - "waitUntil and choose take a function or a single reference, not fields", - "Select the instant or label with one reference, or compute it in a function.", + "waitUntil and choose take a Transform or a single reference, not fields", + "Select the instant or label with one reference, or compute it in a Transform.", )) } (_, Mapping::Function { function, .. }) if !valid_name(function) => { - return Err(fail("mapping.function").at("workflow.yaml", format!("steps.{name}"))) + return Err(fail("mapping.transform").at("workflow.yaml", format!("steps.{name}"))) } (_, Mapping::Fields { fields }) => fields_bounds(fields, &base, 1, &mut 0)?, (_, Mapping::Compare { compare }) => compare.check(step, name)?, @@ -2354,7 +2366,7 @@ pub(crate) fn validate_mapping( "mapping.literal", &format!("{field}.value"), "the literal exceeds the structured value bounds", - "Shorten the literal or build the value in a function; literals hold at most 32 levels, 4096 nodes, 16384-byte strings, 131072 canonical bytes, and integers within 2^53 - 1.", + "Shorten the literal or build the value in a Transform; literals hold at most 32 levels, 4096 nodes, 16384-byte strings, 131072 canonical bytes, and integers within 2^53 - 1.", ) })?; continue; @@ -2539,16 +2551,16 @@ fn fail(code: &'static str) -> CoordinatorError { "definition.cycle" => "the graph contains a cycle", "definition.unreachable" => "a step is not reachable from start", "definition.deadline" => "deadline must be a positive s, m, h or d duration no longer than 365 days", - "mapping.branch" => "the function did not return a declared branch label", + "mapping.branch" => "the Transform did not return a declared branch label", "mapping.timestamp" => "waitUntil did not return an RFC 3339 instant", "mapping.missing-output" => "a declared prior call output is absent", "mapping.path" => "the reference path names no member of the value it reads", - "mapping.call-shape" => "the call input function did not return an object", + "mapping.call-shape" => "the call input Transform did not return an object", "definition.input" => "the start input does not satisfy its authored schema", "definition.outcome" => "the final output does not satisfy the declared outcome schema", "definition.schema" => "the schema is invalid or uses an unsupported format or external reference", _ => "the workflow definition or mapping was refused", - }).suggest("Inspect the authored field and function, correct the definition, then rerun check. Admitted runs keep their original snapshot.") + }).suggest("Inspect the authored field and Transform, correct the definition, then rerun check. Admitted runs keep their original snapshot.") } /// A run cancels only work it opened, so a cancel's input is a fields @@ -2559,7 +2571,7 @@ fn fail(code: &'static str) -> CoordinatorError { /// - a review cancel's `request` is the whole accepted request, with no path, /// a `casework.submit-review-request/v1` step returned. /// -/// Any other source, such as the run input, a literal, a Function, a nested +/// Any other source, such as the run input, a literal, a Transform, a nested /// object or another step, is refused with the code, message and suggestion /// returned here. Ordinary step reference checks then hold that the step ran /// on every route here. diff --git a/crates/registry-coordinator/src/event_trigger.rs b/crates/registry-coordinator/src/event_trigger.rs index 0361df8242..6dd75c724c 100644 --- a/crates/registry-coordinator/src/event_trigger.rs +++ b/crates/registry-coordinator/src/event_trigger.rs @@ -204,7 +204,7 @@ pub(crate) fn check_key_references( } /// Resolved governed trigger. The package revision covers every member, the -/// event schema and all referenced Function implementation bytes. +/// event schema and all referenced Transform implementation bytes. #[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct EventTrigger { @@ -217,7 +217,7 @@ pub struct EventTrigger { impl EventTrigger { /// Evaluate only after durable duplicate lookup. Exact replay must not be - /// reinterpreted by an edited active mapping or Function. + /// reinterpreted by an edited active mapping or Transform. pub(crate) fn map(&self, definition: &Definition, event: &Value) -> Result { crate::functions::check_value(event)?; let schema = crate::definition::compile_schema(&self.event)?; @@ -463,7 +463,7 @@ pub fn verify_delivery( let event_source = envelope.source.as_str(); let value = serde_json::to_value(&envelope).map_err(|_| invalid_event())?; crate::functions::check_value(&value).map_err(|error| { - if error.code == "function.value-limit" { + if error.code == "transform.value-limit" { event_too_large() } else { invalid_event() diff --git a/crates/registry-coordinator/src/event_trigger_tests.rs b/crates/registry-coordinator/src/event_trigger_tests.rs index cfb13e052f..253cdf0ae4 100644 --- a/crates/registry-coordinator/src/event_trigger_tests.rs +++ b/crates/registry-coordinator/src/event_trigger_tests.rs @@ -666,7 +666,7 @@ fn a_function_used_only_by_an_event_trigger_is_hash_covered() { let workflow = project_text() .replace( "workflow:\n input:", - r#"functions: + r#"transforms: event-input: runtime: rhai source: functions.rhai @@ -687,8 +687,8 @@ workflow: fields: recordId: {type: input, path: /data/recordId}"#, r#" input: - type: function - function: event-input + type: transform + transform: event-input inputs: event: {type: input}"#, ); diff --git a/crates/registry-coordinator/src/external_http.rs b/crates/registry-coordinator/src/external_http.rs index 0bc397e345..c6fa2cb42a 100644 --- a/crates/registry-coordinator/src/external_http.rs +++ b/crates/registry-coordinator/src/external_http.rs @@ -275,7 +275,7 @@ impl ExternalHttpConnection { /// so the same command can still be retried. A `Retry-After` either /// answer carries that the command cannot use is ignored. Only a status /// `command_status` classifies as interpreted reaches the operation's - /// pinned interpretation Function, which receives the response. + /// pinned interpretation Transform, which receives the response. pub async fn command( &self, input: &Value, @@ -478,12 +478,12 @@ impl ExternalHttpConnection { /// What an `external.command/v1` attempt does with the provider's HTTP status /// before any body is read. Only [`CommandStatus::Interpreted`] reaches the -/// operation's interpretation Function; scenario checks use the same -/// classification, so a synthetic response reply cannot show the Function +/// operation's interpretation Transform; scenario checks use the same +/// classification, so a synthetic response reply cannot show the Transform /// reading a status the worker never hands it. #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub(crate) enum CommandStatus { - /// The bounded response goes to the interpretation Function. + /// The bounded response goes to the interpretation Transform. Interpreted, /// A redirect is never followed. It may answer an accepted command, so /// the command is uncertain. @@ -512,8 +512,8 @@ pub(crate) fn command_status(status: reqwest::StatusCode) -> CommandStatus { } /// Interpret one provider response to an `external.command/v1` call with the -/// project's pinned pure Function. The response is held to its declared -/// schema before the Function reads it. Anything the Function cannot turn into +/// project's pinned pure Transform. The response is held to its declared +/// schema before the Transform reads it. Anything the Transform cannot turn into /// an accepted result or a declared refusal leaves the command uncertain, /// never failed: the provider may already have applied it. No code carries a /// response or command value. diff --git a/crates/registry-coordinator/src/functions.rs b/crates/registry-coordinator/src/functions.rs index c0e567043d..dc068f2a06 100644 --- a/crates/registry-coordinator/src/functions.rs +++ b/crates/registry-coordinator/src/functions.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -//! Pure functions under one pinned, bounded interpreter profile. +//! Pure Transforms under one pinned, bounded interpreter profile. use crate::definition::{compile_schema, FunctionDefinition}; use chrono::{DateTime, Datelike, SecondsFormat, TimeDelta, Utc}; @@ -55,7 +55,7 @@ const PROFILE: RhaiProfile = RhaiProfile { }; #[derive(Clone)] -pub(crate) struct Functions { +pub(crate) struct Transforms { entries: BTreeMap, } @@ -83,7 +83,7 @@ fn profile(function: &FunctionDefinition) -> RhaiProfile { } } -impl Functions { +impl Transforms { pub(crate) fn compile( sources: &BTreeMap, definitions: &BTreeMap, @@ -96,7 +96,7 @@ impl Functions { let result = (|| { let source = sources .get(&function.source) - .ok_or_else(|| failure("function.definition"))?; + .ok_or_else(|| failure("transform.definition"))?; let limits = &function.limits; let ceiling = crate::definition::FunctionLimits::default(); if function.runtime != "rhai" @@ -119,20 +119,20 @@ impl Functions { || limits.source_bytes > ceiling.source_bytes || function.inputs.len() > 16 { - return Err(failure("function.limits") - .at("workflow.yaml", format!("/functions/{name}/limits"))); + return Err(failure("transform.limits") + .at("workflow.yaml", format!("/transforms/{name}/limits"))); } let ast = platform::compile_entrypoint(&profile(function), source, &function.entrypoint, &[1]) .map_err(|error| match error { - platform::RhaiCompileError::SourceBound => failure("function.source-limit").at(&function.source, "/"), - platform::RhaiCompileError::Parse(position) if refused_only_for_curry(source) => CoordinatorError::new("function.definition", "function source uses `curry`, which Coordinator Functions do not offer") + platform::RhaiCompileError::SourceBound => failure("transform.source-limit").at(&function.source, "/"), + platform::RhaiCompileError::Parse(position) if refused_only_for_curry(source) => CoordinatorError::new("transform.definition", "Transform source uses `curry`, which Coordinator Transforms do not offer") .at(&function.source, format!("line {} column {}", position.line().unwrap_or(0), position.position().unwrap_or(0))) .suggest("Pass the value as an argument where the function is called, for example add(1, x) instead of Fn(\"add\").curry(1).call(x)."), - platform::RhaiCompileError::Parse(position) => CoordinatorError::new("function.definition", syntax_refusal(source)) + platform::RhaiCompileError::Parse(position) => CoordinatorError::new("transform.definition", syntax_refusal(source)) .at(&function.source, format!("line {} column {}", position.line().unwrap_or(0), position.position().unwrap_or(0))) - .suggest("Correct the named Function source syntax and rerun check."), - platform::RhaiCompileError::Entrypoint => CoordinatorError::new("function.definition", "the Function entrypoint must name one public Rhai function taking one named-input object") - .at("workflow.yaml", format!("/functions/{name}/entrypoint")) + .suggest("Correct the named Transform source syntax and rerun check."), + platform::RhaiCompileError::Entrypoint => CoordinatorError::new("transform.definition", "the Transform entrypoint must name one public Rhai function taking one named-input object") + .at("workflow.yaml", format!("/transforms/{name}/entrypoint")) .suggest("Declare one public function with exactly one parameter for its named input object."), })?; let mut names = std::collections::BTreeSet::new(); @@ -141,7 +141,7 @@ impl Functions { .any(|function| !names.insert(function.name.to_owned())) || names.len() > 128 { - return Err(failure("function.definition").at(&function.source, "/")); + return Err(failure("transform.definition").at(&function.source, "/")); } let properties = function .inputs @@ -160,8 +160,8 @@ impl Functions { let output = std::sync::Arc::new(compile_schema(&function.output)?); let revision = revision(function, source)?; if function.revision != revision { - return Err(failure("function.revision") - .at("workflow.yaml", format!("/functions/{name}"))); + return Err(failure("transform.revision") + .at("workflow.yaml", format!("/transforms/{name}"))); } Ok(CompiledFunction { definition: function.clone(), @@ -172,7 +172,7 @@ impl Functions { })(); match result { Ok(compiled) => { - // Functions share one source, so each walk finds the same + // Transforms share one source, so each walk finds the same // calls; a call is reported once, at its position. let unknown = unknown_calls(&compiled); if unknown.is_empty() { @@ -203,46 +203,46 @@ impl Functions { let function = self .entries .get(name) - .ok_or_else(|| failure("function.definition"))?; + .ok_or_else(|| failure("transform.definition"))?; check_value(inputs)?; if !function.input.is_valid(inputs) { return Err(contract_failure( name, - "function.input", + "transform.input", &function.input, inputs, synthetic, )); } let arguments = - vec![rhai::serde::to_dynamic(inputs).map_err(|_| failure("function.input"))?]; + vec![rhai::serde::to_dynamic(inputs).map_err(|_| failure("transform.input"))?]; let engine = platform::build_engine(&profile(&function.definition), None, register_pure_packages); let value = platform::call_with_fresh_scope(&engine, &function.ast, &function.definition.entrypoint, arguments) .map_err(|error| { let refusal = failure(match platform::classify_failure(&error) { - platform::RhaiFailureCategory::ResourceExhausted => "function.resource-limit", - platform::RhaiFailureCategory::Other => "function.execution", + platform::RhaiFailureCategory::ResourceExhausted => "transform.resource-limit", + platform::RhaiFailureCategory::Other => "transform.execution", }); - if synthetic { CoordinatorError { message: format!("function {name} failed: {}", located(&function.definition.entrypoint, &error)), ..refusal } - .suggest(format!("Correct Function {name} in {} at the named position, or correct its synthetic inputs.", function.definition.source)) } + if synthetic { CoordinatorError { message: format!("Transform {name} failed: {}", located(&function.definition.entrypoint, &error)), ..refusal } + .suggest(format!("Correct Transform {name} in {} at the named position, or correct its synthetic inputs.", function.definition.source)) } else { refusal } })?; if holds_non_finite(&value, 0) { - let refusal = failure("function.execution"); + let refusal = failure("transform.execution"); return Err(if synthetic { - CoordinatorError { message: format!("function {name} returned NaN or an infinite number, which has no JSON form"), ..refusal } - .suggest(format!("Correct Function {name} so it never divides by zero or takes the square root of a negative number; test with is_finite first.")) + CoordinatorError { message: format!("Transform {name} returned NaN or an infinite number, which has no JSON form"), ..refusal } + .suggest(format!("Correct Transform {name} so it never divides by zero or takes the square root of a negative number; test with is_finite first.")) } else { refusal }); } - let value = rhai::serde::from_dynamic(&value).map_err(|_| failure("function.output"))?; + let value = rhai::serde::from_dynamic(&value).map_err(|_| failure("transform.output"))?; check_value(&value)?; if !function.output.is_valid(&value) { return Err(contract_failure( name, - "function.output", + "transform.output", &function.output, &value, synthetic, @@ -263,21 +263,21 @@ fn contract_failure( if !synthetic { return refusal; } - let role = if code == "function.input" { + let role = if code == "transform.input" { "named inputs" } else { "output" }; let rule = crate::definition::schema_refusal(schema, value).unwrap_or_default(); - CoordinatorError {message:format!("function {name} returned a value of class {}; its declared {role} schema refuses it{rule}",crate::definition::class(value)),..refusal} - .suggest(format!("Correct Function {name} or its synthetic input mappings to satisfy the named signature rule.")) + CoordinatorError {message:format!("Transform {name} returned a value of class {}; its declared {role} schema refuses it{rule}",crate::definition::class(value)),..refusal} + .suggest(format!("Correct Transform {name} or its synthetic input mappings to satisfy the named signature rule.")) } pub(crate) fn revision(function: &FunctionDefinition, source: &str) -> Result { let semantic = serde_json::json!({"runtime":function.runtime,"profile":function.profile,"capabilities":function.capabilities,"abi":function.abi,"entrypoint":function.entrypoint, "inputs":function.inputs.iter().map(|(name,schema)| (name,crate::definition::semantic_schema(schema))).collect::>(),"output":crate::definition::semantic_schema(&function.output),"limits":function.limits,"valueLimits":value_limits(),"sourceDigest":registry_platform_config::sha256_uri(source.as_bytes())}); let bytes = registry_platform_canonical_json::canonicalize_json(&semantic) - .map_err(|_| failure("function.definition"))?; + .map_err(|_| failure("transform.definition"))?; Ok(registry_platform_config::sha256_uri(&bytes)) } @@ -349,7 +349,7 @@ fn syntax_refusal(source: &str) -> String { .err() .map(|error| format!(": {}", error.err_type())) .unwrap_or_default(); - format!("function source has invalid or disabled syntax{reason}") + format!("Transform source has invalid or disabled syntax{reason}") } /// Bound structured values before conversion and after execution as well as @@ -376,23 +376,23 @@ pub(crate) fn check_value(value: &Value) -> Result<()> { } } if !walk(value, 0, &mut 0) { - return Err(failure("function.value-limit")); + return Err(failure("transform.value-limit")); } let bytes = registry_platform_canonical_json::canonicalize_json(value) - .map_err(|_| failure("function.json"))?; + .map_err(|_| failure("transform.json"))?; if bytes.len() > MAXIMUM_VALUE_BYTES { - return Err(failure("function.value-limit")); + return Err(failure("transform.value-limit")); } Ok(()) } fn failure(code: &'static str) -> CoordinatorError { CoordinatorError::new(code, match code { - "function.resource-limit" => "the function exceeded its operation, call-depth or value-size budget", - "function.value-limit" => "the structured value exceeded its size or depth budget", - "function.execution" => "the function could not evaluate its supplied values", - "function.source-limit" => "functions.rhai exceeds the 65536-byte source budget", - _ => "the pure function boundary refused the definition or value", + "transform.resource-limit" => "the Transform exceeded its operation, call-depth or value-size budget", + "transform.value-limit" => "the structured value exceeded its size or depth budget", + "transform.execution" => "the Transform could not evaluate its supplied values", + "transform.source-limit" => "functions.rhai exceeds the 65536-byte source budget", + _ => "the pure Transform boundary refused the definition or value", }).suggest("Inspect the named mapping and reduce bounded work or correct its declared arguments; values are omitted.") } @@ -424,7 +424,7 @@ fn register_pure_packages(engine: &mut Engine) { /// every host: IEEE 754 arithmetic (`sqrt` is correctly rounded), rounding, /// parsing and conversion. The package's libm functions (`sin`, `exp`, `ln`, /// `hypot` and the like) are left out because their last digits depend on the -/// host's math library, and Function results are recomputed when waits replay. +/// host's math library, and Transform results are recomputed when waits replay. fn register_deterministic_math(engine: &mut Engine) { engine .register_fn("PI", || std::f64::consts::PI) @@ -643,7 +643,7 @@ const INTERPRETER_CALLS: [&str; 6] = [ "type_of", ]; -/// The names a Function may call: every callable the pure profile registers, +/// The names a Transform may call: every callable the pure profile registers, /// listed once from a real engine so the list cannot drift from what runs. /// Operators, property accessors and the symbols the profile disables are not /// calls an author writes by name. @@ -668,7 +668,7 @@ pub(crate) fn helpers() -> &'static BTreeSet { } /// Array methods that take a function by value or by name. A string literal -/// given to one of them names a Function to call. `index_of` and `contains` +/// given to one of them names a Transform to call. `index_of` and `contains` /// are left out: they search for the string. const CALLBACK_METHODS: [&str; 16] = [ "for_each", @@ -694,7 +694,7 @@ const NAMING_CALLS: [&str; 2] = ["Fn", "is_def_fn"]; /// One finding for each call, in `name`'s source, to a name that is neither a /// profile helper nor a function the source defines. Calls are matched by -/// name alone, so a wrong argument count still fails when the Function runs. +/// name alone, so a wrong argument count still fails when the Transform runs. /// A string literal given to `Fn`, `is_def_fn` or an array method such as /// `map` is read as a function name. A method call is skipped when the source /// also uses its name as a map key or property, since it may call a function @@ -761,14 +761,14 @@ fn unknown_calls(function: &CompiledFunction) -> Vec { _ => "/".to_owned(), }; CoordinatorError::new( - "function.unknown-call", + "transform.unknown-call", format!( "`{callee}` is not available: it is neither a helper of {PURE_PROFILE} nor a function defined in {}", function.definition.source ), ) .at(&function.definition.source, location) - .suggest("Call a listed helper, such as trim, split and starts_with for strings or parse_int and abs for numbers, or define the function in the same source; `coordinatorctl explain functions` lists every helper.") + .suggest("Call a listed helper, such as trim, split and starts_with for strings or parse_int and abs for numbers, or define the function in the same source; `coordinatorctl explain transforms` lists every helper.") }) .collect() } @@ -831,8 +831,8 @@ const HELPER_NOTES: [&str; 2] = [ "A top-level const is not visible inside a function: read it as global::NAME, or pass it as an input.", ]; -/// What `coordinatorctl explain functions` reports: the profile, its -/// interpreter ABI and limits, and every helper a Function may call. +/// What `coordinatorctl explain transforms` reports: the profile, its +/// interpreter ABI and limits, and every helper a Transform may call. pub(crate) fn explain() -> Value { json!({ "profile": PURE_PROFILE, @@ -874,7 +874,7 @@ fn instant_refused() -> Box { } /// Structured JSON custody limits, shared by every host Operation boundary. -/// These are distinct from a pure Function's narrowed interpreter limits. +/// These are distinct from a pure Transform's narrowed interpreter limits. pub(crate) fn value_limits() -> Value { serde_json::json!({ "maximumBytes": MAXIMUM_VALUE_BYTES, diff --git a/crates/registry-coordinator/src/http.rs b/crates/registry-coordinator/src/http.rs index 46776e612e..85ced4d8f8 100644 --- a/crates/registry-coordinator/src/http.rs +++ b/crates/registry-coordinator/src/http.rs @@ -1280,6 +1280,55 @@ mod problem_tests { } } + #[test] + fn openapi_uses_explicit_path_identifier_names() { + let document = openapi(); + let operations: [(&str, &str, &str, &[&str]); 8] = [ + ( + "/v1/workflows/{workflowId}", + "get", + "workflowContract", + &["workflowId"], + ), + ("/v1/runs/{runId}", "get", "runStatus", &["runId"]), + ("/v1/runs/{runId}/inspect", "get", "inspectRun", &["runId"]), + ("/v1/runs/{runId}/check", "post", "checkNow", &["runId"]), + ( + "/v1/runs/{runId}/retry-same", + "post", + "retrySame", + &["runId"], + ), + ("/v1/runs/{runId}/cancel", "post", "cancelRun", &["runId"]), + ( + "/v1/runs/{runId}/reconcile", + "post", + "reconcileRun", + &["runId"], + ), + ( + "/v1/events/{workflowId}/{triggerId}", + "post", + "admitEvent", + &["workflowId", "triggerId"], + ), + ]; + for (path, method, id, expected_names) in operations { + let operation = &document["paths"][path][method]; + assert_eq!(operation["operationId"], id, "{method} {path}"); + let parameters = operation["parameters"].as_array().unwrap(); + let names: Vec<_> = parameters + .iter() + .filter(|parameter| parameter["in"] == "path") + .map(|parameter| { + assert_eq!(parameter["required"], true, "{method} {path}"); + parameter["name"].as_str().unwrap() + }) + .collect(); + assert_eq!(names.as_slice(), expected_names, "{method} {path}"); + } + } + #[test] fn openapi_summarizes_every_operation_once() { let document = openapi(); @@ -1963,7 +2012,7 @@ const BODY_PROBLEMS: [ProblemCode; 3] = [ ProblemCode::RequestBodyTooLarge, ProblemCode::RequestUnsupportedMediaType, ]; -/// Every problem resolving the `{run}` path segment can answer. +/// Every problem resolving the `{runId}` path segment can answer. const RUN_PROBLEMS: [ProblemCode; 2] = [ProblemCode::RequestInvalid, ProblemCode::RunNotVisible]; /// Every problem a review completion sender can be answered with. const REVIEW_COMPLETION_PROBLEMS: [ProblemCode; 6] = [ @@ -2052,11 +2101,11 @@ fn summary(operation_id: &str) -> &'static str { pub fn openapi() -> Value { use ProblemCode as P; let run_state = json!({"type":"string","enum":["running","finished","failed","cancelled","cancelled-after-effect","expired","attention","cancel-requested"]}); - let run_param = json!({"name":"run","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}); + let run_param = json!({"name":"runId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}); let mut paths = serde_json::Map::new(); let operations: [DocumentedOperation; 15] = [ ( - "/v1/workflows/{workflow}", + "/v1/workflows/{workflowId}", "get", "workflowContract", None, @@ -2102,7 +2151,7 @@ pub fn openapi() -> Value { .concat(), ), ( - "/v1/runs/{run}", + "/v1/runs/{runId}", "get", "runStatus", None, @@ -2110,7 +2159,7 @@ pub fn openapi() -> Value { RUN_PROBLEMS.to_vec(), ), ( - "/v1/runs/{run}/inspect", + "/v1/runs/{runId}/inspect", "get", "inspectRun", None, @@ -2126,7 +2175,7 @@ pub fn openapi() -> Value { .concat(), ), ( - "/v1/runs/{run}/check", + "/v1/runs/{runId}/check", "post", "checkNow", Some("CheckNow"), @@ -2134,7 +2183,7 @@ pub fn openapi() -> Value { [&BODY_PROBLEMS[..], &RUN_PROBLEMS[..], &[P::CheckNotWaiting]].concat(), ), ( - "/v1/runs/{run}/retry-same", + "/v1/runs/{runId}/retry-same", "post", "retrySame", Some("Reason"), @@ -2157,7 +2206,7 @@ pub fn openapi() -> Value { .concat(), ), ( - "/v1/runs/{run}/cancel", + "/v1/runs/{runId}/cancel", "post", "cancelRun", Some("Reason"), @@ -2170,7 +2219,7 @@ pub fn openapi() -> Value { .concat(), ), ( - "/v1/runs/{run}/reconcile", + "/v1/runs/{runId}/reconcile", "post", "reconcileRun", Some("Reason"), @@ -2257,11 +2306,11 @@ pub fn openapi() -> Value { json!({"description":"Authorized result","content":{"application/json":{"schema":{"$ref":format!("#/components/schemas/{response}")}}}}), ); let mut op = json!({"operationId":id,"summary":summary(id),"security":[{"bearer":[]}],"responses":responses}); - if path.contains("{run}") { + if path.contains("{runId}") { op["parameters"] = json!([run_param.clone()]); } - if path.contains("{workflow}") { - op["parameters"] = json!([{"name":"workflow","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}]); + if path.contains("{workflowId}") { + op["parameters"] = json!([{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}]); } if id == "listRuns" { op["parameters"] = json!([ diff --git a/crates/registry-coordinator/src/http/admission_contracts.rs b/crates/registry-coordinator/src/http/admission_contracts.rs index bf951c8edc..6e640710dd 100644 --- a/crates/registry-coordinator/src/http/admission_contracts.rs +++ b/crates/registry-coordinator/src/http/admission_contracts.rs @@ -76,11 +76,11 @@ fn event_path(paths: &mut Map) { "description":"Run admission is committed, or the exact event was already admitted. Empty Hook response proposes no source mutation.", "headers":{"X-Coordinator-Run-Id":{"schema":{"type":"string","format":"uuid"}}} })); - let mut parameters = ["workflow", "trigger"].into_iter().map(|name| { + let mut parameters = ["workflowId", "triggerId"].into_iter().map(|name| { json!({"name":name,"in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}) }).collect::>(); parameters.extend(webhook_parameters()); - paths.insert("/v1/events/{workflow}/{trigger}".into(), json!({"post":{ + paths.insert("/v1/events/{workflowId}/{triggerId}".into(), json!({"post":{ "operationId":"admitEvent","summary":"Start a workflow from an authenticated product event", "description":"Accept at most 1048576 canonical JSON bytes in a HookEnvelope, then hold the admitted event to the 131072-byte structured value profile. Standard Webhooks signs the webhook ID, Unix timestamp and exact body using the key for the trigger in the URL. The signed timestamp must be within 300 seconds in either direction. The webhook ID must equal the envelope ID, and the envelope must match the configured producer URI and authored event type and data schema. The source URI, event ID and trigger bind admission across retries. Every downstream call uses its own product authorization.", "security":[{"eventSource":[]}],"parameters":parameters, diff --git a/crates/registry-coordinator/src/mapping_check.rs b/crates/registry-coordinator/src/mapping_check.rs index 942f4aa864..85cc38615d 100644 --- a/crates/registry-coordinator/src/mapping_check.rs +++ b/crates/registry-coordinator/src/mapping_check.rs @@ -70,17 +70,17 @@ fn check_step( if let Mapping::Function { function, inputs } = mapping { let signature = workflow.functions.get(function).ok_or_else(|| { authored( - "mapping.function", + "mapping.transform", &format!("{base}.function"), - "the named Function is not declared", - "Name one of the project's declared Functions.", + "the named Transform is not declared", + "Name one of the project's declared Transforms.", ) })?; if inputs.keys().ne(signature.inputs.keys()) { return Err(authored( - "mapping.function", + "mapping.transform", &format!("{base}.inputs"), - "the named Function inputs must match its declared signature exactly", + "the named Transform inputs must match its declared signature exactly", "Supply every declared input name once and remove undeclared names.", )); } @@ -192,7 +192,7 @@ fn schema_fits(target: &Value, read: &Read<'_>, field: &str) -> Result<()> { wanted.describe(), offered.describe() ), - "Select a value of the target type, or convert it with a typed Function.", + "Select a value of the target type, or convert it with a typed Transform.", )); } Ok(()) diff --git a/crates/registry-coordinator/src/problem.rs b/crates/registry-coordinator/src/problem.rs index f3ef8d6722..d94ab9f297 100644 --- a/crates/registry-coordinator/src/problem.rs +++ b/crates/registry-coordinator/src/problem.rs @@ -372,7 +372,7 @@ impl ProblemCode { } Self::CheckNotWaiting => "That step is not waiting.", Self::DefinitionRefused => { - "The workflow's workflow definition, one of its mappings or one of its functions refused the request." + "The workflow's workflow definition, one of its mappings or one of its Transforms refused the request." } Self::DeploymentActivationChanged => { "An apply changed the active packages after this service started. Restart it with the runtime file that apply used." @@ -529,7 +529,7 @@ pub(crate) fn for_error(code: &str) -> Option { } code if code.starts_with("definition.") || code.starts_with("mapping.") - || code.starts_with("function.") => + || code.starts_with("transform.") => { ProblemCode::DefinitionRefused } @@ -715,7 +715,7 @@ mod tests { ("deployment.refused", ProblemCode::DeploymentRefused), ("state-key-custody", ProblemCode::DeploymentRefused), ("mapping.branch", ProblemCode::DefinitionRefused), - ("function.arity", ProblemCode::DefinitionRefused), + ("transform.arity", ProblemCode::DefinitionRefused), ("mutation-uncertain", ProblemCode::MutationUncertain), ] { assert_eq!(for_error(internal), Some(public), "{internal}"); diff --git a/crates/registry-coordinator/src/protocol.rs b/crates/registry-coordinator/src/protocol.rs index 8ef9776dd0..49e2f14030 100644 --- a/crates/registry-coordinator/src/protocol.rs +++ b/crates/registry-coordinator/src/protocol.rs @@ -432,7 +432,7 @@ pub trait AdapterSet: Send + Sync { /// Observe a named completion of the exact accepted call. Both arguments /// are protected durable values. The host interprets bounded external - /// reads using the immutable Workflow Function, never an adapter script. + /// reads using the immutable Workflow Transform, never an adapter script. async fn observe_completion( &self, _request: &CallRequest, diff --git a/crates/registry-coordinator/src/read_in_force.rs b/crates/registry-coordinator/src/read_in_force.rs index eca262a4bb..0a19ca69a3 100644 --- a/crates/registry-coordinator/src/read_in_force.rs +++ b/crates/registry-coordinator/src/read_in_force.rs @@ -173,7 +173,7 @@ pub(crate) async fn read_in_force( } /// The subject fields a call names, when the mapping spells them out as a -/// literal or as nested fields. A subject built by a Function or read whole +/// literal or as nested fields. A subject built by a Transform or read whole /// from input is not known until the run. fn literal_subject_fields(input: &Mapping) -> Option> { let subject = match input { diff --git a/crates/registry-coordinator/src/scenarios.rs b/crates/registry-coordinator/src/scenarios.rs index 22261885f4..28b6c9405d 100644 --- a/crates/registry-coordinator/src/scenarios.rs +++ b/crates/registry-coordinator/src/scenarios.rs @@ -119,7 +119,7 @@ enum AuthoredReply { /// The product returned a package-declared, no-effect business refusal. /// A supported call takes its `onDeclaredRefusal` edge when it has one; /// otherwise the run stops as refused. An `external.command/v1` step - /// takes a `response` reply instead, which its interpretation Function + /// takes a `response` reply instead, which its interpretation Transform /// may turn into a declared refusal. DeclaredRefusal { /// The validated refusal code the package declares. @@ -132,9 +132,9 @@ enum AuthoredReply { code: LocalId, }, /// The provider answered an `external.command/v1` call with `value`. The - /// operation's pinned interpretation Function turns it into an accepted + /// operation's pinned interpretation Transform turns it into an accepted /// result, a declared refusal or an uncertain outcome, as it would at run - /// time. The status must be one the worker hands to that Function: a + /// time. The status must be one the worker hands to that Transform: a /// redirect, a 429 or a 5xx never reaches it, so a fixture models those /// with an `uncertain` or `retryable` reply. Response { @@ -210,7 +210,7 @@ enum AuthoredWait { value: ForeignValue, }, /// The host repeats the accepted external read and interprets these - /// synthetic typed responses under the completion's named Function. + /// synthetic typed responses under the completion's named Transform. Observations { /// One to 128 bounded response objects in observation order. #[cfg_attr(feature = "schema", schemars(length(min = 1, max = 128)))] @@ -939,7 +939,7 @@ fn execute(definition: &Definition, scenario: &Scenario) -> Result Result Result Result { terminal = Some(value); break; }, crate::protocol::CompletionObservation::Pending { .. } => { now += chrono::Duration::seconds(i64::from(*interval_seconds)); }, - _ => return Err(error("scenario.wait-observation", format!("/waits/{step}/responses/{index}"), "the pinned polling interpretation did not establish a valid observation", "Correct the interpretation Function and response correlation under the named completion contract.")), + _ => return Err(error("scenario.wait-observation", format!("/waits/{step}/responses/{index}"), "the pinned polling interpretation did not establish a valid observation", "Correct the interpretation Transform and response correlation under the named completion contract.")), } } if let Some(value) = terminal { @@ -1867,7 +1867,7 @@ fn disbursement_acceptance(value: &Value) -> Option String { } /// The status of a synthetic command response the worker would never hand to -/// the interpretation Function, with the reply that models what the worker +/// the interpretation Transform, with the reply that models what the worker /// does instead. The worker reads the status before any body, so a scenario -/// cannot show the Function reading a redirect, a 429 or a server failure. +/// cannot show the Transform reading a redirect, a 429 or a server failure. fn uninterpreted_status(response: &Value) -> Option<(String, &'static str)> { use crate::external_http::{command_status, CommandStatus}; let Some(status) = response diff --git a/crates/registry-coordinator/src/worker.rs b/crates/registry-coordinator/src/worker.rs index 4675f79121..e55e8f1fda 100644 --- a/crates/registry-coordinator/src/worker.rs +++ b/crates/registry-coordinator/src/worker.rs @@ -733,7 +733,7 @@ impl Worker { }, }; // A command's provider response becomes its step result only - // through the project's pinned interpretation Function. + // through the project's pinned interpretation Transform. let result = match result { CallOutcome::Success(response) if request.operation == crate::protocol::Operation::ExternalCommand => diff --git a/crates/registry-coordinator/tests/authored_project.rs b/crates/registry-coordinator/tests/authored_project.rs index 44e9355c97..ed49346dff 100644 --- a/crates/registry-coordinator/tests/authored_project.rs +++ b/crates/registry-coordinator/tests/authored_project.rs @@ -28,8 +28,8 @@ fn project() -> Value { "type": "finish", "outcome": "accepted", "output": { - "type": "function", - "function": "identity", + "type": "transform", + "transform": "identity", "inputs": { "arg0": { "type": "input" @@ -70,8 +70,8 @@ fn declared_refusal_project() -> Value { "type": "call", "operation": "invoke-breg-action", "input": { - "type": "function", - "function": "command", + "type": "transform", + "transform": "command", "inputs": { "arg0": { "type": "input" @@ -174,10 +174,10 @@ fn authored_project_converts_to_the_versioned_snapshot_abi() { fn project_check_keeps_a_positioned_duplicate_function_title_warning() { let root = tempfile::tempdir().unwrap(); let mut authored = declare_test_functions(&project()); - authored["functions"]["identity"]["label"] = json!("Identity function"); - let mut copy = authored["functions"]["identity"].clone(); + authored["transforms"]["identity"]["label"] = json!("Identity function"); + let mut copy = authored["transforms"]["identity"].clone(); copy["label"] = json!("identity function"); - authored["functions"]["identity-copy"] = copy; + authored["transforms"]["identity-copy"] = copy; let bytes = serde_json::to_vec(&authored).unwrap(); fs::write( root.path().join("functions.rhai"), @@ -191,10 +191,10 @@ fn project_check_keeps_a_positioned_duplicate_function_title_warning() { let finding = warnings .diagnostics() .iter() - .find(|diagnostic| diagnostic.code == "coordinator.project.duplicate-function-label") + .find(|diagnostic| diagnostic.code == "coordinator.project.duplicate-transform-label") .expect("the duplicate title warning survives project compilation"); - assert_eq!(finding.path, "/functions/identity-copy/label"); - assert_eq!(finding.related[0].path, "/functions/identity/label"); + assert_eq!(finding.path, "/transforms/identity-copy/label"); + assert_eq!(finding.related[0].path, "/transforms/identity/label"); assert!(finding.message.contains("`identity`")); assert!(finding.message.contains("`identity-copy`")); assert!(!finding.message.contains("Identity function")); @@ -204,10 +204,10 @@ fn project_check_keeps_a_positioned_duplicate_function_title_warning() { fn project_check_keeps_duplicate_title_warnings_beside_compile_errors() { let root = tempfile::tempdir().unwrap(); let mut authored = declare_test_functions(&project()); - authored["functions"]["identity"]["label"] = json!("Identity function"); - let mut copy = authored["functions"]["identity"].clone(); + authored["transforms"]["identity"]["label"] = json!("Identity function"); + let mut copy = authored["transforms"]["identity"].clone(); copy["label"] = json!("identity function"); - authored["functions"]["identity-copy"] = copy; + authored["transforms"]["identity-copy"] = copy; authored["workflow"]["steps"]["done"] = json!({ "type": "call", "operation": "missing-operation", @@ -220,7 +220,7 @@ fn project_check_keeps_duplicate_title_warnings_beside_compile_errors() { let error = authoring::parse_project(&path, fs::read(&path).unwrap()) .expect_err("the missing operation refuses compilation"); for code in [ - "coordinator.project.duplicate-function-label", + "coordinator.project.duplicate-transform-label", "coordinator.definition.operation", ] { assert!( @@ -237,7 +237,7 @@ fn project_check_keeps_duplicate_title_warnings_beside_compile_errors() { fn project_check_refuses_separator_lookalikes_in_the_function_namespace() { let root = tempfile::tempdir().unwrap(); let mut authored = project(); - authored["functions"] = json!({ + authored["transforms"] = json!({ "identity-fn": { "runtime": "rhai", "source": "functions.rhai", @@ -259,10 +259,10 @@ fn project_check_refuses_separator_lookalikes_in_the_function_namespace() { let finding = error .diagnostics .iter() - .find(|diagnostic| diagnostic.code == "coordinator.project.function-id-collision") + .find(|diagnostic| diagnostic.code == "coordinator.project.transform-id-collision") .expect("the function collision has its own finding"); - assert_eq!(finding.path, "/functions/identity_fn"); - assert_eq!(finding.related[0].path, "/functions/identity-fn"); + assert_eq!(finding.path, "/transforms/identity_fn"); + assert_eq!(finding.related[0].path, "/transforms/identity-fn"); assert!(finding.message.contains("`identity-fn`")); assert!(finding.message.contains("`identity_fn`")); } @@ -433,7 +433,7 @@ fn declared_refusal_is_available_only_on_its_edge_and_not_after_a_mixed_join() { .remove("refused"); joined["workflow"]["steps"]["joined"] = json!({ "type":"finish", "outcome":"joined", "output":{ - "type":"function", "function":"identity", "inputs": {"arg0": {"type":"step", "step":"act"}} + "type":"transform", "transform":"identity", "inputs": {"arg0": {"type":"step", "step":"act"}} } }); joined["workflow"]["outcomes"] = json!({"joined":{}}); @@ -569,7 +569,7 @@ fn reads_and_evaluations_accept_on_failure_but_mutations_refuse_it() { "apiVersion":"id.registrystack.org/formats/coordinator/project/v1alpha1", "kind":"CoordinatorProject", "project":{"id":"evaluation-failure-route","version":"1"}, - "functions":{"command":{ + "transforms":{"command":{ "runtime":"rhai","source":"functions.rhai","entrypoint":"command", "inputs":{"arg0":{"type":"object"}}, "output":{"operationInput":"evaluate"} @@ -579,7 +579,7 @@ fn reads_and_evaluations_accept_on_failure_but_mutations_refuse_it() { "input":{"type":"object"},"deadlineSeconds":60,"start":"act", "steps":{ "act":{"type":"call","operation":"evaluate", - "input":{"type":"function","function":"command","inputs":{"arg0":{"type":"input"}}}, + "input":{"type":"transform","transform":"command","inputs":{"arg0":{"type":"input"}}}, "next":"accepted","onFailure":"refused"}, "accepted":{"type":"finish","outcome":"accepted"}, "refused":{"type":"finish","outcome":"refused"} @@ -636,7 +636,7 @@ fn a_failure_route_has_no_call_output_and_names_a_declared_step() { project["workflow"]["steps"]["refused"] = json!({ "type":"finish", "outcome":"refused", - "output":{"type":"function","function":"identity","inputs":{"arg0":{"type":"step","step":"act"}}} + "output":{"type":"transform","transform":"identity","inputs":{"arg0":{"type":"step","step":"act"}}} }); project["workflow"]["outcomes"]["refused"] = json!({}); write_project(root.path(), &project, source); @@ -706,7 +706,7 @@ fn function_compile_diagnostics_keep_the_function_file_and_position() { .err() .expect("must refuse syntax"); let finding = &error.diagnostics[0]; - assert_eq!(finding.code, "coordinator.function.definition"); + assert_eq!(finding.code, "coordinator.transform.definition"); assert_eq!(finding.path, ""); let source = finding.source.as_ref().unwrap(); assert!(source.file.ends_with("functions.rhai")); @@ -746,7 +746,7 @@ fn linked_function_source_refusal_points_to_the_authored_reference() { .err() .expect("a linked source must refuse"); let finding = error.diagnostics.first().expect("a positioned finding"); - assert_eq!(finding.path, "/functions/identity/source"); + assert_eq!(finding.path, "/transforms/identity/source"); assert!(finding .source .as_ref() @@ -770,7 +770,7 @@ fn missing_function_source_keeps_the_operational_exit_and_authored_position() { .err() .expect("missing source must refuse"); assert_eq!(error.exit_code, 3); - assert_eq!(error.diagnostics[0].path, "/functions/identity/source"); + assert_eq!(error.diagnostics[0].path, "/transforms/identity/source"); assert!(error.diagnostics[0] .source .as_ref() @@ -786,7 +786,7 @@ fn execution_member_diagnostics_preserve_authored_step_names() { let mut project = project(); project["workflow"]["start"] = json!(name); project["workflow"]["steps"] = json!({name: { - "type":"wait-until", "waitUntil":{"type":"function", "function":"identity", "inputs": {"arg0": {"type":"input"}}}, + "type":"wait-until", "waitUntil":{"type":"transform", "transform":"identity", "inputs": {"arg0": {"type":"input"}}}, "next":"missing" }}); write_project( @@ -883,7 +883,7 @@ fn project_schema_matches_local_keys_bounds_and_foreign_schema_members() { assert!(schema["properties"].get("functionsFile").is_none()); for (pointer, minimum, maximum) in [ ("/properties/operations", 0, 64), - ("/properties/functions", 0, 128), + ("/properties/transforms", 0, 128), ("/properties/types", 0, 128), ("/$defs/AuthoredWorkflow/properties/steps", 1, 64), ("/$defs/AuthoredWorkflow/properties/outcomes", 1, 64), @@ -904,11 +904,11 @@ fn project_schema_matches_local_keys_bounds_and_foreign_schema_members() { .collect::>(); assert_eq!( tags, - ["function", "fields", "compare", "input", "step", "literal"] + ["transform", "fields", "compare", "input", "step", "literal"] ); let function = variants .iter() - .find(|variant| variant["properties"]["type"]["const"] == "function") + .find(|variant| variant["properties"]["type"]["const"] == "transform") .unwrap(); assert_eq!(function["properties"]["inputs"]["maxProperties"], 16); assert_eq!(schema["$defs"]["Fields"]["maxProperties"], 64); @@ -1111,9 +1111,9 @@ fn authoring_schemas_describe_every_member_and_form() { fn declare_test_functions(project: &Value) -> Value { fn mapping(value: &Value, functions: &mut serde_json::Map) { if let Some(object) = value.as_object() { - if object.get("type") == Some(&json!("function")) { + if object.get("type") == Some(&json!("transform")) { if let (Some(name), Some(inputs)) = ( - object.get("function").and_then(Value::as_str), + object.get("transform").and_then(Value::as_str), object.get("inputs").and_then(Value::as_object), ) { let signature = inputs @@ -1135,6 +1135,6 @@ fn declare_test_functions(project: &Value) -> Value { let mut project = project.clone(); let mut functions = serde_json::Map::new(); mapping(&project["workflow"]["steps"], &mut functions); - project["functions"] = Value::Object(functions); + project["transforms"] = Value::Object(functions); project } diff --git a/crates/registry-coordinator/tests/authoring.rs b/crates/registry-coordinator/tests/authoring.rs index 5dd36350b5..1244874aff 100644 --- a/crates/registry-coordinator/tests/authoring.rs +++ b/crates/registry-coordinator/tests/authoring.rs @@ -34,14 +34,14 @@ fn authored_value(source: &str) -> Value { } fn computed_workflow() -> String { let mut workflow = authored_value(WORKFLOW); - workflow["functions"]["send-after"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"send_after", + workflow["transforms"]["send-after"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"send_after", "inputs":{"input":{"typeRef":"workflow-input"}},"output":{"type":"string","format":"date-time"}}); - workflow["functions"]["read-request"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"read_request", + workflow["transforms"]["read-request"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"read_request", "inputs":{"input":{"typeRef":"workflow-input"}},"output":{"operationInput":"applications-read-record"}}); workflow["workflow"]["steps"]["due"]["waitUntil"] = - json!({"type":"function","function":"send-after","inputs":{"input":{"type":"input"}}}); + json!({"type":"transform","transform":"send-after","inputs":{"input":{"type":"input"}}}); workflow["workflow"]["steps"]["read-application"]["input"] = - json!({"type":"function","function":"read-request","inputs":{"input":{"type":"input"}}}); + json!({"type":"transform","transform":"read-request","inputs":{"input":{"type":"input"}}}); workflow.to_string() } fn computed_source() -> String { @@ -69,6 +69,44 @@ fn refused(result: registry_coordinator::Result) -> CoordinatorError } } +#[test] +fn authored_transforms_use_their_own_vocabulary_but_keep_the_frozen_snapshot_format() { + let authored = authored_value(WORKFLOW); + assert!(authored["transforms"]["notice-route"].is_object()); + assert!(authored.get("functions").is_none()); + let definition = fixture(); + let report = definition.explain().unwrap(); + assert!(report["transforms"]["notice-route"].is_object()); + assert!(report.get("functions").is_none()); + let permission = report["steps"] + .as_array() + .unwrap() + .iter() + .find(|step| step["id"] == "permission") + .unwrap(); + assert_eq!(permission["mapping"]["transform"], "notice-route"); + assert!(permission["mapping"].get("function").is_none()); + let snapshot = definition.snapshot().unwrap(); + let frozen: Value = serde_json::from_str(&snapshot).unwrap(); + assert!(frozen["workflow"]["functions"]["notice-route"].is_object()); + assert_eq!( + frozen["workflow"]["steps"]["permission"]["choose"]["function"], + "notice-route" + ); + let restored = Definition::from_snapshot(&snapshot).unwrap(); + assert_eq!(restored.snapshot().unwrap(), snapshot); + assert_eq!(restored.digest, definition.digest); +} + +#[test] +fn retired_function_declaration_points_to_transforms() { + let legacy = WORKFLOW.replace("\ntransforms:", "\nfunctions:"); + let error = refused(load(&legacy, SOURCE)); + assert!(error.diagnostics.iter().any(|diagnostic| { + diagnostic.path == "/functions" && diagnostic.suggested_action.contains("transforms") + })); +} + #[test] fn synthetic_fixture_maps_current_permission_and_receipt() { let definition = fixture(); @@ -121,14 +159,14 @@ fn synthetic_fixture_maps_current_permission_and_receipt() { fn shared_mapping_is_validated_only_for_the_executing_branch() { let workflow = json!({ "apiVersion":"id.registrystack.org/formats/coordinator/project/v1alpha1","kind":"CoordinatorProject","project":{"id":"shared-mapping","version":"1"}, - "functions":{ + "transforms":{ "branch":{"runtime":"rhai","source":"functions.rhai","entrypoint":"branch","inputs":{"input":{"type":"object"}},"output":{"type":"string","enum":["number","text"]}}, "value":{"runtime":"rhai","source":"functions.rhai","entrypoint":"value","inputs":{"input":{"type":"object"}},"output":{}} },"workflow":{"input":{"type":"object","required":["choice","value"],"properties":{"choice":{"enum":["number","text"]},"value":{}},"additionalProperties":false},"deadlineSeconds":3600,"start":"select", "steps":{ - "select":{"type":"choose","choose":{"type":"function","function":"branch","inputs":{"input":{"type":"input"}}},"cases":{"number":"finish-number","text":"finish-text"}}, - "finish-number":{"type":"finish","outcome":"number","output":{"type":"function","function":"value","inputs":{"input":{"type":"input"}}}}, - "finish-text":{"type":"finish","outcome":"text","output":{"type":"function","function":"value","inputs":{"input":{"type":"input"}}}} + "select":{"type":"choose","choose":{"type":"transform","transform":"branch","inputs":{"input":{"type":"input"}}},"cases":{"number":"finish-number","text":"finish-text"}}, + "finish-number":{"type":"finish","outcome":"number","output":{"type":"transform","transform":"value","inputs":{"input":{"type":"input"}}}}, + "finish-text":{"type":"finish","outcome":"text","output":{"type":"transform","transform":"value","inputs":{"input":{"type":"input"}}}} },"outcomes":{"number":{"type":"integer"},"text":{"type":"string"}}} }); let definition = load( @@ -283,7 +321,10 @@ fn bad_graphs_and_whole_value_references_refuse() { json!("arbitrary-http"), ), ("/workflow/deadlineSeconds", json!("é")), - ("/functions/notice-route/source", json!("../functions.rhai")), + ( + "/transforms/notice-route/source", + json!("../functions.rhai"), + ), ("/workflow/deadlineSeconds", json!("${DEADLINE}")), ] { let mut workflow = base.clone(); @@ -345,7 +386,7 @@ fn branch_timestamp_schema_and_missing_values_refuse_without_values() { let error = definition .evaluate("permission", &input(), &outputs) .unwrap_err(); - assert_eq!(error.code, "function.output"); + assert_eq!(error.code, "transform.output"); assert!(!error.to_string().contains(CANARY)); let definition = fixture(); assert_eq!( @@ -375,7 +416,7 @@ fn branch_timestamp_schema_and_missing_values_refuse_without_values() { .initial_due(&input(), instant("2026-10-09T09:00:00Z")) .unwrap_err() .code, - "function.output" + "transform.output" ); } @@ -390,7 +431,7 @@ fn pure_profile_has_no_clock_sleep_or_io_and_limits_computation() { &source.replace("input.sendAfter", expression), )); assert_eq!( - error.code, "coordinator.function.unknown-call", + error.code, "coordinator.transform.unknown-call", "{expression}" ); } @@ -405,7 +446,7 @@ fn pure_profile_has_no_clock_sleep_or_io_and_limits_computation() { .evaluate("due", &input(), &BTreeMap::new()) .unwrap_err() .code, - "function.resource-limit" + "transform.resource-limit" ); } let definition = load( @@ -636,14 +677,14 @@ fn resource_limits_include_recursion_input_values_and_non_object_commands() { .evaluate("due", &input(), &BTreeMap::new()) .unwrap_err() .code, - "function.resource-limit" + "transform.resource-limit" ); let definition = fixture(); let mut excessive = input(); excessive["sendAfter"] = json!("x".repeat(16385)); assert_eq!( definition.validate_input(&excessive).unwrap_err().code, - "function.value-limit" + "transform.value-limit" ); let definition = load( &workflow, @@ -658,7 +699,7 @@ fn resource_limits_include_recursion_input_values_and_non_object_commands() { .evaluate("read-application", &input(), &BTreeMap::new()) .unwrap_err() .code, - "function.output" + "transform.output" ); } @@ -721,10 +762,10 @@ fn authoring_diagnostics_locate_graph_reference_and_functions_without_runtime_va &source.replace("fn send_after(input)", "fn send_after(input, extra)"), )); // The step that calls the function is where the mismatch is placed. - assert_eq!(error.code, "coordinator.function.definition"); + assert_eq!(error.code, "coordinator.transform.definition"); assert_eq!( error.field.as_deref(), - Some("/functions/send-after/entrypoint") + Some("/transforms/send-after/entrypoint") ); assert!(error.diagnostics[0] .source diff --git a/crates/registry-coordinator/tests/authoring_findings.rs b/crates/registry-coordinator/tests/authoring_findings.rs index 61298639b1..84213d3742 100644 --- a/crates/registry-coordinator/tests/authoring_findings.rs +++ b/crates/registry-coordinator/tests/authoring_findings.rs @@ -172,7 +172,7 @@ fn a_function_returning_an_undeclared_label_is_reported_at_its_step_by_check_and let findings = check["diagnostics"].as_array().unwrap(); assert_eq!(findings.len(), 1, "{check}"); let finding = &findings[0]; - assert_eq!(finding["code"], "coordinator.function.output"); + assert_eq!(finding["code"], "coordinator.transform.output"); assert_eq!(finding["path"], "/workflow/steps/permission/choose"); assert!(finding["source"]["file"] .as_str() @@ -181,7 +181,7 @@ fn a_function_returning_an_undeclared_label_is_reported_at_its_step_by_check_and assert_eq!(finding["source"]["line"], workflow_line("choose:") + 1); let message = finding["message"].as_str().unwrap(); for expected in [ - "function notice-route returned a value of class string", + "Transform notice-route returned a value of class string", "declared output schema refuses it", ] .into_iter() @@ -215,14 +215,14 @@ fn a_rhai_failure_names_its_kind_and_position_offline() { let (check, test) = refused(&root); assert_eq!(check["diagnostics"], test["diagnostics"], "{check}\n{test}"); let finding = &check["diagnostics"][0]; - assert_eq!(finding["code"], "coordinator.function.execution"); + assert_eq!(finding["code"], "coordinator.transform.execution"); assert_eq!(finding["path"], "/workflow/steps/permission/choose"); assert_eq!(finding["source"]["line"], workflow_line("choose:") + 1); let message = finding["message"].as_str().unwrap(); // The kind of failure and its position in functions.rhai, never the // engine's own words, which may repeat the values it was given. assert!( - message.contains("function notice-route failed: a property is missing in function notice_route at line 6, column "), + message.contains("Transform notice-route failed: a property is missing in function notice_route at line 6, column "), "{message}" ); assert!(!message.contains("member"), "{message}"); @@ -245,10 +245,10 @@ fn a_thrown_rhai_error_names_its_kind_and_position_but_no_value() { let (check, test) = refused(&root); assert_eq!(check["diagnostics"], test["diagnostics"], "{check}\n{test}"); let finding = &check["diagnostics"][0]; - assert_eq!(finding["code"], "coordinator.function.execution"); + assert_eq!(finding["code"], "coordinator.transform.execution"); let message = finding["message"].as_str().unwrap(); assert!( - message.contains("function notice-route failed: an error was thrown in function notice_route at line 6, column "), + message.contains("Transform notice-route failed: an error was thrown in function notice_route at line 6, column "), "{message}" ); assert_unrepeated(&root, &[MARKER, RECORD_ID]); @@ -273,7 +273,7 @@ fn a_failure_in_a_called_function_is_placed_in_that_function() { let message = check["diagnostics"][0]["message"].as_str().unwrap(); assert!( message.contains( - "function notice-route failed: an error was thrown in function helper at line 10, column 5" + "Transform notice-route failed: an error was thrown in function helper at line 10, column 5" ), "{message}" ); @@ -548,18 +548,18 @@ fn a_refused_step_value_is_named_by_its_class_and_rule_never_by_value() { let mut functions = FUNCTIONS.to_owned(); let expected = match kind { "wait" => { - workflow["functions"]["send-after"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"send_after","inputs":{"input":{"typeRef":"workflow-input"}},"output":{"type":"string"}}); - workflow["workflow"]["steps"]["due"]["waitUntil"] = json!({"type":"function","function":"send-after","inputs":{"input":{"type":"input"}}}); + workflow["transforms"]["send-after"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"send_after","inputs":{"input":{"typeRef":"workflow-input"}},"output":{"type":"string"}}); + workflow["workflow"]["steps"]["due"]["waitUntil"] = json!({"type":"transform","transform":"send-after","inputs":{"input":{"type":"input"}}}); functions.push_str(&format!( "\nfn send_after(args) {{ \"{MARKER}\" + args.input.applicationId }}" )); - "function send-after returned a value of class string; expected an RFC 3339 instant with an offset" + "Transform send-after returned a value of class string; expected an RFC 3339 instant with an offset" } "finish" => { - workflow["functions"]["accepted-output"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"accepted_output","inputs":{"input":{"typeRef":"workflow-input"}},"output":{"type":"object"}}); - workflow["workflow"]["steps"]["accepted"]["output"] = json!({"type":"function","function":"accepted-output","inputs":{"input":{"type":"input"}}}); + workflow["transforms"]["accepted-output"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"accepted_output","inputs":{"input":{"typeRef":"workflow-input"}},"output":{"type":"object"}}); + workflow["workflow"]["steps"]["accepted"]["output"] = json!({"type":"transform","transform":"accepted-output","inputs":{"input":{"type":"input"}}}); functions.push_str(&format!("\nfn accepted_output(args) {{ #{{messageId: \"{MARKER}\" + args.input.applicationId}} }}")); - "function accepted-output returned a value of class object; the message-accepted outcome schema refuses it at /messageId by its rule /properties/messageId/format" + "Transform accepted-output returned a value of class object; the message-accepted outcome schema refuses it at /messageId by its rule /properties/messageId/format" } _ => { fs::write( @@ -747,13 +747,13 @@ fn a_connection_name_is_bound_at_deployment_and_changes_the_semantic_revision() #[test] fn an_unknown_function_is_reported_at_its_step_with_the_declared_functions() { let mut workflow = authored_value(); - workflow["workflow"]["steps"]["notify"]["input"]["function"] = json!("notice-reqest"); + workflow["workflow"]["steps"]["notify"]["input"]["transform"] = json!("notice-reqest"); let findings = checked_value(workflow); assert_eq!(findings.len(), 1); finding( &findings, - "/workflow/steps/notify/input/function", - "coordinator.mapping.function", + "/workflow/steps/notify/input/transform", + "coordinator.mapping.transform", &["notice-reqest", "notice-request", "notice-route"], ); } @@ -770,8 +770,8 @@ fn a_function_called_with_the_wrong_inputs_is_reported_at_its_step() { finding( &findings, "/workflow/steps/notify/input/inputs", - "coordinator.mapping.function", - &["named Function inputs", "signature"], + "coordinator.mapping.transform", + &["named Transform inputs", "signature"], ); } @@ -855,7 +855,7 @@ fn authored_semantic_errors_and_warnings_share_one_file_budget() { fn check_reports_every_independent_error_in_one_run() { let mut workflow = authored_value(); workflow["workflow"]["start"] = json!("begin"); - workflow["workflow"]["steps"]["permission"]["choose"]["function"] = json!("notice-rout"); + workflow["workflow"]["steps"]["permission"]["choose"]["transform"] = json!("notice-rout"); workflow["workflow"]["steps"]["skipped"]["outcome"] = json!("no-permission"); let findings = checked_value(workflow); let mut paths = findings @@ -868,7 +868,7 @@ fn check_reports_every_independent_error_in_one_run() { [ "/workflow/outcomes/no-current-permission", "/workflow/start", - "/workflow/steps/permission/choose/function", + "/workflow/steps/permission/choose/transform", "/workflow/steps/skipped/outcome" ], "{findings:#?}" diff --git a/crates/registry-coordinator/tests/breg_action_native.rs b/crates/registry-coordinator/tests/breg_action_native.rs index d0c6dc75cd..cf80d52ccb 100644 --- a/crates/registry-coordinator/tests/breg_action_native.rs +++ b/crates/registry-coordinator/tests/breg_action_native.rs @@ -390,7 +390,7 @@ types: operations: act: {uses: breg.invoke-action/v1, connection: applications, action: {contract: source, id: update-item}} notify: {uses: messaging.submit-message/v1, connection: notices} -functions: +transforms: action_request: runtime: rhai source: functions.rhai @@ -417,17 +417,17 @@ workflow: act: type: call operation: act - input: {type: function, function: action_request, inputs: {input: {type: input}}} + input: {type: transform, transform: action_request, inputs: {input: {type: input}}} next: notify notify: type: call operation: notify - input: {type: function, function: notice_request, inputs: {action: {type: step, step: act}}} + input: {type: transform, transform: notice_request, inputs: {action: {type: step, step: act}}} next: done done: type: finish outcome: accepted - output: {type: function, function: result, inputs: {action: {type: step, step: act}, notice: {type: step, step: notify}}} + output: {type: transform, transform: result, inputs: {action: {type: step, step: act}, notice: {type: step, step: notify}}} outcomes: accepted: {typeRef: accepted-output} "#).unwrap(); diff --git a/crates/registry-coordinator/tests/canonical_model.rs b/crates/registry-coordinator/tests/canonical_model.rs index 69c54e5720..34ccf333af 100644 --- a/crates/registry-coordinator/tests/canonical_model.rs +++ b/crates/registry-coordinator/tests/canonical_model.rs @@ -10,10 +10,10 @@ fn project() -> Value { "project": {"id":"typed-workflow","version":"1"}, "types": {"request": {"type":"object","additionalProperties":false,"required":["text"], "properties":{"text":{"type":"string"}}}}, - "functions": {"render": {"runtime":"rhai","source":"functions.rhai","entrypoint":"render", + "transforms": {"render": {"runtime":"rhai","source":"functions.rhai","entrypoint":"render", "inputs":{"request":{"typeRef":"request"}},"output":{"type":"string"}}}, "workflow": {"input":{"typeRef":"request"},"deadlineSeconds":3600,"start":"done", - "steps":{"done":{"type":"finish","outcome":"rendered","output":{"type":"function","function":"render","inputs":{"request":{"type":"input"}}}}}, + "steps":{"done":{"type":"finish","outcome":"rendered","output":{"type":"transform","transform":"render","inputs":{"request":{"type":"input"}}}}}, "outcomes":{"rendered":{"type":"string"}}} }) } @@ -57,7 +57,7 @@ fn named_function_inputs_are_typed_and_the_snapshot_restores_without_sources() { let error = definition .evaluate("done", &json!({"text":42}), &BTreeMap::new()) .unwrap_err(); - assert_eq!(error.code, "function.input"); + assert_eq!(error.code, "transform.input"); assert!(!error.message.contains("42")); } @@ -69,10 +69,10 @@ fn presentation_version_and_unreferenced_definitions_do_not_change_workflow_revi edited["project"]["description"] = json!("Shows a text."); edited["project"]["version"] = json!("next"); edited["workflow"]["steps"]["done"]["label"] = json!("Show the text"); - edited["functions"]["render"]["label"] = json!("Render a notice"); + edited["transforms"]["render"]["label"] = json!("Render a notice"); edited["types"]["request"]["properties"]["text"]["description"] = json!("Public text"); edited["types"]["unrelated"] = json!({"type":"integer"}); - edited["functions"]["unrelated"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"render", + edited["transforms"]["unrelated"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"render", "inputs":{"ignored":{"type":"integer"}},"output":{"type":"string"}}); let edited = load(&edited, SOURCE).unwrap(); assert_eq!(initial.digest, edited.digest); @@ -150,14 +150,14 @@ fn an_event_trigger_label_and_description_do_not_change_workflow_revision() { fn a_title_is_refused_with_label_as_its_replacement() { for (pointer, set) in [ ("/title", "project"), - ("/functions/render/title", "function"), + ("/transforms/render/title", "transform"), ("/workflow/steps/done/title", "step"), ("/operations/read-job/title", "operation"), ] { let mut edited = project(); match set { "project" => edited["title"] = json!("Readable workflow"), - "function" => edited["functions"]["render"]["title"] = json!("Render a notice"), + "transform" => edited["transforms"]["render"]["title"] = json!("Render a notice"), "operation" => { edited["operations"] = json!({"read-job":{"title":"Read the job","uses":"external.get/v1","connection":"jobs"}}); } @@ -185,11 +185,11 @@ fn changed_function_code_or_limits_changes_workflow_revision() { .digest ); let mut edited = project(); - edited["functions"]["render"]["limits"] = json!({"operations":500}); + edited["transforms"]["render"]["limits"] = json!({"operations":500}); let edited = load(&edited, SOURCE).unwrap(); assert_ne!(initial.digest, edited.digest); assert_eq!( - edited.explain().unwrap()["functions"]["render"]["limits"]["operations"], + edited.explain().unwrap()["transforms"]["render"]["limits"]["operations"], 500 ); } @@ -207,7 +207,7 @@ fn signature_names_and_closed_output_are_enforced_without_rendering_values() { let error = definition .evaluate("done", &json!({"text":"private-canary"}), &BTreeMap::new()) .unwrap_err(); - assert_eq!(error.code, "function.output"); + assert_eq!(error.code, "transform.output"); assert!(!error.message.contains("private-canary")); } @@ -225,8 +225,8 @@ fn schema_references_resolve_nested_properties_and_preserve_reference_sites() { ); assert!(references["/workflow/input/typeRef"]["source"]["line"].is_number()); assert_eq!( - references["/workflow/steps/done/output/function"]["target"], - "/functions/render" + references["/workflow/steps/done/output/transform"]["target"], + "/transforms/render" ); } @@ -255,13 +255,13 @@ fn schema_cycles_mixtures_and_undeclared_references_point_to_authored_fields() { #[test] fn the_default_profile_has_no_clock_and_narrowing_cannot_widen_it() { let error = refused(&project(), "fn render(inputs) { timestamp().to_string() }"); - assert_eq!(error.code, "coordinator.function.unknown-call"); + assert_eq!(error.code, "coordinator.transform.unknown-call"); let mut edited = project(); - edited["functions"]["render"]["limits"] = json!({"operations":100001}); + edited["transforms"]["render"]["limits"] = json!({"operations":100001}); let error = refused(&edited, SOURCE); assert_eq!( error.diagnostics[0].path, - "/functions/render/limits/operations" + "/transforms/render/limits/operations" ); assert_eq!(error.diagnostics[0].code, "config.out-of-range"); } @@ -287,7 +287,7 @@ fn poll_completion_uses_base_schemas_then_resolves_typed_terminal_output() { let mut edited = project(); edited["operations"] = json!({"read-job":{"uses":"external.get/v1","connection":"jobs","responseSchema":{"type":"object","required":["status","body"],"additionalProperties":false,"properties":{"status":{"type":"integer"},"body":{"type":"object"}}}, "completions":{"terminal":{"type":"bounded-poll","interpret":"observe","intervalSeconds":30}}}}); - edited["functions"] = json!({"observe":{"runtime":"rhai","source":"functions.rhai","entrypoint":"observe", + edited["transforms"] = json!({"observe":{"runtime":"rhai","source":"functions.rhai","entrypoint":"observe", "inputs":{"command":{"operationInput":"read-job"},"response":{"operationOutput":"read-job"}},"output":{"oneOf":[ {"type":"object","additionalProperties":false,"required":["state"],"properties":{"state":{"type":"string","const":"pending"}}}, {"type":"object","additionalProperties":false,"required":["state","result"],"properties":{"state":{"type":"string","const":"complete"},"result":{"type":"string"}}}, @@ -341,7 +341,7 @@ fn poll_completion_uses_base_schemas_then_resolves_typed_terminal_output() { assert!(definition .validate_outcome("terminal", &json!({"state":"pending"})) .is_err()); - edited["functions"]["observe"]["output"]["oneOf"][1]["title"] = + edited["transforms"]["observe"]["output"]["oneOf"][1]["title"] = json!("A successful job observation"); let retitled = load(&edited, "fn observe(inputs) { #{state: \"pending\"} }").unwrap(); assert_eq!(definition.digest, retitled.digest); @@ -350,7 +350,7 @@ fn poll_completion_uses_base_schemas_then_resolves_typed_terminal_output() { "type":"object","required":["id"],"additionalProperties":false, "properties":{"id":{"$ref":"#/$defs/identifier"}} }); - edited["functions"]["observe"]["output"]["oneOf"][1]["properties"]["result"] = + edited["transforms"]["observe"]["output"]["oneOf"][1]["properties"]["result"] = json!({"typeRef":"job-result"}); let referenced = load(&edited, "fn observe(inputs) { #{state: \"pending\"} }").unwrap(); referenced @@ -371,10 +371,10 @@ fn poll_completion_uses_base_schemas_then_resolves_typed_terminal_output() { restored .validate_outcome("terminal", &json!({"state":"refused","code":"job-failed"})) .unwrap(); - edited["functions"]["observe"]["output"] = + edited["transforms"]["observe"]["output"] = json!({"completionOutput":{"operation":"read-job","name":"terminal"}}); let error = refused(&edited, "fn observe(inputs) { #{state: \"pending\"} }"); - assert_eq!(error.diagnostics[0].path, "/functions/observe/output"); + assert_eq!(error.diagnostics[0].path, "/transforms/observe/output"); } #[cfg(feature = "schema")] @@ -397,7 +397,7 @@ fn whole_schema_references_rebase_local_definitions_when_embedded() { "$defs":{"text":{"type":"string","minLength":2}}, "properties":{"value":{"$ref":"#/$defs/text"}}}); edited["types"]["request"]["properties"]["text"] = json!({"typeRef":"message"}); - edited["functions"]["render"]["output"] = json!({"typeRef":"message"}); + edited["transforms"]["render"]["output"] = json!({"typeRef":"message"}); edited["workflow"]["outcomes"]["rendered"] = json!({"typeRef":"message"}); let definition = load(&edited, SOURCE).unwrap(); assert!(definition @@ -416,7 +416,7 @@ fn whole_schema_references_rebase_local_definitions_when_embedded() { #[test] fn function_source_assets_cannot_escape_the_project() { let mut edited = project(); - edited["functions"]["render"]["source"] = json!("../outside.rhai"); + edited["transforms"]["render"]["source"] = json!("../outside.rhai"); let error = refused(&edited, SOURCE); assert!(error.message.contains("relative path")); } diff --git a/crates/registry-coordinator/tests/cli_authoring.rs b/crates/registry-coordinator/tests/cli_authoring.rs index 81df08b754..fc36973895 100644 --- a/crates/registry-coordinator/tests/cli_authoring.rs +++ b/crates/registry-coordinator/tests/cli_authoring.rs @@ -201,7 +201,7 @@ fn init_check_and_explain_work_without_database_or_signing_keys() { ]); assert!(explained.status.success()); let result: Value = serde_json::from_slice(&explained.stdout).unwrap(); - assert!(result["functions"] + assert!(result["transforms"] .as_object() .unwrap() .values() diff --git a/crates/registry-coordinator/tests/external_command_project.rs b/crates/registry-coordinator/tests/external_command_project.rs index a2dd79412d..16b5ef7a7b 100644 --- a/crates/registry-coordinator/tests/external_command_project.rs +++ b/crates/registry-coordinator/tests/external_command_project.rs @@ -249,17 +249,17 @@ fn the_interpretation_takes_the_command_and_its_bounded_response() { #[test] fn the_interpretation_declares_accepted_and_only_known_states() { let findings = refused(&[("const: accepted", "const: complete")]); - finding(&findings, "/functions/bill-outcome/output", &["accepted"]); + finding(&findings, "/transforms/bill-outcome/output", &["accepted"]); let findings = refused(&[("enum: [account-closed]", "minLength: 1")]); finding( &findings, - "/functions/bill-outcome/output", + "/transforms/bill-outcome/output", &["closed enum"], ); let findings = refused(&[("const: uncertain", "const: pending")]); - finding(&findings, "/functions/bill-outcome/output", &["uncertain"]); + finding(&findings, "/transforms/bill-outcome/output", &["uncertain"]); } #[test] diff --git a/crates/registry-coordinator/tests/fixtures/external-command/workflow.yaml b/crates/registry-coordinator/tests/fixtures/external-command/workflow.yaml index a2207e13fe..93f1742130 100644 --- a/crates/registry-coordinator/tests/fixtures/external-command/workflow.yaml +++ b/crates/registry-coordinator/tests/fixtures/external-command/workflow.yaml @@ -50,7 +50,7 @@ types: properties: state: {type: string, const: uncertain} -functions: +transforms: bill-request: runtime: rhai source: functions.rhai @@ -84,8 +84,8 @@ workflow: type: call operation: create-bill input: - type: function - function: bill-request + type: transform + transform: bill-request inputs: request: {type: input} next: billed diff --git a/crates/registry-coordinator/tests/fixtures/review-wait/workflow.yaml b/crates/registry-coordinator/tests/fixtures/review-wait/workflow.yaml index 6285eec536..3acfdfe8f6 100644 --- a/crates/registry-coordinator/tests/fixtures/review-wait/workflow.yaml +++ b/crates/registry-coordinator/tests/fixtures/review-wait/workflow.yaml @@ -14,7 +14,7 @@ types: applicationVersion: {type: string, minLength: 1, maxLength: 64} applicationDigest: {type: string, pattern: "^sha256:[0-9a-f]{64}$"} email: {type: string, format: email} -functions: +transforms: review-request: runtime: rhai source: functions.rhai @@ -41,7 +41,7 @@ workflow: submit-review: type: call operation: submit-review-request - input: {type: function, function: review-request, inputs: {input: {type: input}}} + input: {type: transform, transform: review-request, inputs: {input: {type: input}}} next: await-review await-review: type: wait-for @@ -62,7 +62,7 @@ workflow: notify: type: call operation: submit-message - input: {type: function, function: notice-request, inputs: {input: {type: input}, result: {type: step, step: await-review}}} + input: {type: transform, transform: notice-request, inputs: {input: {type: input}, result: {type: step, step: await-review}}} next: notice-sent notice-sent: type: finish diff --git a/crates/registry-coordinator/tests/helper_functions.rs b/crates/registry-coordinator/tests/helper_functions.rs index a6f3ad9342..2b85025ef4 100644 --- a/crates/registry-coordinator/tests/helper_functions.rs +++ b/crates/registry-coordinator/tests/helper_functions.rs @@ -10,12 +10,12 @@ fn write_project(root: &Path, source: &str) { let workflow = json!({ "apiVersion": authoring::API_VERSION, "kind": authoring::KIND, "project": {"id": "helpers", "version": "1"}, - "functions": { + "transforms": { "probe": {"runtime":"rhai","source":"functions.rhai","entrypoint":"probe","inputs":{"request":{"type":"object"}},"output":{}} }, "workflow": {"input": {"type": "object"}, "deadlineSeconds": 86400, "start": "done", "steps": { - "done": {"type": "finish", "outcome": "measured", "output": {"type": "function", "function": "probe", "inputs": {"request":{"type": "input"}}}} + "done": {"type": "finish", "outcome": "measured", "output": {"type": "transform", "transform": "probe", "inputs": {"request":{"type": "input"}}}} }, "outcomes": {"measured": {}} } }); @@ -131,7 +131,7 @@ fn helpers_that_make_longer_strings_stay_inside_the_string_budget() { ] { let source = body.replace("aaaaaaaa", &"a".repeat(1024)); let error = run(&source, json!({})).unwrap_err(); - assert_eq!(error.code, "function.resource-limit", "{body}"); + assert_eq!(error.code, "transform.resource-limit", "{body}"); } } @@ -147,7 +147,7 @@ fn an_oversized_replace_reaches_a_loaded_project_as_a_resource_limit_refusal() { json!({"big": big}), ) .unwrap_err(); - assert_eq!(error.code, "function.resource-limit"); + assert_eq!(error.code, "transform.resource-limit"); } #[test] @@ -155,7 +155,7 @@ fn a_call_to_a_name_the_profile_lacks_is_refused_at_load_with_its_position_and_a let error = load("parse_decimal(inputs.request.digits)") .err() .expect("unknown helper is refused"); - assert_eq!(error.code, "coordinator.function.unknown-call"); + assert_eq!(error.code, "coordinator.transform.unknown-call"); assert!( error.message.contains("`parse_decimal`"), "{}", @@ -166,7 +166,7 @@ fn a_call_to_a_name_the_profile_lacks_is_refused_at_load_with_its_position_and_a .suggested_action .as_deref() .unwrap() - .contains("coordinatorctl explain functions"), + .contains("coordinatorctl explain transforms"), "{error:?}" ); let source = error.diagnostics[0] @@ -197,7 +197,7 @@ fn every_unknown_call_is_reported_and_known_calls_and_local_functions_pass() { .as_array() .unwrap() .iter() - .filter(|d| d["code"] == "coordinator.function.unknown-call") + .filter(|d| d["code"] == "coordinator.transform.unknown-call") .map(|d| d["message"].as_str().unwrap().to_owned()) .collect::>(); assert_eq!(findings.len(), 3, "{report}"); @@ -214,7 +214,7 @@ fn every_unknown_call_is_reported_and_known_calls_and_local_functions_pass() { #[test] fn explain_functions_lists_the_helpers_of_the_profile() { - let output = cli(&["--format", "json", "explain", "functions"]); + let output = cli(&["--format", "json", "explain", "transforms"]); assert!( output.status.success(), "{}", @@ -267,10 +267,10 @@ fn explain_functions_lists_the_helpers_of_the_profile() { assert!(report["interpreterAbi"].as_str().unwrap().contains("/v3;")); assert_eq!(report["limits"]["stringBytes"], 16384); - let human = cli(&["explain", "functions"]); + let human = cli(&["explain", "transforms"]); assert!(human.status.success()); let text = String::from_utf8(human.stdout).unwrap(); - assert!(text.starts_with("Pure function helpers"), "{text}"); + assert!(text.starts_with("Transform helpers"), "{text}"); assert!(text.contains("parse_int"), "{text}"); assert!(text.contains("Notes:"), "{text}"); assert!(text.contains("global::NAME"), "{text}"); @@ -291,7 +291,7 @@ fn explain_without_a_project_names_the_argument_and_its_help_lists_the_topic() { let help = cli(&["explain", "--help"]); assert!(help.status.success()); let text = String::from_utf8(help.stdout).unwrap(); - assert!(text.contains("functions"), "{text}"); + assert!(text.contains("transforms"), "{text}"); assert!(text.contains("--project"), "{text}"); } @@ -307,7 +307,7 @@ fn pad_with_an_empty_padding_string_is_refused_instead_of_looping() { ), ] { let error = within(10, move || run(body, request)).unwrap_err(); - assert_eq!(error.code, "function.execution", "{body}"); + assert_eq!(error.code, "transform.execution", "{body}"); } } @@ -332,7 +332,7 @@ fn pad_with_a_string_fills_to_the_length_and_stops_at_the_budget() { r#"let s = ""; s.pad(9223372036854775807, "ab"); s"#, ] { let error = within(10, move || run(body, json!({}))).unwrap_err(); - assert_eq!(error.code, "function.resource-limit", "{body}"); + assert_eq!(error.code, "transform.resource-limit", "{body}"); } } @@ -413,9 +413,9 @@ fn package_string_helpers_end_on_empty_zero_and_extreme_arguments() { if let Err(error) = outcome { assert!( [ - "function.execution", - "function.resource-limit", - "function.output" + "transform.execution", + "transform.resource-limit", + "transform.output" ] .contains(&error.code.as_ref()), "{call}: {error:?}" @@ -451,7 +451,7 @@ fn only_math_whose_result_is_the_same_on_every_host_is_available() { let error = load(name) .err() .unwrap_or_else(|| panic!("{name} is available")); - assert_eq!(error.code, "coordinator.function.unknown-call", "{name}"); + assert_eq!(error.code, "coordinator.transform.unknown-call", "{name}"); } let value = run( r#" @@ -492,7 +492,7 @@ fn a_result_holding_nan_or_infinity_is_refused_not_turned_into_null() { "parse_float(\"NaN\")", ] { let error = run(body, json!({})).unwrap_err(); - assert_eq!(error.code, "function.execution", "{body}"); + assert_eq!(error.code, "transform.execution", "{body}"); } // Finite numbers, and a NaN that is only tested, still pass. assert_eq!( @@ -511,7 +511,7 @@ fn a_function_that_curries_is_refused_at_check_with_a_way_forward() { let Err(error) = Definition::load(root.path()) else { panic!("a Function that curries was accepted"); }; - assert_eq!(error.code, "coordinator.function.definition"); + assert_eq!(error.code, "coordinator.transform.definition"); assert!(error.message.contains("curry"), "{}", error.message); let hint = error.suggested_action.as_deref().unwrap_or_default(); assert!(hint.contains("curry"), "{hint}"); @@ -527,8 +527,8 @@ fn a_refusal_in_a_shared_source_is_reported_once() { ); let path = root.path().join("workflow.yaml"); let mut workflow: Value = serde_json::from_str(&fs::read_to_string(&path).unwrap()).unwrap(); - workflow["functions"]["other"] = workflow["functions"]["probe"].clone(); - workflow["functions"]["other"]["entrypoint"] = json!("other"); + workflow["transforms"]["other"] = workflow["transforms"]["probe"].clone(); + workflow["transforms"]["other"]["entrypoint"] = json!("other"); fs::write(&path, workflow.to_string()).unwrap(); let output = cli(&[ "--format", @@ -542,7 +542,7 @@ fn a_refusal_in_a_shared_source_is_reported_once() { .as_array() .unwrap() .iter() - .filter(|d| d["code"] == "coordinator.function.definition") + .filter(|d| d["code"] == "coordinator.transform.definition") .count(); assert_eq!(refusals, 1, "{report}"); } @@ -563,7 +563,7 @@ fn unknown_call_names(source: &str) -> Vec { .map(Vec::as_slice) .unwrap_or_default() .iter() - .filter(|d| d["code"] == "coordinator.function.unknown-call") + .filter(|d| d["code"] == "coordinator.transform.unknown-call") .map(|d| { let message = d["message"].as_str().unwrap(); message.split('`').nth(1).unwrap().to_owned() diff --git a/crates/registry-coordinator/tests/instant_functions.rs b/crates/registry-coordinator/tests/instant_functions.rs index 401441fae4..57b6bde8cf 100644 --- a/crates/registry-coordinator/tests/instant_functions.rs +++ b/crates/registry-coordinator/tests/instant_functions.rs @@ -15,14 +15,14 @@ fn project(functions: &str) -> tempfile::TempDir { let workflow = json!({ "apiVersion": authoring::API_VERSION, "kind": authoring::KIND, "project": {"id": "instants", "version": "1"}, - "functions": { + "transforms": { "due": {"runtime":"rhai","source":"functions.rhai","entrypoint":"due","inputs":{"request":{"type":"object"}},"output":{"type":"string","format":"date-time"}}, "elapsed": {"runtime":"rhai","source":"functions.rhai","entrypoint":"elapsed","inputs":{"request":{"type":"object"}},"output":{"type":"integer"}} }, "workflow": {"input": {"type": "object"}, "deadlineSeconds": 86400, "start": "due", "steps": { - "due": {"type": "wait-until", "waitUntil": {"type": "function", "function": "due", "inputs": {"request":{"type": "input"}}}, "next": "done"}, - "done": {"type": "finish", "outcome": "measured", "output": {"type": "function", "function": "elapsed", "inputs": {"request":{"type": "input"}}}} + "due": {"type": "wait-until", "waitUntil": {"type": "transform", "transform": "due", "inputs": {"request":{"type": "input"}}}, "next": "done"}, + "done": {"type": "finish", "outcome": "measured", "output": {"type": "transform", "transform": "elapsed", "inputs": {"request":{"type": "input"}}}} }, "outcomes": {"measured": {"type": "integer"}} } }); @@ -52,7 +52,7 @@ fn between(at: &str, other: &str) -> registry_coordinator::Result { definition().evaluate("done", &json!({"at": at, "other": other}), &BTreeMap::new()) } -const REFUSED: &str = "the function could not evaluate its supplied values"; +const REFUSED: &str = "the Transform could not evaluate its supplied values"; #[test] fn add_seconds_moves_an_instant_and_writes_it_in_utc() { @@ -107,7 +107,7 @@ fn an_instant_or_result_outside_rfc_3339_is_a_function_failure_that_omits_the_va ]; for refusal in refusals { let error = refusal.err().unwrap(); - assert_eq!(error.code, "function.execution"); + assert_eq!(error.code, "transform.execution"); assert_eq!(error.message, REFUSED); let rendered = serde_json::to_string(&json!({ "message": error.message, "field": error.field, @@ -136,5 +136,5 @@ fn the_function_profile_reads_no_clock() { let error = Definition::load(project(&functions).path()) .err() .expect("a call to the clock is refused"); - assert_eq!(error.code, "coordinator.function.unknown-call"); + assert_eq!(error.code, "coordinator.transform.unknown-call"); } diff --git a/crates/registry-coordinator/tests/mapping_checks.rs b/crates/registry-coordinator/tests/mapping_checks.rs index cd9e038297..f8c555749c 100644 --- a/crates/registry-coordinator/tests/mapping_checks.rs +++ b/crates/registry-coordinator/tests/mapping_checks.rs @@ -289,7 +289,7 @@ fn a_mapping_that_fits_every_schema_loads() { #[test] fn open_members_accept_any_path_beneath_them() { let mut project = project(); - project["workflow"]["steps"]["done"]["output"] = json!({"type": "function", "function": "combine", "inputs": {"arg0": {"type": "input", "path": "/labels/lname"}, "arg1": {"type": "input", "path": "/labels/other"}, "arg2": {"type": "input", "path": "/tree/child/child/child/name"}, "arg3": {"type": "input", "path": "/slots/3"}, "arg4": {"type": "input", "path": "/extra/any/depth"}, "arg5": {"type": "step", "step": "read", "path": "/data/domainData/any/0/depth"}, "arg6": {"type": "step", "step": "read", "path": "/data/extension"}, "arg7": {"type": "step", "step": "read", "path": "/links/self"}, "arg8": {"type": "step", "step": "lookup", "path": "/body/0/a~1b"}}}); + project["workflow"]["steps"]["done"]["output"] = json!({"type": "transform", "transform": "combine", "inputs": {"arg0": {"type": "input", "path": "/labels/lname"}, "arg1": {"type": "input", "path": "/labels/other"}, "arg2": {"type": "input", "path": "/tree/child/child/child/name"}, "arg3": {"type": "input", "path": "/slots/3"}, "arg4": {"type": "input", "path": "/extra/any/depth"}, "arg5": {"type": "step", "step": "read", "path": "/data/domainData/any/0/depth"}, "arg6": {"type": "step", "step": "read", "path": "/data/extension"}, "arg7": {"type": "step", "step": "read", "path": "/links/self"}, "arg8": {"type": "step", "step": "lookup", "path": "/body/0/a~1b"}}}); load(&project, "fn combine(__named) { let a = __named.arg0; let b = __named.arg1; let c = __named.arg2; let d = __named.arg3; let e = __named.arg4; let f = __named.arg5; let g = __named.arg6; let h = __named.arg7; let i = __named.arg8; () }").unwrap(); } @@ -335,7 +335,7 @@ fn a_path_the_operation_output_does_not_declare_is_refused() { #[test] fn function_arguments_have_their_paths_checked_and_nothing_else() { let mut project = project(); - project["workflow"]["steps"]["done"]["output"] = json!({"type": "function", "function": "combine", "inputs": {"arg0": {"type": "input", "path": "/count"}, "arg1": {"type": "input", "path": "/tree/child/nmae"}}}); + project["workflow"]["steps"]["done"]["output"] = json!({"type": "transform", "transform": "combine", "inputs": {"arg0": {"type": "input", "path": "/count"}, "arg1": {"type": "input", "path": "/tree/child/nmae"}}}); assert_finding( &refused(&project), "coordinator.mapping.path", @@ -642,9 +642,9 @@ fn an_admitted_snapshot_is_not_held_to_the_static_checks() { fn declare_test_functions(project: &Value) -> Value { fn mapping(value: &Value, functions: &mut serde_json::Map) { if let Some(object) = value.as_object() { - if object.get("type") == Some(&json!("function")) { + if object.get("type") == Some(&json!("transform")) { if let (Some(name), Some(inputs)) = ( - object.get("function").and_then(Value::as_str), + object.get("transform").and_then(Value::as_str), object.get("inputs").and_then(Value::as_object), ) { let signature = inputs @@ -666,6 +666,6 @@ fn declare_test_functions(project: &Value) -> Value { let mut project = project.clone(); let mut functions = serde_json::Map::new(); mapping(&project["workflow"]["steps"], &mut functions); - project["functions"] = Value::Object(functions); + project["transforms"] = Value::Object(functions); project } diff --git a/crates/registry-coordinator/tests/mapping_grammar.rs b/crates/registry-coordinator/tests/mapping_grammar.rs index 1218d1b570..bcb4464fdb 100644 --- a/crates/registry-coordinator/tests/mapping_grammar.rs +++ b/crates/registry-coordinator/tests/mapping_grammar.rs @@ -214,7 +214,7 @@ fn references_and_fields_carry_plumbing_without_a_function() { #[test] fn function_arguments_accept_paths_and_literals() { let mut project = project(); - project["workflow"]["steps"]["done"]["output"] = json!({"type": "function", "function": "combine", "inputs": {"arg0": {"type": "input", "path": "/applicationId"}, "arg1": {"type": "literal", "value": {"nested": [1, true, null]}}, "arg2": {"type": "step", "step": "read", "path": "/data"}, "arg3": {"type": "step", "step": "read"}}}); + project["workflow"]["steps"]["done"]["output"] = json!({"type": "transform", "transform": "combine", "inputs": {"arg0": {"type": "input", "path": "/applicationId"}, "arg1": {"type": "literal", "value": {"nested": [1, true, null]}}, "arg2": {"type": "step", "step": "read", "path": "/data"}, "arg3": {"type": "step", "step": "read"}}}); let definition = load( &project, "fn combine(__named) { let id = __named.arg0; let literal = __named.arg1; let data = __named.arg2; let whole = __named.arg3; let count = if literal.nested.len() == 3 && literal.nested[1] { \"3\" } else { \"?\" }; #{ record: data.recordId + \":\" + id + \":\" + count + \":\" + whole.meta.datasetId, note: () } }", @@ -319,21 +319,21 @@ fn a_malformed_pointer_is_refused_at_its_member() { fn an_input_names_its_form_function_or_fields() { for (value, path, code, message, action) in [ ( - json!({"function": "f", "inputs": {}}), + json!({"transform": "f", "inputs": {}}), "/workflow/steps/read/input", "config.missing-key", "the member `type` is missing; it names which form this mapping takes", - "Add `type` with one of `function`, `fields`, `compare`, `input`, `step`, `literal`.", + "Add `type` with one of `transform`, `fields`, `compare`, `input`, `step`, `literal`.", ), ( json!({"type": "unknown"}), "/workflow/steps/read/input/type", "config.unknown-variant", - "expected one of `function`, `fields`, `compare`, `input`, `step`, `literal`", - "Use one of `function`, `fields`, `compare`, `input`, `step`, `literal`.", + "expected one of `transform`, `fields`, `compare`, `input`, `step`, `literal`", + "Use one of `transform`, `fields`, `compare`, `input`, `step`, `literal`.", ), ( - json!({"type": "function", "function": "f"}), + json!({"type": "transform", "transform": "f"}), "/workflow/steps/read/input", "config.missing-key", "the required member `inputs` is missing", @@ -347,11 +347,11 @@ fn an_input_names_its_form_function_or_fields() { "Add `fields`.", ), ( - json!({"type": "function", "function": "f", "inputs": {}, "fields": {}}), + json!({"type": "transform", "transform": "f", "inputs": {}, "fields": {}}), "/workflow/steps/read/input/fields", "config.unknown-key", "`fields` is not a member of this mapping", - "Remove `fields`; the accepted keys are `type`, `function`, `inputs`.", + "Remove `fields`; the accepted keys are `type`, `transform`, `inputs`.", ), ] { let mut project = project(); @@ -368,18 +368,18 @@ fn an_input_names_its_form_function_or_fields() { fn a_selector_names_its_form_function_or_one_reference() { for (value, path, code, message, action) in [ ( - json!({"function": "f", "inputs": {}}), + json!({"transform": "f", "inputs": {}}), "/workflow/steps/route/choose", "config.missing-key", "the member `type` is missing; it names which form this mapping takes", - "Add `type` with one of `function`, `fields`, `compare`, `input`, `step`, `literal`.", + "Add `type` with one of `transform`, `fields`, `compare`, `input`, `step`, `literal`.", ), ( json!({"type": "unknown"}), "/workflow/steps/route/choose/type", "config.unknown-variant", - "expected one of `function`, `fields`, `compare`, `input`, `step`, `literal`", - "Use one of `function`, `fields`, `compare`, `input`, `step`, `literal`.", + "expected one of `transform`, `fields`, `compare`, `input`, `step`, `literal`", + "Use one of `transform`, `fields`, `compare`, `input`, `step`, `literal`.", ), ( json!({"type": "step"}), @@ -410,11 +410,11 @@ fn a_selector_names_its_form_function_or_one_reference() { "Remove `path`; the accepted keys are `type`, `value`.", ), ( - json!({"type": "function", "function": "f", "inputs": {}, "path": "/x"}), + json!({"type": "transform", "transform": "f", "inputs": {}, "path": "/x"}), "/workflow/steps/route/choose/path", "config.unknown-key", "`path` is not a member of this mapping", - "Remove `path`; the accepted keys are `type`, `function`, `inputs`.", + "Remove `path`; the accepted keys are `type`, `transform`, `inputs`.", ), ] { let mut project = project(); @@ -554,9 +554,9 @@ fn reference_selectors_keep_their_result_contracts() { fn declare_test_functions(project: &Value) -> Value { fn mapping(value: &Value, functions: &mut serde_json::Map) { if let Some(object) = value.as_object() { - if object.get("type") == Some(&json!("function")) { + if object.get("type") == Some(&json!("transform")) { if let (Some(name), Some(inputs)) = ( - object.get("function").and_then(Value::as_str), + object.get("transform").and_then(Value::as_str), object.get("inputs").and_then(Value::as_object), ) { let signature = inputs @@ -578,6 +578,6 @@ fn declare_test_functions(project: &Value) -> Value { let mut project = project.clone(); let mut functions = serde_json::Map::new(); mapping(&project["workflow"]["steps"], &mut functions); - project["functions"] = Value::Object(functions); + project["transforms"] = Value::Object(functions); project } diff --git a/crates/registry-coordinator/tests/nested_fields.rs b/crates/registry-coordinator/tests/nested_fields.rs index be3265a61f..e5d3b9085c 100644 --- a/crates/registry-coordinator/tests/nested_fields.rs +++ b/crates/registry-coordinator/tests/nested_fields.rs @@ -137,9 +137,9 @@ fn only(error: &CoordinatorError) -> &Diagnostic { fn declare_test_functions(project: &Value) -> Value { fn mapping(value: &Value, functions: &mut serde_json::Map) { if let Some(object) = value.as_object() { - if object.get("type") == Some(&json!("function")) { + if object.get("type") == Some(&json!("transform")) { if let (Some(name), Some(inputs)) = ( - object.get("function").and_then(Value::as_str), + object.get("transform").and_then(Value::as_str), object.get("inputs").and_then(Value::as_object), ) { let signature = inputs @@ -157,7 +157,7 @@ fn declare_test_functions(project: &Value) -> Value { let mut project = project.clone(); let mut functions = serde_json::Map::new(); mapping(&project["workflow"]["steps"], &mut functions); - project["functions"] = Value::Object(functions); + project["transforms"] = Value::Object(functions); project } @@ -342,7 +342,7 @@ fn a_nested_member_reads_only_outputs_available_on_every_route() { fn a_nested_member_never_holds_a_function() { let mut project = project(); project["workflow"]["steps"]["lookup"]["input"]["fields"]["query"]["fields"]["page"] = - json!({"type": "function", "function": "page", "inputs": {}}); + json!({"type": "transform", "transform": "page", "inputs": {}}); let error = parse_refused(&project); let finding = &error.diagnostics[0]; assert_eq!(finding.code, "config.unknown-variant"); @@ -357,7 +357,7 @@ fn a_nested_member_never_holds_a_function() { // Function inputs stay plain references. let mut project = self::project(); - project["workflow"]["steps"]["lookup"]["input"] = json!({"type": "function", "function": "build", "inputs": { + project["workflow"]["steps"]["lookup"]["input"] = json!({"type": "transform", "transform": "build", "inputs": { "page": {"type": "fields", "fields": {}} }}); let error = parse_refused(&project); @@ -377,11 +377,11 @@ fn a_nested_member_never_holds_a_function() { fn a_nested_mapping_freezes_the_input_a_function_would_build() { let declarative = load(&project(), "").unwrap(); let mut computed = project(); - computed["workflow"]["steps"]["lookup"]["input"] = json!({"type": "function", "function": "build_query", "inputs": { + computed["workflow"]["steps"]["lookup"]["input"] = json!({"type": "transform", "transform": "build_query", "inputs": { "page": {"type": "input", "path": "/page"}, "record": {"type": "step", "step": "read", "path": "/data/recordId"} }}); - computed["workflow"]["steps"]["done"]["output"] = json!({"type": "function", "function": "build_outcome", "inputs": { + computed["workflow"]["steps"]["done"]["output"] = json!({"type": "transform", "transform": "build_outcome", "inputs": { "id": {"type": "input", "path": "/applicationId"}, "record": {"type": "step", "step": "read", "path": "/data/recordId"} }}); @@ -485,7 +485,7 @@ fn a_snapshot_refuses_unknown_members_of_a_nested_mapping() { reference_with_fields["fields"]["page"]["fields"] = json!({}); let mut function_shaped = query.clone(); function_shaped["fields"]["page"] = - json!({"type": "function", "function": "page", "inputs": {}}); + json!({"type": "transform", "transform": "page", "inputs": {}}); let mut wrong_case = query.clone(); wrong_case["type"] = json!("Fields"); for (case, query) in [ diff --git a/crates/registry-coordinator/tests/postgres_state.rs b/crates/registry-coordinator/tests/postgres_state.rs index 1c628b45b0..49c065fcba 100644 --- a/crates/registry-coordinator/tests/postgres_state.rs +++ b/crates/registry-coordinator/tests/postgres_state.rs @@ -49,7 +49,7 @@ kind: CoordinatorProject project: {id: synthetic-declared-refusal, version: v1} contracts: applications: {type: breg, source: applications.json} -functions: +transforms: action: runtime: rhai source: functions.rhai @@ -75,14 +75,14 @@ workflow: action: type: call operation: invoke-breg-action - input: {type: function, function: action, inputs: {input: {type: input}}} + input: {type: transform, transform: action, inputs: {input: {type: input}}} next: applied onDeclaredRefusal: refused applied: {type: finish, outcome: applied} refused: type: finish outcome: refused - output: {type: function, function: keep, inputs: {value: {type: step, step: action}}} + output: {type: transform, transform: keep, inputs: {value: {type: step, step: action}}} outcomes: applied: {type: 'null'} refused: {operationRefusal: invoke-breg-action} @@ -99,7 +99,7 @@ kind: CoordinatorProject project: {id: synthetic-declared-refusal-deadline, version: v1} contracts: applications: {type: breg, source: applications.json} -functions: +transforms: action: runtime: rhai source: functions.rhai @@ -125,13 +125,13 @@ workflow: action: type: call operation: invoke-breg-action - input: {type: function, function: action, inputs: {input: {type: input}}} + input: {type: transform, transform: action, inputs: {input: {type: input}}} next: applied onDeclaredRefusal: later later: type: call operation: invoke-breg-action - input: {type: function, function: action, inputs: {input: {type: input}}} + input: {type: transform, transform: action, inputs: {input: {type: input}}} next: applied applied: {type: finish, outcome: applied} outcomes: @@ -143,7 +143,7 @@ kind: CoordinatorProject project: id: synthetic-reminder version: v1 -functions: +transforms: timer: runtime: rhai source: functions.rhai @@ -214,8 +214,8 @@ workflow: wait: type: wait-until waitUntil: - type: function - function: timer + type: transform + transform: timer inputs: input: type: input @@ -224,8 +224,8 @@ workflow: type: call operation: read-record input: - type: function - function: record + type: transform + transform: record inputs: input: type: input @@ -233,8 +233,8 @@ workflow: choose: type: choose choose: - type: function - function: permission + type: transform + transform: permission inputs: record: type: step @@ -246,8 +246,8 @@ workflow: type: call operation: submit-message input: - type: function - function: message + type: transform + transform: message inputs: record: type: step @@ -257,8 +257,8 @@ workflow: type: finish outcome: sent output: - type: function - function: receipt + type: transform + transform: receipt inputs: message: type: step @@ -311,7 +311,7 @@ async fn harness() -> Harness { .unwrap(); std::fs::write(project.path().join("applications.json"), include_str!("../../../products/coordinator/examples/governed-action-follow-up/generated/applications.contract.json")).unwrap(); std::fs::write(project.path().join("workflow.yaml"), WORKFLOW).expect("workflow"); - std::fs::write(project.path().join("functions.rhai"), FUNCTIONS).expect("functions"); + std::fs::write(project.path().join("functions.rhai"), FUNCTIONS).expect("transforms"); let definition = Definition::load(project.path()).expect("valid synthetic definition"); Harness { url, @@ -1865,7 +1865,7 @@ async fn a_call_input_outside_the_operation_input_is_refused_before_dispatch_wit // A permissive Function result still cannot bypass the host's exact // Operation contract or freeze an invalid command. let mut workflow = authored_workflow_value(WORKFLOW); - workflow["functions"]["message"]["output"] = json!({"type":"object"}); + workflow["transforms"]["message"]["output"] = json!({"type":"object"}); std::fs::write(h.project.path().join("workflow.yaml"), workflow.to_string()).unwrap(); let definition = Definition::load(h.project.path()).unwrap(); let run = h @@ -1925,7 +1925,7 @@ async fn invalid_dictionary_values_never_disclose_member_names_or_dispatch() { apiVersion: id.registrystack.org/formats/coordinator/project/v1alpha1 kind: CoordinatorProject project: {id: synthetic-dictionary-privacy, version: '1'} -functions: +transforms: request: runtime: rhai source: functions.rhai @@ -1949,7 +1949,7 @@ workflow: read: type: call operation: read-job - input: {type: function, function: request, inputs: {request: {type: input}}} + input: {type: transform, transform: request, inputs: {request: {type: input}}} next: done done: {type: finish, outcome: done} outcomes: {done: {type: 'null'}} @@ -3946,36 +3946,36 @@ async fn invalid_following_wait(prior: &str, body: &str) -> Harness { let mut workflow = authored_workflow_value(WORKFLOW); let mut steps = serde_json::Map::new(); let input_mapping = - json!({"type":"function","function":"record","inputs":{"input":{"type":"input"}}}); + json!({"type":"transform","transform":"record","inputs":{"input":{"type":"input"}}}); let start = match prior { "read" => { steps.insert("read".into(),json!({"type":"call","operation":"read-record","input":input_mapping,"next":"later"})); "read" } "choose" => { - steps.insert("choose".into(),json!({"type":"choose","choose":{"type":"function","function":"choose-input","inputs":{"input":{"type":"input"}}},"cases":{"yes":"later"}})); + steps.insert("choose".into(),json!({"type":"choose","choose":{"type":"transform","transform":"choose-input","inputs":{"input":{"type":"input"}}},"cases":{"yes":"later"}})); "choose" } "wait" => { - steps.insert("wait".into(),json!({"type":"wait-until","waitUntil":{"type":"function","function":"timer","inputs":{"input":{"type":"input"}}},"next":"later"})); + steps.insert("wait".into(),json!({"type":"wait-until","waitUntil":{"type":"transform","transform":"timer","inputs":{"input":{"type":"input"}}},"next":"later"})); "wait" } "message" => { steps.insert("read".into(),json!({"type":"call","operation":"read-record","input":input_mapping,"next":"message"})); - steps.insert("message".into(),json!({"type":"call","operation":"submit-message","input":{"type":"function","function":"message","inputs":{"record":{"type":"step","step":"read"}}},"next":"later"})); + steps.insert("message".into(),json!({"type":"call","operation":"submit-message","input":{"type":"transform","transform":"message","inputs":{"record":{"type":"step","step":"read"}}},"next":"later"})); "read" } _ => panic!("unknown test prior step"), }; - steps.insert("later".into(),json!({"type":"wait-until","waitUntil":{"type":"function","function":"broken-wait","inputs":{"input":{"type":"input"}}},"next":"future-read"})); + steps.insert("later".into(),json!({"type":"wait-until","waitUntil":{"type":"transform","transform":"broken-wait","inputs":{"input":{"type":"input"}}},"next":"future-read"})); steps.insert( "future-read".into(), json!({"type":"call","operation":"read-record","input":input_mapping,"next":"done"}), ); steps.insert("done".into(), json!({"type":"finish","outcome":"done"})); workflow["workflow"] = json!({"input":{"type":"object"},"deadlineSeconds":3600,"start":start,"steps":steps,"outcomes":{"done":{"type":"null"}}}); - workflow["functions"]["choose-input"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"choose_input","inputs":{"input":{"type":"object"}},"output":{"type":"string","enum":["yes"]}}); - workflow["functions"]["broken-wait"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"broken_wait","inputs":{"input":{"type":"object"}},"output":{}}); + workflow["transforms"]["choose-input"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"choose_input","inputs":{"input":{"type":"object"}},"output":{"type":"string","enum":["yes"]}}); + workflow["transforms"]["broken-wait"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"broken_wait","inputs":{"input":{"type":"object"}},"output":{}}); std::fs::write(h.project.path().join("workflow.yaml"), workflow.to_string()).unwrap(); std::fs::write(h.project.path().join("functions.rhai"),format!("{FUNCTIONS}\nfn choose_input(args) {{ \"yes\" }}\nfn broken_wait(args) {{let input=args.input; {body}}}")).unwrap(); h.definition = Definition::load(h.project.path()).unwrap(); @@ -4681,9 +4681,8 @@ async fn interrupted_mutation(kind: &str, prepared: bool) -> (Harness, Uuid, Arc .as_object_mut() .unwrap() .remove("read"); - document["workflow"]["steps"]["message"]["input"] = - json!({"type":"function","function":"pre-io-command","inputs":{"input":{"type":"input"}}}); - document["functions"]["pre-io-command"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"pre_io_command","inputs":{"input":{"type":"object"}},"output":{"operationInput":"submit-message"}}); + document["workflow"]["steps"]["message"]["input"] = json!({"type":"transform","transform":"pre-io-command","inputs":{"input":{"type":"input"}}}); + document["transforms"]["pre-io-command"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"pre_io_command","inputs":{"input":{"type":"object"}},"output":{"operationInput":"submit-message"}}); if kind == "appointment" { document["operations"]["submit-message"]["uses"] = json!("scheduling.create-appointment/v1"); diff --git a/crates/registry-coordinator/tests/process_restart.rs b/crates/registry-coordinator/tests/process_restart.rs index 6c16e8afd6..a2fd1c955a 100644 --- a/crates/registry-coordinator/tests/process_restart.rs +++ b/crates/registry-coordinator/tests/process_restart.rs @@ -346,7 +346,7 @@ async fn exited_decision_workers_hold_unknown_results_and_reuse_completed_result apiVersion: id.registrystack.org/formats/coordinator/project/v1alpha1 kind: CoordinatorProject project: {id: process-decision, version: '1'} -functions: +transforms: decision-request: runtime: rhai source: functions.rhai @@ -371,11 +371,11 @@ workflow: evaluate: type: call operation: evaluate - input: {type: function, function: decision-request, inputs: {input: {type: input}}} + input: {type: transform, transform: decision-request, inputs: {input: {type: input}}} next: wait wait: type: wait-until - waitUntil: {type: function, function: timer, inputs: {input: {type: input}}} + waitUntil: {type: transform, transform: timer, inputs: {input: {type: input}}} next: done done: type: finish diff --git a/crates/registry-coordinator/tests/product_contract_imports.rs b/crates/registry-coordinator/tests/product_contract_imports.rs index e716c5faf4..88f563997d 100644 --- a/crates/registry-coordinator/tests/product_contract_imports.rs +++ b/crates/registry-coordinator/tests/product_contract_imports.rs @@ -299,10 +299,9 @@ fn template_import_checks_computed_data_and_keeps_local_schema_references() { project["contracts"] = json!({"notices": {"type": "messaging", "source": "contract.json"}}); project["operations"]["request"]["template"] = json!({"contract": "notices", "id": "licence-issued", "version": "1"}); - project["functions"] = json!({"message": {"runtime": "rhai", "source": "functions.rhai", "entrypoint": "message", + project["transforms"] = json!({"message": {"runtime": "rhai", "source": "functions.rhai", "entrypoint": "message", "inputs": {"input": {"type": "object"}}, "output": {"type": "object"}}}); - project["workflow"]["steps"]["call"]["input"] = - json!({"type": "function", "function": "message", "inputs": {"input": {"type": "input"}}}); + project["workflow"]["steps"]["call"]["input"] = json!({"type": "transform", "transform": "message", "inputs": {"input": {"type": "input"}}}); fs::write( root.path().join("functions.rhai"), "fn message(args) { args.input }", diff --git a/crates/registry-coordinator/tests/recovery_audit.rs b/crates/registry-coordinator/tests/recovery_audit.rs index 7069cccdd7..dbd1bdcb03 100644 --- a/crates/registry-coordinator/tests/recovery_audit.rs +++ b/crates/registry-coordinator/tests/recovery_audit.rs @@ -132,7 +132,7 @@ async fn harness() -> Harness { r#"apiVersion: id.registrystack.org/formats/coordinator/project/v1alpha1 kind: CoordinatorProject project: {id: recovery-audit, version: v1} -functions: +transforms: timer: runtime: rhai source: functions.rhai @@ -146,7 +146,7 @@ workflow: steps: wait: type: wait-until - waitUntil: {type: function, function: timer, inputs: {input: {type: input}}} + waitUntil: {type: transform, transform: timer, inputs: {input: {type: input}}} next: done done: {type: finish, outcome: done} outcomes: {done: {type: 'null'}} diff --git a/crates/registry-coordinator/tests/review_wait_postgres.rs b/crates/registry-coordinator/tests/review_wait_postgres.rs index 60e91ceb2a..b7f369d83d 100644 --- a/crates/registry-coordinator/tests/review_wait_postgres.rs +++ b/crates/registry-coordinator/tests/review_wait_postgres.rs @@ -290,7 +290,7 @@ async fn harness_with_options(on_timeout: bool, on_cancel: bool, cleanup_wait: b workflow_with_cancel(on_timeout, on_cancel, cleanup_wait), ) .expect("workflow"); - std::fs::write(project.path().join("functions.rhai"), FUNCTIONS).expect("functions"); + std::fs::write(project.path().join("functions.rhai"), FUNCTIONS).expect("transforms"); let definition = Definition::load(project.path()).expect("valid synthetic definition"); Harness { url, diff --git a/crates/registry-coordinator/tests/runtime_config.rs b/crates/registry-coordinator/tests/runtime_config.rs index 8a499cc6d5..4762697ffe 100644 --- a/crates/registry-coordinator/tests/runtime_config.rs +++ b/crates/registry-coordinator/tests/runtime_config.rs @@ -806,7 +806,7 @@ fn init_writes_eight_entries_for_an_offline_checkable_project_and_never_overwrit let explanation = definition.explain().unwrap(); assert_eq!(explanation["workflowRevision"], definition.digest); assert!(explanation["operations"].is_object()); - assert!(explanation["functions"].is_object()); + assert!(explanation["transforms"].is_object()); assert_eq!(explanation["steps"].as_array().unwrap().len(), 6); assert_eq!(explanation["limits"]["operations"], 100000); fs::write(path.join("functions.rhai"), CANARY).unwrap(); @@ -926,7 +926,7 @@ fn appointment_workflow_refuses_ordinary_authority_before_admission_or_activatio ) .unwrap(); read_only["workflow"]["start"] = json!("metadata"); - read_only.as_object_mut().unwrap().remove("functions"); + read_only.as_object_mut().unwrap().remove("transforms"); read_only["operations"] .as_object_mut() .unwrap() diff --git a/crates/registry-coordinator/tests/scheduling_event_native.rs b/crates/registry-coordinator/tests/scheduling_event_native.rs index 00d18ca87b..56daa20b4f 100644 --- a/crates/registry-coordinator/tests/scheduling_event_native.rs +++ b/crates/registry-coordinator/tests/scheduling_event_native.rs @@ -286,7 +286,7 @@ fn write_project(root: &Path) { "appointmentId":{"type":"string","format":"uuid"}, "state":{"type":"string","enum":["confirmed","cancelled"]} }}}, - "functions":{"notice-request":{"runtime":"rhai","source":"functions.rhai","entrypoint":"notice_request", + "transforms":{"notice-request":{"runtime":"rhai","source":"functions.rhai","entrypoint":"notice_request", "inputs":{"input":{"typeRef":"lifecycle-input"}},"output":{"operationInput":"send-message"}}}, "operations":{"send-message":{"uses":"messaging.submit-message/v1","connection":"notices"}}, "workflow":{ @@ -313,7 +313,7 @@ fn write_project(root: &Path) { "deadlineSeconds":300, "start":"notify", "steps":{ - "notify":{"type":"call","operation":"send-message","input":{"type":"function","function":"notice-request","inputs":{"input":{"type":"input"}}},"next":"accepted"}, + "notify":{"type":"call","operation":"send-message","input":{"type":"transform","transform":"notice-request","inputs":{"input":{"type":"input"}}},"next":"accepted"}, "accepted":{"type":"finish","outcome":"message-accepted","output":{"type":"fields","fields":{"messageId":{"type":"step","step":"notify","path":"/id"}}}} }, "outcomes":{"message-accepted":{"type":"object","additionalProperties":false,"required":["messageId"],"properties":{"messageId":{"type":"string","format":"uuid"}}}} diff --git a/crates/registry-coordinator/tests/support/breg_service.rs b/crates/registry-coordinator/tests/support/breg_service.rs index 8f4bded57e..960b9f5294 100644 --- a/crates/registry-coordinator/tests/support/breg_service.rs +++ b/crates/registry-coordinator/tests/support/breg_service.rs @@ -176,11 +176,11 @@ impl Breg { "fields":[{"id":"owner", "type":"string", "required":true, "maximumLength":80, "classification":"internal"}, {"id":"label", "type":"string", "required":true, "minimumLength":1, "maximumLength":80, "classification":"internal"}]}}, "datasets":{"synthetic-items": {}}, - "functions":{"update-item-plan": {"runtime":"rhai","source":"scripts/update-item.rhai","entrypoint":"plan","abi":"registry.action-plan/v1"}}, + "transforms":{"update-item-plan": {"runtime":"rhai","source":"scripts/update-item.rhai","entrypoint":"plan","abi":"registry.action-plan/v1"}}, "actions":{"update-item": { "execution":{"mode":"immediate"}, "inputs":[ {"id":"target", "apiName":"targetId", "type":"reference", "target":"item", "required":true, "classification":"internal"}, {"id":"label", "type":"string", "required":true, "minimumLength":1, "maximumLength":80, "classification":"internal"}], - "plan":{"type":"function", "function":"update-item-plan", "inputs":["target","label"], + "plan":{"type":"transform", "transform":"update-item-plan", "inputs":["target","label"], "refusals":[{"code":"label-not-eligible", "label":"The label is not eligible."}], "writes":[{"id":"item", "target":{"fromInput":"target"}, "operation":"patch", "fields":["label"]}]}}}, "accessProfiles":{ diff --git a/crates/registry-coordinator/tests/support/decision_evaluation.rs b/crates/registry-coordinator/tests/support/decision_evaluation.rs index 0c8cbb1a55..5c32c9b7d2 100644 --- a/crates/registry-coordinator/tests/support/decision_evaluation.rs +++ b/crates/registry-coordinator/tests/support/decision_evaluation.rs @@ -7,7 +7,7 @@ const DECISION_WORKFLOW: &str = r#" apiVersion: id.registrystack.org/formats/coordinator/project/v1alpha1 kind: CoordinatorProject project: {id: synthetic-decision, version: '1'} -functions: +transforms: decision-request: runtime: rhai source: functions.rhai @@ -26,7 +26,7 @@ workflow: evaluate: type: call operation: evaluate - input: {type: function, function: decision-request, inputs: {input: {type: input}}} + input: {type: transform, transform: decision-request, inputs: {input: {type: input}}} next: done done: type: finish @@ -250,9 +250,9 @@ async fn completed_decision_is_reused_after_restart_and_downstream_mapping_failu let mut h = decision_harness().await; if broken_wait { let mut document = authored_workflow_value(DECISION_WORKFLOW); - document["functions"]["broken-wait"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"broken_wait","inputs":{"input":{"type":"object"}},"output":{}}); + document["transforms"]["broken-wait"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"broken_wait","inputs":{"input":{"type":"object"}},"output":{}}); document["workflow"]["steps"]["evaluate"]["next"] = json!("later"); - document["workflow"]["steps"]["later"] = json!({"type":"wait-until","waitUntil":{"type":"function","function":"broken-wait","inputs":{"input":{"type":"input"}}},"next":"done"}); + document["workflow"]["steps"]["later"] = json!({"type":"wait-until","waitUntil":{"type":"transform","transform":"broken-wait","inputs":{"input":{"type":"input"}}},"next":"done"}); std::fs::write(h.project.path().join("workflow.yaml"), document.to_string()).unwrap(); std::fs::write( h.project.path().join("functions.rhai"), diff --git a/crates/registry-coordinator/tests/support/leased_wait_deadline.rs b/crates/registry-coordinator/tests/support/leased_wait_deadline.rs index 641d71e2b6..4d0b089bb9 100644 --- a/crates/registry-coordinator/tests/support/leased_wait_deadline.rs +++ b/crates/registry-coordinator/tests/support/leased_wait_deadline.rs @@ -15,7 +15,7 @@ kind: CoordinatorProject project: id: leased-timer version: v1 -functions: +transforms: timer: runtime: rhai source: functions.rhai @@ -35,11 +35,11 @@ workflow: steps: wait: type: wait-until - waitUntil: {type: function, function: timer, inputs: {input: {type: input}}} + waitUntil: {type: transform, transform: timer, inputs: {input: {type: input}}} next: choose choose: type: choose - choose: {type: function, function: choice, inputs: {input: {type: input}}} + choose: {type: transform, transform: choice, inputs: {input: {type: input}}} cases: {done: done} done: {type: finish, outcome: done} outcomes: @@ -175,7 +175,7 @@ async fn leased_finish_preserves_outcome_under_restore_review_and_after_retentio apiVersion: id.registrystack.org/formats/coordinator/project/v1alpha1 kind: CoordinatorProject project: {id: leased-finish, version: v1} -functions: +transforms: keep: runtime: rhai source: functions.rhai @@ -190,7 +190,7 @@ workflow: done: type: finish outcome: done - output: {type: function, function: keep, inputs: {input: {type: input}}} + output: {type: transform, transform: keep, inputs: {input: {type: input}}} outcomes: done: {type: object} "#, diff --git a/crates/registry-coordinator/tests/support/restore_pending.rs b/crates/registry-coordinator/tests/support/restore_pending.rs index a4423a1f36..61680764a0 100644 --- a/crates/registry-coordinator/tests/support/restore_pending.rs +++ b/crates/registry-coordinator/tests/support/restore_pending.rs @@ -32,12 +32,12 @@ async fn pending_work(kind: &str, at: chrono::DateTime) -> (Harness, Uuid, .remove("read"); let operation = "submit-message"; document["workflow"]["steps"]["message"]["operation"] = json!(operation); - document["workflow"]["steps"]["message"]["input"] = json!({"type":"function","function":"pending-command","inputs":{"input":{"type":"input"}}}); + document["workflow"]["steps"]["message"]["input"] = json!({"type":"transform","transform":"pending-command","inputs":{"input":{"type":"input"}}}); if kind == "appointment" { document["operations"][operation] = json!({"uses":"scheduling.create-appointment/v1","connection":"messages"}); } - document["functions"]["pending-command"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"pending_command","inputs":{"input":{"type":"object"}},"output":{"operationInput":operation}}); + document["transforms"]["pending-command"] = json!({"runtime":"rhai","source":"functions.rhai","entrypoint":"pending_command","inputs":{"input":{"type":"object"}},"output":{"operationInput":operation}}); let functions = h.project.path().join("functions.rhai"); let source = std::fs::read_to_string(&functions).unwrap(); std::fs::write( diff --git a/crates/registry-coordinator/tests/support/snapshot_boundary.rs b/crates/registry-coordinator/tests/support/snapshot_boundary.rs index 740cfa8786..f936001652 100644 --- a/crates/registry-coordinator/tests/support/snapshot_boundary.rs +++ b/crates/registry-coordinator/tests/support/snapshot_boundary.rs @@ -15,11 +15,11 @@ pub fn project_at_snapshot_size(path: &Path, size: usize) { let mut workflow = json!({ "apiVersion": "id.registrystack.org/formats/coordinator/project/v1alpha1", "kind": "CoordinatorProject", "project": {"id": "snapshot-boundary", "version": "1"}, - "functions":{"branch":{"runtime":"rhai","source":"functions.rhai","entrypoint":"branch","inputs":{"input":{"type":"null"}},"output":{"enum":["one","two","three"]}}}, + "transforms":{"branch":{"runtime":"rhai","source":"functions.rhai","entrypoint":"branch","inputs":{"input":{"type":"null"}},"output":{"enum":["one","two","three"]}}}, "workflow":{ "input": schema, "deadlineSeconds": 3600, "start": "select", "steps": { - "select": {"type": "choose", "choose": {"type": "function", "function": "branch", "inputs": {"input":{"type":"input"}}}, + "select": {"type": "choose", "choose": {"type": "transform", "transform": "branch", "inputs": {"input":{"type":"input"}}}, "cases": {"one": "first", "two": "second", "three": "third"}}, "first": {"type": "finish", "outcome": "one"}, "second": {"type": "finish", "outcome": "two"}, "third": {"type": "finish", "outcome": "three"} diff --git a/crates/registry-coordinator/tests/wait_for_authoring.rs b/crates/registry-coordinator/tests/wait_for_authoring.rs index 785a4c5164..67928a7ea1 100644 --- a/crates/registry-coordinator/tests/wait_for_authoring.rs +++ b/crates/registry-coordinator/tests/wait_for_authoring.rs @@ -325,7 +325,7 @@ fn a_review_cancel_built_by_a_function_is_refused() { ), ( " input:\n type: fields\n fields:\n request: {type: step, step: submit-review}\n reason: {type: literal, value: \"No decision within fourteen days.\"}\n", - " input: {type: function, function: withdrawal, inputs: {request: {type: step, step: submit-review}}}\n", + " input: {type: transform, transform: withdrawal, inputs: {request: {type: step, step: submit-review}}}\n", ), ], ); diff --git a/crates/registry-language-server/src/products/catalog_coordinator.rs b/crates/registry-language-server/src/products/catalog_coordinator.rs index 72e07ea93f..44ab88af5a 100644 --- a/crates/registry-language-server/src/products/catalog_coordinator.rs +++ b/crates/registry-language-server/src/products/catalog_coordinator.rs @@ -6,7 +6,7 @@ use super::spec::{DocumentRules, FileRule, NameRule as N}; const DECLARATIONS: &[N] = &[ N::global("project/id", "Coordinator workflow"), N::global("types/$key", "Coordinator type"), - N::global("functions/$key", "Coordinator Function"), + N::global("transforms/$key", "Coordinator Transform"), N::global("contracts/$key", "Coordinator contract import"), N::global("operations/$key", "Coordinator Operation"), N::global("workflow/steps/$key", "Coordinator Step"), @@ -31,13 +31,13 @@ const REFERENCES: &[N] = &[ ), N::global( "operations/*/completions/*/interpret", - "Coordinator Function", + "Coordinator Transform", ), - N::global("operations/*/interpret", "Coordinator Function"), + N::global("operations/*/interpret", "Coordinator Transform"), // Mapping inputs and fields hold References, so literal JSON payloads are never walked. N { - only_when: Some(("type", "function")), - ..N::global("workflow/steps/*/input/function", "Coordinator Function") + only_when: Some(("type", "transform")), + ..N::global("workflow/steps/*/input/transform", "Coordinator Transform") }, N { only_when: Some(("type", "step")), @@ -52,8 +52,8 @@ const REFERENCES: &[N] = &[ ..N::global("workflow/steps/*/input/fields/*/step", "Coordinator Step") }, N { - only_when: Some(("type", "function")), - ..N::global("workflow/steps/*/choose/function", "Coordinator Function") + only_when: Some(("type", "transform")), + ..N::global("workflow/steps/*/choose/transform", "Coordinator Transform") }, N { only_when: Some(("type", "step")), @@ -68,10 +68,10 @@ const REFERENCES: &[N] = &[ ..N::global("workflow/steps/*/choose/fields/*/step", "Coordinator Step") }, N { - only_when: Some(("type", "function")), + only_when: Some(("type", "transform")), ..N::global( - "workflow/steps/*/waitUntil/function", - "Coordinator Function", + "workflow/steps/*/waitUntil/transform", + "Coordinator Transform", ) }, N { @@ -93,8 +93,8 @@ const REFERENCES: &[N] = &[ ) }, N { - only_when: Some(("type", "function")), - ..N::global("workflow/steps/*/output/function", "Coordinator Function") + only_when: Some(("type", "transform")), + ..N::global("workflow/steps/*/output/transform", "Coordinator Transform") }, N { only_when: Some(("type", "step")), @@ -109,10 +109,10 @@ const REFERENCES: &[N] = &[ ..N::global("workflow/steps/*/output/fields/*/step", "Coordinator Step") }, N { - only_when: Some(("type", "function")), + only_when: Some(("type", "transform")), ..N::global( - "workflow/eventTriggers/*/input/function", - "Coordinator Function", + "workflow/eventTriggers/*/input/transform", + "Coordinator Transform", ) }, N { @@ -142,35 +142,38 @@ const REFERENCES: &[N] = &[ "types/*/completionOutput/operation", "Coordinator Operation", ), - N::global("functions/*/inputs/*/typeRef", "Coordinator type"), + N::global("transforms/*/inputs/*/typeRef", "Coordinator type"), N::global( - "functions/*/inputs/*/operationInput", + "transforms/*/inputs/*/operationInput", "Coordinator Operation", ), N::global( - "functions/*/inputs/*/operationOutput", + "transforms/*/inputs/*/operationOutput", "Coordinator Operation", ), N::global( - "functions/*/inputs/*/operationRefusal", + "transforms/*/inputs/*/operationRefusal", "Coordinator Operation", ), N::global( - "functions/*/inputs/*/completionOutput/operation", + "transforms/*/inputs/*/completionOutput/operation", "Coordinator Operation", ), - N::global("functions/*/output/typeRef", "Coordinator type"), - N::global("functions/*/output/operationInput", "Coordinator Operation"), + N::global("transforms/*/output/typeRef", "Coordinator type"), N::global( - "functions/*/output/operationOutput", + "transforms/*/output/operationInput", "Coordinator Operation", ), N::global( - "functions/*/output/operationRefusal", + "transforms/*/output/operationOutput", "Coordinator Operation", ), N::global( - "functions/*/output/completionOutput/operation", + "transforms/*/output/operationRefusal", + "Coordinator Operation", + ), + N::global( + "transforms/*/output/completionOutput/operation", "Coordinator Operation", ), N::global("operations/*/responseSchema/typeRef", "Coordinator type"), @@ -252,7 +255,7 @@ pub(super) const DOCUMENTS: &[DocumentRules] = &[ references: REFERENCES, // Assets remain navigation targets; no Rhai or generated contract bytes are indexed. files: &[ - FileRule::root("functions/*/source", false), + FileRule::root("transforms/*/source", false), FileRule::root("contracts/*/source", false), ], }, diff --git a/crates/registry-language-server/tests/coordinator_navigation.rs b/crates/registry-language-server/tests/coordinator_navigation.rs index c4d256e462..1562a85e0e 100644 --- a/crates/registry-language-server/tests/coordinator_navigation.rs +++ b/crates/registry-language-server/tests/coordinator_navigation.rs @@ -19,8 +19,8 @@ types: <|type|>request: {type: object} contracts: <|contract|>registry: {type: breg, source: <|contract-file|>generated/registry.json} -functions: - <|function|>make-request: +transforms: + <|transform|>make-request: runtime: rhai source: <|function-file|>functions.rhai entrypoint: make_request @@ -41,8 +41,8 @@ workflow: dataSchema: urn:example:remote-event:v1 event: {typeRef: <|event-type-use|>request} input: - type: function - function: <|event-function-use|>make-request + type: transform + transform: <|event-function-use|>make-request inputs: {request: {type: input}} review: outcomes: @@ -53,8 +53,8 @@ workflow: type: call operation: <|operation-use|>read-record input: - type: function - function: <|function-use|>make-request + type: transform + transform: <|function-use|>make-request inputs: {request: {type: input}} next: <|next-use|>complete <|finish|>complete: @@ -66,7 +66,7 @@ workflow: record: {type: step, step: <|step-use|>read} literal: type: literal - value: {type: function, function: not-a-local-function, step: not-a-local-step, typeRef: not-a-local-type} + value: {type: transform, transform: not-a-local-function, step: not-a-local-step, typeRef: not-a-local-type} outcomes: <|outcome|>handled: {operationOutput: <|output-operation-use|>read-record} "#; @@ -100,8 +100,8 @@ fn coordinator_native_review_and_event_edges_resolve_without_claiming_external_n ("operation-use", "operation", "read-record"), ("output-operation-use", "operation", "read-record"), ("contract-use", "contract", "registry"), - ("function-use", "function", "make-request"), - ("event-function-use", "function", "make-request"), + ("function-use", "transform", "make-request"), + ("event-function-use", "transform", "make-request"), ("start-use", "step", "read"), ("next-use", "finish", "complete"), ("step-use", "step", "read"), @@ -262,7 +262,7 @@ async fn coordinator_discovery_unsaved_diagnostics_and_watched_assets_use_the_re ); let changed = source - .replace("function: make-request", "function: unknown-function") + .replace("transform: make-request", "transform: unknown-function") .replace("operation: read-record", "operation: unknown-operation") .replace("start: read", "start: unknown-step") .replace("typeRef: request", "typeRef: unknown-type") diff --git a/docs/site/src/content/docs/configure/adapter-jobs.mdx b/docs/site/src/content/docs/configure/adapter-jobs.mdx index 3b756ef826..2f32611da7 100644 --- a/docs/site/src/content/docs/configure/adapter-jobs.mdx +++ b/docs/site/src/content/docs/configure/adapter-jobs.mdx @@ -373,7 +373,7 @@ A metadata mismatch or operation refusal never selects another operation or dest {/* Evidence: crates/registry-adapter-connectors/src/coordinator_event.rs a_rotating_trigger_sends_the_current_signature_first */} {/* Evidence: crates/registry-adapter-job/src/runtime_destination.rs resolve_destination_keys */} -The job sends one event per item as a canonical JSON `HookEnvelope` in a Standard Webhooks POST to `/v1/events/{workflow}/{trigger}`. +The job sends one event per item as a canonical JSON `HookEnvelope` in a Standard Webhooks POST to `/v1/events/{workflowId}/{triggerId}`. The request carries `accept: application/json`, `content-type: application/json`, `webhook-id`, `webhook-timestamp`, and `webhook-signature`. The signature covers the envelope ID, the send time in Unix seconds, and the exact body bytes. The receiver accepts a `webhook-timestamp` up to 300 seconds before or after its own clock. diff --git a/docs/site/src/content/docs/configure/coordinator.mdx b/docs/site/src/content/docs/configure/coordinator.mdx index e6d4593921..976f784ddf 100644 --- a/docs/site/src/content/docs/configure/coordinator.mdx +++ b/docs/site/src/content/docs/configure/coordinator.mdx @@ -136,17 +136,18 @@ read-application: `type: input` reads the run's input, `type: step` an earlier call's output, and `type: literal` a fixed value. A `path` is a JSON Pointer into it. `type: fields` builds an object of up to 64 -members, and `type: function` computes the value with a Function, as `permission` and `notify` do. +members, and `type: transform` computes the value with a Transform, as `permission` and `notify` do. {/* Evidence: crates/registry-coordinator/src/cli.rs, render_explain; crates/registry-coordinator/src/authoring.rs, AuthoredStep, Mapping; crates/registry-coordinator/src/operations.rs, CATALOG. */} -## Functions +## Transforms -`notice-route` and `notice-request` are Rhai entrypoints in `functions.rhai`. `workflow.yaml` -declares each one's inputs and output by schema, here the read operation's output and the -Messaging operation's input: +Declare `notice-route` and `notice-request` under `transforms` in `workflow.yaml`. +Each [Transform](../../reference/glossary/#transform) names a Rhai entrypoint in `functions.rhai` +and declares its input and output schemas. +This Transform reads the BReg operation's output and produces the Messaging operation's input. ```yaml title="follow-up/workflow.yaml" test-excerpt="follow-up/workflow.yaml" notice-request: @@ -162,13 +163,17 @@ notice-request: operationInput: notices-submit-message ``` -A Function is pure: it has no clock, network, database, file, or credential. The host checks its +A Transform is pure: it has no clock, network, database, file, or credential. The host checks its inputs and output against those schemas and stops it at the limits `check --explain` prints. -`add_seconds` and `seconds_between` compute over instants a Function is given. +`add_seconds` and `seconds_between` compute over instants a Transform is given. {/* Evidence: crates/registry-coordinator/src/functions.rs; crates/registry-coordinator/src/definition.rs, FunctionLimits. */} +If you are upgrading an authored workflow, rename its `functions` section to `transforms`. +In each mapping, change `type: function` to `type: transform` and rename its `function` member +to `transform`. Then run `coordinatorctl check --project ./follow-up`. + ## Check a change `check` fits every mapping to the schemas it reads and feeds. Misspell the input member the read @@ -216,7 +221,7 @@ Valid runtime configuration ``` The `Definition:` digest is the workflow revision. It hashes what execution depends on: input, -steps, outcomes, and the operation and Function revisions used. Labels, descriptions (including `project.label` and `project.description`), and +steps, outcomes, and the operation and Transform revisions used. Labels, descriptions (including `project.label` and `project.description`), and `project.version` do not change it. Every run records the revision it was admitted under. {/* Evidence: crates/registry-coordinator/src/mapping_check.rs; @@ -250,7 +255,7 @@ The schema execution profile is pinned in every snapshot; unknown formats and re ### Build nested objects A `fields` mapping builds an object member by member. -Each member is a reference (`input`, `step`, or `literal`) or another `fields` mapping, so a workflow builds a structured operation input without a Function: +Each member is a reference (`input`, `step`, or `literal`) or another `fields` mapping, so a workflow builds a structured operation input without a Transform: ```yaml start: @@ -278,8 +283,8 @@ start: Nesting reaches a depth of 4, counting the outermost mapping as 1, and the whole mapping holds at most 64 members across all levels. A nested object counts as one member, and so does each of its own members. -A nested member holds only references and further `fields` mappings, never a Function: compute such a value in an earlier step and reference it. -`wait-until`, `choose`, and Function `inputs` still take references only. +A nested member holds only references and further `fields` mappings, never a Transform: compute such a value in an earlier step and reference it. +`wait-until`, `choose`, and Transform `inputs` still take references only. Compilation refuses a fifth level with `mapping.fields-depth` and a 65th member with `mapping.fields-count`, each at the member's path. The compiler checks every member against the operation input schema at that member's path, and the built object is validated again before preparation. @@ -311,7 +316,7 @@ size: Conditions run in order and stop at the first decisive one, so `present: true` before a numeric test guards an optional value. A missing or wrongly typed value in any other test fails the run with `choice-invalid`; it never routes silently to `unmatched`. -A compare holds no Function and no clock. +A compare holds no Transform and no clock. A compare treats the numbers `4` and `4.0` as equal, as JSON Schema does. Casework routing uses the same `equals` and `oneOf` names but compares JSON values exactly, so `4` and `4.0` differ there. @@ -377,12 +382,12 @@ Give the deadline route its own steps, such as a notice and a finish, disjoint f {/* Evidence: crates/registry-coordinator/src/authoring.rs service_deadline_seconds, on_deadline. */} -### Function helpers +### Transform helpers Each Rhai entrypoint takes one object of its declared named inputs and returns one typed value. -A Function declares `runtime`, `source`, `entrypoint`, `inputs`, and `output`. +A Transform declares `runtime`, `source`, `entrypoint`, `inputs`, and `output`. Explicit limits can only narrow the host's ceilings on operations, calls, expressions, strings, arrays, maps, and source size. -A Function cannot obtain credentials, read a clock, or reach a filesystem, network, or database, and it cannot construct workflow steps. +A Transform cannot obtain credentials, read a clock, or reach a filesystem, network, or database, and it cannot construct workflow steps. The profile's callable names are the interpreter's own calls, the arithmetic, logic, string, array, map, and iterator packages, and these helpers: @@ -396,14 +401,14 @@ The trigonometric, hyperbolic, exponential, and logarithmic functions are not av A result that holds NaN or an infinite number is refused with `function.execution`. A top-level `const` is not visible inside a function: read it as `global::NAME` or pass it as an input. -`check` reports a call to any other name as `coordinator.function.unknown-call` at its position in the Function source, unless the source defines that name. -Calls are matched by name only, so a wrong argument count still fails when the Function runs. -The check is an authoring aid, not a security boundary: the engine refuses any name it lacks when the Function runs. +`check` reports a call to any other name as `coordinator.transform.unknown-call` at its position in the Transform source, unless the source defines that name. +Calls are matched by name only, so a wrong argument count still fails when the Transform runs. +The check is an authoring aid, not a security boundary: the engine refuses any name it lacks when the Transform runs. It also reads a string literal given to `Fn`, `is_def_fn`, or an array method such as `map` as a function name, and skips a method call whose name the source also uses as a map key or property. -`coordinatorctl explain functions` prints the names, the interpreter ABI, and the limits. +`coordinatorctl explain transforms` prints the names, the interpreter ABI, and the limits. The ABI names the helper set, so a definition frozen under an earlier ABI is refused with `definition.abi` and the project is re-authored. -{/* Evidence: crates/registry-coordinator/tests/helper_functions.rs coordinator.function.unknown-call; +{/* Evidence: crates/registry-coordinator/tests/helper_functions.rs coordinator.transform.unknown-call; crates/registry-coordinator/src/functions.rs; crates/registry-coordinator/src/definition.rs definition.abi. */} @@ -479,7 +484,7 @@ A trigger accepts a logical source, an exact event type and data-schema identity The event source owns event meaning and disclosure, and product event names and payload meanings stay in the authored project. The receiving workflow uses the same finite execution engine and independently authorised downstream connections as an explicit start. -The receiver is `POST /v1/events/{workflow}/{trigger}`. +The receiver is `POST /v1/events/{workflowId}/{triggerId}`. It accepts the shared HookEnvelope signed with Standard Webhooks using the key configured for that workflow and trigger under `eventSources`. - The authenticated source URI, the event ID, and the trigger bind admission independently of the local source alias, and the canonical event bytes bind exact retries. @@ -522,8 +527,8 @@ await-review: `timeoutSeconds` is required and shorter than the run deadline. Casework submission exposes `result`, and the BReg Proposal operations expose `proposal`. The payment collection operations expose `collection` and the disbursement operations expose `disbursement`, as [Collect and disburse payments](#collect-and-disburse-payments) describes. -An external GET operation can declare a named `bounded-poll` completion with a typed pure `interpret` Function and `intervalSeconds`. -The Function receives the saved command and the latest validated response and returns `pending`, `complete` with a typed result, or a declared `refused` code. +An external GET operation can declare a named `bounded-poll` completion with a typed pure `interpret` Transform and `intervalSeconds`. +The Transform receives the saved command and the latest validated response and returns `pending`, `complete` with a typed result, or a declared `refused` code. The host owns transport, credentials, permitted destinations, scheduling, correlation, and the durable read budget, and the workflow graph stays acyclic. External polling is independent of Casework and BReg, and neither external operation offers an arbitrary HTTP method or a dynamic destination. @@ -863,7 +868,7 @@ An `external.get/v1` alias can specialise its validated response and declare a b `external.command/v1` sends one POST to a provider the operator configured. Workflow data supplies only the JSON body; the runtime connection fixes the origin, the exact relative `commandPath`, and the credential, and redirects are never followed. A connection without `commandPath` stays read-only, and `check` refuses a command alias bound to it or to a connection of another type. -The alias names a required `interpret` Function and can specialise the provider's `{status, body}` response: +The alias names a required `interpret` Transform and can specialise the provider's `{status, body}` response: ```yaml types: @@ -887,7 +892,7 @@ types: properties: state: {type: string, const: uncertain} -functions: +transforms: bill-outcome: runtime: rhai source: functions.rhai @@ -905,14 +910,14 @@ operations: interpret: bill-outcome ``` -The Function reads the frozen command and the validated response, held to the alias's `responseSchema`, and returns `accepted` with a result, `refused` with a declared code, or `uncertain`. +The Transform reads the frozen command and the validated response, held to the alias's `responseSchema`, and returns `accepted` with a result, `refused` with a declared code, or `uncertain`. The step output is the accepted `result`, typed by the `bill` schema in this example. A declared code takes `onDeclaredRefusal` as `{refusalCode}`, and an interpreter that never returns `refused` has no refusal route. -Return `uncertain` for any answer the Function does not recognise, so the run holds instead of guessing. +Return `uncertain` for any answer the Transform does not recognise, so the run holds instead of guessing. An accepted result is the provider's answer as the project interprets it; Coordinator does not independently verify the provider's effect. -Only a response whose status Coordinator neither holds nor retries reaches the Function: a redirect, a 429, and any 5xx never do. -Fixtures reply to the step with `type: response` and a `{status, body}` value, which the same Function interprets, and the status must be one the Function sees at run time. +Only a response whose status Coordinator neither holds nor retries reaches the Transform: a redirect, a 429, and any 5xx never do. +Fixtures reply to the step with `type: response` and a `{status, body}` value, which the same Transform interprets, and the status must be one the Transform sees at run time. A `success` or `declared-refusal` reply to the step is refused. `coordinatorctl test` refuses a `response` reply with a redirect, 429, or 5xx status at `scenario.reply`, naming the `uncertain` or `retryable` reply that models it. @@ -1069,7 +1074,7 @@ same for Python. Regenerate after any change that moves the revision. Give the operator the package directory, its package digest, and a `runtime.yaml` template with secret references and no secret values. For each connection, list the product, the access profile -or review policy it needs, and for Messaging the template and sender profile the Functions name. +or review policy it needs, and for Messaging the template and sender profile the Transforms name. The operator pins the package in `deployment.packages` by `root` and `expectedDigest`. One deployment serves up to sixteen workflows; each is applied, upgraded, and rolled back on its own, and a run keeps the definition it started with. diff --git a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx index 2b86ee494e..510ab8da7f 100644 --- a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx +++ b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx @@ -885,8 +885,10 @@ A later `start` creates a fresh application run. Product data on managed Postgre ### Choose a function or a flow Use a server-side function for work that finishes within one request. Use a Coordinator flow when -work waits for a person or a date, or when each step needs review. Call function code from the -flow when the flow cannot express an individual step. +work waits for a person or a date, or when each step needs review. When a step needs code the +flow cannot express, the existing +[`external.command/v1` operation](../coordinator/#call-an-external-provider) can call an external +provider. The operator binds the destination and credential in the Coordinator runtime file. A function owns no product authority. The product authorises every call the function makes. When the whole procedure lives in function code, you lose the Coordinator diagram and its diff --git a/docs/site/src/content/docs/operate/coordinator.mdx b/docs/site/src/content/docs/operate/coordinator.mdx index f95a9c5639..1f49c16706 100644 --- a/docs/site/src/content/docs/operate/coordinator.mdx +++ b/docs/site/src/content/docs/operate/coordinator.mdx @@ -150,7 +150,7 @@ Retain the keys needed to read those snapshots and the custody metadata needed f Pin the package digest for exact bytes; use `workflowRevision` for execution semantics. -- The computed workflow revision hashes the input, graph, outcomes, used Operation and Function revisions, and host execution contracts. +- The computed workflow revision hashes the input, graph, outcomes, used Operation and Transform revisions, and host execution contracts. Presentation labels and descriptions do not change it. `check` prints it on its `Definition:` line, and start, status, list, and inspect report it as `workflowRevision`. Existing runs keep their admitted revision. @@ -902,7 +902,7 @@ The client resends an admission whose outcome is unknown only under its original An operator policy lists every owner's runs in those workflows. `limit` takes 1 to 100 and defaults to 20. Pass `nextCursor` as `cursor` with the same filters to continue; each page rechecks current caller and workflow permissions. -Keep the run ID a start returns for direct lookup with `GET /v1/runs/{run}`. +Keep the run ID a start returns for direct lookup with `GET /v1/runs/{runId}`. Filters, which combine: @@ -1067,7 +1067,7 @@ An `external.command/v1` call has no read-only receipt, so `reconcile` reports ` The run holds at once with the effect unknown, and `retry-same` resends the same command while the deadline is still in the future. A 429 the deadline ends still ends the run `expired`. - A command ignores a `Retry-After` it cannot use, such as a date, a duplicate field, a malformed value, or a wait over 86,400 seconds, and retries on the ordinary backoff instead. -- Any other server error, a redirect, a timeout, a lost acknowledgement, or a response the interpretation Function cannot settle holds the run as uncertain. +- Any other server error, a redirect, a timeout, a lost acknowledgement, or a response the interpretation Transform cannot settle holds the run as uncertain. - After an uncertain attempt, including a retried 503, a declared refusal or 429 keeps the run held. Check the provider's record and cancel the run if no further step is wanted. diff --git a/docs/site/src/content/docs/reference/api-stability.mdx b/docs/site/src/content/docs/reference/api-stability.mdx index 9f3f050871..4025926467 100644 --- a/docs/site/src/content/docs/reference/api-stability.mdx +++ b/docs/site/src/content/docs/reference/api-stability.mdx @@ -69,10 +69,10 @@ Registry Evidence's versioned routes are `POST /v1/evidence`, `POST /v1/evidence [experimental surfaces](#experimental-surfaces). Registry Coordinator's promise covers its workflow model of five step types, its run API, and -the `coordinator` SDK namespace. Its versioned routes are `GET /v1/workflows/{workflow}`, -`POST /v1/runs`, `GET /v1/runs`, `GET /v1/runs/{run}`, `GET /v1/runs/{run}/inspect`, -`POST /v1/runs/{run}/retry-same`, `POST /v1/runs/{run}/cancel`, `POST /v1/runs/{run}/reconcile`, -`POST /v1/runs/{run}/check`, `POST /v1/events/{workflow}/{trigger}`, and +the `coordinator` SDK namespace. Its versioned routes are `GET /v1/workflows/{workflowId}`, +`POST /v1/runs`, `GET /v1/runs`, `GET /v1/runs/{runId}`, `GET /v1/runs/{runId}/inspect`, +`POST /v1/runs/{runId}/retry-same`, `POST /v1/runs/{runId}/cancel`, `POST /v1/runs/{runId}/reconcile`, +`POST /v1/runs/{runId}/check`, `POST /v1/events/{workflowId}/{triggerId}`, and `POST /v1/review-completions`. Its deployment-wide operator routes are `GET /v1/doctor`, `POST /v1/restore-hold`, `POST /v1/release-restore-hold`, `POST /v1/release-admission-hold`, `POST /v1/complete-execution-recovery`, and `POST /v1/retention`. Its operational routes are diff --git a/docs/site/src/content/docs/reference/apis/registry-coordinator.mdx b/docs/site/src/content/docs/reference/apis/registry-coordinator.mdx index c54ff48477..7b4357bcb9 100644 --- a/docs/site/src/content/docs/reference/apis/registry-coordinator.mdx +++ b/docs/site/src/content/docs/reference/apis/registry-coordinator.mdx @@ -17,7 +17,7 @@ import ApiReferenceTable from '../../../../components/ApiReferenceTable.astro'; Registry Coordinator serves one HTTP surface for starting a run of a served workflow, following and recovering that run, operating the deployment, and taking Casework completion wake-ups. Every route except `/health`, `/ready`, `/v1/review-completions`, and -`/v1/events/{workflow}/{trigger}` takes a caller access token, and the access profile that token +`/v1/events/{workflowId}/{triggerId}` takes a caller access token, and the access profile that token resolves to decides what the caller may do. A Casework completion authenticates with its Standard Webhooks signature, as does a product event. [API stability](../../api-stability/) states the versioning contract. @@ -66,7 +66,7 @@ configured for that connection, and the receiving product decides it. ## Discover a workflow -`GET /v1/workflows/{workflow}` returns the active permitted contract, including `workflowRevision`, +`GET /v1/workflows/{workflowId}` returns the active permitted contract, including `workflowRevision`, input, and declared outcomes. It requires the caller's `start` action for that Workflow. Use that revision for fresh starts or a generated revision-pinned TypeScript/Python wrapper. Generated wrappers provide typed `start`, `get`, and `cancel` over the maintained public generic @@ -106,7 +106,7 @@ A start is refused before admission when: ## Start a run from a product event -`POST /v1/events/{workflow}/{trigger}` admits a run from a signed product event, when the workflow +`POST /v1/events/{workflowId}/{triggerId}` admits a run from a signed product event, when the workflow declares that trigger and the runtime file lists its source under `eventSources`. The body is the platform hook envelope, at most 1,048,576 canonical JSON bytes, above which it answers `413 request.body-too-large`; the admitted event value must then fit the 131,072-byte value @@ -130,7 +130,7 @@ The event grants no authority for the calls the run then makes. ## Read and inspect runs -`GET /v1/runs/{run}` answers the run's `RunStatus`: its `workflow`, computed `workflowRevision`, +`GET /v1/runs/{runId}` answers the run's `RunStatus`: its `workflow`, computed `workflowRevision`, `bindingDigest`, its current step and state, when it was admitted and when its deadline falls, whether an effect is `uncertain`, and whether it needs restore review. `stepLabel` is the label the workflow author gave the current step, as packaged in the workflow @@ -160,7 +160,7 @@ includes `nextCursor`, pass it as `cursor` with the same filters to continue. Ev current caller and workflow permissions. An invalid cursor or one from a different caller or filter answers `400 request.invalid`. Keep the run ID a start returns for direct status lookup. -`GET /v1/runs/{run}/inspect` answers the run, one entry per step with its state, attempt count, +`GET /v1/runs/{runId}/inspect` answers the run, one entry per step with its state, attempt count, whether its command is prepared, whether its effect is uncertain, and whether its receipt expired, and a `recovery` block. `recovery.retryAllowed` and `recovery.reason` describe whether the run can be scheduled again. For a compatible current call, `recovery.operation` names the pinned operation's diff --git a/docs/site/src/content/docs/reference/glossary.mdx b/docs/site/src/content/docs/reference/glossary.mdx index eecbeea412..d0cf3c90f0 100644 --- a/docs/site/src/content/docs/reference/glossary.mdx +++ b/docs/site/src/content/docs/reference/glossary.mdx @@ -111,7 +111,7 @@ Product names are always in English, including on future translated pages.
An `evidence.yaml` file and the scripts it names, kept in version control, declaring assertion definitions, sources, lookups, and Functions. `evidencectl` checks, tests, and packages it with a target into a deployment candidate.
Function
-
A project-local typed implementation asset. In BReg, an Action's Plan uses one to compute effects within the Action's declared write ceiling; it cannot grant authority or invent a review decision. In an Evidence project, a Rhai script with the `assertion-derive/v1` interface that turns a source route's validated facts into declared outputs, under fixed operation and size limits. Provider response normalisation belongs to the reviewed Adapter pack. In a Registry Coordinator workflow, a Rhai script that routes a `choose` step or computes a value a call's input maps with `type: function`, with no clock, file, network, database, or credentials.
+
A project-local typed implementation asset. In BReg, an Action's Plan uses one to compute effects within the Action's declared write ceiling; it cannot grant authority or invent a review decision. In an Evidence project, a Rhai script with the `assertion-derive/v1` interface that turns a source route's validated facts into declared outputs, under fixed operation and size limits. Provider response normalisation belongs to the reviewed Adapter pack.
grant ceiling
The widest authority a Registry Evidence assertion definition lets any grant give for it: the authorities, actor kinds, value origins, and audiences a grant may name. A target authority's grant may only narrow it; Registry Evidence refuses to activate one that widens it.
@@ -296,6 +296,9 @@ Product names are always in English, including on future translated pages.
team
A named Casework group that serves queues and declares the profiles its members and supervisors must hold; its membership lives in the directory.
+
Transform
+
A bounded Rhai computation in a Registry Coordinator workflow. A `type: transform` mapping calls it with named, typed inputs. It can select a branch or compute an operation value using only the supplied data.
+
trust domain
The institutional boundary whose operators, runtime identities, policy, keys, and approval govern one deployment. A Registry Evidence process serves one trust domain, named by the URI in `service.trustDomain`, with one signer and one audit boundary.
diff --git a/docs/site/src/content/docs/security/coordinator.mdx b/docs/site/src/content/docs/security/coordinator.mdx index d7a61e323a..150a5b50fa 100644 --- a/docs/site/src/content/docs/security/coordinator.mdx +++ b/docs/site/src/content/docs/security/coordinator.mdx @@ -25,7 +25,7 @@ Deployment steps are in [Deploy Registry Coordinator](../../operate/coordinator/ Adapter payment connection. Operator configuration is trusted; workflow data is not. - A workflow author writes a project that Coordinator freezes into a definition. - The author supplies bodies, mappings and pure Functions. + The author supplies bodies, mappings and pure Transforms. The author does not choose destinations, headers, credentials or recovery behaviour; the closed operation catalogue does. - Providers decide every effect a run requests: Registry Casework, Registry Scheduling, BReg, the @@ -232,12 +232,12 @@ Enforcement: Once the request may have left, a lost or broken exchange, a timeout, a redirect, any other 5xx, and an oversize, malformed or schema-invalid response are uncertain and hold the run. - Coordinator checks the response against the alias's `responseSchema`, then runs the project's - pinned pure Function. + pinned pure Transform. Only `accepted` with a result matching the step's declared output, or `refused` with a declared - code, leaves the hold; everything else, including a Function error, is uncertain. - The worker and offline scenarios use the same Function, and scenario validation + code, leaves the hold; everything else, including a Transform error, is uncertain. + The worker and offline scenarios use the same Transform, and scenario validation (`scenario.reply`) refuses a `success` or `declared-refusal` reply to the step, so no scenario - reaches a result or refusal route the Function would not produce. + reaches a result or refusal route the Transform would not produce. Transport and scenario validation share one status classification, so a `response` reply with a status the worker holds or retries before interpretation (a redirect, a 429 or any 5xx) is refused too. @@ -489,9 +489,9 @@ Refused: a metadata answer beyond 8 MiB; any business answer beyond 64 KiB. derived_response_limits_retain_credentials_and_leave_the_original_bound_unchanged. These HTTP fixtures do not establish database transaction or deployed service behavior. */} -### COORDINATOR-INV-09: the pure Function profile is bounded and deterministic +### COORDINATOR-INV-09: the pure Transform profile is bounded and deterministic -Threat: a pure Function runs author-supplied code inside the worker. +Threat: a pure Transform runs author-supplied code inside the worker. An argument-controlled loop or allocation could hold a worker thread or exhaust memory. A host-dependent result could differ when a wait replays or a job attempt recomputes, and a changed engine could reinterpret a frozen definition. @@ -535,18 +535,18 @@ Enforcement: functions take results from the platform math library and may differ in the last digits between operating systems, CPU architectures or library versions. Results are recomputed, not only read back: a held wait is recomputed when waits replay, the next - WaitUntil is evaluated again, and each job attempt runs the Function again. + WaitUntil is evaluated again, and each job attempt runs the Transform again. A deadline computed with such a function could therefore land a second apart on two hosts. Coordinator registers only deterministic functions: `sqrt`, `floor`, `ceiling`, `round`, `int`, `fraction`, `is_nan`, `is_finite`, `is_infinite`, `to_degrees`, `to_radians`, `PI`, `E`, `parse_int`, `parse_float`, `to_int` and `to_float`, next to the arithmetic package's `abs`, `sign`, `min` and `max`. -- A Function result holding NaN or an infinite float (`0.0 / 0.0`, `sqrt(-1.0)`) is refused with +- A Transform result holding NaN or an infinite float (`0.0 / 0.0`, `sqrt(-1.0)`) is refused with `function.execution` where results turn into JSON, instead of becoming `null`. - The unknown-call check walks the syntax tree and function table, which Rhai exposes only under its `internals` feature, enabled in the build. It is an authoring aid, not a security boundary: the engine refuses any name it lacks when the - Function runs. + Transform runs. Refused: empty-padding `pad`; `pad` or `replace` results over the string budget; NaN and infinity results; a definition frozen under another interpreter identity; any function outside the @@ -616,7 +616,7 @@ admission. Startup refuses a profile without `subjects`. Threat: every workflow in a deployment calls Casework under the same review producer identity, so Casework cannot tell which run submitted a review request. -A cancel whose `request` is built from input, a literal, a Function or another step could withdraw +A cancel whose `request` is built from input, a literal, a Transform or another step could withdraw a review that another run submitted. Enforcement: check refuses a `casework.cancel-review-request/v1` step unless its input is a fields @@ -891,7 +891,7 @@ The residuals refer to them by number. A live run whose retained definition a version does not restore, under another interpreter identity or a restore rule it breaks, is held with `definition-refused`, and only a release that accepts its definition can end it (COORDINATOR-INV-12). -9. Treat a project's Function as reviewed code: a Function that maps an ambiguous provider answer +9. Treat a project's Transform as reviewed code: a Transform that maps an ambiguous provider answer to `accepted` is an authoring defect that scenarios and review must catch. 10. List in each access profile's `subjects` only the identities it is meant to admit: a producer client's own service-account subject, or the named operators. @@ -987,10 +987,10 @@ Each residual names the condition under which it applies, its consequence, and t - Consequence: `reconcile` cannot settle an uncertain command. - Mitigation: check the provider's records, then retry or cancel the held run. -### COORDINATOR-RES-08: an accepted result is the Function's reading +### COORDINATOR-RES-08: an accepted result is the Transform's reading - Condition: Coordinator does not independently verify the provider's effect. -- Consequence: a Function that maps an ambiguous answer to `accepted` records an effect that may +- Consequence: a Transform that maps an ambiguous answer to `accepted` records an effect that may not have happened. - Mitigation: cover ambiguous answers in scenarios and review. @@ -1106,7 +1106,7 @@ Each residual names the condition under which it applies, its consequence, and t ### COORDINATOR-RES-19: float `**` is not on the deterministic math list -- Condition: a Function uses float `**` (`powf`, in the arithmetic package). +- Condition: a Transform uses float `**` (`powf`, in the arithmetic package). - Consequence: its result is not covered by the deterministic-math rule, so last digits could differ across hosts. - Mitigation: do not derive a deadline or a comparison threshold from float `**`. diff --git a/docs/site/src/content/docs/start/coordinator.mdx b/docs/site/src/content/docs/start/coordinator.mdx index fa5ad46650..22ce72f66b 100644 --- a/docs/site/src/content/docs/start/coordinator.mdx +++ b/docs/site/src/content/docs/start/coordinator.mdx @@ -39,9 +39,9 @@ cannot restore that definition holds the run. A workflow is built from five step types: - `call` runs one product operation. -- `choose` routes on one typed value, on a pure [Function](../../reference/glossary/#function) +- `choose` routes on one typed value, on a pure [Transform](../../reference/glossary/#function) written in bounded [Rhai](../../reference/glossary/#rhai), or on a `compare` of typed values that - needs no Function. In a `compare`, a value that is missing or of the wrong type fails the run + needs no Transform. In a `compare`, a value that is missing or of the wrong type fails the run instead of routing to `unmatched`. The `present` test is the exception, because it reads absence. - `wait-until` waits for an instant. - `wait-for` waits for a named result, such as a Casework review decision. @@ -49,7 +49,7 @@ A workflow is built from five step types: `coordinatorctl check` compiles the project offline. It proves that each step a mapping reads has run on every route that reaches it, and it checks each path against the declared schemas. Values a -schema leaves open, and values a Function computes, are left to scenarios and the runtime. +schema leaves open, and values a Transform computes, are left to scenarios and the runtime. `coordinatorctl package` freezes the project into an immutable [package](../../reference/glossary/#package) whose digest the deployment pins. @@ -63,7 +63,7 @@ schema leaves open, and values a Function computes, are left to scenarios and th An authorised caller starts a run with `POST /v1/runs`, giving the expected workflow revision, its input, and an idempotency key. An authored event trigger can also start one from a signed product -event at `POST /v1/events/{workflow}/{trigger}`, and an authored calendar trigger starts one on a +event at `POST /v1/events/{workflowId}/{triggerId}`, and an authored calendar trigger starts one on a schedule with no caller. The same key with the same revision and input returns the same run, and the [API reference](../../reference/apis/registry-coordinator/) states what a conflicting reuse gets. diff --git a/products/adapter/examples/kobotoolbox-job/workflow/workflow.yaml b/products/adapter/examples/kobotoolbox-job/workflow/workflow.yaml index e449f06d23..dd9a02a1e2 100644 --- a/products/adapter/examples/kobotoolbox-job/workflow/workflow.yaml +++ b/products/adapter/examples/kobotoolbox-job/workflow/workflow.yaml @@ -40,7 +40,7 @@ contracts: households: type: breg source: generated/households.contract.json -functions: +transforms: proposal-request: runtime: rhai source: functions.rhai @@ -132,8 +132,8 @@ workflow: type: call operation: submit-household input: - type: function - function: proposal-request + type: transform + transform: proposal-request inputs: event: {type: input, path: /event} next: await-proposal @@ -155,8 +155,8 @@ workflow: type: call operation: lookup-household input: - type: function - function: lookup-request + type: transform + transform: lookup-request inputs: event: {type: input, path: /event} next: review-resolved @@ -165,8 +165,8 @@ workflow: type: call operation: submit-review input: - type: function - function: resolved-review-request + type: transform + transform: resolved-review-request inputs: event: {type: input, path: /event} lookup: {type: step, step: lookup-revised} @@ -181,8 +181,8 @@ workflow: type: call operation: submit-review input: - type: function - function: unresolved-review-request + type: transform + transform: unresolved-review-request inputs: event: {type: input, path: /event} next: await-unresolved-review @@ -196,8 +196,8 @@ workflow: type: call operation: submit-review input: - type: function - function: returned-review-request + type: transform + transform: returned-review-request inputs: event: {type: input, path: /event} next: await-returned-review diff --git a/products/coordinator/AGENTS.md b/products/coordinator/AGENTS.md index 8ca991b8c2..548afa576e 100644 --- a/products/coordinator/AGENTS.md +++ b/products/coordinator/AGENTS.md @@ -36,8 +36,8 @@ receives the call, which decides it under its own authorization. that contract. Wake-ups only advance an eligible authoritative read and start no run. Keep the durable observation floor, budget, correlation, and original deadline intact across recovery. -- Keep the canonical authoring separation: contracts, types, named pure Functions, - local exact Operation aliases, and one Workflow graph. Functions take one typed +- Keep the canonical authoring separation: contracts, types, named pure Transforms, + local exact Operation aliases, and one Workflow graph. Transforms take one typed object of named inputs and gain no I/O capability. Runtime uses one tagged connections map. Each exact verified client identity resolves one access profile, which scopes run actions through workflows. Start requires the expected workflowRevision. diff --git a/products/coordinator/CHANGELOG.md b/products/coordinator/CHANGELOG.md index b0d0a6f445..6f74ab51fe 100644 --- a/products/coordinator/CHANGELOG.md +++ b/products/coordinator/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- BREAKING: Name the bounded Rhai computations in a Coordinator workflow Transforms. Rename `functions` to `transforms` and use `type: transform` with a `transform` member in mappings. Use `coordinatorctl explain transforms` for the interpreter helpers and update diagnostic consumers from `coordinator.function.*` to `coordinator.transform.*`. Retained definition snapshots keep their reader and revision format. + ## 0.49.0 - 2026-12-01 - BREAKING: BReg record operation outputs use `revisionId` and the updated Registry Record metadata names. Migration: update workflow mappings and fixture replies, then recompile against the regenerated operation contracts. diff --git a/products/coordinator/examples/decision-follow-up/README.md b/products/coordinator/examples/decision-follow-up/README.md index 02d0359e5a..fc1f38383e 100644 --- a/products/coordinator/examples/decision-follow-up/README.md +++ b/products/coordinator/examples/decision-follow-up/README.md @@ -77,5 +77,5 @@ cp /tmp/applications-actions/generated/action-contracts.json \ ``` Review a changed contract before packaging a new workflow version. -Functions declare named input schemas and take one object of those inputs; they do not select +Transforms declare named input schemas and take one object of those inputs; they do not select transport credentials or replace the imported Action contract. diff --git a/products/coordinator/examples/decision-follow-up/workflow.yaml b/products/coordinator/examples/decision-follow-up/workflow.yaml index 7a06a1f976..68aa6f1002 100644 --- a/products/coordinator/examples/decision-follow-up/workflow.yaml +++ b/products/coordinator/examples/decision-follow-up/workflow.yaml @@ -23,7 +23,7 @@ contracts: applications: type: breg source: generated/applications.contract.json -functions: +transforms: assessment-request: runtime: rhai source: functions.rhai @@ -75,8 +75,8 @@ workflow: type: call operation: assessor-evaluate-decision input: - type: function - function: assessment-request + type: transform + transform: assessment-request inputs: input: type: input @@ -84,8 +84,8 @@ workflow: route: type: choose choose: - type: function - function: assessment-route + type: transform + transform: assessment-route inputs: reply: type: step @@ -98,8 +98,8 @@ workflow: type: call operation: applications-invoke-breg-action input: - type: function - function: action-request + type: transform + transform: action-request inputs: input: type: input diff --git a/products/coordinator/examples/deferred-appointment/workflow.yaml b/products/coordinator/examples/deferred-appointment/workflow.yaml index 13e5058a63..6e9c0b16fe 100644 --- a/products/coordinator/examples/deferred-appointment/workflow.yaml +++ b/products/coordinator/examples/deferred-appointment/workflow.yaml @@ -40,7 +40,7 @@ types: expiresAt: type: integer minimum: 1 -functions: +transforms: appointment-route: runtime: rhai source: functions.rhai @@ -129,8 +129,8 @@ workflow: eligibility: type: choose choose: - type: function - function: appointment-route + type: transform + transform: appointment-route inputs: record: type: step @@ -173,8 +173,8 @@ workflow: capacity: type: choose choose: - type: function - function: capacity-route + type: transform + transform: capacity-route inputs: availability: type: step @@ -186,8 +186,8 @@ workflow: type: call operation: bookings-create-appointment input: - type: function - function: booking-request + type: transform + transform: booking-request inputs: input: type: input @@ -202,8 +202,8 @@ workflow: type: call operation: notices-submit-message input: - type: function - function: notice-request + type: transform + transform: notice-request inputs: input: type: input diff --git a/products/coordinator/examples/delayed-follow-up/workflow.yaml b/products/coordinator/examples/delayed-follow-up/workflow.yaml index d7aaa06e93..163c28a75c 100644 --- a/products/coordinator/examples/delayed-follow-up/workflow.yaml +++ b/products/coordinator/examples/delayed-follow-up/workflow.yaml @@ -18,7 +18,7 @@ types: sendAfter: type: string format: date-time -functions: +transforms: notice-route: runtime: rhai source: functions.rhai @@ -77,8 +77,8 @@ workflow: permission: type: choose choose: - type: function - function: notice-route + type: transform + transform: notice-route inputs: record: type: step @@ -90,8 +90,8 @@ workflow: type: call operation: notices-submit-message input: - type: function - function: notice-request + type: transform + transform: notice-request inputs: input: type: input diff --git a/products/coordinator/examples/earlier-appointment-alerts/workflow.yaml b/products/coordinator/examples/earlier-appointment-alerts/workflow.yaml index 282c245a2b..9b18615820 100644 --- a/products/coordinator/examples/earlier-appointment-alerts/workflow.yaml +++ b/products/coordinator/examples/earlier-appointment-alerts/workflow.yaml @@ -28,7 +28,7 @@ contracts: notice-templates: type: messaging source: generated/notices.contract.json -functions: +transforms: source-route: runtime: rhai source: functions.rhai @@ -155,8 +155,8 @@ workflow: source-state: type: choose choose: - type: function - function: source-route + type: transform + transform: source-route inputs: {subscription: {type: step, step: read-subscription}} cases: inspect: read-appointment @@ -167,8 +167,8 @@ workflow: type: call operation: scheduling-read-appointment input: - type: function - function: appointment-request + type: transform + transform: appointment-request inputs: input: {type: input} subscription: {type: step, step: read-subscription} @@ -176,8 +176,8 @@ workflow: appointment-state: type: choose choose: - type: function - function: appointment-route + type: transform + transform: appointment-route inputs: subscription: {type: step, step: read-subscription} appointment: {type: step, step: read-appointment} @@ -186,30 +186,30 @@ workflow: type: call operation: scheduling-preview-availability input: - type: function - function: preview-request + type: transform + transform: preview-request inputs: {subscription: {type: step, step: read-subscription}} next: capacity capacity: type: choose choose: - type: function - function: capacity-route + type: transform + transform: capacity-route inputs: {preview: {type: step, step: preview}} cases: {available: claim-state, unavailable: no-capacity} claim-state: type: choose choose: - type: function - function: claim-route + type: transform + transform: claim-route inputs: {subscription: {type: step, step: read-subscription}} cases: {claim: claim, resume: read-current-subscription} claim: type: call operation: alerts-claim input: - type: function - function: claim-request + type: transform + transform: claim-request inputs: {subscription: {type: step, step: read-subscription}} next: read-current-subscription read-current-subscription: @@ -225,8 +225,8 @@ workflow: type: call operation: scheduling-read-appointment input: - type: function - function: appointment-request + type: transform + transform: appointment-request inputs: input: {type: input} subscription: {type: step, step: read-current-subscription} @@ -234,8 +234,8 @@ workflow: final-state: type: choose choose: - type: function - function: final-route + type: transform + transform: final-route inputs: subscription: {type: step, step: read-current-subscription} appointment: {type: step, step: read-current-appointment} @@ -244,23 +244,23 @@ workflow: type: call operation: scheduling-preview-availability input: - type: function - function: preview-request + type: transform + transform: preview-request inputs: {subscription: {type: step, step: read-current-subscription}} next: final-capacity final-capacity: type: choose choose: - type: function - function: capacity-route + type: transform + transform: capacity-route inputs: {preview: {type: step, step: final-preview}} cases: {available: authorize-dispatch, unavailable: capacity-changed} authorize-dispatch: type: call operation: alerts-authorize-dispatch input: - type: function - function: authorize-request + type: transform + transform: authorize-request inputs: {subscription: {type: step, step: read-current-subscription}} next: read-dispatching-subscription read-dispatching-subscription: @@ -276,8 +276,8 @@ workflow: type: call operation: scheduling-read-appointment input: - type: function - function: appointment-request + type: transform + transform: appointment-request inputs: input: {type: input} subscription: {type: step, step: read-dispatching-subscription} @@ -285,8 +285,8 @@ workflow: dispatch-state: type: choose choose: - type: function - function: dispatch-route + type: transform + transform: dispatch-route inputs: subscription: {type: step, step: read-dispatching-subscription} appointment: {type: step, step: read-dispatching-appointment} @@ -295,16 +295,16 @@ workflow: type: call operation: notices-submit-message input: - type: function - function: notice-request + type: transform + transform: notice-request inputs: {subscription: {type: step, step: read-dispatching-subscription}} next: record-submission record-submission: type: call operation: alerts-record-submission input: - type: function - function: completion-request + type: transform + transform: completion-request inputs: subscription: {type: step, step: read-dispatching-subscription} message: {type: step, step: notify} diff --git a/products/coordinator/examples/external-directory/workflow.yaml b/products/coordinator/examples/external-directory/workflow.yaml index 62c5800893..91d8c55c8f 100644 --- a/products/coordinator/examples/external-directory/workflow.yaml +++ b/products/coordinator/examples/external-directory/workflow.yaml @@ -17,7 +17,7 @@ types: type: string minLength: 1 maxLength: 128 -functions: +transforms: lookup-request: runtime: rhai source: functions.rhai @@ -54,8 +54,8 @@ workflow: type: call operation: directory-external-get input: - type: function - function: lookup-request + type: transform + transform: lookup-request inputs: input: type: input @@ -63,8 +63,8 @@ workflow: result: type: choose choose: - type: function - function: office-route + type: transform + transform: office-route inputs: reply: type: step diff --git a/products/coordinator/examples/external-job/README.md b/products/coordinator/examples/external-job/README.md index 1e34f05720..f0c768ba36 100644 --- a/products/coordinator/examples/external-job/README.md +++ b/products/coordinator/examples/external-job/README.md @@ -11,11 +11,11 @@ coordinatorctl test --project products/coordinator/examples/external-job ``` The `read-job` Operation alias uses `external.get/v1`, specializes its response schema, and exposes -a named `terminal` completion. Its `bounded-poll` declaration names pure Function `job-observation` +a named `terminal` completion. Its `bounded-poll` declaration names pure Transform `job-observation` and a 30-second interval. The workflow reads once, then waits on `completion: {step: read, name: terminal}` for up to 600 seconds within a 900-second run deadline. -The request Function takes one named-input object and selects only the configured `jobs/status` +The request Transform takes one named-input object and selects only the configured `jobs/status` path and `id` query parameter. The interpreter receives the saved original `command` and latest validated `response`. It checks the job ID, returns `pending` for queued/running, `complete` with a typed job result for succeeded, or a declared `external-job-failed` refusal for failed. diff --git a/products/coordinator/examples/external-job/workflow.yaml b/products/coordinator/examples/external-job/workflow.yaml index a98c40d9ad..eec46cfdbb 100644 --- a/products/coordinator/examples/external-job/workflow.yaml +++ b/products/coordinator/examples/external-job/workflow.yaml @@ -50,7 +50,7 @@ types: state: {type: string, const: refused} code: {type: string, enum: [external-job-failed]} -functions: +transforms: job-request: runtime: rhai source: functions.rhai @@ -88,8 +88,8 @@ workflow: type: call operation: read-job input: - type: function - function: job-request + type: transform + transform: job-request inputs: request: {type: input} next: await-terminal diff --git a/products/coordinator/examples/governed-action-follow-up/README.md b/products/coordinator/examples/governed-action-follow-up/README.md index 6d0b753375..be48b94a67 100644 --- a/products/coordinator/examples/governed-action-follow-up/README.md +++ b/products/coordinator/examples/governed-action-follow-up/README.md @@ -96,5 +96,5 @@ cp /tmp/applications-actions/generated/action-contracts.json \ ``` Review a changed contract before packaging a new workflow version. -Functions declare named input schemas and take one object of those inputs; they do not select +Transforms declare named input schemas and take one object of those inputs; they do not select transport credentials or replace the imported Action contract. diff --git a/products/coordinator/examples/governed-action-follow-up/workflow.yaml b/products/coordinator/examples/governed-action-follow-up/workflow.yaml index 2417e1d8ef..68a5167ab0 100644 --- a/products/coordinator/examples/governed-action-follow-up/workflow.yaml +++ b/products/coordinator/examples/governed-action-follow-up/workflow.yaml @@ -18,7 +18,7 @@ contracts: applications: type: breg source: generated/applications.contract.json -functions: +transforms: information-route: runtime: rhai source: functions.rhai @@ -88,8 +88,8 @@ workflow: needs-information: type: choose choose: - type: function - function: information-route + type: transform + transform: information-route inputs: record: type: step @@ -101,8 +101,8 @@ workflow: type: call operation: applications-invoke-breg-action input: - type: function - function: action-request + type: transform + transform: action-request inputs: input: type: input @@ -115,8 +115,8 @@ workflow: type: call operation: notices-submit-message input: - type: function - function: notice-request + type: transform + transform: notice-request inputs: record: type: step diff --git a/products/coordinator/examples/invitation-booking/accept-invitation/workflow.yaml b/products/coordinator/examples/invitation-booking/accept-invitation/workflow.yaml index abbfcf22a9..87f43a7694 100644 --- a/products/coordinator/examples/invitation-booking/accept-invitation/workflow.yaml +++ b/products/coordinator/examples/invitation-booking/accept-invitation/workflow.yaml @@ -22,7 +22,7 @@ contracts: invitations: type: breg source: generated/invitations.contract.json -functions: +transforms: invitation-route: runtime: rhai source: functions.rhai @@ -131,8 +131,8 @@ workflow: current-state: type: choose choose: - type: function - function: invitation-route + type: transform + transform: invitation-route inputs: invitation: {type: step, step: read-invitation} cases: @@ -147,8 +147,8 @@ workflow: type: call operation: invitations-claim input: - type: function - function: claim-request + type: transform + transform: claim-request inputs: input: {type: input} next: read-claimed-invitation @@ -170,16 +170,16 @@ workflow: type: call operation: catalogue-read-availability input: - type: function - function: availability-request + type: transform + transform: availability-request inputs: invitation: {type: step, step: read-claimed-invitation} next: capacity capacity: type: choose choose: - type: function - function: capacity-route + type: transform + transform: capacity-route inputs: availability: {type: step, step: availability} cases: @@ -189,8 +189,8 @@ workflow: type: call operation: invitations-record-no-capacity input: - type: function - function: record-no-capacity-request + type: transform + transform: record-no-capacity-request inputs: invitation: {type: step, step: read-claimed-invitation} next: no-capacity @@ -198,8 +198,8 @@ workflow: type: call operation: book-appointment input: - type: function - function: booking-request + type: transform + transform: booking-request inputs: input: {type: input} invitation: {type: step, step: read-claimed-invitation} @@ -210,8 +210,8 @@ workflow: type: call operation: invitations-record-booking-result input: - type: function - function: record-result-request + type: transform + transform: record-result-request inputs: invitation: {type: step, step: read-claimed-invitation} appointment: {type: step, step: book} @@ -220,8 +220,8 @@ workflow: type: call operation: notices-submit-message input: - type: function - function: notice-request + type: transform + transform: notice-request inputs: invitation: {type: step, step: read-claimed-invitation} appointment: {type: step, step: book} diff --git a/products/coordinator/examples/invitation-booking/issue-invitation/workflow.yaml b/products/coordinator/examples/invitation-booking/issue-invitation/workflow.yaml index 9a0a8ebfd0..8fa14404da 100644 --- a/products/coordinator/examples/invitation-booking/issue-invitation/workflow.yaml +++ b/products/coordinator/examples/invitation-booking/issue-invitation/workflow.yaml @@ -27,7 +27,7 @@ contracts: invitations: type: breg source: generated/invitations.contract.json -functions: +transforms: issue-request: runtime: rhai source: functions.rhai @@ -62,8 +62,8 @@ workflow: type: call operation: invitations-issue input: - type: function - function: issue-request + type: transform + transform: issue-request inputs: input: {type: input} next: read-invitation @@ -80,8 +80,8 @@ workflow: type: call operation: notices-submit-message input: - type: function - function: notice-request + type: transform + transform: notice-request inputs: invitation: {type: step, step: read-invitation} next: accepted diff --git a/products/coordinator/examples/reservation-review/request-only/workflow.yaml b/products/coordinator/examples/reservation-review/request-only/workflow.yaml index bd31b3aeb1..19bbd4c272 100644 --- a/products/coordinator/examples/reservation-review/request-only/workflow.yaml +++ b/products/coordinator/examples/reservation-review/request-only/workflow.yaml @@ -23,7 +23,7 @@ types: expiresAt: {type: integer, minimum: 1} contracts: reservations: {type: breg, source: generated/reservations.contract.json} -functions: +transforms: review-request: runtime: rhai source: functions.rhai @@ -133,7 +133,7 @@ workflow: submit-review: type: call operation: review-submit - input: {type: function, function: review-request, inputs: {input: {type: input}, reservation: {type: step, step: read-source}}} + input: {type: transform, transform: review-request, inputs: {input: {type: input}, reservation: {type: step, step: read-source}}} next: await-review await-review: type: wait-for @@ -149,12 +149,12 @@ workflow: record-rejected: type: call operation: source-review-rejected - input: {type: function, function: source-rejection-request, inputs: {input: {type: input}, result: {type: step, step: await-review}}} + input: {type: transform, transform: source-rejection-request, inputs: {input: {type: input}, result: {type: step, step: await-review}}} next: rejected record-approved: type: call operation: source-review-approved - input: {type: function, function: source-decision-request, inputs: {input: {type: input}, result: {type: step, step: await-review}}} + input: {type: transform, transform: source-decision-request, inputs: {input: {type: input}, result: {type: step, step: await-review}}} next: await-agreement-fixture await-agreement-fixture: type: wait-until @@ -167,12 +167,12 @@ workflow: record-agreement-failed: type: call operation: source-agreement-failed - input: {type: function, function: agreement-failed-request, inputs: {input: {type: input}}} + input: {type: transform, transform: agreement-failed-request, inputs: {input: {type: input}}} next: agreement-failed record-agreement-completed: type: call operation: source-agreement-completed - input: {type: function, function: agreement-completed-request, inputs: {input: {type: input}}} + input: {type: transform, transform: agreement-completed-request, inputs: {input: {type: input}}} next: read-after-agreement read-after-agreement: type: call @@ -187,17 +187,17 @@ workflow: book: type: call operation: scheduling-book - input: {type: function, function: booking-request, inputs: {input: {type: input}, reservation: {type: step, step: read-after-agreement}, metadata: {type: step, step: metadata}}} + input: {type: transform, transform: booking-request, inputs: {input: {type: input}, reservation: {type: step, step: read-after-agreement}, metadata: {type: step, step: metadata}}} next: record-confirmed record-confirmed: type: call operation: source-record-confirmed - input: {type: function, function: record-confirmation-request, inputs: {input: {type: input}, appointment: {type: step, step: book}}} + input: {type: transform, transform: record-confirmation-request, inputs: {input: {type: input}, appointment: {type: step, step: book}}} next: notify notify: type: call operation: notices-submit - input: {type: function, function: notice-request, inputs: {input: {type: input}, reservation: {type: step, step: read-after-agreement}, appointment: {type: step, step: book}}} + input: {type: transform, transform: notice-request, inputs: {input: {type: input}, reservation: {type: step, step: read-after-agreement}, appointment: {type: step, step: book}}} next: confirmed cancel-review-timeout: type: call @@ -212,12 +212,12 @@ workflow: record-withdrawal-after-timeout: type: call operation: source-withdraw - input: {type: function, function: withdrawal-request, inputs: {input: {type: input}}} + input: {type: transform, transform: withdrawal-request, inputs: {input: {type: input}}} next: review-withdrawn record-withdrawal-after-cancel: type: call operation: source-withdraw - input: {type: function, function: withdrawal-request, inputs: {input: {type: input}}} + input: {type: transform, transform: withdrawal-request, inputs: {input: {type: input}}} next: review-withdrawn confirmed: type: finish diff --git a/products/coordinator/examples/reviewed-notice/workflow.yaml b/products/coordinator/examples/reviewed-notice/workflow.yaml index cba135d3fc..df320a1737 100644 --- a/products/coordinator/examples/reviewed-notice/workflow.yaml +++ b/products/coordinator/examples/reviewed-notice/workflow.yaml @@ -23,7 +23,7 @@ types: applicationDigest: type: string pattern: ^sha256:[0-9a-f]{64}$ -functions: +transforms: review-subject-route: runtime: rhai source: functions.rhai @@ -114,8 +114,8 @@ workflow: verify-review-subject: type: choose choose: - type: function - function: review-subject-route + type: transform + transform: review-subject-route inputs: input: type: input @@ -129,8 +129,8 @@ workflow: type: call operation: review-submit-review-request input: - type: function - function: review-request + type: transform + transform: review-request inputs: input: type: input @@ -176,8 +176,8 @@ workflow: verify-notice: type: choose choose: - type: function - function: notice-route + type: transform + transform: notice-route inputs: input: type: input @@ -192,8 +192,8 @@ workflow: type: call operation: notices-submit-message input: - type: function - function: notice-request + type: transform + transform: notice-request inputs: input: type: input diff --git a/products/coordinator/generated/fixture/fixture.schema.json b/products/coordinator/generated/fixture/fixture.schema.json index 3d92772d5c..511d1dc962 100644 --- a/products/coordinator/generated/fixture/fixture.schema.json +++ b/products/coordinator/generated/fixture/fixture.schema.json @@ -102,7 +102,7 @@ }, { "additionalProperties": false, - "description": "The product returned a package-declared, no-effect business refusal.\nA supported call takes its `onDeclaredRefusal` edge when it has one;\notherwise the run stops as refused. An `external.command/v1` step\ntakes a `response` reply instead, which its interpretation Function\nmay turn into a declared refusal.", + "description": "The product returned a package-declared, no-effect business refusal.\nA supported call takes its `onDeclaredRefusal` edge when it has one;\notherwise the run stops as refused. An `external.command/v1` step\ntakes a `response` reply instead, which its interpretation Transform\nmay turn into a declared refusal.", "properties": { "refusalCode": { "$ref": "#/$defs/DeclaredRefusalCode", @@ -140,7 +140,7 @@ }, { "additionalProperties": false, - "description": "The provider answered an `external.command/v1` call with `value`. The\noperation's pinned interpretation Function turns it into an accepted\nresult, a declared refusal or an uncertain outcome, as it would at run\ntime. The status must be one the worker hands to that Function: a\nredirect, a 429 or a 5xx never reaches it, so a fixture models those\nwith an `uncertain` or `retryable` reply.", + "description": "The provider answered an `external.command/v1` call with `value`. The\noperation's pinned interpretation Transform turns it into an accepted\nresult, a declared refusal or an uncertain outcome, as it would at run\ntime. The status must be one the worker hands to that Transform: a\nredirect, a 429 or a 5xx never reaches it, so a fixture models those\nwith an `uncertain` or `retryable` reply.", "properties": { "type": { "const": "response", @@ -196,7 +196,7 @@ }, { "additionalProperties": false, - "description": "The host repeats the accepted external read and interprets these\nsynthetic typed responses under the completion's named Function.", + "description": "The host repeats the accepted external read and interprets these\nsynthetic typed responses under the completion's named Transform.", "properties": { "responses": { "description": "One to 128 bounded response objects in observation order.", diff --git a/products/coordinator/generated/openapi/coordinator.openapi.json b/products/coordinator/generated/openapi/coordinator.openapi.json index f5677fc64e..fc6128e58a 100644 --- a/products/coordinator/generated/openapi/coordinator.openapi.json +++ b/products/coordinator/generated/openapi/coordinator.openapi.json @@ -1768,14 +1768,14 @@ "summary": "Report deployment readiness and run state" } }, - "/v1/events/{workflow}/{trigger}": { + "/v1/events/{workflowId}/{triggerId}": { "post": { "description": "Accept at most 1048576 canonical JSON bytes in a HookEnvelope, then hold the admitted event to the 131072-byte structured value profile. Standard Webhooks signs the webhook ID, Unix timestamp and exact body using the key for the trigger in the URL. The signed timestamp must be within 300 seconds in either direction. The webhook ID must equal the envelope ID, and the envelope must match the configured producer URI and authored event type and data schema. The source URI, event ID and trigger bind admission across retries. Every downstream call uses its own product authorization.", "operationId": "admitEvent", "parameters": [ { "in": "path", - "name": "workflow", + "name": "workflowId", "required": true, "schema": { "maxLength": 64, @@ -1785,7 +1785,7 @@ }, { "in": "path", - "name": "trigger", + "name": "triggerId", "required": true, "schema": { "maxLength": 64, @@ -3824,13 +3824,13 @@ "summary": "Start a run of a served workflow" } }, - "/v1/runs/{run}": { + "/v1/runs/{runId}": { "get": { "operationId": "runStatus", "parameters": [ { "in": "path", - "name": "run", + "name": "runId", "required": true, "schema": { "format": "uuid", @@ -4038,14 +4038,14 @@ "summary": "Read one run's status" } }, - "/v1/runs/{run}/cancel": { + "/v1/runs/{runId}/cancel": { "post": { "description": "An authorized cancellation of a parked review wait with onCancel records durable intent and takes that authored path. A leased result read settles or expires before cleanup advances. Repeating cancellation preserves cleanup, reported by authoredCancelRequested. Other cancellation stops future calls where possible; it never reverses an accepted product effect.", "operationId": "cancelRun", "parameters": [ { "in": "path", - "name": "run", + "name": "runId", "required": true, "schema": { "format": "uuid", @@ -4333,13 +4333,13 @@ "summary": "Cancel a run" } }, - "/v1/runs/{run}/check": { + "/v1/runs/{runId}/check": { "post": { "operationId": "checkNow", "parameters": [ { "in": "path", - "name": "run", + "name": "runId", "required": true, "schema": { "format": "uuid", @@ -4626,13 +4626,13 @@ "summary": "Read a waiting step's product now" } }, - "/v1/runs/{run}/inspect": { + "/v1/runs/{runId}/inspect": { "get": { "operationId": "inspectRun", "parameters": [ { "in": "path", - "name": "run", + "name": "runId", "required": true, "schema": { "format": "uuid", @@ -4865,13 +4865,13 @@ "summary": "Inspect a run's steps and recovery options" } }, - "/v1/runs/{run}/reconcile": { + "/v1/runs/{runId}/reconcile": { "post": { "operationId": "reconcileRun", "parameters": [ { "in": "path", - "name": "run", + "name": "runId", "required": true, "schema": { "format": "uuid", @@ -5165,13 +5165,13 @@ "summary": "Reconcile an uncertain step against its receipt" } }, - "/v1/runs/{run}/retry-same": { + "/v1/runs/{runId}/retry-same": { "post": { "operationId": "retrySame", "parameters": [ { "in": "path", - "name": "run", + "name": "runId", "required": true, "schema": { "format": "uuid", @@ -5466,13 +5466,13 @@ "summary": "Retry a held step with the same command" } }, - "/v1/workflows/{workflow}": { + "/v1/workflows/{workflowId}": { "get": { "operationId": "workflowContract", "parameters": [ { "in": "path", - "name": "workflow", + "name": "workflowId", "required": true, "schema": { "maxLength": 64, diff --git a/products/coordinator/generated/operations/catalog.json b/products/coordinator/generated/operations/catalog.json index bf1abe8a5a..d152b1b43c 100644 --- a/products/coordinator/generated/operations/catalog.json +++ b/products/coordinator/generated/operations/catalog.json @@ -2258,7 +2258,7 @@ }, "output": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "The bounded provider response. The operation's interpret Function receives it with the command and returns the step result, a declared refusal, or an uncertain outcome.", + "description": "The bounded provider response. The operation's interpret Transform receives it with the command and returns the step result, a declared refusal, or an uncertain outcome.", "properties": { "body": { "description": "The parsed JSON response body, or null for an empty body." diff --git a/products/coordinator/generated/operations/external.command.v1.output.schema.json b/products/coordinator/generated/operations/external.command.v1.output.schema.json index 5ebe3566fd..ac42a0be8b 100644 --- a/products/coordinator/generated/operations/external.command.v1.output.schema.json +++ b/products/coordinator/generated/operations/external.command.v1.output.schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "The bounded provider response. The operation's interpret Function receives it with the command and returns the step result, a declared refusal, or an uncertain outcome.", + "description": "The bounded provider response. The operation's interpret Transform receives it with the command and returns the step result, a declared refusal, or an uncertain outcome.", "properties": { "body": { "description": "The parsed JSON response body, or null for an empty body." diff --git a/products/coordinator/generated/project/project.schema.json b/products/coordinator/generated/project/project.schema.json index 64304d2df8..533b3328f0 100644 --- a/products/coordinator/generated/project/project.schema.json +++ b/products/coordinator/generated/project/project.schema.json @@ -52,7 +52,7 @@ "properties": { "interpret": { "$ref": "#/$defs/LocalId", - "description": "The typed pure Function that turns the saved command and response into an observation." + "description": "The typed pure Transform that turns the saved command and response into an observation." }, "intervalSeconds": { "description": "Seconds between pending observations; the host may impose a stricter minimum.", @@ -174,68 +174,12 @@ ], "type": "object" }, - "AuthoredFunction": { - "additionalProperties": false, - "properties": { - "description": { - "$ref": "#/$defs/DisplayText", - "description": "An optional explanation for readers; it has no execution or authorization effect." - }, - "entrypoint": { - "description": "One public source function taking exactly one named-input object.", - "type": "string" - }, - "inputs": { - "additionalProperties": { - "$ref": "#/$defs/Schema" - }, - "description": "Named input schemas or references; every declared input is required exactly once.", - "maxProperties": 16, - "propertyNames": { - "$ref": "#/$defs/LocalId" - }, - "type": "object" - }, - "label": { - "$ref": "#/$defs/DisplayText", - "description": "An optional human label; it changes neither stable identity nor behavior revision." - }, - "limits": { - "$ref": "#/$defs/NarrowedLimits", - "description": "Optional narrowing of the bounded pure profile; omitted limits retain the default ceiling." - }, - "output": { - "$ref": "#/$defs/Schema", - "description": "The declared result schema or mapping; Functions and the host enforce it." - }, - "runtime": { - "$ref": "#/$defs/FunctionRuntime", - "description": "The pinned pure runtime; rhai has no clock, network, database or credential capability." - }, - "source": { - "description": "A local reviewed source asset inside the project directory.", - "type": "string" - } - }, - "required": [ - "runtime", - "source", - "entrypoint", - "inputs", - "output" - ], - "type": "object" - }, "AuthoredMapping": { "oneOf": [ { "additionalProperties": false, - "description": "Computes a value with a declared typed pure Function.", + "description": "Computes a value with a declared typed pure Transform.", "properties": { - "function": { - "$ref": "#/$defs/LocalId", - "description": "A declared pure Function called with an object of named inputs." - }, "inputs": { "additionalProperties": { "$ref": "#/$defs/Reference" @@ -247,14 +191,18 @@ }, "type": "object" }, + "transform": { + "$ref": "#/$defs/LocalId", + "description": "A declared pure Transform called with an object of named inputs." + }, "type": { - "const": "function", + "const": "transform", "type": "string" } }, "required": [ "type", - "function", + "transform", "inputs" ], "type": "object" @@ -399,7 +347,7 @@ }, "interpret": { "$ref": "#/$defs/LocalId", - "description": "The typed pure Function that interprets an external command's provider\nresponse into an accepted result, a declared refusal or an uncertain\noutcome. Required on, and accepted only on, `external.command/v1`." + "description": "The typed pure Transform that interprets an external command's provider\nresponse into an accepted result, a declared refusal or an uncertain\noutcome. Required on, and accepted only on, `external.command/v1`." }, "label": { "$ref": "#/$defs/DisplayText", @@ -615,7 +563,7 @@ }, "output": { "$ref": "#/$defs/AuthoredMapping", - "description": "The declared result schema or mapping; Functions and the host enforce it." + "description": "The declared result schema or mapping; Transforms and the host enforce it." }, "type": { "const": "finish", @@ -630,6 +578,58 @@ } ] }, + "AuthoredTransform": { + "additionalProperties": false, + "properties": { + "description": { + "$ref": "#/$defs/DisplayText", + "description": "An optional explanation for readers; it has no execution or authorization effect." + }, + "entrypoint": { + "description": "One public source function taking exactly one named-input object.", + "type": "string" + }, + "inputs": { + "additionalProperties": { + "$ref": "#/$defs/Schema" + }, + "description": "Named input schemas or references; every declared input is required exactly once.", + "maxProperties": 16, + "propertyNames": { + "$ref": "#/$defs/LocalId" + }, + "type": "object" + }, + "label": { + "$ref": "#/$defs/DisplayText", + "description": "An optional human label; it changes neither stable identity nor behavior revision." + }, + "limits": { + "$ref": "#/$defs/NarrowedLimits", + "description": "Optional narrowing of the bounded pure profile; omitted limits retain the default ceiling." + }, + "output": { + "$ref": "#/$defs/Schema", + "description": "The declared result schema or mapping; Transforms and the host enforce it." + }, + "runtime": { + "$ref": "#/$defs/TransformRuntime", + "description": "The pinned pure runtime; rhai has no clock, network, database or credential capability." + }, + "source": { + "description": "A local reviewed source asset inside the project directory.", + "type": "string" + } + }, + "required": [ + "runtime", + "source", + "entrypoint", + "inputs", + "output" + ], + "type": "object" + }, "AuthoredWorkflow": { "additionalProperties": false, "properties": { @@ -761,12 +761,6 @@ }, "type": "object" }, - "FunctionRuntime": { - "enum": [ - "rhai" - ], - "type": "string" - }, "ImportedContract": { "additionalProperties": false, "properties": { @@ -860,7 +854,7 @@ }, { "additionalProperties": false, - "description": "Builds a nested object member by member, never with a Function.", + "description": "Builds a nested object member by member, never with a Transform.", "properties": { "fields": { "$ref": "#/$defs/Fields", @@ -1101,6 +1095,12 @@ "version" ], "type": "object" + }, + "TransformRuntime": { + "enum": [ + "rhai" + ], + "type": "string" } }, "$id": "https://id.registrystack.org/schemas/coordinator/project/project.v1alpha1.schema.json", @@ -1123,18 +1123,6 @@ }, "type": "object" }, - "functions": { - "additionalProperties": { - "$ref": "#/$defs/AuthoredFunction" - }, - "description": "Named typed bounded pure computations over one object of named inputs.", - "maxProperties": 128, - "minProperties": 0, - "propertyNames": { - "$ref": "#/$defs/LocalId" - }, - "type": "object" - }, "kind": { "const": "CoordinatorProject", "description": "The kind of document this is.", @@ -1173,6 +1161,18 @@ "description": "The shared Project identity; its version is a human release label, not the computed Workflow revision.", "unevaluatedProperties": false }, + "transforms": { + "additionalProperties": { + "$ref": "#/$defs/AuthoredTransform" + }, + "description": "Named typed bounded pure computations over one object of named inputs.", + "maxProperties": 128, + "minProperties": 0, + "propertyNames": { + "$ref": "#/$defs/LocalId" + }, + "type": "object" + }, "types": { "additionalProperties": { "$ref": "#/$defs/Schema" From 0063e57e9dd1dc6f2ffc8ccee5fcb8cb87ceddd7 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 14/55] feat(dev): admit an explicitly selected private PostgreSQL transport Folds these reviewed commits: - chore(release): wire the held Session binary into the native roster - feat(dev): admit explicitly selected private PostgreSQL transport - fix(coordinator): align conformance inputs with transforms Signed-off-by: Jeremi Joslin --- crates/registry-platform-postgres/src/lib.rs | 16 ++- crates/registry-rstack-dev/src/database.rs | 101 +++++++++++++----- crates/registry-rstack-dev/src/products.rs | 13 ++- .../run-a-project-with-rstack-dev.mdx | 7 ++ products/platform/config-formats.yaml | 2 +- .../platform/conformance/yaml/formats.yaml | 2 +- release/scripts/release_roster.py | 9 +- release/scripts/test_release_candidate.py | 14 +++ release/scripts/test_release_roster.py | 11 +- 9 files changed, 133 insertions(+), 42 deletions(-) diff --git a/crates/registry-platform-postgres/src/lib.rs b/crates/registry-platform-postgres/src/lib.rs index 367f003c59..0a13457e51 100644 --- a/crates/registry-platform-postgres/src/lib.rs +++ b/crates/registry-platform-postgres/src/lib.rs @@ -52,11 +52,17 @@ pub fn loopback_postgres_connection( postgres: Config, resolve: &HostResolver, ) -> Result { - let permitted = check_database_hosts( - DatabaseTransport::LoopbackPlaintext, - &database_hosts(&postgres), - resolve, - )?; + connection_for_transport(postgres, DatabaseTransport::LoopbackPlaintext, resolve) +} + +/// Pin a parsed PostgreSQL configuration after the caller has admitted an +/// explicit transport. The caller still sets the matching driver TLS mode. +pub fn connection_for_transport( + postgres: Config, + transport: DatabaseTransport, + resolve: &HostResolver, +) -> Result { + let permitted = check_database_hosts(transport, &database_hosts(&postgres), resolve)?; pinned(&permitted, postgres) } diff --git a/crates/registry-rstack-dev/src/database.rs b/crates/registry-rstack-dev/src/database.rs index 81a60bb38a..7895dfab80 100644 --- a/crates/registry-rstack-dev/src/database.rs +++ b/crates/registry-rstack-dev/src/database.rs @@ -7,7 +7,7 @@ use std::{ time::{Duration, Instant}, }; -use anyhow::{anyhow, bail, Context, Result}; +use anyhow::{anyhow, bail, ensure, Context, Result}; use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine as _}; use registry_platform_config::{DatabaseTransport, HostResolver}; use registry_platform_provision::{ @@ -262,7 +262,7 @@ type AdminConnectionTask = tokio::task::JoinHandle { + Self::Plaintext => { let (client, connection) = bounded_connection(config.connect(tokio_postgres::NoTls), timeout).await?; Ok((client, tokio::spawn(connection))) @@ -387,12 +387,9 @@ impl Endpoint { DatabaseTransport::VerifiedTls => { url.query_pairs_mut().append_pair("sslmode", "require"); } - DatabaseTransport::LoopbackPlaintext => { + DatabaseTransport::LoopbackPlaintext | DatabaseTransport::PrivateNetworkPlaintext => { url.query_pairs_mut().append_pair("sslmode", "disable"); } - DatabaseTransport::PrivateNetworkPlaintext => { - bail!("private-network-plaintext is not supported by rstack dev"); - } } Ok(url.into()) } @@ -423,24 +420,26 @@ impl Database { apply_session_options(&mut admin_config); let transport = match endpoint.transport { DatabaseTransport::VerifiedTls => AdminTransport::Tls(tls_connector(ca_pem)?), - DatabaseTransport::LoopbackPlaintext => { + DatabaseTransport::LoopbackPlaintext | DatabaseTransport::PrivateNetworkPlaintext => { if ca_pem.is_some() { bail!( "RSTACK_DEV_DATABASE_CA cannot be set when the PostgreSQL administrator \ - URL uses sslmode=disable" + URL selects plaintext" ); } - AdminTransport::LoopbackPlaintext - } - DatabaseTransport::PrivateNetworkPlaintext => { - bail!("private-network-plaintext is not supported by rstack dev"); + AdminTransport::Plaintext } }; let session_context = match endpoint.transport { DatabaseTransport::LoopbackPlaintext => { "cannot establish the PostgreSQL administrator session over loopback plaintext" } - _ => "cannot establish the PostgreSQL administrator session over verified TLS", + DatabaseTransport::PrivateNetworkPlaintext => { + "cannot establish the PostgreSQL administrator session over private network plaintext" + } + DatabaseTransport::VerifiedTls => { + "cannot establish the PostgreSQL administrator session over verified TLS" + } }; let runtime = Builder::new_current_thread() .enable_all() @@ -449,7 +448,7 @@ impl Database { let ownership_lock = ownership_lock_statement(run_id)?; let session_deadline = Instant::now() + CLEANUP_ATTEMPT_TIMEOUT; let (admin_config, endpoint, client, connection_task, recovery_identity) = - if matches!(transport, AdminTransport::LoopbackPlaintext) + if matches!(transport, AdminTransport::Plaintext) && admin_config.get_hostaddrs().len() > 1 { let mut last_error = None; @@ -485,7 +484,7 @@ impl Database { Some(found) => found, None => { return Err(last_error.unwrap_or_else(|| { - anyhow!("no checked loopback PostgreSQL address answered") + anyhow!("no checked plaintext PostgreSQL address answered") })) .context(session_context) .map_err(super::operational); @@ -1336,6 +1335,7 @@ fn admin_config_with_resolver( ); } let mut requested_transport: Option = None; + let mut private_plaintext = false; for (key, value) in parsed.query_pairs() { match key.as_ref() { "sslmode" => { @@ -1356,18 +1356,31 @@ fn admin_config_with_resolver( "the PostgreSQL admin URL must not set sslrootcert; set RSTACK_DEV_DATABASE_CA \ to a CA PEM file instead" ), + "transport" => { + if private_plaintext || value != "private-network-plaintext" { + bail!("the PostgreSQL admin URL transport may specify private-network-plaintext once"); + } + private_plaintext = true; + } "connect_timeout" | "application_name" => {} other => bail!("the PostgreSQL admin URL query parameter {other} is not supported"), } } - let transport = requested_transport.unwrap_or(DatabaseTransport::VerifiedTls); + let transport = + if private_plaintext { + ensure!(requested_transport != Some(DatabaseTransport::VerifiedTls), + "the PostgreSQL admin URL must not combine private-network-plaintext with TLS sslmode"); + DatabaseTransport::PrivateNetworkPlaintext + } else { + requested_transport.unwrap_or(DatabaseTransport::VerifiedTls) + }; // tokio-postgres does not parse verify-ca or verify-full, and the runner // sets its own TLS mode, so the checked sslmode is not passed on. let mut sanitized = parsed.clone(); let kept: Vec<(String, String)> = parsed .query_pairs() - .filter(|(key, _)| key != "sslmode") + .filter(|(key, _)| key != "sslmode" && key != "transport") .map(|(key, value)| (key.into_owned(), value.into_owned())) .collect(); if kept.is_empty() { @@ -1403,20 +1416,20 @@ fn admin_config_with_resolver( config.ssl_mode(SslMode::Disable); } DatabaseTransport::PrivateNetworkPlaintext => { - bail!("private-network-plaintext is not supported by rstack dev"); + config = registry_platform_postgres::connection_for_transport(config, transport, resolve) + .map_err(|_| anyhow!("the PostgreSQL admin URL with private-network-plaintext must resolve only to permitted private or loopback addresses"))?; + config.ssl_mode(SslMode::Disable); } } let host = match transport { - DatabaseTransport::LoopbackPlaintext => { + DatabaseTransport::LoopbackPlaintext | DatabaseTransport::PrivateNetworkPlaintext => { let pinned = *config.get_hostaddrs().first().ok_or_else(|| { - anyhow!("the PostgreSQL loopback host did not resolve to an address") + anyhow!("the PostgreSQL plaintext host did not resolve to an address") })?; ip_to_url_host(pinned) } - DatabaseTransport::VerifiedTls | DatabaseTransport::PrivateNetworkPlaintext => { - parsed.host().expect("the host was checked").to_owned() - } + DatabaseTransport::VerifiedTls => parsed.host().expect("the host was checked").to_owned(), }; Ok(( config, @@ -2029,6 +2042,46 @@ mod tests { assert!(!ca_conflict.contains(password)); } + #[test] + fn explicitly_selected_private_plaintext_pins_every_checked_address() { + let url = "postgresql://admin:synthetic-url-value@postgres.compose:5432/postgres?transport=private-network-plaintext"; + let private = std::net::IpAddr::from([172, 20, 0, 7]); + let (config, endpoint) = + admin_config_with_resolver(url, &move |_| Ok(vec![private])).unwrap(); + assert_eq!(config.get_ssl_mode(), SslMode::Disable); + assert!(config.get_hosts().is_empty()); + assert_eq!(config.get_hostaddrs(), &[private]); + assert_eq!( + endpoint.transport, + DatabaseTransport::PrivateNetworkPlaintext + ); + assert_eq!( + endpoint.product_url("owned", "runtime", "pw").unwrap(), + "postgresql://runtime:pw@172.20.0.7:5432/owned?sslmode=disable" + ); + for addresses in [ + vec![private, std::net::IpAddr::from([203, 0, 113, 1])], + vec![std::net::IpAddr::from([169, 254, 169, 254])], + ] { + let error = admin_config_with_resolver(url, &move |_| Ok(addresses.clone())) + .err() + .expect("public or mixed answers must be refused") + .to_string(); + assert!(error.contains("private-network-plaintext"), "{error}"); + assert!(!error.contains("synthetic-url-value")); + } + for suffix in ["&sslmode=require", "&transport=private-network-plaintext"] { + assert!(admin_config_with_resolver(&format!("{url}{suffix}"), &|_| { + panic!("contradictory inputs must be refused before lookup"); + }) + .is_err()); + } + assert!(admin_config( + "postgresql://admin:synthetic-url-value@172.20.0.7/postgres?sslmode=disable" + ) + .is_err()); + } + #[test] fn spatial_runs_are_refused_without_a_supported_postgis() { assert!(require_postgis(Some("3.5.2")).is_ok()); diff --git a/crates/registry-rstack-dev/src/products.rs b/crates/registry-rstack-dev/src/products.rs index b6d93ef07a..ea6a5aaa62 100644 --- a/crates/registry-rstack-dev/src/products.rs +++ b/crates/registry-rstack-dev/src/products.rs @@ -2359,10 +2359,15 @@ fn shared_config( "runtimeUrlRef": secret_ref(&format!("{name}-runtime-url")), "migrationUrlRef": secret_ref(&format!("{name}-migration-url")) }); - if database_transport == DatabaseTransport::LoopbackPlaintext { - database["transport"] = json!("loopback-plaintext"); - } else if root.join("postgres-ca").is_file() { - database["caBundleRef"] = json!(secret_ref("postgres-ca")); + match database_transport { + DatabaseTransport::LoopbackPlaintext => database["transport"] = json!("loopback-plaintext"), + DatabaseTransport::PrivateNetworkPlaintext => { + database["transport"] = json!("private-network-plaintext"); + } + DatabaseTransport::VerifiedTls if root.join("postgres-ca").is_file() => { + database["caBundleRef"] = json!(secret_ref("postgres-ca")); + } + DatabaseTransport::VerifiedTls => {} } let audit = json!({ "hashKeyRef": secret_ref(&format!("{name}-audit-key")), diff --git a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx index 510ab8da7f..c095a2d4d7 100644 --- a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx +++ b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx @@ -542,6 +542,11 @@ By default it must serve TLS, and the runner verifies the server certificate and For a local server on a loopback host (`127.0.0.1`, `::1`, or `localhost` resolving only to loopback addresses), you can use plaintext by passing `?sslmode=disable` in the administrator URL and leaving `RSTACK_DEV_DATABASE_CA` unset. Generated product runtime configurations then use `database.transport: loopback-plaintext`. +If the runner and PostgreSQL share a private development network, such as a Docker Compose network, you can select `?transport=private-network-plaintext` explicitly. +The runner checks that every resolved address is eligible for private network plaintext and connects to one of those addresses directly. +Generated product runtime configurations use `database.transport: private-network-plaintext` and the same address. +Leave `RSTACK_DEV_DATABASE_CA` unset for either plaintext transport. + The administrator role named in the URL needs `LOGIN CREATEROLE CREATEDB`. Superuser is not needed for a non-spatial run. The runner sets `createrole_self_grant` on its own sessions, so you do not configure it. @@ -557,6 +562,8 @@ The URL accepts these query parameters and refuses all others: - `sslmode`: `require`, `verify-ca`, or `verify-full` for verified TLS (the default when omitted, verifying the certificate and host name whichever you choose), or `disable` for plaintext on a loopback host only. Setting `RSTACK_DEV_DATABASE_CA` with `sslmode=disable` is refused. +- `transport=private-network-plaintext` explicitly selects a private development network. + Leave `sslmode` unset for this transport and pass the same URL for recovery. - `connect_timeout` and `application_name`. - `sslrootcert` is refused. Set `RSTACK_DEV_DATABASE_CA` instead. diff --git a/products/platform/config-formats.yaml b/products/platform/config-formats.yaml index dec8050c23..8c0318dc10 100644 --- a/products/platform/config-formats.yaml +++ b/products/platform/config-formats.yaml @@ -3938,7 +3938,7 @@ formats: integer: /workflow/deadlineSeconds boolean: none reference: /workflow/start - relativePath: /functions/notice-route/source + relativePath: /transforms/notice-route/source securityMembers: [] restrictingMembers: [] - id: coordinator/runtime diff --git a/products/platform/conformance/yaml/formats.yaml b/products/platform/conformance/yaml/formats.yaml index 0ea961ba7e..d125edaaa3 100644 --- a/products/platform/conformance/yaml/formats.yaml +++ b/products/platform/conformance/yaml/formats.yaml @@ -135,7 +135,7 @@ formats: # Isolate the path role: other functions keep their shared source file # when the corpus moves or symlinks this one outside the project. set: - /functions/notice-route/source: notice-route.rhai + /transforms/notice-route/source: notice-route.rhai write: notice-route.rhai: | fn notice_route(args) { diff --git a/release/scripts/release_roster.py b/release/scripts/release_roster.py index 609b851abf..e5b7b98d5d 100644 --- a/release/scripts/release_roster.py +++ b/release/scripts/release_roster.py @@ -68,10 +68,9 @@ script builds, stages, or publishes them yet, so the product stays held until it is releasable. -``SESSION_FIRST_RELEASE`` is the single place that decides which release -first ships the ``registry-session`` binary and any image or security evidence -of its own. No release script builds, stages, or publishes it yet, so the -service stays held until it is releasable. +``SESSION_FIRST_RELEASE`` decides which numbered release first includes the +``registry-session`` binary in the native platform builds. The service stays +held while the release gate is unset. ``PYTHON_311_ABI_FIRST_RELEASE`` is the single place that decides which release first builds the Python client wheels against the Python 3.11 stable @@ -137,6 +136,7 @@ ("registry-manifest-cli", "registry-manifest"), ("registry-coordinator", "coordinator"), ("registry-coordinator", "coordinatorctl"), + ("registry-session", "registry-session"), ("registry-adapter", "adapter"), ("registry-adapterctl", "adapterctl"), ) @@ -164,6 +164,7 @@ def additional_platform_builds(version: tuple[int, int, int]): "registry-discoveryctl": discoveryctl_in_release(version), "registry-render": render_in_release(version), "registry-coordinator": coordinator_binaries_in_release(version), + "registry-session": session_in_release(version), "registry-adapter": adapter_in_release(version), "registry-adapterctl": adapter_in_release(version), } diff --git a/release/scripts/test_release_candidate.py b/release/scripts/test_release_candidate.py index 54b1b109cf..d0f20c4b4a 100644 --- a/release/scripts/test_release_candidate.py +++ b/release/scripts/test_release_candidate.py @@ -1567,6 +1567,20 @@ def test_breg_services_join_only_the_rosters_from_their_first_release( self.assertNotIn(f"{service}-v0.38.0-install.sh", inventory) self.assertNotIn(f"{service}-v0.38.0-macos-arm64", inventory) + @roster_patch("release_roster.SESSION_FIRST_RELEASE", (0, 51, 0)) + def test_session_first_release_closes_native_platform_assets(self) -> None: + old = self.module._release_payload_inventory("0.50.0") + self.assertFalse(any(name.startswith("registry-session-") for name in old)) + current = self.module._release_payload_inventory("0.51.0") + self.assertEqual( + { + "registry-session-v0.51.0-linux-amd64": "binary", + "registry-session-v0.51.0-linux-arm64": "binary", + "registry-session-v0.51.0-macos-arm64.tar.gz": "binary", + }, + {name: kind for name, kind in current.items() if name.startswith("registry-session-")}, + ) + @roster_patch("release_roster.COORDINATOR_FIRST_RELEASE", (0, 42, 0)) def test_no_version_ships_the_breg_services_until_the_roster_names_one( self, diff --git a/release/scripts/test_release_roster.py b/release/scripts/test_release_roster.py index ae0e22c92f..417d9e9cb8 100644 --- a/release/scripts/test_release_roster.py +++ b/release/scripts/test_release_roster.py @@ -123,9 +123,14 @@ def test_session_service_is_held_out_of_every_release(self) -> None: ("registry-session", "registry-session"), release_roster.additional_platform_builds(version), ) - with mock.patch.object(release_roster, "SESSION_FIRST_RELEASE", (0, 49, 0)): - self.assertFalse(release_roster.session_in_release((0, 48, 99))) - self.assertTrue(release_roster.session_in_release((0, 49, 0))) + + def test_session_first_release_adds_its_native_binary_to_the_roster(self) -> None: + binary = ("registry-session", "registry-session") + with mock.patch.object(release_roster, "SESSION_FIRST_RELEASE", (0, 51, 0)): + self.assertFalse(release_roster.session_in_release((0, 50, 0))) + self.assertNotIn(binary, release_roster.additional_platform_builds((0, 50, 0))) + self.assertTrue(release_roster.session_in_release((0, 51, 0))) + self.assertIn(binary, release_roster.additional_platform_builds((0, 51, 0))) def test_coordinator_binary_release_does_not_release_its_image(self): self.assertFalse(release_roster.coordinator_binaries_in_release((0, 43, 99))) From efef460d6c77e8a958e14c1b93b31acff70e4897 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 15/55] fix(journeys): qualify BReg on Keycloak and capture signed observer hooks Folds these reviewed commits: - fix(journeys): qualify BReg against stock Keycloak - fix(journeys): clean up explicitly kept fixture inputs - feat(dev): capture signed Documents and Scheduling observer hooks - test(journeys): verify retained Documents version-ready delivery - feat(dev): check saved Casework reports offline - docs(dev): describe private PostgreSQL startup and cleanup - fix(journeys): tighten BReg fixture proof and promotion input - fix(release): keep Session numbered assembly and nightlies aligned - fix(scheduling): date fresh starters from initialization - fix(dev): narrow and verify private PostgreSQL attachment - fix(dev): exercise saved report refusals in strict conformance - fix(dev): classify private PostgreSQL lookup failures as operational - fix(scheduling): verify starter freshness and fold dates Signed-off-by: Jeremi Joslin --- Cargo.lock | 3 + crates/registry-platform-postgres/README.md | 3 +- crates/registry-platform-postgres/src/lib.rs | 21 +- crates/registry-rstack-dev/Cargo.toml | 6 +- crates/registry-rstack-dev/src/database.rs | 227 +++++-- crates/registry-rstack-dev/src/lib.rs | 40 +- .../registry-rstack-dev/src/owner_report.rs | 594 ++++++++++++++++++ .../src/owner_report_tests.rs | 247 ++++++++ crates/registry-rstack-dev/src/products.rs | 155 ++++- crates/registry-rstack-dev/src/sinks.rs | 123 +++- crates/registry-rstack/src/cli.rs | 103 ++- crates/registry-schedulingctl/Cargo.toml | 3 +- crates/registry-schedulingctl/src/project.rs | 119 +++- .../registry-schedulingctl/src/templates.rs | 134 +++- .../run-a-project-with-rstack-dev.mdx | 29 +- .../src/content/docs/configure/scheduling.mdx | 69 +- .../reports/identity-facts-report.json | 18 + products/platform/CHANGELOG.md | 5 + products/platform/CONFIG-CONVENTIONS.md | 22 +- products/platform/config-formats.yaml | 11 +- products/platform/journeys/README.md | 14 + .../platform/journeys/expected-failures.yaml | 16 +- .../platform/journeys/keycloak/realm.json | 5 + products/platform/journeys/own-provider.sh | 349 ++++++---- products/platform/journeys/promote.sh | 33 +- products/platform/journeys/rstack-dev.sh | 126 +++- .../platform/journeys/test_journey_tables.py | 182 +++++- .../scripts/check-config-conventions.py | 39 +- .../scripts/run-config-conformance.py | 35 +- .../scripts/test_check_config_conventions.py | 39 ++ .../scripts/test_run_config_conformance.py | 39 ++ products/scheduling/AGENTS.md | 13 +- products/scheduling/README.md | 12 +- .../scheduling/scripts/check-checkpoint.sh | 70 ++- release/VERIFY.md | 6 +- .../build-additional-platform-binaries.sh | 6 +- release/scripts/build-nightly-linux-arm64.sh | 2 +- release/scripts/build-release-binaries.sh | 14 + .../scripts/build-release-native-platform.sh | 6 +- .../scripts/merge-release-binary-shards.py | 2 + .../merge-release-native-platform-shards.py | 2 +- release/scripts/nightly_release.py | 2 +- release/scripts/registry-release | 2 + release/scripts/release_candidate.py | 4 +- release/scripts/release_roster.py | 14 +- .../test_merge_release_binary_shards.py | 12 + release/scripts/test_nightly_release.py | 14 + release/scripts/test_registry_release.py | 9 + .../scripts/test_release_native_platform.py | 47 +- release/scripts/test_release_roster.py | 9 + 50 files changed, 2731 insertions(+), 324 deletions(-) create mode 100644 crates/registry-rstack-dev/src/owner_report.rs create mode 100644 crates/registry-rstack-dev/src/owner_report_tests.rs create mode 100644 products/casework/examples/formats/reports/identity-facts-report.json diff --git a/Cargo.lock b/Cargo.lock index 3471e08c94..63221e918e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8399,8 +8399,10 @@ dependencies = [ "rcgen", "registry-cli-report", "registry-platform-buildinfo", + "registry-platform-canonical-json", "registry-platform-config", "registry-platform-crypto", + "registry-platform-hooks", "registry-platform-httputil", "registry-platform-postgres", "registry-platform-provision", @@ -8558,6 +8560,7 @@ version = "0.51.0" dependencies = [ "anyhow", "chrono", + "chrono-tz", "clap", "registry-cli-api", "registry-cli-report", diff --git a/crates/registry-platform-postgres/README.md b/crates/registry-platform-postgres/README.md index adcd9380b2..0d3f150df9 100644 --- a/crates/registry-platform-postgres/README.md +++ b/crates/registry-platform-postgres/README.md @@ -4,5 +4,6 @@ - `postgres_connection` checks every host and `hostaddr` of a parsed connection string under the runtime's `database.transport`. Under a plaintext transport it returns a configuration that dials only the numeric addresses each host was checked as, so the driver never resolves a name again. Under `verified-tls` the configuration is returned unchanged. - `loopback_postgres_connection` does the same under `loopback-plaintext`, for a constructor that holds no runtime database block. -- Both take the host resolver as an argument. A runtime passes `registry_platform_config::resolve_database_host`; tests pass a fixed answer. +- `private_development_postgres_connection` pins only private and loopback addresses for the development runner's explicitly selected administrator transport. Product runtimes use `postgres_connection` with the loaded database block and its posture witness. +- Each entry point takes a host resolver. A runtime passes `registry_platform_config::resolve_database_host`. Tests pass a fixed answer. - A keyword host written as an IP address in brackets, such as `host=[::1]`, is dropped from the list, as the driver itself fails that entry. When no other host is left, the connection is refused with `platform.database.bracketed-host`. diff --git a/crates/registry-platform-postgres/src/lib.rs b/crates/registry-platform-postgres/src/lib.rs index 0a13457e51..8ed2cc157f 100644 --- a/crates/registry-platform-postgres/src/lib.rs +++ b/crates/registry-platform-postgres/src/lib.rs @@ -55,12 +55,25 @@ pub fn loopback_postgres_connection( connection_for_transport(postgres, DatabaseTransport::LoopbackPlaintext, resolve) } -/// Pin a parsed PostgreSQL configuration after the caller has admitted an -/// explicit transport. The caller still sets the matching driver TLS mode. -pub fn connection_for_transport( +/// Pin a PostgreSQL administrator configuration for an explicitly selected +/// private development attachment. Only the development runner uses this +/// entry point. Product runtimes use [`postgres_connection`] with a loaded +/// database block and its posture witness. +pub fn private_development_postgres_connection( + postgres: Config, + resolve: &dyn Fn(&str) -> std::io::Result>, +) -> Result { + connection_for_transport( + postgres, + DatabaseTransport::PrivateNetworkPlaintext, + resolve, + ) +} + +fn connection_for_transport( postgres: Config, transport: DatabaseTransport, - resolve: &HostResolver, + resolve: &dyn Fn(&str) -> std::io::Result>, ) -> Result { let permitted = check_database_hosts(transport, &database_hosts(&postgres), resolve)?; pinned(&permitted, postgres) diff --git a/crates/registry-rstack-dev/Cargo.toml b/crates/registry-rstack-dev/Cargo.toml index 24f678cc21..abeddad28b 100644 --- a/crates/registry-rstack-dev/Cargo.toml +++ b/crates/registry-rstack-dev/Cargo.toml @@ -35,12 +35,15 @@ axum.workspace = true base64.workspace = true clap.workspace = true getrandom.workspace = true +jsonschema.workspace = true postgres-protocol.workspace = true rcgen.workspace = true registry-cli-report.workspace = true registry-platform-buildinfo.workspace = true +registry-platform-canonical-json.workspace = true registry-platform-config.workspace = true registry-platform-crypto.workspace = true +registry-platform-hooks = { workspace = true, features = ["receiver"] } registry-platform-httputil.workspace = true registry-platform-postgres.workspace = true registry-platform-provision.workspace = true @@ -63,6 +66,3 @@ tokio-postgres-rustls.workspace = true url.workspace = true uuid = { workspace = true, features = ["serde"] } zeroize.workspace = true - -[dev-dependencies] -jsonschema.workspace = true diff --git a/crates/registry-rstack-dev/src/database.rs b/crates/registry-rstack-dev/src/database.rs index 7895dfab80..318de38fd4 100644 --- a/crates/registry-rstack-dev/src/database.rs +++ b/crates/registry-rstack-dev/src/database.rs @@ -1,7 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 use std::{ + cell::Cell, future::Future, + net::IpAddr, str::FromStr, thread, time::{Duration, Instant}, @@ -324,6 +326,24 @@ fn open_admin_session( Ok((client, connection_task, identity)) } +fn open_plaintext_candidates( + admin_url: &str, + addresses: &[IpAddr], + mut open: impl FnMut(&Config) -> Result, +) -> Result<(Config, Endpoint, T)> { + let mut last_error = None; + for &address in addresses { + let (mut candidate, endpoint) = + admin_config_with_resolver(admin_url, &move |_| Ok(vec![address]))?; + apply_session_options(&mut candidate); + match open(&candidate) { + Ok(session) => return Ok((candidate, endpoint, session)), + Err(error) => last_error = Some(error), + } + } + Err(last_error.unwrap_or_else(|| anyhow!("no checked plaintext PostgreSQL address answered"))) +} + #[derive(Clone)] pub(super) struct DatabaseUrls { pub runtime: String, @@ -451,45 +471,23 @@ impl Database { if matches!(transport, AdminTransport::Plaintext) && admin_config.get_hostaddrs().len() > 1 { - let mut last_error = None; - let mut connected = None; - for &address in admin_config.get_hostaddrs() { - let (mut candidate_config, candidate_endpoint) = - admin_config_with_resolver(admin_url, &move |_| Ok(vec![address]))?; - apply_session_options(&mut candidate_config); - match open_admin_session( - &runtime, - &candidate_config, - &transport, - &ownership_lock, - expected_identity, - session_deadline, - ) { - Ok((client, connection_task, recovery_identity)) => { - connected = Some(( - candidate_config, - candidate_endpoint, - client, - connection_task, - recovery_identity, - )); - break; - } - Err(error) => { - last_error = Some(error); - } - } - } - match connected { - Some(found) => found, - None => { - return Err(last_error.unwrap_or_else(|| { - anyhow!("no checked plaintext PostgreSQL address answered") - })) - .context(session_context) - .map_err(super::operational); - } - } + let (config, endpoint, (client, task, identity)) = open_plaintext_candidates( + admin_url, + admin_config.get_hostaddrs(), + |candidate| { + open_admin_session( + &runtime, + candidate, + &transport, + &ownership_lock, + expected_identity, + session_deadline, + ) + }, + ) + .context(session_context) + .map_err(super::operational)?; + (config, endpoint, client, task, identity) } else { let (client, connection_task, recovery_identity) = open_admin_session( &runtime, @@ -1358,7 +1356,9 @@ fn admin_config_with_resolver( ), "transport" => { if private_plaintext || value != "private-network-plaintext" { - bail!("the PostgreSQL admin URL transport may specify private-network-plaintext once"); + bail!( + "the PostgreSQL admin URL transport may specify private-network-plaintext once" + ); } private_plaintext = true; } @@ -1366,14 +1366,15 @@ fn admin_config_with_resolver( other => bail!("the PostgreSQL admin URL query parameter {other} is not supported"), } } - let transport = - if private_plaintext { - ensure!(requested_transport != Some(DatabaseTransport::VerifiedTls), - "the PostgreSQL admin URL must not combine private-network-plaintext with TLS sslmode"); - DatabaseTransport::PrivateNetworkPlaintext - } else { - requested_transport.unwrap_or(DatabaseTransport::VerifiedTls) - }; + let transport = if private_plaintext { + ensure!( + requested_transport != Some(DatabaseTransport::VerifiedTls), + "the PostgreSQL admin URL must not combine private-network-plaintext with TLS sslmode" + ); + DatabaseTransport::PrivateNetworkPlaintext + } else { + requested_transport.unwrap_or(DatabaseTransport::VerifiedTls) + }; // tokio-postgres does not parse verify-ca or verify-full, and the runner // sets its own TLS mode, so the checked sslmode is not passed on. @@ -1416,8 +1417,25 @@ fn admin_config_with_resolver( config.ssl_mode(SslMode::Disable); } DatabaseTransport::PrivateNetworkPlaintext => { - config = registry_platform_postgres::connection_for_transport(config, transport, resolve) - .map_err(|_| anyhow!("the PostgreSQL admin URL with private-network-plaintext must resolve only to permitted private or loopback addresses"))?; + let lookup_failed = Cell::new(false); + let checked_resolver = |host: &str| { + let result = resolve(host); + lookup_failed.set(result.as_ref().map_or(true, Vec::is_empty)); + result + }; + config = registry_platform_postgres::private_development_postgres_connection( + config, + &checked_resolver, + ) + .map_err(|_| { + if lookup_failed.get() { + super::operational(anyhow!( + "could not resolve the PostgreSQL admin host for private-network-plaintext" + )) + } else { + anyhow!("the PostgreSQL admin URL with private-network-plaintext must resolve only to permitted private or loopback addresses") + } + })?; config.ssl_mode(SslMode::Disable); } } @@ -2059,6 +2077,17 @@ mod tests { endpoint.product_url("owned", "runtime", "pw").unwrap(), "postgresql://runtime:pw@172.20.0.7:5432/owned?sslmode=disable" ); + let (explicit, selected) = + admin_config_with_resolver(&format!("{url}&sslmode=disable"), &move |_| { + Ok(vec![private]) + }) + .unwrap(); + assert_eq!(explicit.get_ssl_mode(), SslMode::Disable); + assert_eq!(explicit.get_hostaddrs(), &[private]); + assert_eq!( + selected.transport, + DatabaseTransport::PrivateNetworkPlaintext + ); for addresses in [ vec![private, std::net::IpAddr::from([203, 0, 113, 1])], vec![std::net::IpAddr::from([169, 254, 169, 254])], @@ -2082,6 +2111,72 @@ mod tests { .is_err()); } + #[test] + fn private_admin_url_distinguishes_lookup_failure_from_refused_addresses() { + let base = + "postgresql://admin:synthetic-url-value@postgres.compose:5432/postgres?transport="; + for value in ["", "loopback-plaintext", "verified-tls"] { + assert!(admin_config_with_resolver(&format!("{base}{value}"), &|_| { + panic!("an invalid selector must be refused before lookup"); + }) + .is_err()); + } + let url = format!("{base}private-network-plaintext"); + let failure = admin_config_with_resolver(&url, &|_| { + Err(std::io::Error::other("synthetic-private-dns-error")) + }) + .err() + .unwrap(); + let refusal = + admin_config_with_resolver(&url, &|_| Ok(vec!["203.0.113.1".parse().unwrap()])) + .err() + .unwrap(); + for (error, code, class, message) in [ + (failure, 3, "operational", "could not resolve the PostgreSQL admin host for private-network-plaintext"), + (refusal, 1, "domain", "the PostgreSQL admin URL with private-network-plaintext must resolve only to permitted private or loopback addresses"), + ] { + let mut wire = Vec::new(); + crate::reply(&mut wire, &crate::WorkerReply::failed(&error)).unwrap(); + let crate::WorkerReply::Failed { error, operational } = serde_json::from_slice(&wire).unwrap() else { + panic!("a refused lookup must produce a worker failure"); + }; + let (report, exit_code) = crate::error_report(&crate::restore_failure(error, operational)); + assert_eq!(exit_code, code); + assert_eq!(report, serde_json::json!({ + "schema_version": "registry.rstack.error.v1", + "status": "refused", + "error": {"class": class, "message": message}, + })); + } + } + + #[test] + fn private_plaintext_tries_checked_candidates_in_order_and_pins_the_winner() { + let url = "postgresql://admin:synthetic-url-value@postgres.compose:5432/postgres?transport=private-network-plaintext"; + let addresses = ["172.20.0.7", "172.20.0.9", "172.20.0.11"].map(|ip| ip.parse().unwrap()); + let (checked, _) = + admin_config_with_resolver(url, &move |_| Ok(addresses.to_vec())).unwrap(); + let mut attempted = Vec::new(); + let (config, endpoint, ()) = + open_plaintext_candidates(url, checked.get_hostaddrs(), |config| { + let [address] = config.get_hostaddrs() else { + panic!("expected one checked candidate") + }; + attempted.push(*address); + if *address == addresses[0] { + bail!("first address refused") + } + Ok(()) + }) + .unwrap(); + assert_eq!(attempted, &addresses[..2]); + assert_eq!(config.get_hostaddrs(), &addresses[1..2]); + assert_eq!( + endpoint.product_url("owned", "runtime", "pw").unwrap(), + "postgresql://runtime:pw@172.20.0.9:5432/owned?sslmode=disable" + ); + } + #[test] fn spatial_runs_are_refused_without_a_supported_postgis() { assert!(require_postgis(Some("3.5.2")).is_ok()); @@ -2975,7 +3070,7 @@ mod postgres_tests { } } -/// Loopback plaintext attach against a real server without TLS. +/// Explicit plaintext attach against a real server without TLS. /// `RSTACK_DEV_TEST_PLAINTEXT_DATABASE_URL` names a disposable loopback /// PostgreSQL administrator URL with `?sslmode=disable`. Without the variable /// the test fails on the spot: a skipped database test is not database @@ -3032,5 +3127,35 @@ mod plaintext_postgres_tests { .cleanup() .expect("cleanup drops every provisioned database and role"); assert!(database.pending_names().is_empty()); + drop(database); + + // The workflow selects this test by its existing name. Exercise the + // private selector against the same disposable server on loopback. + let mut private_url = Url::parse(&admin_url).unwrap(); + private_url + .query_pairs_mut() + .append_pair("transport", "private-network-plaintext"); + let mut database = Database::connect(private_url.as_str(), None, &run_id) + .expect("attach over the explicitly selected private transport"); + let urls = database.provision("documents", false, false).unwrap(); + assert_eq!(urls.transport, DatabaseTransport::PrivateNetworkPlaintext); + let recorded_identity = database.recovery_identity().clone(); + let mut different_cluster = recorded_identity.clone(); + different_cluster.system_identifier ^= 1; + let names = database.pending_names(); + assert!(!names.is_empty()); + drop(database); + let refusal = + Database::connect_for_recovery(private_url.as_str(), None, &run_id, &different_cluster) + .err() + .expect("a different cluster cannot take over the run"); + assert!(format!("{refusal:#}").contains("different PostgreSQL cluster")); + let mut recovery = + Database::connect_for_recovery(private_url.as_str(), None, &run_id, &recorded_identity) + .expect("recover the private attachment from the recorded cluster"); + recovery.adopt("documents", false).unwrap(); + assert_eq!(recovery.pending_names(), names); + recovery.cleanup().unwrap(); + assert!(recovery.pending_names().is_empty()); } } diff --git a/crates/registry-rstack-dev/src/lib.rs b/crates/registry-rstack-dev/src/lib.rs index aeedf1dc89..8ddc19f915 100644 --- a/crates/registry-rstack-dev/src/lib.rs +++ b/crates/registry-rstack-dev/src/lib.rs @@ -22,6 +22,7 @@ mod external_breg; pub(crate) mod guard; mod issuer; mod journey; +mod owner_report; pub(crate) mod plan; mod preview; mod products; @@ -124,6 +125,9 @@ enum Entry { deny_warnings: bool, #[arg(long)] json: bool, + #[arg(long, value_enum)] + owner_report_format: Option, + /// Plan directory, or the saved JSON file when an owner report format is selected. project: PathBuf, }, Start { @@ -609,11 +613,24 @@ pub fn run(args: Args, stdout: &mut dyn Write, stderr: &mut dyn Write) -> ExitCo project, deny_warnings, json, + owner_report_format, } => { + if let Some(format) = owner_report_format { + let (report, mut exit) = owner_report::check_file(&project, format); + if exit == 0 + && deny_warnings + && registry_platform_config::has_denied_warnings(report.diagnostics()) + { + exit = DOMAIN_REFUSAL_EXIT; + } + return ExitCode::from(write_check_report( + report, exit, json, stdout, stderr, true, + )); + } if let Err((code, message, action)) = require_development(declared(None)) { let report = Report::new(vec![Diagnostic::error(code, "", message, action)]); return ExitCode::from(write_check_report( - report, USAGE_EXIT, json, stdout, stderr, + report, USAGE_EXIT, json, stdout, stderr, false, )); } return ExitCode::from(check(&project, deny_warnings, json, stdout, stderr)); @@ -934,6 +951,7 @@ fn check( machine, stdout, stderr, + false, ); } let (code, action, exit) = if error.is::() { @@ -956,7 +974,7 @@ fn check( } }, }; - write_check_report(report, exit, machine, stdout, stderr) + write_check_report(report, exit, machine, stdout, stderr, false) } fn write_check_report( @@ -965,20 +983,28 @@ fn write_check_report( machine: bool, stdout: &mut dyn Write, stderr: &mut dyn Write, + structure_only: bool, ) -> u8 { let result = if machine { - let payload = json!({ + let mut payload = json!({ "ok": exit == 0, "command": "dev-check", "status": registry_cli_report::Status::from_exit(exit).as_str(), "diagnostics": report.to_json_value(), }); + if structure_only { + payload["assessment"] = json!("owner-report-structure"); + } write_check_json(stdout, payload) .map_err(io::Error::other) .and_then(|()| writeln!(stdout)) } else if exit == 0 { - writeln!(stdout, "Development plan is valid") - .and_then(|()| write!(stdout, "{}", report.render_human())) + let message = if structure_only { + "Owner report structure is valid" + } else { + "Development plan is valid" + }; + writeln!(stdout, "{message}").and_then(|()| write!(stdout, "{}", report.render_human())) } else { write!(stderr, "{}", report.render_human()) }; @@ -1734,6 +1760,10 @@ fn worker(root: &Path, output: &mut dyn Write) -> Result<()> { if let Some(hook_sink) = products.breg_hook_report() { report["bregHookSink"] = hook_sink; } + let hook_sinks = products.signed_hook_reports(); + if !hook_sinks.is_empty() { + report["hookSinks"] = json!(hook_sinks); + } let created_keys = products.created_kept_keys(); if !created_keys.is_empty() { report["createdKeptKeys"] = json!(created_keys.as_slice()); diff --git a/crates/registry-rstack-dev/src/owner_report.rs b/crates/registry-rstack-dev/src/owner_report.rs new file mode 100644 index 0000000000..e825a2b4b2 --- /dev/null +++ b/crates/registry-rstack-dev/src/owner_report.rs @@ -0,0 +1,594 @@ +// SPDX-License-Identifier: Apache-2.0 + +//! Structural read-back of bounded saved JSON reports. + +use jsonschema::{ + error::{ErrorIterator, ValidationErrorKind}, + paths::{JSONPointer, JsonPointerNode, PathChunk}, + Draft, JSONSchema, Keyword, ValidationError, +}; +use registry_platform_yaml::{ + escape_pointer_segment, ApiVersion, Diagnostic, Document, EnvelopeRule, Expect, FormatSpec, + Reader, Report, Severity, Source, MAXIMUM_DOCUMENT_BYTES, +}; +use serde_json::{json, Value}; +use std::{ + borrow::Cow, + collections::{BTreeMap, BTreeSet}, + fs::OpenOptions, + io::{self, Read}, + os::unix::fs::OpenOptionsExt, + path::Path, + sync::OnceLock, +}; + +const CASEWORK: &str = include_str!("../../../products/casework/contracts/cli/report.schema.json"); +const CASEWORK_FORMAT: FormatSpec<'static> = FormatSpec { + kind: "CaseworkReport", + envelope: EnvelopeRule::ApiVersionKind { + api_versions: &[ApiVersion::current( + "id.registrystack.org/formats/casework/report/v1alpha2", + )], + retired_api_versions: &[], + }, + removed_keys: &[], +}; + +#[derive(Clone, Copy, Debug, PartialEq, Eq, clap::ValueEnum)] +pub(crate) enum Format { + CaseworkReport, +} + +#[derive(Debug)] +pub(crate) struct Invalid { + path: String, + code: &'static str, + message: Cow<'static, str>, + position: Option<(usize, usize)>, + schema_unavailable: bool, +} + +impl Invalid { + fn at(path: impl Into, message: &'static str) -> Self { + Self { + path: path.into(), + code: "rstack.dev.owner-report-invalid", + message: Cow::Borrowed(message), + position: None, + schema_unavailable: false, + } + } + + fn into_report(self, file: &str) -> (Report, u8) { + let (exit, code, remedy) = if self.schema_unavailable { + ( + crate::OPERATIONAL_FAILURE_EXIT, + "rstack.dev.owner-report-schema-unavailable", + "Use an rstack development host with a valid embedded owner report schema.", + ) + } else { + (crate::DOMAIN_REFUSAL_EXIT, self.code, FORMAT_REMEDY) + }; + let mut diagnostic = Diagnostic::error(code, self.path, self.message, remedy); + diagnostic.artifact = Some(CASEWORK_FORMAT.kind.to_owned()); + diagnostic.source = Some(Source { + file: file.to_owned(), + line: self.position.map(|(line, _)| line), + column: self + .position + .and_then(|(_, column)| (column > 0).then_some(column)), + }); + let mut report = Report::new(vec![diagnostic]); + report.set_files_checked(1); + (report, exit) + } +} + +fn parse(bytes: &[u8]) -> Result { + if bytes.len() > MAXIMUM_DOCUMENT_BYTES { + return Err(Invalid::at("", "Owner report exceeds the 1 MiB limit")); + } + registry_platform_canonical_json::parse_json_preserving_integers(bytes).map_err(|error| { + Invalid { + position: parse_position(bytes, error.line(), error.column()), + ..Invalid::at( + "", + "Expected one valid JSON document with unique member names", + ) + } + }) +} + +fn parse_position(bytes: &[u8], line: usize, byte_column: usize) -> Option<(usize, usize)> { + let line_bytes = bytes + .split(|byte| *byte == b'\n') + .nth(line.checked_sub(1)?)?; + let prefix = &line_bytes[..byte_column.saturating_sub(1).min(line_bytes.len())]; + Some((line, String::from_utf8_lossy(prefix).chars().count() + 1)) +} + +fn check_bytes(file: &str, bytes: &[u8], format: Format) -> (Report, u8) { + let report = match parse(bytes) { + Ok(report) => report, + Err(error) => return error.into_report(file), + }; + let expected = match format { + Format::CaseworkReport => &CASEWORK_FORMAT, + }; + // The JSON parser enforces the declared syntax. The shared reader checks + // the envelope and retains positions for every schema diagnostic. + let document = match Reader::new(file).read(bytes, &Expect::one(expected)) { + Ok(document) => document, + Err(mut report) => { + redact_structure(&mut report); + return (report, crate::DOMAIN_REFUSAL_EXIT); + } + }; + let issues = match validate(&report, format, Some(&document)) { + Ok(issues) => issues, + Err(error) => return error.into_report(file), + }; + let mut report = document.report_with(issues.into_iter().map(|issue| { + let mut diagnostic = document.diagnostic_at_value( + Severity::Error, + issue.code, + &issue.path, + &issue.message, + FORMAT_REMEDY, + ); + if let (Some((line, column)), Some(source)) = (issue.position, &mut diagnostic.source) { + source.line = Some(line); + source.column = Some(column); + } + diagnostic + })); + redact_warnings(&mut report); + let exit = u8::from(report.has_errors()); + (report, exit) +} + +const FORMAT_REMEDY: &str = + "Select the matching owner report format and capture a fresh report as JSON."; + +fn redact_structure(report: &mut Report) { + for diagnostic in report.diagnostics_mut() { + if diagnostic.code == "config.too-many-problems" { + continue; + } + if !matches!(diagnostic.path.as_str(), "/kind" | "/apiVersion") { + diagnostic.path.clear(); + } + diagnostic.message = + "Expected a valid CaseworkReport v1alpha2 envelope and document".to_owned(); + diagnostic.suggested_action = FORMAT_REMEDY.to_owned(); + diagnostic.related.clear(); + } +} + +fn redact_warnings(report: &mut Report) { + for diagnostic in report.diagnostics_mut() { + if diagnostic.severity == Severity::Warning { + diagnostic.path.clear(); + diagnostic.message = "Owner report uses a deprecated document form".to_owned(); + diagnostic.suggested_action = FORMAT_REMEDY.to_owned(); + diagnostic.related.clear(); + } + } +} + +fn validate( + report: &Value, + format: Format, + document: Option<&Document>, +) -> Result, Invalid> { + match format { + Format::CaseworkReport => validate_casework(report, document), + } +} + +struct CaseworkSchemas { + family: Schema, + branches: BTreeMap, +} + +fn validate_casework(report: &Value, document: Option<&Document>) -> Result, Invalid> { + static SCHEMAS: OnceLock> = OnceLock::new(); + let schemas = SCHEMAS.get_or_init(|| { + let mut schema: Value = serde_json::from_str(CASEWORK).ok()?; + let mut branches = BTreeMap::new(); + for branch in schema["oneOf"].as_array()? { + // The generated family consists of closed branches with distinct command constants. + if branch["additionalProperties"] != false { + return None; + } + let command = branch.pointer("/properties/command/const")?.as_str()?; + let mut branch = branch.clone(); + branch["$defs"] = schema["$defs"].clone(); + if branches + .insert(command.to_owned(), compile(branch)?) + .is_some() + { + return None; + } + } + // Every selected command branch already rejects undeclared fields. + // jsonschema 0.18 misattributes evaluated properties across the root + // applicators, so compile the family without the redundant closure. + if schema.as_object_mut()?.remove("unevaluatedProperties") != Some(json!(false)) { + return None; + } + Some(CaseworkSchemas { + family: compile(schema)?, + branches, + }) + }); + let schemas = schemas.as_ref().ok_or_else(schema_unavailable)?; + let branch = report["command"] + .as_str() + .and_then(|command| schemas.branches.get(command)); + let Some(branch) = branch else { + return Ok(vec![Invalid::at( + if report.get("command").is_some() { + "/command" + } else { + "" + }, + "Expected a command from the Casework report contract", + )]); + }; + // Validate the selected branch first to retain its field-level diagnostics. + // The family also imposes shared completion and refusal rules at the root. + let issues = branch.issues(report, "", document); + if issues.is_empty() { + Ok(schemas.family.issues(report, "", document)) + } else { + Ok(issues) + } +} + +fn schema_unavailable() -> Invalid { + Invalid { + schema_unavailable: true, + ..Invalid::at("", "The embedded owner report schema could not be loaded") + } +} + +const MAX_DIAGNOSTIC_NODES: usize = 256; +const MAX_DIAGNOSTIC_TEXT_BYTES: usize = 16 * 1024; + +struct Schema { + validator: JSONSchema, + document: Value, +} + +impl Schema { + fn issues(&self, value: &Value, prefix: &str, document: Option<&Document>) -> Vec { + if self.validator.is_valid(value) { + return Vec::new(); + } + let fallback = || Invalid::at(prefix, "Owner report violates the selected schema"); + // Detailed validation eagerly collects child errors for array items. + let mut nodes = MAX_DIAGNOSTIC_NODES; + let mut text_bytes = MAX_DIAGNOSTIC_TEXT_BYTES; + if !fits_diagnostic_budget(value, &mut nodes, &mut text_bytes) { + return vec![fallback()]; + } + let Err(errors) = self.validator.validate(value) else { + return vec![fallback()]; + }; + let mut issues = Vec::new(); + let mut seen = BTreeSet::new(); + for error in errors { + let path = self.diagnostic_path(prefix, &error.instance_path); + let raw_parent = error.instance_path.to_string(); + if let ValidationErrorKind::AdditionalProperties { unexpected } = &error.kind { + for key in unexpected { + // Use the unknown key to locate it, then report only the safe parent. + let raw = format!("{raw_parent}/{}", escape_pointer_segment(key)); + let position = document + .and_then(|doc| doc.key_span_of(&raw)) + .map(|span| (span.start.line, span.start.column)); + let issue = Invalid { + code: "config.unknown-key", + position, + ..Invalid::at( + path.clone(), + "Owner report contains a member outside the selected schema", + ) + }; + issues.push(issue); + } + continue; + } + let mut issue = Invalid::at( + path, + "Owner report violates the selected schema at this location", + ); + issue.position = document + .and_then(|doc| doc.span_of(&raw_parent)) + .map(|span| (span.start.line, span.start.column)); + match &error.kind { + ValidationErrorKind::Minimum { .. } + | ValidationErrorKind::Maximum { .. } + | ValidationErrorKind::Custom { .. } => { + if let Some((minimum, maximum)) = self.error_integer_bounds(&error) { + issue.code = if integer(&error.instance).is_some() { + "config.out-of-range" + } else { + "config.wrong-type" + }; + issue.message = + format!("Expected a JSON integer from {minimum} to {maximum}").into(); + } + } + ValidationErrorKind::Required { property } => { + issue.code = "config.missing-key"; + if let Some(key) = property.as_str() { + issue.message = format!("Owner report requires the {key} member").into(); + } + issue.position = document + .and_then(|doc| doc.key_span_of(&raw_parent)) + .map(|span| (span.start.line, span.start.column)) + .or(issue.position); + } + _ => {} + } + if seen.insert(( + issue.path.clone(), + issue.position, + issue.code, + issue.message.clone(), + )) { + issues.push(issue); + } + } + issues + } + + fn error_integer_bounds(&self, error: &ValidationError<'_>) -> Option<(i128, i128)> { + let schema_path = error.schema_path.to_string(); + let (parent, _) = schema_path.rsplit_once('/')?; + let schema = self.document.pointer(parent)?.as_object()?; + schema + .contains_key(EXACT_INTEGER) + .then(|| exact_integer_bounds(schema)) + } + + fn diagnostic_path(&self, prefix: &str, instance_path: &JSONPointer) -> String { + let mut path = prefix.to_owned(); + let mut schema = &self.document; + for part in instance_path { + let Some(resolved) = self.resolve_path_schema(schema) else { + break; + }; + // Only literal properties and array items establish a safe path. + // Dynamic map members and ambiguous schema positions end the path. + match part { + PathChunk::Property(name) => { + let Some(child) = resolved["properties"].get(name.as_ref()) else { + break; + }; + schema = child; + path.push('/'); + path.push_str(&escape_pointer_segment(name)); + } + PathChunk::Index(index) => { + let Some(child) = resolved["prefixItems"] + .get(*index) + .or_else(|| resolved.get("items")) + else { + break; + }; + schema = child; + path.push('/'); + path.push_str(&index.to_string()); + } + PathChunk::Keyword(_) => break, + } + } + path + } + + fn resolve_path_schema<'a>(&'a self, mut schema: &'a Value) -> Option<&'a Value> { + for _ in 0..16 { + let Some(reference) = schema.get("$ref") else { + return Some(schema); + }; + let pointer = reference.as_str()?.strip_prefix('#')?; + schema = self.document.pointer(pointer)?; + } + None + } +} + +fn fits_diagnostic_budget(value: &Value, nodes: &mut usize, text_bytes: &mut usize) -> bool { + let Some(remaining) = nodes.checked_sub(1) else { + return false; + }; + *nodes = remaining; + match value { + Value::Array(items) => items + .iter() + .all(|item| fits_diagnostic_budget(item, nodes, text_bytes)), + Value::Object(fields) => fields.iter().all(|(key, value)| { + spend_text_budget(key, text_bytes) && fits_diagnostic_budget(value, nodes, text_bytes) + }), + Value::String(text) => spend_text_budget(text, text_bytes), + _ => true, + } +} + +fn spend_text_budget(text: &str, budget: &mut usize) -> bool { + let Some(remaining) = budget.checked_sub(text.len()) else { + return false; + }; + *budget = remaining; + true +} + +const EXACT_INTEGER: &str = "x-rstack-report-integer"; + +fn compile(mut document: Value) -> Option { + annotate(&mut document); + let validator = JSONSchema::options() + .with_draft(Draft::Draft202012) + .with_keyword(EXACT_INTEGER, exact_integer) + .compile(&document) + .ok()?; + Some(Schema { + validator, + document, + }) +} + +// Add integer-token checks to compiler input only. The standard validator still +// applies the generated schema and resolves references and union arms normally. +fn annotate(schema: &mut Value) { + if schema["type"] == "integer" + || schema["type"] + .as_array() + .is_some_and(|types| types.iter().any(|ty| ty == "integer")) + { + schema[EXACT_INTEGER] = json!(true); + } + for key in [ + "properties", + "$defs", + "patternProperties", + "dependentSchemas", + ] { + if let Some(children) = schema.get_mut(key).and_then(Value::as_object_mut) { + for child in children.values_mut() { + annotate(child); + } + } + } + for key in ["oneOf", "anyOf", "allOf", "prefixItems"] { + if let Some(children) = schema.get_mut(key).and_then(Value::as_array_mut) { + for child in children { + annotate(child); + } + } + } + for key in [ + "items", + "additionalProperties", + "if", + "then", + "else", + "not", + "contains", + ] { + if let Some(child) = schema.get_mut(key) { + annotate(child); + } + } +} + +fn integer(value: &Value) -> Option { + value + .as_u64() + .map(i128::from) + .or_else(|| value.as_i64().map(i128::from)) +} + +struct ExactInteger { + path: JSONPointer, + minimum: i128, + maximum: i128, + nullable: bool, +} + +fn exact_integer<'a>( + parent: &'a serde_json::Map, + _: &'a Value, + path: JSONPointer, +) -> Result, ValidationError<'a>> { + let (minimum, maximum) = exact_integer_bounds(parent); + let nullable = parent + .get("type") + .and_then(Value::as_array) + .is_some_and(|types| types.iter().any(|ty| ty == "null")); + Ok(Box::new(ExactInteger { + path, + minimum, + maximum, + nullable, + })) +} + +fn exact_integer_bounds(parent: &serde_json::Map) -> (i128, i128) { + let minimum = parent + .get("minimum") + .and_then(integer) + .unwrap_or(i128::from(i64::MIN)); + let mut maximum = parent + .get("maximum") + .and_then(integer) + .unwrap_or(i128::from(u64::MAX)); + if parent.get("format").and_then(Value::as_str) == Some("uint") { + maximum = maximum.min(usize::MAX as i128); + } + (minimum, maximum) +} + +impl Keyword for ExactInteger { + fn is_valid(&self, value: &Value) -> bool { + (self.nullable && value.is_null()) + || integer(value).is_some_and(|n| (self.minimum..=self.maximum).contains(&n)) + } + + fn validate<'a>(&self, value: &'a Value, path: &JsonPointerNode) -> ErrorIterator<'a> { + if self.is_valid(value) { + Box::new(std::iter::empty()) + } else { + Box::new(std::iter::once(ValidationError::custom( + self.path.clone(), + path.clone().into(), + value, + "Expected a bounded native integer", + ))) + } + } +} + +pub(crate) fn check_file(path: &Path, format: Format) -> (Report, u8) { + let file = OpenOptions::new() + .read(true) + .custom_flags(rustix::fs::OFlags::NONBLOCK.bits() as i32) + .open(path); + let bytes = file.and_then(|file| { + if !file.metadata()?.is_file() { + return Err(io::Error::other("expected a regular file")); + } + let mut bytes = Vec::new(); + file.take(MAXIMUM_DOCUMENT_BYTES as u64 + 1) + .read_to_end(&mut bytes)?; + Ok(bytes) + }); + let file = path.to_string_lossy(); + match bytes { + Ok(bytes) => check_bytes(&file, &bytes, format), + Err(_) => { + let mut diagnostic = Diagnostic::error( + "rstack.dev.owner-report-unreadable", + "", + "Cannot read the owner report as a regular file", + "Pass a readable regular JSON file to --owner-report.", + ); + diagnostic.source = Some(Source { + file: file.into_owned(), + line: None, + column: None, + }); + ( + Report::new(vec![diagnostic]), + crate::OPERATIONAL_FAILURE_EXIT, + ) + } + } +} + +#[cfg(test)] +#[path = "owner_report_tests.rs"] +mod tests; diff --git a/crates/registry-rstack-dev/src/owner_report_tests.rs b/crates/registry-rstack-dev/src/owner_report_tests.rs new file mode 100644 index 0000000000..b49ae3a350 --- /dev/null +++ b/crates/registry-rstack-dev/src/owner_report_tests.rs @@ -0,0 +1,247 @@ +// SPDX-License-Identifier: Apache-2.0 + +use super::*; + +const CASEWORK: &str = + include_str!("../../../products/casework/examples/formats/reports/check-report.json"); + +fn decode(bytes: &[u8], format: Format) -> Result<(), Diagnostic> { + let (report, exit) = check_bytes("synthetic.json", bytes, format); + if exit == 0 { + Ok(()) + } else { + Err(report.into_diagnostics().into_iter().next().unwrap()) + } +} + +#[test] +fn casework_checks_resolved_branch_and_exact_numeric_tokens() { + let report = |count: &str| { + let value: Value = serde_json::from_str(CASEWORK).unwrap(); + let marker = "replace-count"; + let mut value = value; + value["filesChecked"] = json!(marker); + serde_json::to_string(&value) + .unwrap() + .replace(&format!("\"{marker}\""), count) + }; + for count in ["0", &usize::MAX.to_string()] { + assert!(decode(report(count).as_bytes(), Format::CaseworkReport).is_ok()); + } + for count in ["-1", "1.0", "1e0"] { + let error = decode(report(count).as_bytes(), Format::CaseworkReport).unwrap_err(); + assert_eq!(error.path, "/filesChecked"); + } + assert!(decode( + report("18446744073709551616").as_bytes(), + Format::CaseworkReport + ) + .is_err()); + let mut check: Value = serde_json::from_str(CASEWORK).unwrap(); + check["status"] = json!("domain-refusal"); + assert!(decode(&serde_json::to_vec(&check).unwrap(), Format::CaseworkReport).is_err()); + check["status"] = json!("complete"); + check["unexpected"] = json!(true); + assert!(decode(&serde_json::to_vec(&check).unwrap(), Format::CaseworkReport).is_err()); + check.as_object_mut().unwrap().remove("unexpected"); + check["command"] = json!("package"); + assert!(decode(&serde_json::to_vec(&check).unwrap(), Format::CaseworkReport).is_err()); +} + +#[test] +fn casework_native_u32_counts_use_the_selected_command_branch() { + let mut report = json!({ + "ok": true, "command": "generate-identity-facts", "status": "complete", + "apiVersion": "id.registrystack.org/formats/casework/report/v1alpha2", + "kind": "CaseworkReport", "version": "synthetic", "diagnostics": [], + "output": "synthetic.json", "product": "casework", + "claims": u32::MAX, "accessProfiles": 0, "assertionIssuers": 0, + }); + let decode = + |report: &Value| decode(&serde_json::to_vec(report).unwrap(), Format::CaseworkReport); + assert!(decode(&report).is_ok()); + report["claims"] = json!(u64::from(u32::MAX) + 1); + assert_eq!(decode(&report).unwrap_err().path, "/claims"); +} + +#[test] +fn plain_reader_refuses_duplicate_trailing_and_oversized_json() { + assert!(parse(br#"{"a":{"b":1,"b":2}}"#).is_err()); + assert!(parse(br#"{} {}"#).is_err()); + assert!(parse(&vec![b' '; MAXIMUM_DOCUMENT_BYTES + 1]).is_err()); +} + +#[test] +fn integer_constraints_follow_refs_and_selected_union_arms() { + let schema = compile(json!({ + "$defs": {"bound": {"type": ["integer", "null"], "minimum": 0, "maximum": 65535}}, + "oneOf": [ + {"type": "object", "required": ["type", "count"], + "properties": {"type": {"const": "count"}, "count": {"$ref": "#/$defs/bound"}}}, + {"type": "object", "required": ["type", "count"], + "properties": {"type": {"const": "number"}, "count": {"type": "number"}}} + ] + })) + .unwrap(); + for (raw, valid) in [ + (br#"{"type":"count","count":65535}"#.as_slice(), true), + (br#"{"type":"count","count":null}"#, true), + (br#"{"type":"count","count":65536}"#, false), + (br#"{"type":"count","count":1e0}"#, false), + (br#"{"type":"number","count":1e0}"#, true), + ] { + assert_eq!(schema.validator.is_valid(&parse(raw).unwrap()), valid); + } + let signed = + compile(json!({"type": "integer", "minimum": i64::MIN, "maximum": i64::MAX})).unwrap(); + assert!(signed.validator.is_valid(&json!(i64::MIN))); + assert!(signed.validator.is_valid(&json!(i64::MAX))); + assert!(!signed.validator.is_valid(&json!(i64::MAX as u64 + 1))); + assert!(!signed + .validator + .is_valid(&parse(b"-9223372036854775809").unwrap())); + let unsigned = compile(json!({"type": "integer", "minimum":0, "maximum": u64::MAX})).unwrap(); + for n in [(1u64 << 53) - 1, (1u64 << 53) + 1, u64::MAX - 1, u64::MAX] { + assert!(unsigned.validator.is_valid(&json!(n))); + } +} + +#[test] +fn hosted_file_check_reports_structure_and_redacts_parser_errors() { + let file = tempfile::NamedTempFile::new().unwrap(); + let run = |bytes: &[u8]| { + std::fs::write(file.path(), bytes).unwrap(); + let mut out = Vec::new(); + let mut err = Vec::new(); + let status = crate::run( + crate::Args { + entry: crate::Entry::Check { + project: file.path().to_owned(), + deny_warnings: false, + json: true, + owner_report_format: Some(Format::CaseworkReport), + }, + }, + &mut out, + &mut err, + ); + assert!(err.is_empty()); + (status, String::from_utf8(out).unwrap()) + }; + let (status, output) = run(CASEWORK.as_bytes()); + assert_eq!(status, std::process::ExitCode::SUCCESS); + let report: Value = serde_json::from_str(&output).unwrap(); + assert_eq!(report["assessment"], "owner-report-structure"); + let (status, output) = + run(b"{\n\"synthetic-private-member\": 1, \"synthetic-private-member\": 2}"); + assert_eq!(status, std::process::ExitCode::from(1)); + assert!(!output.contains("synthetic-private-member")); + let report: Value = serde_json::from_str(&output).unwrap(); + assert_eq!(report["diagnostics"][0]["source"]["line"], 2); + assert_eq!( + report["diagnostics"][0]["code"], + "rstack.dev.owner-report-invalid" + ); +} + +#[test] +fn saved_report_retains_positions_and_numeric_bounds_without_echoing_input() { + let file = tempfile::NamedTempFile::new().unwrap(); + let source = CASEWORK + .replace("\"filesChecked\": 1", "\"filesChecked\": -918204") + .replace( + "\"networkAccess\": false", + "\"networkAccess\": \"synthetic-private-value\"", + ); + std::fs::write(file.path(), source).unwrap(); + let (report, exit) = check_file(file.path(), Format::CaseworkReport); + assert_eq!(exit, 1); + assert_eq!(report.error_count(), 2); + let diagnostics = report.diagnostics(); + assert_eq!(diagnostics[0].code, "config.out-of-range"); + assert_eq!(diagnostics[0].path, "/filesChecked"); + assert!(diagnostics[0].message.contains(&usize::MAX.to_string())); + let position = diagnostics[0].source.as_ref().unwrap(); + assert_eq!((position.line, position.column), (Some(9), Some(19))); + assert_eq!(diagnostics[1].path, "/networkAccess"); + assert_eq!(diagnostics[1].source.as_ref().unwrap().line, Some(10)); + let output = report.render_human(); + assert!(!output.contains("-918204")); + assert!(!output.contains("synthetic-private-value")); +} + +#[test] +fn saved_report_retains_unknown_key_locations_and_all_envelope_refusals() { + let source = CASEWORK.replace( + "\"version\": \"0.49.0-dev\"", + "\"version\": \"0.49.0-dev\",\n \"private-canary-one\": true,\n \"private-canary-two\": false", + ); + let (report, exit) = check_bytes("synthetic.json", source.as_bytes(), Format::CaseworkReport); + assert_eq!(exit, 1); + assert_eq!(report.error_count(), 2); + for (diagnostic, line) in report.diagnostics().iter().zip([8, 9]) { + let position = diagnostic.source.as_ref().unwrap(); + assert_eq!((position.line, position.column), (Some(line), Some(3))); + assert_eq!(diagnostic.code, "config.unknown-key"); + } + assert!(!report.render_human().contains("private-canary")); + + let source = CASEWORK.replace("CaseworkReport", "private-kind").replace( + "\"id.registrystack.org/formats/casework/report/v1alpha2\"", + "[\"private-version\"]", + ); + let (report, exit) = check_bytes("synthetic.json", source.as_bytes(), Format::CaseworkReport); + assert_eq!(exit, 1); + assert_eq!(report.error_count(), 2); + assert_eq!(report.diagnostics()[0].path, "/apiVersion"); + assert_eq!(report.diagnostics()[1].path, "/kind"); + assert!(!report.render_human().contains("private-")); +} + +#[test] +fn near_limit_invalid_diagnostics_use_the_generic_fallback() { + let mut report: Value = serde_json::from_str(CASEWORK).unwrap(); + let cell = json!("x".repeat(64)); + let cell_bytes = serde_json::to_vec(&cell).unwrap().len() + 1; + let cap = MAXIMUM_DOCUMENT_BYTES; + let overhead = serde_json::to_vec(&report).unwrap().len(); + report["diagnostics"] = json!(vec![cell; (cap - overhead) / cell_bytes]); + let bytes = serde_json::to_vec(&report).unwrap(); + assert!((cap - cell_bytes..=cap).contains(&bytes.len())); + let error = decode(&bytes, Format::CaseworkReport).unwrap_err(); + assert_eq!(error.path, ""); + assert_eq!(error.message, "Owner report violates the selected schema"); +} + +#[test] +fn ordinary_diagnostics_retain_exact_field_locations() { + let mut report: Value = serde_json::from_str(CASEWORK).unwrap(); + report["policyBindings"][0]["digest"] = json!(false); + let error = validate(&report, Format::CaseworkReport, None) + .unwrap() + .remove(0); + assert_eq!(error.path, "/policyBindings/0/digest"); + assert_eq!( + error.message, + "Owner report violates the selected schema at this location" + ); +} + +#[test] +fn dynamic_map_members_are_redacted_even_when_they_match_schema_names() { + let document: Value = serde_json::from_str(super::CASEWORK).unwrap(); + let schema = compile(json!({ + "$defs": document["$defs"], + "properties": { + "condition": {"$ref": "#/$defs/RoutingCondition"}, + "stage": {"type": "string"} + } + })) + .unwrap(); + for key in ["stage", "synthetic-private-map-key"] { + let value = json!({"condition": {"fields": {(key): false}}}); + let error = schema.issues(&value, "", None).remove(0); + assert_eq!(error.path, "/condition/fields"); + assert!(!format!("{error:?}").contains(key)); + } +} diff --git a/crates/registry-rstack-dev/src/products.rs b/crates/registry-rstack-dev/src/products.rs index ea6a5aaa62..94222cfbdb 100644 --- a/crates/registry-rstack-dev/src/products.rs +++ b/crates/registry-rstack-dev/src/products.rs @@ -350,6 +350,7 @@ pub(super) struct ProductRunner<'a> { /// run. gateway: Option, hook_sink: Option, + signed_hook_sinks: BTreeMap, /// Where each Messaging provider's sent messages can be read, by provider /// ID. sinks: BTreeMap, @@ -389,6 +390,7 @@ impl<'a> ProductRunner<'a> { coordinator_issuer: None, gateway: None, hook_sink: None, + signed_hook_sinks: BTreeMap::new(), sinks: BTreeMap::new(), messaging_providers: None, runtime_configs: BTreeMap::new(), @@ -1298,6 +1300,88 @@ impl<'a> ProductRunner<'a> { }) } + pub(super) fn signed_hook_reports(&self) -> serde_json::Map { + self.signed_hook_sinks + .iter() + .map(|(product, sink)| { + ( + product.name().to_owned(), + json!({"receivedUrl": format!("{}/received", sink.origin)}), + ) + }) + .collect() + } + + fn bind_signed_hooks( + &mut self, + product: Product, + project: &Path, + runtime: &mut Value, + ) -> Result<()> { + use registry_platform_crypto::delivery_signature::{DeliveryKey, DeliveryKeys}; + use registry_platform_yaml::LocalId; + + let project_file = match product { + Product::Documents => "documents.yaml", + Product::Scheduling => "scheduling.yaml", + _ => return Ok(()), + }; + // The product has already validated and packaged the authored policy. + // Read only the URL destination names the development runtime must bind. + let document = authored_document(&project.join(project_file))?; + let hooks = match &document["hooks"] { + Value::Null => Vec::new(), + Value::Array(hooks) if product == Product::Documents => hooks.iter().collect(), + Value::Object(hooks) if product == Product::Scheduling => hooks.values().collect(), + _ => anyhow::bail!("unexpected observer hook inventory in the checked project"), + }; + let destinations = hooks + .into_iter() + .filter(|hook| hook["handler"]["type"] == "url") + .map(|hook| { + let id = hook["handler"]["destinationId"] + .as_str() + .context("the URL observer must name a destination")?; + LocalId::new(id).context("invalid URL observer destination identifier")?; + Ok::<_, anyhow::Error>(id) + }) + .collect::>>()?; + if destinations.is_empty() { + return Ok(()); + } + + let mut keys = BTreeMap::new(); + let mut references = BTreeMap::new(); + for id in destinations { + let key = random_key_bytes()?; + let reference = + self.secret(&format!("{}-hook-{id}", product.name()), key.as_slice())?; + references.insert(id, reference); + keys.insert( + id.to_owned(), + DeliveryKeys::new(DeliveryKey::new(key.as_slice())?, None)?, + ); + } + let sink = GatewayServer::start_signed_hooks(keys)?; + let configs: serde_json::Map = references + .into_iter() + .map(|(id, reference)| { + ( + id.to_owned(), + json!({ + "url": format!("{}/events/{id}", sink.origin), + "hmacSha256KeyRef": reference, + "attemptTimeoutMilliseconds": 2000, + "maximumAttempts": 5, + }), + ) + }) + .collect(); + runtime["destinations"]["hooks"] = json!(configs); + self.signed_hook_sinks.insert(product, sink); + Ok(()) + } + fn activate_casework( &self, database: &mut Database, @@ -1363,7 +1447,7 @@ impl<'a> ProductRunner<'a> { } fn activate_additional( - &self, + &mut self, product: Product, database: Option<&mut Database>, project: &Path, @@ -1397,8 +1481,9 @@ impl<'a> ProductRunner<'a> { } else { None }; - let configuration = + let mut configuration = self.additional_config(product, project, bind, &package, database_urls.as_ref())?; + self.bind_signed_hooks(product, project, &mut configuration)?; let path = self.root.join(format!("{name}-runtime.yaml")); write_private(&path, &serde_json::to_vec(&configuration)?)?; @@ -1971,6 +2056,7 @@ impl<'a> ProductRunner<'a> { drop(self.coordinator_issuer.take()); drop(self.gateway.take()); drop(self.hook_sink.take()); + self.signed_hook_sinks.clear(); Ok(()) } @@ -4629,6 +4715,21 @@ mod tests { ); assert_eq!(plaintext["database"]["transport"], "loopback-plaintext"); assert!(plaintext["database"].get("caBundleRef").is_none()); + + let private = casework_config( + &runner.input.plan, + "casework", + &root, + &package, + &identity, + "127.0.0.1:0", + DatabaseTransport::PrivateNetworkPlaintext, + ); + assert_eq!( + private["database"]["transport"], + "private-network-plaintext" + ); + assert!(private["database"].get("caBundleRef").is_none()); } #[test] @@ -5585,6 +5686,56 @@ INVENTORY } } + #[test] + fn signed_observer_hooks_connect_only_declared_destinations_to_the_run_sink() { + let root = tempfile::tempdir().unwrap(); + let terminate = AtomicBool::new(false); + let mut runner = + ProductRunner::new(Arc::new(breg_input(false)), root.path(), &terminate).unwrap(); + for (product, name) in [ + (Product::Documents, "documents.yaml"), + (Product::Scheduling, "scheduling.yaml"), + ] { + let policy = root.path().join(name); + let (empty, declared) = match product { + Product::Documents => ( + "hooks: []\n", + "hooks:\n - handler: {type: url, destinationId: events}\n - handler: {type: url, destinationId: events}\n", + ), + Product::Scheduling => ( + "hooks: {}\n", + "hooks:\n booking: {handler: {type: url, destinationId: events}}\n cancellation: {handler: {type: url, destinationId: events}}\n", + ), + _ => unreachable!(), + }; + fs::write(&policy, empty).unwrap(); + let mut config = json!({}); + runner + .bind_signed_hooks(product, root.path(), &mut config) + .unwrap(); + assert_eq!(config, json!({})); + assert!(!runner.signed_hook_reports().contains_key(product.name())); + + fs::write(&policy, declared).unwrap(); + runner + .bind_signed_hooks(product, root.path(), &mut config) + .unwrap(); + let hooks = config["destinations"]["hooks"].as_object().unwrap(); + assert_eq!(hooks.len(), 1); + let report = runner.signed_hook_reports(); + let received = report[product.name()]["receivedUrl"].as_str().unwrap(); + let origin = received.strip_suffix("/received").unwrap(); + assert!(origin.starts_with("http://127.0.0.1:")); + assert_eq!(hooks["events"]["url"], format!("{origin}/events/events")); + let file = format!("{}-hook-events", product.name()); + assert_eq!( + hooks["events"]["hmacSha256KeyRef"], + format!("secret:file/{file}") + ); + assert_eq!(fs::metadata(runner.root.join(file)).unwrap().len(), 32); + } + } + #[test] fn external_hook_ids_must_match_the_inventory_exactly() { use std::os::unix::fs::PermissionsExt; diff --git a/crates/registry-rstack-dev/src/sinks.rs b/crates/registry-rstack-dev/src/sinks.rs index 9a3765c8cd..cdebee7091 100644 --- a/crates/registry-rstack-dev/src/sinks.rs +++ b/crates/registry-rstack-dev/src/sinks.rs @@ -20,14 +20,18 @@ use axum::{ routing::{get, post}, Json, Router, }; -use registry_platform_crypto::mac::{constant_time_eq, hmac_sha256}; +use registry_platform_crypto::{ + delivery_signature::DeliveryKeys, + mac::{constant_time_eq, hmac_sha256}, +}; +use registry_platform_hooks::receiver::{verify_hook_delivery, DeliveryFreshness, HookDelivery}; use serde_json::{json, Value}; use std::{ - collections::{BTreeSet, HashMap, VecDeque}, + collections::{BTreeMap, BTreeSet, HashMap, VecDeque}, net::{Ipv4Addr, TcpListener}, sync::{mpsc, Arc, Mutex}, thread, - time::Duration, + time::{Duration, SystemTime}, }; use zeroize::Zeroizing; @@ -117,6 +121,18 @@ impl GatewayServer { Self::start_router(router, "rstack-dev-hook-sink") } + pub(super) fn start_signed_hooks(keys: BTreeMap) -> Result { + let router = Router::new() + .route("/events/{destination}", post(receive_signed_hook)) + .route("/received", get(list_signed_hooks)) + .layer(DefaultBodyLimit::max(HOOK_BODY_LIMIT)) + .with_state(Arc::new(SignedHooks { + keys, + deliveries: Mutex::new(VecDeque::new()), + })); + Self::start_router(router, "rstack-dev-signed-hook-sink") + } + fn start_router(router: Router, name: &str) -> Result { let listener = TcpListener::bind((Ipv4Addr::LOCALHOST, 0)) .context("cannot reserve a loopback port for the HTTP sink")?; @@ -195,11 +211,63 @@ impl GatewayServer { type HookDeliveries = Arc>>; +struct SignedHooks { + keys: BTreeMap, + deliveries: Mutex>, +} + +async fn receive_signed_hook( + State(sink): State>, + Path(destination): Path, + headers: HeaderMap, + body: Bytes, +) -> StatusCode { + let Some(keys) = sink.keys.get(&destination) else { + return StatusCode::NOT_FOUND; + }; + if [ + "authorization", + "registry-source-authorization", + "proxy-authorization", + "cookie", + ] + .iter() + .any(|name| headers.contains_key(*name)) + || verify_hook_delivery( + HookDelivery { + headers: headers + .iter() + .map(|(name, value)| (name.as_str(), value.as_bytes())), + body: &body, + keys, + }, + DeliveryFreshness::default_at(SystemTime::now()), + ) + .is_err() + { + return StatusCode::FORBIDDEN; + } + record_hook(&sink.deliveries, headers, body); + StatusCode::NO_CONTENT +} + +async fn list_signed_hooks(State(sink): State>) -> Json { + Json(json!(*sink + .deliveries + .lock() + .expect("signed hook sink lock"))) +} + async fn receive_hook( State(deliveries): State, headers: HeaderMap, body: Bytes, ) -> StatusCode { + record_hook(&deliveries, headers, body); + StatusCode::NO_CONTENT +} + +fn record_hook(deliveries: &Mutex>, headers: HeaderMap, body: Bytes) { use base64::{engine::general_purpose::STANDARD, Engine as _}; let headers: Vec<_> = headers @@ -223,7 +291,6 @@ async fn receive_hook( |text| json!(text), ), })); - StatusCode::NO_CONTENT } async fn list_hooks(State(deliveries): State) -> Json { @@ -524,6 +591,54 @@ mod tests { .contains(&json!({"name": "x-delivery-number", "value": "1000"}))); } + #[test] + fn signed_hook_capture_checks_destination_signature_and_headers() { + use registry_platform_crypto::delivery_signature::{sign, DeliveryKey, DeliveryKeys}; + use std::{collections::BTreeMap, time::SystemTime}; + + const ID: &str = "00000000-0000-4000-8000-000000000001"; + const BODY: &str = r#"{"causation":{"hop":0,"root":"00000000-0000-4000-8000-000000000001"},"data":{},"dataschema":"urn:example:schema","id":"00000000-0000-4000-8000-000000000001","source":"urn:example:source","subject":{"recordReference":"example/case/42","recordRevision":3},"time":"2026-08-30T00:00:00Z","type":"case-created"}"#; + let keys = |byte| DeliveryKeys::new(DeliveryKey::new(&[byte; 32]).unwrap(), None).unwrap(); + let sink = GatewayServer::start_signed_hooks(BTreeMap::from([ + ("expected".to_owned(), keys(31)), + ("other".to_owned(), keys(32)), + ])) + .unwrap(); + let timestamp = SystemTime::now() + .duration_since(SystemTime::UNIX_EPOCH) + .unwrap() + .as_secs(); + let signature = sign(&keys(31), ID, timestamp, BODY.as_bytes()).unwrap(); + + for (destination, credential, expected) in [ + ("other", false, 403), + ("expected", true, 403), + ("missing", false, 404), + ("expected", false, 204), + ] { + let (status, _) = call(|client| { + let request = client + .post(format!("{}/events/{destination}", sink.origin)) + .header("content-type", "application/json") + .header("webhook-id", ID) + .header("webhook-timestamp", timestamp.to_string()) + .header("webhook-signature", &signature) + .body(BODY); + if credential { + request.bearer_auth("synthetic-canary") + } else { + request + } + }); + assert_eq!(status, expected, "{destination}"); + } + let (status, received) = call(|client| client.get(format!("{}/received", sink.origin))); + assert_eq!(status, 200); + assert_eq!(received.as_array().unwrap().len(), 1); + assert_eq!(received[0]["body"], BODY); + assert!(!received.to_string().contains("synthetic-canary")); + } + #[test] fn dropping_the_gateway_stops_its_listener() { let gateway = gateway("http://127.0.0.1:9"); diff --git a/crates/registry-rstack/src/cli.rs b/crates/registry-rstack/src/cli.rs index da79b8d4f5..543b749c55 100644 --- a/crates/registry-rstack/src/cli.rs +++ b/crates/registry-rstack/src/cli.rs @@ -260,12 +260,25 @@ struct ClientGenerate { #[derive(Subcommand)] enum DevCommand { - /// Validate a development plan without starting services. - #[command(after_help = "Example:\n rstack dev check ./my-registry-project")] + /// Validate a development plan or the structure of a saved owner report without starting services. + #[command( + after_help = "Examples:\n rstack dev check ./my-registry-project\n rstack dev check --owner-report ./report.json --owner-report-format casework-report" + )] Check { /// Project directory containing dev.yaml and, when it declares audiences, service.yaml. - #[arg(value_name = "PROJECT")] - project: PathBuf, + #[arg(value_name = "PROJECT", required_unless_present = "owner_report")] + project: Option, + /// Saved JSON report to check structurally. + #[arg( + long, + value_name = "FILE", + conflicts_with = "project", + requires = "owner_report_format" + )] + owner_report: Option, + /// Exact saved document format. + #[arg(long, requires = "owner_report", conflicts_with = "project", value_parser = ["casework-report"])] + owner_report_format: Option, /// Refuse an unaccepted warning. /// Development posture listings do not count. #[arg(long)] @@ -2079,7 +2092,11 @@ fn dev_help(format: ReportFormat) -> Result<(), CliFailure> { fn admit_dev(action: &DevCommand, format: ReportFormat) -> Result<(), CliFailure> { if !matches!( action, - DevCommand::Check { .. } | DevCommand::Start { .. } | DevCommand::Issuer { .. } + DevCommand::Check { + owner_report: None, + .. + } | DevCommand::Start { .. } + | DevCommand::Issuer { .. } ) { return Ok(()); } @@ -2146,17 +2163,36 @@ fn dispatch_dev(cli: &Cli, action: &DevCommand, format: ReportFormat) -> Result< let (name, mut options, target, database_url, needs) = match action { DevCommand::Check { project, + owner_report, + owner_report_format, deny_warnings, - } => ( - "check", - deny_warnings + } => { + let mut options = deny_warnings .then(|| OsString::from("--deny-warnings")) .into_iter() - .collect::>(), - project.as_os_str(), - None, - DevNeeds::check(project), - ), + .collect::>(); + if let (Some(file), Some(format)) = (owner_report, owner_report_format) { + options.push(option("owner-report-format", format.as_ref())); + ( + "check", + options, + file.as_os_str(), + None, + DevNeeds::any_host(), + ) + } else { + let project = project + .as_ref() + .expect("clap requires a project or owner report"); + ( + "check", + options, + project.as_os_str(), + None, + DevNeeds::check(project), + ) + } + } DevCommand::Start { project, application_root, @@ -2554,6 +2590,47 @@ fn set_selected_generation_environment( mod tests { use super::*; + #[test] + fn dev_check_owner_report_requires_an_explicit_exclusive_format() { + let parse = |args: &[&str]| { + Cli::try_parse_from( + ["rstack", "dev", "check"] + .into_iter() + .chain(args.iter().copied()), + ) + }; + assert!(parse(&["./project", "--deny-warnings"]).is_ok()); + assert!(parse(&[ + "--owner-report", + "./report.json", + "--owner-report-format", + "casework-report", + "--deny-warnings", + ]) + .is_ok()); + for args in [ + &[][..], + &["--owner-report", "./report.json"], + &["--owner-report-format", "casework-report"], + &["./project", "--owner-report-format", "casework-report"], + &[ + "--owner-report", + "./report.json", + "--owner-report-format", + "guess", + ], + &[ + "./project", + "--owner-report", + "./report.json", + "--owner-report-format", + "casework-report", + ], + ] { + assert!(parse(args).is_err(), "{args:?}"); + } + } + #[test] fn selected_generation_projects_optional_service_binaries() { let generation = tempfile::tempdir().unwrap(); diff --git a/crates/registry-schedulingctl/Cargo.toml b/crates/registry-schedulingctl/Cargo.toml index bf39cf0de9..670ef6edbd 100644 --- a/crates/registry-schedulingctl/Cargo.toml +++ b/crates/registry-schedulingctl/Cargo.toml @@ -22,6 +22,8 @@ workspace = true registry-rstack-dev.workspace = true registry-cli-report.workspace = true anyhow.workspace = true +chrono.workspace = true +chrono-tz.workspace = true clap.workspace = true registry-cli-api.workspace = true registry-platform-audit.workspace = true @@ -45,7 +47,6 @@ zeroize.workspace = true # already demand. Asking for it here instead would turn it on for every build # holding both crates, and the runtime's own database suite would then be # compiled and run by shards that have no server to offer it. -chrono.workspace = true registry-platform-provision = { workspace = true, features = ["test-support"] } tokio-postgres.workspace = true diff --git a/crates/registry-schedulingctl/src/project.rs b/crates/registry-schedulingctl/src/project.rs index 694cea0228..51aeb41a56 100644 --- a/crates/registry-schedulingctl/src/project.rs +++ b/crates/registry-schedulingctl/src/project.rs @@ -2,11 +2,10 @@ //! Project loading and the offline init, check, test, and explain reports. //! -//! Everything here runs without a network, a database, or a clock: the -//! authored policy, its records, and its fixtures are read from the project -//! directory through the shared reader, checked and replayed through the -//! pure core, and rendered as one JSON report per command. A refused project -//! is the reader's own report, every diagnostic at its position. +//! Init dates a new starter from today's UTC date. The other offline commands +//! read the policy, records, and fixtures through the shared reader and pure +//! core without reading the clock. A refused project is the reader's own +//! report, every diagnostic at its position. use registry_platform_config::DeclaredPosture; use std::collections::BTreeMap; @@ -14,6 +13,7 @@ use std::fs; use std::path::{Path, PathBuf}; use anyhow::{Context, Result}; +use chrono::{NaiveDate, Utc}; use registry_platform_config::package::{plan_package, write_package}; use registry_platform_config::{sha256_uri, UNAVAILABLE_CODE}; use registry_platform_yaml::{Decoded, Diagnostic, Report, Source}; @@ -37,6 +37,10 @@ const FIXTURES_DIRECTORY: &str = "fixtures"; const NO_FIXTURES_CODE: &str = "scheduling.fixture.none"; pub(super) fn init(project: &Path, template: &str) -> Result { + init_on(project, template, Utc::now().date_naive()) +} + +fn init_on(project: &Path, template: &str, today: NaiveDate) -> Result { let Some(files) = templates::template_files(template) else { anyhow::bail!( "unknown template {template:?}; available templates: standalone-exact-time, standalone-arrival-window, resource-reservations" @@ -58,7 +62,8 @@ pub(super) fn init(project: &Path, template: &str) -> Result { fs::create_dir(staging.path().join(FIXTURES_DIRECTORY))?; let mut created = Vec::new(); for (relative, contents) in &files { - fs::write(staging.path().join(relative), contents)?; + let contents = templates::date_file(template, relative, contents, today)?; + fs::write(staging.path().join(relative), contents.as_bytes())?; created.push((*relative).to_owned()); } let staging_path = staging.keep(); @@ -856,13 +861,113 @@ fn absolute_lexical(path: &Path) -> std::io::Result { mod tests { use super::*; use registry_scheduling::config::RuntimeConfig; + use registry_scheduling_core::location_open_intervals; + + #[test] + fn fresh_starters_publish_supply_after_the_original_example_dates() { + let root = tempfile::tempdir().unwrap(); + let posture = registry_scheduling::config::DEFAULT_POSTURE; + for day in ["2027-01-01", "2028-02-29", "2037-11-02"] { + let today = day.parse::().unwrap(); + let now = today.and_hms_opt(0, 0, 0).unwrap().and_utc(); + for (template, expected_cases) in [ + ("standalone-exact-time", 8), + ("standalone-arrival-window", 6), + ("resource-reservations", 11), + ] { + let project = root.path().join(day).join(template); + init_on(&project, template, today).unwrap(); + let context = format!("{day} {template}"); + let checked = check(&project, false, posture).unwrap(); + assert_eq!(checked["diagnostics"], json!([]), "{context}"); + let replay = test(&project, posture).unwrap(); + let mut case_count = 0; + for fixture in replay["fixtures"].as_array().unwrap() { + assert_eq!(fixture["status"], "passed", "{context}: {fixture}"); + for case in fixture["cases"].as_array().unwrap() { + assert_eq!(case["status"], "pass", "{context}: {case}"); + case_count += 1; + } + } + assert_eq!(case_count, expected_cases, "{context}"); + + let authored = read_project(&project, true, posture).unwrap(); + let policy = authored.policy.unwrap().value; + let facts = authored.facts.unwrap(); + for offering in &policy.offerings { + let location = facts.location(&offering.location).unwrap(); + let intervals = + location_open_intervals(&policy, &location.id, &location.timezone, &[]) + .unwrap(); + assert!( + intervals.iter().any(|open| open.end > now), + "{context}: {}", + offering.id + ); + if let Some(arrival) = &offering.arrival { + let window = offering.served_windows(&facts.windows).next().unwrap(); + assert!(window.start > now + chrono::TimeDelta::days(1), "{context}"); + assert!( + window.start + < now + chrono::TimeDelta::days(i64::from(arrival.horizon_days)), + "{context}" + ); + } + } + } + } + } + + #[test] + fn init_reproduces_the_committed_examples_on_their_reference_date() { + let root = tempfile::tempdir().unwrap(); + for template in [ + "standalone-exact-time", + "standalone-arrival-window", + "resource-reservations", + ] { + let project = root.path().join(template); + init_on(&project, template, templates::EXAMPLE_DATE).unwrap(); + for (relative, bytes) in templates::template_files(template).unwrap() { + assert_eq!( + fs::read(project.join(relative)).unwrap(), + bytes.as_bytes(), + "{template}/{relative}" + ); + } + } + } + + #[test] + fn init_does_not_publish_a_starter_for_a_fold_missing_from_the_timezone_data() { + let root = tempfile::tempdir().unwrap(); + let before_fold = "2026-10-31".parse().unwrap(); + // In 2006 the fold had already happened in October. This also tests + // the refusal without depending on where the installed data ends. + let before_regular_sunday = "2006-10-31".parse().unwrap(); + for template in ["standalone-exact-time", "resource-reservations"] { + let supported = root.path().join("supported").join(template); + init_on(&supported, template, before_fold).unwrap(); + + let refused = root.path().join("refused").join(template); + let error = init_on(&refused, template, before_regular_sunday).unwrap_err(); + assert!(error + .to_string() + .contains("America/New_York fold on 2006-11-05")); + assert!(!refused.exists()); + } + + let arrival = root.path().join("standalone-arrival-window"); + init_on(&arrival, "standalone-arrival-window", before_regular_sunday).unwrap(); + assert!(arrival.is_dir()); + } /// A tempdir holding one freshly initialized template project, plus the /// paths the tempdir keeps alive. fn initialized(template: &str) -> (tempfile::TempDir, PathBuf) { let root = tempfile::tempdir().unwrap(); let project = root.path().join("project"); - init(&project, template).unwrap(); + init_on(&project, template, templates::EXAMPLE_DATE).unwrap(); (root, project) } diff --git a/crates/registry-schedulingctl/src/templates.rs b/crates/registry-schedulingctl/src/templates.rs index 39c43313f1..7be5529380 100644 --- a/crates/registry-schedulingctl/src/templates.rs +++ b/crates/registry-schedulingctl/src/templates.rs @@ -5,8 +5,138 @@ //! Each template is a working project: its policy passes the check with zero //! findings and its fixtures replay all-Pass offline, which the tests prove //! end to end. The files are the committed examples under -//! `products/scheduling/examples`, so the two cannot drift, and every file -//! carries its schema modeline on its first line. +//! `products/scheduling/examples`, dated as of a common reference day. +//! Init moves their date groups together so the live supply is usable and +//! each fixture still proves the same scenario. Every file carries its +//! schema modeline on its first line. + +use std::borrow::Cow; + +use anyhow::{ensure, Result}; +use chrono::{Datelike, Days, NaiveDate, Offset, TimeDelta, TimeZone, Weekday}; +use chrono_tz::America::New_York; + +#[cfg(test)] +pub(super) const EXAMPLE_DATE: NaiveDate = example_date(10, 1); +const EXAMPLE_COUNTER: NaiveDate = example_date(10, 5); +const EXAMPLE_ARRIVAL: NaiveDate = example_date(10, 10); +const EXAMPLE_FOLD: NaiveDate = example_date(11, 1); + +const fn example_date(month: u32, day: u32) -> NaiveDate { + NaiveDate::from_ymd_opt(2026, month, day).expect("valid starter reference date") +} + +pub(super) fn date_file<'a>( + template: &str, + relative: &str, + contents: &'a str, + today: NaiveDate, +) -> Result> { + let counter_shift = || { + // The example opens on the Thursday before the Monday fixture. Shift + // by whole weeks and choose a Monday whose opening has begun today. + let monday = on_or_after(today - Days::new(2), Weekday::Mon); + monday - EXAMPLE_COUNTER + }; + let fold_shift = || next_new_york_fold(today).map(|fold| fold - EXAMPLE_FOLD); + Ok(match (template, relative) { + ("standalone-exact-time", "scheduling.yaml") => { + let counter = counter_shift(); + let fold = fold_shift()?; + shift_dates(contents, |date| { + date + if date == EXAMPLE_FOLD { fold } else { counter } + }) + } + ("standalone-exact-time", "fixtures/counter-stations.yaml") => { + let shift = counter_shift(); + shift_dates(contents, |date| date + shift) + } + ("standalone-exact-time", "records.yaml" | "fixtures/fold-day-rebooking.yaml") + | ("resource-reservations", "records.yaml" | "fixtures/named-intervals.yaml") => { + let shift = fold_shift()?; + shift_dates(contents, |date| date + shift) + } + ( + "standalone-arrival-window", + "scheduling.yaml" + | "records.yaml" + | "fixtures/household-morning.yaml" + | "fixtures/household-afternoon.yaml", + ) => { + // Both named blocks need to be on the same Saturday, far enough + // ahead for their lead time and the example cancellation cutoff. + let saturday = on_or_after(today + Days::new(7), Weekday::Sat); + let shift = saturday - EXAMPLE_ARRIVAL; + shift_dates(contents, |date| date + shift) + } + ("resource-reservations", "scheduling.yaml") => { + let year = next_new_york_fold(today)?.year(); + // Cover the fixture's November fold and the live dates leading up + // to it, including when the fold will land in the next year. + shift_dates(contents, |date| { + let shifted = date.with_year(year).expect("valid opening date"); + if date == example_date(1, 1) { + shifted.min(today) + } else { + shifted + } + }) + } + _ => Cow::Borrowed(contents), + }) +} + +fn on_or_after(date: NaiveDate, weekday: Weekday) -> NaiveDate { + date + Days::new(u64::from(weekday.days_since(date.weekday()))) +} + +fn next_new_york_fold(today: NaiveDate) -> Result { + // America/New_York returns to standard time on the first Sunday in November. + let fold = |year| { + let november = NaiveDate::from_ymd_opt(year, 11, 1).expect("valid November date"); + on_or_after(november, Weekday::Sun) + }; + let this_year = fold(today.year()); + let fold = if this_year > today { + this_year + } else { + fold(today.year() + 1) + }; + // Both fixtures keep their original UTC clock times. Verify the offset + // change at precisely 06:00 UTC with the same timezone data as replay. + let transition = fold.and_hms_opt(6, 0, 0).expect("valid UTC time"); + let offset_seconds = |instant| { + New_York + .offset_from_utc_datetime(&instant) + .fix() + .local_minus_utc() + }; + ensure!( + offset_seconds(transition - TimeDelta::seconds(1)) == -4 * 3600 + && offset_seconds(transition) == -5 * 3600, + "America/New_York fold on {fold} does not match the starter's 06:00 UTC transition in the installed timezone data" + ); + Ok(fold) +} + +/// Move ISO date prefixes in the built-in YAML, including the dates in UTC +/// timestamps. Keep the emitted file formatting and all clock times intact. +fn shift_dates(contents: &str, shift: impl Fn(NaiveDate) -> NaiveDate) -> Cow<'_, str> { + let date_char = |c: char| c.is_ascii_digit() || c == '-'; + let mut output = String::with_capacity(contents.len()); + for token in contents.split_inclusive(|c| !date_char(c)) { + let date = token.trim_end_matches(|c| !date_char(c)); + if date.len() == 10 { + if let Ok(parsed) = NaiveDate::parse_from_str(date, "%Y-%m-%d") { + output.push_str(&shift(parsed).format("%Y-%m-%d").to_string()); + output.push_str(&token[date.len()..]); + continue; + } + } + output.push_str(token); + } + Cow::Owned(output) +} /// The example directory one template's files are read from. macro_rules! example { diff --git a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx index c095a2d4d7..7eac1e4295 100644 --- a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx +++ b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx @@ -543,9 +543,18 @@ For a local server on a loopback host (`127.0.0.1`, `::1`, or `localhost` resolv Generated product runtime configurations then use `database.transport: loopback-plaintext`. If the runner and PostgreSQL share a private development network, such as a Docker Compose network, you can select `?transport=private-network-plaintext` explicitly. +The connection is unencrypted and the PostgreSQL server is unauthenticated. +Use this transport for disposable, synthetic data on an operator-isolated development network. +Use verified TLS for shared, hosted or routed CI networks. The runner checks that every resolved address is eligible for private network plaintext and connects to one of those addresses directly. Generated product runtime configurations use `database.transport: private-network-plaintext` and the same address. Leave `RSTACK_DEV_DATABASE_CA` unset for either plaintext transport. +On recovery, PostgreSQL reports its own cluster identifier. The check catches a wrong-cluster setup during recovery. + +With Compose, give PostgreSQL a health check and wait for it to pass before running `rstack dev start`. +For example, run `docker compose up -d --wait postgres` when the service is named `postgres`. +Keep PostgreSQL reachable until `rstack dev stop` finishes dropping the run's databases and roles. +Then bring down the Compose project. The administrator role named in the URL needs `LOGIN CREATEROLE CREATEDB`. Superuser is not needed for a non-spatial run. @@ -560,10 +569,11 @@ The URL must be a `postgres://` or `postgresql://` URL with one TCP host, a user Percent-encode special characters in the password. The URL accepts these query parameters and refuses all others: -- `sslmode`: `require`, `verify-ca`, or `verify-full` for verified TLS (the default when omitted, verifying the certificate and host name whichever you choose), or `disable` for plaintext on a loopback host only. - Setting `RSTACK_DEV_DATABASE_CA` with `sslmode=disable` is refused. -- `transport=private-network-plaintext` explicitly selects a private development network. - Leave `sslmode` unset for this transport and pass the same URL for recovery. +- `sslmode` accepts `require`, `verify-ca`, and `verify-full`. Each verifies the certificate and host name, as does the default TLS mode. + `sslmode=disable` on its own selects loopback plaintext. +- `transport=private-network-plaintext` explicitly selects plaintext on a private development network. + Use this selector alone or with `sslmode=disable`. A TLS `sslmode` conflicts with it. + Leave `RSTACK_DEV_DATABASE_CA` unset for plaintext and pass the same URL for recovery. - `connect_timeout` and `application_name`. - `sslrootcert` is refused. Set `RSTACK_DEV_DATABASE_CA` instead. @@ -767,6 +777,17 @@ A journey can call the Messaging API as a test person and poll for the delivery crates/registry-rstack-dev/src/docker.rs org.registrystack.rstack.dev-run; products/messaging/examples/starter/dev.yaml. */} +### Document Store and Scheduling hook captures + +When a Document Store or Scheduling project declares URL observers, the run binds their destinations +to a loopback receiver. The receiver verifies the webhook signature with a separate key for each +destination. Read the captured synthetic events at `hookSinks..receivedUrl` in the start +report. Trigger the observer through the product's authorised operation, then match the event type +and identifier in the capture. + +{/* Evidence: crates/registry-rstack-dev/src/products.rs, bind_signed_hooks, signed_hook_reports; + crates/registry-rstack-dev/src/sinks.rs, start_signed_hooks, receive_signed_hook. */} + ### Authored journey file `dev.yaml` must set `journeyFile`, for example `journeyFile: dev-journeys.yaml`. diff --git a/docs/site/src/content/docs/configure/scheduling.mdx b/docs/site/src/content/docs/configure/scheduling.mdx index cb4e5ae2ca..8b078a1c6e 100644 --- a/docs/site/src/content/docs/configure/scheduling.mdx +++ b/docs/site/src/content/docs/configure/scheduling.mdx @@ -36,36 +36,50 @@ openings: weekdays: [mon, tue, wed, thu, fri] startTime: "09:00" endTime: "12:30" - effectiveFrom: "2026-10-01" - effectiveUntil: "2026-12-31" + effectiveFrom: "" + effectiveUntil: "" ``` -Times are wall-clock times at the location, read in the time zone its location record names, so -the counter opens at 09:00 Bangkok time on weekdays. The opening ends on `effectiveUntil`; from -2027 this offering publishes no starts until you extend that date and deploy the change. +Times are local to the time zone in the location record. The counter opens at 09:00 Bangkok time +on weekdays. Read `effectiveFrom` and `effectiveUntil` +in your file for the dates `init` generated when you created the project. Both dates are +inclusive. To publish starts after `effectiveUntil`, set a new approved range and deploy the +change. A single opening can span at most 3,650 days between its first and last dates. + +{/* Evidence: crates/registry-schedulingctl/src/templates.rs, date_file(); + crates/registry-scheduling-core/src/policy.rs, PatternSpanTooLarge. */} ## Close a public holiday Every opening names a [holiday set](../../reference/glossary/#holiday-set), and a date in that set -closes the opening for the whole day. The starter's set closes nothing yet. Close Tuesday 13 -October 2026: - -```diff test-edit title="scheduling/scheduling.yaml" - office-holidays: - revision: 1 -+ dates: -+ - "2026-10-13" - label: Public holidays observed by the registry offices. -``` +closes the opening for the whole day. Use Python 3 to add the Tuesday after the counter fixture's +Monday `now` to `office-holidays.dates`. Add a booking case for 09:00 Bangkok time that day. +This keeps the holiday inside the fixture's booking horizon and leaves its Monday cases intact. -Prove it with a case at the end of the counter fixture. A booking at 09:00 that day must be -refused: - -```yaml title="scheduling/fixtures/counter-stations.yaml" test-append +```sh +python3 - <<'PY' +from datetime import datetime, timedelta +from pathlib import Path + +project = Path("scheduling") +fixture = project / "fixtures/counter-stations.yaml" +fixture_text = fixture.read_text(encoding="utf-8") +fixture_now = next(line.split(": ", 1)[1] for line in fixture_text.splitlines() + if line.startswith("now: ")) +holiday = datetime.strptime(fixture_now, "%Y-%m-%dT%H:%M:%SZ").date() + timedelta(days=1) + +policy = project / "scheduling.yaml" +policy_text = policy.read_text(encoding="utf-8") +holiday_set = " office-holidays:\n revision: 1\n" +before, after = policy_text.split(holiday_set, 1) +if after.startswith(" dates:") or "the-holiday-is-not-served" in fixture_text: + raise SystemExit("The starter already has holiday dates or has recorded the holiday case.") +policy.write_text(f'{before}{holiday_set} dates:\n - "{holiday}"\n{after}', encoding="utf-8") +fixture.write_text(fixture_text + f"""\ - name: the-holiday-is-not-served request: offering: registry-update-30 - start: 2026-10-13T02:00:00Z + start: {holiday}T02:00:00Z party: recipients: 1 attendees: 1 @@ -74,6 +88,8 @@ refused: expect: type: refused code: schedule.unpublished +""", encoding="utf-8") +PY ``` ```sh @@ -96,15 +112,16 @@ does not establish source reachability or deployment readiness. `schedule.unpublished` is the answer for any start the policy does not publish, whether the day is a holiday, a weekend, or outside the opening hours. -A closure that affects one location for part of a day is not policy. It is an exception record in -`records.yaml`, which the operator applies to a running deployment without a new package: +A closure that affects one location for part of a day is an exception record in `records.yaml`. +The operator applies it to a running deployment without a new package. Read the `hall-prep` +exception in your starter for the date of the New York clock change the fixture exercises. ```yaml title="scheduling/records.yaml" test-excerpt="scheduling/records.yaml" exceptions: - id: hall-prep location: new-york-hall kind: closure - date: "2026-11-01" + date: "" startTime: "00:15" endTime: "00:45" ``` @@ -256,8 +273,10 @@ schedulingctl explain ./arrival --format json } ``` -The window itself is a record in `./arrival/records.yaml`, with its start, end, and `units`. A -`subquotas` entry caps how many of those units one channel, `public` or `assisted`, may take. A +The window itself is a record in `./arrival/records.yaml`, with its start, end, and `units`. +The starter dates both windows on the same upcoming Saturday. After those windows pass, publish +new dated records for future bookings. +A `subquotas` entry caps how many of those units one channel, `public` or `assisted`, may take. A subquota is a ceiling, not a reservation: the other channel may still use units the first leaves free. A channel the policy declares but gives no subquota draws from the window's total alone, and a request naming an undeclared channel is refused. diff --git a/products/casework/examples/formats/reports/identity-facts-report.json b/products/casework/examples/formats/reports/identity-facts-report.json new file mode 100644 index 0000000000..cdd4c57374 --- /dev/null +++ b/products/casework/examples/formats/reports/identity-facts-report.json @@ -0,0 +1,18 @@ +{ + "ok": true, + "command": "generate-identity-facts", + "status": "complete", + "apiVersion": "id.registrystack.org/formats/casework/report/v1alpha2", + "kind": "CaseworkReport", + "version": "0.49.0-dev", + "accessProfiles": 4, + "assertionIssuers": 0, + "claims": 1, + "output": "casework.identity-facts.yaml", + "product": "casework", + "posture": { + "value": "production", + "source": "default" + }, + "diagnostics": [] +} diff --git a/products/platform/CHANGELOG.md b/products/platform/CHANGELOG.md index 6c9c5c95b0..b170e7aa29 100644 --- a/products/platform/CHANGELOG.md +++ b/products/platform/CHANGELOG.md @@ -4,6 +4,11 @@ - `rstack dev check` refuses incompatible owner reports and mismatched identity facts. For Messaging it also checks the staged package, runtime input and tool around facts generation. +- `rstack dev` can attach to PostgreSQL on an isolated development network + when the administrator URL selects `transport=private-network-plaintext`. + The runner pins the checked numeric address in the generated product URLs. + Verified TLS remains the default. Production and `provision` keep their + existing transport rules. ## 0.50.0 - 2026-12-01 diff --git a/products/platform/CONFIG-CONVENTIONS.md b/products/platform/CONFIG-CONVENTIONS.md index 58049ac7e0..c2b8f02f4d 100644 --- a/products/platform/CONFIG-CONVENTIONS.md +++ b/products/platform/CONFIG-CONVENTIONS.md @@ -42,7 +42,12 @@ In scope: CFG-SCHEMA-6. A product output that a maintained tool reads is a registered contract: it is a read-back format, registered with its schema and a `reader` entry naming that tool's reading function, whatever command prints it. Explain output a - maintained tool reads belongs here, not under `reader: none`. + maintained tool reads belongs in the read-back category. A saved writer + report may register `passiveReport: true` when a maintained offline check + validates it on read-back and its integers only observe completed work. + Register the `rstack dev check --owner-report` command and a saved writer + example with bounded integers. The corpus runs its baseline and both sides + of the integer boundary sweep with `--deny-warnings`. These cells must pass. A **build artifact** is a read-back format that its own product's build writes and reads again and that no one edits (the compiled package model in BReg's `package.json`). It is registered with `audience: generated` and @@ -580,12 +585,15 @@ value outside them with `config.out-of-range`, naming the bounds. An implicit a maximum below the unsigned format's own ceiling, as the bounded types emit it, does. -An output format registered with `reader: none` may state its writer's native -integer range. The schema must declare both bounds explicitly from the actual -serialized type, rather than rely on `format` alone. An observed count or -sequence does not configure resource use, so it needs no invented operational -cap. This distinction changes no input limit, output closedness, or other -schema requirement. +An output format registered with `reader: none` or a generated JSON report +registered with `passiveReport: true` may state its writer's native integer +range. Declare `minimum` and `maximum` explicitly from the serialized type. +A passive report's registered reader validates those bounds against the owner +schema. Use the marker only for a saved writer report with an offline file +check and no security or restricting members. Its integers record completed +work. The marker leaves the payload contract, reader limits and all other +checks in force. Files that configure work or convey authority follow the +ordinary reader rules. *Enforced by:* the convention lint (every `integer` property declares `minimum` and `maximum`); the conformance corpus boundary sweep (each integer in each format's example whose registered schema states both bounds, set one diff --git a/products/platform/config-formats.yaml b/products/platform/config-formats.yaml index 8c0318dc10..e8b8283d9c 100644 --- a/products/platform/config-formats.yaml +++ b/products/platform/config-formats.yaml @@ -1714,6 +1714,7 @@ formats: files: [] syntax: json audience: generated + passiveReport: true stability: unpromised current: apiVersion: id.registrystack.org/formats/casework/report/v1alpha2 @@ -1730,12 +1731,16 @@ formats: origin: generated generator: cargo run -p registry-caseworkctl --features schema --example report-schemas -- --output products/casework/contracts/cli driftCheck: crates/registry-caseworkctl/src/schema.rs - reader: none + reader: + crate: registry-rstack-dev + file: crates/registry-rstack-dev/src/owner_report.rs + function: check_file + type: untyped emittedBy: file: crates/registry-caseworkctl/src/report.rs symbol: write - check: none - example: products/casework/examples/formats/reports/check-report.json + check: rstack dev check --owner-report {file} --owner-report-format casework-report + example: products/casework/examples/formats/reports/identity-facts-report.json conformance: none securityMembers: [] restrictingMembers: [] diff --git a/products/platform/journeys/README.md b/products/platform/journeys/README.md index 83d416787a..e576405035 100644 --- a/products/platform/journeys/README.md +++ b/products/platform/journeys/README.md @@ -173,6 +173,20 @@ codes matched by the initial production startup and check. It is `null` until the comparison was measured, and `0` when the comparison found no refusals. The existing `total.refusalsMet` counts refusals across the cell. +The stock Keycloak BReg editor requests an optional client scope for the +fixture's static claims. Keycloak keeps the issued `scope` claim unchanged. +The no-mapper control obtains a fresh token for that same service account +without the optional scope and checks the refusal against the response's +trace ID. The foreign caller also gets a fresh token for its exact-record +assertion. + +The BReg setup records `fixtureOnlyProducts: ["breg"]` in +`own-provider.json`. Promotion reports `journey.promote.no-input` for this +fixture. A passing BReg input directory that predates the marker is refused as +`legacy-unmarked`. A present marker with any other value is refused as +`invalid-fixture-marker`. These refusals happen before production startup. +An explicitly kept input is still taken over and cleaned up. + In `rstack-dev`, the run log and `cells.tsv` mark the hook step `unexercised` when the journey has no hook delivery to check. The cell still runs its later steps, including retention and cleanup. diff --git a/products/platform/journeys/expected-failures.yaml b/products/platform/journeys/expected-failures.yaml index 86960f7d46..a742620b08 100644 --- a/products/platform/journeys/expected-failures.yaml +++ b/products/platform/journeys/expected-failures.yaml @@ -51,14 +51,6 @@ authenticationStages: [header, algorithm, token-type, key, signature, issuer, au changes: [posture, postgres-tls-requirement, rstack-dev-products, caller-contract] expectedFailures: - - journey: own-provider - product: breg - step: database.connect - code: product.breg.runtime.package-root-unavailable - removedBy: rstack-dev-products - basis: observed - observedOn: "journey run 20261128141250-8151" - reason: "prepare, issuer, and database.provision pass (bregctl provision accepts loopback-plaintext on the reader's plain PostgreSQL server). database.connect runs bregctl test to produce the receipt bregctl package requires, and bregctl test refuses because the package.root directory in runtime.yaml does not exist yet before bregctl package creates it." - journey: own-provider product: evidence step: issuer @@ -74,8 +66,8 @@ expectedFailures: code: journey.promote.no-input removedBy: rstack-dev-products basis: observed - observedOn: "origin/main cd83550e, journey run 20261127023442-18b4 against own-provider run 20261127021546-ddef" - reason: "The development journey did not finish for this product, so there are no files to promote." + observedOn: "v0.49.0 binaries, strict promote run 20261201173525-487a from own-provider run 20261201173442-23a5" + reason: "The stock Keycloak input is marked as a fixture for own-provider verification. Promotion refuses it at input before attempting to start production." - journey: promote product: evidence step: input @@ -229,6 +221,10 @@ unreached: # observedOn: "origin/main cd83550e, promote run 20261127025000-816f on own-provider run 20261127024425-265d (assisted: sql, certificate, token-type, mapper)" # reason: "The assisted Scheduling cell reached T1. Started with no development declaration, schedulingctl check (which has no --production flag) lists no refusal and the server starts and answers /readyz, so zero refusals are listed. No shared posture exists on main, so nothing can refuse. The count becomes meaningful once the posture change lands." passes: + - journey: own-provider + product: breg + basis: observed + observedOn: "v0.49.0 binaries, own-provider run 20261201170814-cac9" - journey: own-provider product: adapter basis: observed diff --git a/products/platform/journeys/keycloak/realm.json b/products/platform/journeys/keycloak/realm.json index 32ea513be3..8e516a6e67 100644 --- a/products/platform/journeys/keycloak/realm.json +++ b/products/platform/journeys/keycloak/realm.json @@ -23,6 +23,9 @@ {"clientId": "directory-client", "name": "BReg caller", "enabled": true, "protocol": "openid-connect", "publicClient": false, "secret": "${JOURNEY_CLIENT_SECRET_BREG}", "standardFlowEnabled": false, "implicitFlowEnabled": false, "directAccessGrantsEnabled": false, "serviceAccountsEnabled": true}, + {"clientId": "foreign-directory-client", "name": "BReg outside-jurisdiction caller", "enabled": true, "protocol": "openid-connect", "publicClient": false, + "secret": "${JOURNEY_CLIENT_SECRET_BREG_FOREIGN}", "standardFlowEnabled": false, "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, "serviceAccountsEnabled": true}, {"clientId": "urn:example:casework", "name": "Casework API", "enabled": true, "protocol": "openid-connect", "publicClient": false, "standardFlowEnabled": false, "implicitFlowEnabled": false, "directAccessGrantsEnabled": false, "serviceAccountsEnabled": false}, @@ -78,6 +81,8 @@ "users": [ {"username": "service-account-directory-client", "enabled": true, "serviceAccountClientId": "directory-client", "clientRoles": {"urn:breg:local-directory": ["access"]}}, + {"username": "service-account-foreign-directory-client", "enabled": true, "serviceAccountClientId": "foreign-directory-client", + "clientRoles": {"urn:breg:local-directory": ["access"]}}, {"username": "service-account-casework-client", "enabled": true, "serviceAccountClientId": "casework-client", "clientRoles": {"urn:example:casework": ["access"]}}, {"username": "service-account-case-system", "enabled": true, "serviceAccountClientId": "case-system", diff --git a/products/platform/journeys/own-provider.sh b/products/platform/journeys/own-provider.sh index 5d733cdba4..e2c06721cc 100755 --- a/products/platform/journeys/own-provider.sh +++ b/products/platform/journeys/own-provider.sh @@ -28,6 +28,9 @@ # through the admin API at setup and made a default scope of its caller. Each # product counts three identity-provider changes: its caller client, its # audience and its scope. +# BReg's disposable fixture binds exact scopes to two callers and sets its +# authored principal, purpose and jurisdiction with built-in static mappers. +# An editor token issued without the optional mapper scope must be refused. # # What the harness does that the reader does not type, and so is not counted: # - the secret folder of every product is the run's secrets/ folder, so each @@ -434,6 +437,10 @@ CASEWORK_SUBJECT='' DOCUMENTS_SUBJECT='' COORDINATOR_SUBJECT='' BREG_HOOK_PORT='' +BREG_SCOPE_UNLINKS=0 +BREG_KEYCLOAK_CLAIM_SCOPE='breg-fixture-claims' +BREG_EDITOR_SUBJECT='' +BREG_FOREIGN_SUBJECT='' ADAPTER_SOURCE_PORT='' REACHED_AUTH_PRODUCTS=() THUNDERID_SESSION_IDS=() @@ -506,6 +513,65 @@ keycloak_default_scope() { journey_harness_failure "Keycloak refused to add scope $scope to client $client (HTTP $KC_STATUS)" } +# Keep the built-in scopes that do not appear in the access token's scope +# claim. The BReg schema test compares the caller's entire issued scope set. +breg_keycloak_exact_scope() { + local client=$1 uuid defaults scopes scope_id + keycloak_client_uuid "$client" uuid + keycloak_admin GET "/clients/$uuid/default-client-scopes" + [[ "$KC_STATUS" == 200 ]] || journey_harness_failure "Keycloak cannot list the default scopes of $client" + defaults=$KC_BODY + # Keycloak omits attributes from the per-client scope listing. + keycloak_admin GET /client-scopes + [[ "$KC_STATUS" == 200 ]] || journey_harness_failure "Keycloak cannot read scope attributes" + scopes=$(jq -r --argjson defaults "$defaults" --arg scope "$SCOPE" ' + .[] | .id as $id | select(any($defaults[]; .id == $id)) + | select(.name != $scope and .attributes["include.in.token.scope"] != "false") | .id' <<<"$KC_BODY") || + journey_harness_failure "Keycloak returned an invalid default scope inventory" + while IFS= read -r scope_id; do + [[ -n "$scope_id" ]] || continue + keycloak_admin DELETE "/clients/$uuid/default-client-scopes/$scope_id" + [[ "$KC_STATUS" == 204 ]] || journey_harness_failure "Keycloak refused to unlink a default scope from $client" + BREG_SCOPE_UNLINKS=$((BREG_SCOPE_UNLINKS + 1)) + done <<<"$scopes" +} + +breg_keycloak_mappers() { + jq -cn --arg principal "$1" --arg jurisdiction "$2" ' + {registry_principal: $principal, registry_purpose: "directory-administration", jurisdiction: $jurisdiction} + | to_entries | map({name: .key, protocol: "openid-connect", protocolMapper: "oidc-hardcoded-claim-mapper", + config: {"claim.name": .key, "claim.value": .value, "jsonType.label": "String", "access.token.claim": "true", + "id.token.claim": "false", "userinfo.token.claim": "false", "introspection.token.claim": "false"}})' +} + +breg_keycloak_add_mappers() { + local uuid mappers mapper + keycloak_client_uuid "$1" uuid + mappers=$(breg_keycloak_mappers "$2" "$3" | jq -c '.[]') || journey_harness_failure "cannot assemble BReg's static mappers" + while IFS= read -r mapper; do + keycloak_admin POST "/clients/$uuid/protocol-mappers/models" "$mapper" + [[ "$KC_STATUS" == 201 ]] || journey_harness_failure "Keycloak refused a static BReg mapper (HTTP $KC_STATUS)" + done <<<"$mappers" +} + +# Keep the editor's static mappers on its own optional client scope. Keycloak +# can then issue a fresh unmapped token to the same client and service account. +breg_keycloak_editor_scope() { + local uuid scope_id body + body=$(breg_keycloak_mappers synthetic-directory-editor zone-a | jq -c --arg name "$BREG_KEYCLOAK_CLAIM_SCOPE" ' + {name: $name, protocol: "openid-connect", attributes: {"include.in.token.scope": "false"}, protocolMappers: .}') || + journey_harness_failure "cannot assemble the BReg editor's optional claim scope" + keycloak_admin POST /client-scopes "$body" + [[ "$KC_STATUS" == 201 ]] || journey_harness_failure "Keycloak refused the BReg editor's claim scope (HTTP $KC_STATUS)" + keycloak_admin GET /client-scopes + [[ "$KC_STATUS" == 200 ]] || journey_harness_failure "Keycloak cannot list its client scopes" + scope_id=$(jq -er --arg name "$BREG_KEYCLOAK_CLAIM_SCOPE" '.[] | select(.name == $name) | .id' <<<"$KC_BODY") || + journey_harness_failure "Keycloak did not list the BReg editor's claim scope" + keycloak_client_uuid "$CLIENT" uuid + keycloak_admin PUT "/clients/$uuid/optional-client-scopes/$scope_id" + [[ "$KC_STATUS" == 204 ]] || journey_harness_failure "Keycloak refused to bind the editor's optional scope (HTTP $KC_STATUS)" +} + # keycloak_service_account_subject CLIENT_ID VAR: the `sub` of the client's # service account, which a Coordinator policy names. keycloak_service_account_subject() { @@ -529,6 +595,8 @@ start_keycloak() { done journey_secret_new client-documents-wrong-kind 24 secret_envs+=(--secret-env JOURNEY_CLIENT_SECRET_DOCUMENTS_WRONG_KIND=client-documents-wrong-kind) + journey_secret_new client-breg-foreign 24 + secret_envs+=(--secret-env JOURNEY_CLIENT_SECRET_BREG_FOREIGN=client-breg-foreign) journey_container_run kc --port 8080 \ --env=KC_BOOTSTRAP_ADMIN_USERNAME=admin \ --secret-env KC_BOOTSTRAP_ADMIN_PASSWORD=keycloak-admin "${secret_envs[@]}" \ @@ -1029,14 +1097,12 @@ step_prepare() { edit "$RUNTIME_FILE" " root: /var/lib/breg/secrets" " root: $SECRETS" secret-file edit "$RUNTIME_FILE" " root: /var/lib/breg/package" " root: $WORK/build/package" package edit "$RUNTIME_FILE" " path: /var/log/breg/audit.jsonl" " path: $WORK/audit.jsonl" - if [[ "$ISSUER_KIND" == thunderid ]]; then - free_port BREG_HOOK_PORT - local hook_decl hook_dest - hook_decl=$(printf ' hooks:\n - id: contact-created\n phase: after\n trigger: created\n projection: [name, email, jurisdiction]\n handler: {type: url, destinationId: contact-sink}') - edit "$PROJECT/registry.yaml" $'\nactions:\n' $'\n'"$hook_decl"$'\n\nactions:\n' - hook_dest=$(printf 'destinations:\n hooks:\n contact-sink:\n origin: http://127.0.0.1:%s\n path: /events\n networkProfile: loopback-http\n dnsFamily: dual-stack-strict\n allowedPrivateCidrs: []\n hmacSha256KeyRef: secret:file/contact-sink-hmac\n classificationCeiling: internal\n deliveryCeilings:\n attemptTimeoutMilliseconds: 2000\n maximumAttempts: 5\n' "$BREG_HOOK_PORT") - printf '\n%s' "$hook_dest" >>"$RUNTIME_FILE" - fi + free_port BREG_HOOK_PORT + local hook_decl hook_dest + hook_decl=$(printf ' hooks:\n - id: contact-created\n phase: after\n trigger: created\n projection: [name, email, jurisdiction]\n handler: {type: url, destinationId: contact-sink}') + edit "$PROJECT/registry.yaml" $'\nactions:\n' $'\n'"$hook_decl"$'\n\nactions:\n' + hook_dest=$(printf 'destinations:\n hooks:\n contact-sink:\n origin: http://127.0.0.1:%s\n path: /events\n networkProfile: loopback-http\n dnsFamily: dual-stack-strict\n allowedPrivateCidrs: []\n hmacSha256KeyRef: secret:file/contact-sink-hmac\n classificationCeiling: internal\n deliveryCeilings:\n attemptTimeoutMilliseconds: 2000\n maximumAttempts: 5\n' "$BREG_HOOK_PORT") + printf '\n%s' "$hook_dest" >>"$RUNTIME_FILE" ;; casework) reader_command prepare --concepts project -- "$TOOL_BIN" init "$PROJECT" @@ -1295,9 +1361,10 @@ step_issuer() { case "$product" in breg) edit "$RUNTIME_FILE" " allowedAlgorithm: EdDSA" " allowedAlgorithm: RS256" - if [[ "$ISSUER_KIND" == thunderid ]]; then - edit "$RUNTIME_FILE" " allowedClients: [directory-client]" \ - " allowedClients: [directory-client, foreign-directory-client]" + edit "$RUNTIME_FILE" " allowedClients: [directory-client]" \ + " allowedClients: [directory-client, foreign-directory-client]" + if [[ "$ISSUER_KIND" == keycloak ]]; then + journey_count identity-provider-changes "$((10 + BREG_SCOPE_UNLINKS))" fi reader_command issuer -- "$TOOL_BIN" --format json check "$PROJECT" --runtime-config "$RUNTIME_FILE" ;; @@ -1414,82 +1481,88 @@ write_product_secrets() { done < <(secret_references "$RUNTIME_FILE") } -# breg_schema_test_credentials: acquire real client tokens for BReg's schema -# rehearsal and write a schema-test credential binding document covering every -# step of tests/journeys.yaml. +# Get a client-credentials token into the caller's variable. Keep the token +# response and the client secret out of the step output. +breg_keycloak_token() { + local client=$1 ref=$2 variable=$3 claims_scope=${4:-} secret_file response issued + local -a options=() + [[ -z "$claims_scope" ]] || options=(--data-urlencode "scope=$claims_scope") + journey_secret_path "$ref" secret_file + response=$(curl --silent --show-error --fail --max-time 30 \ + --data grant_type=client_credentials --data "client_id=$client" \ + --data-urlencode "client_secret@$secret_file" "${options[@]}" "$KC_ISSUER/protocol/openid-connect/token") || + journey_harness_failure "Keycloak refused the BReg client credentials of $client" + issued=$(jq -er '.access_token | strings | select(length > 0)' <<<"$response") || + journey_harness_failure "Keycloak returned no BReg access token for $client" + printf -v "$variable" '%s' "$issued" + local label=${variable,,} + journey_secret_register "$ref-token-${label//_/-}" "$variable" +} + +# Check issuer-provided identity and the exact scope before BReg sees a token. +# An empty principal represents an editor token issued without the mapper scope. +breg_keycloak_token_matches() { + local variable=$1 client=$2 subject=$3 principal=$4 jurisdiction=$5 + printf '%s' "${!variable}" | perl -MMIME::Base64 -e ' + local $/; my $token = ; + my $payload = (split /\./, $token)[1] // ""; + $payload =~ tr{-_}{+/}; + $payload .= "=" x ((4 - length($payload) % 4) % 4); + print decode_base64($payload);' | + jq -e --arg issuer "$KC_ISSUER" --arg client "$client" --arg subject "$subject" \ + --arg audience "$AUDIENCE" --arg scope "$SCOPE" --arg principal "$principal" --arg zone "$jurisdiction" ' + {issuer: (.iss == $issuer), client: (.azp == $client), subject: (.sub == $subject), + audience: (([.aud] | flatten | index($audience)) != null), scope: (.scope == $scope), + profile: (if $principal == "" then + (has("registry_principal") or has("registry_purpose") or has("jurisdiction") | not) + else + .registry_principal == $principal and .registry_purpose == "directory-administration" and .jurisdiction == $zone + end)} as $checks + | ($checks | to_entries | map(select(.value | not) | .key)) as $mismatches + | if ($mismatches | length) == 0 then true else + "Unexpected Keycloak token fields: \($mismatches | join(", ")); issued scope: \(.scope // "")\n" | halt_error(1) + end' >/dev/null +} + +# Acquire exact credentials for every step in the unmodified BReg fixture suite. breg_schema_test_credentials() { - local credentials_file=$1 secret_file response token + local credentials_file=$1 + # shellcheck disable=SC2034 # Read by name through token fetch and secret helpers. + local breg_schema_token='' breg_foreign_schema_token='' if [[ "$ISSUER_KIND" == thunderid ]]; then - # shellcheck disable=SC2034 # read by name in write_own_secret and thunderid_fetch_token - local breg_schema_token='' breg_foreign_schema_token='' thunderid_fetch_token "$TID_ROOT" "$TID_REGISTRATION" "$CLIENT" breg_schema_token "$AUDIENCE" thunderid_fetch_token "$TID_ROOT" "$TID_REGISTRATION" foreign-directory-client breg_foreign_schema_token "$AUDIENCE" - write_own_secret breg-schema-token breg_schema_token - write_own_secret breg-foreign-schema-token breg_foreign_schema_token - journey_write_file "$credentials_file" --concepts client,grant,scopes,secret-file < <( - perl -MJSON::PP -e ' - my ($path) = @ARGV; - open my $fh, "<", $path or die "cannot read $path: $!\n"; - my ($journey, $step, @bindings); - while (my $line = <$fh>) { - if ($line =~ /^ - id: (\S+)/) { - $journey = $1; - $step = undef; - } elsif (defined $journey && $line =~ /^ - id: (\S+)/) { - $step = $1; - push @bindings, { - journeyId => $journey, - stepId => $step, - credential => { - type => "bearer", - tokenRef => "secret:file/breg-schema-token", - }, - }; - } elsif (@bindings && $line =~ /jurisdiction:\s*zone-b/) { - $bindings[-1]{credential}{tokenRef} = "secret:file/breg-foreign-schema-token"; - } - } - die "no journey steps found in $path\n" unless @bindings; - print JSON::PP->new->utf8->canonical->pretty->encode({ - apiVersion => "id.registrystack.org/formats/breg/schema-test-credentials/v1", - kind => "BRegSchemaTestCredentials", - bindings => \@bindings, - });' "$PROJECT/tests/journeys.yaml" - ) - return 0 + else + breg_keycloak_token "$CLIENT" client-breg breg_schema_token "$BREG_KEYCLOAK_CLAIM_SCOPE" + breg_keycloak_token foreign-directory-client client-breg-foreign breg_foreign_schema_token + breg_keycloak_token_matches breg_schema_token "$CLIENT" "$BREG_EDITOR_SUBJECT" synthetic-directory-editor zone-a || + journey_harness_failure "Keycloak did not issue the exact BReg editor claims and scope" + breg_keycloak_token_matches breg_foreign_schema_token foreign-directory-client "$BREG_FOREIGN_SUBJECT" synthetic-foreign-editor zone-b || + journey_harness_failure "Keycloak did not issue the exact BReg foreign editor claims and scope" fi - journey_secret_path "client-breg" secret_file - response=$(curl --silent --show-error --max-time 30 \ - --data grant_type=client_credentials \ - --data "client_id=$CLIENT" \ - --data-urlencode "client_secret@$secret_file" \ - "$KC_ISSUER/protocol/openid-connect/token") || - journey_harness_failure "Keycloak did not answer for $CLIENT while preparing bregctl test" - token=$(printf '%s' "$response" | jq -r '.access_token // empty') || - journey_harness_failure "Keycloak answered non-JSON for $CLIENT while preparing bregctl test" - [[ -n "$token" ]] || - journey_harness_failure "Keycloak refused client credentials for $CLIENT while preparing bregctl test" - # shellcheck disable=SC2034 # read by name in write_own_secret and journey_secret_register - BREG_SCHEMA_TOKEN=$token - journey_secret_register breg-schema-token BREG_SCHEMA_TOKEN - write_own_secret breg-schema-token BREG_SCHEMA_TOKEN + write_own_secret breg-schema-token breg_schema_token + write_own_secret breg-foreign-schema-token breg_foreign_schema_token journey_write_file "$credentials_file" --concepts client,grant,scopes,secret-file < <( perl -MJSON::PP -e ' my ($path) = @ARGV; open my $fh, "<", $path or die "cannot read $path: $!\n"; - my ($journey, @bindings); + my ($journey, $step, @bindings); while (my $line = <$fh>) { if ($line =~ /^ - id: (\S+)/) { $journey = $1; + $step = undef; } elsif (defined $journey && $line =~ /^ - id: (\S+)/) { + $step = $1; push @bindings, { journeyId => $journey, - stepId => $1, + stepId => $step, credential => { type => "bearer", tokenRef => "secret:file/breg-schema-token", }, }; + } elsif (@bindings && $line =~ /jurisdiction:\s*zone-b/) { + $bindings[-1]{credential}{tokenRef} = "secret:file/breg-foreign-schema-token"; } } die "no journey steps found in $path\n" unless @bindings; @@ -1563,42 +1636,35 @@ step_database() { breg) local credentials=$WORK/schema-test-credentials.json receipt=$WORK/schema-test-receipt.json build=$WORK/build breg_schema_test_credentials "$credentials" - if [[ "$ISSUER_KIND" == thunderid ]]; then - # bregctl test records an initial activation in its target database, so - # run schema rehearsal against a separate breg_test database while keeping - # the serving breg database empty for bregctl apply --initial. - local test_rt=$WORK/test-runtime.yaml test_pkg=$WORK/test-package - # shellcheck disable=SC2034 # read by name in write_own_secret - local mig_pw run_pw test_url - journey_secret_new breg-test-mig-pw 24 - journey_secret_new breg-test-run-pw 24 - read_secret breg-test-mig-pw mig_pw - read_secret breg-test-run-pw run_pw - test_url="postgresql://breg_test_migration:$mig_pw@127.0.0.1:$PG_PORT/breg_test" - write_own_secret breg-test-migration-database-url test_url - # shellcheck disable=SC2034 # read by name in write_own_secret - test_url="postgresql://breg_test_runtime:$run_pw@127.0.0.1:$PG_PORT/breg_test" - write_own_secret breg-test-runtime-database-url test_url - mkdir -p -- "$test_pkg" - copy_file "$RUNTIME_FILE" "$test_rt" - harness_edit "$test_rt" " databaseId: local-directory-db" " databaseId: local-directory-test-db" - harness_edit "$test_rt" " runtimeUrlRef: secret:file/breg-runtime-database-url" " runtimeUrlRef: secret:file/breg-test-runtime-database-url" - harness_edit "$test_rt" " migrationUrlRef: secret:file/breg-migration-database-url" " migrationUrlRef: secret:file/breg-test-migration-database-url" - harness_edit "$test_rt" " migration: breg_migration" " migration: breg_test_migration" - harness_edit "$test_rt" " runtime: breg_runtime" " runtime: breg_test_runtime" - harness_edit "$test_rt" " root: $build/package" " root: $test_pkg" - reader_command database.connect -- "$TOOL_BIN" provision --runtime-config "$test_rt" --admin-url-file "$ADMIN_URL_FILE" - [[ $CELL_OVER -eq 0 ]] || return 0 - reader_command database.connect \ - --typed "$TOOL test $PROJECT --runtime-config $test_rt --credentials $credentials --output $receipt" -- \ - "$TOOL_BIN" --format json test "$PROJECT" --runtime-config "$test_rt" --credentials "$credentials" --output "$receipt" - [[ $CELL_OVER -eq 0 ]] || return 0 - else - reader_command database.connect \ - --typed "$TOOL test $PROJECT --runtime-config $RUNTIME_FILE --credentials $credentials --output $receipt" -- \ - "$TOOL_BIN" --format json test "$PROJECT" --runtime-config "$RUNTIME_FILE" --credentials "$credentials" --output "$receipt" - [[ $CELL_OVER -eq 0 ]] || return 0 - fi + # bregctl test records an initial activation in its target database, so + # run schema rehearsal against a separate breg_test database while keeping + # the serving breg database empty for bregctl apply --initial. + local test_rt=$WORK/test-runtime.yaml test_pkg=$WORK/test-package + # shellcheck disable=SC2034 # read by name in write_own_secret + local mig_pw run_pw test_url + journey_secret_new breg-test-mig-pw 24 + journey_secret_new breg-test-run-pw 24 + read_secret breg-test-mig-pw mig_pw + read_secret breg-test-run-pw run_pw + test_url="postgresql://breg_test_migration:$mig_pw@127.0.0.1:$PG_PORT/breg_test" + write_own_secret breg-test-migration-database-url test_url + # shellcheck disable=SC2034 # read by name in write_own_secret + test_url="postgresql://breg_test_runtime:$run_pw@127.0.0.1:$PG_PORT/breg_test" + write_own_secret breg-test-runtime-database-url test_url + mkdir -p -- "$test_pkg" + copy_file "$RUNTIME_FILE" "$test_rt" + harness_edit "$test_rt" " databaseId: local-directory-db" " databaseId: local-directory-test-db" + harness_edit "$test_rt" " runtimeUrlRef: secret:file/breg-runtime-database-url" " runtimeUrlRef: secret:file/breg-test-runtime-database-url" + harness_edit "$test_rt" " migrationUrlRef: secret:file/breg-migration-database-url" " migrationUrlRef: secret:file/breg-test-migration-database-url" + harness_edit "$test_rt" " migration: breg_migration" " migration: breg_test_migration" + harness_edit "$test_rt" " runtime: breg_runtime" " runtime: breg_test_runtime" + harness_edit "$test_rt" " root: $build/package" " root: $test_pkg" + reader_command database.connect -- "$TOOL_BIN" provision --runtime-config "$test_rt" --admin-url-file "$ADMIN_URL_FILE" + [[ $CELL_OVER -eq 0 ]] || return 0 + reader_command database.connect \ + --typed "$TOOL test $PROJECT --runtime-config $test_rt --credentials $credentials --output $receipt" -- \ + "$TOOL_BIN" --format json test "$PROJECT" --runtime-config "$test_rt" --credentials "$credentials" --output "$receipt" + [[ $CELL_OVER -eq 0 ]] || return 0 reader_command database.connect --concepts package \ --typed "$TOOL package $PROJECT --test-receipt $receipt --output $build" -- \ "$TOOL_BIN" --format json package "$PROJECT" --test-receipt "$receipt" --output "$build" @@ -1752,10 +1818,15 @@ step_token() { journey_pass token return 0 fi - local token_url=$KC_ISSUER/protocol/openid-connect/token status=0 + local token_url=$KC_ISSUER/protocol/openid-connect/token status=0 typed_scope='' + local -a scope_option=() + if [[ "$CELL" == breg ]]; then + scope_option=(--form "scope=$BREG_KEYCLOAK_CLAIM_SCOPE") + typed_scope=" -d scope=$BREG_KEYCLOAK_CLAIM_SCOPE" + fi journey_http token --concepts client,grant,scopes \ - --typed "curl -X POST $token_url -d grant_type=client_credentials -d client_id=$CLIENT -d client_secret=\$SECRET" \ - --form grant_type=client_credentials --form "client_id=$CLIENT" --form-secret "client_secret=client-$CELL" \ + --typed "curl -X POST $token_url -d grant_type=client_credentials -d client_id=$CLIENT -d client_secret=\$SECRET$typed_scope" \ + --form grant_type=client_credentials --form "client_id=$CLIENT" --form-secret "client_secret=client-$CELL" "${scope_option[@]}" \ --capture-secret .access_token ACCESS_TOKEN POST "$token_url" || status=$? if [[ $status -ne 0 ]]; then journey_harness_failure "Keycloak refused the client credentials of $CLIENT (HTTP $JOURNEY_HTTP_STATUS); the realm is the journey's own setup, see $JOURNEY_STEP_STDOUT" @@ -1940,6 +2011,30 @@ check_thunderid_negative_auth() { journey_harness_failure "$CELL did not refuse a wrong-audience ThunderID token with HTTP 401 (got HTTP $JOURNEY_HTTP_STATUS)" } +# Match the claims check to the trace from the control's HTTP response. +breg_claims_refused_at_trace() { + local trace=$1 + shift + jq -Rne --arg trace "$trace" 'any(inputs | fromjson?; + .fields.trace_id == $trace and .fields.decision == "refused" and .fields.failed_check == "token-claims")' "$@" >/dev/null +} + +breg_no_mapper_control() { + # shellcheck disable=SC2034 # Read by name through the token and HTTP helpers. + local control_token='' trace + breg_keycloak_token "$CLIENT" client-breg control_token + breg_keycloak_token_matches control_token "$CLIENT" "$BREG_EDITOR_SUBJECT" '' '' || + journey_harness_failure "Keycloak did not issue the exact stock BReg scope and caller for the no-mapper control" + journey_http call --expect-status 401 --bearer control_token GET "http://127.0.0.1:$PORT$CALL_PATH" && + [[ "$JOURNEY_HTTP_PROBLEM_CODE" == authentication.refused ]] || + journey_harness_failure "BReg's no-mapper control returned HTTP $JOURNEY_HTTP_STATUS ($JOURNEY_HTTP_PROBLEM_CODE)" + trace=$(jq -er '.traceId | strings | select(test("^[0-9a-f]{32}$"))' "$JOURNEY_STEP_STDOUT") || + journey_harness_failure "BReg's no-mapper response did not include a valid trace ID" + refresh_server_log + breg_claims_refused_at_trace "$trace" "$SERVER_LOG_OUT" "$SERVER_LOG_ERR" || + journey_harness_failure "BReg's no-mapper trace $trace has no refusal at the authored claims check" +} + # call: the first authenticated request. A refusal is named by the HTTP status # and the stage the product logged, by the problem code it answered when its # log names no stage. Optional assists may retry the request. @@ -1967,6 +2062,9 @@ step_call() { REACHED_AUTH_PRODUCTS+=("$CELL") fi check_wrong_kind + if [[ "$CELL" == breg && "$ISSUER_KIND" == keycloak ]]; then + breg_no_mapper_control + fi journey_pass call [[ "$CALL_METHOD" != GET ]] || journey_reached t1 return 0 @@ -2204,6 +2302,22 @@ breg_hook() { journey_stop hook breg-hook-receiver || journey_harness_failure "the BReg hook receiver ignored SIGTERM" journey_step hook -- assert_signed_hook_acceptance "$receiver_out" /events contact-created || journey_harness_failure "the BReg signed hook acceptance record did not confirm HMAC receiver authority without inbound credential headers" + if [[ "$ISSUER_KIND" == keycloak ]]; then + journey_http hook --expect-status 200 --bearer ACCESS_TOKEN GET "$origin/v1/records/contacts/$record_id" || + journey_harness_failure "the BReg editor could not read the contact named by the signed hook" + # shellcheck disable=SC2016 # jq binds its own variables. + journey_step hook -- jq -e --arg record "$record_id" '.data.recordId == $record' "$JOURNEY_STEP_STDOUT" || + journey_harness_failure "the BReg editor did not receive the exact contact" + local foreign_token='' + breg_keycloak_token foreign-directory-client client-breg-foreign foreign_token + breg_keycloak_token_matches foreign_token foreign-directory-client "$BREG_FOREIGN_SUBJECT" synthetic-foreign-editor zone-b || + journey_harness_failure "Keycloak did not issue the exact BReg foreign caller for the hook assertion" + [[ "$foreign_token" != "$(<"$SECRETS/breg-foreign-schema-token")" ]] || + journey_harness_failure "Keycloak reused the BReg schema test token for the hook assertion" + journey_http hook --expect-status 404 --bearer foreign_token GET "$origin/v1/records/contacts/$record_id" && + [[ "$JOURNEY_HTTP_PROBLEM_CODE" == resource.not-found ]] || + journey_harness_failure "the BReg foreign caller was not concealed from the exact contact" + fi } # composed_scheduling_hook: exercise a real BReg + Casework + Scheduling @@ -2722,13 +2836,8 @@ JSON step_hook() { case "$CELL" in breg) - if [[ "$ISSUER_KIND" == thunderid ]]; then - breg_hook - journey_pass hook - else - journey_unreached hook "The product delivers hooks, and this journey does not start a hook receiver yet." - CELL_OVER=1 - fi + breg_hook + journey_pass hook ;; scheduling) [[ $scheduling_catalogue_ok -eq 1 ]] || @@ -2894,6 +3003,15 @@ if [[ ${#PRIMARY[@]} -gt 0 ]]; then recipe "$product" keycloak_default_scope "$CLIENT" "$SCOPE" case "$product" in + breg) + keycloak_default_scope foreign-directory-client "$SCOPE" + breg_keycloak_exact_scope "$CLIENT" + breg_keycloak_exact_scope foreign-directory-client + keycloak_service_account_subject "$CLIENT" BREG_EDITOR_SUBJECT + keycloak_service_account_subject foreign-directory-client BREG_FOREIGN_SUBJECT + breg_keycloak_editor_scope + breg_keycloak_add_mappers foreign-directory-client synthetic-foreign-editor zone-b + ;; casework) keycloak_default_scope "$CLIENT" casework:staff keycloak_service_account_subject "$CLIENT" CASEWORK_SUBJECT @@ -2908,12 +3026,13 @@ if [[ ${#PRIMARY[@]} -gt 0 ]]; then fi jq -n --arg issuer "$ISSUER_KIND" --arg image "$KEYCLOAK_IMAGE" --arg realm "$REALM" \ --arg issuerUrl "$KC_ISSUER" --arg postgres "$POSTGRES_IMAGE" --arg pgPort "$PG_PORT" \ - --arg port "$PORT" --arg metricsPort "$METRICS_PORT" \ + --arg port "$PORT" --arg metricsPort "$METRICS_PORT" --args \ 'def opt: if . == "" then null else . end; {schema: "registry.journey-own-provider/v1", issuer: $issuer, issuerImage: $image, realm: $realm, issuerUrl: ($issuerUrl | opt), postgresImage: $postgres, postgresPort: ($pgPort | opt | if . == null then null else tonumber end), productPort: ($port | tonumber), productMetricsPort: ($metricsPort | tonumber), - containers: {issuer: "kc", postgres: "pg"}}' >"$JOURNEY_OUT/own-provider.json" || + fixtureOnlyProducts: [$ARGS.positional[] | select(. == "breg")], + containers: {issuer: "kc", postgres: "pg"}}' "${PRIMARY[@]}" >"$JOURNEY_OUT/own-provider.json" || journey_harness_failure "cannot write $JOURNEY_OUT/own-provider.json" else jq -n --arg issuer "$ISSUER_KIND" --arg image "$THUNDERID_IMAGE" \ diff --git a/products/platform/journeys/promote.sh b/products/platform/journeys/promote.sh index 411e98aac1..87aa6d1f17 100755 --- a/products/platform/journeys/promote.sh +++ b/products/platform/journeys/promote.sh @@ -156,6 +156,21 @@ input_outcome() { elif .[0].outcome == "pass" or (.[0].outcome == "unreached" and .[0].toT1 != null) then "finished" else .[0].outcome end' "$FROM/summary.json") || journey_harness_failure "cannot read the cell of $1 in $FROM/summary.json" + if [[ "$value" == finished && "$1" == breg ]]; then + # A passing BReg summary alone cannot authorize reuse of the fixture. + if [[ ! -e "$FROM/own-provider.json" ]]; then + value=legacy-unmarked + else + value=$(jq -er ' + if type != "object" then "invalid-fixture-marker" + elif has("fixtureOnlyProducts") | not then "legacy-unmarked" + elif .fixtureOnlyProducts == ["breg"] then "fixture-only" + else "invalid-fixture-marker" end' "$FROM/own-provider.json" 2>/dev/null) || value=invalid-fixture-marker + fi + elif [[ "$value" == finished && -f "$FROM/own-provider.json" ]] && jq -e --arg product "$1" ' + .fixtureOnlyProducts | type == "array" and index($product) != null' "$FROM/own-provider.json" >/dev/null; then + value=fixture-only + fi printf -v "$2" '%s' "$value" } @@ -493,7 +508,23 @@ walk_product() { # input input_outcome "$product" outcome if [[ "$outcome" != finished ]]; then - printf 'promote: the %s journey did not finish for %s (cell outcome %s); nothing to promote\n' "$INPUT_JOURNEY" "$product" "$outcome" >&2 + case "$outcome" in + fixture-only | legacy-unmarked | invalid-fixture-marker) + # An explicitly kept fixture still needs cleanup when no cell can use it. + if [[ -f "$FROM/kept" ]]; then + take_over_input + fi + if [[ "$outcome" == fixture-only ]]; then + printf 'promote: %s %s input refused (fixture-only). This fixture is scoped to own-provider verification\n' "$INPUT_JOURNEY" "$product" >&2 + else + printf 'promote: %s %s input refused (%s). Use the current own-provider runner to record the BReg fixture marker\n' \ + "$INPUT_JOURNEY" "$product" "$outcome" >&2 + fi + ;; + *) + printf 'promote: the %s journey did not finish for %s (cell outcome %s); nothing to promote\n' "$INPUT_JOURNEY" "$product" "$outcome" >&2 + ;; + esac journey_fail input journey.promote.no-input journey_cell_end return 0 diff --git a/products/platform/journeys/rstack-dev.sh b/products/platform/journeys/rstack-dev.sh index 39dc3a52cd..f24b30b5b1 100755 --- a/products/platform/journeys/rstack-dev.sh +++ b/products/platform/journeys/rstack-dev.sh @@ -286,6 +286,18 @@ path.write_text(source.replace(marker, hook + marker)) PYHOOK } +# Use the maintained Documents observer policies with the development starter's +# people, journey, and custody policies. +add_documents_hooks() { + local target=$1/documents.yaml + local starter=$JOURNEY_ROOT/products/documents/examples/starter/documents.yaml + if ! grep -Fxq 'hooks:' "$target"; then + grep -Fxq 'hooks:' "$starter" || journey_harness_failure "the Documents starter has no observer policies" + printf '\n' >>"$target" + sed -n '/^hooks:$/,$p' "$starter" >>"$target" + fi +} + # The Adapter starter writes two effects to an authored reference endpoint. # Speak the documented fixture's two replies over a disposable local socket. start_adapter_source() { @@ -401,11 +413,6 @@ write_keep() { KEEP_EXPECT=retained-counter return ;; - documents) - path=/v1/documents - body='{"policyId":"institutional-custody","expectedDigest":"sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","length":1,"mediaType":"application/pdf","label":"Retained document","custodian":{"subject":"starter-citizen"}}' - field='.document.id' - ;; coordinator) path=/v1/runs send_after=$(python3 -c 'from datetime import datetime, timedelta, timezone; print((datetime.now(timezone.utc) + timedelta(days=1)).isoformat(timespec="seconds"))') @@ -426,7 +433,7 @@ write_keep() { [[ "$product" != casework ]] || write_path="$path?accessProfile=requester" journey_http "$step" "${options[@]}" --data-file "$work/keep-body.json" --capture "$field" saved_id "$method" "$url$write_path" || unexpected_answer "$step" case "$product" in - breg | documents | coordinator) KEEP_PATH=$path/$saved_id ;; + breg | coordinator) KEEP_PATH=$path/$saved_id ;; casework) KEEP_PATH=$path/$saved_id ;; adapter) KEEP_PATH=$path ;; esac @@ -481,7 +488,7 @@ unexpected_answer() { walk_product() { # shellcheck disable=SC2034 # token and token2 are set by name through issue_token local product=$1 work project tier plan_capable status=0 url message_id='' token='' token2='' workflow_revision='' uses_postgres - local first_read=0 + local first_read=0 documents_receipt='' journey_product_field "$product" tier tier journey_product_field "$product" rstackDevPlan plan_capable journey_product_field "$product" usesPostgres uses_postgres @@ -526,6 +533,7 @@ walk_product() { # start: one command, after supplying the optional fixture endpoints. case "$product" in breg) add_contact_hook "$project" ;; + documents) add_documents_hooks "$project" ;; casework) # Use the generated test person's issuer for the starter's # trusted producer on this disposable project. @@ -604,8 +612,9 @@ walk_product() { first_read=1 fi - # hook: BReg's keep write also triggers its local sink. - if [[ "$product" == breg ]]; then + # The BReg and Documents writes also test retention after restart. + case "$product" in + breg) local sink write_keep "$product" "$work" "$project" "$url" "$run" sink=$(jq -er '.bregHookSink.receivedUrl' "$START_FILE") @@ -615,12 +624,16 @@ walk_product() { breg_hook_matches "$KEEP_EXPECT" "$JOURNEY_STEP_STDOUT" || journey_harness_failure "the BReg hook receipt does not contain the retained contact's creation event" journey_pass hook - else - journey_unexercised hook - fi + ;; + documents) + documents_ready_hook "$work" "$url" token documents_receipt + journey_pass hook + ;; + *) journey_unexercised hook ;; + esac if [[ "$uses_postgres" == true ]]; then - if [[ "$product" != breg ]]; then + if [[ "$product" != breg && "$product" != documents ]]; then write_keep "$product" "$work" "$project" "$url" "$run" fi local audit='' first_start_file=$START_FILE @@ -672,6 +685,10 @@ walk_product() { fi jq -e --arg expected "$KEEP_EXPECT" '[.. | strings] | index($expected) != null' "$JOURNEY_STEP_STDOUT" >/dev/null || journey_harness_failure "the retained $product response did not contain the written record" + if [[ "$product" == documents ]]; then + documents_ready_matches "$documents_receipt" "$JOURNEY_STEP_STDOUT" || + journey_harness_failure "the retained document no longer identifies the ready version" + fi if [[ "$method" == GET && $first_read -eq 0 ]]; then journey_reached t1 fi @@ -679,9 +696,9 @@ walk_product() { journey_step keep -- audit_was_appended "$work/audit-before-restart.jsonl" "$audit" fi # These paths have written and read back a record across a restart. - # BReg also delivered its observer hook before the restart. + # BReg and Documents also delivered an observer hook before the restart. case "$product" in - breg | coordinator | messaging) journey_reached t2 ;; + breg | coordinator | documents | messaging) journey_reached t2 ;; esac else printf '%s\n' "$product has no PostgreSQL state to retain." @@ -769,6 +786,85 @@ hook_received() { curl --silent --fail --max-time 3 "$1" | breg_hook_matches "$2" } +# The managed sink authenticates the delivery. Correlate its captured envelope +# and signing headers to the operation, without accepting forwarded credentials. +signed_hook_matches() { + local expected=$1 + shift + jq -e --argjson expected "$expected" 'any(.[]; + . as $capture | (.body | fromjson?) as $event | + $event.type == $expected.type and $event.data == $expected.data and + ($expected.source == null or $event.source == $expected.source) and + ($event.id | type == "string" and length > 0) and + any($capture.headers[]; .name == "webhook-id" and .value == $event.id) and + any($capture.headers[]; .name == "webhook-timestamp" and (.value | test("^[0-9]+$"))) and + any($capture.headers[]; .name == "webhook-signature" and (.value | startswith("v1,"))) and + all($capture.headers[]; .name != "authorization" and .name != "cookie" and + .name != "registry-source-authorization" and .name != "proxy-authorization"))' "$@" >/dev/null +} + +signed_hook_received() { + curl --silent --fail --max-time 3 "$1" | signed_hook_matches "$2" +} + +managed_hook_url() { + local product=$1 value + value=$(jq -er --arg product "$product" '.hookSinks[$product].receivedUrl | strings | select(length > 0)' "$START_FILE") || + journey_harness_failure "the local $product run did not report its hook sink" + printf -v "$2" '%s' "$value" +} + +check_managed_hook() { + local product=$1 sink=$2 expected=$3 + journey_poll 45 -- signed_hook_received "$sink" "$expected" || + journey_harness_failure "the local $product hook sink did not receive the expected event" + journey_http hook GET "$sink" || unexpected_answer hook + signed_hook_matches "$expected" "$JOURNEY_STEP_STDOUT" || + journey_harness_failure "the local $product hook receipt did not contain the expected event" +} + +documents_ready_matches() { + jq -e --argjson event "$1" ' + .id == $event.data.documentId and .version.id == $event.data.versionId and + .version.expectedDigest == $event.data.versionDigest and .version.status == "ready"' "$2" >/dev/null +} + +# Reserve and upload the synthetic PDF, then read the same ready version. +# Leave its path and ID for the retained read rather than reserving a second document. +documents_ready_hook() { + local work=$1 origin=$2 bearer=$3 result=$4 + local pdf=$work/retained.pdf reserve=$work/document-reserve.json + local digest document='' version='' upload='' ready_event sink + managed_hook_url documents sink + journey_write_file "$pdf" < <(printf '%%PDF-1.7\n%%%%EOF\n') + digest=$(perl -MDigest::SHA -e 'print "sha256:", Digest::SHA->new(256)->addfile($ARGV[0], "b")->hexdigest' "$pdf") || + journey_harness_failure "cannot digest the synthetic document" + journey_write_file "$reserve" < <( + jq -cn --arg digest "$digest" --argjson length "$(wc -c <"$pdf")" \ + '{policyId:"institutional-custody", custodian:{subject:"starter-citizen"}, + expectedDigest:$digest, length:$length, mediaType:"application/pdf"}' + ) + journey_http hook --expect-status 201 --bearer "$bearer" --header 'Content-Type: application/json' \ + --header 'Idempotency-Key: journey-document-reservation' --data-file "$reserve" \ + --capture .uploadPath upload --capture .document.id document --capture .document.version.id version \ + POST "$origin/v1/documents" || unexpected_answer hook + [[ "$upload" =~ ^/v1/uploads/[0-9a-f-]+/content$ ]] || + journey_harness_failure "the document reservation returned an invalid upload path" + journey_http hook --expect-status 200 --bearer "$bearer" --header 'Content-Type: application/pdf' \ + --data-file "$pdf" PUT "$origin$upload" || unexpected_answer hook + ready_event=$(jq -cn --arg document "$document" --arg version "$version" --arg digest "$digest" \ + '{source:"urn:registrystack:documents:civil-registry-documents", type:"document-version-ready", + data:{documentId:$document, versionId:$version, versionDigest:$digest, policyId:"institutional-custody", policyVersion:"1"}}') + check_managed_hook documents "$sink" "$ready_event" + KEEP_PERSON=$PERSON + KEEP_PATH=/v1/documents/$document + KEEP_EXPECT=$document + journey_http hook --expect-status 200 --bearer "$bearer" GET "$origin$KEEP_PATH" || unexpected_answer hook + documents_ready_matches "$ready_event" "$JOURNEY_STEP_STDOUT" || + journey_harness_failure "the document read did not return the exact ready version from the hook" + printf -v "$result" '%s' "$ready_event" +} + # attach_database PROJECT: start PROJECT against a PostgreSQL server the reader # runs: a stock container with no certificate, using explicit loopback plaintext # (?sslmode=disable). The password reaches the child process through the diff --git a/products/platform/journeys/test_journey_tables.py b/products/platform/journeys/test_journey_tables.py index 933b233676..cb107b64bd 100644 --- a/products/platform/journeys/test_journey_tables.py +++ b/products/platform/journeys/test_journey_tables.py @@ -352,6 +352,45 @@ def test_realm_import_has_no_protocol_mappers(self): class KeycloakRecipe(unittest.TestCase): + def test_breg_refusal_requires_the_control_trace(self): + script = (TABLES / "own-provider.sh").read_text(encoding="utf-8") + function = re.search(r"^breg_claims_refused_at_trace\(\) \{\n.*?^\}\n", script, re.S | re.M) + self.assertIsNotNone(function) + trace = "01a2329737512fef4af31980675d47a2" + other = "01a23294626136512634d9f00f1cf6ee" + with tempfile.TemporaryDirectory() as directory: + log = Path(directory) / "server.log" + for second_check, accepted in (("token-time", False), ("token-claims", True)): + records = [{"fields": {"trace_id": id_, "decision": "refused", "failed_check": check}} + for id_, check in ((other, "token-claims"), (trace, second_check))] + log.write_text("non-JSON output\n" + "\n".join(map(json.dumps, records)) + "\n", encoding="utf-8") + result = subprocess.run( + ["bash", "-euo", "pipefail", "-c", function.group(0) + '\nbreg_claims_refused_at_trace "$@"', + "breg-control-trace", trace, str(log)], capture_output=True, text=True, timeout=5, + ) + self.assertEqual(result.returncode == 0, accepted, result.stderr) + + def test_breg_mappers_are_static_and_only_set_authored_claims(self): + script = (TABLES / "own-provider.sh").read_text(encoding="utf-8") + match = re.search(r"^breg_keycloak_mappers\(\) \{\n.*?^\}\n", script, re.S | re.M) + self.assertIsNotNone(match) + for principal, zone in (("synthetic-directory-editor", "zone-a"), + ("synthetic-foreign-editor", "zone-b")): + result = subprocess.run( + ["bash", "-euo", "pipefail", "-c", match.group(0) + '\nbreg_keycloak_mappers "$1" "$2"', + "breg-keycloak-mappers", principal, zone], capture_output=True, text=True, timeout=5, + ) + self.assertEqual(result.returncode, 0, result.stderr) + mappings = json.loads(result.stdout) + self.assertEqual({m["config"]["claim.name"]: m["config"]["claim.value"] for m in mappings}, + {"registry_principal": principal, "registry_purpose": "directory-administration", + "jurisdiction": zone}) + self.assertEqual(len(mappings), 3) + for mapper in mappings: + self.assertEqual(mapper["protocolMapper"], "oidc-hardcoded-claim-mapper") + self.assertEqual(mapper["config"]["access.token.claim"], "true") + self.assertEqual(mapper["config"]["jsonType.label"], "String") + def test_documents_realm_provisions_custodian_and_wrong_kind_service_clients(self): realm = json.loads((TABLES / "keycloak" / "realm.json").read_text(encoding="utf-8")) clients = {client["clientId"]: client for client in realm["clients"]} @@ -497,6 +536,35 @@ def test_change_in_request_bytes_changes_contract_without_exposing_body(self): class ProductionOutcome(unittest.TestCase): + def test_scoped_fixture_input_cannot_be_promoted(self): + script = (TABLES / "promote.sh").read_text(encoding="utf-8") + function = re.search(r"^input_outcome\(\) \{\n.*?^\}\n", script, re.S | re.M) + self.assertIsNotNone(function) + with tempfile.TemporaryDirectory() as directory: + path = Path(directory) + (path / "summary.json").write_text(json.dumps({"cells": [ + {"product": product, "outcome": "pass"} for product in ("breg", "adapter") + ]}), encoding="utf-8") + provider = path / "own-provider.json" + cases = ( + (None, "legacy-unmarked"), + ({}, "legacy-unmarked"), + ({"fixtureOnlyProducts": ["breg"]}, "fixture-only"), + ({"fixtureOnlyProducts": []}, "invalid-fixture-marker"), + ({"fixtureOnlyProducts": "breg"}, "invalid-fixture-marker"), + ({"fixtureOnlyProducts": ["breg", 1]}, "invalid-fixture-marker"), + ({"fixtureOnlyProducts": None}, "invalid-fixture-marker"), + ) + for metadata, expected_breg in cases: + if metadata is not None: + provider.write_text(json.dumps(metadata), encoding="utf-8") + result = subprocess.check_output( + ["bash", "-euo", "pipefail", "-c", function.group(0) + '\nFROM=$1\n' + 'input_outcome breg breg; input_outcome adapter adapter; printf "%s\\n" "$breg" "$adapter"', + "promote-input", str(path)], text=True, timeout=5, + ) + self.assertEqual(result.splitlines(), [expected_breg, "finished"]) + def test_zero_diagnostics_requires_a_successful_check_and_an_explicit_case(self): script = (TABLES / "promote.sh").read_text(encoding="utf-8") function = re.search(r"^production_outcome\(\) \{\n.*?^\}\n", script, re.S | re.M) @@ -870,7 +938,11 @@ class LocalHookWalk(unittest.TestCase): def walk(self, product, delivered): script = (TABLES / "rstack-dev.sh").read_text(encoding="utf-8") functions = [] - for name in ("walk_product", "recipe", "hook_received", "breg_hook_matches"): + for name in ( + "walk_product", "recipe", "hook_received", "breg_hook_matches", + "managed_hook_url", "check_managed_hook", "signed_hook_received", "signed_hook_matches", + "documents_ready_hook", "documents_ready_matches", + ): match = re.search(rf"^{name}\(\) \{{\n.*?^\}}\n", script, re.M | re.S) self.assertIsNotNone(match, name) functions.append(match.group(0)) @@ -885,14 +957,19 @@ def walk(self, product, delivered): : >"$scratch/audit.schedulingctl.jsonl" init_command() { INIT_COMMAND=(true); } add_contact_hook() { :; } +add_documents_hooks() { :; } start_run() { local result=passed [[ "$1" != keep ]] || result=skipped RUN=$1-run START_FILE=$scratch/$1.json - jq -n --arg product "$CELL" --arg runtime "$scratch/runtime.json" --arg result "$result" ' + jq -n --arg product "$CELL" --arg runtime "$scratch/runtime.json" --arg result "$result" \ + --arg delivered "$delivered" ' {runtimeConfigs: {($product): $runtime}, scenarios: [{id: "starter", result: $result}], - bregHookSink: {receivedUrl: "http://127.0.0.1:49191/received"}}' >"$START_FILE" + bregHookSink: {receivedUrl: "http://127.0.0.1:49191/received"}} + + if $delivered == "no-sink" then {} else + {hookSinks: {documents: {receivedUrl: "http://127.0.0.1:49191/received"}}} + end' >"$START_FILE" LIVE_RUNS+="$RUN"$'\n' } run_url() { printf '%s\n' 'http://127.0.0.1:49192'; } @@ -905,6 +982,19 @@ def walk(self, product, delivered): } sink_response() { local record + if [[ "$CELL" == documents ]]; then + jq -nc --arg digest "$(<"$scratch/digest")" --arg mode "$delivered" ' + {id: "evt-1", source: "urn:registrystack:documents:civil-registry-documents", + type: "document-version-ready", data: {documentId: "retained-id", + versionId: (if $mode == "other-version" then "other" else "version-id" end), + versionDigest: $digest, policyId: "institutional-custody", policyVersion: "1"}} as $event | + [{body: ($event | tojson), headers: [ + {name: "webhook-id", value: "evt-1"}, + {name: "webhook-timestamp", value: "1"}, + {name: "webhook-signature", value: "v1,fixture"} + ] + (if $mode == "forwarded-auth" then [{name: "authorization", value: "fixture"}] else [] end)}]' + return + fi case "$delivered" in yes | missing-on-read) record=retained-id ;; wrong-record) record=other-id ;; @@ -923,8 +1013,46 @@ def walk(self, product, delivered): shift 2 "$@" } +document_view() { + jq -nc --arg digest "$(<"$scratch/digest")" --arg version "$1" \ + '{id:"retained-id", version:{id:$version, status:"ready", expectedDigest:$digest}}' +} +documents_http() { + local request=${@: -2:1} url=${!#} + case "$request $url" in + 'POST http://127.0.0.1:49192/v1/documents') + local expected actual + expected=$(jq -er '.expectedDigest' "$work/document-reserve.json") + actual=$(perl -MDigest::SHA -e 'print "sha256:", Digest::SHA->new(256)->addfile($ARGV[0], "b")->hexdigest' "$work/retained.pdf") + [[ "$expected" == "$actual" ]] + printf '%s' "$expected" >"$scratch/digest" + document=retained-id version=version-id upload=/v1/uploads/abcd/content + printf '%s\n' 'reserve document' >>"$trace" + ;; + 'PUT http://127.0.0.1:49192/v1/uploads/abcd/content') + printf '%s\n' 'upload document' >>"$trace" + ;; + 'GET http://127.0.0.1:49192/v1/documents/retained-id') + printf '%s\n' 'read ready document' >>"$trace" + if [[ "$1" == keep && "$delivered" == changed-after-restart ]]; then + document_view other-version >"$JOURNEY_STEP_STDOUT" + else + document_view version-id >"$JOURNEY_STEP_STDOUT" + fi + ;; + *) return 1 ;; + esac +} journey_http() { JOURNEY_STEP_STDOUT=$scratch/response.json + if [[ "$CELL" == documents ]]; then + case "${!#}" in + http://127.0.0.1:49192/v1/documents* | http://127.0.0.1:49192/v1/uploads/*) + documents_http "$@" + return + ;; + esac + fi case "$1" in call) printf '%s\n' '{}' >"$JOURNEY_STEP_STDOUT" ;; hook) @@ -1006,6 +1134,28 @@ def test_final_step_cannot_be_unexercised(self): self.assertIn("the final step of scheduling cannot be marked unexercised", result.stderr) self.assertEqual(outcomes, []) + def test_documents_keeps_the_same_ready_version_after_one_upload(self): + result, outcomes, trace = self.walk("documents", "yes") + self.assertEqual(result.returncode, 0, result.stdout + result.stderr) + self.assertEqual(outcomes[-4:], [("hook", "pass"), ("keep", "pass"), ("attach", "pass"), ("stop", "pass")]) + self.assertEqual(trace, ["reserve document", "upload document", "poll sink", "read sink", + "read ready document", "read ready document"]) + + def test_documents_refuses_unmatched_capture_or_readback(self): + for delivered, diagnostic in ( + ("no-sink", "did not report its hook sink"), + ("other-version", "did not receive the expected event"), + ("forwarded-auth", "did not receive the expected event"), + ("changed-after-restart", "no longer identifies the ready version"), + ): + with self.subTest(delivered=delivered): + result, outcomes, trace = self.walk("documents", delivered) + self.assertEqual(result.returncode, 3, result.stdout + result.stderr) + self.assertIn(diagnostic, result.stderr) + self.assertNotIn(("keep", "pass"), outcomes) + if delivered == "no-sink": + self.assertEqual(trace, []) + class HookReceiverAndAdapterSource(unittest.TestCase): def test_hook_receiver_signature_verification(self): @@ -1189,6 +1339,32 @@ def test_token_has_audience_and_scope_handles_keycloak_array_and_string_shapes(s ) self.assertEqual(result.returncode == 0, should_pass, f"{label}: {result.stderr}") + def test_breg_keycloak_checks_exact_scope_and_distinguishes_the_unmapped_control(self): + fn = self._extract_functions("breg_keycloak_token_matches") + claims = {"iss": "https://keycloak.example.test", "aud": "urn:example:api", + "azp": "directory-client", "sub": "keycloak-service-account", + "scope": "registry:directory:write"} + mapped = dict(claims, registry_principal="synthetic-directory-editor", + registry_purpose="directory-administration", jurisdiction="zone-a") + for label, payload, control, accepted in ( + ("exact", mapped, False, True), + ("extra scope", {**mapped, "scope": "registry:directory:write profile"}, False, False), + ("wrong zone", {**mapped, "jurisdiction": "zone-b"}, False, False), + ("wrong client", {**mapped, "azp": "foreign-directory-client"}, False, False), + ("unmapped control", claims, True, True), + ("mapped control", mapped, True, False), + ): + with self.subTest(case=label): + result = subprocess.run( + ["bash", "-euo", "pipefail", "-c", fn + '\n' + + 'TOKEN=$1 KC_ISSUER=https://keycloak.example.test SCOPE=registry:directory:write AUDIENCE=urn:example:api\n' + 'breg_keycloak_token_matches TOKEN directory-client keycloak-service-account "$2" "$3"', + "bash", self._encode_payload_for_parser_test(payload), + "" if control else "synthetic-directory-editor", "" if control else "zone-a"], + capture_output=True, text=True, timeout=5, + ) + self.assertEqual(result.returncode == 0, accepted, result.stderr) + def test_assert_wrong_agent_grant_refused_distinguishes_setup_and_credential_errors(self): fn = self._extract_functions("assert_wrong_agent_grant_refused") exact = "Casework refused the grant; check its approval, client, expiry and revocation" diff --git a/products/platform/scripts/check-config-conventions.py b/products/platform/scripts/check-config-conventions.py index 19624d66a8..2cfd646502 100644 --- a/products/platform/scripts/check-config-conventions.py +++ b/products/platform/scripts/check-config-conventions.py @@ -113,7 +113,7 @@ "target", "schema", "reader", "check", "example", "conformance", "securityMembers", "restrictingMembers", ) -OPTIONAL_FORMAT_FIELDS = ("emittedBy", "exceptionClass", "topLevel", "buildArtifact", "notes") +OPTIONAL_FORMAT_FIELDS = ("emittedBy", "exceptionClass", "topLevel", "buildArtifact", "passiveReport", "notes") ENUMS = { "syntax": ("yaml", "json", "jsonl", "text"), "audience": ("authored", "operator", "generated"), @@ -1177,6 +1177,7 @@ def __init__(self, root: Path, report: Report) -> None: self.canonical: dict = {} self.convention: Convention | None = None self.formats: list[dict] = [] + self.passive_reports: set[str] = set() self.by_id: dict[str, dict] = {} self.quantities: list[tuple[str, str, str, str, str]] = [] @@ -1570,11 +1571,36 @@ def check_registry(self, registry: dict) -> None: self.check_target(fid, entry, kinds) self.check_schema_entry(fid, entry) self.check_reader(fid, entry) + writer = None if "emittedBy" in entry: - self.check_symbol(fid, "emittedBy", entry["emittedBy"]) + writer = self.check_symbol(fid, "emittedBy", entry["emittedBy"]) document = self.check_example(fid, entry) entry["_example"] = document schema = self.format_schema(entry) + if "passiveReport" in entry: + if ( + entry["passiveReport"] is True + and entry["audience"] == "generated" + and entry["syntax"] == "json" + and "buildArtifact" not in entry + and writer is not None + and isinstance(schema, dict) + and isinstance(entry["reader"], dict) + and isinstance(entry["check"], str) + and re.fullmatch( + r"rstack dev check --owner-report \{file\} --owner-report-format [a-z][a-z0-9-]*", + entry["check"], + ) + and isinstance(document, dict) + and entry["securityMembers"] == entry["restrictingMembers"] == [] + ): + self.passive_reports.add(fid) + else: + self.error( + f"{fid}: passiveReport requires true on a generated JSON writer report with a schema, " + "a reader and offline rstack owner-report check, a saved example, " + "and no build, security, or restricting members" + ) self.check_conformance(fid, entry, document, schema) self.check_members(fid, entry, schema) for kind, ids in kinds.items(): @@ -1914,14 +1940,15 @@ def find(rule: str, visit: Visit, message: str, fix: str, suffix: tuple[str, ... # do not bound configured work. Reports may state the writer's # native range, but still need both bounds explicitly in schema. output = entry is not None and entry.get("reader") == "none" - implicit = not output and str(node.get("format", "")).startswith("uint") and node.get("minimum") == 0 \ + passive = fid in self.passive_reports + implicit = not (output or passive) and str(node.get("format", "")).startswith("uint") and node.get("minimum") == 0 \ and node.get("maximum", UNSIGNED_CEILING.get(node.get("format"))) == UNSIGNED_CEILING.get(node.get("format")) - has_minimum = ("minimum" in node and not implicit) or "exclusiveMinimum" in node - has_maximum = "maximum" in node or "exclusiveMaximum" in node + has_minimum = ("minimum" in node and not implicit) or (not passive and "exclusiveMinimum" in node) + has_maximum = "maximum" in node or (not passive and "exclusiveMaximum" in node) if not (has_minimum and has_maximum): missing = [bound for bound, present in (("minimum", has_minimum), ("maximum", has_maximum)) if not present] detail = " (minimum 0 is the unsigned type's implicit bound)" if implicit else "" - fix = "State both bounds from the writer's serialized integer type" if output else \ + fix = "State both bounds from the writer's serialized integer type" if output or passive else \ "Read it with BoundedU32/BoundedU64 and state both bounds" find("CFG-QTY-4", visit, f"an integer without a stated {' and '.join(missing)}{detail}", fix) closing = None if visit.conditional else self.closing_problem(document, visit) diff --git a/products/platform/scripts/run-config-conformance.py b/products/platform/scripts/run-config-conformance.py index 7a78f743fe..3dd3867e73 100644 --- a/products/platform/scripts/run-config-conformance.py +++ b/products/platform/scripts/run-config-conformance.py @@ -195,6 +195,8 @@ VARIABLE = "REGISTRY_CONFORMANCE_VALUE" UNSET_VARIABLE = "REGISTRY_CONFORMANCE_UNSET" BASELINE = "baseline" +INTEGER_BOUNDARY_SWEEP = "integer-boundary-sweep" +PASSIVE_REPORT_CASES = frozenset((BASELINE, INTEGER_BOUNDARY_SWEEP)) TIMEOUT_SECONDS = 120 CODE = re.compile(r"^[a-z0-9]+(-[a-z0-9]+)*(\.[a-z0-9]+(-[a-z0-9]+)*)+$") @@ -376,6 +378,7 @@ class Format: harness: dict[str, Any] schema: str | None = None schema_id: str | None = None + passive_report: bool = False def with_harness(self, harness: dict[str, Any]) -> "Format": return dataclasses.replace(self, harness=dict(harness)) @@ -1319,7 +1322,7 @@ def resolve_expected( # Reports -def parse_report(stdout: str) -> tuple[list[Any] | None, list[str]]: +def parse_report(stdout: str, *, passive: bool = False) -> tuple[list[Any] | None, list[str]]: text = stdout.strip() if not text: return None, [NO_REPORT] @@ -1329,6 +1332,8 @@ def parse_report(stdout: str) -> tuple[list[Any] | None, list[str]]: return None, [NOT_ONE_DOCUMENT] if not isinstance(value, dict): return None, [NOT_AN_OBJECT] + if passive and value.get("assessment") != "owner-report-structure": + return None, ["the JSON report has no owner-report-structure assessment"] diagnostics = value.get("diagnostics") if not isinstance(diagnostics, list): return None, [NO_DIAGNOSTICS] @@ -1576,6 +1581,8 @@ def sanitize(text: str, work: str) -> str: def not_applicable(case: Case, fmt: Format) -> str | None: """Why a case does not apply to a format, or None when it does.""" + if fmt.passive_report and case.id not in PASSIVE_REPORT_CASES: + return "a passive JSON report runs the baseline and integer boundary sweep" audiences = case.applies_to.get("audiences") if audiences and fmt.audience not in audiences: return f"the case applies to {' and '.join(audiences)} files" @@ -1596,7 +1603,7 @@ def partition_formats(formats: list[Format]) -> tuple[list[Format], dict[str, st skipped[fmt.id] = "no check command" elif not fmt.example: skipped[fmt.id] = "no example" - elif fmt.syntax != "yaml": + elif fmt.syntax != "yaml" and not (fmt.syntax == "json" and fmt.passive_report): skipped[fmt.id] = f"syntax {fmt.syntax}; the corpus mutates YAML text" else: reached.append(fmt) @@ -1803,6 +1810,7 @@ def load_registry(path: Path) -> list[Format]: harness={}, schema=str(root / schema["path"]) if isinstance(schema.get("path"), str) else None, schema_id=schema["id"] if isinstance(schema.get("id"), str) else None, + passive_report=entry.get("passiveReport") is True, ) ) return formats @@ -2067,7 +2075,7 @@ def check_variant( problems += marker_problems(stdout, stderr) posture_warnings = 0 if case.expect.get("report", True): - diagnostics, report = parse_report(stdout.decode("utf-8", "replace")) + diagnostics, report = parse_report(stdout.decode("utf-8", "replace"), passive=fmt.passive_report) problems += report if diagnostics is not None: compared = diagnostics @@ -2267,7 +2275,16 @@ def plan(root: Path, formats: list[Format], cases: list[Case], harness: dict[str swept: dict[str, dict[str, Case]] = {case.id: {} for case in cases} for fmt in reached: text = prepare_example((root / str(fmt.example)).read_text(encoding="utf-8"), fmt, {}) + if fmt.passive_report: + try: + json.loads(text) + except ValueError: + raise HarnessError(f"{fmt.id}: the passive report example is not JSON") from None for case in cases: + if fmt.passive_report and case.id in PASSIVE_REPORT_CASES: + case = dataclasses.replace( + case, args=[*case.args, "--deny-warnings"], human=case.id == INTEGER_BOUNDARY_SWEEP, + ) why = not_applicable(case, fmt) variants = [] if why is None and case.run is None: @@ -2276,6 +2293,8 @@ def plan(root: Path, formats: list[Format], cases: list[Case], harness: dict[str except NotApplicable as error: why = str(error) if why is not None: + if fmt.passive_report and case.id in PASSIVE_REPORT_CASES: + raise HarnessError(f"{fmt.id}: passive report must exercise {case.id}: {why}") inapplicable[(fmt.id, case.id)] = why elif case.operation == SWEEP: for variant in variants: @@ -2311,6 +2330,9 @@ def validate_ids( """ format_ids = {fmt.id for fmt in formats} case_ids = {case.id for case in cases} + passive = {fmt.id for fmt in formats if fmt.passive_report} + if passive and not PASSIVE_REPORT_CASES <= case_ids: + raise HarnessError("the corpus needs the baseline and integer boundary sweep for passive reports") for format_id in harness: if only_formats is not None and format_id not in only_formats: continue @@ -2321,6 +2343,8 @@ def validate_ids( continue if format_id not in format_ids: raise HarnessError(f"expected-failures.yaml names format {format_id}, which the registry does not") + if format_id in passive: + raise HarnessError(f"passive report {format_id} cannot have an expected-failure waiver") if not names_case(case_id, cases): raise HarnessError(f"expected-failures.yaml names case {case_id}, which the corpus does not") for format_id in expected.unreached: @@ -2328,6 +2352,8 @@ def validate_ids( continue if format_id not in format_ids: raise HarnessError(f"expected-failures.yaml names format {format_id}, which the registry does not") + if format_id in passive: + raise HarnessError(f"passive report {format_id} cannot have an unreached waiver") for case_id in expected.inapplicable: if case_id not in case_ids: raise HarnessError(f"expected-failures.yaml names case {case_id}, which the corpus does not") @@ -2426,8 +2452,9 @@ def report( if args.write_expected_failures: failures, refused = {}, [] + passive = {fmt.id for fmt in work.reached if fmt.passive_report} for cell, problems in results.items(): - if any(unmaskable(problem) for problem in problems): + if problems and (cell[0] in passive or any(unmaskable(problem) for problem in problems)): refused.append(cell) elif problems: failures[cell] = Listed(reason(problems), digest(problems)) diff --git a/products/platform/scripts/test_check_config_conventions.py b/products/platform/scripts/test_check_config_conventions.py index 9ad7790787..d4d0b95a46 100644 --- a/products/platform/scripts/test_check_config_conventions.py +++ b/products/platform/scripts/test_check_config_conventions.py @@ -1198,6 +1198,45 @@ def test_cfg_qty_4_read_back_format_still_requires_semantic_bounds(self) -> None } self.assertFinding(self.repo.run(), "CFG-QTY-4", P, at(PROJECT_SCHEMA, "/$defs/Queue/properties/retryCount")) + def passive_report(self) -> dict: + entry = self.repo.fmt(R) + entry.update( + passiveReport=True, + reader={"crate": "registry-casework-core", "file": CONFIG_RS, "function": "load", "type": "untyped"}, + check="rstack dev check --owner-report {file} --owner-report-format casework-report", + ) + self.repo.report["properties"]["filesChecked"] = { + "type": "integer", "format": "uint64", "minimum": 0, "maximum": 2**64 - 1, + } + return entry + + def test_cfg_qty_4_accepts_explicit_native_passive_report_bounds(self) -> None: + self.passive_report() + report = self.repo.run() + self.assertEqual(report.errors, []) + self.assertNoFinding(report, "CFG-QTY-4") + + def test_cfg_qty_4_passive_report_flag_cannot_exempt_authored_config(self) -> None: + self.passive_report()["audience"] = "authored" + report = self.repo.run() + self.assertTrue(any("passiveReport requires" in error for error in report.errors)) + self.assertFinding(report, "CFG-QTY-4", R, at(REPORT_SCHEMA, "/properties/filesChecked")) + + def test_cfg_qty_4_passive_report_requires_a_maintained_corpus_check(self) -> None: + self.passive_report()["check"] = "true {file}" + report = self.repo.run() + self.assertTrue(any("passiveReport requires" in error for error in report.errors)) + self.assertFinding(report, "CFG-QTY-4", R, at(REPORT_SCHEMA, "/properties/filesChecked")) + + def test_cfg_qty_4_passive_report_still_requires_both_bounds(self) -> None: + self.passive_report() + fields = self.repo.report["properties"]["filesChecked"] + for bound in ("minimum", "maximum"): + with self.subTest(bound=bound): + value = fields.pop(bound) + self.assertFinding(self.repo.run(), "CFG-QTY-4", R, at(REPORT_SCHEMA, "/properties/filesChecked")) + fields[bound] = value + def test_cfg_qty_4_accepts_a_bounded_type_whose_stated_minimum_is_zero(self) -> None: self.queue()["leewayMilliseconds"] = {"type": "integer", "format": "uint64", "minimum": 0, "maximum": 300000} self.assertNoFinding(self.repo.run(), "CFG-QTY-4") diff --git a/products/platform/scripts/test_run_config_conformance.py b/products/platform/scripts/test_run_config_conformance.py index 10237499aa..51c376a8c8 100644 --- a/products/platform/scripts/test_run_config_conformance.py +++ b/products/platform/scripts/test_run_config_conformance.py @@ -2208,6 +2208,45 @@ def setUp(self) -> None: self.cases = runner.load_cases(self.corpus / "cases") self.registry = runner.load_registry(ROOT / runner.REGISTRY) + def test_passive_casework_report_has_a_positive_and_both_integer_controls(self) -> None: + fmt = next(fmt for fmt in self.registry if fmt.id == "casework/report") + plan = runner.plan(ROOT, [fmt], self.cases, runner.load_harness(self.corpus / "formats.yaml")) + self.assertEqual([fmt.id], [item.id for item in plan.reached]) + self.assertNotIn(fmt.id, plan.skipped) + cells = {case.id: case for _, case in plan.cells} + self.assertEqual(set(cells), {"baseline", "integer-boundary-sweep"}) + source = (ROOT / fmt.example).read_text(encoding="utf-8") + bounds = cells["integer-boundary-sweep"] + mutations = runner.mutate(source, bounds.mutation, fmt) + self.assertIn("--deny-warnings", bounds.args) + observed = {(mutation.sites[0].values["pointer"], json.loads(mutation.text)["claims"]) + for mutation in mutations if mutation.sites[0].values["pointer"] == "/claims"} + self.assertEqual(observed, {("/claims", -1), ("/claims", 4294967296)}) + + def test_passive_report_cannot_have_a_corpus_waiver(self) -> None: + fmt = next(fmt for fmt in self.registry if fmt.id == "casework/report") + for expected in ( + runner.ExpectedFailures({(fmt.id, "baseline"): runner.Listed("fixture", "test")}, {}, {}), + runner.ExpectedFailures({}, {fmt.id: "fixture"}, {}), + ): + with self.assertRaisesRegex(runner.HarnessError, "passive report.*cannot"): + runner.validate_ids(expected, self.registry, self.cases, {}) + + def test_passive_report_check_that_always_accepts_fails_the_executable_corpus(self) -> None: + with tempfile.TemporaryDirectory() as directory: + binary = Path(directory) / "rstack" + binary.write_text( + f"#!{sys.executable}\nprint('{{\"assessment\":\"owner-report-structure\",\"diagnostics\":[]}}')\n", + encoding="utf-8", + ) + binary.chmod(0o755) + stdout = io.StringIO() + with redirect_stdout(stdout): + exit_code = runner.main(["--bin-dir", directory, "--only-format", "casework/report", "--matrix"]) + self.assertEqual(exit_code, 1, stdout.getvalue()) + self.assertIn("casework/report\tbaseline\tpass", stdout.getvalue()) + self.assertIn("casework/report\tinteger-boundary-sweep\tfail", stdout.getvalue()) + def test_cfg_check_3_every_case_cites_known_rules(self) -> None: convention = (ROOT / "products/platform/CONFIG-CONVENTIONS.md").read_text(encoding="utf-8") known = set(re.findall(r"^\*\*(CFG-[A-Z]+-[0-9]+) \(", convention, re.MULTILINE)) diff --git a/products/scheduling/AGENTS.md b/products/scheduling/AGENTS.md index 3d3e965425..dff3278c03 100644 --- a/products/scheduling/AGENTS.md +++ b/products/scheduling/AGENTS.md @@ -33,13 +33,12 @@ product. Document Store, Evidence, or Messaging crate, and none of those products reach a scheduling crate. Run `scripts/check_dependency_direction.py` after dependency changes. -- Each directory under `examples/` is exactly what `schedulingctl init` writes - for the template with the same name (the `resource-reservations` example also - keeps a README the template does not write), and the checkpoint fails if any - of the three pairs drifts apart. When `schedulingctl init` starts emitting or - changing a file, copy that output into every applicable committed example - (`standalone-exact-time`, `standalone-arrival-window`, and - `resource-reservations`) in the same commit. +- The three starter directories under `examples/` are the checked snapshots + for `schedulingctl init` on 2026-10-01. The `resource-reservations` example + also keeps a README the template does not write. The CLI test checks the + exact snapshot bytes and the checkpoint verifies both fresh and committed + projects. When `init` changes a file, keep each applicable snapshot in + sync and date its fixture cases relative to the fixture clock. - Keep authored examples and the checkpoint demo small. Do not add a later-wave surface to close a documentation obligation; record the exclusion instead. diff --git a/products/scheduling/README.md b/products/scheduling/README.md index 7081d86d31..f68d9557aa 100644 --- a/products/scheduling/README.md +++ b/products/scheduling/README.md @@ -73,8 +73,10 @@ serves the runtime on loopback. See `products/scheduling/demo/README.md`. - `contracts/`: the security invariant matrix, its test traceability, and recorded decisions. - `examples/`: `standalone-exact-time`, `standalone-arrival-window`, and `resource-reservations` - are what `schedulingctl init --template ` writes, and `formats/` holds a sample - `schedulingctl` report. The `resource-reservations` example also keeps a README. + are snapshots of `schedulingctl init --template ` as of 2026-10-01. Their five fixtures + replay against their declared clocks. Run `init` for live supply dated from the day you create + a project. `formats/` holds a sample `schedulingctl` report, and `resource-reservations` also + keeps a README. - `generated/`: the OpenAPI description and the JSON Schemas derived from the Rust types. Do not edit them by hand. - `demo/`: the acceptance demo. @@ -99,9 +101,9 @@ cargo build --locked -p registry-schedulingctl products/scheduling/scripts/check-checkpoint.sh ``` -`examples/standalone-exact-time/` is exactly what -`schedulingctl init --template standalone-exact-time` writes, and the checkpoint fails if the two -drift apart. +The checkpoint checks and replays all three committed examples and freshly initialized projects. +The CLI unit test verifies that initialization on the reference date reproduces the example files +byte for byte. For PostgreSQL execution, the destructive test suites require a separate disposable database and the `postgres-test` feature: diff --git a/products/scheduling/scripts/check-checkpoint.sh b/products/scheduling/scripts/check-checkpoint.sh index 80373a5067..dc4da027f8 100755 --- a/products/scheduling/scripts/check-checkpoint.sh +++ b/products/scheduling/scripts/check-checkpoint.sh @@ -41,8 +41,51 @@ cleanup() { } trap cleanup EXIT HUP INT TERM -for template in standalone-exact-time standalone-arrival-window; do +for template in standalone-exact-time standalone-arrival-window resource-reservations; do + init_before=$(date -u +%Y-%m-%d) "$schedulingctl_bin" init "$work/$template" --template "$template" >/dev/null + init_after=$(date -u +%Y-%m-%d) + # Accept either UTC day if init crosses midnight. Replay uses fixture + # clocks and the later snapshot comparison deliberately ignores dates. + python3 - "$work/$template" "$init_before" "$init_after" <<'PY' +import sys +from datetime import date, timedelta +from pathlib import Path + +import yaml + +project = Path(sys.argv[1]) +first_day, last_day = sorted(date.fromisoformat(day) for day in sys.argv[2:]) +records = yaml.safe_load((project / "records.yaml").read_text(encoding="utf-8")) + +def require(condition, detail): + if not condition: + sys.exit(f"{project.name}: {detail} for UTC init dates {first_day} to {last_day}") + +if project.name == "standalone-arrival-window": + starts = {window["start"].date() for window in records["windows"]} + require(len(starts) == 1, "arrival windows must share one date") + start = starts.pop() + earliest = first_day + timedelta(days=7) + latest = last_day + timedelta(days=13) + require(start.weekday() == 5 and earliest <= start <= latest, + "arrival windows are outside the starter date range") +else: + openings = yaml.safe_load((project / "scheduling.yaml").read_text(encoding="utf-8"))["openings"] + if project.name == "standalone-exact-time": + opening = openings["bangkok-counter-hours"] + future_day = openings["new-york-hall-hours"]["effectiveFrom"] + label = "New York fold opening" + else: + opening = openings["hall-hours"] + maintenance = next(item for item in records["exceptions"] if item["id"] == "maintenance-day") + future_day = maintenance["date"] + label = "New York maintenance closure" + first_covered = max(first_day, date.fromisoformat(opening["effectiveFrom"])) + last_covered = min(last_day, date.fromisoformat(opening["effectiveUntil"])) + require(first_covered <= last_covered, "regular opening does not cover initialization") + require(date.fromisoformat(future_day) > first_covered, f"{label} is stale") +PY "$schedulingctl_bin" check "$work/$template" >/dev/null "$schedulingctl_bin" test "$work/$template" >/dev/null "$schedulingctl_bin" explain "$work/$template" >/dev/null @@ -153,14 +196,31 @@ if [ "$written" != "$sums_digest" ]; then exit 1 fi -# The committed examples are the starter templates' output, so neither can -# drift from what an adopter initializes, including its live records document. +# The committed examples match what an adopter initializes, with the live +# and fixture dates shifted from the snapshot to the day of init. The CLI +# unit test compares the exact bytes with init pinned to the snapshot date. # The resource-reservations example also carries a README, which the template # does not write, so the comparison excludes that one file. for template in standalone-exact-time standalone-arrival-window resource-reservations; do example="$repo_root/products/scheduling/examples/$template" - "$schedulingctl_bin" init "$work/example-$template" --template "$template" >/dev/null - diff -r -x README.md "$work/example-$template" "$example" >/dev/null + python3 - "$work/$template" "$example" <<'PY' +import re +import sys +from pathlib import Path + +date = re.compile(rb"(?", path.read_bytes()) + for path in root.rglob("*") if path.is_file() and path.name != "README.md" + } + +fresh, snapshot = (files(Path(root)) for root in sys.argv[1:]) +for path in sorted(fresh.keys() | snapshot.keys()): + if fresh.get(path) != snapshot.get(path): + sys.exit(f"{sys.argv[2]}/{path}: starter differs from snapshot after masking dates") +PY "$schedulingctl_bin" check "$example" >/dev/null "$schedulingctl_bin" test "$example" >/dev/null done diff --git a/release/VERIFY.md b/release/VERIFY.md index 305ef1785a..afce0e149b 100644 --- a/release/VERIFY.md +++ b/release/VERIFY.md @@ -284,8 +284,10 @@ Registry Adapter binaries join in `v0.46.0`, as set by `ADAPTER_IMAGE_FIRST_RELEASE` is unset. The Registry Document Store is held out of every release while `DOCUMENTS_FIRST_RELEASE` is `None`, and no release roster names it. -The session service is held out while `SESSION_FIRST_RELEASE` is `None`. -No release script builds, stages or publishes `registry-session` yet. +`SESSION_FIRST_RELEASE` controls the `registry-session` binary for numbered +Linux amd64, Linux arm64 and macOS arm64 payloads. It remains unset pending +native release qualification. Session has no image or installer in this +roster, and the frozen nightly profiles keep their existing inventory. `BREG_SERVICES_FIRST_RELEASE`, `MESSAGING_FIRST_RELEASE`, `RENDER_FIRST_RELEASE`, `EVIDENCE_OID4VCI_IMAGE_FIRST_RELEASE`, and the three Coordinator release constants in `release/scripts/release_roster.py` diff --git a/release/scripts/build-additional-platform-binaries.sh b/release/scripts/build-additional-platform-binaries.sh index b369c3007e..bdc507225f 100644 --- a/release/scripts/build-additional-platform-binaries.sh +++ b/release/scripts/build-additional-platform-binaries.sh @@ -18,7 +18,11 @@ if [[ "$#" == 6 ]]; then exclude_discovery=1 fi repo_root="$(git rev-parse --show-toplevel)" -builds="$(python3 "${repo_root}/release/scripts/release_roster.py" additional-platform-builds "${version}")" +roster_flags=() +if [[ "${tag}" == "v${version}-nightly."* ]]; then + roster_flags+=(--nightly) +fi +builds="$(python3 "${repo_root}/release/scripts/release_roster.py" additional-platform-builds "${version}" "${roster_flags[@]}")" cargo_bin="${CARGO:-cargo}" if [[ -z "${builds}" ]]; then exit 0 diff --git a/release/scripts/build-nightly-linux-arm64.sh b/release/scripts/build-nightly-linux-arm64.sh index d8d24c50f9..d9638ecb2f 100644 --- a/release/scripts/build-nightly-linux-arm64.sh +++ b/release/scripts/build-nightly-linux-arm64.sh @@ -65,7 +65,7 @@ from pathlib import Path sys.path.insert(0, str(Path('release/scripts').resolve())) from release_candidate import _release_payload_inventory version, tag, target = sys.argv[1:] -for asset, kind in _release_payload_inventory(version).items(): +for asset, kind in _release_payload_inventory(version, nightly=True).items(): if kind != 'binary' or not asset.endswith('-linux-arm64'): continue binary = asset.split(f'-v{version}-', 1)[0] diff --git a/release/scripts/build-release-binaries.sh b/release/scripts/build-release-binaries.sh index 38c0a931ed..778eed9208 100755 --- a/release/scripts/build-release-binaries.sh +++ b/release/scripts/build-release-binaries.sh @@ -165,6 +165,10 @@ include_coordinator_image=0 if [[ "$(python3 "${script_dir}/release_roster.py" coordinator-in-release "${version}")" == true ]]; then include_coordinator_image=1 fi +include_session=0 +if [[ -z "${nightly_tag}" && "$(python3 "${script_dir}/release_roster.py" session-in-release "${version}")" == true ]]; then + include_session=1 +fi # Adapter binaries have an independent boundary from image publication. include_adapter=0 adapter_in_release="$(python3 "${script_dir}/release_roster.py" \ @@ -358,6 +362,13 @@ build_payload() { fi fi + if [[ "${include_session}" -eq 1 ]]; then + cargo build --release --locked -p registry-session --bin registry-session + cp target/release/registry-session "dist/bin/registry-session-${RELEASE_TAG}-linux-amd64" + check_version "dist/bin/registry-session-${RELEASE_TAG}-linux-amd64" \ + "registry-session ${RELEASE_TAG#v}" + fi + # One invocation per binary keeps each product's feature boundary. if [[ "${include_adapter}" -eq 1 ]]; then cargo build --release --locked \ @@ -729,6 +740,9 @@ if [[ "${group}" == all || "${group}" == core ]]; then image_bin_binaries+=(coordinator coordinatorctl) fi fi + if [[ "${include_session}" -eq 1 ]]; then + bin_assets+=("registry-session-${tag}-linux-amd64") + fi if [[ "${include_adapter}" -eq 1 ]]; then bin_assets+=( "adapter-${tag}-linux-amd64" diff --git a/release/scripts/build-release-native-platform.sh b/release/scripts/build-release-native-platform.sh index 6d029cb95f..fac430bf27 100755 --- a/release/scripts/build-release-native-platform.sh +++ b/release/scripts/build-release-native-platform.sh @@ -343,7 +343,11 @@ build_scheduling() { check_version "schedulingctl ${display_version}" } -additional_platform_builds="$(python3 "${repo_root}/release/scripts/release_roster.py" additional-platform-builds "${version}")" +roster_flags=() +if [[ -n "${nightly_tag}" ]]; then + roster_flags+=(--nightly) +fi +additional_platform_builds="$(python3 "${repo_root}/release/scripts/release_roster.py" additional-platform-builds "${version}" "${roster_flags[@]}")" if [[ "${exclude_discovery}" -eq 1 ]]; then filtered_platform_builds="" while read -r package binary; do diff --git a/release/scripts/merge-release-binary-shards.py b/release/scripts/merge-release-binary-shards.py index f0bd56741d..5607bf7686 100755 --- a/release/scripts/merge-release-binary-shards.py +++ b/release/scripts/merge-release-binary-shards.py @@ -141,6 +141,8 @@ def rosters( f"coordinatorctl-{tag}-linux-amd64", ] ) + if nightly_tag is None and release_roster.session_in_release(parsed): + common.append(f"registry-session-{tag}-linux-amd64") if release_roster.adapter_in_release(parsed): common.extend( [ diff --git a/release/scripts/merge-release-native-platform-shards.py b/release/scripts/merge-release-native-platform-shards.py index 7d240445ec..9927c627c5 100755 --- a/release/scripts/merge-release-native-platform-shards.py +++ b/release/scripts/merge-release-native-platform-shards.py @@ -82,7 +82,7 @@ def rosters( core.insert(0, f"relayctl-{tag}-{ASSET}") if parsed >= MINT_RETIREMENT_VERSION: core.remove(f"mint-{tag}-{ASSET}") - additional = release_roster.additional_platform_builds(parsed) + additional = release_roster.additional_platform_builds(parsed, nightly=nightly_tag is not None) additional_core = [ f"{binary}-{tag}-{ASSET}" for _, binary in additional diff --git a/release/scripts/nightly_release.py b/release/scripts/nightly_release.py index 5544fa6f49..98a9ee6c56 100644 --- a/release/scripts/nightly_release.py +++ b/release/scripts/nightly_release.py @@ -641,7 +641,7 @@ def assemble( expected_roster = current_roster(base, record["tag"]) if record.get("schema_version") != SCHEMA_V2 or record.get("roster") != expected_roster: raise NightlyError("build plan source roster mismatch") - release_assets = release_candidate._release_payload_inventory(base) + release_assets = release_candidate._release_payload_inventory(base, nightly=True) for name, kind in release_assets.items(): if kind == "notice": notice = ROOT / name diff --git a/release/scripts/registry-release b/release/scripts/registry-release index 0dcfd38f41..4565d23fcd 100755 --- a/release/scripts/registry-release +++ b/release/scripts/registry-release @@ -295,6 +295,8 @@ def artifact_inventory_errors(version: str, artifacts: dict[Any, Any]) -> list[s expected_inventory.add("registry-render") if release_roster.coordinator_binaries_in_release(parsed_version): expected_inventory.update({"coordinator", "coordinatorctl"}) + if release_roster.session_in_release(parsed_version): + expected_inventory.add("registry-session") if release_roster.adapter_in_release(parsed_version): expected_inventory.update({"adapter", "adapterctl"}) if release_roster.rstack_in_release(parsed_version): diff --git a/release/scripts/release_candidate.py b/release/scripts/release_candidate.py index 71b4639d2d..47af0ecffc 100644 --- a/release/scripts/release_candidate.py +++ b/release/scripts/release_candidate.py @@ -374,7 +374,7 @@ def _version_uses_release_docs(version: tuple[int, int, int]) -> bool: return version >= DOCS_RELEASE_RESUMPTION_VERSION -def _release_payload_inventory(version: str) -> dict[str, str]: +def _release_payload_inventory(version: str, *, nightly: bool = False) -> dict[str, str]: tag = f"v{version}" version_tuple = tuple(int(part) for part in version.split(".")) inventory = { @@ -538,7 +538,7 @@ def _release_payload_inventory(version: str) -> dict[str, str]: inventory[f"registry-language-server-{tag}-macos-arm64"] = "binary" if version_tuple >= THIRD_PARTY_NOTICES_MINIMUM_VERSION: inventory["THIRD_PARTY_NOTICES"] = "notice" - for _, binary in release_roster.additional_platform_builds(version_tuple): + for _, binary in release_roster.additional_platform_builds(version_tuple, nightly=nightly): for platform in ("linux-amd64", "linux-arm64", "macos-arm64"): inventory[f"{binary}-{tag}-{platform}"] = "binary" for installer in release_roster.additional_installers(version_tuple): diff --git a/release/scripts/release_roster.py b/release/scripts/release_roster.py index e5b7b98d5d..f3ec613e85 100644 --- a/release/scripts/release_roster.py +++ b/release/scripts/release_roster.py @@ -69,8 +69,8 @@ it is releasable. ``SESSION_FIRST_RELEASE`` decides which numbered release first includes the -``registry-session`` binary in the native platform builds. The service stays -held while the release gate is unset. +``registry-session`` binary in the native platform builds. Its image and +the frozen nightly inventories are independent of this gate. ``PYTHON_311_ABI_FIRST_RELEASE`` is the single place that decides which release first builds the Python client wheels against the Python 3.11 stable @@ -153,7 +153,7 @@ } -def additional_platform_builds(version: tuple[int, int, int]): +def additional_platform_builds(version: tuple[int, int, int], *, nightly: bool = False): """Return the additional native binaries without changing historical releases.""" if tuple(version) < ALL_PLATFORMS_FIRST_RELEASE: return () @@ -164,7 +164,7 @@ def additional_platform_builds(version: tuple[int, int, int]): "registry-discoveryctl": discoveryctl_in_release(version), "registry-render": render_in_release(version), "registry-coordinator": coordinator_binaries_in_release(version), - "registry-session": session_in_release(version), + "registry-session": not nightly and session_in_release(version), "registry-adapter": adapter_in_release(version), "registry-adapterctl": adapter_in_release(version), } @@ -373,6 +373,10 @@ def main(argv: list[str] | None = None) -> int: commands = parser.add_subparsers(dest="command", required=True) platforms = commands.add_parser("additional-platform-builds") platforms.add_argument("version", type=version_argument) + platforms.add_argument("--nightly", action="store_true") + session = commands.add_parser("session-in-release") + session.add_argument("version", type=version_argument) + session.set_defaults(in_release=session_in_release) coordinator_binaries = commands.add_parser("coordinator-binaries-in-release") coordinator_binaries.add_argument("version", type=version_argument) coordinator_binaries.set_defaults(in_release=coordinator_binaries_in_release) @@ -482,7 +486,7 @@ def main(argv: list[str] | None = None) -> int: relay.set_defaults(in_release=relay_in_release) args = parser.parse_args(argv) if args.command == "additional-platform-builds": - for crate, binary in additional_platform_builds(args.version): + for crate, binary in additional_platform_builds(args.version, nightly=args.nightly): print(crate, binary) return 0 print("true" if args.in_release(args.version) else "false") diff --git a/release/scripts/test_merge_release_binary_shards.py b/release/scripts/test_merge_release_binary_shards.py index 3b4afb7b3c..010b140f90 100644 --- a/release/scripts/test_merge_release_binary_shards.py +++ b/release/scripts/test_merge_release_binary_shards.py @@ -75,6 +75,18 @@ def digest(data: bytes) -> str: class MergeReleaseBinaryShardsTest(unittest.TestCase): + def test_session_is_a_numbered_core_binary_and_has_no_image(self) -> None: + version = "0.51.0" + nightly_tag = f"v{version}-nightly.20261201.{SOURCE_SHA}" + with mock.patch.object(MODULE.release_roster, "SESSION_FIRST_RELEASE", (0, 51, 0)): + past, _ = MODULE.rosters("0.50.0") + numbered, images = MODULE.rosters(version) + nightly, _ = MODULE.rosters(version, nightly_tag) + self.assertNotIn("registry-session-v0.50.0-linux-amd64", past["core"]) + self.assertIn("registry-session-v0.51.0-linux-amd64", numbered["core"]) + self.assertNotIn(f"registry-session-{nightly_tag}-linux-amd64", nightly["core"]) + self.assertNotIn("registry-session", dict(images)) + def setUp(self) -> None: self.temporary = tempfile.TemporaryDirectory() self.addCleanup(self.temporary.cleanup) diff --git a/release/scripts/test_nightly_release.py b/release/scripts/test_nightly_release.py index d2232057fa..f1c958abca 100644 --- a/release/scripts/test_nightly_release.py +++ b/release/scripts/test_nightly_release.py @@ -48,6 +48,20 @@ class NightlyTest(unittest.TestCase): + def test_numbered_session_does_not_change_frozen_nightly_inventory(self): + version = "0.51.0" + tag = f"v{version}-nightly.20261201.{SHA}" + before = nightly.current_roster(version, tag) + with patch.object(nightly.release_roster, "SESSION_FIRST_RELEASE", (0, 51, 0)): + self.assertEqual(before, nightly.current_roster(version, tag)) + inventory = release_candidate._release_payload_inventory(version, nightly=True) + expected = sorted( + name.replace(f"v{version}", tag) + for name, kind in inventory.items() + if kind in {"binary", "notice"} + ) + self.assertEqual(before["payloads"], expected) + def test_current_platform_roster_preserves_historical_manifest_meaning(self): tag = f"v0.44.0-nightly.20261023.{SHA}" roster = nightly.current_roster("0.44.0", tag) diff --git a/release/scripts/test_registry_release.py b/release/scripts/test_registry_release.py index 24430a3409..ca17511f45 100755 --- a/release/scripts/test_registry_release.py +++ b/release/scripts/test_registry_release.py @@ -4119,6 +4119,15 @@ def released(version: str) -> dict[str, str]: [], module.artifact_inventory_errors("0.42.0", incomplete) ) + before_session = released("0.50.0") + at_session = released("0.51.0") + session = "registry-session" + with mock.patch.object(module.release_roster, "SESSION_FIRST_RELEASE", (0, 51, 0)): + self.assertEqual([], module.artifact_inventory_errors("0.50.0", before_session)) + self.assertTrue(module.artifact_inventory_errors("0.50.0", before_session | {session: "0.50.0"})) + self.assertTrue(module.artifact_inventory_errors("0.51.0", at_session)) + self.assertEqual([], module.artifact_inventory_errors("0.51.0", at_session | {session: "0.51.0"})) + # Holding the image does not hold the independently released binaries. with mock.patch.object( module.release_roster, "COORDINATOR_FIRST_RELEASE", None diff --git a/release/scripts/test_release_native_platform.py b/release/scripts/test_release_native_platform.py index a8a640255d..5ee6bd57c1 100755 --- a/release/scripts/test_release_native_platform.py +++ b/release/scripts/test_release_native_platform.py @@ -281,10 +281,9 @@ def setUp(self) -> None: self.fake_codesign.chmod(0o755) def roster_shim( - self, stem: str, first_release: tuple[int, int, int] + self, stem: str, first_releases: dict[str, tuple[int, int, int]] ) -> Path: - """Return a directory whose python3 answers the roster as if it named - ``first_release``, and runs every other command unchanged.""" + """Run the real roster with fixture gates and pass through other commands.""" shim_dir = self.root / f"{stem}-roster-shim" shim_dir.mkdir() shim = shim_dir / "python3" @@ -298,12 +297,12 @@ def roster_shim( if ( len(args) >= 2 and args[0].endswith("/release_roster.py") - and args[1] == "breg-services-in-release" ): spec = importlib.util.spec_from_file_location("release_roster", args[0]) roster = importlib.util.module_from_spec(spec) spec.loader.exec_module(roster) - roster.BREG_SERVICES_FIRST_RELEASE = {first_release!r} + for constant, first_release in {first_releases!r}.items(): + setattr(roster, constant, first_release) sys.exit(roster.main(args[1:])) os.execv({sys.executable!r}, [{sys.executable!r}, *args]) """, @@ -326,6 +325,7 @@ def build( missing_fips_binary: str | None = None, nightly_tag: str | None = None, breg_services_first_release: tuple[int, int, int] | None = None, + session_first_release: tuple[int, int, int] | None = None, exclude_discovery: bool = False, ) -> tuple[subprocess.CompletedProcess[str], Path, list[list[str]]]: stem = name or group @@ -348,8 +348,14 @@ def build( environment["FAKE_CARGO_FAIL_CALL"] = str(fail_call) if binary_version is not None: environment["FAKE_BINARY_VERSION"] = binary_version - if breg_services_first_release is not None: - shim_dir = self.roster_shim(stem, breg_services_first_release) + first_releases = { + name: value for name, value in ( + ("BREG_SERVICES_FIRST_RELEASE", breg_services_first_release), + ("SESSION_FIRST_RELEASE", session_first_release), + ) if value is not None + } + if first_releases: + shim_dir = self.roster_shim(stem, first_releases) environment["PATH"] = f"{shim_dir}{os.pathsep}{environment['PATH']}" parsed = tuple(int(part) for part in version.split(".")) if fips_shared or parsed >= (0, 33, 0): @@ -371,6 +377,7 @@ def build( "registry-render", "coordinator", "coordinatorctl", + "registry-session", "adapter", "adapterctl", ] @@ -525,6 +532,32 @@ def test_nightly_language_server_keeps_its_cargo_version(self): ).is_file() ) + def test_session_numbered_archive_is_built_and_nightly_archive_is_omitted(self): + version = "0.51.0" + first_release = (0, 51, 0) + numbered_tag = f"v{version}" + nightly_tag = f"{numbered_tag}-nightly.20261201.{SOURCE_SHA}" + asset = f"registry-session-{numbered_tag}-macos-arm64.tar.gz" + with mock.patch.object(MODULE.release_roster, "SESSION_FIRST_RELEASE", first_release): + result, output, _ = self.build( + "core", name="session-numbered", version=version, session_first_release=first_release, + ) + self.assertEqual(0, result.returncode, result.stderr) + self.assertIn(asset, MODULE.rosters(version)["core"]) + with tarfile.open(output / "platform" / asset, "r:gz") as package: + self.assertEqual( + [asset.removesuffix(".tar.gz"), "libaws_lc_fips_0_14_2_crypto.dylib", "THIRD_PARTY_NOTICES"], + package.getnames(), + ) + result, output, calls = self.build( + "core", name="session-nightly", version=version, nightly_tag=nightly_tag, + session_first_release=first_release, + ) + self.assertEqual(0, result.returncode, result.stderr) + self.assertFalse(any("registry-session" in call for call in calls)) + paths = [path.name for path in (output / "platform").iterdir()] + self.assertCountEqual(paths, MODULE.rosters(version, nightly_tag)["core"]) + def test_v0_44_core_bundles_and_launches_every_additional_native_binary(self): result, output, calls = self.build("core", version="0.44.0") self.assertEqual(0, result.returncode, result.stderr) diff --git a/release/scripts/test_release_roster.py b/release/scripts/test_release_roster.py index 417d9e9cb8..ef760bad06 100644 --- a/release/scripts/test_release_roster.py +++ b/release/scripts/test_release_roster.py @@ -131,6 +131,15 @@ def test_session_first_release_adds_its_native_binary_to_the_roster(self) -> Non self.assertNotIn(binary, release_roster.additional_platform_builds((0, 50, 0))) self.assertTrue(release_roster.session_in_release((0, 51, 0))) self.assertIn(binary, release_roster.additional_platform_builds((0, 51, 0))) + self.assertNotIn(binary, release_roster.additional_platform_builds((0, 51, 0), nightly=True)) + for arguments, expected in ( + (["session-in-release", "0.50.0"], "false\n"), + (["session-in-release", "0.51.0"], "true\n"), + ): + stdout = io.StringIO() + with redirect_stdout(stdout): + self.assertEqual(0, release_roster.main(arguments)) + self.assertEqual(expected, stdout.getvalue()) def test_coordinator_binary_release_does_not_release_its_image(self): self.assertFalse(release_roster.coordinator_binaries_in_release((0, 43, 99))) From 18d6381c5c16fbd88aa296fd0c20b938d8f0d3fa Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 16/55] feat(session): export routes from checked standalone HTTPS Folds these reviewed commits: - feat(session): export routes from checked standalone HTTPS - docs: explain when to choose a service function or flow - docs(breg): reach a business preview from BReg Start - feat(deploy): add business registration reference host - fix(deploy): require checked route export before starting Envoy - docs(coordinator): align route labels with OpenAPI - test(coordinator): check transform fields in the configuration reference Signed-off-by: Jeremi Joslin --- crates/registry-rstack/src/cli.rs | 10 +- crates/registry-session/src/gateway.rs | 17 +- crates/registry-session/src/gateway/verify.rs | 369 ++++++++++++++++-- crates/registry-session/src/lib.rs | 31 ++ crates/registry-session/src/main.rs | 19 +- crates/registry-session/tests/binary.rs | 133 +++++++ .../business-registration/.dockerignore | 5 + .../examples/business-registration/Dockerfile | 7 + .../examples/business-registration/README.md | 178 +++++++++ .../business-registration/breg-runtime.yaml | 43 ++ .../business-registration/check-gateway.sh | 22 ++ .../business-registration/compose.yaml | 236 +++++++++++ .../examples/business-registration/edge.yaml | 128 ++++++ .../examples/business-registration/host.mjs | 132 +++++++ .../identity-deployment.yaml | 28 ++ .../business-registration/init-postgres.sh | 25 ++ .../business-registration/issuer-ready.mjs | 34 ++ .../business-registration/package-lock.json | 28 ++ .../business-registration/package.json | 7 + .../business-registration/pg_hba.conf | 3 + .../business-registration/session.yaml | 54 +++ .../business-registration/tests/host.test.mjs | 69 ++++ .../business-registration/tests/smoke.sh | 33 ++ .../tests/test_compose.py | 84 ++++ .../tests/test_gateway_check.py | 81 ++++ .../business-registration/thunderid.sh | 41 ++ .../business-registration/thunderid.yaml | 57 +++ .../business-registration/upstreams.yaml | 63 +++ docs/site/astro.config.mjs | 1 + ...enerate-coordinator-configuration.test.mjs | 3 +- .../scripts/information-architecture.test.mjs | 16 + .../run-a-project-with-rstack-dev.mdx | 41 +- .../src/content/docs/configure/session.mdx | 28 ++ .../src/content/docs/security/session.mdx | 3 + docs/site/src/content/docs/start/adopt.mdx | 39 +- .../content/docs/start/breg-quickstart.mdx | 2 + .../docs/tutorials/preview-a-breg-service.mdx | 113 ++++++ docs/site/src/data/coordinator-api.yaml | 16 +- 38 files changed, 2130 insertions(+), 69 deletions(-) create mode 100644 deploy/examples/business-registration/.dockerignore create mode 100644 deploy/examples/business-registration/Dockerfile create mode 100644 deploy/examples/business-registration/README.md create mode 100644 deploy/examples/business-registration/breg-runtime.yaml create mode 100644 deploy/examples/business-registration/check-gateway.sh create mode 100644 deploy/examples/business-registration/compose.yaml create mode 100644 deploy/examples/business-registration/edge.yaml create mode 100644 deploy/examples/business-registration/host.mjs create mode 100644 deploy/examples/business-registration/identity-deployment.yaml create mode 100755 deploy/examples/business-registration/init-postgres.sh create mode 100644 deploy/examples/business-registration/issuer-ready.mjs create mode 100644 deploy/examples/business-registration/package-lock.json create mode 100644 deploy/examples/business-registration/package.json create mode 100644 deploy/examples/business-registration/pg_hba.conf create mode 100644 deploy/examples/business-registration/session.yaml create mode 100644 deploy/examples/business-registration/tests/host.test.mjs create mode 100755 deploy/examples/business-registration/tests/smoke.sh create mode 100644 deploy/examples/business-registration/tests/test_compose.py create mode 100644 deploy/examples/business-registration/tests/test_gateway_check.py create mode 100644 deploy/examples/business-registration/thunderid.sh create mode 100644 deploy/examples/business-registration/thunderid.yaml create mode 100644 deploy/examples/business-registration/upstreams.yaml create mode 100644 docs/site/src/content/docs/tutorials/preview-a-breg-service.mdx diff --git a/crates/registry-rstack/src/cli.rs b/crates/registry-rstack/src/cli.rs index 543b749c55..e3f52b7fe9 100644 --- a/crates/registry-rstack/src/cli.rs +++ b/crates/registry-rstack/src/cli.rs @@ -296,7 +296,9 @@ enum DevCommand { /// Root of an already-built local application when dev.yaml declares one. #[arg(long, value_name = "DIRECTORY")] application_root: Option, - /// PostgreSQL administrator URL (verified TLS, or loopback with sslmode=disable). + /// PostgreSQL administrator URL. Defaults to verified TLS. For development, select + /// loopback plaintext with sslmode=disable or private network plaintext with + /// transport=private-network-plaintext. /// Defaults to RSTACK_DEV_DATABASE_URL; without either, the run starts its own /// PostgreSQL server in Docker. #[arg(long, value_name = "URL")] @@ -353,9 +355,9 @@ enum DevCommand { /// Remove the project's managed PostgreSQL volume and state after stopping. #[arg(long, conflicts_with = "recover")] clean: bool, - /// PostgreSQL administrator URL for --recover (verified TLS, or loopback with - /// sslmode=disable). Defaults to RSTACK_DEV_DATABASE_URL; a run that started its own - /// server needs none. + /// The same PostgreSQL administrator URL used at start, including its transport + /// choice. Defaults to RSTACK_DEV_DATABASE_URL; a run that started its own server + /// needs none. #[arg(long, value_name = "URL", requires = "recover")] database_url: Option, }, diff --git a/crates/registry-session/src/gateway.rs b/crates/registry-session/src/gateway.rs index f8278d29de..2566d393ce 100644 --- a/crates/registry-session/src/gateway.rs +++ b/crates/registry-session/src/gateway.rs @@ -192,6 +192,14 @@ pub fn generate(config: &RuntimeConfig) -> Result, GatewayErr fn load_for_gateway( runtime_config: &Path, posture: DeclaredPosture, +) -> Result, GatewayError> { + load_gateway_config(runtime_config, posture, false) +} + +fn load_gateway_config( + runtime_config: &Path, + posture: DeclaredPosture, + checked_routes: bool, ) -> Result, GatewayError> { let (mut file, check) = read_runtime_file(runtime_config, false, posture); let Some(loaded) = file.loaded.take() else { @@ -214,6 +222,11 @@ fn load_for_gateway( }; require("/publicOrigin", file.defers("/publicOrigin")); require("/gateway", file.defers_within("/gateway")); + if checked_routes { + for pointer in ["/listener", "/checkListener", "/issuer", "/signIns"] { + require(pointer, file.defers_within(pointer)); + } + } for (list, count) in [ ("modules", loaded.config.modules.len()), ("pages", loaded.config.pages.len()), @@ -813,7 +826,9 @@ fn array<'a>(value: &'a Value, key: &str) -> &'a [Value] { } mod verify; -pub use verify::{verify_assembled, write_standalone}; +pub use verify::{ + verify_assembled, write_standalone, write_verified_route_inventory, StandaloneTls, +}; #[cfg(test)] mod tests { diff --git a/crates/registry-session/src/gateway/verify.rs b/crates/registry-session/src/gateway/verify.rs index f40a953c46..97757c879b 100644 --- a/crates/registry-session/src/gateway/verify.rs +++ b/crates/registry-session/src/gateway/verify.rs @@ -14,14 +14,17 @@ use std::{ collections::{BTreeMap, BTreeSet}, fs, io::{Read, Write}, - net::{IpAddr, SocketAddr}, + net::{IpAddr, Ipv4Addr, SocketAddr}, path::Path, }; +use registry_platform_config::{ListenerNetworkExposure, TlsTermination}; use registry_platform_yaml::{Reader, Refusal, ScalarHook, ScalarSite, ScalarStyle}; use serde_json::{json, Value}; +use sha2::{Digest, Sha256}; use super::*; +use crate::config::ModuleProduct; use crate::wire::SOURCE_PROFILE_HEADER; /// The most bytes of an assembled configuration `--verify-assembled` reads. @@ -212,9 +215,15 @@ pub fn write_standalone<'a>( output: &Path, listen: SocketAddr, upstreams: impl IntoIterator, + tls: Option>, posture: DeclaredPosture, ) -> Result { - let loaded = load_for_gateway(runtime_config, posture)?; + refuse_input_output_alias(output, runtime_config)?; + if let Some(tls) = &tls { + refuse_input_output_alias(output, tls.certificate)?; + refuse_input_output_alias(output, tls.key)?; + } + let loaded = load_gateway_config(runtime_config, posture, tls.is_some())?; let mut expected = Expected::new(&loaded.config)?; let gateway = loaded .config @@ -242,13 +251,46 @@ pub fn write_standalone<'a>( "Set gateway.service.host to a numeric loopback address.", )); } - let required = expected + let addresses = standalone_upstreams(&standalone_clusters(&expected), upstreams)?; + if tls.is_some() { + let ingress = validate_checked_transport(&loaded.config, addresses.values().copied())?; + if ingress != listen { + return Err(standalone_refusal( + "Make --listen match the numeric HTTPS publicOrigin.", + )); + } + } + let document = standalone_document(&mut expected, listen, addresses, tls.as_ref())?; + let bytes = serde_json::to_vec_pretty(&document) + .map_err(|_| standalone_refusal("Could not serialize the configuration."))?; + let document = scan_assembly(output, &bytes)?; + verify_document(&expected, &document)?; + + write_output(output, &bytes)?; + Ok(loaded.posture) +} + +/// File paths as Envoy will see them. The generator reads neither file. +pub struct StandaloneTls<'a> { + pub certificate: &'a Path, + pub key: &'a Path, +} + +fn standalone_clusters(expected: &Expected) -> BTreeSet<&str> { + expected .protected .iter() .map(String::as_str) .filter(|name| !matches!(*name, PUBLIC_CLUSTER | CHECK_CLUSTER)) - .collect::>(); - let addresses = standalone_upstreams(&required, upstreams)?; + .collect() +} + +fn standalone_document( + expected: &mut Expected, + listen: SocketAddr, + addresses: BTreeMap<&str, SocketAddr>, + tls: Option<&StandaloneTls<'_>>, +) -> Result { let mut definitions = String::new(); for (name, address) in addresses { cluster( @@ -259,15 +301,19 @@ pub fn write_standalone<'a>( ); } if !definitions.is_empty() { - expected.clusters.extend( - parse_fragment(&GeneratedFile { - name: "standalone-clusters", - content: definitions, - })? - .as_array() - .cloned() - .ok_or_else(|| standalone_refusal("Could not assemble the upstream clusters."))?, - ); + let mut custom = parse_fragment(&GeneratedFile { + name: "standalone-clusters", + content: definitions, + })? + .as_array() + .cloned() + .ok_or_else(|| standalone_refusal("Could not assemble the upstream clusters."))?; + if tls.is_some() { + for cluster in &mut custom { + cluster["type"] = json!("STATIC"); + } + } + expected.clusters.extend(custom); } let strip_port = !expected @@ -279,7 +325,7 @@ pub fn write_standalone<'a>( "name": "envoy.filters.http.router", "typed_config": {"@type": ROUTER_TYPE}, })); - let document = json!({ + let mut document = json!({ "static_resources": { "listeners": [{ "name": "registry-session", @@ -309,11 +355,178 @@ pub fn write_standalone<'a>( "clusters": &expected.clusters, }, }); - let bytes = serde_json::to_vec_pretty(&document) - .map_err(|_| standalone_refusal("Could not serialize the configuration."))?; - let document = scan_assembly(output, &bytes)?; - verify_document(&expected, &document)?; + if let Some(tls) = tls { + let certificate = checked_tls_path(tls.certificate)?; + let key = checked_tls_path(tls.key)?; + document["static_resources"]["listeners"][0]["filter_chains"][0]["transport_socket"] = json!({ + "name": "envoy.transport_sockets.tls", + "typed_config": { + "@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext", + "common_tls_context": { + "alpn_protocols": ["h2", "http/1.1"], + "tls_certificates": [{ + "certificate_chain": {"filename": certificate}, + "private_key": {"filename": key}, + }], + }, + }, + }); + } + Ok(document) +} + +fn checked_tls_path(path: &Path) -> Result<&str, GatewayError> { + path.to_str() + .filter(|value| path.is_absolute() && !value.chars().any(char::is_control)) + .ok_or_else(|| standalone_refusal("Use absolute UTF-8 filenames for gateway TLS material.")) +} + +fn refuse_input_output_alias(output: &Path, input: &Path) -> Result<(), GatewayError> { + let canonical = |path: &Path| { + path.canonicalize().ok().or_else(|| { + let parent = path + .parent() + .filter(|parent| !parent.as_os_str().is_empty()); + let directory = parent + .unwrap_or_else(|| Path::new(".")) + .canonicalize() + .ok()?; + Some(directory.join(path.file_name()?)) + }) + }; + if output == input || canonical(output).is_some_and(|output| canonical(input) == Some(output)) { + return Err(standalone_refusal( + "Write the gateway output to a file distinct from its input files.", + )); + } + Ok(()) +} + +fn validate_checked_transport( + config: &RuntimeConfig, + upstreams: impl IntoIterator, +) -> Result { + let gateway = config + .gateway + .as_ref() + .ok_or(GatewayError::NoGatewayBlock)?; + let origin = config.public_origin.to_url(); + let ingress = origin + .host_str() + .and_then(|host| host.parse::().ok()) + .zip(origin.port_or_known_default()) + .map(|(host, port)| SocketAddr::from((host, port))) + .filter(|socket| origin.scheme() == "https" && loopback_socket(*socket)) + .ok_or_else(|| { + standalone_refusal("Checked routes require a numeric IPv4 loopback HTTPS publicOrigin.") + })?; + let origin_authority = origin + .port() + .map_or_else(|| ingress.ip().to_string(), |_| ingress.to_string()); + if config.gateway_authority().as_deref() != Some(origin_authority.as_str()) + || config.listener.network_exposure != ListenerNetworkExposure::PrivateAddress + || !matches!( + config.listener.tls_termination, + TlsTermination::LoopbackPlaintext | TlsTermination::OperatorControlledUpstream + ) + || config + .issuer + .endpoints() + .iter() + .any(|(_, endpoint)| endpoint.to_url().scheme() != "https") + { + return Err(standalone_refusal("Checked routes require the public authority, private Session listeners and HTTPS issuer endpoints.")); + } + let host = gateway + .service + .host + .as_str() + .parse::() + .ok() + .filter(Ipv4Addr::is_loopback) + .ok_or_else(|| { + standalone_refusal("Checked routes require numeric IPv4 loopback Session listeners.") + })?; + let public = SocketAddr::from((host, gateway.service.public_port.get() as u16)); + let check = SocketAddr::from((host, gateway.service.check_port.get() as u16)); + if public != config.listener.bind.0 || check != config.check_listener.0 { + return Err(standalone_refusal( + "Match the gateway's Session sockets to the runtime listeners.", + )); + } + let mut sockets = BTreeSet::new(); + for socket in [ingress, public, check].into_iter().chain(upstreams) { + if !socket.is_ipv4() || !loopback_socket(socket) || !sockets.insert(socket) { + return Err(standalone_refusal("Use a distinct numeric IPv4 loopback socket for each gateway listener and upstream.")); + } + } + let routes = config + .modules + .iter() + .map(|module| module.upstream.as_ref()) + .chain(config.pages.iter().map(|page| page.upstream.as_ref())); + let mut clusters = BTreeSet::from([PUBLIC_CLUSTER, CHECK_CLUSTER]); + if !gateway.host_filters.is_empty() + || routes.into_iter().any(|upstream| { + upstream.is_none_or(|upstream| { + !upstream.keep_host_filters.is_empty() + || !clusters.insert(upstream.cluster.as_str()) + }) + }) + { + return Err(standalone_refusal( + "Checked routes require one exclusive cluster per route and no host filters.", + )); + } + Ok(ingress) +} +fn verify_checked_transport<'a>( + config: &RuntimeConfig, + document: &'a Value, +) -> Result, GatewayError> { + let refusal = || { + standalone_refusal( + "Use the complete dedicated loopback HTTPS Envoy assembly for checked route export.", + ) + }; + let mut expected = Expected::new(config)?; + let resources = &document["static_resources"]; + let chain = &resources["listeners"][0]["filter_chains"][0]; + let certificates = + &chain["transport_socket"]["typed_config"]["common_tls_context"]["tls_certificates"][0]; + let certificate = certificates["certificate_chain"]["filename"] + .as_str() + .ok_or_else(refusal)?; + let key = certificates["private_key"]["filename"] + .as_str() + .ok_or_else(refusal)?; + let tls = StandaloneTls { + certificate: Path::new(certificate), + key: Path::new(key), + }; + let clusters = resources["clusters"].as_array().ok_or_else(refusal)?; + let addresses: BTreeMap<_, _> = standalone_clusters(&expected).into_iter().map(|name| { + let endpoint = clusters.iter().find(|cluster| cluster["name"] == name) + .and_then(|cluster| cluster.pointer("/load_assignment/endpoints/0/lb_endpoints/0/endpoint/address/socket_address")) + .ok_or_else(refusal)?; + let ip = endpoint["address"].as_str().and_then(|value| value.parse::().ok()).ok_or_else(refusal)?; + let port = endpoint["port_value"].as_u64().and_then(|port| u16::try_from(port).ok()).ok_or_else(refusal)?; + Ok((name.to_owned(), SocketAddr::from((ip, port)))) + }).collect::>()?; + let ingress = validate_checked_transport(config, addresses.values().copied())?; + let by_name = addresses + .iter() + .map(|(name, socket)| (name.as_str(), *socket)) + .collect(); + let wanted = standalone_document(&mut expected, ingress, by_name, Some(&tls))?; + if document != &wanted { + return Err(refusal()); + } + Ok(tls) +} + +fn write_output(output: &Path, bytes: &[u8]) -> Result<(), GatewayError> { let parent = output .parent() .filter(|path| !path.as_os_str().is_empty()) @@ -321,13 +534,13 @@ pub fn write_standalone<'a>( let mut staged = tempfile::NamedTempFile::new_in(parent).map_err(|error| io_error(output, &error))?; staged - .write_all(&bytes) + .write_all(bytes) .and_then(|()| staged.write_all(b"\n")) .map_err(|error| io_error(output, &error))?; staged .persist(output) .map_err(|error| io_error(output, &error.error))?; - Ok(loaded.posture) + Ok(()) } fn loopback_socket(address: SocketAddr) -> bool { @@ -399,6 +612,114 @@ pub fn verify_assembled( Ok(loaded.posture) } +/// Project the browser-facing routes only after verifying the same runtime and +/// assembly as the gateway checks. Upstream addresses and credentials are +/// absent. The operation catalogue and products still decide what a route can +/// call and who can call it. +pub fn write_verified_route_inventory( + runtime_config: &Path, + assembled: &Path, + output: &Path, + selection: &str, + posture: DeclaredPosture, +) -> Result { + let loaded = load_gateway_config(runtime_config, posture, true).map_err(|_| { + standalone_refusal("Supply a valid and literal Session runtime for checked route export.") + })?; + let config = &loaded.config; + let assembly_bytes = read_assembly_bytes(assembled).map_err(|_| { + standalone_refusal("Supply a readable, valid Envoy assembly for checked route export.") + })?; + let json_refusal = + || standalone_refusal("Supply the generated standalone Envoy configuration as JSON."); + let document = scan_assembly(assembled, &assembly_bytes).map_err(|_| json_refusal())?; + if serde_json::from_slice::(&assembly_bytes).map_err(|_| json_refusal())? != document { + return Err(json_refusal()); + } + let tls = verify_checked_transport(config, &document)?; + refuse_input_output_alias(output, runtime_config)?; + refuse_input_output_alias(output, assembled)?; + refuse_input_output_alias(output, tls.certificate)?; + refuse_input_output_alias(output, tls.key)?; + + let module = config + .modules + .iter() + .find(|module| module.id.as_str() == selection) + .filter(|module| module.product == Some(ModuleProduct::Breg)) + .ok_or_else(|| standalone_refusal("Select one declared BReg product module."))?; + let rewrite = module + .upstream + .as_ref() + .and_then(|upstream| upstream.prefix_rewrite.as_ref()) + .map(|prefix| prefix.as_str()); + let overlap = + |other: &str| lies_under(&module.prefix, other) || lies_under(other, &module.prefix); + if rewrite != Some("/") + || module.prefix.len() > 256 + || !module.prefix.ends_with('/') + || !module + .prefix + .bytes() + .all(|byte| byte.is_ascii_alphanumeric() || b"/._:-".contains(&byte)) + || config + .modules + .iter() + .any(|other| other.id != module.id && overlap(&other.prefix)) + || config.pages.iter().any(|page| overlap(&page.prefix)) + { + return Err(standalone_refusal( + "Select a disjoint BReg module prefix that rewrites to the product root.", + )); + } + if config.pages.iter().any(|page| { + config.modules.iter().any(|module| { + lies_under(&page.prefix, &module.prefix) || lies_under(&module.prefix, &page.prefix) + }) + }) { + return Err(standalone_refusal( + "Use page prefixes disjoint from all module prefixes in a checked inventory.", + )); + } + let sign_ins = config + .sign_ins + .iter() + .map(|entry| entry.id.as_str()) + .filter(|id| module.admits(id)) + .collect::>(); + if sign_ins.is_empty() || sign_ins.len() > 64 || config.pages.len() > 64 { + return Err(standalone_refusal( + "Checked routes require one to 64 admitted sign-in kinds and at most 64 pages.", + )); + } + let modules = [ + json!({"id": module.id.as_str(), "product": "breg", "prefix": module.prefix, "prefixRewrite": rewrite, "signIns": sign_ins}), + ]; + let pages: Vec<_> = config + .pages + .iter() + .map(|page| json!({"prefix": page.prefix, "signIn": page.sign_in.as_str()})) + .collect(); + let assembly_bytes = serde_json::to_vec(&document) + .map_err(|_| standalone_refusal("Could not serialize the verified assembly."))?; + let gateway_sha256: String = Sha256::digest(assembly_bytes) + .iter() + .map(|byte| format!("{byte:02x}")) + .collect(); + let inventory = json!({ + "apiVersion": "id.registrystack.org/formats/platform/session-route-inventory/v1alpha1", + "kind": "PlatformSessionRouteInventory", + "publicOrigin": config.public_origin.as_str().trim_end_matches('/'), + "gatewaySha256": gateway_sha256, + "modules": modules, + "pages": pages, + }); + let bytes = serde_json::to_vec_pretty(&inventory) + .map_err(|_| standalone_refusal("Could not serialize the verified route inventory."))?; + write_output(output, &bytes)?; + Ok(loaded.posture) +} + fn verify_loaded(config: &RuntimeConfig, assembled: &Path) -> Result<(), GatewayError> { let expected = Expected::new(config)?; let document = read_assembly(assembled)?; @@ -406,6 +727,10 @@ fn verify_loaded(config: &RuntimeConfig, assembled: &Path) -> Result<(), Gateway } fn read_assembly(assembled: &Path) -> Result { + scan_assembly(assembled, &read_assembly_bytes(assembled)?) +} + +fn read_assembly_bytes(assembled: &Path) -> Result, GatewayError> { let file = fs::File::open(assembled).map_err(|error| io_error(assembled, &error))?; let metadata = file .metadata() @@ -419,7 +744,7 @@ fn read_assembly(assembled: &Path) -> Result { file.take(MAXIMUM_ASSEMBLED_BYTES + 1) .read_to_end(&mut bytes) .map_err(|error| io_error(assembled, &error))?; - scan_assembly(assembled, &bytes) + Ok(bytes) } fn scan_assembly(assembled: &Path, bytes: &[u8]) -> Result { diff --git a/crates/registry-session/src/lib.rs b/crates/registry-session/src/lib.rs index 59cf14d7d3..a60a0d15f5 100644 --- a/crates/registry-session/src/lib.rs +++ b/crates/registry-session/src/lib.rs @@ -137,6 +137,21 @@ pub fn command() -> Command { ) .value_parser(value_parser!(PathBuf)), ) + .arg( + Arg::new("route-inventory-out") + .long("route-inventory-out") + .value_name("FILE") + .help("Write browser paths for the selected BReg route from a verified loopback HTTPS assembly") + .requires_all(["verify-assembled", "checked-route"]) + .value_parser(value_parser!(PathBuf)), + ) + .arg( + Arg::new("checked-route") + .long("checked-route") + .value_name("ID") + .help("Select the BReg product module for the browser route inventory") + .requires("route-inventory-out"), + ) .arg( Arg::new("standalone-out") .long("standalone-out") @@ -162,6 +177,22 @@ pub fn command() -> Command { .requires("standalone-out") .conflicts_with_all(["out", "check", "verify-assembled"]) .action(ArgAction::Append), + ) + .arg( + Arg::new("tls-certificate") + .long("tls-certificate") + .value_name("FILE") + .help("Absolute filename of the certificate chain for dedicated loopback HTTPS") + .requires_all(["standalone-out", "tls-key"]) + .value_parser(value_parser!(PathBuf)), + ) + .arg( + Arg::new("tls-key") + .long("tls-key") + .value_name("FILE") + .help("Absolute filename of the Envoy TLS private key") + .requires("tls-certificate") + .value_parser(value_parser!(PathBuf)), ), ), ) diff --git a/crates/registry-session/src/main.rs b/crates/registry-session/src/main.rs index 7fd0345682..abc8633e46 100644 --- a/crates/registry-session/src/main.rs +++ b/crates/registry-session/src/main.rs @@ -96,7 +96,18 @@ async fn main() -> ExitCode { return ExitCode::from(2); }; let result = if let Some(assembled) = arguments.get_one::("verify-assembled") { - gateway::verify_assembled(path, assembled, posture) + match arguments.get_one::("route-inventory-out") { + Some(out) => gateway::write_verified_route_inventory( + path, + assembled, + out, + arguments + .get_one::("checked-route") + .expect("inventory requires a module"), + posture, + ), + None => gateway::verify_assembled(path, assembled, posture), + } } else if let Some(out) = arguments.get_one::("standalone-out") { let listen = *arguments .get_one::("listen") @@ -106,7 +117,11 @@ async fn main() -> ExitCode { .into_iter() .flatten() .map(String::as_str); - gateway::write_standalone(path, out, listen, upstreams, posture) + let tls = arguments + .get_one::("tls-certificate") + .zip(arguments.get_one::("tls-key")) + .map(|(certificate, key)| gateway::StandaloneTls { certificate, key }); + gateway::write_standalone(path, out, listen, upstreams, tls, posture) } else { let mode = match ( arguments.get_one::("out"), diff --git a/crates/registry-session/tests/binary.rs b/crates/registry-session/tests/binary.rs index 4c82831ab5..d584f56418 100644 --- a/crates/registry-session/tests/binary.rs +++ b/crates/registry-session/tests/binary.rs @@ -273,6 +273,139 @@ fn gateway_writes_a_deterministic_checked_standalone_configuration() { ); } +#[test] +fn gateway_inventory_requires_the_exact_verified_assembly() { + let root = tempfile::tempdir().expect("directory"); + let runtime = root.path().join("runtime.yaml"); + std::fs::write( + &runtime, + standalone_runtime().replace("https://app.example", "https://127.0.0.1:8080"), + ) + .expect("runtime"); + let assembly = root.path().join("envoy.json"); + let routes = root.path().join("routes.json"); + let certificate = root.path().join("cert.pem"); + let key = root.path().join("key.pem"); + std::fs::write(&key, "synthetic key placeholder").expect("key placeholder"); + let export = |output: &std::path::Path| { + run_command( + runtime_command(&runtime) + .args(["gateway", "envoy", "--verify-assembled"]) + .arg(&assembly) + .arg("--route-inventory-out") + .arg(output) + .args(["--checked-route", "breg"]), + ) + }; + let verify = || export(&routes); + generate_standalone(&runtime, &assembly); + assert_eq!(verify().0, 1, "ordinary plaintext assembly must not export"); + assert!(!routes.exists()); + + let (exit, _, stderr) = run_command( + runtime_command(&runtime) + .args(["gateway", "envoy", "--standalone-out"]) + .arg(&assembly) + .args([ + "--listen", + "127.0.0.1:8080", + "--upstream", + "registry=127.0.0.1:8100", + "--upstream", + "pages=127.0.0.1:8200", + ]) + .arg("--tls-certificate") + .arg(&certificate) + .arg("--tls-key") + .arg(&key), + ); + assert_eq!(exit, 0, "{stderr}"); + let (exit, _, stderr) = verify(); + assert_eq!(exit, 0, "{stderr}"); + let first = std::fs::read(&routes).expect("route inventory"); + let inventory: serde_json::Value = serde_json::from_slice(&first).expect("JSON inventory"); + assert_eq!(inventory["kind"], "PlatformSessionRouteInventory"); + assert_eq!(inventory["publicOrigin"], "https://127.0.0.1:8080"); + assert_eq!( + inventory["modules"], + json!([{ + "id": "breg", + "product": "breg", + "prefix": "/api/registry/", + "prefixRewrite": "/", + "signIns": ["citizen"] + }]) + ); + assert_eq!( + inventory["pages"], + json!([{"prefix": "/apply/", "signIn": "citizen"}]) + ); + let output = String::from_utf8_lossy(&first); + for private in [ + ":8100", + ":8121", + "secret:", + "https://id.example", + "clientId", + "key.pem", + ] { + assert!(!output.contains(private), "{output}"); + } + + let (exit, _, stderr) = verify(); + assert_eq!(exit, 0, "{stderr}"); + assert_eq!(std::fs::read(&routes).expect("regenerated routes"), first); + + assert_eq!(export(&key).0, 1, "refuse to overwrite the gateway TLS key"); + assert_eq!( + std::fs::read_to_string(&key).expect("original key placeholder"), + "synthetic key placeholder" + ); + assert_eq!( + export(&certificate).0, + 1, + "refuse to create output at the declared certificate filename" + ); + let child = root.path().join("child"); + std::fs::create_dir(&child).expect("nested directory"); + assert_eq!( + export(&child.join("../cert.pem")).0, + 1, + "refuse an alternate spelling of the declared certificate filename" + ); + assert!(!certificate.exists()); + + let contents = std::fs::read_to_string(&assembly).expect("Envoy configuration"); + std::fs::write( + &assembly, + contents.replacen("\"static_resources\"", "static_resources", 1), + ) + .expect("convert assembly to flow YAML"); + assert_eq!(verify().0, 1, "the checked exporter requires JSON"); + assert_eq!(std::fs::read(&routes).expect("retained inventory"), first); + + assert!(contents.contains("/api/registry/")); + std::fs::write(&assembly, contents.replace("/api/registry/", "/api/other/")) + .expect("mutate assembled route"); + let (exit, _, _) = verify(); + assert_eq!(exit, 1); + assert_eq!(std::fs::read(&routes).expect("retained inventory"), first); + + let mut remote: serde_json::Value = serde_json::from_str(&contents).expect("assembly JSON"); + let clusters = remote["static_resources"]["clusters"] + .as_array_mut() + .expect("clusters"); + let registry = clusters + .iter_mut() + .find(|cluster| cluster["name"] == "registry") + .expect("BReg cluster"); + registry["load_assignment"]["endpoints"][0]["lb_endpoints"][0]["endpoint"]["address"] + ["socket_address"]["address"] = json!("192.0.2.1"); + std::fs::write(&assembly, remote.to_string()).expect("mutate upstream address"); + assert_eq!(verify().0, 1); + assert_eq!(std::fs::read(&routes).expect("retained inventory"), first); +} + #[test] #[ignore = "requires Docker and the pinned Envoy image"] fn envoy_validates_the_generated_standalone_configuration() { diff --git a/deploy/examples/business-registration/.dockerignore b/deploy/examples/business-registration/.dockerignore new file mode 100644 index 0000000000..dc6492ac2c --- /dev/null +++ b/deploy/examples/business-registration/.dockerignore @@ -0,0 +1,5 @@ +* +!Dockerfile +!package.json +!package-lock.json +!host.mjs diff --git a/deploy/examples/business-registration/Dockerfile b/deploy/examples/business-registration/Dockerfile new file mode 100644 index 0000000000..a38bf67221 --- /dev/null +++ b/deploy/examples/business-registration/Dockerfile @@ -0,0 +1,7 @@ +FROM node:24.22.3@sha256:dc26ae92c9fb15cf6b1d63e20f0944b2efe0f115b20e00be48fb23fceb061c54 +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci --omit=dev --ignore-scripts --no-audit --no-fund +COPY host.mjs ./ +USER node +ENTRYPOINT ["node", "/app/host.mjs"] diff --git a/deploy/examples/business-registration/README.md b/deploy/examples/business-registration/README.md new file mode 100644 index 0000000000..f770c98329 --- /dev/null +++ b/deploy/examples/business-registration/README.md @@ -0,0 +1,178 @@ +# Business registration on the Compose reference host + +Run the business-registration preview's compiled function and static page with +Registry Session, Envoy, ThunderID, BReg and PostgreSQL. The application opens +at `https://127.0.0.1:8443/apply/`. Use a disposable project and synthetic +registrar. The example uses production posture and verified TLS with loopback +host bindings. + +The browser receives an opaque Session cookie. Envoy checks it and supplies +the registrar's access token on the private function and registry routes. +The function uses that token for the existing BReg Action. BReg applies its +own access profile, issuer, scope and row rules. The Node host has read-only +bundle files and no database or issuer credentials. + +## Prepare the deployment inputs + +Use Docker Compose v2 on Linux amd64. Set `RECIPE` to the absolute path of this +directory and prepare a fresh private directory for `REFERENCE_CONFIG`. Stage +`breg`, `bregctl` and `registry-session` in `REFERENCE_ARTIFACTS`. Verify the +matching BReg release binaries against their manifest. Use a matching native +Session binary verified against the local candidate's artifact receipt until +Session is available in a numbered release. + +Set these inputs in your shell and in a Compose environment file. Use absolute +paths. Set `REFERENCE_UID` and `REFERENCE_GID` if the nonroot owner of these +inputs differs from 1000. Both Envoy relays use this same UID. Each Compose +project needs its own input, audit, checked-config and socket directories. + +| Variable | Value | +| --- | --- | +| `REFERENCE_CONFIG` | Private directory with the layout below | +| `REFERENCE_ARTIFACTS` | Directory with the verified executables | +| `BUSINESS_BUNDLE` | Build output of the business-registration preview | +| `BUSINESS_BUNDLE_SHA256` | Runtime file digest of the reviewed preview build | + +Generate the preview bundle with the matching preview builder. The recipe uses +its `manifest.json`, `functions/register-business.mjs`, and the three files in +the manifest's `staticOutput` directory, `index.html`, `app.js` and +`service.css`. Use a build whose page references its assets by relative URL so +the same page can run under `/apply/`. The digest covers each of these five +files and its relative path. Derive it once from the reviewed build, then +include that value in the instance's input file. + +```bash +bundle_host=$(docker build --quiet "$RECIPE") +docker run --rm --network none \ + --mount "type=bind,source=$BUSINESS_BUNDLE,target=/run/bundle,readonly" \ + "$bundle_host" --digest /run/bundle +``` + +Name the sealed BReg package from that preview project in both BReg inputs. +Follow the [BReg test and package steps](../../../docs/site/src/content/docs/operate/breg.mdx) +with a separate schema-test database. Use the same package and recorded digest +for activation and serving. Set `BREG_PACKAGE_DIGEST` in your shell from the +package receipt. + +| Path under `REFERENCE_CONFIG` | Contents | +| --- | --- | +| `app-tls/app.crt`, `app-tls/app.key` | TLS pair with an IP SAN of `127.0.0.1` | +| `issuer-tls/issuer.crt`, `issuer-tls/issuer.key` | TLS pair for `identity.reference.test` | +| `trust/https-ca.pem`, `trust/postgres-ca.pem` | Trust roots for the HTTPS and PostgreSQL certificates | +| `postgres/server.crt`, `postgres/server.key`, `postgres/bootstrap-password`, `postgres/thunderid-password` | TLS pair for DNS name `postgres`, database admin password and ThunderID database password | +| `postgres/schema/` | Four schema files from the pinned ThunderID image, staged below | +| `session/secrets/` | Owner-only `registrar-client` and `audit-key` | +| `breg/runtime/` | [Runtime configuration](breg-runtime.yaml) as `runtime.yaml`, sealed `package/`, and owner-only `secrets/` with the serving database URL, database CA, cursor key and audit key | +| `breg/admin/` | Same runtime file and package, separately staged for the explicit BReg admin commands. Also provide `admin-database-url` and the migration database URL in `secrets/`. | +| `thunderid/bootstrap.yaml` | A copy of [thunderid.yaml](thunderid.yaml), used once with writable backing stores | +| `thunderid/deployment.yaml` | The same ThunderID base plus the generated store settings, used by the issuer after setup | +| `thunderid/bootstrap-secrets/` | `DB_CONFIG_PASSWORD` and `ADMIN_PASSWORD` for the one-shot setup | +| `thunderid/secrets/` | `DB_CONFIG_PASSWORD`, `REGISTRAR_CLIENT_SECRET`, and `REGISTRAR_PASSWORD` for serving | +| `thunderid/resources/`, `thunderid/front-gateway/`, `thunderid/identity-receipt.json` | Output of identity generation | +| `gateway/envoy.json` | Reviewed complete Envoy configuration from the matching Session CLI | +| `gateway-checked/`, `relay/`, `breg/audit/`, `session/audit/` | Empty private directories owned by the instance UID | + +The Session client secret equals `REGISTRAR_CLIENT_SECRET`. Both ThunderID +`DB_CONFIG_PASSWORD` files carry the value in `postgres/thunderid-password`. +The PostgreSQL files must be readable by the image's UID 999 and the +ThunderID secrets by UID 10001. Give private keys and secret files mode 0600. +Use distinct random values for admin, registrar, database and audit credentials. +BReg URLs target `postgres:5432`; runtime and migration use different roles and +passwords and point at the same registry database. BReg's CA file carries +`postgres-ca.pem`. Configure the local browser to resolve +`identity.reference.test` to `127.0.0.1` and trust the HTTPS CA. + +Generate the issuer inputs with the matching `rstack identity generate thunderid` +command and [identity-deployment.yaml](identity-deployment.yaml). Use the +preview's BReg project and a host-side copy of the BReg runtime file whose +package and secret-provider roots exist and are readable. The private resource +files carry references to the secret names above. Stage the generated +`resources/`, `front-gateway/` and `identity-receipt.json` at the paths in the +table. Merge the generated ThunderID store settings into the serving deployment +file, retaining the supplied `server`, `jwt`, `crypto` and `database` blocks. +The generated issuer, application registration, subject claims and registrar +scope must agree with the BReg and Session files. + +Use a matching Session CLI that supports standalone TLS assembly and checked +route export. Generate the complete Envoy file from [session.yaml](session.yaml). +The gateway itself terminates app TLS at `127.0.0.1:8443`. Use +`/run/tls/app.crt` and `/run/tls/app.key` as its TLS paths and these three +distinct private first hops. + +| Session route | Upstream | Rewrite | +| --- | --- | --- | +| `/registry/businesses/` | `registry=127.0.0.1:8100` | `/` | +| `/api/functions/` | `functions=127.0.0.1:8300` | `/functions/` | +| `/apply/` | `pages=127.0.0.1:8200` | `/` | + +```bash +session=("$REFERENCE_ARTIFACTS/registry-session" --runtime-config "$RECIPE/session.yaml") +"${session[@]}" gateway envoy --posture production \ + --standalone-out "$REFERENCE_CONFIG/gateway/envoy.json" --listen 127.0.0.1:8443 \ + --upstream registry=127.0.0.1:8100 --upstream pages=127.0.0.1:8200 \ + --upstream functions=127.0.0.1:8300 \ + --tls-certificate /run/tls/app.crt --tls-key /run/tls/app.key +"${session[@]}" gateway envoy --posture production \ + --verify-assembled "$REFERENCE_CONFIG/gateway/envoy.json" \ + --route-inventory-out "$REFERENCE_CONFIG/gateway/route-inventory.json" --checked-route businesses +``` + +Only the `businesses` module supplies the browser's product-client route +inventory. At startup, Compose runs the strict export for `businesses` against +a staged copy of the supplied Envoy file. It installs those exact bytes after +the export succeeds. The startup inventory is temporary. The application and +BReg share the upstream namespace. Session's check listener is in the +separate gateway namespace. The two Envoy relays connect these namespaces over +three private owner-only Unix sockets. The host app port passes TLS through to +the Session-checked gateway. + +## Start with empty state + +Set `REFERENCE_ENV` to the absolute path of the Compose environment file. +Choose a unique project name. Extract the database scripts before starting +PostgreSQL. The initialization script creates only ThunderID's four databases +and applies the matching schemas as the ThunderID role. + +```bash +compose=(docker compose --project-name business-reference \ + --env-file "$REFERENCE_ENV" --file "$RECIPE/compose.yaml") + +mkdir -p "$REFERENCE_CONFIG/postgres/schema" +for schema in config:configdb entity:entitydb runtime_transient:runtime_transient runtime_persistent:runtime_persistent; do + "${compose[@]}" run -T --rm --no-deps --entrypoint cat thunderid-setup \ + "dbscripts/${schema#*:}/postgres.sql" > "$REFERENCE_CONFIG/postgres/schema/${schema%%:*}.sql" +done + +"${compose[@]}" up --detach --wait postgres +"${compose[@]}" run -T --rm thunderid-setup + +"${compose[@]}" run -T --rm breg-admin provision --posture production \ + --runtime-config /run/breg/runtime.yaml --admin-url-file /run/breg/secrets/admin-database-url +"${compose[@]}" run -T --rm breg-admin apply --posture production --initial \ + --runtime-config /run/breg/runtime.yaml --package /run/breg/package \ + --expected-digest "$BREG_PACKAGE_DIGEST" + +"${compose[@]}" up --wait --wait-timeout 60 --build +"${compose[@]}" ps +``` + +The ThunderID setup job creates the built-in password flow first. The serving +issuer then loads the registrar app and user from the generated resources. +Before BReg starts, a one-shot checks the issuer's HTTPS discovery document and +signing keys from BReg's network namespace. +The setup containers are for fresh state. PostgreSQL data and ThunderID signing +and encryption material live in project-owned volumes. `docker compose stop` +preserves those volumes. Session state is in memory and a Session restart +requires signing in again. + +## Check the routes + +Run `bash "$RECIPE/tests/smoke.sh" "$REFERENCE_CONFIG/trust/https-ca.pem"`. +The probe checks TLS, the issuer discovery document and administrative route +refusals, the sign-in redirect, and Session and origin refusals. Then open +`https://127.0.0.1:8443/apply/`, sign in as the disposable registrar and +register a synthetic business. The page should show its Record ID from BReg. +Verify the Record through the same BReg route and registrar session. + +Release-candidate smoke wiring, published Session and Coordinator images, +and the `rstack dev` route-parity gate are v0.52 work. diff --git a/deploy/examples/business-registration/breg-runtime.yaml b/deploy/examples/business-registration/breg-runtime.yaml new file mode 100644 index 0000000000..8717e1b804 --- /dev/null +++ b/deploy/examples/business-registration/breg-runtime.yaml @@ -0,0 +1,43 @@ +apiVersion: id.registrystack.org/formats/breg/runtime/v1alpha1 +kind: BRegRuntimeConfig +listener: + bind: 127.0.0.1:8100 + publicOrigin: https://127.0.0.1:8443/registry/businesses +identity: + environment: reference + instanceId: business-registration + databaseId: business-registration +secretProviders: + file: + root: /run/breg/secrets +database: + transport: verified-tls + runtimeUrlRef: secret:file/runtime-database-url + migrationUrlRef: secret:file/migration-database-url + caBundleRef: secret:file/database-ca + pool: + maximumConnections: 4 + roles: + runtime: breg_runtime + migration: breg_migration +package: + root: /run/breg/package +authentication: + oidc: + issuers: + thunderid: + issuer: https://identity.reference.test:9443 + audience: urn:example:business-register + allowedAlgorithm: RS256 + scopeClaim: scope + scopeSeparator: " " + allowedClients: [business-registrar] + maximumTokenLifetimeSeconds: 3600 + leewayMilliseconds: 30000 + authorityClaims: + principal: sub +audit: + hashKeyRef: secret:file/audit-key + path: /var/lib/breg/audit.jsonl +cursor: + secretRef: secret:file/cursor-key diff --git a/deploy/examples/business-registration/check-gateway.sh b/deploy/examples/business-registration/check-gateway.sh new file mode 100644 index 0000000000..acd8742040 --- /dev/null +++ b/deploy/examples/business-registration/check-gateway.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -euo pipefail +umask 077 + +reference=$2 +input=$3 +output=$4 +session=("$1" --runtime-config "$reference/session.yaml") +"${session[@]}" check --posture production --deny-warnings --identity-receipt "$reference/identity-receipt.json" + +staging=$(mktemp -d "$output/.check.XXXXXX") +candidate="$staging/envoy.json" +inventory="$staging/route-inventory.json" +trap 'rm -f -- "$candidate" "$inventory"; rmdir -- "$staging"' EXIT +cp -- "$input" "$candidate" +"${session[@]}" gateway envoy --posture production --verify-assembled "$candidate" \ + --route-inventory-out "$inventory" --checked-route businesses +if [[ ! -s "$inventory" ]]; then + printf 'Session did not produce the checked route inventory.\n' >&2 + exit 1 +fi +mv -fT -- "$candidate" "$output/envoy.json" diff --git a/deploy/examples/business-registration/compose.yaml b/deploy/examples/business-registration/compose.yaml new file mode 100644 index 0000000000..5b9d164bb9 --- /dev/null +++ b/deploy/examples/business-registration/compose.yaml @@ -0,0 +1,236 @@ +x-native: &native + image: ubuntu:24.04@sha256:73b999393d07f2bf65a40373778a44dc9a6d54ad7718d29247d8ff9413c4d6a8 + user: "${REFERENCE_UID:-1000}:${REFERENCE_GID:-1000}" + read_only: true + cap_drop: [ALL] + security_opt: [no-new-privileges:true] + +x-envoy: &envoy + image: envoyproxy/envoy:v1.39.6@sha256:1fde8efee875e4e4f6a39a90fe49d9338e1caacce5762034ef9fb4bbb9ad6aed + user: "${REFERENCE_UID:-1000}:${REFERENCE_GID:-1000}" + entrypoint: [envoy, --disable-hot-restart] + read_only: true + cap_drop: [ALL] + security_opt: [no-new-privileges:true] + +x-thunderid: &thunderid + image: ghcr.io/thunder-id/thunderid:1.0.1@sha256:d3c0613ff447a551fd440768a15bdfb6668948e80809cbb50f82d6752f22ab3e + entrypoint: [bash, /run/reference/thunderid.sh] + read_only: true + cap_drop: [ALL] + security_opt: [no-new-privileges:true] + tmpfs: [/tmp] + environment: + PGSSLROOTCERT: /run/trust/postgres-ca.pem + depends_on: + postgres: + condition: service_healthy + +services: + edge: + <<: *envoy + command: [-c, /run/reference/edge.yaml] + ports: + - "127.0.0.1:8443:8080" + - "127.0.0.1:9443:9443" + volumes: + - ./edge.yaml:/run/reference/edge.yaml:ro + - ${REFERENCE_CONFIG:?Set REFERENCE_CONFIG}/issuer-tls:/run/tls:ro + - ${REFERENCE_CONFIG}/relay:/run/relay:ro + networks: + ingress: + issuer: + aliases: [identity.reference.test] + issuer-front: + + upstreams: + <<: *envoy + command: [-c, /run/reference/upstreams.yaml] + volumes: + - ./upstreams.yaml:/run/reference/upstreams.yaml:ro + - ${REFERENCE_CONFIG}/relay:/run/relay + networks: [issuer, database] + + gateway-check: + <<: *native + network_mode: none + entrypoint: [bash, /run/reference/check-gateway.sh] + command: [/opt/native/registry-session, /run/reference, /run/gateway-input/envoy.json, /run/gateway] + volumes: + - ./check-gateway.sh:/run/reference/check-gateway.sh:ro + - ./session.yaml:/run/reference/session.yaml:ro + - ${REFERENCE_ARTIFACTS:?Set REFERENCE_ARTIFACTS}/registry-session:/opt/native/registry-session:ro + - ${REFERENCE_CONFIG}/gateway:/run/gateway-input:ro + - ${REFERENCE_CONFIG}/gateway-checked:/run/gateway + - ${REFERENCE_CONFIG}/thunderid/identity-receipt.json:/run/reference/identity-receipt.json:ro + + gateway: + <<: *envoy + network_mode: service:edge + command: [-c, /run/gateway/envoy.json] + volumes: + - ${REFERENCE_CONFIG}/gateway-checked:/run/gateway:ro + - ${REFERENCE_CONFIG}/app-tls:/run/tls:ro + depends_on: + gateway-check: + condition: service_completed_successfully + + session: + <<: *native + network_mode: service:edge + entrypoint: [/opt/native/registry-session] + command: [--runtime-config, /run/reference/session.yaml, --posture, production] + environment: + SSL_CERT_FILE: /run/trust/https-ca.pem + volumes: + - ./session.yaml:/run/reference/session.yaml:ro + - ${REFERENCE_ARTIFACTS}/registry-session:/opt/native/registry-session:ro + - ${REFERENCE_CONFIG}/session/secrets:/run/session-secrets:ro + - ${REFERENCE_CONFIG}/session/audit:/var/lib/session + - ${REFERENCE_CONFIG}/trust:/run/trust:ro + + application: + build: . + user: "${REFERENCE_UID:-1000}:${REFERENCE_GID:-1000}" + network_mode: service:upstreams + read_only: true + init: true + cap_drop: [ALL] + security_opt: [no-new-privileges:true] + environment: + BUSINESS_BUNDLE: /run/bundle + BUSINESS_BUNDLE_SHA256: ${BUSINESS_BUNDLE_SHA256:?Set BUSINESS_BUNDLE_SHA256} + volumes: + - ${BUSINESS_BUNDLE:?Set BUSINESS_BUNDLE}:/run/bundle:ro + + issuer-ready: + image: node:24.22.3@sha256:dc26ae92c9fb15cf6b1d63e20f0944b2efe0f115b20e00be48fb23fceb061c54 + user: "${REFERENCE_UID:-1000}:${REFERENCE_GID:-1000}" + network_mode: service:upstreams + read_only: true + cap_drop: [ALL] + security_opt: [no-new-privileges:true] + command: [node, /run/reference/issuer-ready.mjs] + environment: + NODE_EXTRA_CA_CERTS: /run/trust/https-ca.pem + volumes: + - ./issuer-ready.mjs:/run/reference/issuer-ready.mjs:ro + - ${REFERENCE_CONFIG}/trust:/run/trust:ro + depends_on: + edge: + condition: service_started + identity-gateway: + condition: service_started + thunderid: + condition: service_started + + breg: + <<: *native + network_mode: service:upstreams + entrypoint: [/opt/native/breg] + command: [--runtime-config, /run/breg/runtime.yaml, --posture, production] + environment: + SSL_CERT_FILE: /run/trust/https-ca.pem + volumes: + - ${REFERENCE_ARTIFACTS}/breg:/opt/native/breg:ro + - ${REFERENCE_CONFIG}/breg/runtime:/run/breg:ro + - ${REFERENCE_CONFIG}/breg/audit:/var/lib/breg + - ${REFERENCE_CONFIG}/trust:/run/trust:ro + depends_on: + postgres: + condition: service_healthy + issuer-ready: + condition: service_completed_successfully + + breg-admin: + <<: *native + profiles: [setup] + networks: [database] + entrypoint: [/opt/native/bregctl] + environment: + SSL_CERT_FILE: /run/trust/https-ca.pem + volumes: + - ${REFERENCE_ARTIFACTS}/bregctl:/opt/native/bregctl:ro + - ${REFERENCE_CONFIG}/breg/admin:/run/breg:ro + - ${REFERENCE_CONFIG}/breg/audit:/var/lib/breg + - ${REFERENCE_CONFIG}/trust:/run/trust:ro + depends_on: + postgres: + condition: service_healthy + + identity-gateway: + <<: *envoy + command: [-c, /run/identity/envoy.yaml] + volumes: + - ${REFERENCE_CONFIG}/thunderid/front-gateway:/run/identity:ro + networks: [issuer-front, identity-backend] + + thunderid: + <<: *thunderid + command: [serve] + networks: [identity-backend, identity-database] + volumes: + - &issuer-launch ./thunderid.sh:/run/reference/thunderid.sh:ro + - ${REFERENCE_CONFIG}/thunderid/deployment.yaml:/opt/thunderid/deployment.yaml:ro + - ${REFERENCE_CONFIG}/thunderid/resources:/opt/thunderid/config/resources:ro + - ${REFERENCE_CONFIG}/thunderid/secrets:/run/identity-secrets:ro + - &issuer-trust ${REFERENCE_CONFIG}/trust:/run/trust:ro + - &issuer-certs issuer-certs:/opt/thunderid/config/certs + - &issuer-secrets issuer-secrets:/opt/thunderid/config/secrets + + thunderid-setup: + <<: *thunderid + command: [setup] + profiles: [setup] + networks: [identity-database] + volumes: + - *issuer-launch + - ${REFERENCE_CONFIG}/thunderid/bootstrap.yaml:/opt/thunderid/deployment.yaml:ro + - ${REFERENCE_CONFIG}/thunderid/bootstrap-secrets:/run/identity-secrets:ro + - *issuer-trust + - *issuer-certs + - *issuer-secrets + + postgres: + image: postgres:17.11@sha256:ff87138949ad9a46f32ff23bd6852b52ce024a13dffe9b4087be98292cdd3b4f + environment: + POSTGRES_PASSWORD_FILE: /run/postgres/bootstrap-password + command: + - postgres + - -c + - ssl=on + - -c + - ssl_cert_file=/run/postgres/server.crt + - -c + - ssl_key_file=/run/postgres/server.key + - -c + - hba_file=/run/reference/pg_hba.conf + volumes: + - postgres-data:/var/lib/postgresql/data + - ${REFERENCE_CONFIG}/postgres:/run/postgres:ro + - ./pg_hba.conf:/run/reference/pg_hba.conf:ro + - ./init-postgres.sh:/docker-entrypoint-initdb.d/10-identity.sh:ro + healthcheck: + test: [CMD, pg_isready, -h, 127.0.0.1, -U, postgres] + interval: 2s + timeout: 2s + retries: 30 + networks: [database, identity-database] + +networks: + ingress: + issuer: + internal: true + issuer-front: + internal: true + identity-backend: + internal: true + database: + internal: true + identity-database: + internal: true + +volumes: + postgres-data: + issuer-certs: + issuer-secrets: diff --git a/deploy/examples/business-registration/edge.yaml b/deploy/examples/business-registration/edge.yaml new file mode 100644 index 0000000000..9e29da5cb1 --- /dev/null +++ b/deploy/examples/business-registration/edge.yaml @@ -0,0 +1,128 @@ +static_resources: + listeners: + - name: app_tcp + address: + socket_address: {address: 0.0.0.0, port_value: 8080} + filter_chains: + - filters: + - name: envoy.filters.network.tcp_proxy + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy + stat_prefix: app_tcp + cluster: app_tls + - name: issuer_https + address: + socket_address: {address: 0.0.0.0, port_value: 9443} + filter_chains: + - transport_socket: + name: envoy.transport_sockets.tls + typed_config: + "@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext + common_tls_context: + tls_params: {tls_minimum_protocol_version: TLSv1_2} + tls_certificates: + - certificate_chain: {filename: /run/tls/issuer.crt} + private_key: {filename: /run/tls/issuer.key} + filters: + - name: envoy.filters.network.http_connection_manager + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager + stat_prefix: issuer_https + use_remote_address: true + normalize_path: true + merge_slashes: true + path_with_escaped_slashes_action: REJECT_REQUEST + route_config: + name: issuer + virtual_hosts: + - name: issuer + domains: ["identity.reference.test:9443"] + routes: + - match: {prefix: /} + route: {cluster: issuer_front} + http_filters: + - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router + # Checked Envoy reaches these three private, distinct first hops. + - name: to_registry + address: + socket_address: {address: 127.0.0.1, port_value: 8100} + filter_chains: + - filters: + - name: envoy.filters.network.tcp_proxy + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy + stat_prefix: to_registry + cluster: registry_socket + - name: to_pages + address: + socket_address: {address: 127.0.0.1, port_value: 8200} + filter_chains: + - filters: + - name: envoy.filters.network.tcp_proxy + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy + stat_prefix: to_pages + cluster: pages_socket + - name: to_functions + address: + socket_address: {address: 127.0.0.1, port_value: 8300} + filter_chains: + - filters: + - name: envoy.filters.network.tcp_proxy + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy + stat_prefix: to_functions + cluster: functions_socket + clusters: + - name: app_tls + type: STATIC + connect_timeout: 2s + load_assignment: + cluster_name: app_tls + endpoints: + - lb_endpoints: + - endpoint: + address: + socket_address: {address: 127.0.0.1, port_value: 8443} + - name: issuer_front + type: STRICT_DNS + connect_timeout: 2s + load_assignment: + cluster_name: issuer_front + endpoints: + - lb_endpoints: + - endpoint: + address: + socket_address: {address: identity-gateway, port_value: 8080} + - name: registry_socket + type: STATIC + connect_timeout: 2s + load_assignment: + cluster_name: registry_socket + endpoints: + - lb_endpoints: + - endpoint: + address: + pipe: {path: /run/relay/registry.sock} + - name: pages_socket + type: STATIC + connect_timeout: 2s + load_assignment: + cluster_name: pages_socket + endpoints: + - lb_endpoints: + - endpoint: + address: + pipe: {path: /run/relay/pages.sock} + - name: functions_socket + type: STATIC + connect_timeout: 2s + load_assignment: + cluster_name: functions_socket + endpoints: + - lb_endpoints: + - endpoint: + address: + pipe: {path: /run/relay/functions.sock} diff --git a/deploy/examples/business-registration/host.mjs b/deploy/examples/business-registration/host.mjs new file mode 100644 index 0000000000..9349b467d1 --- /dev/null +++ b/deploy/examples/business-registration/host.mjs @@ -0,0 +1,132 @@ +import { createHash } from 'node:crypto' +import { readFile, realpath } from 'node:fs/promises' +import { isAbsolute, join, relative, sep } from 'node:path' +import { pathToFileURL } from 'node:url' +import { serve } from 'srvx/node' + +const functionName = 'register-business' +const functionPath = '/functions/' + functionName +const pages = new Map([ + ['/index.html', 'text/html; charset=utf-8'], + ['/app.js', 'text/javascript; charset=utf-8'], + ['/service.css', 'text/css; charset=utf-8'], +]) + +async function readBundleFile(root, path) { + const resolved = await realpath(join(root, path)) + const location = relative(root, resolved) + if (location === '..' || location.startsWith('..' + sep) || isAbsolute(location)) { + throw new Error('A runtime file leaves the bundle.') + } + return readFile(resolved) +} + +async function readBundle(directory) { + if (!isAbsolute(directory ?? '')) throw new Error('Use an absolute preview bundle directory.') + const root = await realpath(directory) + const manifestBytes = await readBundleFile(root, 'manifest.json') + const manifest = JSON.parse(manifestBytes) + if (manifest.product?.id !== 'businesses' || manifest.product.profile !== 'business-registrar' + || !Array.isArray(manifest.functions) || manifest.functions.length !== 1 || manifest.functions[0] !== functionName + || typeof manifest.staticOutput !== 'string' || !manifest.staticOutput || isAbsolute(manifest.staticOutput)) { + throw new Error('Use the business-registration preview bundle.') + } + const modulePath = 'functions/' + functionName + '.mjs' + const files = new Map([['manifest.json', manifestBytes]]) + for (const path of [modulePath, ...Array.from(pages.keys(), name => join(manifest.staticOutput, name))]) { + files.set(path, await readBundleFile(root, path)) + } + const hashes = Array.from(files, ([path, bytes]) => [path, createHash('sha256').update(bytes).digest('hex')]) + const digest = createHash('sha256').update(JSON.stringify(hashes)).digest('hex') + return { + digest, + module: files.get(modulePath), + assets: new Map(Array.from(pages.keys(), path => [path, files.get(join(manifest.staticOutput, path))])), + } +} + +export async function bundleDigest(directory) { + return (await readBundle(directory)).digest +} + +async function requestFunction(request, handle) { + const url = new URL(request.url) + if (url.pathname !== functionPath || url.search) return new Response(null, { status: 404 }) + if (request.method !== 'POST') return new Response(null, { status: 405, headers: { allow: 'POST' } }) + // The checked Envoy route supplies the caller's bearer over private loopback. + if (!/^Bearer [A-Za-z0-9._-]+$/u.test(request.headers.get('authorization') ?? '')) { + return new Response(null, { status: 401, headers: { 'cache-control': 'no-store' } }) + } + // Read through srvx's limit before the function can catch a body read error. + const body = await request.arrayBuffer() + return handle(new Request(request.url, { method: request.method, headers: request.headers, body })) +} + +function requestPage(request, assets) { + const pathname = new URL(request.url).pathname + const path = pathname === '/' ? '/index.html' : pathname + const bytes = assets.get(path) + if (!bytes) return new Response(null, { status: 404 }) + if (request.method !== 'GET' && request.method !== 'HEAD') { + return new Response(null, { status: 405, headers: { allow: 'GET, HEAD' } }) + } + return new Response(request.method === 'GET' ? bytes : null, { + headers: { 'content-type': pages.get(path), 'x-content-type-options': 'nosniff' }, + }) +} + +export async function startHost(directory, expectedDigest, { functionsPort = 8300, pagesPort = 8200 } = {}) { + const bundle = await readBundle(directory) + if (bundle.digest !== expectedDigest) throw new Error('The preview bundle digest differs from the deployment pin.') + // Import the bytes that were checked. The compiler emits a self-contained ESM module. + const { default: createHandler } = await import('data:text/javascript;base64,' + bundle.module.toString('base64')) + const handle = await createHandler({ products: { businesses: { baseUrl: 'http://127.0.0.1:8100' } } }) + if (typeof handle !== 'function') throw new TypeError('The compiled registration module must create a handler.') + + const options = { hostname: '127.0.0.1', silent: true, gracefulShutdown: false } + const functions = serve({ + ...options, + port: functionsPort, + maxRequestBodySize: 32_768, + fetch: request => requestFunction(request, handle), + error(error) { + if (error?.code === 'ERR_BODY_TOO_LARGE') return new Response(null, { status: 413 }) + console.error('The registration function could not complete its request.') + return new Response(null, { status: 500 }) + }, + }) + const staticPages = serve({ ...options, port: pagesPort, fetch: request => requestPage(request, bundle.assets) }) + try { + await Promise.all([functions.ready(), staticPages.ready()]) + } catch (error) { + await Promise.allSettled([functions.close(true), staticPages.close(true)]) + throw error + } + return { + functionsOrigin: new URL(functions.url).origin, + pagesOrigin: new URL(staticPages.url).origin, + close: () => Promise.all([functions.close(true), staticPages.close(true)]), + } +} + +if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { + if (process.argv[2] === '--digest') { + console.log(await bundleDigest(process.argv[3])) + } else { + try { + const host = await startHost(process.env.BUSINESS_BUNDLE, process.env.BUSINESS_BUNDLE_SHA256) + const stop = () => host.close().catch(() => { + console.error('The reference host could not close its listeners.') + process.exitCode = 1 + }) + process.once('SIGINT', stop) + process.once('SIGTERM', stop) + } catch (error) { + const message = error.message === 'The preview bundle digest differs from the deployment pin.' + ? error.message + : 'The reference host could not load its checked bundle or start its private listeners.' + console.error(message) + process.exitCode = 1 + } + } +} diff --git a/deploy/examples/business-registration/identity-deployment.yaml b/deploy/examples/business-registration/identity-deployment.yaml new file mode 100644 index 0000000000..43a47ebd08 --- /dev/null +++ b/deploy/examples/business-registration/identity-deployment.yaml @@ -0,0 +1,28 @@ +apiVersion: id.registrystack.org/formats/platform/identity-deployment/v1 +kind: PlatformIdentityDeployment +organizationUnit: + handle: business-registration + name: Business registration +personAudience: urn:example:business-register +sessionApps: + - id: business-registrar + clientSecretRef: secret:env/REGISTRAR_CLIENT_SECRET + origin: https://127.0.0.1:8443 + redirectUris: [https://127.0.0.1:8443/session/callback] + postLogoutRedirectUris: [https://127.0.0.1:8443/session/signed-out] + products: [breg] + tokenAttributes: [registry_actor_kind, registry_office] + grants: + - product: breg + accessProfiles: [business-registrar] +users: + - id: reference-registrar + username: reference-registrar + email: reference-registrar@example.invalid + passwordRef: secret:env/REGISTRAR_PASSWORD + claims: + registry_actor_kind: human + registry_office: central + grants: + - product: breg + accessProfiles: [business-registrar] diff --git a/deploy/examples/business-registration/init-postgres.sh b/deploy/examples/business-registration/init-postgres.sh new file mode 100755 index 0000000000..97420da574 --- /dev/null +++ b/deploy/examples/business-registration/init-postgres.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail + +THUNDERID_DB_PASSWORD=$(&2 + exit 1 +fi +export THUNDERID_DB_PASSWORD +psql --username postgres --dbname postgres --set ON_ERROR_STOP=1 <<'SQL' +SET log_min_error_statement = panic; +\getenv thunderid_password THUNDERID_DB_PASSWORD +CREATE ROLE thunderid LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE PASSWORD :'thunderid_password'; +CREATE DATABASE thunderid_config OWNER thunderid; +CREATE DATABASE thunderid_runtime_transient OWNER thunderid; +CREATE DATABASE thunderid_entity OWNER thunderid; +CREATE DATABASE thunderid_runtime_persistent OWNER thunderid; +REVOKE CONNECT ON DATABASE thunderid_config, thunderid_runtime_transient, thunderid_entity, thunderid_runtime_persistent FROM PUBLIC; +SQL +unset THUNDERID_DB_PASSWORD + +for database in config entity runtime_transient runtime_persistent; do + psql --username postgres --dbname "thunderid_$database" --set ON_ERROR_STOP=1 \ + --command 'SET ROLE thunderid' --file "/run/postgres/schema/$database.sql" +done diff --git a/deploy/examples/business-registration/issuer-ready.mjs b/deploy/examples/business-registration/issuer-ready.mjs new file mode 100644 index 0000000000..46c931385b --- /dev/null +++ b/deploy/examples/business-registration/issuer-ready.mjs @@ -0,0 +1,34 @@ +import { setTimeout as pause } from 'node:timers/promises' + +const issuer = 'https://identity.reference.test:9443' +const jwksUrl = issuer + '/oauth2/jwks' + +async function get(url) { + const response = await fetch(url, { signal: AbortSignal.timeout(1500), redirect: 'error' }) + if (!response.ok) throw new Error('HTTP ' + response.status) + return response.json() +} + +async function waitForIssuer() { + const deadline = Date.now() + 30_000 + let failure + do { + try { + const discovery = await get(issuer + '/.well-known/openid-configuration') + if (discovery.issuer === issuer && discovery.jwks_uri === jwksUrl) { + const { keys } = await get(jwksUrl) + if (Array.isArray(keys) && keys.length > 0) return true + failure = 'signing keys missing' + } else { + failure = 'unexpected discovery metadata' + } + } catch (error) { + failure = error.cause?.code ?? error.name + } + await pause(500) + } while (Date.now() < deadline) + console.error('The reference issuer did not become ready: ' + failure) + return false +} + +if (!(await waitForIssuer())) process.exitCode = 1 diff --git a/deploy/examples/business-registration/package-lock.json b/deploy/examples/business-registration/package-lock.json new file mode 100644 index 0000000000..d2a97cca06 --- /dev/null +++ b/deploy/examples/business-registration/package-lock.json @@ -0,0 +1,28 @@ +{ + "name": "registry-business-registration-reference", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "registry-business-registration-reference", + "dependencies": { + "srvx": "1.0.8" + }, + "engines": { + "node": ">=24 <25" + } + }, + "node_modules/srvx": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/srvx/-/srvx-1.0.8.tgz", + "integrity": "sha512-ngFS/J6St4PJfHRHGjr78xkPPtbyXtdMOLNE4x/XZunEK3OhV7aGUWMHf9WTUEy6wm1U0W4okkd82ZFFWRVQTw==", + "license": "MIT", + "bin": { + "srvx": "bin/srvx.mjs" + }, + "engines": { + "node": ">=20.16.0" + } + } + } +} diff --git a/deploy/examples/business-registration/package.json b/deploy/examples/business-registration/package.json new file mode 100644 index 0000000000..5816515a72 --- /dev/null +++ b/deploy/examples/business-registration/package.json @@ -0,0 +1,7 @@ +{ + "name": "registry-business-registration-reference", + "private": true, + "engines": { "node": ">=24 <25" }, + "dependencies": { "srvx": "1.0.8" }, + "scripts": { "test": "node --test tests/host.test.mjs" } +} diff --git a/deploy/examples/business-registration/pg_hba.conf b/deploy/examples/business-registration/pg_hba.conf new file mode 100644 index 0000000000..1a2304cecb --- /dev/null +++ b/deploy/examples/business-registration/pg_hba.conf @@ -0,0 +1,3 @@ +local all all peer +hostssl all all 0.0.0.0/0 scram-sha-256 +hostssl all all ::/0 scram-sha-256 diff --git a/deploy/examples/business-registration/session.yaml b/deploy/examples/business-registration/session.yaml new file mode 100644 index 0000000000..8e9d433af8 --- /dev/null +++ b/deploy/examples/business-registration/session.yaml @@ -0,0 +1,54 @@ +apiVersion: id.registrystack.org/formats/platform/session-runtime/v1alpha1 +kind: PlatformSessionRuntimeConfig +listener: + bind: 127.0.0.1:8120 + tlsTermination: operator-controlled-upstream +checkListener: 127.0.0.1:8121 +publicOrigin: https://127.0.0.1:8443 +secretProviders: + file: + root: /run/session-secrets +issuer: + id: https://identity.reference.test:9443 + authorization: https://identity.reference.test:9443/oauth2/authorize + endSession: https://identity.reference.test:9443/oauth2/logout + token: https://identity.reference.test:9443/oauth2/token + revocation: https://identity.reference.test:9443/oauth2/revoke + jwks: https://identity.reference.test:9443/oauth2/jwks +personAudience: urn:example:business-register +gateway: + service: + host: 127.0.0.1 + publicPort: 8120 + checkPort: 8121 +modules: + - id: businesses + product: breg + prefix: /registry/businesses/ + audience: person + signIns: [registrar] + upstream: + cluster: registry + prefixRewrite: / + - id: functions + product: breg + prefix: /api/functions/ + audience: person + signIns: [registrar] + upstream: + cluster: functions + prefixRewrite: /functions/ +pages: + - prefix: /apply/ + signIn: registrar + upstream: + cluster: pages + prefixRewrite: / +signIns: + registrar: + clientId: business-registrar + clientSecretRef: secret:file/registrar-client + scopes: [registry:business:register] +audit: + hashKeyRef: secret:file/audit-key + path: /var/lib/session/audit.jsonl diff --git a/deploy/examples/business-registration/tests/host.test.mjs b/deploy/examples/business-registration/tests/host.test.mjs new file mode 100644 index 0000000000..d9a79d5529 --- /dev/null +++ b/deploy/examples/business-registration/tests/host.test.mjs @@ -0,0 +1,69 @@ +import assert from 'node:assert/strict' +import { mkdtemp, mkdir, writeFile, rm, symlink } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { test } from 'node:test' +import { bundleDigest, startHost } from '../host.mjs' + +async function fixture(t) { + const root = await mkdtemp(join(tmpdir(), 'reference-host-test-')) + t.after(() => rm(root, { recursive: true })) + await mkdir(join(root, 'functions')) + await mkdir(join(root, 'project/web/dist'), { recursive: true }) + const manifest = { + product: { id: 'businesses', profile: 'business-registrar' }, + functions: ['register-business'], + staticOutput: 'project/web/dist', + } + await writeFile(join(root, 'manifest.json'), JSON.stringify(manifest)) + await writeFile(join(root, 'functions/register-business.mjs'), ` + export default ({ products }) => request => { + if (products.businesses.baseUrl !== 'http://127.0.0.1:8100') throw new Error('Wrong upstream') + return Response.json({ caller: request.headers.get('authorization') === 'Bearer synthetic.caller.token' }) + } + `) + for (const name of ['index.html', 'app.js', 'service.css']) { + await writeFile(join(root, 'project/web/dist', name), name) + } + return root +} + +test('loads the checked bundle and serves only the declared function and page assets', async t => { + const root = await fixture(t) + const host = await startHost(root, await bundleDigest(root), { functionsPort: 0, pagesPort: 0 }) + t.after(host.close) + const route = host.functionsOrigin + '/functions/register-business' + const headers = { authorization: 'Bearer synthetic.caller.token' } + + assert.equal((await fetch(route, { method: 'POST' })).status, 401) + assert.equal((await fetch(route, { method: 'POST', headers: { authorization: 'Bearer a, Bearer b' } })).status, 401) + assert.equal((await fetch(route, { headers })).status, 405) + assert.equal((await fetch(route + '?unexpected=true', { method: 'POST', headers })).status, 404) + assert.deepEqual(await (await fetch(route, { method: 'POST', headers })).json(), { caller: true }) + assert.equal((await fetch(route, { method: 'POST', headers, body: 'x'.repeat(32_769) })).status, 413) + + const page = await fetch(host.pagesOrigin) + assert.equal((await page.text()), 'index.html') + assert.equal(page.headers.get('content-type'), 'text/html; charset=utf-8') + assert.equal(page.headers.get('x-content-type-options'), 'nosniff') + assert.equal((await fetch(host.pagesOrigin + '/app.js', { method: 'HEAD' })).status, 200) + assert.equal((await fetch(host.pagesOrigin + '/app.js', { method: 'POST' })).status, 405) + for (const path of ['/manifest.json', '/functions/register-business.mjs', '/project/web/dist/index.html']) { + assert.equal((await fetch(host.pagesOrigin + path)).status, 404) + } +}) + +test('refuses changed bundles before importing function code', async t => { + const root = await fixture(t) + const expected = await bundleDigest(root) + await writeFile(join(root, 'functions/register-business.mjs'), 'throw new Error("never import this")') + await assert.rejects(startHost(root, expected), /bundle digest differs/) +}) + +test('refuses files that resolve outside the bundle', async t => { + const root = await fixture(t) + const file = join(root, 'project/web/dist/app.js') + await rm(file) + await symlink('/etc/hosts', file) + await assert.rejects(bundleDigest(root), /leaves the bundle/) +}) diff --git a/deploy/examples/business-registration/tests/smoke.sh b/deploy/examples/business-registration/tests/smoke.sh new file mode 100755 index 0000000000..e23a23bc9c --- /dev/null +++ b/deploy/examples/business-registration/tests/smoke.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +set -euo pipefail + +ca=${1:?Pass the HTTPS CA file for the disposable reference stack.} +app=https://127.0.0.1:8443 +issuer=https://identity.reference.test:9443 +http=(curl --silent --show-error --noproxy '*' --cacert "$ca" --max-time 10) +identity=("${http[@]}" --resolve identity.reference.test:9443:127.0.0.1) + +expect_status() { + local expected=$1 status + shift + status=$("$@" --output /dev/null --write-out '%{http_code}') + if [[ "$status" != "$expected" ]]; then + printf 'Expected HTTP %s, received %s.\n' "$expected" "$status" >&2 + exit 1 + fi +} + +"${identity[@]}" --fail "$issuer/.well-known/openid-configuration" | + jq -e --arg issuer "$issuer" '.issuer == $issuer' >/dev/null +expect_status 404 "${identity[@]}" "$issuer/applications" +expect_status 403 "${identity[@]}" -H 'X-HTTP-Method-Override: GET' "$issuer/.well-known/openid-configuration" +expect_status 302 "${http[@]}" "$app/apply/" +expect_status 401 "${http[@]}" -H 'Registry-Client: page' "$app/registry/businesses/v1/records/businesses" +function_call=("${http[@]}" -X POST -H 'Registry-Client: page' -H "Origin: $app" + -H 'Authorization: Bearer synthetic.browser.value' "$app/api/functions/register-business") +expect_status 401 "${function_call[@]}" +"${function_call[@]}" | jq -e '.code == "session.expired"' >/dev/null +expect_status 403 "${http[@]}" -X POST -H 'Registry-Client: page' -H "Origin: $issuer" \ + "$app/api/functions/register-business" +expect_status 404 "${http[@]}" "$app/check/businesses" +printf 'HTTPS issuer, private routes, signed-in page redirect and session refusals passed.\n' diff --git a/deploy/examples/business-registration/tests/test_compose.py b/deploy/examples/business-registration/tests/test_compose.py new file mode 100644 index 0000000000..cdf540f87c --- /dev/null +++ b/deploy/examples/business-registration/tests/test_compose.py @@ -0,0 +1,84 @@ +"""Check the reference's published listeners and private service boundaries.""" + +import json +import os +from pathlib import Path +import shutil +import subprocess +import unittest + + +EXAMPLE = Path(__file__).resolve().parents[1] +DOCKER = shutil.which("docker") + + +@unittest.skipUnless(DOCKER, "Docker Compose is needed to render the reference") +class ComposeReference(unittest.TestCase): + @classmethod + def setUpClass(cls): + if subprocess.run([DOCKER, "compose", "version"], capture_output=True).returncode: + raise unittest.SkipTest("The Docker Compose plugin is unavailable") + env = dict(os.environ, REFERENCE_CONFIG="/reference/config", REFERENCE_ARTIFACTS="/reference/bin", + BUSINESS_BUNDLE="/reference/bundle", BUSINESS_BUNDLE_SHA256="0" * 64) + rendered = subprocess.run( + [DOCKER, "compose", "-f", str(EXAMPLE / "compose.yaml"), "--profile", "setup", + "config", "--format", "json"], env=env, check=True, capture_output=True, text=True, + ) + cls.compose = json.loads(rendered.stdout) + cls.services = cls.compose["services"] + + def test_only_the_loopback_edge_publishes_ports(self): + bindings = {name: service["ports"] for name, service in self.services.items() if service.get("ports")} + self.assertEqual(list(bindings), ["edge"]) + self.assertEqual( + {(row["host_ip"], row["published"], row["target"]) for row in bindings["edge"]}, + {("127.0.0.1", "8443", 8080), ("127.0.0.1", "9443", 9443)}, + ) + + def test_credential_endpoints_and_plaintext_hops_are_separate(self): + self.assertEqual(self.services["gateway"]["network_mode"], "service:edge") + self.assertEqual(self.services["session"]["network_mode"], "service:edge") + self.assertEqual(self.services["application"]["network_mode"], "service:upstreams") + self.assertEqual(self.services["breg"]["network_mode"], "service:upstreams") + backend = set(self.services["thunderid"]["networks"]) + self.assertTrue(backend.isdisjoint(self.services["upstreams"]["networks"])) + self.assertTrue(backend.isdisjoint(self.services["edge"]["networks"])) + self.assertTrue(set(self.services["identity-gateway"]["networks"]).isdisjoint( + self.services["upstreams"]["networks"] + )) + self.assertEqual(set(self.services["postgres"]["networks"]), {"database", "identity-database"}) + self.assertEqual(set(self.compose["volumes"]), {"issuer-certs", "issuer-secrets", "postgres-data"}) + + def test_checked_snapshot_and_bundle_are_read_only_in_consumers(self): + gateway = self.services["gateway"] + self.assertEqual(gateway["depends_on"]["gateway-check"]["condition"], "service_completed_successfully") + self.assertEqual(gateway["command"], ["-c", "/run/gateway/envoy.json"]) + self.assertEqual(self.services["gateway-check"]["command"][-2:], [ + "/run/gateway-input/envoy.json", "/run/gateway", + ]) + self.assertEqual(self.services["gateway-check"]["network_mode"], "none") + checked = next(mount for mount in gateway["volumes"] if mount["target"] == "/run/gateway") + self.assertEqual(checked["source"], "/reference/config/gateway-checked") + self.assertTrue(checked["read_only"]) + app = self.services["application"] + self.assertEqual([mount["target"] for mount in app["volumes"]], ["/run/bundle"]) + self.assertTrue(app["volumes"][0]["read_only"]) + self.assertEqual(app["environment"]["BUSINESS_BUNDLE_SHA256"], "0" * 64) + + def test_one_shots_keep_bootstrap_authority_out_of_serving_mounts(self): + for name in ("breg-admin", "thunderid-setup"): + self.assertEqual(self.services[name]["profiles"], ["setup"]) + boot = self.services["thunderid-setup"]["volumes"] + serve = self.services["thunderid"]["volumes"] + self.assertTrue(any("bootstrap-secrets" in mount["source"] for mount in boot)) + self.assertFalse(any("bootstrap-secrets" in mount["source"] for mount in serve)) + self.assertFalse(any("/config/resources" in mount["target"] for mount in boot)) + self.assertFalse(any("/breg/admin" in mount["source"] for mount in self.services["breg"]["volumes"])) + + def test_breg_waits_for_the_issuer_from_its_own_namespace(self): + readiness = self.services["issuer-ready"] + self.assertEqual(readiness["network_mode"], self.services["breg"]["network_mode"]) + self.assertEqual( + self.services["breg"]["depends_on"]["issuer-ready"]["condition"], "service_completed_successfully" + ) + self.assertTrue(all(mount["read_only"] for mount in readiness["volumes"])) diff --git a/deploy/examples/business-registration/tests/test_gateway_check.py b/deploy/examples/business-registration/tests/test_gateway_check.py new file mode 100644 index 0000000000..5744eb134e --- /dev/null +++ b/deploy/examples/business-registration/tests/test_gateway_check.py @@ -0,0 +1,81 @@ +"""Exercise the gateway one-shot with a stand-in for the Session CLI.""" + +import os +from pathlib import Path +import subprocess +from tempfile import TemporaryDirectory +import unittest + + +EXAMPLE = Path(__file__).resolve().parents[1] + + +class GatewayCheck(unittest.TestCase): + def setUp(self): + self.root = Path(self.enterContext(TemporaryDirectory())) + self.input = self.root / "envoy.json" + self.input.write_bytes(b'{"candidate":true}\n') + self.output = self.root / "checked" + self.output.mkdir() + self.installed = self.output / "envoy.json" + self.installed.write_bytes(b'{"previous":true}\n') + self.session = self.root / "registry-session" + self.session.write_text("""#!/usr/bin/env python3 +import os +from pathlib import Path +import sys + +root = Path(__file__).parent +runtime = root / "session.yaml" +identity = root / "identity-receipt.json" +assert sys.argv[1:3] == ["--runtime-config", str(runtime)] +args = sys.argv[3:] +if args[0] == "check": + assert args == [ + "check", "--posture", "production", "--deny-warnings", "--identity-receipt", str(identity), + ] + sys.exit(0) + +assert args[:5] == ["gateway", "envoy", "--posture", "production", "--verify-assembled"] +assert args[6] == "--route-inventory-out" +assert args[8:] == ["--checked-route", "businesses"] +staged, inventory = Path(args[5]), Path(args[7]) +source = root / "envoy.json" +assert staged != source and staged.read_bytes() == source.read_bytes() +assert staged.parent == inventory.parent and not inventory.exists() +outcome = os.environ["EXPORT_OUTCOME"] +if outcome == "refused": + sys.exit(1) +if outcome == "accepted": + inventory.write_text("{}") + source.write_text("changed after staging") +""") + self.session.chmod(0o700) + + def run_check(self, outcome): + return subprocess.run( + ["bash", str(EXAMPLE / "check-gateway.sh"), str(self.session), + str(self.root), str(self.input), str(self.output)], + capture_output=True, text=True, env=dict(os.environ, EXPORT_OUTCOME=outcome), + ) + + def test_installs_exact_bytes_checked_by_strict_export(self): + original = self.input.read_bytes() + result = self.run_check("accepted") + self.assertEqual(result.returncode, 0, result.stderr) + self.assertNotEqual(self.input.read_bytes(), original) + self.assertEqual(self.installed.read_bytes(), original) + self.assertEqual(list(self.output.iterdir()), [self.installed]) + + def test_retains_installed_bytes_when_strict_export_refuses(self): + result = self.run_check("refused") + self.assertEqual(result.returncode, 1, result.stderr) + self.assertEqual(self.installed.read_bytes(), b'{"previous":true}\n') + self.assertEqual(list(self.output.iterdir()), [self.installed]) + + def test_requires_export_output_before_installing(self): + result = self.run_check("no-inventory") + self.assertEqual(result.returncode, 1, result.stderr) + self.assertIn("route inventory", result.stderr) + self.assertEqual(self.installed.read_bytes(), b'{"previous":true}\n') + self.assertEqual(list(self.output.iterdir()), [self.installed]) diff --git a/deploy/examples/business-registration/thunderid.sh b/deploy/examples/business-registration/thunderid.sh new file mode 100644 index 0000000000..2116e5d375 --- /dev/null +++ b/deploy/examples/business-registration/thunderid.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +set -euo pipefail + +read_secret() { + local name=$1 value + value=$(<"/run/identity-secrets/$name") + if [[ -z "$value" ]]; then + printf 'Missing ThunderID input %s.\n' "$name" >&2 + exit 1 + fi + printf -v "$name" '%s' "$value" + export "${name?}" +} + +read_secret DB_CONFIG_PASSWORD +export DB_RUNTIME_TRANSIENT_PASSWORD="$DB_CONFIG_PASSWORD" +export DB_ENTITY_PASSWORD="$DB_CONFIG_PASSWORD" +export DB_RUNTIME_PERSISTENT_PASSWORD="$DB_CONFIG_PASSWORD" + +case "${1:-}" in + serve) + read_secret REGISTRAR_CLIENT_SECRET + read_secret REGISTRAR_PASSWORD + exec ./start.sh + ;; + setup) + read_secret ADMIN_PASSWORD + # Suppress the upstream bootstrap's credential notices. + if ./setup.sh >/dev/null 2>&1; then + printf 'ThunderID bootstrap completed.\n' + else + status=$? + printf 'ThunderID bootstrap failed with status %s. Check the reviewed bootstrap inputs.\n' "$status" >&2 + exit "$status" + fi + ;; + *) + printf 'Choose ThunderID setup or serve.\n' >&2 + exit 2 + ;; +esac diff --git a/deploy/examples/business-registration/thunderid.yaml b/deploy/examples/business-registration/thunderid.yaml new file mode 100644 index 0000000000..f7edabe8ed --- /dev/null +++ b/deploy/examples/business-registration/thunderid.yaml @@ -0,0 +1,57 @@ +server: + hostname: 0.0.0.0 + port: 8090 + http_only: true + public_url: https://identity.reference.test:9443 + security: + direct_auth_secret: file://config/secrets/direct_auth_secret +jwt: + issuer: https://identity.reference.test:9443 + preferred_key_id: default-key +crypto: + encryption: + key: file://config/certs/crypto.key + keys: + - id: default-key + cert_file: config/certs/signing.cert + key_file: config/certs/signing.key + - id: ecdsa-key + cert_file: config/certs/ecdsa-signing.cert + key_file: config/certs/ecdsa-signing.key +database: + config: + type: postgres + postgres: + hostname: postgres + port: 5432 + name: thunderid_config + username: thunderid + password: "{{.DB_CONFIG_PASSWORD}}" + sslmode: verify-full + runtime_transient: + type: postgres + postgres: + hostname: postgres + port: 5432 + name: thunderid_runtime_transient + username: thunderid + password: "{{.DB_RUNTIME_TRANSIENT_PASSWORD}}" + sslmode: verify-full + entity: + type: postgres + postgres: + hostname: postgres + port: 5432 + name: thunderid_entity + username: thunderid + password: "{{.DB_ENTITY_PASSWORD}}" + sslmode: verify-full + runtime_persistent: + type: postgres + postgres: + hostname: postgres + port: 5432 + name: thunderid_runtime_persistent + username: thunderid + password: "{{.DB_RUNTIME_PERSISTENT_PASSWORD}}" + sslmode: verify-full diff --git a/deploy/examples/business-registration/upstreams.yaml b/deploy/examples/business-registration/upstreams.yaml new file mode 100644 index 0000000000..551b767931 --- /dev/null +++ b/deploy/examples/business-registration/upstreams.yaml @@ -0,0 +1,63 @@ +static_resources: + listeners: + - name: from_registry + address: + pipe: {path: /run/relay/registry.sock, mode: 384} + filter_chains: + - filters: + - name: envoy.filters.network.tcp_proxy + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy + stat_prefix: from_registry + cluster: registry + - name: from_pages + address: + pipe: {path: /run/relay/pages.sock, mode: 384} + filter_chains: + - filters: + - name: envoy.filters.network.tcp_proxy + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy + stat_prefix: from_pages + cluster: pages + - name: from_functions + address: + pipe: {path: /run/relay/functions.sock, mode: 384} + filter_chains: + - filters: + - name: envoy.filters.network.tcp_proxy + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy + stat_prefix: from_functions + cluster: functions + clusters: + - name: registry + type: STATIC + connect_timeout: 2s + load_assignment: + cluster_name: registry + endpoints: + - lb_endpoints: + - endpoint: + address: + socket_address: {address: 127.0.0.1, port_value: 8100} + - name: pages + type: STATIC + connect_timeout: 2s + load_assignment: + cluster_name: pages + endpoints: + - lb_endpoints: + - endpoint: + address: + socket_address: {address: 127.0.0.1, port_value: 8200} + - name: functions + type: STATIC + connect_timeout: 2s + load_assignment: + cluster_name: functions + endpoints: + - lb_endpoints: + - endpoint: + address: + socket_address: {address: 127.0.0.1, port_value: 8300} diff --git a/docs/site/astro.config.mjs b/docs/site/astro.config.mjs index c877023df3..18e04bb609 100644 --- a/docs/site/astro.config.mjs +++ b/docs/site/astro.config.mjs @@ -802,6 +802,7 @@ export default defineConfig({ items: [ { label: 'Overview', slug: 'start/breg-quickstart' }, { label: 'Your first registry', slug: 'tutorials/first-breg' }, + { label: 'Preview a browser service', slug: 'tutorials/preview-a-breg-service' }, { label: 'How a registry works', slug: 'explanation/configuration-defined-registry' }, { label: 'Tutorials', diff --git a/docs/site/scripts/generate-coordinator-configuration.test.mjs b/docs/site/scripts/generate-coordinator-configuration.test.mjs index f60c6147a1..2ba4c6d542 100644 --- a/docs/site/scripts/generate-coordinator-configuration.test.mjs +++ b/docs/site/scripts/generate-coordinator-configuration.test.mjs @@ -31,9 +31,10 @@ test('Coordinator project and runtime references carry the keys authors and oper const keys = (id) => new Set(document.contracts.find((contract) => contract.id === id) .fields.map((field) => field.key_path)); const project = keys('project'); - for (const path of ['workflow.steps', 'workflow.start', 'operations.*.uses', 'functions.*.entrypoint']) { + for (const path of ['workflow.steps', 'workflow.start', 'operations.*.uses', 'transforms.*.entrypoint']) { assert.ok(project.has(path), path); } + assert.ok(!project.has('functions.*.entrypoint')); const runtime = keys('runtime'); for (const path of [ 'connections', diff --git a/docs/site/scripts/information-architecture.test.mjs b/docs/site/scripts/information-architecture.test.mjs index 1fd830d676..300164ab73 100644 --- a/docs/site/scripts/information-architecture.test.mjs +++ b/docs/site/scripts/information-architecture.test.mjs @@ -13,6 +13,7 @@ import { RETIRED_RELAY_ROUTES, } from '../src/lib/relay-retirement-redirects.mjs'; import { flattenSidebarGroups } from '../src/lib/sidebar.mjs'; +import { readJourney } from './tutorial-runner/page.mjs'; import { docsetPublishesBregOpenApi, docsetPublishesEvidenceOid4vciOpenApi, @@ -890,6 +891,7 @@ test('keeps the BReg guide and references in one adoption path', () => { assert.deepEqual(slugs, [ 'start/breg-quickstart', 'tutorials/first-breg', + 'tutorials/preview-a-breg-service', 'explanation/configuration-defined-registry', 'tutorials/change-a-registry-with-an-action', 'tutorials/extend-a-registry-with-a-module', @@ -943,6 +945,7 @@ test('keeps the BReg guide and references in one adoption path', () => { breg, [ "slug: 'tutorials/first-breg'", + "slug: 'tutorials/preview-a-breg-service'", "label: 'Tutorials'", "label: 'Author a registry'", "label: 'Deploy and operate'", @@ -952,6 +955,8 @@ test('keeps the BReg guide and references in one adoption path', () => { ], 'Base Registry Engine', ); + const overview = readFileSync(resolve(siteRoot, 'src/content/docs/start/breg-quickstart.mdx'), 'utf8'); + assert.match(overview, /\]\(\.\.\/\.\.\/tutorials\/preview-a-breg-service\/\)/u); // The homepage names the doors into the path, not every room: the overview, // the first tutorial, the deployment page, and the tutorial @@ -972,6 +977,17 @@ test('keeps the BReg guide and references in one adoption path', () => { } }); +test('reads the first BReg tutorial development files from the scaffold', () => { + const firstBreg = readFileSync(resolve(siteRoot, 'src/content/docs/tutorials/first-breg.mdx'), 'utf8'); + const { steps, errors } = readJourney(firstBreg); + assert.deepEqual(errors, []); + const devFiles = steps.filter(({ path }) => path === 'dev.yaml' || path === 'dev-journeys.yaml'); + assert.deepEqual(devFiles.map(({ kind, path }) => [kind, path]), [ + ['excerpt', 'dev.yaml'], + ['excerpt', 'dev-journeys.yaml'], + ]); +}); + // Both runtime products ask an adopter for infrastructure before they serve // anything: PostgreSQL, a token issuer, and a signing process for Base Registry // Engine; a Transit proxy, an identity provider, and durable audit storage for diff --git a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx index 7eac1e4295..efd477e569 100644 --- a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx +++ b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx @@ -910,21 +910,32 @@ A later `start` creates a fresh application run. Product data on managed Postgre crates/registry-rstack-dev/src/lib.rs application-root; crates/registry-rstack-dev/src/products.rs PreparedApplication. */} -### Choose a function or a flow - -Use a server-side function for work that finishes within one request. Use a Coordinator flow when -work waits for a person or a date, or when each step needs review. When a step needs code the -flow cannot express, the existing -[`external.command/v1` operation](../coordinator/#call-an-external-provider) can call an external -provider. The operator binds the destination and credential in the Coordinator runtime file. - -A function owns no product authority. The product authorises every call the function makes. -When the whole procedure lives in function code, you lose the Coordinator diagram and its -record of each step. - -{/* Evidence: crates/registry-coordinator/src/operations.rs, operation_catalog; - products/coordinator/AGENTS.md, Registry Coordinator product; - docs/site/src/content/docs/configure/coordinator.mdx. */} +### Choose a service function or a Coordinator flow + +Use a service function for work that finishes within one request. A service function is +server-side code that your application calls. In business registration, it can check the +submitted details and call the BReg Action that creates the Record. In medical licence renewal, +it can prepare a new expiry and call the BReg renewal Action with the condition the holder +reviewed. In each case, the write completes within the request. + +Use a Coordinator flow when work waits for a person or a date, or when reviewers need to +inspect the steps of a procedure. For example, a flow can request an officer's review, wait +for the decision, and then call the product that carries out the next step. Call a service +function for an individual step the flow cannot express. To call your code through the +current [external provider operation](../coordinator/#call-an-external-provider), implement +the external command contract and have your operator configure the provider. + +A service function holds no authority of its own. Send Record changes through the owning +product under the caller's authority. BReg checks that authority before it carries out the +Action. You can draw a Coordinator flow from its declared steps and inspect the record of +each run's steps. If you write the whole procedure as function code, you give up that drawing +and per-step record. + +{/* Evidence: crates/registry-coordinator/src/definition.rs, Step::WaitUntil, Step::WaitFor; + crates/registry-coordinator/src/cli.rs, render_explain; + crates/registry-coordinator/src/store.rs, RunInspection; + crates/registry-coordinator/src/operations.rs, external.command/v1; + crates/registry-breg/src/api/actions.rs, authorize_action_mode. */} ### Browser issuer diff --git a/docs/site/src/content/docs/configure/session.mdx b/docs/site/src/content/docs/configure/session.mdx index cf4a163a57..7f09e99219 100644 --- a/docs/site/src/content/docs/configure/session.mdx +++ b/docs/site/src/content/docs/configure/session.mdx @@ -276,6 +276,34 @@ on other hosts. {/* Evidence: crates/registry-session/src/gateway/verify.rs, write_standalone; crates/registry-session/tests/binary.rs, envoy_validates_the_generated_standalone_configuration. */} +### Export the checked BReg browser route + +Use the dedicated loopback HTTPS assembly for checked route export. Set `publicOrigin` to +`https://127.0.0.1:8443` and give each configured upstream a distinct numeric IPv4 loopback +socket. Session's public and check binds must match the two sockets declared in `gateway.service`. +Keep the issuer endpoints on HTTPS. Configure the BReg route to rewrite its disjoint prefix to `/`. + +Provide absolute certificate and key filenames as Envoy will see them. The generator records +the paths. The browser verifies the live TLS certificate for the numeric origin. + +```bash +registry-session --runtime-config /etc/registry-session/runtime.yaml gateway envoy \ + --standalone-out /etc/envoy/envoy.json --listen 127.0.0.1:8443 \ + --upstream registry=127.0.0.1:8100 --upstream pages=127.0.0.1:8200 \ + --tls-certificate /run/tls/app.crt --tls-key /run/tls/app.key +registry-session --runtime-config /etc/registry-session/runtime.yaml gateway envoy \ + --verify-assembled /etc/envoy/envoy.json --route-inventory-out /tmp/session-routes.json \ + --checked-route breg +``` + +The export checks the standalone Envoy JSON and records the selected BReg product route, +its admitted sign-in kinds and the page bindings. Use it with the assembly that produced it. +Envoy and Session check live requests, and the product authorizes the operation. + +{/* Evidence: crates/registry-session/src/gateway/verify.rs, validate_checked_transport, + verify_checked_transport, write_verified_route_inventory; + crates/registry-session/tests/binary.rs, gateway_inventory_requires_the_exact_verified_assembly. */} + ### Integrate with an existing gateway Generate into a directory you reserve for these files. diff --git a/docs/site/src/content/docs/security/session.mdx b/docs/site/src/content/docs/security/session.mdx index 996388e1cb..20ebaae20f 100644 --- a/docs/site/src/content/docs/security/session.mdx +++ b/docs/site/src/content/docs/security/session.mdx @@ -81,6 +81,9 @@ A module's `signIns` list routes kinds of sessions, but grants no product permis 5. Terminate TLS in front of the public listener. The service accepts `development-loopback` only in development posture. Use it for local HTTP in a browser that supports `Secure` cookies on loopback. + For checked browser route export, use the dedicated loopback HTTPS Envoy assembly and deploy + the verified configuration. The browser verifies the ingress certificate. The operator + controls the gateway namespace, private Session sockets and upstream endpoints. 6. Name every host HTTP filter in `gateway.hostFilters`. Retain a filter on a module or page only through `upstream.keepHostFilters`. A retained filter must preserve the path, route cache and authorisation header. diff --git a/docs/site/src/content/docs/start/adopt.mdx b/docs/site/src/content/docs/start/adopt.mdx index 33f506d416..e432783e7b 100644 --- a/docs/site/src/content/docs/start/adopt.mdx +++ b/docs/site/src/content/docs/start/adopt.mdx @@ -140,28 +140,35 @@ Your team owns four things: That answer means that the first request completed. Read its result, such as the Record or the Proposal, and do not send the request again. -Each product still checks every call itself and stores its own results. - -Some sequences of steps run for days or weeks. -For example: ask a reviewer, wait for the decision, then send the applicant a notice. -Add [Registry Coordinator](../../reference/glossary/#registry-coordinator) only when such a -sequence must continue without a person or a running script keeping track of it. -Coordinator runs the sequence as a reviewed workflow. -It keeps the workflow going across long waits, outages, and restarts. -Read the [Coordinator overview](../coordinator/) for more. - -Review alone does not need Coordinator. -Your application can prepare a Proposal, get a Casework review, and have BReg apply it. -A Proposal is a change that BReg holds before it applies it. -BReg freezes exactly what will change when the Proposal is submitted. -Where the Action requires a review, BReg applies the change only after approval. - Add [Registry Messaging](../../reference/glossary/#registry-messaging) only when the application must send messages from templates that were reviewed in advance. Messaging sends one message to one destination over one channel, such as SMS or email. It sends through a messaging provider that is configured for your deployment. It then reports what it knows about delivery. +### Choose a service function or a Coordinator flow + +Use a service function when the work finishes within one request, such as preparing the input +for a licence renewal. The function holds no authority of its own. It asks the owning product +to make the change, and the product checks the caller's authority and stores the result. + +Use a [Registry Coordinator](../coordinator/) flow when the work must wait or someone needs to +review the procedure's steps. For example, the flow can ask for a review, wait for the +decision, and then send the applicant a notice. Call a service function for a step the flow +cannot express. If you write the whole procedure as function code, you give up the drawing +and the record of each step. See [how to choose a service function or a flow](../../configure/run-a-project-with-rstack-dev/#choose-a-service-function-or-a-coordinator-flow). + +If the work is a single review of a BReg change, your application can submit a Proposal to +BReg and let BReg and Casework handle the review. BReg freezes what will change when the +Proposal is submitted. Where the Action requires review, BReg applies the change only after +approval. + +{/* Evidence: crates/registry-coordinator/src/definition.rs, Step::WaitUntil, Step::WaitFor; + crates/registry-coordinator/src/cli.rs, render_explain; + crates/registry-coordinator/src/store.rs, RunInspection; + crates/registry-breg/src/api/actions.rs, authorize_action_mode; + products/breg/contracts/security-invariant-matrix.yaml. */} + ## Run your own module On this page, a module is a service or worker that you write, deploy, and run yourself. diff --git a/docs/site/src/content/docs/start/breg-quickstart.mdx b/docs/site/src/content/docs/start/breg-quickstart.mdx index 95e9457ef1..989cf0e4bd 100644 --- a/docs/site/src/content/docs/start/breg-quickstart.mdx +++ b/docs/site/src/content/docs/start/breg-quickstart.mdx @@ -58,6 +58,8 @@ journal stay on, so the local registry checks each request the way a deployed on ## Then follow your role - **You build applications on a registry.** Keep the + [preview a business registration service](../../tutorials/preview-a-breg-service/) to submit a + test registration from your browser. Keep the [client reference](../../reference/breg-client-capabilities/) open, then [send registry events to a webhook](../../tutorials/send-registry-events-to-a-webhook/) to connect the registry to the systems around it. diff --git a/docs/site/src/content/docs/tutorials/preview-a-breg-service.mdx b/docs/site/src/content/docs/tutorials/preview-a-breg-service.mdx new file mode 100644 index 0000000000..932fa53978 --- /dev/null +++ b/docs/site/src/content/docs/tutorials/preview-a-breg-service.mdx @@ -0,0 +1,113 @@ +--- +title: Preview a business registration service +description: Run the business registration starter, submit a test registration in your browser, and read the resulting Record from Base Registry Engine. +status: draft +owner: registry-docs +source_repos: + - registry-stack +last_reviewed: unreviewed +doc_type: tutorial +persona: + - data publisher + - operator +locale: en +standards_referenced: [] +tutorial_test: + toolset: breg + skip: The browser preview uses the matching release checkout, npm package, Node.js 24 and Docker. Replay it with the service preview acceptance tools. +--- + +import QuickstartMeta from '../../../components/QuickstartMeta.astro'; + +If you are building a service on Base Registry Engine (BReg), try the business registration +starter. You will run it on your machine, register a test business from a browser form, and see +the Record that BReg returns. + + + +## Scaffold the preview + +Start in an empty working directory. Use the Registry Stack release selected in the docs +version picker and install the BReg component from that release. Replace `` with the +release number, without the leading `v`. Copy the business registration starter from its source tag. + +```sh +version='' +rstack breg --version +git clone --depth 1 --branch "v${version}" https://github.com/registrystack/registry-stack.git registry-stack-preview-source +cp -R registry-stack-preview-source/products/platform/examples/service-previews/business-registration ./business-registration +``` + +Check that the reported tool version matches ``. +You now have a `business-registration` directory with a registry project, a browser page, and a +registration function. If Git cannot find the tag, check the release number in the verified +installer's filename. If the starter is missing, choose a release that includes the preview. + +## Install the client + +Install the published client for the release you selected. npm saves that exact version in your +copy of the starter. Run the remaining commands from the preview directory. + +```sh +cd business-registration +npm install --save-exact "@registrystack/client@${version}" +``` + +If npm cannot find the version, check the package version against the Registry Stack release you +installed. Use the same version for both. + +{/* Evidence: crates/registry-rstack/src/cli.rs, generate_client(); clients/typescript/package.json. */} + +## Start the preview + +Use synthetic data and trusted code on a trusted machine. The preview runs as a test registrar. +Other processes and users on the same host can reach the loopback URL. + +Check the development plan and start a local run. + +```sh +rstack dev check . +rstack dev start . --ttl 30m +``` + +If the check fails, use the file and field named in its diagnostic. The first start may download +the PostgreSQL image. If start fails, check that Docker is running and read the diagnostic. +Keep the run ID and open the URL marked `Application` in the start report. + +{/* Evidence: crates/registry-rstack/src/cli.rs, dispatch_dev; crates/registry-rstack-dev/src/lib.rs, start(). */} + +## Register a test business + +In the browser, enter `Example Supply Cooperative` for **Business name** and +`BR-TUTORIAL-001` for **Registration number**. Select **Register business**. + +The **Business registered** confirmation shows the name, registration number and Record ID +read back from BReg. Reload the page and use a fresh number to repeat the exercise in the same run. + +{/* TODO[evidence]: Bind the business-registration page and its native browser acceptance source when the preview release baseline lands. */} + +## Stop the preview + +Replace `` with the ID from the start report. The `--clean` flag deletes the managed +development data for this preview. + +```sh +RUN='' +rstack dev stop "$RUN" --clean +``` + +The stop report confirms the run stopped. + +## Next + +[Generate clients for your own projects](../../reference/typescript-clients/) diff --git a/docs/site/src/data/coordinator-api.yaml b/docs/site/src/data/coordinator-api.yaml index cab253d937..8927909ca0 100644 --- a/docs/site/src/data/coordinator-api.yaml +++ b/docs/site/src/data/coordinator-api.yaml @@ -53,15 +53,15 @@ rows: - ['`GET`', '`/health`', 'None', '`200` with `{"live":true}` while the process answers.'] - ['`GET`', '`/ready`', 'None', '`200` with `{"ready":true}`, or `503` with `{"ready":false}` while the service cannot accept work.'] - - ['`GET`', '`/v1/workflows/{workflow}`', 'Bearer, `start` on the named workflow', 'Discover the active revision, input schema, and declared outcomes.'] + - ['`GET`', '`/v1/workflows/{workflowId}`', 'Bearer, `start` on the named workflow', 'Discover the active revision, input schema, and declared outcomes.'] - ['`POST`', '`/v1/runs`', 'Bearer, `start` on the named workflow', 'Start one run with the expected `workflowRevision` and an `Idempotency-Key`.'] - ['`GET`', '`/v1/runs`', 'Bearer, `status`', 'List at most 100 of the most recently admitted runs the caller may see, newest first.'] - - ['`GET`', '`/v1/runs/{run}`', 'Bearer, `status`', 'Read one run''s progress and its reviewed terminal output.'] - - ['`GET`', '`/v1/runs/{run}/inspect`', 'Bearer, `inspect`', 'Read bounded steps, accepted or unknown effects, durable wait budgets, and available recovery actions.'] - - ['`POST`', '`/v1/runs/{run}/cancel`', 'Bearer, `cancel`', 'Stop future dispatch where possible, without rolling back an accepted effect.'] - - ['`POST`', '`/v1/runs/{run}/check`', 'Bearer, `inspect`', 'Read a waiting step''s product now, no sooner than the read floor after its last read, counting against the wait''s read budget. Body `{"step":"..."}`.'] - - ['`POST`', '`/v1/runs/{run}/reconcile`', 'Bearer, `reconcile`', 'Settle an uncertain call from the receiving product''s original-key receipt.'] - - ['`POST`', '`/v1/runs/{run}/retry-same`', 'Bearer, `retry-same`', 'Schedule held work again with its original command, key, binding, and authority.'] + - ['`GET`', '`/v1/runs/{runId}`', 'Bearer, `status`', 'Read one run''s progress and its reviewed terminal output.'] + - ['`GET`', '`/v1/runs/{runId}/inspect`', 'Bearer, `inspect`', 'Read bounded steps, accepted or unknown effects, durable wait budgets, and available recovery actions.'] + - ['`POST`', '`/v1/runs/{runId}/cancel`', 'Bearer, `cancel`', 'Stop future dispatch where possible, without rolling back an accepted effect.'] + - ['`POST`', '`/v1/runs/{runId}/check`', 'Bearer, `inspect`', 'Read a waiting step''s product now, no sooner than the read floor after its last read, counting against the wait''s read budget. Body `{"step":"..."}`.'] + - ['`POST`', '`/v1/runs/{runId}/reconcile`', 'Bearer, `reconcile`', 'Settle an uncertain call from the receiving product''s original-key receipt.'] + - ['`POST`', '`/v1/runs/{runId}/retry-same`', 'Bearer, `retry-same`', 'Schedule held work again with its original command, key, binding, and authority.'] - ['`GET`', '`/v1/doctor`', 'Bearer, operator', 'Report activation, audit readiness, holds, and run counts.'] - ['`POST`', '`/v1/restore-hold`', 'Bearer, operator', 'Place the restore hold, which stops dispatch and admissions.'] - ['`POST`', '`/v1/release-restore-hold`', 'Bearer, operator', 'Release the restore hold once no held work is unresolved.'] @@ -69,4 +69,4 @@ - ['`POST`', '`/v1/complete-execution-recovery`', 'Bearer, operator', 'Attest complete execution history and prior fencing while the restore hold remains.'] - ['`POST`', '`/v1/retention`', 'Bearer, operator', 'Erase eligible terminal payloads that ended before a cutoff.'] - ['`POST`', '`/v1/review-completions`', 'Standard Webhooks signature using the key selected by the recipient binding', 'Bring forward the next result read of a run waiting on that review request.'] - - ['`POST`', '`/v1/events/{workflow}/{trigger}`', 'Standard Webhooks signature using the key for the trigger URL', 'Admit one run per exact authenticated event and trigger; exact redelivery returns the same run.'] + - ['`POST`', '`/v1/events/{workflowId}/{triggerId}`', 'Standard Webhooks signature using the key for the trigger URL', 'Admit one run per exact authenticated event and trigger; exact redelivery returns the same run.'] From e4819adc72e325b12688623d2de8413d46946b9a Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 17/55] feat(evidence): provision databases for held Evidence stores Folds these reviewed commits: - test(journeys): record native Keycloak BReg qualification - feat(dev): check saved BReg identity-facts reports offline - feat(evidence): provision databases for held Evidence stores - fix(journeys): shorten managed paths to the first read - feat(dev): bind managed Scheduling to one live task authority - test(journeys): verify managed Scheduling appointment hooks - fix(session): check literal route bindings and their assembly digest - fix(evidence): make store provisioning checks conform to the operator contract - docs(evidence): publish the store provisioning reference Signed-off-by: Jeremi Joslin --- Cargo.lock | 2 + crates/registry-cli-docs/src/lib.rs | 7 +- crates/registry-evidencectl/Cargo.toml | 6 +- .../authoring/store-provision.schema.json | 160 +++++++++ crates/registry-evidencectl/src/lib.rs | 53 ++- crates/registry-evidencectl/src/schema.rs | 29 ++ .../src/store_provision.rs | 321 ++++++++++++++++++ .../tests/store_provision.rs | 284 ++++++++++++++++ crates/registry-rstack-dev/src/bindings.rs | 1 + .../registry-rstack-dev/src/external_breg.rs | 123 ++++++- .../registry-rstack-dev/src/owner_report.rs | 101 ++++-- .../src/owner_report_tests.rs | 49 +++ crates/registry-rstack-dev/src/plan.rs | 119 ++++++- crates/registry-rstack-dev/src/products.rs | 8 + crates/registry-rstack/src/cli.rs | 12 +- crates/registry-session/src/gateway.rs | 11 + crates/registry-session/src/gateway/verify.rs | 28 +- crates/registry-session/src/lib.rs | 4 +- crates/registry-session/src/schema.rs | 65 +++- crates/registry-session/tests/binary.rs | 102 ++++-- .../scripts/generate-breg-configuration.mjs | 10 +- .../generate-breg-configuration.test.mjs | 7 +- .../generate-evidence-configuration.mjs | 7 + .../generate-evidence-configuration.test.mjs | 2 + .../docs/configure/evidence-oid4vci.mdx | 12 + .../run-a-project-with-rstack-dev.mdx | 17 + .../src/content/docs/configure/session.mdx | 7 +- .../generate-identity-configuration.mdx | 16 + products/evidence/OPERATOR-CONTRACT.md | 23 ++ .../examples/formats/store-provision.yaml | 12 + products/platform/config-formats.yaml | 101 +++++- .../examples/session/checked-routes.json | 23 ++ ...ssion-route-inventory.v1alpha1.schema.json | 118 +++++++ products/platform/journeys/README.md | 6 + .../platform/journeys/expected-failures.yaml | 2 +- products/platform/journeys/lib.sh | 43 +++ products/platform/journeys/own-provider.sh | 259 +++++++++++--- .../journeys/projects/composed_fixtures.py | 75 ++++ products/platform/journeys/rstack-dev.sh | 79 ++--- .../platform/journeys/test_journey_tables.py | 169 ++++++++- 40 files changed, 2273 insertions(+), 200 deletions(-) create mode 100644 crates/registry-evidencectl/schemas/authoring/store-provision.schema.json create mode 100644 crates/registry-evidencectl/src/store_provision.rs create mode 100644 crates/registry-evidencectl/tests/store_provision.rs create mode 100644 products/evidence/examples/formats/store-provision.yaml create mode 100644 products/platform/examples/session/checked-routes.json create mode 100644 products/platform/generated/session-runtime/session-route-inventory.v1alpha1.schema.json diff --git a/Cargo.lock b/Cargo.lock index 63221e918e..cc96a8ed8e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7359,6 +7359,7 @@ dependencies = [ "inquire", "jsonschema", "p256", + "percent-encoding", "pkcs1", "pkcs8 0.10.2", "rand 0.9.5", @@ -7377,6 +7378,7 @@ dependencies = [ "registry-platform-crypto", "registry-platform-httpsec", "registry-platform-loopback", + "registry-platform-provision", "registry-platform-yaml", "registry-rstack-dev", "registry-thunderid-tooling", diff --git a/crates/registry-cli-docs/src/lib.rs b/crates/registry-cli-docs/src/lib.rs index 7bcd41c234..822423ccb2 100644 --- a/crates/registry-cli-docs/src/lib.rs +++ b/crates/registry-cli-docs/src/lib.rs @@ -1108,7 +1108,12 @@ mod tests { let evidencectl_check = find_command(&catalog.binaries, "evidencectl check"); assert!(evidencectl_check.constraints.iter().any(|constraint| { constraint.kind == ConstraintKind::RequiredExactlyOne - && constraint.arguments == ["[PROJECT]", "--file "] + && constraint.arguments + == [ + "[PROJECT]", + "--file ", + "--store-provision-config ", + ] })); let mock_serve = find_command(&catalog.binaries, "evidencectl source mock serve"); diff --git a/crates/registry-evidencectl/Cargo.toml b/crates/registry-evidencectl/Cargo.toml index b4691acb4c..73e65ca45b 100644 --- a/crates/registry-evidencectl/Cargo.toml +++ b/crates/registry-evidencectl/Cargo.toml @@ -42,10 +42,12 @@ registry-cli-reference.workspace = true registry-platform-crypto.workspace = true registry-platform-httpsec = { workspace = true, features = ["server"] } registry-platform-loopback.workspace = true +registry-platform-provision = { workspace = true, features = ["cli"] } registry-platform-yaml.workspace = true registry-rstack-dev.workspace = true registry-thunderid-tooling.workspace = true p256.workspace = true +percent-encoding = "2" # `jwk from-pem` reads a PEM SubjectPublicKeyInfo or PKCS #1 public key. pkcs1.workspace = true pkcs8 = { workspace = true, features = ["pem"] } @@ -66,7 +68,8 @@ schemars = { workspace = true, optional = true } [features] # The generator for the committed schemas of the documents this crate owns. -schema = ["dep:schemars", "registry-evidence-authoring/schema"] +schema = ["dep:schemars", "registry-evidence-authoring/schema", "registry-platform-config/schema"] +postgres-test = [] [[example]] name = "authoring-schema" @@ -77,4 +80,5 @@ registry-adapter-engine.workspace = true registry-evidence.workspace = true registry-evidence-authoring.workspace = true registry-platform-crypto = { workspace = true, features = ["test-support"] } +registry-platform-provision = { workspace = true, features = ["test-support"] } tower.workspace = true diff --git a/crates/registry-evidencectl/schemas/authoring/store-provision.schema.json b/crates/registry-evidencectl/schemas/authoring/store-provision.schema.json new file mode 100644 index 0000000000..e84a7877b1 --- /dev/null +++ b/crates/registry-evidencectl/schemas/authoring/store-provision.schema.json @@ -0,0 +1,160 @@ +{ + "$defs": { + "DatabaseConfig": { + "additionalProperties": false, + "description": "The PostgreSQL connection a stateful runtime uses. Both URLs are secret\nreferences and may name the same secret.", + "properties": { + "caBundleRef": { + "$ref": "#/$defs/SecretReference", + "description": "Secret reference to a PEM root certificate the connection trusts.\nAbsent, the connection trusts the platform's root certificates." + }, + "migrationUrlRef": { + "$ref": "#/$defs/SecretReference", + "description": "Secret reference to the migration connection URL." + }, + "runtimeUrlRef": { + "$ref": "#/$defs/SecretReference", + "description": "Secret reference to the least-privileged runtime connection URL." + }, + "testOnlyPlaintext": { + "default": false, + "description": "Allow a plaintext connection. Refused outside test builds.", + "type": "boolean" + }, + "transport": { + "$ref": "#/$defs/DatabaseTransport", + "description": "How the connection is protected. Absent means `verified-tls`. A\nplaintext transport must match the database hosts, and cannot be\nwritten beside `testOnlyPlaintext`.", + "x-registry-development-only": [ + "platform.posture.database-private-plaintext" + ] + } + }, + "required": [ + "runtimeUrlRef", + "migrationUrlRef" + ], + "type": "object" + }, + "DatabaseTransport": { + "description": "How a PostgreSQL connection is protected.", + "oneOf": [ + { + "const": "verified-tls", + "description": "TLS with verification. `caBundleRef` is optional.", + "type": "string" + }, + { + "const": "loopback-plaintext", + "description": "No TLS. Every host must be a Unix socket, a numeric loopback address\nor `localhost`.", + "type": "string" + }, + { + "const": "private-network-plaintext", + "description": "No TLS, in development only. Every host must also be loopback, a\nsocket, a private IPv4 address (RFC 1918), an IPv6 unique local\naddress (`fc00::/7`), or a name that resolves only to such addresses.", + "type": "string" + } + ] + }, + "EnvironmentSecretProviderConfig": { + "additionalProperties": false, + "description": "The environment secret provider. It takes no settings.", + "type": "object" + }, + "FileSecretProviderConfig": { + "additionalProperties": false, + "description": "The file secret provider.", + "properties": { + "root": { + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "pattern": "^/", + "type": "string" + } + }, + "required": [ + "root" + ], + "type": "object" + }, + "SecretProvidersConfig": { + "additionalProperties": false, + "anyOf": [ + { + "properties": { + "file": { + "$ref": "#/$defs/FileSecretProviderConfig" + } + }, + "required": [ + "file" + ] + }, + { + "properties": { + "environment": { + "$ref": "#/$defs/EnvironmentSecretProviderConfig" + } + }, + "required": [ + "environment" + ] + } + ], + "description": "The secret providers a runtime enables. A reference is resolved only by a\nprovider declared here: `secret:file/name` under `file.root`, and\n`secret:env/NAME` only when `environment: {}` is present.", + "properties": { + "environment": { + "$ref": "#/$defs/EnvironmentSecretProviderConfig", + "description": "Enables `secret:env/NAME` references, read from the process\nenvironment. Declared as an empty mapping: `environment: {}`." + }, + "file": { + "$ref": "#/$defs/FileSecretProviderConfig", + "description": "Enables `secret:file/name` references, read from files under `root`." + } + }, + "type": "object" + }, + "SecretReference": { + "description": "An exact secret reference: secret:file/name, resolved under secretProviders.file.root, or secret:env/NAME, resolved only when secretProviders.environment is declared.", + "pattern": "^(?:secret:env/[A-Z][A-Z0-9_]{0,127}|secret:file/[a-z][a-z0-9._-]{0,127})$", + "type": "string" + }, + "Store": { + "enum": [ + "status", + "oid4vci" + ], + "type": "string" + } + }, + "$id": "https://id.registrystack.org/schemas/evidence/store-provision/store-provision.v1alpha1.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "apiVersion": { + "const": "id.registrystack.org/formats/evidence/store-provision/v1alpha1", + "type": "string" + }, + "database": { + "$ref": "#/$defs/DatabaseConfig" + }, + "kind": { + "const": "EvidenceStoreProvisionConfig", + "type": "string" + }, + "secretProviders": { + "$ref": "#/$defs/SecretProvidersConfig" + }, + "store": { + "$ref": "#/$defs/Store", + "description": "The Evidence PostgreSQL store this database is reserved for." + } + }, + "required": [ + "apiVersion", + "kind", + "store", + "database", + "secretProviders" + ], + "title": "Evidence store provisioning config", + "type": "object" +} diff --git a/crates/registry-evidencectl/src/lib.rs b/crates/registry-evidencectl/src/lib.rs index ad4fd9d7f4..39f420d415 100644 --- a/crates/registry-evidencectl/src/lib.rs +++ b/crates/registry-evidencectl/src/lib.rs @@ -43,6 +43,7 @@ mod scaffold; mod source_cli; mod source_import; mod source_mock; +mod store_provision; mod suggest; mod target; mod tooling; @@ -90,6 +91,8 @@ enum Command { Types(normalized::TypesArgs), /// Check a normalized project and, when selected, deployment closure, or one tooling file, offline. Check(CheckArgs), + /// Create split PostgreSQL roles and an empty database for a held Evidence store. + Provision(registry_platform_provision::ProvisionArgs), /// Explain the authored inventory and optional target-owned governance. Explain(ExplainArgs), /// Run the project's synthetic Evidence fixtures. @@ -181,7 +184,7 @@ enum CliFormat { ArgGroup::new("checked") .required(true) .multiple(false) - .args(["project", "file"]) + .args(["project", "file", "store_provision_config"]) ))] struct CheckArgs { #[arg( @@ -190,13 +193,19 @@ struct CheckArgs { help = "Declared posture: development or production. Unset means production." )] posture: Option, - /// Editable Evidence project directory. Required unless --file is given. + /// Editable Evidence project directory. Required unless --file or --store-provision-config is given. project: Option, /// Check one tooling file on its own, offline: a client profile, reviewed /// contracts, a ThunderID task connection or session file, a source-import /// baseline or journal, a source resolution file, or a source export manifest. #[arg(long, conflicts_with_all = ["project", "target", "production"])] file: Option, + /// Check a store provisioning file offline without resolving secrets. + #[arg(long, value_name = "FILE", conflicts_with_all = ["target", "production"])] + store_provision_config: Option, + /// Resolve text substitutions in the provisioning file from the environment. + #[arg(long, requires = "store_provision_config")] + environment: bool, /// Explicit deployment target whose governance and runtime structure are checked. #[arg(long)] target: Option, @@ -365,16 +374,22 @@ fn cli_command() -> clap::Command { let command = HUMAN_ONLY_COMMANDS .iter() .fold(Cli::command(), |command, path| narrow_format(command, path)); - command.mut_subcommand("runtime", |subcommand| { - subcommand.arg( - clap::Arg::new("output_format") - .long("format") - .value_name("FORMAT") - .default_value("human") - .hide(true) - .value_parser(clap::builder::EnumValueParser::::new()), - ) - }) + command + .mut_subcommand("provision", |subcommand| { + subcommand.mut_arg("runtime_config", |argument| { + argument.help("Runtime configuration file for Evidence store provisioning") + }) + }) + .mut_subcommand("runtime", |subcommand| { + subcommand.arg( + clap::Arg::new("output_format") + .long("format") + .value_name("FORMAT") + .default_value("human") + .hide(true) + .value_parser(clap::builder::EnumValueParser::::new()), + ) + }) } fn narrow_format(command: clap::Command, path: &[&str]) -> clap::Command { @@ -586,6 +601,7 @@ fn run_entry() -> ExitCode { } let posture_flag = match &cli.command { Command::Check(args) => Some(args.posture.as_deref()), + Command::Provision(args) => Some(args.posture.as_deref()), Command::Package(args) => Some(args.posture.as_deref()), Command::Test(args) => Some(args.posture.as_deref()), Command::Fixtures(fixtures::FixturesCommand::Run(args)) => Some(args.posture.as_deref()), @@ -687,11 +703,24 @@ fn run_entry() -> ExitCode { ) } Command::Types(args) => normalized::generate_types(args, format), + Command::Provision(args) => Ok(store_provision::run(&args, format, posture)), Command::Check(CheckArgs { file: Some(file), deny_warnings, .. }) => Ok(file_check::run(&file, format, deny_warnings)), + Command::Check(CheckArgs { + store_provision_config: Some(file), + deny_warnings, + environment, + .. + }) => Ok(store_provision::check( + &file, + format, + deny_warnings, + environment, + posture, + )), Command::Check(args) => { let artifact = project_of(&args).display().to_string(); safe_command( diff --git a/crates/registry-evidencectl/src/schema.rs b/crates/registry-evidencectl/src/schema.rs index d3cd7ba773..96bc78018a 100644 --- a/crates/registry-evidencectl/src/schema.rs +++ b/crates/registry-evidencectl/src/schema.rs @@ -14,6 +14,7 @@ use registry_evidence_authoring::schema::publish; use crate::source_import::{ resolution_schema, RESOLUTION_API_VERSION, RESOLUTION_KIND, RESOLUTION_SCHEMA_ID, }; +use crate::store_provision::{self, StoreProvisionDocument}; /// The schema for one local access client under `access/clients/`. pub const ACCESS_CLIENT_SCHEMA_FILE: &str = "access-client.schema.json"; @@ -23,6 +24,8 @@ pub const MOCK_PLAN_SCHEMA_FILE: &str = "mock-plan.schema.json"; /// The schema for one source import resolution file. pub const SOURCE_RESOLUTION_SCHEMA_FILE: &str = "source-resolution.schema.json"; +/// The schema for the operator-only database provisioning input. +pub const STORE_PROVISION_SCHEMA_FILE: &str = "store-provision.schema.json"; /// Every generated schema this crate owns, keyed by the filename it is /// committed under. @@ -59,6 +62,15 @@ pub fn documents() -> Result, serde_json::Error> (RESOLUTION_API_VERSION, RESOLUTION_KIND), )?, ), + ( + STORE_PROVISION_SCHEMA_FILE, + publish( + serde_json::to_value(schemars::schema_for!(StoreProvisionDocument))?, + "Evidence store provisioning config", + store_provision::SCHEMA_ID, + (store_provision::API_VERSION, store_provision::KIND), + )?, + ), ])) } @@ -70,6 +82,7 @@ mod tests { )] use super::{ documents, ACCESS_CLIENT_SCHEMA_FILE, MOCK_PLAN_SCHEMA_FILE, SOURCE_RESOLUTION_SCHEMA_FILE, + STORE_PROVISION_SCHEMA_FILE, }; fn compile(file: &str) -> jsonschema::JSONSchema { @@ -94,6 +107,7 @@ mod tests { ACCESS_CLIENT_SCHEMA_FILE, MOCK_PLAN_SCHEMA_FILE, SOURCE_RESOLUTION_SCHEMA_FILE, + STORE_PROVISION_SCHEMA_FILE, ] ); for (file, generated) in documents().expect("schemas generate") { @@ -107,6 +121,21 @@ mod tests { } } + #[test] + fn store_provision_schema_checks_the_example_and_its_envelope() { + let schema = compile(STORE_PROVISION_SCHEMA_FILE); + let mut example: serde_json::Value = serde_norway::from_str(include_str!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/../../products/evidence/examples/formats/store-provision.yaml" + ))) + .expect("the store provision example is YAML"); + assert!(schema.is_valid(&example)); + example["store"] = serde_json::json!("oid4vci"); + assert!(schema.is_valid(&example)); + example["apiVersion"] = serde_json::json!("wrong-version"); + assert!(!schema.is_valid(&example)); + } + #[test] fn an_access_client_with_an_unusable_issuer_is_turned_away() { let schema = compile(ACCESS_CLIENT_SCHEMA_FILE); diff --git a/crates/registry-evidencectl/src/store_provision.rs b/crates/registry-evidencectl/src/store_provision.rs new file mode 100644 index 0000000000..f0a1fd2189 --- /dev/null +++ b/crates/registry-evidencectl/src/store_provision.rs @@ -0,0 +1,321 @@ +// SPDX-License-Identifier: Apache-2.0 +//! Operator-only database provisioning for the two held PostgreSQL stores. + +use std::{path::Path, process::ExitCode}; + +use registry_platform_config::{ + describe_secret_failure, DatabaseConfig, DatabaseTransport, DeclaredPosture, + RuntimeConfigLoader, RuntimeEnvelope, SecretProvidersConfig, DEFAULT_STAND_IN, +}; +use registry_platform_provision::{ + provision_transport, run_provision, ProductDatabase, ProvisionArgs, ProvisionInput, + SchemaLayout, +}; +use registry_platform_yaml::{Diagnostic, Report, Source}; +use serde::{Deserialize, Deserializer}; +use zeroize::Zeroizing; + +use crate::{report, OutputFormat}; + +pub(crate) const API_VERSION: &str = + "id.registrystack.org/formats/evidence/store-provision/v1alpha1"; +pub(crate) const KIND: &str = "EvidenceStoreProvisionConfig"; +const SPLIT_ROLES_REQUIRED: &str = "evidence.store-provision.split-roles-required"; +#[cfg(feature = "schema")] +pub(crate) const SCHEMA_ID: &str = + "https://id.registrystack.org/schemas/evidence/store-provision/store-provision.v1alpha1.schema.json"; + +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[cfg_attr(feature = "schema", schemars(rename_all = "kebab-case"))] +enum Store { + Status, + Oid4vci, +} + +impl<'de> Deserialize<'de> for Store { + fn deserialize>(deserializer: D) -> Result { + let name = String::deserialize(deserializer)?; + match name.as_str() { + "status" => Ok(Self::Status), + "oid4vci" => Ok(Self::Oid4vci), + _ => Err(serde::de::Error::unknown_variant( + &name, + &["status", "oid4vci"], + )), + } + } +} + +impl Store { + fn product(&self) -> ProductDatabase { + ProductDatabase { + product: match self { + Self::Status => "evidence-status", + Self::Oid4vci => "evidence-oid4vci", + }, + // Both stores create their schema in their separate migration. + layout: SchemaLayout::CreatedByApply, + btree_gist: false, + spatial: None, + } + } +} + +#[derive(Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub(crate) struct StoreProvisionDocument { + #[cfg_attr(feature = "schema", schemars(skip))] + #[serde(rename = "apiVersion")] + _api_version: String, + #[cfg_attr(feature = "schema", schemars(skip))] + #[serde(rename = "kind")] + _kind: String, + /// The Evidence PostgreSQL store this database is reserved for. + store: Store, + database: DatabaseConfig, + secret_providers: SecretProvidersConfig, +} + +fn loader(declared: DeclaredPosture) -> RuntimeConfigLoader { + RuntimeConfigLoader::new( + RuntimeEnvelope { + api_version: API_VERSION, + kind: KIND, + }, + declared, + ) + .require_trusted_ownership() +} + +fn diagnostics(config: &StoreProvisionDocument, defers: impl Fn(&str) -> bool) -> Vec { + let mut findings = Vec::new(); + let mut block = |error: registry_platform_config::ConfigBlockError| { + findings.push(Diagnostic::error( + "evidence.store-provision.configuration", + &format!("/{}", error.field().replace('.', "/")), + error.to_string(), + "Correct the named field in the provisioning file.", + )); + }; + if let Err(error) = config.secret_providers.check() { + if !defers(&format!("/{}", error.field().replace('.', "/"))) { + block(error); + } + } + for (field, reference) in config.database.references() { + if !defers(&format!("/{}", field.replace('.', "/"))) { + if let Err(error) = config.secret_providers.check_reference(field, reference) { + block(error); + } + } + } + if config.database.migration_url_ref == config.database.runtime_url_ref + && !defers("/database/migrationUrlRef") + && !defers("/database/runtimeUrlRef") + { + findings.push(Diagnostic::error( + SPLIT_ROLES_REQUIRED, + "/database/runtimeUrlRef", + "the two URL references are identical", + "Use separate references for the migration and runtime login URLs.", + )); + } + if config.database.test_only_plaintext && !defers("/database/testOnlyPlaintext") { + findings.push(Diagnostic::error( + "evidence.store-provision.transport-refused", + "/database/testOnlyPlaintext", + "testOnlyPlaintext is unavailable for store provisioning", + "Use verified TLS or the explicit loopback-plaintext transport.", + )); + } + if !defers("/database/transport") + && provision_transport(&config.database) == DatabaseTransport::PrivateNetworkPlaintext + { + findings.push(Diagnostic::error( + "evidence.store-provision.transport-refused", + "/database/transport", + "store provisioning cannot use private-network-plaintext", + "Use verified TLS or the explicit loopback-plaintext transport.", + )); + } + findings +} + +fn unavailable_path() -> Diagnostic { + Diagnostic::error( + "evidence.store-provision.config-path", + "", + "the provisioning file path cannot be resolved", + "Pass an absolute path to the provisioning file.", + ) +} + +fn decoded_login(url: &str) -> Option { + let url = url::Url::parse(url).ok()?; + // Match the PostgreSQL URL reader's user-info decoding. The provisioner + // validates endpoint overrides and the rest of the URL before doing work. + percent_encoding::percent_decode_str(url.username()) + .decode_utf8() + .ok() + .map(|login| login.into_owned()) +} + +pub(crate) fn check( + path: &Path, + format: OutputFormat, + deny_warnings: bool, + environment: bool, + declared: DeclaredPosture, +) -> ExitCode { + let (found, unavailable) = match std::path::absolute(path) { + Ok(path) => { + let checked = loader(declared).check_offline::( + &path, + environment, + |pointer| match pointer { + "/store" => "status", + "/secretProviders/file/root" => "/deferred", + "/database/transport" => "verified-tls", + "/database/testOnlyPlaintext" => "false", + _ => DEFAULT_STAND_IN, + }, + ); + let extra = checked.loaded.as_ref().map_or_else(Vec::new, |loaded| { + diagnostics(&loaded.config, |pointer| checked.defers(pointer)) + }); + let positioned = extra.into_iter().map(|finding| { + checked.error_at( + KIND, + &finding.code, + &finding.path, + finding.message, + finding.suggested_action, + ) + }); + (checked.report_with(KIND, positioned), checked.unavailable) + } + Err(_) => (Report::new(vec![unavailable_path()]), true), + }; + let exit = if unavailable { + report::OPERATIONAL_FAILURE_EXIT + } else if found.has_errors() || crate::check::refuses_warnings(&found, deny_warnings) { + report::DOMAIN_REFUSAL_EXIT + } else { + report::SUCCESS_EXIT + }; + if exit == report::SUCCESS_EXIT { + match format { + OutputFormat::Json => crate::print_report_with_posture( + &report::success( + "check", + "complete", + serde_json::json!({"diagnostics": found.to_json_value()}), + ), + Some(declared), + ), + OutputFormat::Human => print!("{}", found.render_human()), + } + } else { + crate::write_report_failure("check", exit, &found, format, Some(declared)); + } + ExitCode::from(exit) +} + +fn load(path: &Path, declared: DeclaredPosture) -> Result> { + let absolute = std::path::absolute(path).map_err(|_| vec![unavailable_path()])?; + let loaded = loader(declared) + .load::(&absolute) + .map_err(|error| error.diagnostics().to_vec())?; + let config = loaded.config; + let findings = diagnostics(&config, |_| false); + if !findings.is_empty() { + return Err(findings); + } + let refuse = |code: &str, pointer: &str, message: String, action: &str| { + let mut diagnostic = Diagnostic::error(code, pointer, message, action); + diagnostic.artifact = Some(KIND.to_owned()); + diagnostic.source = Some(Source { + file: path.display().to_string(), + line: None, + column: None, + }); + vec![diagnostic] + }; + let secrets = config + .secret_providers + .resolver(loaded.development.as_ref()) + .map_err(|error| { + refuse( + "evidence.store-provision.secret-provider", + "/secretProviders", + error.to_string(), + error.suggested_action(), + ) + })?; + let resolve = |member: &str, reference: &str| { + secrets.resolve(reference).map_err(|error| { + refuse( + "evidence.store-provision.secret-unavailable", + &format!("/database/{member}"), + describe_secret_failure(&format!("database.{member}"), reference, &error), + error.suggested_action(), + ) + }) + }; + let url = |member: &str, reference: &str| { + let secret = resolve(member, reference)?; + std::str::from_utf8(secret.expose_secret()) + .map(|text| Zeroizing::new(text.trim().to_owned())) + .map_err(|_| { + refuse( + "evidence.store-provision.url-invalid", + &format!("/database/{member}"), + "the PostgreSQL URL secret is not UTF-8".to_owned(), + "Write a PostgreSQL URL in the secret.", + ) + }) + }; + let input = ProvisionInput { + product: config.store.product(), + migration_url: url("migrationUrlRef", &config.database.migration_url_ref)?, + runtime_url: url("runtimeUrlRef", &config.database.runtime_url_ref)?, + ca_pem: config + .database + .ca_bundle_ref + .as_deref() + .map(|reference| resolve("caBundleRef", reference)) + .transpose()? + .map(|secret| secret.expose_secret().to_vec()), + transport: provision_transport(&config.database), + }; + let logins = decoded_login(&input.migration_url).zip(decoded_login(&input.runtime_url)); + if logins.is_some_and(|(migration, runtime)| migration == runtime) { + return Err(refuse( + SPLIT_ROLES_REQUIRED, + "/database/runtimeUrlRef", + "the two URLs name the same PostgreSQL login".to_owned(), + "Give the migration and runtime URLs distinct PostgreSQL login names.", + )); + } + Ok(input) +} + +pub(crate) fn run( + args: &ProvisionArgs, + format: OutputFormat, + declared: DeclaredPosture, +) -> ExitCode { + let format = match format { + OutputFormat::Human => registry_platform_provision::cli::OutputFormat::Human, + OutputFormat::Json => registry_platform_provision::cli::OutputFormat::Json, + }; + run_provision( + "evidencectl", + registry_platform_buildinfo::DISPLAY_VERSION, + args, + format, + declared, + |path| load(path, declared), + ) +} diff --git a/crates/registry-evidencectl/tests/store_provision.rs b/crates/registry-evidencectl/tests/store_provision.rs new file mode 100644 index 0000000000..2efeaea35c --- /dev/null +++ b/crates/registry-evidencectl/tests/store_provision.rs @@ -0,0 +1,284 @@ +// SPDX-License-Identifier: Apache-2.0 + +use std::path::Path; +use std::process::{Command, Output}; + +fn config(directory: &Path, store: &str) -> std::path::PathBuf { + let path = directory.join("store-provision.yaml"); + std::fs::write( + &path, + format!( + "\ +apiVersion: id.registrystack.org/formats/evidence/store-provision/v1alpha1 +kind: EvidenceStoreProvisionConfig +store: {store} +database: + migrationUrlRef: secret:env/EVIDENCE_TEST_STORE_MIGRATION + runtimeUrlRef: secret:env/EVIDENCE_TEST_STORE_RUNTIME +secretProviders: + environment: {{}} +" + ), + ) + .expect("write operator configuration"); + path +} + +fn evidencectl() -> Command { + let mut command = Command::new(env!("CARGO_BIN_EXE_evidencectl")); + command + .env_remove("REGISTRY_STACK_POSTURE") + .env_remove("EVIDENCE_TEST_STORE_MIGRATION") + .env_remove("EVIDENCE_TEST_STORE_RUNTIME"); + command +} + +fn check(path: &Path) -> Output { + evidencectl() + .args(["--format", "json", "check", "--store-provision-config"]) + .arg(path) + .output() + .expect("run offline check") +} + +fn plan(path: &Path, migration_role: &str, runtime_role: &str) -> Output { + let endpoint = + |role: &str| format!("postgresql://{role}:synthetic-canary@db.example.test/store"); + evidencectl() + .args(["provision", "--print-sql", "--runtime-config"]) + .arg(path) + .env("EVIDENCE_TEST_STORE_MIGRATION", endpoint(migration_role)) + .env("EVIDENCE_TEST_STORE_RUNTIME", endpoint(runtime_role)) + .output() + .expect("plan provisioning") +} + +#[test] +fn both_store_documents_check_without_resolving_secrets() { + let directory = tempfile::tempdir().expect("private test directory"); + for store in ["status", "oid4vci"] { + let output = check(&config(directory.path(), store)); + assert!( + output.status.success(), + "{store} check: {:?}", + output.status + ); + let report: serde_json::Value = + serde_json::from_slice(&output.stdout).expect("check report"); + assert_eq!(report["status"], "complete"); + } +} + +#[test] +fn an_unknown_store_is_refused_offline() { + let directory = tempfile::tempdir().expect("private test directory"); + let output = check(&config(directory.path(), "unrecognised")); + assert_eq!(output.status.code(), Some(1)); + let report: serde_json::Value = serde_json::from_slice(&output.stdout).expect("check report"); + assert_eq!(report["diagnostics"][0]["path"], "/store"); +} + +#[test] +fn store_name_requires_a_string() { + let directory = tempfile::tempdir().expect("private test directory"); + for store in ["true", "3", "2.5"] { + let output = check(&config(directory.path(), store)); + assert_eq!(output.status.code(), Some(1)); + let report: serde_json::Value = + serde_json::from_slice(&output.stdout).expect("check report"); + assert_eq!(report["diagnostics"][0]["path"], "/store"); + assert_eq!(report["diagnostics"][0]["code"], "config.expected-string"); + } +} + +#[test] +fn provisioning_check_resolves_authored_text_only_when_requested() { + let directory = tempfile::tempdir().expect("private test directory"); + let path = config(directory.path(), "status"); + let document = std::fs::read_to_string(&path).expect("read test configuration"); + std::fs::write(&path, document.replace( + "database:\n", + "database:\n transport: \"${EVIDENCE_TEST_TRANSPORT:?synthetic-private-diagnostic}\"\n", + )).expect("write a deferred transport setting"); + assert!(check(&path).status.success()); + + let inspect = |transport: Option<&str>| { + let mut command = evidencectl(); + command + .args([ + "--format", + "json", + "check", + "--environment", + "--store-provision-config", + ]) + .arg(&path) + .env_remove("EVIDENCE_TEST_TRANSPORT"); + if let Some(transport) = transport { + command.env("EVIDENCE_TEST_TRANSPORT", transport); + } + command.output().expect("run provisioning check") + }; + assert!(inspect(Some("verified-tls")).status.success()); + let refused = inspect(None); + assert_eq!(refused.status.code(), Some(1)); + assert!(!String::from_utf8_lossy(&refused.stdout).contains("synthetic-private-diagnostic")); + let report: serde_json::Value = serde_json::from_slice(&refused.stdout).expect("check report"); + assert_eq!(report["diagnostics"][0]["code"], "config.substitution"); + assert_eq!(report["diagnostics"][0]["path"], "/database/transport"); +} + +#[test] +fn a_shared_url_reference_is_refused_without_resolving_it() { + let directory = tempfile::tempdir().expect("private test directory"); + let path = config(directory.path(), "status"); + let document = std::fs::read_to_string(&path).expect("read test configuration"); + std::fs::write( + &path, + document.replace( + "EVIDENCE_TEST_STORE_RUNTIME", + "EVIDENCE_TEST_STORE_MIGRATION", + ), + ) + .expect("write shared reference"); + let output = check(&path); + assert_eq!(output.status.code(), Some(1)); + let report: serde_json::Value = serde_json::from_slice(&output.stdout).expect("check report"); + assert_eq!(report["diagnostics"][0]["path"], "/database/runtimeUrlRef"); + assert_eq!( + report["diagnostics"][0]["code"], + "evidence.store-provision.split-roles-required" + ); +} + +#[test] +fn provisioning_plans_split_roles_and_leaves_migration_separate() { + let directory = tempfile::tempdir().expect("private test directory"); + for store in ["status", "oid4vci"] { + let output = plan(&config(directory.path(), store), "migration", "runtime"); + assert!(output.status.success(), "{store} plan: {:?}", output.status); + let sql = std::str::from_utf8(&output.stdout).expect("SQL text"); + assert!(sql.contains("CREATE ROLE \"migration\"")); + assert!(sql.contains("CREATE ROLE \"runtime\"")); + assert!(sql.contains("GRANT CREATE ON DATABASE \"store\" TO \"migration\"")); + assert!(!sql.contains("CREATE TABLE")); + assert!(!sql.contains("synthetic-canary")); + assert!(!sql.contains("SCRAM-SHA-256")); + } +} + +#[test] +fn a_shared_login_is_refused_even_when_one_url_encodes_it() { + let directory = tempfile::tempdir().expect("private test directory"); + let output = plan(&config(directory.path(), "status"), "same", "%73ame"); + assert!(!output.status.success()); + assert!(output.stdout.is_empty()); + let refusal = std::str::from_utf8(&output.stderr).expect("refusal text"); + assert!(refusal.contains("evidence.store-provision.split-roles-required")); + assert!(!refusal.contains("synthetic-canary")); +} + +/// Use the shared verified-TLS fixture. Both variables must point to a +/// disposable server, as in the other products' provisioning tests. +#[cfg(feature = "postgres-test")] +#[tokio::test] +async fn both_stores_provision_idempotently_without_migrating() { + use registry_platform_provision::test_support::{connect_verified, provision_test_env}; + + let (admin_url, ca) = provision_test_env(); + let admin = connect_verified(&admin_url, &ca, None).await; + let base = registry_platform_provision::admin_config(&admin_url, Some(&ca)) + .expect("parse the disposable TLS endpoint"); + let directory = tempfile::tempdir().expect("private test directory"); + for (store, schema) in [ + ("status", "evidence_status"), + ("oid4vci", "evidence_oid4vci"), + ] { + let suffix: u64 = rand::random(); + let database = format!("evidence_store_{suffix:x}"); + let migration = format!("evidence_mig_{suffix:x}"); + let runtime = format!("evidence_run_{suffix:x}"); + let url = |role: &str| { + format!( + "postgresql://{role}:synthetic-canary@{}:{}/{database}?sslmode=verify-full", + base.host(), + base.port() + ) + }; + let migration_url = url(&migration); + let runtime_url = url(&runtime); + let config_path = config(directory.path(), store); + let document = std::fs::read_to_string(&config_path).expect("read test configuration"); + std::fs::write( + &config_path, + document.replace( + "database:\n", + "database:\n caBundleRef: secret:env/EVIDENCE_TEST_STORE_CA\n", + ), + ) + .expect("add the disposable CA reference"); + for _ in 0..2 { + let output = evidencectl() + .args([ + "--format", + "json", + "provision", + "--admin-url-env", + "EVIDENCE_TEST_STORE_ADMIN", + "--runtime-config", + ]) + .arg(&config_path) + .env("EVIDENCE_TEST_STORE_MIGRATION", &migration_url) + .env("EVIDENCE_TEST_STORE_RUNTIME", &runtime_url) + .env( + "EVIDENCE_TEST_STORE_CA", + std::str::from_utf8(&ca).expect("fixture PEM"), + ) + .env("EVIDENCE_TEST_STORE_ADMIN", &admin_url) + .output() + .expect("invoke the provision command"); + assert!( + output.status.success(), + "{store} provision: {:?}", + output.status + ); + let report: serde_json::Value = + serde_json::from_slice(&output.stdout).expect("provision report"); + assert_eq!(report["roleMode"], "split"); + assert!(!String::from_utf8_lossy(&output.stdout).contains("synthetic-canary")); + } + let runtime_client = connect_verified(&runtime_url, &ca, None).await; + let migration_client = connect_verified(&migration_url, &ca, None).await; + let privilege = "SELECT has_database_privilege(current_database(), 'CREATE')"; + assert!(!runtime_client + .query_one(privilege, &[]) + .await + .unwrap() + .get::<_, bool>(0)); + assert!(migration_client + .query_one(privilege, &[]) + .await + .unwrap() + .get::<_, bool>(0)); + assert!(migration_client + .query_one("SELECT to_regnamespace($1) IS NULL", &[&schema]) + .await + .unwrap() + .get::<_, bool>(0)); + // The separate migration can create the store schema under its own role. + migration_client + .batch_execute(&format!("BEGIN; CREATE SCHEMA {schema}; ROLLBACK")) + .await + .expect("migration role can create the store schema"); + drop(runtime_client); + drop(migration_client); + admin + .batch_execute(&format!("DROP DATABASE {database} WITH (FORCE)")) + .await + .expect("clean up owned disposable database"); + admin + .batch_execute(&format!("DROP ROLE {migration}, {runtime}")) + .await + .expect("clean up owned disposable roles"); + } +} diff --git a/crates/registry-rstack-dev/src/bindings.rs b/crates/registry-rstack-dev/src/bindings.rs index 84edefcc8a..cf07d0a5d3 100644 --- a/crates/registry-rstack-dev/src/bindings.rs +++ b/crates/registry-rstack-dev/src/bindings.rs @@ -1464,6 +1464,7 @@ mod tests { issuer: "https://identity.example.test/realms/dev".to_owned(), external_jwks_uri: None, external_breg: None, + external_scheduling: None, products: vec![ ProductPlan { product: Product::Breg, diff --git a/crates/registry-rstack-dev/src/external_breg.rs b/crates/registry-rstack-dev/src/external_breg.rs index 47b6042554..0d5740e67b 100644 --- a/crates/registry-rstack-dev/src/external_breg.rs +++ b/crates/registry-rstack-dev/src/external_breg.rs @@ -16,7 +16,8 @@ use std::{ use zeroize::Zeroizing; use crate::plan::{ - identifier, numeric_loopback_endpoint, require, SemanticRefusal, SemanticResult, + identifier, issuer_url, numeric_loopback_endpoint, require, Plan, Product, SemanticRefusal, + SemanticResult, }; #[derive(Deserialize, Serialize)] @@ -71,6 +72,111 @@ pub(super) struct TaskGrant { status_resource: String, } +impl TaskGrant { + pub(super) fn validate_for_scheduling( + &self, + root: &Path, + plan: &Plan, + audience: &str, + ) -> SemanticResult<()> { + let same_origin = |endpoint: &str| { + url::Url::parse(endpoint) + .ok() + .zip(url::Url::parse(&plan.issuer).ok()) + .is_some_and(|(endpoint, issuer)| endpoint.origin() == issuer.origin()) + }; + require( + plan.jwks_uri().is_some_and(same_origin), + "/externalJwksUri", + "The Scheduling fixture issuer and its key endpoint must have the same origin.", + "Use the key endpoint published by the configured external issuer.", + )?; + let check = |valid, field, reason, remedy| { + require( + valid, + &format!("/externalScheduling/taskGrant/{field}"), + reason, + remedy, + ) + }; + check( + issuer_url(self.source_issuer.as_str()), + "sourceIssuer", + "The Scheduling fixture needs an exact HTTPS assertion issuer name.", + "Use the issuer name in the Casework task grant.", + )?; + check( + identifier(&self.assertion_client) + && plan + .people + .values() + .filter(|person| { + person.client == self.assertion_client + && person.grants.contains_key(&Product::Scheduling) + }) + .count() + == 1, + "assertionClient", + "The assertion client must name exactly one planned Scheduling caller.", + "Use the exact external booking client in one Scheduling grant entry.", + )?; + check( + crate::products::is_loopback_run_issuer(self.status_url.as_str()), + "statusUrl", + "The task status connection must use a numeric loopback HTTP origin.", + "Use the exact Casework status service origin with its port.", + )?; + check( + numeric_loopback_endpoint(self.token_endpoint.as_str()) + && same_origin(self.token_endpoint.as_str()), + "tokenEndpoint", + "The task status token endpoint must use the exact external issuer origin.", + "Use the token endpoint published by the configured external issuer.", + )?; + check( + identifier(&self.status_client) && self.status_client != self.assertion_client, + "statusClient", + "The task status client must have its own identifier.", + "Use a separate external client registered for task status reads.", + )?; + check( + registry_platform_httputil::valid_resource_uri(audience) + && registry_platform_httputil::valid_resource_uri(&self.status_resource) + && self.status_resource != audience, + "statusResource", + "The status resource must be an absolute URI distinct from the Scheduling audience.", + "Use the Casework status resource configured for the status client.", + )?; + check( + root.canonicalize() + .is_ok_and(|root| private_fixture(&root, &self.status_key_ref).is_ok()), + "statusKeyRef", + "The task status key must be a readable owner-only fixture file.", + "Use a secret:file reference to the separate status key under fixture/ with mode 0600.", + ) + } + + pub(super) fn configure( + &self, + store: impl FnOnce(&[u8]) -> Result, + root: &Path, + issuer: &str, + config: &mut Value, + ) -> Result<()> { + let key = private_fixture(root, &self.status_key_ref)?; + let private_key_ref = store(&key)?; + config["authentication"]["oidc"]["issuers"]["main"]["assertionIssuers"] + [&self.assertion_client] = json!([self.source_issuer]); + config["taskGrantStatus"] = json!([{ + "sourceIssuer": self.source_issuer, "baseUrl": self.status_url, + "tokenEndpoint": self.token_endpoint, "clientAssertionAudience": issuer, + "clientId": self.status_client, "privateKeyRef": private_key_ref, + "statusResource": self.status_resource + }]); + Ok(()) + } +} + #[derive(Deserialize, Serialize)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[serde(rename_all = "camelCase", deny_unknown_fields)] @@ -243,15 +349,12 @@ impl ExternalBreg { }); } if let Some(grant) = &self.task_grant { - let key = private_fixture(root, &grant.status_key_ref)?; - config["authentication"]["oidc"]["issuers"]["main"]["assertionIssuers"] - [&grant.assertion_client] = json!([grant.source_issuer]); - config["taskGrantStatus"] = json!([{ - "sourceIssuer": grant.source_issuer, "baseUrl": grant.status_url, - "tokenEndpoint": grant.token_endpoint, "clientAssertionAudience": issuer, - "clientId": grant.status_client, "privateKeyRef": store("external-task-status-key", &key)?, - "statusResource": grant.status_resource - }]); + grant.configure( + |key| store("external-task-status-key", key), + root, + issuer, + config, + )?; } Ok(()) } diff --git a/crates/registry-rstack-dev/src/owner_report.rs b/crates/registry-rstack-dev/src/owner_report.rs index e825a2b4b2..13c3b88bf8 100644 --- a/crates/registry-rstack-dev/src/owner_report.rs +++ b/crates/registry-rstack-dev/src/owner_report.rs @@ -23,6 +23,8 @@ use std::{ }; const CASEWORK: &str = include_str!("../../../products/casework/contracts/cli/report.schema.json"); +const BREG_IDENTITY_FACTS: &str = + include_str!("../../../products/breg/generated/tools/ctl-report.v1alpha1.schema.json"); const CASEWORK_FORMAT: FormatSpec<'static> = FormatSpec { kind: "CaseworkReport", envelope: EnvelopeRule::ApiVersionKind { @@ -33,10 +35,30 @@ const CASEWORK_FORMAT: FormatSpec<'static> = FormatSpec { }, removed_keys: &[], }; +const BREG_REPORT_FORMAT: FormatSpec<'static> = FormatSpec { + kind: "BRegCtlReport", + envelope: EnvelopeRule::ApiVersionKind { + api_versions: &[ApiVersion::current( + "id.registrystack.org/formats/breg/ctl-report/v1alpha1", + )], + retired_api_versions: &[], + }, + removed_keys: &[], +}; #[derive(Clone, Copy, Debug, PartialEq, Eq, clap::ValueEnum)] pub(crate) enum Format { CaseworkReport, + BregIdentityFactsReport, +} + +impl Format { + fn spec(self) -> &'static FormatSpec<'static> { + match self { + Self::CaseworkReport => &CASEWORK_FORMAT, + Self::BregIdentityFactsReport => &BREG_REPORT_FORMAT, + } + } } #[derive(Debug)] @@ -59,7 +81,7 @@ impl Invalid { } } - fn into_report(self, file: &str) -> (Report, u8) { + fn into_report(self, file: &str, format: Format) -> (Report, u8) { let (exit, code, remedy) = if self.schema_unavailable { ( crate::OPERATIONAL_FAILURE_EXIT, @@ -70,7 +92,7 @@ impl Invalid { (crate::DOMAIN_REFUSAL_EXIT, self.code, FORMAT_REMEDY) }; let mut diagnostic = Diagnostic::error(code, self.path, self.message, remedy); - diagnostic.artifact = Some(CASEWORK_FORMAT.kind.to_owned()); + diagnostic.artifact = Some(format.spec().kind.to_owned()); diagnostic.source = Some(Source { file: file.to_owned(), line: self.position.map(|(line, _)| line), @@ -110,23 +132,20 @@ fn parse_position(bytes: &[u8], line: usize, byte_column: usize) -> Option<(usiz fn check_bytes(file: &str, bytes: &[u8], format: Format) -> (Report, u8) { let report = match parse(bytes) { Ok(report) => report, - Err(error) => return error.into_report(file), - }; - let expected = match format { - Format::CaseworkReport => &CASEWORK_FORMAT, + Err(error) => return error.into_report(file, format), }; // The JSON parser enforces the declared syntax. The shared reader checks // the envelope and retains positions for every schema diagnostic. - let document = match Reader::new(file).read(bytes, &Expect::one(expected)) { + let document = match Reader::new(file).read(bytes, &Expect::one(format.spec())) { Ok(document) => document, Err(mut report) => { - redact_structure(&mut report); + redact_structure(&mut report, format); return (report, crate::DOMAIN_REFUSAL_EXIT); } }; let issues = match validate(&report, format, Some(&document)) { Ok(issues) => issues, - Err(error) => return error.into_report(file), + Err(error) => return error.into_report(file, format), }; let mut report = document.report_with(issues.into_iter().map(|issue| { let mut diagnostic = document.diagnostic_at_value( @@ -150,7 +169,13 @@ fn check_bytes(file: &str, bytes: &[u8], format: Format) -> (Report, u8) { const FORMAT_REMEDY: &str = "Select the matching owner report format and capture a fresh report as JSON."; -fn redact_structure(report: &mut Report) { +fn redact_structure(report: &mut Report, format: Format) { + let message = match format { + Format::CaseworkReport => "Expected a valid CaseworkReport v1alpha2 envelope and document", + Format::BregIdentityFactsReport => { + "Expected a valid BRegCtlReport v1alpha1 envelope and document" + } + }; for diagnostic in report.diagnostics_mut() { if diagnostic.code == "config.too-many-problems" { continue; @@ -158,8 +183,7 @@ fn redact_structure(report: &mut Report) { if !matches!(diagnostic.path.as_str(), "/kind" | "/apiVersion") { diagnostic.path.clear(); } - diagnostic.message = - "Expected a valid CaseworkReport v1alpha2 envelope and document".to_owned(); + diagnostic.message = message.to_owned(); diagnostic.suggested_action = FORMAT_REMEDY.to_owned(); diagnostic.related.clear(); } @@ -183,6 +207,14 @@ fn validate( ) -> Result, Invalid> { match format { Format::CaseworkReport => validate_casework(report, document), + Format::BregIdentityFactsReport => { + static SCHEMA: OnceLock> = OnceLock::new(); + let schema = SCHEMA + .get_or_init(|| compile(serde_json::from_str(BREG_IDENTITY_FACTS).ok()?)) + .as_ref() + .ok_or_else(schema_unavailable)?; + Ok(schema.issues(report, "", document)) + } } } @@ -279,7 +311,7 @@ impl Schema { let mut issues = Vec::new(); let mut seen = BTreeSet::new(); for error in errors { - let path = self.diagnostic_path(prefix, &error.instance_path); + let (path, instance_schema) = self.diagnostic_path(prefix, &error.instance_path); let raw_parent = error.instance_path.to_string(); if let ValidationErrorKind::AdditionalProperties { unexpected } = &error.kind { for key in unexpected { @@ -311,7 +343,9 @@ impl Schema { ValidationErrorKind::Minimum { .. } | ValidationErrorKind::Maximum { .. } | ValidationErrorKind::Custom { .. } => { - if let Some((minimum, maximum)) = self.error_integer_bounds(&error) { + if let Some((minimum, maximum)) = + self.error_integer_bounds(&error, instance_schema) + { issue.code = if integer(&error.instance).is_some() { "config.out-of-range" } else { @@ -345,28 +379,43 @@ impl Schema { issues } - fn error_integer_bounds(&self, error: &ValidationError<'_>) -> Option<(i128, i128)> { + fn error_integer_bounds( + &self, + error: &ValidationError<'_>, + instance_schema: Option<&Value>, + ) -> Option<(i128, i128)> { let schema_path = error.schema_path.to_string(); - let (parent, _) = schema_path.rsplit_once('/')?; - let schema = self.document.pointer(parent)?.as_object()?; - schema - .contains_key(EXACT_INTEGER) - .then(|| exact_integer_bounds(schema)) + // A validator can report the path through a reference rather than the + // definition that holds the bounds. Use the instance schema when the + // path resolves entirely through declared properties and array items. + let reported = schema_path + .rsplit_once('/') + .and_then(|(parent, _)| self.document.pointer(parent)); + [reported, instance_schema] + .into_iter() + .flatten() + .filter_map(Value::as_object) + .find(|schema| schema.contains_key(EXACT_INTEGER)) + .map(exact_integer_bounds) } - fn diagnostic_path(&self, prefix: &str, instance_path: &JSONPointer) -> String { + fn diagnostic_path( + &self, + prefix: &str, + instance_path: &JSONPointer, + ) -> (String, Option<&Value>) { let mut path = prefix.to_owned(); let mut schema = &self.document; for part in instance_path { let Some(resolved) = self.resolve_path_schema(schema) else { - break; + return (path, None); }; // Only literal properties and array items establish a safe path. // Dynamic map members and ambiguous schema positions end the path. match part { PathChunk::Property(name) => { let Some(child) = resolved["properties"].get(name.as_ref()) else { - break; + return (path, None); }; schema = child; path.push('/'); @@ -377,16 +426,16 @@ impl Schema { .get(*index) .or_else(|| resolved.get("items")) else { - break; + return (path, None); }; schema = child; path.push('/'); path.push_str(&index.to_string()); } - PathChunk::Keyword(_) => break, + PathChunk::Keyword(_) => return (path, None), } } - path + (path, self.resolve_path_schema(schema)) } fn resolve_path_schema<'a>(&'a self, mut schema: &'a Value) -> Option<&'a Value> { diff --git a/crates/registry-rstack-dev/src/owner_report_tests.rs b/crates/registry-rstack-dev/src/owner_report_tests.rs index b49ae3a350..4a650da70b 100644 --- a/crates/registry-rstack-dev/src/owner_report_tests.rs +++ b/crates/registry-rstack-dev/src/owner_report_tests.rs @@ -4,6 +4,8 @@ use super::*; const CASEWORK: &str = include_str!("../../../products/casework/examples/formats/reports/check-report.json"); +const BREG_IDENTITY_FACTS: &str = + include_str!("../../../products/breg/examples/formats/identity-facts-report.json"); fn decode(bytes: &[u8], format: Format) -> Result<(), Diagnostic> { let (report, exit) = check_bytes("synthetic.json", bytes, format); @@ -64,6 +66,53 @@ fn casework_native_u32_counts_use_the_selected_command_branch() { assert_eq!(decode(&report).unwrap_err().path, "/claims"); } +#[test] +fn breg_reads_only_completed_identity_facts_report_structure() { + let format = Format::BregIdentityFactsReport; + let mut report: Value = serde_json::from_str(BREG_IDENTITY_FACTS).unwrap(); + report["artifacts"][0]["path"] = json!("never-open-this/identity-facts.yaml"); + let check = |value: &Value| decode(&serde_json::to_vec(value).unwrap(), format); + assert!(check(&report).is_ok()); + + for (pointer, value) in [ + ("/command", json!("explain")), + ("/status", json!("domain-refusal")), + ("/artifacts/0/sha256", json!("synthetic-private-digest")), + ("/artifacts/0/byteLength", json!(0)), + ("/explanation/identityFacts/claims", json!(65)), + ] { + let mut refused = report.clone(); + *refused.pointer_mut(pointer).unwrap() = value; + let issue = check(&refused).unwrap_err(); + assert_eq!(issue.path, pointer); + assert!(!issue.message.contains("synthetic-private-digest")); + assert!(issue.source.unwrap().column.is_some()); + } + + let mut wrong_kind = report; + wrong_kind["kind"] = json!("PlatformIdentityFacts"); + let issue = check(&wrong_kind).unwrap_err(); + assert_eq!(issue.path, "/kind"); + assert!(issue.message.contains("BRegCtlReport")); + assert!(decode(BREG_IDENTITY_FACTS.as_bytes(), Format::CaseworkReport).is_err()); +} + +#[test] +fn breg_reports_native_integer_bounds_through_diagnostic_references() { + let format = Format::BregIdentityFactsReport; + for (pointer, value) in [ + ("/diagnostics/0/source/column", 0), + ("/diagnostics/0/source/line", MAXIMUM_DOCUMENT_BYTES + 2), + ] { + let mut report: Value = serde_json::from_str(BREG_IDENTITY_FACTS).unwrap(); + *report.pointer_mut(pointer).unwrap() = json!(value); + let issue = decode(&serde_json::to_vec(&report).unwrap(), format).unwrap_err(); + assert_eq!(issue.path, pointer); + assert_eq!(issue.code, "config.out-of-range"); + assert!(issue.message.contains("from 1 to 1048577")); + } +} + #[test] fn plain_reader_refuses_duplicate_trailing_and_oversized_json() { assert!(parse(br#"{"a":{"b":1,"b":2}}"#).is_err()); diff --git a/crates/registry-rstack-dev/src/plan.rs b/crates/registry-rstack-dev/src/plan.rs index b45317b899..d6dbbe4ffc 100644 --- a/crates/registry-rstack-dev/src/plan.rs +++ b/crates/registry-rstack-dev/src/plan.rs @@ -360,6 +360,9 @@ pub(super) struct Plan { /// Explicit connections from a development BReg to external fixture services. #[serde(default, skip_serializing_if = "Option::is_none")] pub external_breg: Option, + /// One external task grant and its live status provider for a Scheduling fixture. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub external_scheduling: Option, /// The products to start, each with its project directory and token audience. List each product at most once. pub products: Vec, /// The audience that products a person calls from a page will share: an absolute URI of at most 256 characters, with no fragment or user information. Only BReg can be a member, by setting its `audience` to the same value, whether or not it checks task grants. Casework keeps its own audience, Messaging takes no person token, and Evidence cannot join yet. Declaring `personAudience` alone changes nothing at run time. @@ -392,6 +395,13 @@ pub(super) struct Plan { pub preview: Option, } +#[derive(Deserialize, Serialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub(super) struct ExternalScheduling { + pub task_grant: super::external_breg::TaskGrant, +} + /// A generic Node application and its configuration command. All artifact paths are relative to the supplied built root. #[derive(Deserialize, Serialize)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] @@ -1355,6 +1365,23 @@ impl Plan { "Set issuer to the exact external issuer and externalJwksUri to its key endpoint.", )?; } + if let Some(binding) = &self.external_scheduling { + let scheduling = self + .products + .iter() + .find(|entry| entry.product == Product::Scheduling); + require( + self.jwks_uri().is_some() && scheduling.is_some(), + "/externalScheduling", + "An external Scheduling task grant needs Scheduling and an external issuer.", + "Select Scheduling and set issuer and externalJwksUri to the fixture issuer and its key endpoint.", + )?; + binding.task_grant.validate_for_scheduling( + root, + self, + &scheduling.expect("validated Scheduling product").audience, + )?; + } require( (self.issuer != "run" || self.application.is_some() @@ -2027,7 +2054,7 @@ impl JourneyFile { } } -fn issuer_url(value: &str) -> bool { +pub(super) fn issuer_url(value: &str) -> bool { value.len() <= 512 && ParsedUrl::parse(value).is_ok_and(|url| { url.scheme() == "https" @@ -2329,6 +2356,96 @@ mod tests { } } + #[test] + fn managed_scheduling_requires_the_exact_external_grant_binding() { + let (root, mut plan) = plan(json!({"id": "read", "product": "breg", + "as": "operator", "method": "GET", "path": "/v1/records", "expect": {"status": 200}})); + fs::write(root.path().join("scheduling.yaml"), "{}").unwrap(); + fs::create_dir(root.path().join("fixture")).unwrap(); + crate::write_private( + &root.path().join("fixture/status-key"), + b"synthetic fixture credential", + ) + .unwrap(); + plan.products = serde_json::from_value(json!([{ + "product": "scheduling", "project": ".", "audience": "urn:example:journey:scheduling" + }])) + .unwrap(); + plan.people = serde_json::from_value(json!({"booker": { + "subject": "booker", "client": "task-agent", + "grants": {"scheduling": {"profile": "booker", "scopes": ["scheduling:write"]}} + }})) + .unwrap(); + plan.issuer = "http://127.0.0.1:41000".to_owned(); + plan.external_jwks_uri = Some("http://127.0.0.1:41000/oauth2/jwks".to_owned()); + let binding = json!({"taskGrant": { + "sourceIssuer": "https://casework.journey.example", + "assertionClient": "task-agent", + "statusUrl": "http://127.0.0.1:41001", + "tokenEndpoint": "http://127.0.0.1:41000/oauth2/token", + "statusClient": "scheduling-status", + "statusKeyRef": "secret:file/status-key", + "statusResource": "urn:example:journey:casework" + }}); + plan.external_scheduling = Some(serde_json::from_value(binding.clone()).unwrap()); + plan.validate(root.path()) + .expect("fixed external Scheduling grant"); + let mut runtime = json!({"authentication": {"oidc": {"issuers": {"main": { + "allowedClients": ["task-agent"], "issuer": plan.issuer + }}}}}); + plan.external_scheduling + .as_ref() + .unwrap() + .task_grant + .configure( + |_| Ok("secret:file/run-task-status-key".to_owned()), + &root.path().canonicalize().unwrap(), + &plan.issuer, + &mut runtime, + ) + .unwrap(); + assert_eq!( + runtime["authentication"]["oidc"]["issuers"]["main"]["assertionIssuers"], + json!({"task-agent": ["https://casework.journey.example"]}) + ); + assert_eq!( + runtime["taskGrantStatus"], + json!([{ + "sourceIssuer": "https://casework.journey.example", + "baseUrl": "http://127.0.0.1:41001", + "tokenEndpoint": "http://127.0.0.1:41000/oauth2/token", + "clientAssertionAudience": "http://127.0.0.1:41000", + "clientId": "scheduling-status", + "privateKeyRef": "secret:file/run-task-status-key", + "statusResource": "urn:example:journey:casework" + }]) + ); + + for (field, value) in [ + ("sourceIssuer", "http://127.0.0.1:41001"), + ("assertionClient", "another-agent"), + ("statusUrl", "http://127.0.0.1:41001/arbitrary"), + ("tokenEndpoint", "http://127.0.0.1:41002/oauth2/token"), + ("statusClient", "task-agent"), + ("statusKeyRef", "secret:file/missing"), + ("statusResource", "urn:example:journey:scheduling"), + ] { + let mut mutated = binding.clone(); + mutated["taskGrant"][field] = json!(value); + plan.external_scheduling = Some(serde_json::from_value(mutated).unwrap()); + assert_eq!( + plan.validate(root.path()).unwrap_err().field, + format!("/externalScheduling/taskGrant/{field}") + ); + } + plan.external_scheduling = Some(serde_json::from_value(binding).unwrap()); + plan.external_jwks_uri = Some("http://127.0.0.1:41002/oauth2/jwks".to_owned()); + assert_eq!( + plan.validate(root.path()).unwrap_err().field, + "/externalJwksUri" + ); + } + #[test] fn a_fixed_external_hook_may_use_the_managed_development_issuer() { let (root, mut plan) = plan(json!({"id": "read", "product": "breg", diff --git a/crates/registry-rstack-dev/src/products.rs b/crates/registry-rstack-dev/src/products.rs index 94222cfbdb..b507632496 100644 --- a/crates/registry-rstack-dev/src/products.rs +++ b/crates/registry-rstack-dev/src/products.rs @@ -1579,6 +1579,14 @@ impl<'a> ProductRunner<'a> { config["authentication"] = json!({"oidc": issuer_set(oidc)}); if product == Product::Scheduling { config["taskGrantStatus"] = json!("unchecked-final-fifteen-minutes"); + if let Some(external) = &self.input.plan.external_scheduling { + external.task_grant.configure( + |bytes| self.secret("scheduling-external-task-status-key", bytes), + &self.input.project, + &self.input.plan.issuer, + &mut config, + )?; + } config["retention"] = json!({}); } else { config["storage"] = json!({"type": "database"}); diff --git a/crates/registry-rstack/src/cli.rs b/crates/registry-rstack/src/cli.rs index e3f52b7fe9..1bb245d61f 100644 --- a/crates/registry-rstack/src/cli.rs +++ b/crates/registry-rstack/src/cli.rs @@ -262,7 +262,7 @@ struct ClientGenerate { enum DevCommand { /// Validate a development plan or the structure of a saved owner report without starting services. #[command( - after_help = "Examples:\n rstack dev check ./my-registry-project\n rstack dev check --owner-report ./report.json --owner-report-format casework-report" + after_help = "Examples:\n rstack dev check ./my-registry-project\n rstack dev check --owner-report ./report.json --owner-report-format casework-report\n rstack dev check --owner-report ./identity-facts-report.json --owner-report-format breg-identity-facts-report" )] Check { /// Project directory containing dev.yaml and, when it declares audiences, service.yaml. @@ -277,7 +277,7 @@ enum DevCommand { )] owner_report: Option, /// Exact saved document format. - #[arg(long, requires = "owner_report", conflicts_with = "project", value_parser = ["casework-report"])] + #[arg(long, requires = "owner_report", conflicts_with = "project", value_parser = ["casework-report", "breg-identity-facts-report"])] owner_report_format: Option, /// Refuse an unaccepted warning. /// Development posture listings do not count. @@ -2610,6 +2610,14 @@ mod tests { "--deny-warnings", ]) .is_ok()); + assert!(parse(&[ + "--owner-report", + "./report.json", + "--owner-report-format", + "breg-identity-facts-report", + "--deny-warnings", + ]) + .is_ok()); for args in [ &[][..], &["--owner-report", "./report.json"], diff --git a/crates/registry-session/src/gateway.rs b/crates/registry-session/src/gateway.rs index 2566d393ce..50226f5f49 100644 --- a/crates/registry-session/src/gateway.rs +++ b/crates/registry-session/src/gateway.rs @@ -237,6 +237,15 @@ fn load_gateway_config( continue; } for index in 0..count { + if checked_routes { + let field = if list == "modules" { + "signIns" + } else { + "signIn" + }; + let binding = format!("/{list}/{index}/{field}"); + require(&binding, file.defers_within(&binding)); + } for field in ["id", "prefix", "upstream", "product"] { let pointer = format!("/{list}/{index}/{field}"); require( @@ -829,6 +838,8 @@ mod verify; pub use verify::{ verify_assembled, write_standalone, write_verified_route_inventory, StandaloneTls, }; +#[cfg(feature = "schema")] +pub(crate) use verify::{ROUTE_INVENTORY_API_VERSION, ROUTE_INVENTORY_KIND}; #[cfg(test)] mod tests { diff --git a/crates/registry-session/src/gateway/verify.rs b/crates/registry-session/src/gateway/verify.rs index 97757c879b..67258f23fa 100644 --- a/crates/registry-session/src/gateway/verify.rs +++ b/crates/registry-session/src/gateway/verify.rs @@ -18,10 +18,9 @@ use std::{ path::Path, }; -use registry_platform_config::{ListenerNetworkExposure, TlsTermination}; +use registry_platform_config::{sha256_uri, ListenerNetworkExposure, TlsTermination}; use registry_platform_yaml::{Reader, Refusal, ScalarHook, ScalarSite, ScalarStyle}; use serde_json::{json, Value}; -use sha2::{Digest, Sha256}; use super::*; use crate::config::ModuleProduct; @@ -29,6 +28,9 @@ use crate::wire::SOURCE_PROFILE_HEADER; /// The most bytes of an assembled configuration `--verify-assembled` reads. const MAXIMUM_ASSEMBLED_BYTES: u64 = 16 * 1024 * 1024; +pub(crate) const ROUTE_INVENTORY_API_VERSION: &str = + "id.registrystack.org/formats/platform/session-route-inventory/v1alpha1"; +pub(crate) const ROUTE_INVENTORY_KIND: &str = "PlatformSessionRouteInventory"; const MANAGER_TYPE: &str = "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager"; @@ -672,6 +674,16 @@ pub fn write_verified_route_inventory( "Select a disjoint BReg module prefix that rewrites to the product root.", )); } + if config.pages.iter().any(|page| { + !page + .prefix + .bytes() + .all(|byte| byte.is_ascii_alphanumeric() || b"/._:~-".contains(&byte)) + }) { + return Err(standalone_refusal( + "Use checked page prefixes made of letters, digits, or /._:~-.", + )); + } if config.pages.iter().any(|page| { config.modules.iter().any(|module| { lies_under(&page.prefix, &module.prefix) || lies_under(&module.prefix, &page.prefix) @@ -700,17 +712,11 @@ pub fn write_verified_route_inventory( .iter() .map(|page| json!({"prefix": page.prefix, "signIn": page.sign_in.as_str()})) .collect(); - let assembly_bytes = serde_json::to_vec(&document) - .map_err(|_| standalone_refusal("Could not serialize the verified assembly."))?; - let gateway_sha256: String = Sha256::digest(assembly_bytes) - .iter() - .map(|byte| format!("{byte:02x}")) - .collect(); let inventory = json!({ - "apiVersion": "id.registrystack.org/formats/platform/session-route-inventory/v1alpha1", - "kind": "PlatformSessionRouteInventory", + "apiVersion": ROUTE_INVENTORY_API_VERSION, + "kind": ROUTE_INVENTORY_KIND, "publicOrigin": config.public_origin.as_str().trim_end_matches('/'), - "gatewaySha256": gateway_sha256, + "gatewayDigest": sha256_uri(&assembly_bytes), "modules": modules, "pages": pages, }); diff --git a/crates/registry-session/src/lib.rs b/crates/registry-session/src/lib.rs index a60a0d15f5..80c70798f8 100644 --- a/crates/registry-session/src/lib.rs +++ b/crates/registry-session/src/lib.rs @@ -141,7 +141,7 @@ pub fn command() -> Command { Arg::new("route-inventory-out") .long("route-inventory-out") .value_name("FILE") - .help("Write browser paths for the selected BReg route from a verified loopback HTTPS assembly") + .help("Write browser paths for the selected Base Registry Engine route from a verified loopback HTTPS assembly") .requires_all(["verify-assembled", "checked-route"]) .value_parser(value_parser!(PathBuf)), ) @@ -149,7 +149,7 @@ pub fn command() -> Command { Arg::new("checked-route") .long("checked-route") .value_name("ID") - .help("Select the BReg product module for the browser route inventory") + .help("Select the Base Registry Engine module for the browser route inventory") .requires("route-inventory-out"), ) .arg( diff --git a/crates/registry-session/src/schema.rs b/crates/registry-session/src/schema.rs index 5a76b259a4..14cf1dbabf 100644 --- a/crates/registry-session/src/schema.rs +++ b/crates/registry-session/src/schema.rs @@ -7,6 +7,8 @@ use std::{borrow::Cow, collections::BTreeMap}; +use registry_platform_yaml::{Digest, LocalId, Url}; +use schemars::generate::SchemaSettings; use schemars::{json_schema, JsonSchema, Schema, SchemaGenerator}; use serde_json::{json, Value}; @@ -14,12 +16,18 @@ use crate::config::{ Authority, ClaimName, ClusterName, FilterName, HostName, ModuleAudience, ResourceUri, RewritePrefix, RuntimeConfig, ScopeToken, RUNTIME_API_VERSION, RUNTIME_KIND, }; +use crate::gateway::{ROUTE_INVENTORY_API_VERSION, ROUTE_INVENTORY_KIND}; /// The `$id` of the runtime schema. pub const RUNTIME_SCHEMA_ID: &str = "https://id.registrystack.org/schemas/platform/session-runtime/session-runtime.v1alpha1.schema.json"; /// The file name of the committed runtime schema. pub const RUNTIME_SCHEMA_FILE: &str = "session-runtime.schema.json"; +/// The `$id` of the checked browser route inventory schema. +pub const ROUTE_INVENTORY_SCHEMA_ID: &str = + "https://id.registrystack.org/schemas/platform/session-route-inventory/session-route-inventory.v1alpha1.schema.json"; +/// The file name of the committed checked route inventory schema. +pub const ROUTE_INVENTORY_SCHEMA_FILE: &str = "session-route-inventory.v1alpha1.schema.json"; /// Every generated schema, by file name, as the bytes to commit. pub fn schema_documents() -> Result, serde_json::Error> { @@ -43,7 +51,62 @@ pub fn schema_documents() -> Result, serde_json:: ]); let mut rendered = serde_json::to_string_pretty(&runtime)?; rendered.push('\n'); - Ok([(RUNTIME_SCHEMA_FILE, rendered)].into()) + let mut inventory = serde_json::to_string_pretty(&route_inventory_schema())?; + inventory.push('\n'); + Ok([ + (RUNTIME_SCHEMA_FILE, rendered), + (ROUTE_INVENTORY_SCHEMA_FILE, inventory), + ] + .into()) +} + +fn route_inventory_schema() -> Value { + let mut generator = SchemaSettings::draft2020_12().into_generator(); + let id = generator.subschema_for::(); + let digest = generator.subschema_for::(); + let mut origin = json!(generator.subschema_for::()); + origin["pattern"] = json!("^https://127(?:\\.[0-9]{1,3}){3}(?::[0-9]{1,5})?$"); + json!({ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": ROUTE_INVENTORY_SCHEMA_ID, + "$defs": generator.take_definitions(true), + "title": "Checked Registry Session route inventory", + "description": "One Base Registry Engine browser route and its page bindings from an exact, verified Envoy JSON file.", + "type": "object", + "additionalProperties": false, + "required": ["apiVersion", "kind", "publicOrigin", "gatewayDigest", "modules", "pages"], + "properties": { + "apiVersion": {"type": "string", "const": ROUTE_INVENTORY_API_VERSION}, + "kind": {"type": "string", "const": ROUTE_INVENTORY_KIND}, + "publicOrigin": origin, + "gatewayDigest": digest, + "modules": { + "type": "array", "minItems": 1, "maxItems": 1, + "items": { + "type": "object", "additionalProperties": false, + "required": ["id", "product", "prefix", "prefixRewrite", "signIns"], + "properties": { + "id": id, + "product": {"type": "string", "const": "breg"}, + "prefix": {"type": "string", "maxLength": 256, "pattern": "^/(?:(?!\\.\\.?/)[A-Za-z0-9._:-]+/)+$"}, + "prefixRewrite": {"type": "string", "const": "/"}, + "signIns": {"type": "array", "minItems": 1, "maxItems": 64, "uniqueItems": true, "items": id} + } + } + }, + "pages": { + "type": "array", "maxItems": 64, "uniqueItems": true, + "items": { + "type": "object", "additionalProperties": false, + "required": ["prefix", "signIn"], + "properties": { + "prefix": {"type": "string", "maxLength": 256, "pattern": "^/(?:(?!\\.\\.?(?:/|$))[A-Za-z0-9._:~-]+(?:/|$))+$"}, + "signIn": id + } + } + } + } + }) } /// File audit requires an absolute path. Stdout accepts no file-only setting. diff --git a/crates/registry-session/tests/binary.rs b/crates/registry-session/tests/binary.rs index d584f56418..5f341e2830 100644 --- a/crates/registry-session/tests/binary.rs +++ b/crates/registry-session/tests/binary.rs @@ -277,11 +277,9 @@ fn gateway_writes_a_deterministic_checked_standalone_configuration() { fn gateway_inventory_requires_the_exact_verified_assembly() { let root = tempfile::tempdir().expect("directory"); let runtime = root.path().join("runtime.yaml"); - std::fs::write( - &runtime, - standalone_runtime().replace("https://app.example", "https://127.0.0.1:8080"), - ) - .expect("runtime"); + let runtime_source = + standalone_runtime().replace("https://app.example", "https://127.0.0.1:8080"); + std::fs::write(&runtime, &runtime_source).expect("runtime"); let assembly = root.path().join("envoy.json"); let routes = root.path().join("routes.json"); let certificate = root.path().join("cert.pem"); @@ -302,23 +300,26 @@ fn gateway_inventory_requires_the_exact_verified_assembly() { assert_eq!(verify().0, 1, "ordinary plaintext assembly must not export"); assert!(!routes.exists()); - let (exit, _, stderr) = run_command( - runtime_command(&runtime) - .args(["gateway", "envoy", "--standalone-out"]) - .arg(&assembly) - .args([ - "--listen", - "127.0.0.1:8080", - "--upstream", - "registry=127.0.0.1:8100", - "--upstream", - "pages=127.0.0.1:8200", - ]) - .arg("--tls-certificate") - .arg(&certificate) - .arg("--tls-key") - .arg(&key), - ); + let assemble = || { + run_command( + runtime_command(&runtime) + .args(["gateway", "envoy", "--standalone-out"]) + .arg(&assembly) + .args([ + "--listen", + "127.0.0.1:8080", + "--upstream", + "registry=127.0.0.1:8100", + "--upstream", + "pages=127.0.0.1:8200", + ]) + .arg("--tls-certificate") + .arg(&certificate) + .arg("--tls-key") + .arg(&key), + ) + }; + let (exit, _, stderr) = assemble(); assert_eq!(exit, 0, "{stderr}"); let (exit, _, stderr) = verify(); assert_eq!(exit, 0, "{stderr}"); @@ -326,6 +327,26 @@ fn gateway_inventory_requires_the_exact_verified_assembly() { let inventory: serde_json::Value = serde_json::from_slice(&first).expect("JSON inventory"); assert_eq!(inventory["kind"], "PlatformSessionRouteInventory"); assert_eq!(inventory["publicOrigin"], "https://127.0.0.1:8080"); + let digest = |file: &std::path::Path| { + let bytes = std::fs::read(file).expect("assembly bytes"); + registry_platform_config::sha256_uri(&bytes) + }; + assert_eq!(inventory["gatewayDigest"], digest(&assembly)); + #[cfg(feature = "schema")] + { + use registry_session::schema::{schema_documents, ROUTE_INVENTORY_SCHEMA_FILE}; + let schemas = schema_documents().expect("Session schemas"); + let schema = serde_json::from_str(&schemas[ROUTE_INVENTORY_SCHEMA_FILE]) + .expect("inventory schema is JSON"); + let validator = jsonschema::JSONSchema::options() + .with_draft(jsonschema::Draft::Draft202012) + .compile(&schema) + .expect("inventory schema compiles"); + assert!( + validator.is_valid(&inventory), + "native inventory violates its schema" + ); + } assert_eq!( inventory["modules"], json!([{ @@ -356,6 +377,26 @@ fn gateway_inventory_requires_the_exact_verified_assembly() { assert_eq!(exit, 0, "{stderr}"); assert_eq!(std::fs::read(&routes).expect("regenerated routes"), first); + for (field, deferred) in [ + ( + "module sign-ins", + runtime_source.replace( + " audience: person\n", + " audience: person\n signIns: [citizen, '${MODULE_SIGN_IN}']\n", + ), + ), + ( + "page sign-in", + runtime_source.replace(" signIn: citizen", " signIn: '${PAGE_SIGN_IN}'"), + ), + ] { + assert_ne!(deferred, runtime_source); + std::fs::write(&runtime, deferred).expect("deferred runtime"); + assert_eq!(verify().0, 1, "refuse deferred {field}"); + assert_eq!(std::fs::read(&routes).expect("retained inventory"), first); + } + std::fs::write(&runtime, &runtime_source).expect("restore literal test fixture"); + assert_eq!(export(&key).0, 1, "refuse to overwrite the gateway TLS key"); assert_eq!( std::fs::read_to_string(&key).expect("original key placeholder"), @@ -376,6 +417,15 @@ fn gateway_inventory_requires_the_exact_verified_assembly() { assert!(!certificate.exists()); let contents = std::fs::read_to_string(&assembly).expect("Envoy configuration"); + std::fs::write(&assembly, format!("{contents}\n")).expect("reformat assembly"); + assert_eq!(verify().0, 0, "whitespace remains valid JSON"); + let reformatted = std::fs::read(&routes).expect("new inventory digest"); + let changed: serde_json::Value = serde_json::from_slice(&reformatted).expect("JSON inventory"); + assert_eq!(changed["gatewayDigest"], digest(&assembly)); + assert_ne!(changed["gatewayDigest"], inventory["gatewayDigest"]); + std::fs::write(&assembly, &contents).expect("restore original assembly bytes"); + assert_eq!(verify().0, 0); + std::fs::write( &assembly, contents.replacen("\"static_resources\"", "static_resources", 1), @@ -404,6 +454,14 @@ fn gateway_inventory_requires_the_exact_verified_assembly() { std::fs::write(&assembly, remote.to_string()).expect("mutate upstream address"); assert_eq!(verify().0, 1); assert_eq!(std::fs::read(&routes).expect("retained inventory"), first); + + let unsafe_page = runtime_source.replace("/apply/", "/apply;/"); + assert_ne!(unsafe_page, runtime_source); + std::fs::write(&runtime, unsafe_page).expect("runtime with broader page prefix"); + let (exit, _, stderr) = assemble(); + assert_eq!(exit, 0, "{stderr}"); + assert_eq!(verify().0, 1, "refuse a page path that live checks reject"); + assert_eq!(std::fs::read(&routes).expect("retained inventory"), first); } #[test] diff --git a/docs/site/scripts/generate-breg-configuration.mjs b/docs/site/scripts/generate-breg-configuration.mjs index 98fbde9f21..d9d65763a0 100644 --- a/docs/site/scripts/generate-breg-configuration.mjs +++ b/docs/site/scripts/generate-breg-configuration.mjs @@ -47,8 +47,8 @@ const DEV_CONTRACTS = [ }, ].map(contract('tooling', undefined, 'products/platform/generated/dev')); -// Files `bregctl` reads beside a project: adopter tooling, published by the -// `tool-schema` example under products/breg/generated/tools. +// Adopter tooling files and saved reports, published by the `tool-schema` +// example under products/breg/generated/tools. const BREG_TOOL_CONTRACTS = [ { id: 'example-scenarios', @@ -86,6 +86,12 @@ const BREG_TOOL_CONTRACTS = [ file: 'tools/model-selection.v1alpha1.schema.json', reference: 'reference/bregctl-publicschema-wizard.mdx', }, + { + id: 'ctl-report', + title: 'Saved identity-facts-report.json', + file: 'tools/ctl-report.v1alpha1.schema.json', + reference: 'operate/advanced/generate-identity-configuration.mdx', + }, ].map(contract('tooling')); // The tool files listed in the order an adopter meets them; the generated diff --git a/docs/site/scripts/generate-breg-configuration.test.mjs b/docs/site/scripts/generate-breg-configuration.test.mjs index 60e0ede0fd..78143d7ec4 100644 --- a/docs/site/scripts/generate-breg-configuration.test.mjs +++ b/docs/site/scripts/generate-breg-configuration.test.mjs @@ -67,7 +67,7 @@ test('BReg covers every committed tool schema, in the order an adopter meets the ...await committed('products/platform/generated/dev'), ].sort(), [...TOOL_CONTRACTS.map((entry) => entry.file), ...reportSchemas].sort()); assert.deepEqual(TOOL_CONTRACTS.map((entry) => entry.id), ['rstack-dev', 'rstack-service', 'rstack-journeys', 'example-scenarios', - 'journeys', 'schema-test-credentials', 'migration-descriptor', 'backup-binding', 'model-selection']); + 'journeys', 'schema-test-credentials', 'migration-descriptor', 'backup-binding', 'model-selection', 'ctl-report']); }); test('BReg tool and service references read the committed schemas they name', async () => { @@ -95,6 +95,11 @@ test('BReg tool and service references read the committed schemas they name', as assert.ok(projectDev.has('products[].product')); assert.ok(fields('tools', 'rstack-journeys').has('journeys[].steps[].expect.status')); + const savedReport = fields('tools', 'ctl-report'); + assert.deepEqual(savedReport.get('kind').values, ['BRegCtlReport']); + assert.deepEqual(savedReport.get('command').values, ['generate']); + assert.deepEqual(savedReport.get('status').values, ['complete']); + const descriptor = fields('tools', 'migration-descriptor'); assert.deepEqual(descriptor.get('steps[].type').values, ['chunked-backfill', 'field-encryption-backfill', 'transactional-sql']); diff --git a/docs/site/scripts/generate-evidence-configuration.mjs b/docs/site/scripts/generate-evidence-configuration.mjs index 4db0eba1ed..d373cd183c 100644 --- a/docs/site/scripts/generate-evidence-configuration.mjs +++ b/docs/site/scripts/generate-evidence-configuration.mjs @@ -111,6 +111,13 @@ export const CONTRACTS = [ status: 'tooling', reference: AUTHORING_REFERENCE, }, + { + id: 'store-provision', + file: 'crates/registry-evidencectl/schemas/authoring/store-provision.schema.json', + title: 'store-provision.yaml', + status: 'tooling', + reference: 'products/evidence/OPERATOR-CONTRACT.md', + }, { id: 'oid4vci-runtime', file: 'products/evidence/generated/oid4vci-runtime/oid4vci-runtime.schema.json', diff --git a/docs/site/scripts/generate-evidence-configuration.test.mjs b/docs/site/scripts/generate-evidence-configuration.test.mjs index 4534cd5b90..0b2a3d9a28 100644 --- a/docs/site/scripts/generate-evidence-configuration.test.mjs +++ b/docs/site/scripts/generate-evidence-configuration.test.mjs @@ -660,6 +660,8 @@ test('every published schema declares whether it is frozen or adopter tooling', assert.equal(byId.get('authoring-project').status, 'tooling'); assert.equal(byId.get('authoring-target').status, 'tooling'); assert.equal(byId.get('authoring-target-authority').status, 'tooling'); + assert.equal(byId.get('store-provision').status, 'tooling'); + assert.equal(byId.get('store-provision').reference, 'products/evidence/OPERATOR-CONTRACT.md'); assert.equal(byId.get('oid4vci-runtime').status, 'beta'); assert.equal(byId.get('oid4vp-runtime').status, 'beta'); }); diff --git a/docs/site/src/content/docs/configure/evidence-oid4vci.mdx b/docs/site/src/content/docs/configure/evidence-oid4vci.mdx index 73f19764f0..a43cddb0b3 100644 --- a/docs/site/src/content/docs/configure/evidence-oid4vci.mdx +++ b/docs/site/src/content/docs/configure/evidence-oid4vci.mdx @@ -160,6 +160,18 @@ schema gives it, and `check` also enforces the rules a schema cannot hold: evidence.oid4vci.secret-file-root; products/evidence/examples/oid4vci-runtime/runtime.yaml. */} +## Prepare a PostgreSQL store for qualification + +To prepare a database for the OID4VCI store, follow +[Provision a PostgreSQL store for qualification](../../products/registry-evidence/operator-contract/#provision-a-postgresql-store-for-qualification) +and set `store: oid4vci` in the provisioning file. Provisioning prepares the +database and logins for a separate migration. `evidence-oid4vci serve` uses the +bounded in-memory store. + +{/* Evidence: crates/registry-evidencectl/src/store_provision.rs; + crates/registry-evidence-oid4vci/src/lib.rs; + crates/registry-evidence-oid4vci/src/storage/postgres.rs, migrate(). */} + ## Check offline Check the file before the service reads it: diff --git a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx index efd477e569..efb7fb5768 100644 --- a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx +++ b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx @@ -507,6 +507,23 @@ and check that the receiver verifies its signature and records the expected even crates/registry-rstack-dev/src/products.rs, prepare_breg_hooks; crates/registry-rstack-dev/src/external_breg.rs, Hook, hook_key. */} +## Attach a Scheduling task grant fixture + +For a development run with an external issuer, use `externalScheduling.taskGrant` to bind one +named Scheduling caller to a Casework assertion authority. Put the caller's `assertionClient` +in one Scheduling entry under `people` and use the exact Casework `sourceIssuer` from its grant. +Put the issuer's JWKS endpoint in `externalJwksUri` on the same numeric loopback origin as `issuer`. + +Set `statusUrl` to the Casework loopback origin and `tokenEndpoint` to the external issuer's token +endpoint. Set `statusClient` to its separate status reader, `statusKeyRef` to its owner-only key +under `fixture/` and `statusResource` to the reader's Casework resource. Run `rstack dev check` +before `rstack dev start`. Scheduling checks the grant's current status with Casework before +booking and refuses the operation if it cannot verify that status. + +{/* Evidence: crates/registry-rstack-dev/src/plan.rs, managed_scheduling_requires_the_exact_external_grant_binding; + crates/registry-rstack-dev/src/external_breg.rs, TaskGrant; + crates/registry-rstack-dev/src/products.rs, additional_config. */} + ## The managed PostgreSQL server The run starts PostgreSQL for BReg, Casework, Messaging, Scheduling, Documents, Coordinator and diff --git a/docs/site/src/content/docs/configure/session.mdx b/docs/site/src/content/docs/configure/session.mdx index 7f09e99219..46d48ebb99 100644 --- a/docs/site/src/content/docs/configure/session.mdx +++ b/docs/site/src/content/docs/configure/session.mdx @@ -297,8 +297,11 @@ registry-session --runtime-config /etc/registry-session/runtime.yaml gateway env ``` The export checks the standalone Envoy JSON and records the selected BReg product route, -its admitted sign-in kinds and the page bindings. Use it with the assembly that produced it. -Envoy and Session check live requests, and the product authorizes the operation. +its admitted sign-in kinds and the page bindings. Write the sign-in names literally and keep +page paths to letters, digits and `/._:~-`. +The `gatewayDigest` is SHA-256 over the exact Envoy JSON file bytes, including whitespace. +Use the inventory with those bytes. Envoy and Session check live requests, and the product +authorizes the operation. {/* Evidence: crates/registry-session/src/gateway/verify.rs, validate_checked_transport, verify_checked_transport, write_verified_route_inventory; diff --git a/docs/site/src/content/docs/operate/advanced/generate-identity-configuration.mdx b/docs/site/src/content/docs/operate/advanced/generate-identity-configuration.mdx index ff7af52ba9..3c9fdd7b16 100644 --- a/docs/site/src/content/docs/operate/advanced/generate-identity-configuration.mdx +++ b/docs/site/src/content/docs/operate/advanced/generate-identity-configuration.mdx @@ -103,6 +103,22 @@ file, and renders the result. {/* Evidence: crates/registry-thunderid-tooling/src/identity_generate.rs, generate(), and key_file_refusal(); crates/registry-casework/src/config.rs authentication.oidc.humanIdentity and representedHuman. */} +## Check a saved BReg identity-facts report + +If you saved the JSON report from a completed `bregctl --format json generate identity-facts` +run, check its structure offline with the same Registry Stack version. + +```bash +rstack dev check --owner-report ./identity-facts-report.json \ + --owner-report-format breg-identity-facts-report +``` + +The check validates the report envelope, counts and artifact metadata. The identity generator +reads the `PlatformIdentityFacts` YAML file separately and checks its contents. + +{/* Evidence: crates/registry-rstack-dev/src/owner_report.rs, check_file; + crates/registry-bregctl/src/lib.rs, generate_identity_facts. */} + ## Prerequisites - A same-version binary for each product you select. If a binary is missing, the command names diff --git a/products/evidence/OPERATOR-CONTRACT.md b/products/evidence/OPERATOR-CONTRACT.md index 38c67a745c..ed704378fc 100644 --- a/products/evidence/OPERATOR-CONTRACT.md +++ b/products/evidence/OPERATOR-CONTRACT.md @@ -68,6 +68,29 @@ constraint the authorization server issued the token under. An authorization server that binds tokens to DPoP keys or client certificates must issue Evidence clients unbound tokens. +### Provision a PostgreSQL store for qualification + +Use `evidencectl provision` to prepare a dedicated database and two PostgreSQL +logins for the status ledger or the OID4VCI store. Use +[`store-provision.yaml`](examples/formats/store-provision.yaml) as the operator +file. Set `store` to `status` or `oid4vci` and supply secret references for the +distinct migration and runtime login URLs. The URLs must name the same database +on the same server. Use the `database.caBundleRef` reference when the database +uses a private CA. + +Check the file with `evidencectl check --store-provision-config store-provision.yaml`. +Use `--environment` to fill text expressions from the current environment during +the check. The check leaves database secret references unresolved. Review the plan with +`evidencectl provision --runtime-config store-provision.yaml --print-sql`. +The plan reads the configured database secrets and connects to no PostgreSQL server. +To execute it, replace `--print-sql` with `--admin-url-file `. +You can run the same provision command again to converge the same target. + +Provision grants database `CREATE` to the migration login and `CONNECT` to both +logins. On an existing database, check that the runtime login holds only the +intended privileges. The explicit store migration and its table grants are a +separate step. Neither served runtime selects the PostgreSQL store. + ## Governed bundle and operator runtime The operator supplies one atomic bundle containing the approved YAML, diff --git a/products/evidence/examples/formats/store-provision.yaml b/products/evidence/examples/formats/store-provision.yaml new file mode 100644 index 0000000000..ec883d4f3f --- /dev/null +++ b/products/evidence/examples/formats/store-provision.yaml @@ -0,0 +1,12 @@ +# yaml-language-server: $schema=https://id.registrystack.org/schemas/evidence/store-provision/store-provision.v1alpha1.schema.json +apiVersion: id.registrystack.org/formats/evidence/store-provision/v1alpha1 +kind: EvidenceStoreProvisionConfig +store: status +database: + transport: verified-tls + migrationUrlRef: secret:file/migration-url + runtimeUrlRef: secret:file/runtime-url + caBundleRef: secret:file/postgres-ca +secretProviders: + file: + root: /run/evidence-store-secrets diff --git a/products/platform/config-formats.yaml b/products/platform/config-formats.yaml index e8b8283d9c..629c2d855d 100644 --- a/products/platform/config-formats.yaml +++ b/products/platform/config-formats.yaml @@ -276,6 +276,38 @@ formats: whenOmitted: closed restrictingMembers: [] + - id: platform/session-route-inventory + product: platform + title: Checked Registry Session browser route inventory + files: [] + syntax: json + audience: generated + stability: experimental + current: + apiVersion: id.registrystack.org/formats/platform/session-route-inventory/v1alpha1 + kind: PlatformSessionRouteInventory + checkedBy: + file: crates/registry-session/src/gateway/verify.rs + symbol: ROUTE_INVENTORY_API_VERSION + target: + apiVersion: id.registrystack.org/formats/platform/session-route-inventory/v1alpha1 + kind: PlatformSessionRouteInventory + schema: + path: products/platform/generated/session-runtime/session-route-inventory.v1alpha1.schema.json + id: https://id.registrystack.org/schemas/platform/session-route-inventory/session-route-inventory.v1alpha1.schema.json + origin: generated + generator: cargo run -p registry-session --features schema --example session-runtime-schema -- --output products/platform/generated/session-runtime + driftCheck: crates/registry-session/src/schema.rs + reader: none + emittedBy: + file: crates/registry-session/src/gateway/verify.rs + symbol: write_verified_route_inventory + check: none + example: products/platform/examples/session/checked-routes.json + conformance: none + securityMembers: [] + restrictingMembers: [] + # breg - id: breg/project product: breg @@ -870,7 +902,23 @@ formats: whenOmitted: closed - pointer: /preview/breg/post whenOmitted: closed - restrictingMembers: [/issuer, /application/client, /application/callbackPath, /products/*/audience, /people/*/roles] + - pointer: /externalScheduling + whenOmitted: closed + - pointer: /externalScheduling/taskGrant/assertionClient + whenOmitted: refused + - pointer: /externalScheduling/taskGrant/sourceIssuer + whenOmitted: refused + - pointer: /externalScheduling/taskGrant/statusUrl + whenOmitted: refused + - pointer: /externalScheduling/taskGrant/tokenEndpoint + whenOmitted: refused + - pointer: /externalScheduling/taskGrant/statusClient + whenOmitted: refused + - pointer: /externalScheduling/taskGrant/statusKeyRef + whenOmitted: refused + - pointer: /externalScheduling/taskGrant/statusResource + whenOmitted: refused + restrictingMembers: [/issuer, /application/client, /application/callbackPath, /products/*/audience, /people/*/roles, /externalScheduling/taskGrant/assertionClient, /externalScheduling/taskGrant/sourceIssuer, /externalScheduling/taskGrant/statusUrl, /externalScheduling/taskGrant/tokenEndpoint, /externalScheduling/taskGrant/statusClient, /externalScheduling/taskGrant/statusKeyRef, /externalScheduling/taskGrant/statusResource] - id: rstack/journeys product: rstack title: Registry Stack authored development journeys @@ -1404,6 +1452,7 @@ formats: files: [] syntax: json audience: generated + passiveReport: true stability: unpromised current: apiVersion: id.registrystack.org/formats/breg/ctl-report/v1alpha1 @@ -1420,11 +1469,15 @@ formats: origin: generated generator: cargo run -p registry-bregctl --features schema --example tool-schema -- --output products/breg/generated/tools driftCheck: products/breg/scripts/check-tool-schemas.sh - reader: none + reader: + crate: registry-rstack-dev + file: crates/registry-rstack-dev/src/owner_report.rs + function: check_file + type: untyped emittedBy: file: crates/registry-bregctl/src/lib.rs symbol: write_ctl_report - check: none + check: rstack dev check --owner-report {file} --owner-report-format breg-identity-facts-report example: products/breg/examples/formats/identity-facts-report.json conformance: none securityMembers: [] @@ -2679,6 +2732,48 @@ formats: - pointer: /package/expectedDigest whenOmitted: open restrictingMembers: [] + - id: evidence/store-provision + product: evidence + title: Evidence store provisioning config + files: [store-provision.yaml] + syntax: yaml + audience: operator + stability: unpromised + current: + apiVersion: id.registrystack.org/formats/evidence/store-provision/v1alpha1 + kind: EvidenceStoreProvisionConfig + checkedBy: + file: crates/registry-evidencectl/src/store_provision.rs + symbol: API_VERSION + target: + apiVersion: id.registrystack.org/formats/evidence/store-provision/v1alpha1 + kind: EvidenceStoreProvisionConfig + schema: + path: crates/registry-evidencectl/schemas/authoring/store-provision.schema.json + id: https://id.registrystack.org/schemas/evidence/store-provision/store-provision.v1alpha1.schema.json + origin: generated + generator: cargo run -p registry-evidencectl --features schema --example authoring-schema -- --output crates/registry-evidencectl/schemas/authoring + driftCheck: products/evidence/scripts/check-authoring-schema.sh + reader: + crate: registry-evidencectl + file: crates/registry-evidencectl/src/store_provision.rs + function: load + type: StoreProvisionDocument + check: evidencectl check --store-provision-config {file} + example: products/evidence/examples/formats/store-provision.yaml + conformance: + requiredText: /store + optionalText: /database/transport + integer: none + boolean: none + securityMembers: + - pointer: /database/migrationUrlRef + whenOmitted: refused + - pointer: /database/runtimeUrlRef + whenOmitted: refused + - pointer: /database/caBundleRef + whenOmitted: open + restrictingMembers: [/store] - id: evidence/codelist product: evidence title: Evidence code list diff --git a/products/platform/examples/session/checked-routes.json b/products/platform/examples/session/checked-routes.json new file mode 100644 index 0000000000..3b2033bfae --- /dev/null +++ b/products/platform/examples/session/checked-routes.json @@ -0,0 +1,23 @@ +{ + "apiVersion": "id.registrystack.org/formats/platform/session-route-inventory/v1alpha1", + "gatewayDigest": "sha256:56635e6d5a33bb8026b95d06912c4be2a9e725ce66b389126830c3c31d69bcae", + "kind": "PlatformSessionRouteInventory", + "modules": [ + { + "id": "businesses", + "prefix": "/registry/businesses/", + "prefixRewrite": "/", + "product": "breg", + "signIns": [ + "registrar" + ] + } + ], + "pages": [ + { + "prefix": "/apply/", + "signIn": "registrar" + } + ], + "publicOrigin": "https://127.0.0.1:8443" +} diff --git a/products/platform/generated/session-runtime/session-route-inventory.v1alpha1.schema.json b/products/platform/generated/session-runtime/session-route-inventory.v1alpha1.schema.json new file mode 100644 index 0000000000..2fecc18432 --- /dev/null +++ b/products/platform/generated/session-runtime/session-route-inventory.v1alpha1.schema.json @@ -0,0 +1,118 @@ +{ + "$defs": { + "Digest": { + "description": "A SHA-256 digest: `sha256:` followed by 64 lowercase hex digits.", + "pattern": "^sha256:[0-9a-f]{64}$", + "type": "string" + }, + "LocalId": { + "description": "A local identifier: a lowercase letter, then up to 63 lowercase letters, digits, `_`, or `-`.", + "pattern": "^[a-z][a-z0-9_-]{0,63}$", + "type": "string" + }, + "Url": { + "description": "An absolute http or https URL with a host preserved as written, no user information, and no backslash, whitespace or control character. DNS case and equivalent IPv6 literals are permitted.", + "format": "uri", + "maxLength": 2048, + "pattern": "^[Hh][Tt][Tt][Pp][Ss]?://[^/?#@\\u005C\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]+([/?#][^\\u005C\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]*)?$", + "type": "string" + } + }, + "$id": "https://id.registrystack.org/schemas/platform/session-route-inventory/session-route-inventory.v1alpha1.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "One Base Registry Engine browser route and its page bindings from an exact, verified Envoy JSON file.", + "properties": { + "apiVersion": { + "const": "id.registrystack.org/formats/platform/session-route-inventory/v1alpha1", + "type": "string" + }, + "gatewayDigest": { + "$ref": "#/$defs/Digest" + }, + "kind": { + "const": "PlatformSessionRouteInventory", + "type": "string" + }, + "modules": { + "items": { + "additionalProperties": false, + "properties": { + "id": { + "$ref": "#/$defs/LocalId" + }, + "prefix": { + "maxLength": 256, + "pattern": "^/(?:(?!\\.\\.?/)[A-Za-z0-9._:-]+/)+$", + "type": "string" + }, + "prefixRewrite": { + "const": "/", + "type": "string" + }, + "product": { + "const": "breg", + "type": "string" + }, + "signIns": { + "items": { + "$ref": "#/$defs/LocalId" + }, + "maxItems": 64, + "minItems": 1, + "type": "array", + "uniqueItems": true + } + }, + "required": [ + "id", + "product", + "prefix", + "prefixRewrite", + "signIns" + ], + "type": "object" + }, + "maxItems": 1, + "minItems": 1, + "type": "array" + }, + "pages": { + "items": { + "additionalProperties": false, + "properties": { + "prefix": { + "maxLength": 256, + "pattern": "^/(?:(?!\\.\\.?(?:/|$))[A-Za-z0-9._:~-]+(?:/|$))+$", + "type": "string" + }, + "signIn": { + "$ref": "#/$defs/LocalId" + } + }, + "required": [ + "prefix", + "signIn" + ], + "type": "object" + }, + "maxItems": 64, + "type": "array", + "uniqueItems": true + }, + "publicOrigin": { + "$ref": "#/$defs/Url", + "pattern": "^https://127(?:\\.[0-9]{1,3}){3}(?::[0-9]{1,5})?$" + } + }, + "required": [ + "apiVersion", + "kind", + "publicOrigin", + "gatewayDigest", + "modules", + "pages" + ], + "title": "Checked Registry Session route inventory", + "type": "object" +} diff --git a/products/platform/journeys/README.md b/products/platform/journeys/README.md index e576405035..de96d0d80f 100644 --- a/products/platform/journeys/README.md +++ b/products/platform/journeys/README.md @@ -180,6 +180,12 @@ without the optional scope and checks the refusal against the response's trace ID. The foreign caller also gets a fresh token for its exact-record assertion. +The managed BReg launcher creates a separate rehearsal package root before `bregctl test`. +The own-provider runner uses the separate rehearsal package and database for both issuers. +Strict Keycloak run `20261201182016-4bf3` passed all ten steps with same-source binaries. +It verified the no-mapper claim refusal, signed delivery, exact editor read and foreign read +refusal. The paired strict promotion run `20261201182055-d29b` verified clean teardown. + The BReg setup records `fixtureOnlyProducts: ["breg"]` in `own-provider.json`. Promotion reports `journey.promote.no-input` for this fixture. A passing BReg input directory that predates the marker is refused as diff --git a/products/platform/journeys/expected-failures.yaml b/products/platform/journeys/expected-failures.yaml index a742620b08..753099fc0b 100644 --- a/products/platform/journeys/expected-failures.yaml +++ b/products/platform/journeys/expected-failures.yaml @@ -224,7 +224,7 @@ passes: - journey: own-provider product: breg basis: observed - observedOn: "v0.49.0 binaries, own-provider run 20261201170814-cac9" + observedOn: "same-source binaries, strict Keycloak own-provider run 20261201182016-4bf3" - journey: own-provider product: adapter basis: observed diff --git a/products/platform/journeys/lib.sh b/products/platform/journeys/lib.sh index 0cdf66ad8a..a96c13d074 100644 --- a/products/platform/journeys/lib.sh +++ b/products/platform/journeys/lib.sh @@ -1772,6 +1772,49 @@ journey_request_contract() { done } +# The managed sink authenticates the delivery. Correlate its captured envelope +# and signing headers to the operation, without accepting forwarded credentials. +signed_hook_matches() { + local expected=$1 + shift + jq -e --argjson expected "$expected" 'any(.[]; + . as $capture | (.body | fromjson?) as $event | + $event.type == $expected.type and $event.data == $expected.data and + ($expected.source == null or $event.source == $expected.source) and + ($event.id | type == "string" and length > 0) and + any($capture.headers[]; .name == "webhook-id" and .value == $event.id) and + any($capture.headers[]; .name == "webhook-timestamp" and (.value | test("^[0-9]+$"))) and + any($capture.headers[]; .name == "webhook-signature" and (.value | startswith("v1,"))) and + all($capture.headers[]; .name != "authorization" and .name != "cookie" and + .name != "registry-source-authorization" and .name != "proxy-authorization"))' "$@" >/dev/null +} + +signed_hook_received() { + curl --silent --fail --max-time 3 "$1" | signed_hook_matches "$2" +} + +# Confirm one Scheduling appointment with the caller's already admitted task +# grant. The caller supplies the hold request and chooses how to observe the +# resulting delivery. The grant reaches HTTP by variable name. +journey_scheduling_appointment() { + local origin=$1 work=$2 request=$3 bearer=$4 appointment_var=$5 + local _js_hold='' confirm=$work/appt-request.json + journey_http hook --expect-status 201 --bearer "$bearer" \ + --header 'Content-Type: application/json' \ + --header 'Idempotency-Key: journey-comp-hold-create' \ + --data-file "$request" --capture .holdId _js_hold \ + POST "$origin/v1/holds" || + journey_harness_failure "Scheduling hold creation failed (HTTP $JOURNEY_HTTP_STATUS, $JOURNEY_HTTP_PROBLEM_CODE)" + jq -cn --arg hold "$_js_hold" '{hold:$hold,admission:null}' >"$confirm" || + journey_harness_failure "cannot assemble the Scheduling confirmation request" + journey_http hook --expect-status 201 --bearer "$bearer" \ + --header 'Content-Type: application/json' \ + --header 'Idempotency-Key: journey-comp-appt-confirm' \ + --data-file "$confirm" --capture .appointmentId "$appointment_var" \ + POST "$origin/v1/appointments" || + journey_harness_failure "Scheduling appointment confirmation failed (HTTP $JOURNEY_HTTP_STATUS, $JOURNEY_HTTP_PROBLEM_CODE)" +} + # journey_http STEP [--bearer VAR] [--header 'Name: value']... [--form K=V]... # [--form-secret K=SECRET]... [--data-file FILE] [--cookie-jar NAME] # [--location] [--expect-status NNN] [--capture FILTER VAR]... [--capture-secret FILTER VAR]... diff --git a/products/platform/journeys/own-provider.sh b/products/platform/journeys/own-provider.sh index e2c06721cc..4c57637193 100755 --- a/products/platform/journeys/own-provider.sh +++ b/products/platform/journeys/own-provider.sh @@ -114,7 +114,8 @@ select_journey_init_args() { INIT_JOURNEY_NAME=own-provider INIT_DEFAULT_EXPECTED=$JOURNEY_LIB_DIR/expected-failures.yaml select_journey_init_args "$@" -journey_init "$INIT_JOURNEY_NAME" --default-expected "$INIT_DEFAULT_EXPECTED" --value-option issuer -- "$@" +journey_init "$INIT_JOURNEY_NAME" --default-expected "$INIT_DEFAULT_EXPECTED" \ + --value-option issuer --value-option scheduling-runtime -- "$@" REALM=registry-journey POSTGRES_IMAGE=postgres:18.7@sha256:2ea8630df176ad090ec92136dee850397c5af8781e4bcf2e4162593691c61bbc @@ -141,6 +142,17 @@ keycloak | thunderid) ;; ;; esac +journey_option_value scheduling-runtime SCHEDULING_RUNTIME +SCHEDULING_RUNTIME=${SCHEDULING_RUNTIME:-standalone} +case "$SCHEDULING_RUNTIME" in +standalone) ;; +managed) + [[ "$ISSUER_KIND" == thunderid && $JOURNEY_KEEP -eq 0 && "${JOURNEY_PRODUCTS[*]}" == scheduling ]] || + journey_usage_error "--scheduling-runtime managed requires --issuer thunderid --product scheduling and no --keep" + ;; +*) journey_usage_error "--scheduling-runtime $SCHEDULING_RUNTIME: choose standalone or managed" ;; +esac + KEYCLOAK_IMAGE='' THUNDERID_IMAGE='' JOURNEY_ISSUER_BIN='' @@ -406,6 +418,60 @@ stop_thunderid_sessions() { } journey_at_cleanup stop_thunderid_sessions +COMPOSED_MANAGED_RUN='' +COMPOSED_MANAGED_ROOT=$SECRETS/scheduling-managed + +composed_managed_dev() { + RSTACK_DEV_STATE_DIR="$COMPOSED_MANAGED_ROOT/state" \ + RSTACK_SCHEDULING_BIN="$SERVER_BIN" RSTACK_SCHEDULINGCTL_BIN="$TOOL_BIN" \ + "$COMPOSED_RSTACK_BIN" --install-root "$COMPOSED_MANAGED_ROOT/install" --format json dev "$@" +} + +stop_composed_managed_scheduling() { + [[ -n "$COMPOSED_MANAGED_RUN" ]] || return 0 + composed_managed_dev stop "$COMPOSED_MANAGED_RUN" >/dev/null || return 1 + COMPOSED_MANAGED_RUN='' +} + +cleanup_composed_managed_scheduling() { + stop_composed_managed_scheduling || return 1 + [[ ! -d "$COMPOSED_MANAGED_ROOT" ]] || + python3 -c 'import shutil, sys; shutil.rmtree(sys.argv[1])' "$COMPOSED_MANAGED_ROOT" +} +journey_at_cleanup cleanup_composed_managed_scheduling + +composed_managed_start() ( + unset RSTACK_DEV_DATABASE_CA + composed_managed_dev start "$@" +) + +start_composed_managed_scheduling() { + local _cms_project=$1 _cms_report=$2 _cms_url='' + IFS= read -r _cms_url <"$ADMIN_URL_FILE" || [[ -n "$_cms_url" ]] || + journey_harness_failure "cannot read the disposable PostgreSQL admin URL" + RSTACK_DEV_DATABASE_URL="$_cms_url?sslmode=disable" \ + journey_step hook --timeout 120 --typed "rstack dev start $_cms_project" -- \ + composed_managed_start "$_cms_project" || + journey_harness_failure "managed Scheduling did not start; see $JOURNEY_STEP_STDERR" + COMPOSED_MANAGED_RUN=$(jq -er '.run_id | strings | select(test("^[0-9a-f]{32}$"))' "$JOURNEY_STEP_STDOUT") || + journey_harness_failure "managed Scheduling start report has no run ID" + copy_file "$JOURNEY_STEP_STDOUT" "$_cms_report" +} + +composed_scheduling_url() { + jq -er '.products.scheduling | select(test("^http://127[.]0[.]0[.]1:[0-9]+$"))' "$1" +} + +assert_composed_scheduling_authority_refused() { + local origin=$1 request=$2 key=$3 + journey_http hook --expect-status 401 --bearer exchanged_token \ + --header 'Content-Type: application/json' --header "Idempotency-Key: $key" \ + --data-file "$request" POST "$origin/v1/holds" || + journey_harness_failure "managed Scheduling did not refuse the exchanged bearer with HTTP 401" + jq -e '.code == "authentication.refused" and .failedCheck == "token-assertion-issuer"' "$JOURNEY_STEP_STDOUT" >/dev/null || + journey_harness_failure "managed Scheduling did not refuse at token-assertion-issuer" +} + # read_secret NAME VAR: the value of a generated secret into VAR. read_secret() { local _kc_path @@ -2339,6 +2405,7 @@ composed_scheduling_hook() { local breg_final=$comp/breg-final breg_final_rt=$comp/breg-final-runtime.yaml breg_final_build=$comp/breg-final-build local sched_proj=$comp/sched-project sched_pkg=$comp/sched-package sched_rt=$comp/sched-runtime.yaml local task_conn=$comp/task-connection.json receipt=$comp/scheduling-hook.json + local managed_report=$comp/managed-scheduling.json bound_plan=$comp/managed-dev-plan.json local day start_time local breg_url cw_url sched_url comp_hook_out='' comp_cw_out='' # shellcheck disable=SC2034 # journey_process_log sets comp_cw_err while refreshing comp_cw_out @@ -2547,21 +2614,37 @@ JSON # 5) Build, package, provision & apply composed Scheduling with appointment-observer hook. day=$(python3 -c 'from datetime import datetime, timedelta, timezone; print((datetime.now(timezone.utc) + timedelta(days=2)).strftime("%Y-%m-%d"))') start_time="${day}T10:00:00Z" + if [[ "$SCHEDULING_RUNTIME" == managed ]]; then + mkdir -m 700 -- "$COMPOSED_MANAGED_ROOT" "$COMPOSED_MANAGED_ROOT/state" "$COMPOSED_MANAGED_ROOT/install" + sched_proj=$COMPOSED_MANAGED_ROOT/project + journey_step hook -- "$TOOL_BIN" init --template standalone-exact-time "$COMPOSED_MANAGED_ROOT/starter" || + journey_harness_failure "cannot initialize the managed Scheduling fixture" + mkdir -m 700 -- "$sched_proj" + copy_file "$COMPOSED_MANAGED_ROOT/starter/runtime.example.yaml" "$sched_proj/runtime.example.yaml" + fi python3 "$PROJECTS_DIR/composed_fixtures.py" scheduling-project "$sched_proj" --day "$day" || journey_harness_failure "cannot write composed Scheduling project" - journey_step hook -- "$TOOL_BIN" package --output "$sched_pkg" "$sched_proj" || - journey_harness_failure "composed Scheduling package failed; see $JOURNEY_STEP_STDERR" - python3 "$PROJECTS_DIR/composed_fixtures.py" scheduling-runtime "$sched_rt" \ - --port "$sched_port" --metrics-port "$sched_metrics_port" --secrets "$SECRETS" \ - --package "$sched_pkg" --audit "$comp/sched-audit.ndjson" \ - --issuer "$comp_tid_issuer" --casework-port "$cw_port" --hook-port "$hook_port" || - journey_harness_failure "cannot write composed Scheduling runtime" - journey_step hook -- "$TOOL_BIN" provision --runtime-config "$sched_rt" --admin-url-file "$ADMIN_URL_FILE" --posture development || - journey_harness_failure "composed Scheduling provision failed; see $JOURNEY_STEP_STDERR" - journey_step hook -- "$TOOL_BIN" apply --runtime-config "$sched_rt" --posture development --format json || - journey_harness_failure "composed Scheduling apply failed; see $JOURNEY_STEP_STDERR" - journey_step hook -- "$TOOL_BIN" records apply --runtime-config "$sched_rt" "$sched_proj/records.yaml" --posture development --format json || - journey_harness_failure "composed Scheduling records apply failed; see $JOURNEY_STEP_STDERR" + if [[ "$SCHEDULING_RUNTIME" == managed ]]; then + python3 "$PROJECTS_DIR/composed_fixtures.py" scheduling-managed-plan "$sched_proj" \ + --issuer "$comp_tid_issuer" --jwks "$comp_tid_issuer/oauth2/jwks" \ + --casework-port "$cw_port" --agent-subject "$agent_sub" --status-key "$SECRETS/comp-sched-status-key" || + journey_harness_failure "cannot write the managed Scheduling plan" + copy_file "$sched_proj/dev.yaml" "$bound_plan" + else + journey_step hook -- "$TOOL_BIN" package --output "$sched_pkg" "$sched_proj" || + journey_harness_failure "composed Scheduling package failed; see $JOURNEY_STEP_STDERR" + python3 "$PROJECTS_DIR/composed_fixtures.py" scheduling-runtime "$sched_rt" \ + --port "$sched_port" --metrics-port "$sched_metrics_port" --secrets "$SECRETS" \ + --package "$sched_pkg" --audit "$comp/sched-audit.ndjson" \ + --issuer "$comp_tid_issuer" --casework-port "$cw_port" --hook-port "$hook_port" || + journey_harness_failure "cannot write composed Scheduling runtime" + journey_step hook -- "$TOOL_BIN" provision --runtime-config "$sched_rt" --admin-url-file "$ADMIN_URL_FILE" --posture development || + journey_harness_failure "composed Scheduling provision failed; see $JOURNEY_STEP_STDERR" + journey_step hook -- "$TOOL_BIN" apply --runtime-config "$sched_rt" --posture development --format json || + journey_harness_failure "composed Scheduling apply failed; see $JOURNEY_STEP_STDERR" + journey_step hook -- "$TOOL_BIN" records apply --runtime-config "$sched_rt" "$sched_proj/records.yaml" --posture development --format json || + journey_harness_failure "composed Scheduling records apply failed; see $JOURNEY_STEP_STDERR" + fi python3 "$PROJECTS_DIR/composed_fixtures.py" task-connection "$task_conn" \ --casework-port "$cw_port" --issuer "$comp_tid_issuer" --secrets "$SECRETS" || @@ -2572,13 +2655,15 @@ JSON cw_url=http://127.0.0.1:$cw_port sched_url=http://127.0.0.1:$sched_port - journey_start hook comp-hook-receiver -- python3 "$PROJECTS_DIR/hook-receiver.py" \ - "$hook_port" /scheduling-events appointment-observer "$SECRETS/comp-sched-hook-hmac" "$receipt" || - journey_harness_failure "composed Scheduling hook receiver failed to start" - comp_hook_out=$JOURNEY_STEP_STDOUT - journey_ready hook comp-hook-receiver --timeout 30 -- \ - curl --silent --show-error --fail --output /dev/null "http://127.0.0.1:$hook_port/ready" || - journey_harness_failure "composed Scheduling hook receiver did not answer /ready" + if [[ "$SCHEDULING_RUNTIME" == standalone ]]; then + journey_start hook comp-hook-receiver -- python3 "$PROJECTS_DIR/hook-receiver.py" \ + "$hook_port" /scheduling-events appointment-observer "$SECRETS/comp-sched-hook-hmac" "$receipt" || + journey_harness_failure "composed Scheduling hook receiver failed to start" + comp_hook_out=$JOURNEY_STEP_STDOUT + journey_ready hook comp-hook-receiver --timeout 30 -- \ + curl --silent --show-error --fail --output /dev/null "http://127.0.0.1:$hook_port/ready" || + journey_harness_failure "composed Scheduling hook receiver did not answer /ready" + fi journey_start hook comp-breg --settle 2 -- "$breg_bin" --posture development --runtime-config "$breg_final_rt" || journey_harness_failure "composed BReg failed to start" @@ -2597,11 +2682,13 @@ JSON jq -e '[.keys[]? | select(.kid == "journey-task-authority")] | length == 1' >/dev/null || journey_harness_failure "composed Casework did not publish journey-task-authority on /.well-known/jwks.json" - journey_start hook comp-scheduling --settle 2 -- "$SERVER_BIN" --posture development --runtime-config "$sched_rt" serve || - journey_harness_failure "composed Scheduling failed to start" - journey_ready hook comp-scheduling --timeout 90 -- \ - curl --silent --show-error --fail --output /dev/null "$sched_url/ready" || - journey_harness_failure "composed Scheduling did not become ready" + if [[ "$SCHEDULING_RUNTIME" == standalone ]]; then + journey_start hook comp-scheduling --settle 2 -- "$SERVER_BIN" --posture development --runtime-config "$sched_rt" serve || + journey_harness_failure "composed Scheduling failed to start" + journey_ready hook comp-scheduling --timeout 90 -- \ + curl --silent --show-error --fail --output /dev/null "$sched_url/ready" || + journey_harness_failure "composed Scheduling did not become ready" + fi # 7) Bootstrap Casework directory. # shellcheck disable=SC2034 # read by name through journey_http --bearer @@ -2767,6 +2854,15 @@ JSON journey_harness_failure "exchanged Scheduling task grant token lacks scalar Scheduling audience" # 13) Negative check: ordinary task-agent token without a task grant is refused by Scheduling POST /v1/holds. + if [[ "$SCHEDULING_RUNTIME" == managed ]]; then + # The same real exchanged bearer must be refused without an explicit + # assertion-authority binding. Use a separate stopped/restarted run. + jq 'del(.externalScheduling)' "$bound_plan" >"$sched_proj/dev.yaml" || + journey_harness_failure "cannot assemble the unbound managed Scheduling control" + start_composed_managed_scheduling "$sched_proj" "$comp/unbound-scheduling.json" + sched_url=$(composed_scheduling_url "$comp/unbound-scheduling.json") || + journey_harness_failure "the unbound Scheduling run has no loopback address" + fi thunderid_fetch_token "$comp_tid_root" "$comp_reg" task-agent ordinary_agent_token "urn:example:journey:scheduling" token_has_scalar_audience ordinary_agent_token "urn:example:journey:scheduling" || journey_harness_failure "composed ordinary task-agent token lacks string scalar Scheduling audience" @@ -2777,49 +2873,102 @@ JSON jq -cn --arg start "$start_time" --arg app "$app_id" --arg duplicate_key "cross-product-$app_id" --argjson rev "$sched_rev" \ '{offering:"application-review",start:$start,party:{recipients:1,attendees:1},channel:"assisted",duplicateKey:$duplicate_key,policyRevision:$rev,windowRevision:null,capabilities:[],prerequisites:[],externalReferences:[{product:"breg",recordType:"application",identifier:$app}]}' \ >"$comp/hold-request.json" + if [[ "$SCHEDULING_RUNTIME" == managed ]]; then + assert_composed_scheduling_authority_refused "$sched_url" "$comp/hold-request.json" journey-comp-unbound-authority + stop_composed_managed_scheduling || journey_harness_failure "cannot stop the unbound managed Scheduling control" + + # The genuine exchanged token also fails when the same named client is + # bound to a different authority. Only this disposable plan is varied. + jq '.externalScheduling.taskGrant.sourceIssuer = "https://unrelated.casework.journey.example"' \ + "$bound_plan" >"$sched_proj/dev.yaml" || + journey_harness_failure "cannot assemble the wrong-authority managed Scheduling control" + start_composed_managed_scheduling "$sched_proj" "$comp/wrong-authority-scheduling.json" + sched_url=$(composed_scheduling_url "$comp/wrong-authority-scheduling.json") || + journey_harness_failure "the wrong-authority Scheduling run has no loopback address" + assert_composed_scheduling_authority_refused "$sched_url" "$comp/hold-request.json" journey-comp-wrong-authority + stop_composed_managed_scheduling || journey_harness_failure "cannot stop the wrong-authority managed Scheduling control" + + copy_file "$bound_plan" "$sched_proj/dev.yaml" + start_composed_managed_scheduling "$sched_proj" "$managed_report" + sched_url=$(composed_scheduling_url "$managed_report") || + journey_harness_failure "the managed Scheduling run has no loopback address" + local managed_config + managed_config=$(jq -er '.runtimeConfigs.scheduling' "$managed_report") || + journey_harness_failure "the managed Scheduling run did not report its runtime configuration" + jq -e --slurpfile plan "$bound_plan" ' + $plan[0].externalScheduling.taskGrant as $binding | + .authentication.oidc.issuers.main as $issuer | + $issuer.issuer == $plan[0].issuer and $issuer.audience == $plan[0].products[0].audience and + $issuer.allowedClients == [$binding.assertionClient] and + $issuer.assertionIssuers == {($binding.assertionClient): [$binding.sourceIssuer]} and + (.taskGrantStatus | type == "array" and length == 1) and + (.taskGrantStatus[0] | .sourceIssuer == $binding.sourceIssuer and .baseUrl == $binding.statusUrl and + .tokenEndpoint == $binding.tokenEndpoint and .clientAssertionAudience == $issuer.issuer and + .clientId == $binding.statusClient and .statusResource == $binding.statusResource and + (.privateKeyRef | startswith("secret:file/")))' "$managed_config" >"$comp/managed-status-binding.json" || + journey_harness_failure "managed Scheduling did not project the exact live Casework status binding" + journey_http hook --bearer ordinary_agent_token GET "$sched_url/v1/scheduling" || + journey_harness_failure "the managed Scheduling policy metadata request failed" + jq -e --argjson revision "$sched_rev" '.policyRevision == $revision' "$JOURNEY_STEP_STDOUT" >/dev/null || + journey_harness_failure "the managed Scheduling run did not load the same booking policy revision" + fi journey_http hook --expect-status 403 --bearer ordinary_agent_token \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: journey-comp-hold-no-grant' \ --data-file "$comp/hold-request.json" \ POST "$sched_url/v1/holds" || journey_harness_failure "composed Scheduling did not refuse grantless hold with HTTP 403 (got HTTP $JOURNEY_HTTP_STATUS)" + [[ "$JOURNEY_HTTP_PROBLEM_CODE" == operation.not-authorized ]] || + journey_harness_failure "composed Scheduling returned an unexpected grantless hold problem code" + if [[ "$SCHEDULING_RUNTIME" == managed ]]; then + jq -e '.failedCheck == "task-grant-missing"' "$JOURNEY_STEP_STDOUT" >/dev/null || + journey_harness_failure "managed Scheduling grantless hold did not refuse at task-grant-missing" + fi # 14) Positive check: create hold and confirm appointment with the exchanged grant, # then verify signed Standard Webhooks appointment-observer delivery. - local hold_id='' appt_id='' - journey_http hook --expect-status 201 --bearer exchanged_token \ - --header 'Content-Type: application/json' \ - --header 'Idempotency-Key: journey-comp-hold-create' \ - --data-file "$comp/hold-request.json" \ - --capture .holdId hold_id \ - POST "$sched_url/v1/holds" || - journey_harness_failure "composed Scheduling hold creation failed (HTTP $JOURNEY_HTTP_STATUS, $JOURNEY_HTTP_PROBLEM_CODE)" - jq -cn --arg hold "$hold_id" '{hold:$hold,admission:null}' >"$comp/appt-request.json" - journey_http hook --expect-status 201 --bearer exchanged_token \ - --header 'Content-Type: application/json' \ - --header 'Idempotency-Key: journey-comp-appt-confirm' \ - --data-file "$comp/appt-request.json" \ - --capture .appointmentId appt_id \ - POST "$sched_url/v1/appointments" || - journey_harness_failure "composed Scheduling appointment confirmation failed (HTTP $JOURNEY_HTTP_STATUS, $JOURNEY_HTTP_PROBLEM_CODE)" + local appt_id='' + journey_scheduling_appointment "$sched_url" "$comp" "$comp/hold-request.json" exchanged_token appt_id [[ -n "$appt_id" ]] || journey_harness_failure "composed Scheduling appointment response carried no appointmentId" - journey_ready hook comp-hook-receiver --timeout 45 -- test -s "$receipt" || - journey_harness_failure "composed Scheduling hook receiver did not accept the signed appointment-observer hook" - # shellcheck disable=SC2016 # jq binds its own variables - journey_step hook -- jq -e --arg appt "$appt_id" \ - '.type == "appointment-observer" and .data.appointmentId == $appt and .data.state == "confirmed"' \ - "$receipt" || - journey_harness_failure "composed Scheduling signed hook did not carry appointment-observer for appointment $appt_id" + if [[ "$SCHEDULING_RUNTIME" == managed ]]; then + local sink expected + sink=$(jq -er '.hookSinks.scheduling.receivedUrl | select(test("^http://127[.]0[.]0[.]1:[0-9]+/received$"))' "$managed_report") || + journey_harness_failure "managed Scheduling did not report a loopback hook sink" + expected=$(jq -cn --arg id "$appt_id" '{type:"appointment-observer", source:"urn:registrystack:scheduling:journey-composed-scheduling",data:{appointmentId:$id,state:"confirmed"}}') + journey_poll 45 -- signed_hook_received "$sink" "$expected" || + journey_harness_failure "the managed Scheduling hook sink did not receive the signed appointment" + journey_http hook GET "$sink" || journey_harness_failure "the managed Scheduling hook sink did not answer" + signed_hook_matches "$expected" "$JOURNEY_STEP_STDOUT" || + journey_harness_failure "the managed Scheduling hook receipt does not match the confirmed appointment" + # A subsequent write with the same issued bearer needs a fresh status + # result. Stop our disposable Casework after proving the appointment. + journey_stop hook comp-casework || journey_harness_failure "composed Casework ignored SIGTERM" + journey_http hook --expect-status 503 --bearer exchanged_token \ + --header 'Content-Type: application/json' --header 'Idempotency-Key: journey-comp-status-unavailable' \ + --data-file "$comp/hold-request.json" POST "$sched_url/v1/holds" || + journey_harness_failure "managed Scheduling returned HTTP $JOURNEY_HTTP_STATUS when live status was unavailable" + [[ "$JOURNEY_HTTP_PROBLEM_CODE" == service.unavailable ]] || + journey_harness_failure "managed Scheduling did not report service.unavailable for the stopped status authority" + stop_composed_managed_scheduling || journey_harness_failure "managed Scheduling did not stop" + else + journey_ready hook comp-hook-receiver --timeout 45 -- test -s "$receipt" || + journey_harness_failure "composed Scheduling hook receiver did not accept the signed appointment-observer hook" + # shellcheck disable=SC2016 # jq binds its own variables + journey_step hook -- jq -e --arg appt "$appt_id" \ + '.type == "appointment-observer" and .data.appointmentId == $appt and .data.state == "confirmed"' \ + "$receipt" || + journey_harness_failure "composed Scheduling signed hook did not carry appointment-observer for appointment $appt_id" + journey_stop hook comp-scheduling || journey_harness_failure "composed Scheduling ignored SIGTERM" + journey_stop hook comp-hook-receiver || journey_harness_failure "composed Scheduling hook receiver ignored SIGTERM" + journey_step hook -- assert_signed_hook_acceptance "$comp_hook_out" /scheduling-events appointment-observer || + journey_harness_failure "composed Scheduling signed hook acceptance record did not confirm HMAC receiver authority without inbound credential headers" + journey_stop hook comp-casework || journey_harness_failure "composed Casework ignored SIGTERM" + fi # 15) Stop composed processes and composed ThunderID session cleanly, then # restore the outer standalone session variables. - journey_stop hook comp-scheduling || journey_harness_failure "composed Scheduling ignored SIGTERM" - journey_stop hook comp-casework || journey_harness_failure "composed Casework ignored SIGTERM" journey_stop hook comp-breg || journey_harness_failure "composed BReg ignored SIGTERM" - journey_stop hook comp-hook-receiver || journey_harness_failure "composed Scheduling hook receiver ignored SIGTERM" - journey_step hook -- assert_signed_hook_acceptance "$comp_hook_out" /scheduling-events appointment-observer || - journey_harness_failure "composed Scheduling signed hook acceptance record did not confirm HMAC receiver authority without inbound credential headers" stop_thunderid_session "$comp_tid_root" || journey_harness_failure "cannot stop composed ThunderID session" TID_ROOT=$saved_tid_root @@ -2982,7 +3131,9 @@ if [[ ${#PRIMARY[@]} -gt 0 ]]; then fi done fi + [[ "$SCHEDULING_RUNTIME" != managed ]] || BIN_OPTS+=(--package registry-rstack) journey_resolve_binaries ${BIN_OPTS[@]+"${BIN_OPTS[@]}"} "${PRIMARY[@]}" + [[ "$SCHEDULING_RUNTIME" != managed ]] || journey_bin rstack COMPOSED_RSTACK_BIN if [[ "$ISSUER_KIND" == thunderid && $NEEDS_ISSUER -eq 1 ]]; then journey_resolve_example registry-thunderid-tooling session journey-issuer JOURNEY_ISSUER_BIN fi diff --git a/products/platform/journeys/projects/composed_fixtures.py b/products/platform/journeys/projects/composed_fixtures.py index 01889f2300..5e1ab947c2 100644 --- a/products/platform/journeys/projects/composed_fixtures.py +++ b/products/platform/journeys/projects/composed_fixtures.py @@ -7,7 +7,10 @@ import hashlib import json import os +import shutil +import stat from pathlib import Path +from urllib.parse import urlsplit SOURCE = "journey-source" AUTHORITY = "https://casework.journey.example" @@ -740,6 +743,69 @@ def cmd_scheduling_project(args: argparse.Namespace) -> None: ) +def cmd_scheduling_managed_plan(args: argparse.Namespace) -> None: + root = Path(args.directory) + issuer = urlsplit(args.issuer) + jwks = urlsplit(args.jwks) + if (issuer.scheme != "http" or issuer.hostname != "127.0.0.1" or not issuer.port + or issuer.path or issuer.query or issuer.fragment or issuer.username + or (jwks.scheme, jwks.netloc) != (issuer.scheme, issuer.netloc) + or not jwks.path or jwks.query or jwks.fragment): + raise SystemExit("managed Scheduling requires the exact numeric loopback issuer and its same-origin JWKS") + + example = root / "runtime.example.yaml" + example_source = example.read_text(encoding="utf-8") + empty_destinations = "\ndestinations: {}\n" + if example_source.count(empty_destinations) != 1: + raise SystemExit("managed Scheduling needs the starter's empty runtime destinations") + + fixture = root / "fixture" + key_name = "scheduling-status.jwk" + with os.fdopen(os.open(args.status_key, os.O_RDONLY | os.O_NOFOLLOW), "rb") as source: + metadata = os.fstat(source.fileno()) + if not stat.S_ISREG(metadata.st_mode) or metadata.st_uid != os.getuid() or metadata.st_mode & 0o077: + raise SystemExit("managed Scheduling needs an owner-only fixture status key") + fixture.mkdir(mode=0o700) + fd = os.open(fixture / key_name, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600) + with os.fdopen(fd, "wb") as destination: + shutil.copyfileobj(source, destination) + + example.write_text(example_source.replace(empty_destinations, """ +destinations: + hooks: + appointment-events: + url: http://127.0.0.1:1/events + hmacSha256KeyRef: secret:file/unused-example-hook-key + attemptTimeoutMilliseconds: 2000 + maximumAttempts: 5 +"""), encoding="utf-8") + write_json(root / "dev-journeys.yaml", { + "apiVersion": "id.registrystack.org/formats/rstack/journeys/v1alpha1", + "kind": "RStackJourneys", "journeys": [], + }) + write_json(root / "dev.yaml", { + "apiVersion": "id.registrystack.org/formats/rstack/dev/v1alpha1", + "kind": "RStackDev", + "issuer": args.issuer, + "externalJwksUri": args.jwks, + "products": [{"product": "scheduling", "project": ".", "audience": SCHEDULING_RESOURCE}], + "people": {"task-agent": { + "subject": args.agent_subject, "client": "task-agent", + "grants": {"scheduling": {"profile": "reader", "scopes": ["scheduling:read"]}}, + }}, + "journeyFile": "dev-journeys.yaml", + "externalScheduling": {"taskGrant": { + "sourceIssuer": AUTHORITY, + "assertionClient": "task-agent", + "statusUrl": f"http://127.0.0.1:{args.casework_port}", + "tokenEndpoint": f"{args.issuer}/oauth2/token", + "statusClient": "scheduling-status", + "statusKeyRef": f"secret:file/{key_name}", + "statusResource": CASEWORK_RESOURCE, + }}, + }) + + def cmd_scheduling_runtime(args: argparse.Namespace) -> None: runtime = { "apiVersion": "id.registrystack.org/formats/scheduling/runtime/v1alpha1", @@ -885,6 +951,15 @@ def main() -> None: p.add_argument("--day", required=True) p.set_defaults(func=cmd_scheduling_project) + p = sub.add_parser("scheduling-managed-plan") + p.add_argument("directory") + p.add_argument("--issuer", required=True) + p.add_argument("--jwks", required=True) + p.add_argument("--casework-port", type=int, required=True) + p.add_argument("--agent-subject", required=True) + p.add_argument("--status-key", required=True) + p.set_defaults(func=cmd_scheduling_managed_plan) + p = sub.add_parser("scheduling-runtime") p.add_argument("output") p.add_argument("--port", type=int, required=True) diff --git a/products/platform/journeys/rstack-dev.sh b/products/platform/journeys/rstack-dev.sh index f24b30b5b1..499f8f4481 100755 --- a/products/platform/journeys/rstack-dev.sh +++ b/products/platform/journeys/rstack-dev.sh @@ -488,7 +488,7 @@ unexpected_answer() { walk_product() { # shellcheck disable=SC2034 # token and token2 are set by name through issue_token local product=$1 work project tier plan_capable status=0 url message_id='' token='' token2='' workflow_revision='' uses_postgres - local first_read=0 documents_receipt='' + local first_read=0 documents_receipt='' standalone_plan_check=0 journey_product_field "$product" tier tier journey_product_field "$product" rstackDevPlan plan_capable journey_product_field "$product" usesPostgres uses_postgres @@ -512,23 +512,25 @@ walk_product() { fi journey_pass init - # plan: `rstack dev check` on the project init wrote. A product that init - # gave no plan for, and that the plan format cannot name, is given the plan - # a reader would write first. + # A generated plan is validated by start. Products without a supported + # starter still need a separate check to report what stops the reader. if [[ ! -f "$project/dev.yaml" && "$plan_capable" != true ]]; then write_probe_plan "$product" "$project" fi - journey_step plan --concepts development-plan --typed "rstack dev check $project" -- rstack_dev check "$project" || status=$? - if [[ $status -ne 0 ]]; then - if [[ ! -f "$project/dev.yaml" ]]; then - journey_needs plan hand-written-plan - else - fail_with_product_code plan "$JOURNEY_STEP_STDOUT" "$JOURNEY_STEP_STDERR" + if [[ ! -f "$project/dev.yaml" || "$plan_capable" != true ]]; then + standalone_plan_check=1 + journey_step plan --concepts development-plan --typed "rstack dev check $project" -- rstack_dev check "$project" || status=$? + if [[ $status -ne 0 ]]; then + if [[ ! -f "$project/dev.yaml" ]]; then + journey_needs plan hand-written-plan + else + fail_with_product_code plan "$JOURNEY_STEP_STDOUT" "$JOURNEY_STEP_STDERR" + fi + journey_cell_end + return 0 fi - journey_cell_end - return 0 + journey_pass plan fi - journey_pass plan # start: one command, after supplying the optional fixture endpoints. case "$product" in @@ -552,27 +554,28 @@ walk_product() { if ! jq -e 'all(.scenarios[]; .result == "passed")' "$START_FILE" >/dev/null; then journey_harness_failure "the start report of $product holds a journey that did not pass; see $START_FILE" fi + [[ $standalone_plan_check -eq 1 ]] || journey_pass plan journey_pass start local run=$RUN url=$(run_url "$product") recipe "$product" - # issuer: the issuer the run gave the product, read from the runtime file - # the report names. + # Check the issuer the runner generated before sending the request. The + # reader uses the header file from `dev token` directly. local runtime_file runtime_file=$(jq -er --arg product "$product" '.runtimeConfigs[$product]' "$START_FILE") || journey_harness_failure "the start report names no runtime file for $product" if [[ "$product" == evidence ]]; then - journey_step issuer --concepts issuer-url,jwks-uri,audience,allowed-clients,scope-claim -- \ - "$JOURNEY_BIN_DIR/evidence" check --posture development --runtime-config "$runtime_file" --format json + # Start already checks the Evidence target, activates its authority and + # runs the authenticated scenario against the generated YAML configuration. + [[ -s "$runtime_file" ]] || journey_harness_failure "the checked Evidence runtime file is missing or empty" elif [[ "$product" == discovery ]]; then printf '%s\n' "Discovery's public index has no issuer." else - journey_step issuer --concepts issuer-url,jwks-uri,audience,allowed-clients,scope-claim \ - --typed "jq read issuer settings $runtime_file" -- \ - jq -e '(.authentication.oidc // .deployment.authentication // .oidc).issuers + jq -e '(.authentication.oidc // .deployment.authentication // .oidc).issuers | select(type == "object" and length > 0) - | map_values({issuer, audience, allowedClients, scopeClaim, jwksSource: .jwksSource.type})' "$runtime_file" || + | map_values({issuer, audience, allowedClients, scopeClaim, jwksSource: .jwksSource.type})' \ + "$runtime_file" >"$work/issuer.json" || journey_harness_failure "cannot read the issuer of $product from $runtime_file" fi journey_pass issuer @@ -606,8 +609,13 @@ walk_product() { if [[ $status -ne 0 ]]; then unexpected_answer call fi + if [[ "$product" == messaging ]]; then + journey_http call --expect-status 200 --bearer token GET "$url/v1/messages/$message_id" || unexpected_answer call + jq -e --arg id "$message_id" '.id == $id' "$JOURNEY_STEP_STDOUT" >/dev/null || + journey_harness_failure "the message read did not return the submitted message" + fi journey_pass call - if [[ "$CALL_METHOD" == GET && -n "$PERSON" ]]; then + if [[ "$product" == messaging || ("$CALL_METHOD" == GET && -n "$PERSON") ]]; then journey_reached t1 first_read=1 fi @@ -629,6 +637,12 @@ walk_product() { documents_ready_hook "$work" "$url" token documents_receipt journey_pass hook ;; + scheduling) + # The named reader has catalogue access. Booking needs an exchanged task + # grant and a trusted assertion issuer binding on the managed runtime. + printf '%s\n' 'Scheduling appointment observer needs a verified task grant and its assertion issuer binding.' + journey_unexercised hook + ;; *) journey_unexercised hook ;; esac @@ -786,27 +800,6 @@ hook_received() { curl --silent --fail --max-time 3 "$1" | breg_hook_matches "$2" } -# The managed sink authenticates the delivery. Correlate its captured envelope -# and signing headers to the operation, without accepting forwarded credentials. -signed_hook_matches() { - local expected=$1 - shift - jq -e --argjson expected "$expected" 'any(.[]; - . as $capture | (.body | fromjson?) as $event | - $event.type == $expected.type and $event.data == $expected.data and - ($expected.source == null or $event.source == $expected.source) and - ($event.id | type == "string" and length > 0) and - any($capture.headers[]; .name == "webhook-id" and .value == $event.id) and - any($capture.headers[]; .name == "webhook-timestamp" and (.value | test("^[0-9]+$"))) and - any($capture.headers[]; .name == "webhook-signature" and (.value | startswith("v1,"))) and - all($capture.headers[]; .name != "authorization" and .name != "cookie" and - .name != "registry-source-authorization" and .name != "proxy-authorization"))' "$@" >/dev/null -} - -signed_hook_received() { - curl --silent --fail --max-time 3 "$1" | signed_hook_matches "$2" -} - managed_hook_url() { local product=$1 value value=$(jq -er --arg product "$product" '.hookSinks[$product].receivedUrl | strings | select(length > 0)' "$START_FILE") || diff --git a/products/platform/journeys/test_journey_tables.py b/products/platform/journeys/test_journey_tables.py index cb107b64bd..e289fc43a9 100644 --- a/products/platform/journeys/test_journey_tables.py +++ b/products/platform/journeys/test_journey_tables.py @@ -186,6 +186,59 @@ def test_scheduling_rejects_missing_proof_even_when_stop_passes(self): self.assertIn(diagnostic, result.stdout + result.stderr) self.assertEqual("cell ended" in result.stdout, code == 0) + def test_book_and_confirm_use_the_same_named_grant(self): + driver = r""" +source "$1/lib.sh" +scratch=$2 mode=$3 +appointment='' +printf '%s\n' '{"offering":"application-review"}' >"$scratch/hold-request.json" +journey_harness_failure() { printf '%s\n' "$1" >&2; exit 3; } +journey_http() { + [[ "$1 $2 $3 $4 $5" == 'hook --expect-status 201 --bearer approved_booking' ]] + local request_file capture + while [[ $# -gt 2 ]]; do + case "$1" in + --data-file) request_file=$2; shift 2 ;; + --capture) capture=$3; shift 3 ;; + *) shift ;; + esac + done + [[ "$1" == POST ]] + case "$2" in + http://127.0.0.1:49192/v1/holds) + [[ "$request_file" == "$scratch/hold-request.json" ]] + printf '%s\n' 'hold requested' + if [[ "$mode" == refuse ]]; then + JOURNEY_HTTP_STATUS=403 JOURNEY_HTTP_PROBLEM_CODE=operation.not-authorized + return 1 + fi + printf -v "$capture" '%s' held-id + ;; + http://127.0.0.1:49192/v1/appointments) + jq -e '. == {hold:"held-id",admission:null}' "$request_file" >/dev/null + printf '%s\n' 'appointment confirmed' + printf -v "$capture" '%s' confirmed-id + ;; + *) return 1 ;; + esac +} +journey_scheduling_appointment http://127.0.0.1:49192 "$scratch" "$scratch/hold-request.json" approved_booking appointment +printf '%s\n' "$appointment" +""" + for mode, code, steps in ( + ("approve", 0, ["hold requested", "appointment confirmed", "confirmed-id"]), + ("refuse", 3, ["hold requested"]), + ): + with self.subTest(mode=mode), tempfile.TemporaryDirectory() as directory: + result = subprocess.run( + ["bash", "-euo", "pipefail", "-c", driver, "scheduling-booking", str(TABLES), directory, mode], + capture_output=True, text=True, timeout=10, + ) + self.assertEqual(result.returncode, code, result.stderr) + self.assertEqual(result.stdout.splitlines(), steps) + if mode == "refuse": + self.assertIn("HTTP 403, operation.not-authorized", result.stderr) + class PassRule(unittest.TestCase): @classmethod @@ -940,7 +993,7 @@ def walk(self, product, delivered): functions = [] for name in ( "walk_product", "recipe", "hook_received", "breg_hook_matches", - "managed_hook_url", "check_managed_hook", "signed_hook_received", "signed_hook_matches", + "managed_hook_url", "check_managed_hook", "documents_ready_hook", "documents_ready_matches", ): match = re.search(rf"^{name}\(\) \{{\n.*?^\}}\n", script, re.M | re.S) @@ -955,11 +1008,20 @@ def walk(self, product, delivered): "$scratch" >"$scratch/runtime.json" : >"$scratch/audit.jsonl" : >"$scratch/audit.schedulingctl.jsonl" -init_command() { INIT_COMMAND=(true); } +write_starter() { mkdir -p "$1"; : >"$1/dev.yaml"; } +init_command() { INIT_COMMAND=(write_starter "$2"); } add_contact_hook() { :; } add_documents_hooks() { :; } +start_evidence_source() { :; } +stop_evidence_source() { :; } +measure_reader_action() { + if [[ "$delivered" == first-hour ]]; then + journey_step "$1" -- true + fi +} start_run() { local result=passed + measure_reader_action "$1" [[ "$1" != keep ]] || result=skipped RUN=$1-run START_FILE=$scratch/$1.json @@ -973,7 +1035,7 @@ def walk(self, product, delivered): LIVE_RUNS+="$RUN"$'\n' } run_url() { printf '%s\n' 'http://127.0.0.1:49192'; } -issue_token() { :; } +issue_token() { measure_reader_action "$1"; } write_keep() { KEEP_PERSON=$PERSON KEEP_PATH=/retained @@ -1054,7 +1116,25 @@ def walk(self, product, delivered): esac fi case "$1" in - call) printf '%s\n' '{}' >"$JOURNEY_STEP_STDOUT" ;; + call) + measure_reader_action "$1" + JOURNEY_STEP_STDOUT=$scratch/response.json + if [[ "$CELL" == messaging ]]; then + case "${@: -2:1} ${!#}" in + 'POST http://127.0.0.1:49192/v1/messages') + message_id=message-1 + printf '%s\n' 'submit message' >>"$trace" + ;; + 'GET http://127.0.0.1:49192/v1/messages/message-1') + printf '%s\n' 'read submitted message' >>"$trace" + ;; + *) return 1 ;; + esac + printf '%s\n' '{"id":"message-1"}' >"$JOURNEY_STEP_STDOUT" + else + printf '%s\n' '{}' >"$JOURNEY_STEP_STDOUT" + fi + ;; hook) [[ "${!#}" == http://127.0.0.1:49191/received ]] printf '%s\n' 'read sink' >>"$trace" @@ -1079,13 +1159,21 @@ def walk(self, product, delivered): run_containers() { printf '%s\n' 'fake-container'; } journey_check_absent() { :; } -journey_init rstack-dev -- --product "$product" --out "$scratch/run" +options=() +[[ "$delivered" != first-hour ]] || options+=(--timed) +journey_init rstack-dev -- --product "$product" --out "$scratch/run" "${options[@]}" +JOURNEY_BIN_DIR=$scratch +printf '%s\n' '#!/usr/bin/env bash' 'exit 0' >"$scratch/evidence" +chmod +x "$scratch/evidence" if [[ "$delivered" == terminal-step ]]; then journey_cell_begin "$product" journey_unexercised stop else walk_product "$product" fi +if [[ "$delivered" == first-hour ]]; then + jq -r '.toT1.steps' "$scratch/run/$product/cell.json" >>"$trace" +fi journey_finish """ with tempfile.TemporaryDirectory() as directory: @@ -1102,9 +1190,29 @@ def walk(self, product, delivered): trace = trace_file.read_text(encoding="utf-8").splitlines() if trace_file.exists() else [] return result, outcomes, trace + def test_starter_first_read_uses_four_reader_commands(self): + result, outcomes, trace = self.walk("scheduling", "first-hour") + self.assertEqual(result.returncode, 0, result.stdout + result.stderr) + self.assertEqual(trace[-1], "4") + self.assertIn(("plan", "pass"), outcomes) + self.assertIn(("issuer", "pass"), outcomes) + + def test_messaging_reads_the_submitted_message_before_restart(self): + result, _, trace = self.walk("messaging", "first-hour") + self.assertEqual(result.returncode, 0, result.stdout + result.stderr) + self.assertEqual(trace[:2], ["submit message", "read submitted message"]) + self.assertEqual(trace[-1], "5") + + def test_evidence_first_read_uses_the_checked_start(self): + result, outcomes, trace = self.walk("evidence", "first-hour") + self.assertEqual(result.returncode, 0, result.stdout + result.stderr) + self.assertEqual(trace[-1], "4") + self.assertIn(("issuer", "pass"), outcomes) + def test_scheduling_reports_unexercised_and_keeps_walking(self): result, outcomes, trace = self.walk("scheduling", "no") self.assertEqual(result.returncode, 0, result.stdout + result.stderr) + self.assertIn("needs a verified task grant and its assertion issuer binding", result.stdout) self.assertEqual([row for row in outcomes if row[0] == "hook"], [("hook", "unexercised")]) self.assertIn("scheduling hook: unexercised", result.stderr) self.assertEqual(outcomes[-3:], [("keep", "pass"), ("attach", "pass"), ("stop", "pass")]) @@ -1274,6 +1382,57 @@ def test_composed_fixtures_writes_valid_registration_and_runtimes(self): self.assertEqual(cw_rt["listener"]["bind"], "0.0.0.0:18100") self.assertEqual(cw_rt["listener"]["networkExposure"], "container-private") + def test_managed_scheduling_fixture_names_one_grant_and_live_status_client(self): + script = TABLES / "projects" / "composed_fixtures.py" + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + key = root / "status-input" + key.write_bytes(b"fixture status key\n") + key.chmod(0o600) + issuer = "http://127.0.0.1:18080" + jwks = issuer + "/oauth2/jwks" + project = root / "managed" + project.mkdir() + example = project / "runtime.example.yaml" + example.write_text("kind: SchedulingRuntimeConfig\ndestinations: {}\n", encoding="utf-8") + command = ["python3", str(script), "scheduling-managed-plan", str(project), + "--issuer", issuer, "--jwks", jwks, "--casework-port", "18100", + "--agent-subject", "fixture-agent", "--status-key", str(key)] + rejected = command.copy() + rejected[rejected.index(jwks)] = "http://127.0.0.1:18009/oauth2/jwks" + result = subprocess.run(rejected, capture_output=True, text=True) + self.assertNotEqual(result.returncode, 0) + self.assertIn("same-origin JWKS", result.stderr) + key.chmod(0o640) + result = subprocess.run(command, capture_output=True, text=True) + self.assertNotEqual(result.returncode, 0) + self.assertIn("owner-only fixture status key", result.stderr) + self.assertFalse((project / "fixture").exists()) + self.assertFalse((project / "dev.yaml").exists()) + key.chmod(0o600) + subprocess.run(command, check=True, capture_output=True) + plan = json.loads((project / "dev.yaml").read_text(encoding="utf-8")) + self.assertEqual(plan["externalJwksUri"], jwks) + self.assertEqual(plan["products"], [{"product": "scheduling", "project": ".", + "audience": "urn:example:journey:scheduling"}]) + self.assertEqual(plan["people"], {"task-agent": { + "subject": "fixture-agent", "client": "task-agent", + "grants": {"scheduling": {"profile": "reader", "scopes": ["scheduling:read"]}}, + }}) + self.assertEqual(plan["externalScheduling"], {"taskGrant": { + "sourceIssuer": "https://casework.journey.example", "assertionClient": "task-agent", + "statusUrl": "http://127.0.0.1:18100", "tokenEndpoint": issuer + "/oauth2/token", + "statusClient": "scheduling-status", "statusKeyRef": "secret:file/scheduling-status.jwk", + "statusResource": "urn:example:journey:casework", + }}) + self.assertEqual(json.loads((project / plan["journeyFile"]).read_text())["journeys"], []) + copied = project / "fixture/scheduling-status.jwk" + self.assertEqual(copied.read_bytes(), key.read_bytes()) + self.assertEqual(copied.stat().st_mode & 0o777, 0o600) + self.assertEqual(copied.parent.stat().st_mode & 0o777, 0o700) + destinations = yaml.safe_load(example.read_text())["destinations"] + self.assertEqual(set(destinations["hooks"]), {"appointment-events"}) + class TokenAudienceAndWrongAgentChecks(unittest.TestCase): @staticmethod From 07578388e289215c21a13e8897d487fa5f8e7375 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 18/55] refactor: select signed event and webhook transport centrally and bind Session sign-in routes Folds these reviewed commits: - refactor(adapter): select signed event transport before activation - fix(journeys): read the Messaging starter receipt at T1 - refactor(breg): select signed webhook transport centrally - fix(session): bind checked inventory to live sign-in routes - fix(rstack): separate Scheduling and BReg status credentials - test(journeys): exercise managed BReg Compose attachments - fix(journeys): reap managed Scheduling startup before cleanup - refactor(evidence): centralize wallet delivery transport checks - fix(journeys): reap promotion startup and validate Adapter checks - test(session): verify module sign-in drift and prefix refusal - test(rstack): check task status identity separation through plans - test(deploy): prove isolated registrar sign-out - fix(journeys): preserve aligned Casework starter files - docs(casework): staff the starter queue without replacing its files - fix(rstack): scope lint expectation to the JSON Schema callback - test(journeys): measure Casework missing-scope diagnostics Signed-off-by: Jeremi Joslin --- .../src/runtime_destination.rs | 98 ++-- .../signed_coordinator_event_postgres.rs | 90 +++- crates/registry-breg/src/event_destination.rs | 114 ++++- .../registry-evidence-oid4vci/src/config.rs | 91 +++- .../registry-rstack-dev/src/external_breg.rs | 76 +++ .../registry-rstack-dev/src/owner_report.rs | 4 + crates/registry-rstack-dev/src/plan.rs | 81 +++ crates/registry-session/src/gateway/verify.rs | 70 ++- crates/registry-session/src/schema.rs | 24 +- crates/registry-session/tests/binary.rs | 141 ++++-- .../examples/business-registration/README.md | 30 +- .../identity-deployment.yaml | 10 + .../business-registration/tests/browser.mjs | 207 ++++++++ .../tests/test_compose.py | 8 + .../business-registration/thunderid.sh | 1 + .../docs/configure/casework-directory.mdx | 21 +- .../src/content/docs/configure/casework.mdx | 4 +- .../run-a-project-with-rstack-dev.mdx | 3 +- .../src/content/docs/configure/session.mdx | 17 +- .../src/content/docs/security/session.mdx | 7 +- .../content/docs/tutorials/first-casework.mdx | 53 +- .../examples/session/checked-routes.json | 15 +- ...ssion-route-inventory.v1alpha1.schema.json | 47 +- products/platform/journeys/README.md | 17 +- products/platform/journeys/concepts.yaml | 2 + products/platform/journeys/lib.sh | 34 +- products/platform/journeys/own-provider.sh | 72 ++- .../projects/check-private-postgres.py | 32 ++ .../journeys/projects/hook-receiver.py | 6 +- .../projects/rstack-attachments.compose.yaml | 29 ++ .../journeys/projects/rstack-attachments.sh | 157 ++++++ products/platform/journeys/promote.sh | 74 ++- products/platform/journeys/rstack-dev.sh | 156 ++++-- .../platform/journeys/test_journey_tables.py | 464 +++++++++++++++++- products/platform/journeys/test_lib.sh | 2 + 35 files changed, 1955 insertions(+), 302 deletions(-) create mode 100644 deploy/examples/business-registration/tests/browser.mjs create mode 100644 products/platform/journeys/projects/check-private-postgres.py create mode 100644 products/platform/journeys/projects/rstack-attachments.compose.yaml create mode 100644 products/platform/journeys/projects/rstack-attachments.sh diff --git a/crates/registry-adapter-job/src/runtime_destination.rs b/crates/registry-adapter-job/src/runtime_destination.rs index 5dea3ec2ae..be28eed68e 100644 --- a/crates/registry-adapter-job/src/runtime_destination.rs +++ b/crates/registry-adapter-job/src/runtime_destination.rs @@ -24,6 +24,11 @@ use registry_platform_crypto::delivery_signature::DeliveryKeys; #[cfg(any(feature = "direct-breg", feature = "signed-coordinator-event"))] use registry_platform_crypto::delivery_signature::{distinct_delivery_keys, DeliveryKey}; #[cfg(feature = "signed-coordinator-event")] +use registry_platform_httputil::{ + destination::EventDestinationPolicy, + select::{select_destination, TransportClass}, +}; +#[cfg(feature = "signed-coordinator-event")] use registry_platform_yaml::ExternalId; use registry_platform_yaml::{BoundedU64, LocalId, SecretReference, Url}; use serde::Deserialize; @@ -106,16 +111,15 @@ pub async fn activate_destination<'a>( ) -> Result, String> { require_compiled_destination(&program.job.destination).map_err(not_compiled_message)?; let bindings = load_runtime_bindings(runtime)?; - #[cfg(any(feature = "direct-breg", feature = "signed-coordinator-event"))] - let keys = resolve_destination_keys(resolver, &bindings)?; match &program.job.destination { JobDestination::DirectBreg { binding, .. } => { + #[cfg(feature = "direct-breg")] + drop(resolve_destination_keys(resolver, &bindings)?); let configured = bindings .get(binding) .ok_or_else(|| missing_binding(binding))?; #[cfg(feature = "direct-breg")] { - drop(keys); activate_direct( program, configured, @@ -142,7 +146,7 @@ pub async fn activate_destination<'a>( configured, &runtime.core, resolver, - keys, + &bindings, runtime.posture.posture(), ) } @@ -155,9 +159,8 @@ pub async fn activate_destination<'a>( } } -/// Check destination feature and runtime binding shape without resolving a -/// secret or opening a network connection. `adapter-job check` uses this -/// before it reports success. +/// Check the destination feature, runtime binding and signed event transport +/// without resolving a secret or opening a network connection. pub fn check_destination_runtime( job: &AdapterJob, runtime: &JobRuntimeConfig, @@ -178,14 +181,28 @@ pub fn check_destination_runtime( revised_receiver, .. }, RuntimeDestinationBinding::SignedCoordinatorEvent { + #[cfg(feature = "signed-coordinator-event")] + base_url, revised_receiver: configured_revised, + #[cfg(feature = "signed-coordinator-event")] + tls_trust_profile, .. }, - ) => check_revised_receiver( - binding, - revised_receiver.is_some(), - configured_revised.is_some(), - ), + ) => { + check_revised_receiver( + binding, + revised_receiver.is_some(), + configured_revised.is_some(), + )?; + #[cfg(feature = "signed-coordinator-event")] + signed_destination_policy( + binding, + base_url, + &runtime.core, + tls_trust_profile.is_some(), + )?; + Ok(()) + } _ => Err("the runtime destination kind does not match the job destination".to_string()), } } @@ -561,19 +578,50 @@ fn take_receiver_keys(keys: &mut BTreeMap, path: &str) -> D DeliveryKeys::new(current, previous).expect("the inventory validated distinct key bytes") } +#[cfg(feature = "signed-coordinator-event")] +fn signed_destination_policy( + binding: &LocalId, + base_url: &Url, + core: &AdapterEndpointBindings, + configured_tls: bool, +) -> Result { + let refused = "the signed-event destination policy was refused"; + // Transport inference admits HTTPS and loopback HTTP. Source CIDRs keep + // their existing role in the fixed event policy's address checks. + let selected = + select_destination(&base_url.to_url(), None, &[]).map_err(|_| refused.to_owned())?; + let private_cidrs = core + .allowed_private_cidrs + .iter() + .map(registry_adapter_core::Cidr::network) + .collect::>(); + // The original URL must be a bare origin, and HTTPS retains its existing + // profile and DNS policy. + let policy = EventDestinationPolicy::new( + binding.as_str(), + base_url.as_str(), + selected.profile(), + &private_cidrs, + ) + .map_err(|_| refused.to_owned())?; + if configured_tls && selected.transport() != TransportClass::VerifiedTls { + return Err("the signed-event destination TLS material was refused".to_owned()); + } + Ok(policy) +} + #[cfg(feature = "signed-coordinator-event")] fn activate_signed<'a>( program: &'a JobProgram, configured: &RuntimeDestinationBinding, core: &AdapterEndpointBindings, resolver: &SecretResolver, - mut keys: BTreeMap, + bindings: &BTreeMap, posture: registry_platform_config::Posture, ) -> Result, String> { use registry_adapter_connectors::coordinator_event::{ CoordinatorEventConnector, CoordinatorEventReceiver, }; - use registry_platform_httputil::destination::{DestinationProfile, EventDestinationPolicy}; let JobDestination::SignedCoordinatorEvent { binding, @@ -602,28 +650,18 @@ fn activate_signed<'a>( revised_receiver.is_some(), configured_revised.is_some(), )?; + let mut policy = + signed_destination_policy(binding, base_url, core, tls_trust_profile.is_some())? + .with_peer_policy(registry_platform_httputil::PeerPolicy::from_posture( + posture, + )); + let mut keys = resolve_destination_keys(resolver, bindings)?; let path = format!("destinations.{binding}"); let primary_keys = take_receiver_keys(&mut keys, &path); let revised_keys = configured_revised .as_ref() .map(|_| take_receiver_keys(&mut keys, &format!("{path}.revisedReceiver"))); drop(keys); - let profile = if base_url.is_https() { - DestinationProfile::ProductionHttps - } else { - DestinationProfile::LoopbackHttp - }; - let private_cidrs = core - .allowed_private_cidrs - .iter() - .map(registry_adapter_core::Cidr::network) - .collect::>(); - let mut policy = - EventDestinationPolicy::new(binding.as_str(), base_url.as_str(), profile, &private_cidrs) - .map_err(|_| "the signed-event destination policy was refused".to_string())? - .with_peer_policy(registry_platform_httputil::PeerPolicy::from_posture( - posture, - )); if tls_trust_profile.is_some() { let endpoint = tls_endpoint(binding, base_url, tls_trust_profile.clone())?; let materials = diff --git a/crates/registry-adapter-job/tests/signed_coordinator_event_postgres.rs b/crates/registry-adapter-job/tests/signed_coordinator_event_postgres.rs index 78e2e85151..45e2054b43 100644 --- a/crates/registry-adapter-job/tests/signed_coordinator_event_postgres.rs +++ b/crates/registry-adapter-job/tests/signed_coordinator_event_postgres.rs @@ -29,7 +29,7 @@ use registry_adapter_engine::job::{compile_job, JobProgram}; use registry_adapter_engine::job_sources::JobRuntimeConfig; use registry_adapter_job::destination::{DeliverableItem, HandOffOutcome, JobDestination}; use registry_adapter_job::pass::{run_pass, PassOptions, PassReport, StopReason}; -use registry_adapter_job::runtime_destination::activate_destination; +use registry_adapter_job::runtime_destination::{activate_destination, check_destination_runtime}; use registry_adapter_job::signed_coordinator_event::{ receiver_identity, CoordinatorReceiverDigestContext, SignedCoordinatorEventDestination, SignedCoordinatorEventReceiver, @@ -162,6 +162,8 @@ async fn isolated_store() -> Pool { #[tokio::test(flavor = "multi_thread")] async fn runtime_binding_activates_the_signed_destination_without_fallback() { const KEY_ENV: &str = "ADAPTER_JOB_SIGNED_DESTINATION_TEST_KEY"; + const RECEIVER_DIGEST: &str = "SELECT receiver_identity FROM adapter_job_items \ + WHERE job_id = 'case-daily' AND item_key = 'submissions/a'"; struct EnvironmentGuard; impl Drop for EnvironmentGuard { fn drop(&mut self) { @@ -177,6 +179,7 @@ async fn runtime_binding_activates_the_signed_destination_without_fallback() { .await .expect("the signed receiver binds"); let address = listener.local_addr().expect("the receiver address"); + let base_url = format!("http://127.0.0.1:{}/", address.port()); let app = Router::new() .route(TARGET, post(admit)) .with_state(receiver.clone()); @@ -203,7 +206,7 @@ async fn runtime_binding_activates_the_signed_destination_without_fallback() { runtime["destinations"] = json!({ "coordinator-test": { "type": "signed-coordinator-event", - "baseUrl": format!("http://127.0.0.1:{}/", address.port()), + "baseUrl": &base_url, "hmacSha256KeyRef": format!("secret:env/{KEY_ENV}"), "attemptTimeoutMilliseconds": 2000 } @@ -221,6 +224,7 @@ async fn runtime_binding_activates_the_signed_destination_without_fallback() { let program = compile_job(&fixture.pack, &fixture.job, &fixture.runtime).expect("the job compiles"); let runtime = JobRuntimeConfig::load(&fixture.runtime).expect("the runtime snapshot loads"); + check_destination_runtime(&program.job, &runtime).expect("the signed destination checks"); let resolver = SecretResolver::new([SecretProvider::Environment], "") .expect("the environment secret resolver starts"); let destination = activate_destination(&program, &runtime, &resolver) @@ -249,6 +253,18 @@ async fn runtime_binding_activates_the_signed_destination_without_fallback() { assert_eq!(pending.sequence, 1); assert!(pending.run_id.is_none()); assert!(!pending.admitted_before); + let expected_identity = receiver_identity(&CoordinatorReceiverDigestContext { + binding: "coordinator-test", + base_url: &base_url, + tls_trust_profile: None, + workflow: "case-ingestion", + trigger: "submitted", + source: "urn:registry-adapter:job:case-daily", + event_type: "org.example.case-submitted.v1", + data_schema: "urn:example:schema:case-submitted:v1", + }); + let pending_identity: Vec = client.query_one(RECEIVER_DIGEST, &[]).await.unwrap().get(0); + assert_eq!(pending_identity, expected_identity); let state = store::read_state(&client, "case-daily") .await .unwrap() @@ -275,11 +291,81 @@ async fn runtime_binding_activates_the_signed_destination_without_fallback() { assert_eq!(acknowledged.sequence, pending.sequence); assert_eq!(acknowledged.last_digest, pending.last_digest); assert!(acknowledged.run_id.is_some()); + let retried_identity: Vec = client.query_one(RECEIVER_DIGEST, &[]).await.unwrap().get(0); + assert_eq!(retried_identity, pending_identity); let bodies = receiver.bodies.lock().expect("the receiver body lock"); assert_eq!(bodies.len(), 2); assert_eq!(bodies[0], bodies[1], "a retry preserves envelope bytes"); } +#[tokio::test] +async fn signed_destination_refuses_invalid_transports_and_origins_before_keys() { + let fixture = job_fixture::JobFixture::start( + job_fixture::PAGE_SCRIPT, + vec![], + job_fixture::Edits::Ordered, + ) + .await; + let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap(); + let address = listener.local_addr().unwrap(); + let missing_key = tempfile::tempdir().expect("an empty directory for the missing key"); + let resolver = SecretResolver::new([SecretProvider::File], missing_key.path()) + .expect("the file resolver starts"); + let mut document: serde_json::Value = + serde_json::from_slice(&std::fs::read(&fixture.runtime).unwrap()).unwrap(); + let policy_refused = "the signed-event destination policy was refused"; + for (base_url, tls_trust_profile, expected) in [ + // The job fixture intentionally lists a CIDR covering this address. + ( + "http://192.168.10.8:41001/".to_owned(), + None, + policy_refused, + ), + ( + format!("http://{address}/?resource=unexpected"), + None, + policy_refused, + ), + ("https://localhost:41001/".to_owned(), None, policy_refused), + ( + format!("http://{address}/"), + Some("private-ca"), + "the signed-event destination TLS material was refused", + ), + ] { + document["destinations"] = json!({ + "coordinator-test": { + "type": "signed-coordinator-event", + "baseUrl": base_url, + "hmacSha256KeyRef": "secret:file/missing-key", + "attemptTimeoutMilliseconds": 2000 + } + }); + if let Some(profile) = tls_trust_profile { + document["destinations"]["coordinator-test"]["tlsTrustProfile"] = json!(profile); + } + std::fs::write(&fixture.runtime, serde_json::to_vec(&document).unwrap()).unwrap(); + let program = compile_job(&fixture.pack, &fixture.job, &fixture.runtime).unwrap(); + let runtime = JobRuntimeConfig::load(&fixture.runtime).unwrap(); + assert_eq!( + check_destination_runtime(&program.job, &runtime).unwrap_err(), + expected + ); + assert_eq!( + activate_destination(&program, &runtime, &resolver) + .await + .err() + .as_deref(), + Some(expected) + ); + } + assert!( + tokio::time::timeout(Duration::from_millis(100), listener.accept()) + .await + .is_err() + ); +} + #[tokio::test(flavor = "multi_thread")] async fn a_lost_signed_event_answer_recovers_one_run_through_the_job_store() { let receiver = Receiver::default(); diff --git a/crates/registry-breg/src/event_destination.rs b/crates/registry-breg/src/event_destination.rs index f8dd6096cf..942aea3859 100644 --- a/crates/registry-breg/src/event_destination.rs +++ b/crates/registry-breg/src/event_destination.rs @@ -17,10 +17,11 @@ use registry_platform_crypto::delivery_signature::{ use registry_platform_hooks::delivery::{UrlDestination, UrlDestinationParts}; use registry_platform_httputil::destination::{ DestinationDnsFamily, DestinationProfile, DestinationTlsMaterial, EventDestinationPolicy, - EventDestinationRequestTemplate, MAX_DESTINATION_PRIVATE_CIDRS, - MAX_DESTINATION_REQUEST_BODY_BYTES, MAX_DESTINATION_REQUEST_HEADER_BYTES, - MAX_DESTINATION_TARGET_BYTES, + EventDestinationRequestTemplate, MAX_DESTINATION_ORIGIN_URL_BYTES, + MAX_DESTINATION_PRIVATE_CIDRS, MAX_DESTINATION_REQUEST_BODY_BYTES, + MAX_DESTINATION_REQUEST_HEADER_BYTES, MAX_DESTINATION_TARGET_BYTES, }; +use registry_platform_httputil::select::{select_destination, TransportClass}; use serde::Deserialize; use serde_json::{json, Value}; use sha2::{Digest, Sha256}; @@ -472,7 +473,7 @@ impl EventDestinationConfig { let policy = EventDestinationPolicy::new_with_dns_family( logical_id, &self.origin, - self.network_profile.platform(), + self.network_profile.select(&self.origin)?, &self.allowed_private_cidrs, self.dns_family.platform(), ) @@ -632,13 +633,24 @@ impl<'de> Deserialize<'de> for EventDestinationNetworkProfile { } impl EventDestinationNetworkProfile { - fn platform(self) -> DestinationProfile { - match self { - Self::ProductionHttps => DestinationProfile::ProductionHttps, - Self::LoopbackHttp => DestinationProfile::LoopbackHttp, + fn select(self, origin: &str) -> ConfigResult { + let transport = match self { + Self::ProductionHttps => TransportClass::VerifiedTls, + Self::LoopbackHttp => TransportClass::LoopbackPlaintext, #[cfg(feature = "postgres-test")] - Self::PinnedLoopbackHttpsTest => DestinationProfile::PinnedLoopbackHttpsTest, + Self::PinnedLoopbackHttpsTest => { + return Ok(DestinationProfile::PinnedLoopbackHttpsTest) + } + }; + if origin.len() > MAX_DESTINATION_ORIGIN_URL_BYTES { + return Err(EventDestinationConfigError); } + let url = url::Url::parse(origin).map_err(|_| EventDestinationConfigError)?; + // The fixed policy keeps the authored origin and its existing DNS + // address-family and range constraints. + select_destination(&url, Some(transport), &[]) + .map(|selected| selected.profile()) + .map_err(|_| EventDestinationConfigError) } /// The word the binding digest is computed over. The digest is stored @@ -801,3 +813,87 @@ fn canonical_binding_digest(value: &Value) -> Result { canonicalize_json(value).map_err(|_| EventDestinationActivationError::InvalidBinding)?; Ok(format!("sha256:{}", hex::encode(Sha256::digest(canonical)))) } + +#[cfg(test)] +mod tests { + use super::*; + + fn configured_policy( + origin: &str, + profile: &str, + dns_family: &str, + cidrs: &[&str], + ) -> ConfigResult { + let binding = serde_json::from_value(json!({ + "origin": origin, + "path": "/events", + "networkProfile": profile, + "dnsFamily": dns_family, + "allowedPrivateCidrs": cidrs, + "hmacSha256KeyRef": "secret:file/hook-key", + "classificationCeiling": "internal", + "deliveryCeilings": { + "attemptTimeoutMilliseconds": 2500, + "maximumAttempts": 3, + }, + })) + .expect("a well-formed authored binding"); + EventDestinationConfig::from_raw("events", binding)?.platform_binding("events") + } + + #[test] + fn event_bindings_keep_their_configured_dns_family() { + let private_https = configured_policy( + "https://events.example/", + "production-https", + "ipv4-only", + &["10.42.0.0/24"], + ) + .expect("private HTTPS receiver with IPv4-only DNS"); + assert_eq!(private_https.dns_family(), DestinationDnsFamily::Ipv4Only); + + let loopback = configured_policy( + "http://[::1]:8100/", + "loopback-http", + "dual-stack-strict", + &[], + ) + .expect("loopback HTTP receiver"); + assert_eq!(loopback.dns_family(), DestinationDnsFamily::DualStackStrict); + } + + #[test] + fn event_bindings_refuse_mismatched_profiles_and_invalid_origins() { + for (origin, profile) in [ + ("http://10.42.0.2/", "loopback-http"), + ("http://127.0.0.1/", "production-https"), + ("https://127.0.0.1/", "loopback-http"), + ("https://localhost/", "production-https"), + ("https://events.example/unexpected", "production-https"), + ] { + assert!( + configured_policy(origin, profile, "dual-stack-strict", &["10.42.0.0/24"]).is_err(), + "{origin} using {profile}" + ); + } + assert!(configured_policy( + "https://events.example/", + "production-https", + "ipv4-only", + &["fd00::/8"], + ) + .is_err()); + } + + #[cfg(feature = "postgres-test")] + #[test] + fn pinned_test_profile_still_accepts_local_https() { + configured_policy( + "https://localhost:8100/", + "pinned-loopback-https-test", + "dual-stack-strict", + &[], + ) + .expect("native pinned TLS fixture binding"); + } +} diff --git a/crates/registry-evidence-oid4vci/src/config.rs b/crates/registry-evidence-oid4vci/src/config.rs index 95504951db..f2ba0c41b8 100644 --- a/crates/registry-evidence-oid4vci/src/config.rs +++ b/crates/registry-evidence-oid4vci/src/config.rs @@ -26,9 +26,10 @@ use registry_platform_config::{ SecretProvidersConfig, SecretReference, DEFAULT_STAND_IN, }; use registry_platform_httputil::client::{ - is_loopback_host, valid_resource_uri, valid_scope_token, MAXIMUM_REQUESTED_SCOPES, - MAXIMUM_REQUESTED_SCOPE_BYTES, MAXIMUM_SCOPE_PARAMETER_BYTES, + valid_resource_uri, valid_scope_token, MAXIMUM_REQUESTED_SCOPES, MAXIMUM_REQUESTED_SCOPE_BYTES, + MAXIMUM_SCOPE_PARAMETER_BYTES, }; +use registry_platform_httputil::select::{select_credential_destination, select_destination}; use registry_platform_yaml::{ shape_union, BoundedU32, BoundedU64, Diagnostic, ExternalId, Invalid, Report, Severity, UniqueList, Url, @@ -1328,7 +1329,7 @@ impl DeliveryDocument { } for (pointer, origin) in self.called_origins() { url_query_or_fragment_findings(pointer, origin, findings); - https_origin_findings(pointer, origin, findings); + https_origin_findings(pointer, origin, OutboundOriginRole::Credential, findings); } for (id, entry) in self.offers.issuers.iter() { let prefix = format!("{OFFER_ISSUERS}/{}", id.as_str()); @@ -1336,7 +1337,12 @@ impl DeliveryDocument { let issuer_path = format!("{prefix}/issuer"); url_query_or_fragment_findings(&issuer_path, &provider.issuer, findings); if !provider.allow_insecure_http { - https_origin_findings(&issuer_path, &provider.issuer, findings); + https_origin_findings( + &issuer_path, + &provider.issuer, + OutboundOriginRole::OfferMetadata, + findings, + ); } let source_path = format!("{prefix}/jwksSource"); match &provider.jwks_source { @@ -1344,7 +1350,12 @@ impl DeliveryDocument { let pointer = format!("{source_path}/uri"); url_query_or_fragment_findings(&pointer, uri, findings); if !provider.allow_insecure_http { - https_origin_findings(&pointer, uri, findings); + https_origin_findings( + &pointer, + uri, + OutboundOriginRole::OfferMetadata, + findings, + ); } } _ => findings.push(Finding::error( @@ -1692,21 +1703,31 @@ fn normalized_credential_issuer(written: &str) -> &str { written.trim_end_matches('/') } -/// Require HTTPS for a called origin outside loopback. +enum OutboundOriginRole { + Credential, + OfferMetadata, +} + +/// Require protected transport for a called origin or a strict offer key source. /// The reader refuses URLs without a host or with embedded credentials. -fn https_origin_findings(pointer: &str, origin: &Url, findings: &mut Vec) { - if !origin.is_https() - && !origin - .to_url() - .host() - .as_ref() - .is_some_and(is_loopback_host) - { - let action = if pointer.starts_with(OFFER_ISSUERS) { - "Write an HTTPS or loopback HTTP URL, or use allowInsecureHttp: true in the issuer entry with development for HTTP beyond loopback." - } else { - "Write an HTTPS or loopback HTTP URL." - }; +fn https_origin_findings( + pointer: &str, + origin: &Url, + role: OutboundOriginRole, + findings: &mut Vec, +) { + let url = origin.to_url(); + let (selected, action) = match role { + OutboundOriginRole::Credential => ( + select_credential_destination(&url, None, &[]), + "Write an HTTPS or loopback HTTP URL.", + ), + OutboundOriginRole::OfferMetadata => ( + select_destination(&url, None, &[]), + "Write an HTTPS or loopback HTTP URL, or use allowInsecureHttp: true in the issuer entry with development for HTTP beyond loopback.", + ), + }; + if selected.is_err() { findings.push(Finding::error( HTTPS_REQUIRED, pointer, @@ -2328,10 +2349,34 @@ store: #[test] fn posture_strict_called_origins_allow_loopback_http_only() { - let loopback = VALID.replace("https://evidence.example.org", "http://127.0.0.1:8080"); - assert!(load_from(&loopback).is_ok()); - let private = VALID.replace("https://evidence.example.org", "http://10.0.0.5"); - assert_refused_with(&private, HTTPS_REQUIRED); + for (original, path, suffix) in [ + ("https://evidence.example.org", "/evidence/baseUrl", ""), + ( + "https://mint.example.org/token", + "/tokenClient/tokenEndpoint", + "/token", + ), + ] { + for host in ["127.0.0.1", "[::1]", "localhost"] { + let text = VALID.replace(original, &format!("http://{host}:8080{suffix}")); + assert!(load_from(&text).is_ok(), "{path} at {host}"); + assert!(!check(&text, false) + .diagnostics + .iter() + .any(|d| d.severity == Severity::Error)); + } + for host in ["10.0.0.5", "receiver.localhost"] { + let text = VALID.replace(original, &format!("http://{host}:8080{suffix}")); + let error = load_from(&text).expect_err("non-loopback plaintext is refused"); + let offline = check(&text, false); + for diagnostics in [error.diagnostics(), offline.diagnostics.as_slice()] { + assert_eq!(diagnostics.len(), 1, "{path} at {host}"); + assert_eq!(diagnostics[0].code, HTTPS_REQUIRED); + assert_eq!(diagnostics[0].path, path); + assert!(!diagnostics[0].message.contains(host)); + } + } + } } #[test] diff --git a/crates/registry-rstack-dev/src/external_breg.rs b/crates/registry-rstack-dev/src/external_breg.rs index 0d5740e67b..98ca725314 100644 --- a/crates/registry-rstack-dev/src/external_breg.rs +++ b/crates/registry-rstack-dev/src/external_breg.rs @@ -3,6 +3,7 @@ use anyhow::{ensure, Context, Result}; use registry_platform_config::{SecretProvider, SecretReference}; +use registry_platform_crypto::PrivateJwk; use registry_platform_yaml::{BoundedU32, LocalId, Url}; use serde::{Deserialize, Serialize}; use serde_json::{json, Value}; @@ -73,6 +74,33 @@ pub(super) struct TaskGrant { } impl TaskGrant { + pub(super) fn require_distinct_status(&self, other: &Self, root: &Path) -> SemanticResult<()> { + require( + self.status_client != other.status_client, + "/externalScheduling/taskGrant/statusClient", + "Scheduling and BReg must use different task status clients.", + "Register a separate Scheduling task status client.", + )?; + let canonical = root.canonicalize().ok(); + let thumbprint = |reference| { + let key = private_fixture(canonical.as_deref()?, reference).ok()?; + PrivateJwk::parse(std::str::from_utf8(&key).ok()?) + .ok()? + .public() + .jkt() + .ok() + }; + let distinct = thumbprint(&self.status_key_ref) + .zip(thumbprint(&other.status_key_ref)) + .is_some_and(|(scheduling, breg)| scheduling != breg); + require( + distinct, + "/externalScheduling/taskGrant/statusKeyRef", + "Scheduling and BReg need valid, distinct private JWKs for task status.", + "Use a separate owner-only key for each task status client.", + ) + } + pub(super) fn validate_for_scheduling( &self, root: &Path, @@ -387,8 +415,56 @@ fn require_loopback_endpoint(field: &str, value: &str) -> SemanticResult<()> { #[cfg(test)] mod tests { use super::*; + use registry_platform_crypto::{generate_private_jwk, GeneratedKeyAlgorithm}; use std::{fs, os::unix::fs::PermissionsExt}; + #[test] + fn scheduling_and_breg_status_clients_and_signing_keys_are_separate() { + let directory = tempfile::tempdir().unwrap(); + let root = directory.path().canonicalize().unwrap(); + std::fs::create_dir(root.join("fixture")).unwrap(); + let key = generate_private_jwk(GeneratedKeyAlgorithm::Ed25519).unwrap(); + let mut same_key = key.clone(); + same_key.kid = Some("renamed-key".to_owned()); + let different_key = generate_private_jwk(GeneratedKeyAlgorithm::Ed25519).unwrap(); + for (path, key) in [ + ("breg-key", key), + ("same-key", same_key), + ("scheduling-key", different_key), + ] { + let bytes = crate::bindings::encode_private_jwk(&key).unwrap(); + crate::write_private(&root.join("fixture").join(path), &bytes).unwrap(); + } + let grant = |client, name| -> TaskGrant { + serde_json::from_value(json!({ + "sourceIssuer": "https://casework.journey.example", + "assertionClient": "task-agent", + "statusUrl": "http://127.0.0.1:41001", + "tokenEndpoint": "http://127.0.0.1:41000/oauth2/token", + "statusClient": client, + "statusKeyRef": format!("secret:file/{name}"), + "statusResource": "urn:example:journey:casework" + })) + .unwrap() + }; + let breg = grant("breg-status", "breg-key"); + for (client, file, field) in [ + ("breg-status", "scheduling-key", "statusClient"), + ("scheduling-status", "breg-key", "statusKeyRef"), + ("scheduling-status", "same-key", "statusKeyRef"), + ] { + let refusal = grant(client, file) + .require_distinct_status(&breg, &root) + .unwrap_err(); + assert!(refusal + .to_string() + .starts_with(&format!("dev.yaml /externalScheduling/taskGrant/{field}:"))); + } + grant("scheduling-status", "scheduling-key") + .require_distinct_status(&breg, &root) + .unwrap(); + } + #[test] fn fixture_keys_refuse_group_access_symlinks_and_paths_outside_the_project() { let scratch = tempfile::tempdir().unwrap(); diff --git a/crates/registry-rstack-dev/src/owner_report.rs b/crates/registry-rstack-dev/src/owner_report.rs index 13c3b88bf8..95477b8fa4 100644 --- a/crates/registry-rstack-dev/src/owner_report.rs +++ b/crates/registry-rstack-dev/src/owner_report.rs @@ -548,6 +548,10 @@ struct ExactInteger { nullable: bool, } +#[expect( + clippy::result_large_err, + reason = "jsonschema requires its keyword factory to return ValidationError by value" +)] fn exact_integer<'a>( parent: &'a serde_json::Map, _: &'a Value, diff --git a/crates/registry-rstack-dev/src/plan.rs b/crates/registry-rstack-dev/src/plan.rs index d6dbbe4ffc..13f60d3cf9 100644 --- a/crates/registry-rstack-dev/src/plan.rs +++ b/crates/registry-rstack-dev/src/plan.rs @@ -1381,6 +1381,15 @@ impl Plan { self, &scheduling.expect("validated Scheduling product").audience, )?; + if let Some(breg_grant) = self + .external_breg + .as_ref() + .and_then(|breg| breg.task_grant.as_ref()) + { + binding + .task_grant + .require_distinct_status(breg_grant, root)?; + } } require( (self.issuer != "run" @@ -2446,6 +2455,78 @@ mod tests { ); } + #[test] + fn plan_refuses_cross_product_task_status_credential_reuse() { + let (root, mut plan) = plan(json!({ + "id": "read", "product": "breg", "as": "operator", "method": "GET", + "path": "/v1/records", "expect": {"status": 200} + })); + fs::create_dir(root.path().join("schedule")).unwrap(); + fs::write(root.path().join("schedule/scheduling.yaml"), "{}").unwrap(); + fs::create_dir(root.path().join("fixture")).unwrap(); + for file in ["breg-status", "scheduling-status"] { + let key = registry_platform_crypto::generate_private_jwk( + registry_platform_crypto::GeneratedKeyAlgorithm::Es256, + ) + .unwrap(); + let bytes = crate::bindings::encode_private_jwk(&key).unwrap(); + crate::write_private(&root.path().join("fixture").join(file), &bytes).unwrap(); + } + plan.products.push( + serde_json::from_value(json!({ + "product": "scheduling", "project": "schedule", + "audience": "urn:example:journey:scheduling" + })) + .unwrap(), + ); + plan.people.insert( + "booker".to_owned(), + serde_json::from_value(json!({ + "subject": "booker", "client": "task-agent", + "grants": {"scheduling": {"profile": "booker", "scopes": ["scheduling:write"]}} + })) + .unwrap(), + ); + plan.issuer = "http://127.0.0.1:41000".to_owned(); + plan.external_jwks_uri = Some("http://127.0.0.1:41000/oauth2/jwks".to_owned()); + let task_grant = |issuer, client, key| { + json!({"taskGrant": { + "sourceIssuer": issuer, "assertionClient": "task-agent", + "statusUrl": "http://127.0.0.1:41001", + "tokenEndpoint": "http://127.0.0.1:41000/oauth2/token", + "statusClient": client, "statusKeyRef": format!("secret:file/{key}"), + "statusResource": "urn:example:journey:casework" + }}) + }; + plan.external_breg = Some( + serde_json::from_value(task_grant( + "http://127.0.0.1:41001", + "breg-status", + "breg-status", + )) + .unwrap(), + ); + for (client, key, refused_field) in [ + ("scheduling-status", "scheduling-status", None), + ("breg-status", "scheduling-status", Some("statusClient")), + ("scheduling-status", "breg-status", Some("statusKeyRef")), + ] { + plan.external_scheduling = Some( + serde_json::from_value(task_grant("https://casework.journey.example", client, key)) + .unwrap(), + ); + let validation = plan.validate(root.path()); + if let Some(field) = refused_field { + assert_eq!( + validation.unwrap_err().field, + format!("/externalScheduling/taskGrant/{field}") + ); + } else { + validation.expect("separate task-status identities"); + } + } + } + #[test] fn a_fixed_external_hook_may_use_the_managed_development_issuer() { let (root, mut plan) = plan(json!({"id": "read", "product": "breg", diff --git a/crates/registry-session/src/gateway/verify.rs b/crates/registry-session/src/gateway/verify.rs index 67258f23fa..ac8a474abc 100644 --- a/crates/registry-session/src/gateway/verify.rs +++ b/crates/registry-session/src/gateway/verify.rs @@ -366,6 +366,7 @@ fn standalone_document( "@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext", "common_tls_context": { "alpn_protocols": ["h2", "http/1.1"], + "tls_params": {"tls_minimum_protocol_version": "TLSv1_2"}, "tls_certificates": [{ "certificate_chain": {"filename": certificate}, "private_key": {"filename": key}, @@ -525,6 +526,7 @@ fn verify_checked_transport<'a>( if document != &wanted { return Err(refusal()); } + verify_document(&expected, document)?; Ok(tls) } @@ -614,10 +616,9 @@ pub fn verify_assembled( Ok(loaded.posture) } -/// Project the browser-facing routes only after verifying the same runtime and -/// assembly as the gateway checks. Upstream addresses and credentials are -/// absent. The operation catalogue and products still decide what a route can -/// call and who can call it. +/// Project the checked gateway routes without upstream addresses or credentials. +/// The selected module supplies the browser client binding. The product still +/// decides what a route can call and who can call it. pub fn write_verified_route_inventory( runtime_config: &Path, assembled: &Path, @@ -625,9 +626,7 @@ pub fn write_verified_route_inventory( selection: &str, posture: DeclaredPosture, ) -> Result { - let loaded = load_gateway_config(runtime_config, posture, true).map_err(|_| { - standalone_refusal("Supply a valid and literal Session runtime for checked route export.") - })?; + let loaded = load_gateway_config(runtime_config, posture, true)?; let config = &loaded.config; let assembly_bytes = read_assembly_bytes(assembled).map_err(|_| { standalone_refusal("Supply a readable, valid Envoy assembly for checked route export.") @@ -657,13 +656,18 @@ pub fn write_verified_route_inventory( .map(|prefix| prefix.as_str()); let overlap = |other: &str| lies_under(&module.prefix, other) || lies_under(other, &module.prefix); - if rewrite != Some("/") - || module.prefix.len() > 256 + if module.prefix.len() > 256 || !module.prefix.ends_with('/') || !module .prefix .bytes() .all(|byte| byte.is_ascii_alphanumeric() || b"/._:-".contains(&byte)) + { + return Err(standalone_refusal( + "Use letters, digits or /._:- and a trailing slash in the selected BReg prefix.", + )); + } + if rewrite != Some("/") || config .modules .iter() @@ -674,14 +678,18 @@ pub fn write_verified_route_inventory( "Select a disjoint BReg module prefix that rewrites to the product root.", )); } - if config.pages.iter().any(|page| { - !page - .prefix + let route_prefixes = config + .modules + .iter() + .map(|module| &module.prefix) + .chain(config.pages.iter().map(|page| &page.prefix)); + if route_prefixes.into_iter().any(|prefix| { + !prefix .bytes() .all(|byte| byte.is_ascii_alphanumeric() || b"/._:~-".contains(&byte)) }) { return Err(standalone_refusal( - "Use checked page prefixes made of letters, digits, or /._:~-.", + "Use checked route prefixes made of letters, digits, or /._:~-.", )); } if config.pages.iter().any(|page| { @@ -697,26 +705,50 @@ pub fn write_verified_route_inventory( .sign_ins .iter() .map(|entry| entry.id.as_str()) - .filter(|id| module.admits(id)) .collect::>(); - if sign_ins.is_empty() || sign_ins.len() > 64 || config.pages.len() > 64 { + if !sign_ins.iter().any(|id| module.admits(id)) + || sign_ins.len() > 64 + || config.pages.len() > 64 + || config.modules.len() > 64 + { return Err(standalone_refusal( - "Checked routes require one to 64 admitted sign-in kinds and at most 64 pages.", + "Checked routes require an admitted sign-in and at most 64 sign-ins, modules and pages.", )); } - let modules = [ - json!({"id": module.id.as_str(), "product": "breg", "prefix": module.prefix, "prefixRewrite": rewrite, "signIns": sign_ins}), - ]; + let modules: Vec<_> = config + .modules + .iter() + .map(|module| { + let admitted: Vec<_> = sign_ins.iter().filter(|id| module.admits(id)).collect(); + let mut route = + json!({"id": module.id.as_str(), "prefix": module.prefix, "signIns": admitted}); + if let Some(product) = module.product { + route["product"] = json!(product.as_str()); + } + if let Some(rewrite) = module + .upstream + .as_ref() + .and_then(|upstream| upstream.prefix_rewrite.as_ref()) + { + route["prefixRewrite"] = json!(rewrite.as_str()); + } + route + }) + .collect(); let pages: Vec<_> = config .pages .iter() .map(|page| json!({"prefix": page.prefix, "signIn": page.sign_in.as_str()})) .collect(); + let projection = serde_json::to_vec(&json!({"modules": modules, "pages": pages})) + .map_err(|_| standalone_refusal("Could not serialize the sign-in projection."))?; let inventory = json!({ "apiVersion": ROUTE_INVENTORY_API_VERSION, "kind": ROUTE_INVENTORY_KIND, "publicOrigin": config.public_origin.as_str().trim_end_matches('/'), "gatewayDigest": sha256_uri(&assembly_bytes), + "signInDigest": sha256_uri(&projection), + "selectedModule": selection, "modules": modules, "pages": pages, }); diff --git a/crates/registry-session/src/schema.rs b/crates/registry-session/src/schema.rs index 14cf1dbabf..c74649b04f 100644 --- a/crates/registry-session/src/schema.rs +++ b/crates/registry-session/src/schema.rs @@ -13,8 +13,8 @@ use schemars::{json_schema, JsonSchema, Schema, SchemaGenerator}; use serde_json::{json, Value}; use crate::config::{ - Authority, ClaimName, ClusterName, FilterName, HostName, ModuleAudience, ResourceUri, - RewritePrefix, RuntimeConfig, ScopeToken, RUNTIME_API_VERSION, RUNTIME_KIND, + Authority, ClaimName, ClusterName, FilterName, HostName, ModuleAudience, ModuleProduct, + ResourceUri, RewritePrefix, RuntimeConfig, ScopeToken, RUNTIME_API_VERSION, RUNTIME_KIND, }; use crate::gateway::{ROUTE_INVENTORY_API_VERSION, ROUTE_INVENTORY_KIND}; @@ -64,6 +64,8 @@ fn route_inventory_schema() -> Value { let mut generator = SchemaSettings::draft2020_12().into_generator(); let id = generator.subschema_for::(); let digest = generator.subschema_for::(); + let product = generator.subschema_for::(); + let rewrite = generator.subschema_for::(); let mut origin = json!(generator.subschema_for::()); origin["pattern"] = json!("^https://127(?:\\.[0-9]{1,3}){3}(?::[0-9]{1,5})?$"); json!({ @@ -71,26 +73,28 @@ fn route_inventory_schema() -> Value { "$id": ROUTE_INVENTORY_SCHEMA_ID, "$defs": generator.take_definitions(true), "title": "Checked Registry Session route inventory", - "description": "One Base Registry Engine browser route and its page bindings from an exact, verified Envoy JSON file.", + "description": "Every configured module and page in a verified Envoy assembly, with one selected Base Registry Engine browser binding. Routes use the longest matching prefix at a path segment boundary.", "type": "object", "additionalProperties": false, - "required": ["apiVersion", "kind", "publicOrigin", "gatewayDigest", "modules", "pages"], + "required": ["apiVersion", "kind", "publicOrigin", "gatewayDigest", "signInDigest", "selectedModule", "modules", "pages"], "properties": { "apiVersion": {"type": "string", "const": ROUTE_INVENTORY_API_VERSION}, "kind": {"type": "string", "const": ROUTE_INVENTORY_KIND}, "publicOrigin": origin, "gatewayDigest": digest, + "signInDigest": digest, + "selectedModule": id, "modules": { - "type": "array", "minItems": 1, "maxItems": 1, + "type": "array", "minItems": 1, "maxItems": 64, "uniqueItems": true, "items": { "type": "object", "additionalProperties": false, - "required": ["id", "product", "prefix", "prefixRewrite", "signIns"], + "required": ["id", "prefix", "signIns"], "properties": { "id": id, - "product": {"type": "string", "const": "breg"}, - "prefix": {"type": "string", "maxLength": 256, "pattern": "^/(?:(?!\\.\\.?/)[A-Za-z0-9._:-]+/)+$"}, - "prefixRewrite": {"type": "string", "const": "/"}, - "signIns": {"type": "array", "minItems": 1, "maxItems": 64, "uniqueItems": true, "items": id} + "product": product, + "prefix": {"type": "string", "maxLength": 256, "pattern": "^/(?:(?!\\.\\.?(?:/|$))[A-Za-z0-9._:~-]+(?:/|$))+$"}, + "prefixRewrite": rewrite, + "signIns": {"type": "array", "maxItems": 64, "uniqueItems": true, "items": id} } } }, diff --git a/crates/registry-session/tests/binary.rs b/crates/registry-session/tests/binary.rs index 5f341e2830..fe30a66565 100644 --- a/crates/registry-session/tests/binary.rs +++ b/crates/registry-session/tests/binary.rs @@ -277,8 +277,16 @@ fn gateway_writes_a_deterministic_checked_standalone_configuration() { fn gateway_inventory_requires_the_exact_verified_assembly() { let root = tempfile::tempdir().expect("directory"); let runtime = root.path().join("runtime.yaml"); - let runtime_source = - standalone_runtime().replace("https://app.example", "https://127.0.0.1:8080"); + let runtime_source = standalone_runtime() + .replace("https://app.example", "https://127.0.0.1:8080") + .replace( + "session:\n", + " reviewer:\n clientId: reviewer-app\n clientSecretRef: secret:file/reviewer-secret\n scopes: [registry:read]\nsession:\n", + ) + .replace( + "pages:\n", + " - id: functions\n product: breg\n prefix: /api/functions/\n audience: person\n upstream: {cluster: functions, prefixRewrite: /functions/}\npages:\n", + ); std::fs::write(&runtime, &runtime_source).expect("runtime"); let assembly = root.path().join("envoy.json"); let routes = root.path().join("routes.json"); @@ -296,37 +304,51 @@ fn gateway_inventory_requires_the_exact_verified_assembly() { ) }; let verify = || export(&routes); - generate_standalone(&runtime, &assembly); - assert_eq!(verify().0, 1, "ordinary plaintext assembly must not export"); - assert!(!routes.exists()); - - let assemble = || { - run_command( - runtime_command(&runtime) - .args(["gateway", "envoy", "--standalone-out"]) - .arg(&assembly) - .args([ - "--listen", - "127.0.0.1:8080", - "--upstream", - "registry=127.0.0.1:8100", - "--upstream", - "pages=127.0.0.1:8200", - ]) + let assemble = |tls| { + let mut command = runtime_command(&runtime); + command + .args(["gateway", "envoy", "--standalone-out"]) + .arg(&assembly) + .args([ + "--listen", + "127.0.0.1:8080", + "--upstream", + "registry=127.0.0.1:8100", + "--upstream", + "pages=127.0.0.1:8200", + "--upstream", + "functions=127.0.0.1:8300", + ]); + if tls { + command .arg("--tls-certificate") .arg(&certificate) .arg("--tls-key") - .arg(&key), - ) + .arg(&key); + } + run_command(&mut command) }; - let (exit, _, stderr) = assemble(); + assert_eq!(assemble(false).0, 0); + assert_eq!(verify().0, 1, "ordinary plaintext assembly must not export"); + assert!(!routes.exists()); + let (exit, _, stderr) = assemble(true); assert_eq!(exit, 0, "{stderr}"); + let assembled: serde_json::Value = + serde_json::from_slice(&std::fs::read(&assembly).expect("assembly")).expect("Envoy JSON"); + assert_eq!( + assembled.pointer(concat!( + "/static_resources/listeners/0/filter_chains/0/transport_socket/typed_config", + "/common_tls_context/tls_params/tls_minimum_protocol_version" + )), + Some(&json!("TLSv1_2")) + ); let (exit, _, stderr) = verify(); assert_eq!(exit, 0, "{stderr}"); let first = std::fs::read(&routes).expect("route inventory"); let inventory: serde_json::Value = serde_json::from_slice(&first).expect("JSON inventory"); assert_eq!(inventory["kind"], "PlatformSessionRouteInventory"); assert_eq!(inventory["publicOrigin"], "https://127.0.0.1:8080"); + assert_eq!(inventory["selectedModule"], "breg"); let digest = |file: &std::path::Path| { let bytes = std::fs::read(file).expect("assembly bytes"); registry_platform_config::sha256_uri(&bytes) @@ -349,13 +371,12 @@ fn gateway_inventory_requires_the_exact_verified_assembly() { } assert_eq!( inventory["modules"], - json!([{ - "id": "breg", - "product": "breg", - "prefix": "/api/registry/", - "prefixRewrite": "/", - "signIns": ["citizen"] - }]) + json!([ + {"id": "breg", "product": "breg", "prefix": "/api/registry/", + "prefixRewrite": "/", "signIns": ["citizen", "reviewer"]}, + {"id": "functions", "product": "breg", "prefix": "/api/functions/", + "prefixRewrite": "/functions/", "signIns": ["citizen", "reviewer"]} + ]) ); assert_eq!( inventory["pages"], @@ -377,12 +398,42 @@ fn gateway_inventory_requires_the_exact_verified_assembly() { assert_eq!(exit, 0, "{stderr}"); assert_eq!(std::fs::read(&routes).expect("regenerated routes"), first); + let changed_sign_in = runtime_source.replace(" signIn: citizen", " signIn: reviewer"); + assert_ne!(changed_sign_in, runtime_source); + std::fs::write(&runtime, changed_sign_in).expect("changed sign-in"); + assert_eq!(verify().0, 0); + let changed: serde_json::Value = + serde_json::from_slice(&std::fs::read(&routes).expect("updated inventory")).unwrap(); + assert_eq!(changed["gatewayDigest"], inventory["gatewayDigest"]); + assert_ne!(changed["signInDigest"], inventory["signInDigest"]); + assert_eq!(changed["pages"][0]["signIn"], "reviewer"); + + let restricted_function = runtime_source.replace( + " prefix: /api/functions/\n audience: person", + " prefix: /api/functions/\n audience: person\n signIns: [reviewer]", + ); + assert_ne!(restricted_function, runtime_source); + std::fs::write(&runtime, restricted_function).expect("changed function admission"); + let (exit, _, stderr) = verify(); + assert_eq!(exit, 0, "{stderr}"); + let changed: serde_json::Value = + serde_json::from_slice(&std::fs::read(&routes).expect("changed function inventory")) + .unwrap(); + assert_eq!(changed["gatewayDigest"], inventory["gatewayDigest"]); + assert_eq!(changed["pages"], inventory["pages"]); + assert_eq!(changed["modules"][1]["signIns"], json!(["reviewer"])); + assert_ne!(changed["signInDigest"], inventory["signInDigest"]); + + std::fs::write(&runtime, &runtime_source).expect("restore literal test fixture"); + assert_eq!(verify().0, 0); + assert_eq!(std::fs::read(&routes).expect("restored inventory"), first); + for (field, deferred) in [ ( "module sign-ins", runtime_source.replace( " audience: person\n", - " audience: person\n signIns: [citizen, '${MODULE_SIGN_IN}']\n", + " audience: person\n signIns: [citizen, reviewer, '${MODULE_SIGN_IN}']\n", ), ), ( @@ -392,7 +443,14 @@ fn gateway_inventory_requires_the_exact_verified_assembly() { ] { assert_ne!(deferred, runtime_source); std::fs::write(&runtime, deferred).expect("deferred runtime"); - assert_eq!(verify().0, 1, "refuse deferred {field}"); + let (exit, _, error) = verify(); + assert_eq!(exit, 1, "refuse deferred {field}"); + let pointer = if field == "module sign-ins" { + "/modules/0/signIns" + } else { + "/pages/0/signIn" + }; + assert!(error.contains(pointer), "{error}"); assert_eq!(std::fs::read(&routes).expect("retained inventory"), first); } std::fs::write(&runtime, &runtime_source).expect("restore literal test fixture"); @@ -455,13 +513,20 @@ fn gateway_inventory_requires_the_exact_verified_assembly() { assert_eq!(verify().0, 1); assert_eq!(std::fs::read(&routes).expect("retained inventory"), first); - let unsafe_page = runtime_source.replace("/apply/", "/apply;/"); - assert_ne!(unsafe_page, runtime_source); - std::fs::write(&runtime, unsafe_page).expect("runtime with broader page prefix"); - let (exit, _, stderr) = assemble(); - assert_eq!(exit, 0, "{stderr}"); - assert_eq!(verify().0, 1, "refuse a page path that live checks reject"); - assert_eq!(std::fs::read(&routes).expect("retained inventory"), first); + for (prefix, changed) in [ + ("page", runtime_source.replace("/apply/", "/apply;/")), + ( + "module", + runtime_source.replace("/api/functions/", "/api/functions;/"), + ), + ] { + assert_ne!(changed, runtime_source); + std::fs::write(&runtime, changed).expect("runtime with a broader route prefix"); + let (exit, _, stderr) = assemble(true); + assert_eq!(exit, 0, "{stderr}"); + assert_eq!(verify().0, 1, "refuse unsafe {prefix} path"); + assert_eq!(std::fs::read(&routes).expect("retained inventory"), first); + } } #[test] diff --git a/deploy/examples/business-registration/README.md b/deploy/examples/business-registration/README.md index f770c98329..f0e58f1a3e 100644 --- a/deploy/examples/business-registration/README.md +++ b/deploy/examples/business-registration/README.md @@ -3,7 +3,7 @@ Run the business-registration preview's compiled function and static page with Registry Session, Envoy, ThunderID, BReg and PostgreSQL. The application opens at `https://127.0.0.1:8443/apply/`. Use a disposable project and synthetic -registrar. The example uses production posture and verified TLS with loopback +registrars. The example uses production posture and verified TLS with loopback host bindings. The browser receives an opaque Session cookie. Envoy checks it and supplies @@ -67,7 +67,7 @@ package receipt. | `thunderid/bootstrap.yaml` | A copy of [thunderid.yaml](thunderid.yaml), used once with writable backing stores | | `thunderid/deployment.yaml` | The same ThunderID base plus the generated store settings, used by the issuer after setup | | `thunderid/bootstrap-secrets/` | `DB_CONFIG_PASSWORD` and `ADMIN_PASSWORD` for the one-shot setup | -| `thunderid/secrets/` | `DB_CONFIG_PASSWORD`, `REGISTRAR_CLIENT_SECRET`, and `REGISTRAR_PASSWORD` for serving | +| `thunderid/secrets/` | `DB_CONFIG_PASSWORD`, `REGISTRAR_CLIENT_SECRET`, `REGISTRAR_PASSWORD`, and `SECOND_REGISTRAR_PASSWORD` for serving | | `thunderid/resources/`, `thunderid/front-gateway/`, `thunderid/identity-receipt.json` | Output of identity generation | | `gateway/envoy.json` | Reviewed complete Envoy configuration from the matching Session CLI | | `gateway-checked/`, `relay/`, `breg/audit/`, `session/audit/` | Empty private directories owned by the instance UID | @@ -76,7 +76,8 @@ The Session client secret equals `REGISTRAR_CLIENT_SECRET`. Both ThunderID `DB_CONFIG_PASSWORD` files carry the value in `postgres/thunderid-password`. The PostgreSQL files must be readable by the image's UID 999 and the ThunderID secrets by UID 10001. Give private keys and secret files mode 0600. -Use distinct random values for admin, registrar, database and audit credentials. +Use distinct random values for admin, both registrar passwords, database and +audit credentials. BReg URLs target `postgres:5432`; runtime and migration use different roles and passwords and point at the same registry database. BReg's CA file carries `postgres-ca.pem`. Configure the local browser to resolve @@ -157,7 +158,8 @@ done ``` The ThunderID setup job creates the built-in password flow first. The serving -issuer then loads the registrar app and user from the generated resources. +issuer then loads the registrar app and two synthetic users from the generated +resources. Before BReg starts, a one-shot checks the issuer's HTTPS discovery document and signing keys from BReg's network namespace. The setup containers are for fresh state. PostgreSQL data and ThunderID signing @@ -174,5 +176,25 @@ refusals, the sign-in redirect, and Session and origin refusals. Then open register a synthetic business. The page should show its Record ID from BReg. Verify the Record through the same BReg route and registrar session. +For the two-person browser check, use a Playwright installation with Chromium +and set `PLAYWRIGHT_MODULE` to the absolute path of its module entry point. Set +`REFERENCE_TEST_CHROMIUM` if you use a separately installed Chromium executable. +Set `REFERENCE_TEST_PASSWORD_DIR` to a private directory containing owner-only +copies of the two synthetic registrar password files. The check pins the +fixture certificates and resolves the issuer to loopback inside Chromium. + +```bash +node "$RECIPE/tests/browser.mjs" \ + "$PLAYWRIGHT_MODULE" "$REFERENCE_CONFIG" "$REFERENCE_TEST_PASSWORD_DIR" "$BUSINESS_BUNDLE" +``` + +The test signs in two distinct registrars for the central office in separate +browser contexts with one BReg audience. Each uses the frozen page to register +a business and reads back its exact BReg Record. The test signs out the first +registrar through a top-level form and verifies that the old session cookie +is refused, the protected page asks for sign-in again, and the second registrar +can still read its Record. It checks application requests for browser-sent +Authorization headers throughout. + Release-candidate smoke wiring, published Session and Coordinator images, and the `rstack dev` route-parity gate are v0.52 work. diff --git a/deploy/examples/business-registration/identity-deployment.yaml b/deploy/examples/business-registration/identity-deployment.yaml index 43a47ebd08..8cc5566963 100644 --- a/deploy/examples/business-registration/identity-deployment.yaml +++ b/deploy/examples/business-registration/identity-deployment.yaml @@ -26,3 +26,13 @@ users: grants: - product: breg accessProfiles: [business-registrar] + - id: reference-registrar-two + username: reference-registrar-two + email: reference-registrar-two@example.invalid + passwordRef: secret:env/SECOND_REGISTRAR_PASSWORD + claims: + registry_actor_kind: human + registry_office: central + grants: + - product: breg + accessProfiles: [business-registrar] diff --git a/deploy/examples/business-registration/tests/browser.mjs b/deploy/examples/business-registration/tests/browser.mjs new file mode 100644 index 0000000000..e2a7a5a043 --- /dev/null +++ b/deploy/examples/business-registration/tests/browser.mjs @@ -0,0 +1,207 @@ +import assert from 'node:assert/strict' +import { createHash, randomUUID, X509Certificate } from 'node:crypto' +import { readFile } from 'node:fs/promises' +import { isAbsolute, join } from 'node:path' +import { pathToFileURL } from 'node:url' + +const [playwright, config, passwords, bundle] = process.argv.slice(2) +if (![playwright, config, passwords, bundle].every(path => path && isAbsolute(path))) { + throw new Error('Pass absolute paths to the Playwright module, reference inputs, test passwords, and frozen bundle.') +} + +const origin = 'https://127.0.0.1:8443' +const issuer = 'https://identity.reference.test:9443' +const apply = origin + '/apply/' +const cookieName = '__Host-registry-session' +const accessProfile = 'business-registrar' +const registrars = [ + { username: 'reference-registrar', password: 'REGISTRAR_PASSWORD' }, + { username: 'reference-registrar-two', password: 'SECOND_REGISTRAR_PASSWORD' }, +] +const identity = JSON.parse(await readFile(join(config, 'thunderid', 'identity-receipt.json'), 'utf8')) +const pins = await Promise.all(['app', 'issuer'].map(async name => { + const certificate = new X509Certificate(await readFile(join(config, name + '-tls', name + '.crt'))) + return createHash('sha256').update(certificate.publicKey.export({ type: 'spki', format: 'der' })).digest('base64') +})) +const { chromium } = await import(pathToFileURL(playwright)) +const browser = await chromium.launch({ + executablePath: process.env.REFERENCE_TEST_CHROMIUM, + args: [ + '--host-resolver-rules=MAP identity.reference.test 127.0.0.1', + '--no-proxy-server', + '--ignore-certificate-errors-spki-list=' + pins.join(','), + ], +}) +const authorizationHeaders = [] + +async function startRegistrar(person) { + const context = await browser.newContext() + const page = await context.newPage() + page.setDefaultTimeout(15_000) + page.on('request', request => { + if (new URL(request.url()).origin === origin) authorizationHeaders.push(request.headerValue('authorization')) + }) + await page.goto(apply) + await page.waitForURL(url => url.origin === issuer) + await page.getByRole('textbox', { name: /username/i }).fill(person.username) + await page.locator('input[type=password]').fill((await readFile(join(passwords, person.password), 'utf8')).trim()) + await page.getByRole('button', { name: /sign in/i }).click() + await page.waitForURL(apply) + const { signIn, claims } = await sessionIdentity(page) + assert.equal(signIn, 'registrar') + assert.ok(typeof claims?.sub === 'string' && claims.sub.length > 0) + assert.equal(claims.sub, identity.users[person.username].sub) + return { context, page, subject: claims.sub } +} + +async function sessionIdentity(page) { + return page.evaluate(async () => { + const response = await fetch('/session/me') + return response.ok ? response.json() : {} + }) +} + +async function checkAssets(page) { + const manifest = JSON.parse(await readFile(join(bundle, 'manifest.json'), 'utf8')) + const assets = {} + for (const [file, suffix] of [['index.html', ''], ['app.js', 'app.js'], ['service.css', 'service.css']]) { + const expected = createHash('sha256').update(await readFile(join(bundle, manifest.staticOutput, file))).digest('hex') + const actual = await page.evaluate(async path => { + const response = await fetch(path) + const hash = new Uint8Array(await crypto.subtle.digest('SHA-256', await response.arrayBuffer())) + return { status: response.status, digest: Array.from(hash, byte => byte.toString(16).padStart(2, '0')).join('') } + }, '/apply/' + suffix) + assert.equal(actual.status, 200) + assert.equal(actual.digest, expected) + assets[file] = actual.digest + } + return assets +} + +async function register(page, name) { + const legalName = 'Synthetic business for ' + name + const registrationNumber = 'LOGOUT-' + randomUUID().slice(0, 8) + await page.locator('#legal-name').fill(legalName) + await page.locator('#registration-number').fill(registrationNumber) + const response = page.waitForResponse(item => + item.url() === origin + '/api/functions/register-business' && item.request().method() === 'POST') + await page.getByRole('button', { name: 'Register business', exact: true }).click() + const submitted = await response + assert.equal(submitted.status(), 200) + const { recordId } = await submitted.json() + assert.match(recordId, /^[0-9a-f-]{36}$/i) + await page.getByRole('heading', { name: 'Business registered' }).waitFor() + assert.equal(await page.locator('#record-id').textContent(), recordId) + return { recordId, legalName, registrationNumber, registeringOffice: 'central' } +} + +function recordPath(recordId) { + return '/registry/businesses/v1/records/businesses/' + encodeURIComponent(recordId) +} + +async function readRecord(page, recordId) { + return page.evaluate(async ({ path, profile }) => { + const response = await fetch(path, { + cache: 'no-store', + headers: { 'Registry-Client': 'page', 'Registry-Access-Profile': profile }, + }) + return { status: response.status, body: await response.json() } + }, { path: recordPath(recordId), profile: accessProfile }) +} + +async function navigateToRecord(page, recordId) { + // The signed-out document's CSP forbids fetch. Navigate with the same page binding instead. + await page.setExtraHTTPHeaders({ + 'Registry-Client': 'page', + 'Registry-Access-Profile': accessProfile, + 'Cache-Control': 'no-cache', + }) + try { + return await page.goto(origin + recordPath(recordId)) + } finally { + await page.setExtraHTTPHeaders({}) + } +} + +async function assertOwnRecord(page, expected) { + const { status, body } = await readRecord(page, expected.recordId) + assert.equal(status, 200) + const { recordId, domainData } = body.data + const { legalName, registrationNumber, registeringOffice } = domainData + assert.deepEqual({ recordId, legalName, registrationNumber, registeringOffice }, expected) +} + +async function signOut(page) { + stage = 'submit the first registrar sign-out form' + const response = page.waitForResponse(item => + item.url() === origin + '/session/sign-out' && item.request().method() === 'POST') + // The frozen page is unchanged. Submit a top-level form as a service's own page would. + await page.evaluate(() => { + const form = document.createElement('form') + form.method = 'post' + form.action = '/session/sign-out' + const button = document.createElement('button') + button.textContent = 'Sign out for acceptance test' + form.append(button) + document.body.append(form) + }) + await page.getByRole('button', { name: 'Sign out for acceptance test' }).click() + assert.equal((await response).status(), 303) + stage = 'return from the issuer to the signed-out page' + await page.waitForURL(origin + '/session/signed-out') +} + +let stage = 'sign in two registrars' +let report +try { + const first = await startRegistrar(registrars[0]) + const second = await startRegistrar(registrars[1]) + assert.notEqual(first.subject, second.subject) + stage = 'verify assets and register both businesses' + const assetSha256 = await checkAssets(first.page) + const firstRecord = await register(first.page, registrars[0].username) + const secondRecord = await register(second.page, registrars[1].username) + assert.notEqual(firstRecord.recordId, secondRecord.recordId) + + stage = 'verify both exact BReg readbacks' + await assertOwnRecord(first.page, firstRecord) + await assertOwnRecord(second.page, secondRecord) + + stage = 'sign out the first registrar and refuse its old session' + const cookie = (await first.context.cookies(origin)).find(item => item.name === cookieName) + assert.ok(cookie?.secure && cookie.httpOnly) + await signOut(first.page) + stage = 'refuse the first registrar without a session cookie' + assert.ok(!(await first.context.cookies(origin)).some(item => item.name === cookieName)) + assert.equal((await navigateToRecord(first.page, firstRecord.recordId)).status(), 401) + stage = 'refuse the first registrar with the stale cookie' + await first.context.addCookies([cookie]) + const stale = await navigateToRecord(first.page, firstRecord.recordId) + const sentCookie = await stale.request().headerValue('cookie') + assert.ok(sentCookie?.split(';').some(item => item.trim() === cookie.name + '=' + cookie.value)) + assert.equal(stale.status(), 401) + assert.equal(await stale.headerValue('registry-session-answer'), '1') + assert.equal((await stale.json()).code, 'session.expired') + stage = 'require a new issuer sign-in for the protected page' + await first.page.goto(apply) + await first.page.waitForURL(url => url.origin === issuer) + await first.page.getByRole('textbox', { name: /username/i }).waitFor() + + stage = 'verify that the second registrar is still signed in' + assert.equal((await sessionIdentity(second.page)).claims?.sub, second.subject) + await assertOwnRecord(second.page, secondRecord) + assert.ok((await Promise.all(authorizationHeaders)).every(value => value === null)) + report = { + distinctSubjects: true, separateContexts: true, assetSha256, formSubmissions: [200, 200], + owningRecordReads: [200, 200], + first: { signOut: 303, recordAfterSignOut: 401, staleCookieSent: true, staleCookie: 401, signInRequired: true }, + second: { sameSubjectAfterFirstSignOut: true, owningRead: 200 }, + noBrowserAuthorizationHeader: true, + } +} catch (error) { + console.error('Reference browser test stopped at ' + stage + ' (' + error.name + ').') + process.exitCode = 1 +} finally { + await browser.close() +} +if (report) console.log(JSON.stringify(report, null, 2)) diff --git a/deploy/examples/business-registration/tests/test_compose.py b/deploy/examples/business-registration/tests/test_compose.py index cdf540f87c..c8fc4a380f 100644 --- a/deploy/examples/business-registration/tests/test_compose.py +++ b/deploy/examples/business-registration/tests/test_compose.py @@ -82,3 +82,11 @@ def test_breg_waits_for_the_issuer_from_its_own_namespace(self): self.services["breg"]["depends_on"]["issuer-ready"]["condition"], "service_completed_successfully" ) self.assertTrue(all(mount["read_only"] for mount in readiness["volumes"])) + + def test_browser_registrars_have_separate_passwords_for_the_supported_office(self): + users = (EXAMPLE / "identity-deployment.yaml").read_text().split("\nusers:\n", 1)[1] + first, second = users.split(" - id: reference-registrar-two\n") + self.assertIn("secret:env/REGISTRAR_PASSWORD", first) + self.assertIn("registry_office: central", first) + self.assertIn("secret:env/SECOND_REGISTRAR_PASSWORD", second) + self.assertIn("registry_office: central", second) diff --git a/deploy/examples/business-registration/thunderid.sh b/deploy/examples/business-registration/thunderid.sh index 2116e5d375..2383b04cea 100644 --- a/deploy/examples/business-registration/thunderid.sh +++ b/deploy/examples/business-registration/thunderid.sh @@ -21,6 +21,7 @@ case "${1:-}" in serve) read_secret REGISTRAR_CLIENT_SECRET read_secret REGISTRAR_PASSWORD + read_secret SECOND_REGISTRAR_PASSWORD exec ./start.sh ;; setup) diff --git a/docs/site/src/content/docs/configure/casework-directory.mdx b/docs/site/src/content/docs/configure/casework-directory.mdx index 3b393598df..e1bd101070 100644 --- a/docs/site/src/content/docs/configure/casework-directory.mdx +++ b/docs/site/src/content/docs/configure/casework-directory.mdx @@ -36,15 +36,16 @@ Only an [access profile](../../reference/glossary/#access-profile) with the `adm ## Seed it for the development run -A new directory is empty. The run's journey, `dev-journeys.yaml`, seated the team with the same -bootstrap call a deployment uses, as the plan's `administrator` person: - -```yaml title="dev-journeys.yaml" test-excerpt="tutorial-work/casework/dev-journeys.yaml" -body: - teamId: decisions-team - staff: [{issuer: https://identity.casework.example.test, subject: staff}] - supervisors: [] - queueId: decisions +A new directory is empty. In the tutorial, the plan's `administrator` seated the team +using the same bootstrap call a deployment uses. The body is in `directory-bootstrap.json`. + +```json title="directory-bootstrap.json" test-excerpt="tutorial-work/casework/directory-bootstrap.json" +{ + "teamId": "decisions-team", + "queueId": "decisions", + "staff": [{"issuer": "https://identity.casework.example.test", "subject": "staff"}], + "supervisors": [] +} ``` The body names one team and the one declared queue it serves. Its staff and supervisors are an @@ -95,7 +96,7 @@ A deployment's first administrator creates the first team with one call, naming } ``` -```sh test-skip="the run's journey already seeded its directory, so revision 0 is refused" +```sh test-skip="the tutorial already bootstrapped this directory, so revision 0 is refused" curl -sS --fail-with-body --header @"$(headers_for administrator)" \ --header 'Content-Type: application/json' \ --header 'If-Match: "0"' \ diff --git a/docs/site/src/content/docs/configure/casework.mdx b/docs/site/src/content/docs/configure/casework.mdx index 9142040947..435789efbb 100644 --- a/docs/site/src/content/docs/configure/casework.mdx +++ b/docs/site/src/content/docs/configure/casework.mdx @@ -27,8 +27,8 @@ still going. ## Read the project files -`casework.yaml` is the policy. `dev.yaml` and `dev-journeys.yaml`, which you wrote in the -tutorial, describe the local run for `rstack dev`. `fixtures/` holds the cases `test` proves, and +`casework.yaml` is the policy. The generated `dev.yaml` and `dev-journeys.yaml` describe the +local run for `rstack dev`. `fixtures/` holds the cases `test` proves, and `runtime.example.yaml` is a starting runtime configuration for a deployment. `.casework/schemas/` holds the JSON Schemas your editor reads through each file's first-line comment. Check the project as it stands: diff --git a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx index efb7fb5768..822dd5c170 100644 --- a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx +++ b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx @@ -516,7 +516,8 @@ Put the issuer's JWKS endpoint in `externalJwksUri` on the same numeric loopback Set `statusUrl` to the Casework loopback origin and `tokenEndpoint` to the external issuer's token endpoint. Set `statusClient` to its separate status reader, `statusKeyRef` to its owner-only key -under `fixture/` and `statusResource` to the reader's Casework resource. Run `rstack dev check` +under `fixture/` and `statusResource` to the reader's Casework resource. If the run also attaches a +Base Registry Engine task grant, register a separate status client and key for each product. Run `rstack dev check` before `rstack dev start`. Scheduling checks the grant's current status with Casework before booking and refuses the operation if it cannot verify that status. diff --git a/docs/site/src/content/docs/configure/session.mdx b/docs/site/src/content/docs/configure/session.mdx index 46d48ebb99..b1a9b5899a 100644 --- a/docs/site/src/content/docs/configure/session.mdx +++ b/docs/site/src/content/docs/configure/session.mdx @@ -296,12 +296,17 @@ registry-session --runtime-config /etc/registry-session/runtime.yaml gateway env --checked-route breg ``` -The export checks the standalone Envoy JSON and records the selected BReg product route, -its admitted sign-in kinds and the page bindings. Write the sign-in names literally and keep -page paths to letters, digits and `/._:~-`. -The `gatewayDigest` is SHA-256 over the exact Envoy JSON file bytes, including whitespace. -Use the inventory with those bytes. Envoy and Session check live requests, and the product -authorizes the operation. +The export records every configured module and page with its sign-in bindings. It names the +selected BReg module for browser client generation. Routes use the longest matching prefix +at a path segment boundary. Write sign-in names literally and keep the route paths to +letters, digits and `/._:~-`. The selected BReg prefix omits `~` and ends with a slash. + +The `gatewayDigest` covers the exact Envoy JSON file bytes, including whitespace. The +`signInDigest` covers the compact JSON object containing `modules` and `pages`, with +object keys in lexicographic order and array order preserved. Both use SHA-256. After +a runtime change, re-export against the assembly and use the fresh inventory. +Deploy the checked assembly with its matching runtime file. +Envoy and Session check live requests, and the product authorizes the operation. {/* Evidence: crates/registry-session/src/gateway/verify.rs, validate_checked_transport, verify_checked_transport, write_verified_route_inventory; diff --git a/docs/site/src/content/docs/security/session.mdx b/docs/site/src/content/docs/security/session.mdx index 20ebaae20f..799cad9775 100644 --- a/docs/site/src/content/docs/security/session.mdx +++ b/docs/site/src/content/docs/security/session.mdx @@ -5,7 +5,7 @@ status: current owner: registry-docs source_repos: - registry-stack -last_reviewed: "2026-11-27" +last_reviewed: "2026-12-01" doc_type: explanation locale: en standards_referenced: [] @@ -78,12 +78,17 @@ A module's `signIns` list routes kinds of sessions, but grants no product permis A private bind alone does not establish that restriction. 4. Regenerate the gateway fragments after every runtime change. Splice them and verify the assembled static configuration before deploying it. + For a checked standalone assembly, regenerate the assembly and re-export the inventory after + every runtime change. The inventory describes every configured module and page and names one + selected browser binding. Its two digests bind the Envoy JSON bytes and the sign-in projection. + Envoy and Session enforce the live routing and sign-in policy. 5. Terminate TLS in front of the public listener. The service accepts `development-loopback` only in development posture. Use it for local HTTP in a browser that supports `Secure` cookies on loopback. For checked browser route export, use the dedicated loopback HTTPS Envoy assembly and deploy the verified configuration. The browser verifies the ingress certificate. The operator controls the gateway namespace, private Session sockets and upstream endpoints. + The standalone HTTPS assembly requires TLS 1.2 or later. 6. Name every host HTTP filter in `gateway.hostFilters`. Retain a filter on a module or page only through `upstream.keepHostFilters`. A retained filter must preserve the path, route cache and authorisation header. diff --git a/docs/site/src/content/docs/tutorials/first-casework.mdx b/docs/site/src/content/docs/tutorials/first-casework.mdx index 4b118a1ad1..ea91b08158 100644 --- a/docs/site/src/content/docs/tutorials/first-casework.mdx +++ b/docs/site/src/content/docs/tutorials/first-casework.mdx @@ -115,28 +115,8 @@ issuer and subject in `casework.yaml`. {/* Evidence: crates/registry-caseworkctl/src/project.rs, STANDALONE_YAML, development_plan. */} -A new Casework directory has no staff. Replace `dev-journeys.yaml` to have the administrator -seat one team on the `decisions` queue and put the person `staff` in it: - -```yaml title="dev-journeys.yaml" test-file -apiVersion: id.registrystack.org/formats/rstack/journeys/v1alpha1 -kind: RStackJourneys -journeys: - - id: staff-the-queue - steps: - - id: staff-the-queue - product: casework - as: administrator - method: POST - path: /v1/directory/bootstrap - headers: {If-Match: '"0"', Idempotency-Key: staff-the-queue} - body: - teamId: decisions-team - staff: [{issuer: https://identity.casework.example.test, subject: staff}] - supervisors: [] - queueId: decisions - expect: {status: 200} -``` +Keep the generated `dev.yaml` and `dev-journeys.yaml`. The starter journey checks the +running service. You'll staff the empty directory with the administrator after startup. ## Start the run @@ -150,7 +130,7 @@ run_id="$(jq -r .run_id run.json)" casework_url="$(jq -r .products.casework run.json)" ``` -PostgreSQL runs in Docker, and the run has seated one staff team. Its state, keys and logs live in +PostgreSQL runs in Docker. Its state, keys and logs live in the run's own owner-only directory, outside your project. Each call below needs a short-lived token for one of the plan's people. This function asks for one and prints the header file to pass to curl: @@ -163,6 +143,33 @@ headers_for() { {/* Evidence: crates/registry-rstack-dev/src/lib.rs; crates/registry-rstack/tests/dev_run.rs, casework_alone_runs_end_to_end; products/casework/examples/standalone-decision/dev.yaml. */} +## Staff the review queue + +Save the directory bootstrap as `directory-bootstrap.json`. It seats one team on +the `decisions` queue and names the staff person's issuer and subject from `dev.yaml`. + +```json title="directory-bootstrap.json" test-file +{ + "teamId": "decisions-team", + "queueId": "decisions", + "staff": [{"issuer": "https://identity.casework.example.test", "subject": "staff"}], + "supervisors": [] +} +``` + +Send it as the administrator. The `If-Match` header names revision zero, the empty directory. + +```sh +curl -sS --fail-with-body --header @"$(headers_for administrator)" \ + --header 'Content-Type: application/json' \ + --header 'If-Match: "0"' \ + --header 'Idempotency-Key: staff-the-queue' \ + --data @directory-bootstrap.json "$casework_url/v1/directory/bootstrap" +``` + +{/* Evidence: crates/registry-casework/src/http.rs, bootstrap(); + crates/registry-casework-core/src/http.rs, BootstrapDirectoryRequest. */} + ## Submit a ReviewRequest Save the request. It names the policy, the subject under review, and the snapshot a reviewer will diff --git a/products/platform/examples/session/checked-routes.json b/products/platform/examples/session/checked-routes.json index 3b2033bfae..8bfb0ee170 100644 --- a/products/platform/examples/session/checked-routes.json +++ b/products/platform/examples/session/checked-routes.json @@ -1,6 +1,6 @@ { "apiVersion": "id.registrystack.org/formats/platform/session-route-inventory/v1alpha1", - "gatewayDigest": "sha256:56635e6d5a33bb8026b95d06912c4be2a9e725ce66b389126830c3c31d69bcae", + "gatewayDigest": "sha256:32c5a92f7b5f7f446b196f96cfab1d856a395cb8587be13dc44de4330ea95091", "kind": "PlatformSessionRouteInventory", "modules": [ { @@ -11,6 +11,15 @@ "signIns": [ "registrar" ] + }, + { + "id": "functions", + "prefix": "/api/functions/", + "prefixRewrite": "/functions/", + "product": "breg", + "signIns": [ + "registrar" + ] } ], "pages": [ @@ -19,5 +28,7 @@ "signIn": "registrar" } ], - "publicOrigin": "https://127.0.0.1:8443" + "publicOrigin": "https://127.0.0.1:8443", + "selectedModule": "businesses", + "signInDigest": "sha256:7c31878d23b2a2d12e0766bafa78f8c220d4d05481b1dcc36650030095552ce9" } diff --git a/products/platform/generated/session-runtime/session-route-inventory.v1alpha1.schema.json b/products/platform/generated/session-runtime/session-route-inventory.v1alpha1.schema.json index 2fecc18432..c43ded35a7 100644 --- a/products/platform/generated/session-runtime/session-route-inventory.v1alpha1.schema.json +++ b/products/platform/generated/session-runtime/session-route-inventory.v1alpha1.schema.json @@ -10,6 +10,27 @@ "pattern": "^[a-z][a-z0-9_-]{0,63}$", "type": "string" }, + "ModuleProduct": { + "description": "Maintained products a module can declare, independent of the module's id.", + "enum": [ + "adapter", + "breg", + "casework", + "coordinator", + "documents", + "evidence", + "messaging", + "render", + "scheduling" + ], + "type": "string" + }, + "RewritePrefix": { + "maxLength": 256, + "minLength": 1, + "pattern": "^/(?!.*[%\\\\?#])[!-~]*$", + "type": "string" + }, "Url": { "description": "An absolute http or https URL with a host preserved as written, no user information, and no backslash, whitespace or control character. DNS case and equivalent IPv6 literals are permitted.", "format": "uri", @@ -21,7 +42,7 @@ "$id": "https://id.registrystack.org/schemas/platform/session-route-inventory/session-route-inventory.v1alpha1.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "One Base Registry Engine browser route and its page bindings from an exact, verified Envoy JSON file.", + "description": "Every configured module and page in a verified Envoy assembly, with one selected Base Registry Engine browser binding. Routes use the longest matching prefix at a path segment boundary.", "properties": { "apiVersion": { "const": "id.registrystack.org/formats/platform/session-route-inventory/v1alpha1", @@ -43,39 +64,35 @@ }, "prefix": { "maxLength": 256, - "pattern": "^/(?:(?!\\.\\.?/)[A-Za-z0-9._:-]+/)+$", + "pattern": "^/(?:(?!\\.\\.?(?:/|$))[A-Za-z0-9._:~-]+(?:/|$))+$", "type": "string" }, "prefixRewrite": { - "const": "/", - "type": "string" + "$ref": "#/$defs/RewritePrefix" }, "product": { - "const": "breg", - "type": "string" + "$ref": "#/$defs/ModuleProduct" }, "signIns": { "items": { "$ref": "#/$defs/LocalId" }, "maxItems": 64, - "minItems": 1, "type": "array", "uniqueItems": true } }, "required": [ "id", - "product", "prefix", - "prefixRewrite", "signIns" ], "type": "object" }, - "maxItems": 1, + "maxItems": 64, "minItems": 1, - "type": "array" + "type": "array", + "uniqueItems": true }, "pages": { "items": { @@ -103,6 +120,12 @@ "publicOrigin": { "$ref": "#/$defs/Url", "pattern": "^https://127(?:\\.[0-9]{1,3}){3}(?::[0-9]{1,5})?$" + }, + "selectedModule": { + "$ref": "#/$defs/LocalId" + }, + "signInDigest": { + "$ref": "#/$defs/Digest" } }, "required": [ @@ -110,6 +133,8 @@ "kind", "publicOrigin", "gatewayDigest", + "signInDigest", + "selectedModule", "modules", "pages" ], diff --git a/products/platform/journeys/README.md b/products/platform/journeys/README.md index de96d0d80f..99ad1feebf 100644 --- a/products/platform/journeys/README.md +++ b/products/platform/journeys/README.md @@ -108,6 +108,17 @@ and grant exchange, commit a hold and an appointment, and verify a signed appointment hook correlated to that appointment. A skipped hook cannot satisfy the ThunderID cell. +Run the same composed check with a managed Scheduling runtime by passing +`--issuer thunderid --product scheduling --scheduling-runtime managed` to +`own-provider.sh`, using a prebuilt `rstack`, `schedulingctl`, and the composed +fixture tools. Use `expected-failures-thunderid.yaml` for the strict run. The +managed dev plan binds the named `task-agent` client to the exact Casework +assertion issuer and uses a separate status client to check live Casework +grant status. The journey checks the missing and wrong authority, an ordinary +bearer without a grant, and the signed hook for the confirmed appointment. +The generic `rstack-dev.sh` Scheduling smoke reports its hook as unexercised +without this composed fixture. + ## Adapter promotion The Adapter facade uses loopback PostgreSQL and a disposable Basic Auth source. @@ -164,14 +175,16 @@ T1 is captured at the first successful authenticated read. If the local journey's first operation is a write, its authenticated readback can provide T1. T2 is captured after the runner has verified the write across a restart and checked delivery for paths that exercise a hook. The current local T2 -receipts cover BReg, Coordinator, and Messaging. +receipts cover BReg, Coordinator, Documents, and Messaging. Threshold outcomes are report-only in CI. The functional ratchet controls journey acceptance, and comparison code errors fail the harness. Promote uses its functional ratchet. Its `productionRefusals` field counts distinct codes matched by the initial production startup and check. It is `null` until the comparison was measured, and `0` when the comparison found no refusals. -The existing `total.refusalsMet` counts refusals across the cell. +`total.refusalsMet` counts blocking or explicitly counted refusals across the +cell, including matched production refusals. An expected HTTP refusal that +satisfies a negative control stays in the step receipt as a passing assertion. The stock Keycloak BReg editor requests an optional client scope for the fixture's static claims. Keycloak keeps the issued `scope` claim unchanged. diff --git a/products/platform/journeys/concepts.yaml b/products/platform/journeys/concepts.yaml index c1f2249b5a..570f005e74 100644 --- a/products/platform/journeys/concepts.yaml +++ b/products/platform/journeys/concepts.yaml @@ -58,6 +58,8 @@ concepts: meaning: The run identifier and its time to live. - id: header-file meaning: The file that holds a ready authorisation header. + - id: idempotency-key + meaning: The key that identifies the original submission for a receipt read. - id: short-lived-token meaning: A token with a five minute lifetime. - id: runtime-file diff --git a/products/platform/journeys/lib.sh b/products/platform/journeys/lib.sh index a96c13d074..bc226f9649 100644 --- a/products/platform/journeys/lib.sh +++ b/products/platform/journeys/lib.sh @@ -1772,6 +1772,31 @@ journey_request_contract() { done } +# assert_signed_hook_acceptance LOG_FILE EXPECTED_PATH EXPECTED_TYPE: verify +# the hook receiver logged one value-free acceptance record proving Standard +# Webhooks HMAC-SHA256 receiver authority without inbound credential headers. +assert_signed_hook_acceptance() { + local log_file=$1 expected_path=$2 expected_type=$3 + # shellcheck disable=SC2016 # jq binds its own variables + jq -e -s --arg path "$expected_path" --arg type "$expected_type" ' + length == 1 + and (.[0] | + .event == "signed-hook-accepted" + and .path == $path + and .eventType == $type + and .signatureVerified == true + and .receiverAuthority == "standard-webhooks-hmac-sha256" + and .inboundCredentialHeaders == false + and (.headerNames | type == "array") + and (.headerNames | index("webhook-signature") != null) + and (.headerNames | index("authorization") == null) + and (.headerNames | index("registry-source-authorization") == null) + and (.headerNames | index("proxy-authorization") == null) + and (.headerNames | index("cookie") == null) + ) + ' "$log_file" >/dev/null +} + # The managed sink authenticates the delivery. Correlate its captured envelope # and signing headers to the operation, without accepting forwarded credentials. signed_hook_matches() { @@ -2605,8 +2630,7 @@ journey__cleanup_problem() { _journey_cleanup_failures+="$*"$'\n' } -journey__stop_processes() { - local index pid failed=0 +journey__stop_foreground() { if [[ -n "$_journey_watchdog_pid" ]]; then journey__end_watchdog "$_journey_watchdog_pid" _journey_watchdog_pid='' @@ -2615,6 +2639,10 @@ journey__stop_processes() { journey__terminate "$_journey_foreground_pid" "$JOURNEY_KILL_GRACE" _journey_foreground_pid='' fi +} + +journey__stop_processes() { + local index pid failed=0 for ((index = 0; index < ${#_journey_process_pids[@]}; index++)); do pid=${_journey_process_pids[$index]} [[ -n "$pid" ]] || continue @@ -2761,6 +2789,8 @@ journey__dispose_secrets() { journey__cleanup() { local index failed=0 + # A cancelled step can still be writing the state inspected by its cleanup hook. + journey__stop_foreground for ((index = ${#_journey_cleanup_hooks[@]} - 1; index >= 0; index--)); do if ! "${_journey_cleanup_hooks[$index]}"; then journey__cleanup_problem "cleanup hook ${_journey_cleanup_hooks[$index]} failed" diff --git a/products/platform/journeys/own-provider.sh b/products/platform/journeys/own-provider.sh index 4c57637193..b78bda8c99 100755 --- a/products/platform/journeys/own-provider.sh +++ b/products/platform/journeys/own-provider.sh @@ -421,37 +421,52 @@ journey_at_cleanup stop_thunderid_sessions COMPOSED_MANAGED_RUN='' COMPOSED_MANAGED_ROOT=$SECRETS/scheduling-managed -composed_managed_dev() { - RSTACK_DEV_STATE_DIR="$COMPOSED_MANAGED_ROOT/state" \ - RSTACK_SCHEDULING_BIN="$SERVER_BIN" RSTACK_SCHEDULINGCTL_BIN="$TOOL_BIN" \ - "$COMPOSED_RSTACK_BIN" --install-root "$COMPOSED_MANAGED_ROOT/install" --format json dev "$@" -} - stop_composed_managed_scheduling() { - [[ -n "$COMPOSED_MANAGED_RUN" ]] || return 0 - composed_managed_dev stop "$COMPOSED_MANAGED_RUN" >/dev/null || return 1 + local state=$COMPOSED_MANAGED_ROOT/state run_id=$COMPOSED_MANAGED_RUN run + [[ ! -L "$COMPOSED_MANAGED_ROOT" && ! -L "$state" ]] || return 1 + if [[ -z "$run_id" ]]; then + # A launcher can create state before its startup report returns. + # This private directory belongs to this fixture alone. + for run in "$state/"*; do + [[ "${run##*/}" =~ ^[0-9a-f]{32}$ ]] || continue + [[ -d "$run" && ! -L "$run" && -z "$run_id" ]] || return 1 + run_id=${run##*/} + done + fi + [[ -n "$run_id" ]] || return 0 + run=$state/$run_id + if [[ -L "$run" ]] || + ! RSTACK_DEV_STATE_DIR="$state" RSTACK_SCHEDULING_BIN="$SERVER_BIN" RSTACK_SCHEDULINGCTL_BIN="$TOOL_BIN" \ + "$COMPOSED_RSTACK_BIN" --install-root "$COMPOSED_MANAGED_ROOT/install" --format json dev stop "$run_id" >/dev/null || + [[ -e "$run" || -L "$run" ]]; then + printf 'Managed Scheduling did not stop. Recovery state retained at %s.\n' "$run" >&2 + return 1 + fi COMPOSED_MANAGED_RUN='' } cleanup_composed_managed_scheduling() { - stop_composed_managed_scheduling || return 1 + if ! stop_composed_managed_scheduling; then + journey__cleanup_problem "managed Scheduling recovery state retained at $COMPOSED_MANAGED_ROOT" + return 1 + fi [[ ! -d "$COMPOSED_MANAGED_ROOT" ]] || python3 -c 'import shutil, sys; shutil.rmtree(sys.argv[1])' "$COMPOSED_MANAGED_ROOT" } journey_at_cleanup cleanup_composed_managed_scheduling -composed_managed_start() ( - unset RSTACK_DEV_DATABASE_CA - composed_managed_dev start "$@" -) - start_composed_managed_scheduling() { local _cms_project=$1 _cms_report=$2 _cms_url='' + # rstack start can spend up to 60 seconds stopping its supervisor after TERM. + local JOURNEY_KILL_GRACE=$((JOURNEY_KILL_GRACE < 65 ? 65 : JOURNEY_KILL_GRACE)) IFS= read -r _cms_url <"$ADMIN_URL_FILE" || [[ -n "$_cms_url" ]] || journey_harness_failure "cannot read the disposable PostgreSQL admin URL" - RSTACK_DEV_DATABASE_URL="$_cms_url?sslmode=disable" \ + # env execs rstack in the same PID watched by journey_step. + RSTACK_DEV_DATABASE_URL="$_cms_url?sslmode=disable" RSTACK_DEV_STATE_DIR="$COMPOSED_MANAGED_ROOT/state" \ + RSTACK_SCHEDULING_BIN="$SERVER_BIN" RSTACK_SCHEDULINGCTL_BIN="$TOOL_BIN" \ journey_step hook --timeout 120 --typed "rstack dev start $_cms_project" -- \ - composed_managed_start "$_cms_project" || + env -u RSTACK_DEV_DATABASE_CA "$COMPOSED_RSTACK_BIN" --install-root "$COMPOSED_MANAGED_ROOT/install" \ + --format json dev start "$_cms_project" || journey_harness_failure "managed Scheduling did not start; see $JOURNEY_STEP_STDERR" COMPOSED_MANAGED_RUN=$(jq -er '.run_id | strings | select(test("^[0-9a-f]{32}$"))' "$JOURNEY_STEP_STDOUT") || journey_harness_failure "managed Scheduling start report has no run ID" @@ -2198,31 +2213,6 @@ step_call() { CELL_OVER=1 } -# assert_signed_hook_acceptance LOG_FILE EXPECTED_PATH EXPECTED_TYPE: verify -# the hook receiver logged one value-free acceptance record proving Standard -# Webhooks HMAC-SHA256 receiver authority without inbound credential headers. -assert_signed_hook_acceptance() { - local log_file=$1 expected_path=$2 expected_type=$3 - # shellcheck disable=SC2016 # jq binds its own variables - jq -e -s --arg path "$expected_path" --arg type "$expected_type" ' - length == 1 - and (.[0] | - .event == "signed-hook-accepted" - and .path == $path - and .eventType == $type - and .signatureVerified == true - and .receiverAuthority == "standard-webhooks-hmac-sha256" - and .inboundCredentialHeaders == false - and (.headerNames | type == "array") - and (.headerNames | index("webhook-signature") != null) - and (.headerNames | index("authorization") == null) - and (.headerNames | index("registry-source-authorization") == null) - and (.headerNames | index("proxy-authorization") == null) - and (.headerNames | index("cookie") == null) - ) - ' "$log_file" >/dev/null -} - # assert_wrong_agent_grant_refused ISSUER_BIN TID_ROOT TASK_CONN CLIENT GRANT_ID: # run `journey-issuer grant` for an unintended agent and succeed only when it # exits non-zero, emits no stdout or header file, and reports the exact diff --git a/products/platform/journeys/projects/check-private-postgres.py b/products/platform/journeys/projects/check-private-postgres.py new file mode 100644 index 0000000000..ec575be2e5 --- /dev/null +++ b/products/platform/journeys/projects/check-private-postgres.py @@ -0,0 +1,32 @@ +"""Check both BReg child URL references without reporting credential values.""" + +import json +import sys +from pathlib import Path +from urllib.parse import parse_qs, urlsplit + + +def check(config_path, address): + config = json.loads(config_path.read_text(encoding="utf-8")) + database = config["database"] + if database["transport"] != "private-network-plaintext": + raise ValueError("unexpected PostgreSQL transport") + root = Path(config["secretProviders"]["file"]["root"]).resolve(strict=True) + for role in ("runtime", "migration"): + prefix, name = database[role + "UrlRef"].rsplit("/", 1) + if prefix != "secret:file" or not name: + raise ValueError("expected a local file reference for each database role") + secret = (root / name).resolve(strict=True) + if secret.parent != root: + raise ValueError("database URL file must be inside the run's secret directory") + url = urlsplit(secret.read_text(encoding="utf-8").strip()) + if url.hostname != address or url.port != 5432 or parse_qs(url.query) != {"sslmode": ["disable"]}: + raise ValueError("database role did not pin the expected private endpoint and transport") + + +if __name__ == "__main__": + try: + check(Path(sys.argv[1]), sys.argv[2]) + except (OSError, KeyError, TypeError, ValueError): + raise SystemExit("BReg's generated PostgreSQL roles did not use the checked private Compose transport") from None + print(json.dumps({"transport": "private-network-plaintext", "rolesPinned": ["runtime", "migration"]})) diff --git a/products/platform/journeys/projects/hook-receiver.py b/products/platform/journeys/projects/hook-receiver.py index 3d7a7a2295..fdacbbb3f3 100644 --- a/products/platform/journeys/projects/hook-receiver.py +++ b/products/platform/journeys/projects/hook-receiver.py @@ -62,7 +62,9 @@ def verify_signed_delivery(path, expected_path, headers, body, key, expected_typ return 204, record -def main(port, expected_path, expected_type, key_path, receipt): +def main(port, expected_path, expected_type, key_path, receipt, bind_address="127.0.0.1"): + if bind_address not in ("127.0.0.1", "0.0.0.0"): + raise SystemExit("receiver must bind loopback or the Compose container interface") key = Path(key_path).read_bytes() path = Path(receipt) @@ -105,7 +107,7 @@ def do_POST(self): pending.replace(path) self.reply(204) - with HTTPServer(("127.0.0.1", int(port)), Receiver) as server: + with HTTPServer((bind_address, int(port)), Receiver) as server: server.serve_forever() diff --git a/products/platform/journeys/projects/rstack-attachments.compose.yaml b/products/platform/journeys/projects/rstack-attachments.compose.yaml new file mode 100644 index 0000000000..37b93f249f --- /dev/null +++ b/products/platform/journeys/projects/rstack-attachments.compose.yaml @@ -0,0 +1,29 @@ +services: + db: + image: postgres:18.7@sha256:e754b839f447639b7004895f4d8a4bfcb4e9dbe3a1bc035f27f646562a16fd61 + pull_policy: never + environment: + POSTGRES_PASSWORD_FILE: /run/secrets/db-password + secrets: [db-password] + healthcheck: + test: [CMD, pg_isready, --host, 127.0.0.1, --username, postgres] + interval: 1s + timeout: 1s + retries: 20 + tmpfs: [/var/lib/postgresql] + receiver: + image: mcr.microsoft.com/playwright:v1.60.0-noble@sha256:9bd26ad900bb5e0f4dee75839e957a89ae89c2b7ab1e76050e559790e946b948 + pull_policy: never + user: "${RSTACK_JOURNEY_RECEIVER_USER:?}" + entrypoint: [python3, /receiver.py] + command: ["8109", /events, contact-created, /run/secrets/hook-key, /receipts/event.json, "0.0.0.0"] + ports: ["127.0.0.1::8109"] + volumes: + - "${RSTACK_JOURNEY_RECEIVER_SCRIPT:?}:/receiver.py:ro" + - "${RSTACK_JOURNEY_RECEIVER_RECEIPTS:?}:/receipts" + secrets: [hook-key] +secrets: + db-password: + file: "${RSTACK_JOURNEY_DB_PASSWORD_FILE:?}" + hook-key: + file: "${RSTACK_JOURNEY_HOOK_KEY_FILE:?}" diff --git a/products/platform/journeys/projects/rstack-attachments.sh b/products/platform/journeys/projects/rstack-attachments.sh new file mode 100644 index 0000000000..8ec8e27614 --- /dev/null +++ b/products/platform/journeys/projects/rstack-attachments.sh @@ -0,0 +1,157 @@ +#!/usr/bin/env bash +set -euo pipefail + +ATTACHMENT_COMPOSE_ACTIVE=0 +ATTACHMENT_COMPOSE_PROJECT='' +ATTACHMENT_HOOK_KEY='' +ATTACHMENT_DB_PASSWORD='' +ATTACHMENT_FIXTURE_KEY='' +ATTACHMENT_RECEIPTS='' + +attachment_compose() { + RSTACK_JOURNEY_RECEIVER_USER="$(id -u):$(id -g)" \ + RSTACK_JOURNEY_RECEIVER_SCRIPT="$JOURNEY_LIB_DIR/projects/hook-receiver.py" \ + RSTACK_JOURNEY_RECEIVER_RECEIPTS="$ATTACHMENT_RECEIPTS" \ + RSTACK_JOURNEY_DB_PASSWORD_FILE="$ATTACHMENT_DB_PASSWORD" \ + RSTACK_JOURNEY_HOOK_KEY_FILE="$ATTACHMENT_HOOK_KEY" \ + docker compose --env-file /dev/null --project-name "$ATTACHMENT_COMPOSE_PROJECT" \ + --file "$JOURNEY_LIB_DIR/projects/rstack-attachments.compose.yaml" "$@" +} + +stop_compose_attachments() { + local status=0 + if [[ "$ATTACHMENT_COMPOSE_ACTIVE" == 1 ]]; then + attachment_compose down || status=1 + fi + if [[ -n "$ATTACHMENT_FIXTURE_KEY" && -e "$ATTACHMENT_FIXTURE_KEY" ]]; then + rm -- "$ATTACHMENT_FIXTURE_KEY" || status=1 + fi + return "$status" +} + +prepare_compose_attachments() { + local project=$1 work=$2 origin existing + ATTACHMENT_COMPOSE_PROJECT="$JOURNEY_CONTAINER_PREFIX-attachments-$JOURNEY_RUN_ID" + ATTACHMENT_RECEIPTS=$work/receiver + mkdir -m 700 -- "$ATTACHMENT_RECEIPTS" "$project/fixture" + journey_secret_new compose-hook-key 32 + journey_secret_new compose-db-password 24 + journey_secret_path compose-hook-key ATTACHMENT_HOOK_KEY + journey_secret_path compose-db-password ATTACHMENT_DB_PASSWORD + ATTACHMENT_FIXTURE_KEY=$project/fixture/contact-hmac + install -m 600 -- "$ATTACHMENT_HOOK_KEY" "$ATTACHMENT_FIXTURE_KEY" + + existing=$(docker ps -aq --filter "label=com.docker.compose.project=$ATTACHMENT_COMPOSE_PROJECT") || + journey_harness_failure "cannot check ownership of the disposable Compose project" + [[ -z "$existing" ]] || journey_harness_failure "the Compose project name already exists" + existing=$(docker network ls -q --filter "name=^${ATTACHMENT_COMPOSE_PROJECT}_default$") || + journey_harness_failure "cannot check ownership of the disposable Compose network" + [[ -z "$existing" ]] || journey_harness_failure "the Compose network name already exists" + ATTACHMENT_COMPOSE_ACTIVE=1 + attachment_compose up --wait --wait-timeout 60 || journey_harness_failure "the disposable Compose services did not start" + origin=$(attachment_compose port receiver 8109) || journey_harness_failure "the sibling hook receiver has no port" + [[ "$origin" =~ ^127\.0\.0\.1:[0-9]+$ ]] || journey_harness_failure "the sibling receiver must publish loopback only" + journey_poll 30 -- curl --silent --fail --max-time 2 --output /dev/null "http://$origin/ready" || + journey_harness_failure "the sibling hook receiver did not become ready" + local unsigned + unsigned=$(curl --silent --show-error --max-time 5 --output /dev/null --write-out '%{http_code}' \ + --json '{}' "http://$origin/events") || journey_harness_failure "the unsigned hook control could not reach the receiver" + [[ "$unsigned" == 403 && ! -e "$ATTACHMENT_RECEIPTS/event.json" ]] || + journey_harness_failure "the sibling receiver did not refuse the unsigned control without a capture" + printf '%s\n' 'The sibling receiver refused the unsigned hook with HTTP 403.' + cat >>"$project/dev.yaml" </dev/null || + journey_harness_failure "the sibling hook run unexpectedly started an internal BReg sink" + # shellcheck disable=SC2016 # jq binds $id. + journey_poll 45 -- jq -e --arg id "$expected" ' + .type == "contact-created" and .data.recordId == $id and .data.values.name == "A retained contact"' \ + "$ATTACHMENT_RECEIPTS/event.json" >/dev/null || + journey_harness_failure "the sibling receiver did not capture the signed event for the exact contact" + jq -e --arg id "$expected" 'select(.data.recordId == $id)' "$ATTACHMENT_RECEIPTS/event.json" \ + >"$ATTACHMENT_RECEIPTS/$phase-event.json" || journey_harness_failure "the sibling receiver capture changed before readback" + event=$(jq -er '.id | strings | select(length > 0)' "$ATTACHMENT_RECEIPTS/$phase-event.json") || + journey_harness_failure "the sibling receiver capture has no event ID" + attachment_compose logs --no-color --no-log-prefix receiver | + jq -Rc --arg id "$event" 'fromjson? | select(.eventId == $id)' >"$report" || + journey_harness_failure "cannot read the sibling receiver acceptance log" + assert_signed_hook_acceptance "$report" /events contact-created || + journey_harness_failure "the sibling receiver did not confirm signature verification without caller credentials" +} + +verify_compose_services_running() { + local service + for service in db receiver; do + [[ -n "$(attachment_compose ps --status running --quiet "$service")" ]] || + journey_harness_failure "stopping rstack also stopped the developer-owned Compose $service" + done + printf '%s\n' 'Both developer-owned Compose services remained running after rstack stopped.' +} + +private_compose_database_address() { + local container=$1 network=$2 + docker inspect "$container" | jq -er --arg network "$network" ' + .[0] | select((.NetworkSettings.Networks | keys) == [$network]) + | select([(.HostConfig.PortBindings // {})[]? | .[]?] == []) + | select([(.NetworkSettings.Ports // {})[]? | .[]?] == []) + | .NetworkSettings.Networks[$network].IPAddress + | select(test("^(10\\.|172\\.(1[6-9]|2[0-9]|3[01])\\.|192\\.168\\.)[0-9.]+$"))' +} + +expect_implicit_compose_refusal() { + local project=$1 reply status=0 run + reply=$(rstack_dev start "$project") || status=$? + if [[ "$status" == 0 ]]; then + run=$(jq -er '.run_id' <<<"$reply") || return 1 + rstack_dev stop "$run" >/dev/null || return 1 + printf '%s\n' 'Private plaintext unexpectedly started without an explicit transport selector.' >&2 + return 1 + fi + printf '%s\n' "$reply" + [[ "$status" == 1 ]] && jq -e ' + .error.class == "domain" and (.error.message | contains("numeric loopback"))' <<<"$reply" >/dev/null +} + +attach_compose_database() { + # shellcheck disable=SC2034 # issue_token and --bearer read token by name. + local project=$1 work=$2 container address password admin_base origin token='' contact='' + stop_live_runs || journey_harness_failure "cannot stop the managed run before Compose attachment" + container=$(attachment_compose ps --quiet db) || journey_harness_failure "cannot locate the Compose database" + [[ "$container" =~ ^[0-9a-f]{64}$ ]] || journey_harness_failure "expected one disposable Compose database" + address=$(private_compose_database_address "$container" "${ATTACHMENT_COMPOSE_PROJECT}_default") || + journey_harness_failure "the Compose database must have one numeric private address and no published port" + IFS= read -r password <"$ATTACHMENT_DB_PASSWORD" + admin_base="postgresql://postgres:$password@$address:5432/postgres" + RSTACK_DEV_DATABASE_URL="$admin_base?sslmode=disable" \ + journey_step attach --typed 'rstack dev start with implicit private plaintext' -- \ + expect_implicit_compose_refusal "$project" || + journey_harness_failure "implicit private plaintext did not return the expected loopback refusal" + RSTACK_DEV_DATABASE_URL="$admin_base?transport=private-network-plaintext" start_run attach "$project" || + journey_harness_failure "explicit private Compose attachment did not start; see $JOURNEY_STEP_STDOUT" + local config + config=$(jq -er '.runtimeConfigs.breg' "$START_FILE") || journey_harness_failure "the attached run names no BReg config" + journey_step attach -- python3 "$JOURNEY_LIB_DIR/projects/check-private-postgres.py" "$config" "$address" || + journey_harness_failure "BReg did not pin the private Compose address for both database roles" + origin=$(run_url breg) + issue_token attach "$RUN" editor token || journey_harness_failure "cannot issue the attached BReg editor credential" + journey_http attach --expect-status 201 --bearer token --header 'Content-Type: application/json' \ + --header 'Idempotency-Key: journey-compose-attached-contact' --data-file "$work/keep-body.json" \ + --capture .data.recordId contact POST "$origin/v1/records/contacts" || unexpected_answer attach + verify_sibling_hook "$contact" attached + journey_http attach --expect-status 200 --bearer token GET "$origin/v1/records/contacts/$contact" || unexpected_answer attach + jq -e --arg id "$contact" '.data.recordId == $id' "$JOURNEY_STEP_STDOUT" >/dev/null || + journey_harness_failure "the attached BReg read did not return the contact written on the Compose database" + journey_pass attach +} diff --git a/products/platform/journeys/promote.sh b/products/platform/journeys/promote.sh index 87aa6d1f17..6f996fca9a 100755 --- a/products/platform/journeys/promote.sh +++ b/products/platform/journeys/promote.sh @@ -285,44 +285,56 @@ port_is_free() { # attempt has an answer, so a refused start is an observation. # shellcheck disable=SC2329 # run through journey_step production_start() { - local pid attempt=0 state='' + local stop_grace=$1 pid deadline interrupted=0 state='' + # Record signals even between starting the server and saving its PID. + # This watched shell owns the child until it has reaped it. + trap 'interrupted=129' HUP + trap 'interrupted=130' INT + trap 'interrupted=143' TERM "${SERVE_COMMAND[@]}" & pid=$! - while ((attempt < 60)); do - if ! kill -0 "$pid" 2>/dev/null; then + deadline=$((SECONDS + 30)) + while ((interrupted == 0 && SECONDS < deadline)); do + if ! journey__process_alive "$pid"; then state=refused break fi - if curl --silent --fail --output /dev/null "http://127.0.0.1:$PORT$READY_PATH"; then + if curl --silent --fail --max-time 1 --output /dev/null "http://127.0.0.1:$PORT$READY_PATH"; then state=started break fi sleep 0.5 - attempt=$((attempt + 1)) done - if [[ -z "$state" ]]; then - printf 'the product neither answered %s nor exited within 30 seconds\n' "$READY_PATH" >&2 - kill -TERM "$pid" 2>/dev/null || true - wait "$pid" 2>/dev/null || true - return 1 - fi if [[ "$state" == refused ]]; then wait "$pid" 2>/dev/null || printf 'the product exited with status %s\n' "$?" >&2 else - kill -TERM "$pid" - for attempt in $(seq 1 100); do - kill -0 "$pid" 2>/dev/null || break - sleep 0.1 + while :; do + journey__terminate "$pid" "$stop_grace" + # A trapped signal can interrupt wait before the child exits. + journey__process_alive "$pid" || break done - if kill -0 "$pid" 2>/dev/null; then - kill -KILL "$pid" + # shellcheck disable=SC2154 # journey__terminate sets this status. + if [[ $_journey_terminate_killed -eq 1 ]]; then printf 'the product ignored SIGTERM and was killed\n' >&2 + return "$((interrupted == 0 ? 1 : interrupted))" fi - wait "$pid" 2>/dev/null || true + fi + ((interrupted == 0)) || return "$interrupted" + if [[ -z "$state" ]]; then + printf 'the product neither answered %s nor exited within 30 seconds\n' "$READY_PATH" >&2 + return 1 fi printf '%s\n' "$state" >"$STATE_FILE" } +observe_production_start() { + local stop_grace=$JOURNEY_KILL_GRACE + # Leave the wrapper enough time to finish a readiness probe, then stop + # and reap the server before its own watchdog can escalate. + local JOURNEY_KILL_GRACE=$((stop_grace + 4)) + journey_step start-as-production --timeout 90 --typed "${SERVE_COMMAND[*]##*/}" -- production_start "$stop_grace" +} + # production_check: the production check, whatever it answers. Its exit status # goes to stderr; its report is the step's stdout. # shellcheck disable=SC2329 # run through journey_step @@ -332,6 +344,20 @@ production_check() { printf 'check exit status %s\n' "$status" >&2 } +adapter_check_envelope() { + jq -e -s --arg exit "$2" ' + ({"0":"complete","1":"domain-refusal","2":"usage-error","3":"operational-failure"}[$exit]) as $status | + length == 1 and (.[0] | + type == "object" and + .apiVersion == "id.registrystack.org/formats/adapter/ctl-report/v1alpha1" and + .kind == "AdapterCtlReport" and .command == "check" and + $status != null and .status == $status and .ok == ($exit == "0") and + (.diagnostics | type == "array" and ($exit == "0" or length > 0) and + all(.[]; type == "object" and (.code | type == "string" and length > 0) and + (.message | type == "string") and + ($exit == "0" or (.suggestedAction | type == "string" and length > 0)))))' "$1" >/dev/null 2>&1 +} + # The stock own-provider paths for these products use narrow loopback transport # and explicit clients, both permitted in production. Any actual refusal still # takes the remediation path, even for these products. @@ -538,7 +564,7 @@ walk_product() { # start-as-production STATE_FILE=$JOURNEY_OUT/$product/production-start.state port_is_free "$PORT" || journey_harness_failure "port $PORT is in use; promote cannot start $product on it" - journey_step start-as-production --timeout 90 --typed "${SERVE_COMMAND[*]##*/}" -- production_start || + observe_production_start || journey_harness_failure "the start of $product neither answered nor exited; see $JOURNEY_STEP_STDERR" [[ -f "$STATE_FILE" ]] || journey_harness_failure "the start attempt of $product left no state; see $JOURNEY_STEP_STDERR" START_CODES=$(diagnostic_codes "$JOURNEY_STEP_STDOUT" "$JOURNEY_STEP_STDERR") @@ -553,11 +579,17 @@ walk_product() { # refusals journey_step refusals --typed "${CHECK_COMMAND[*]##*/}" -- production_check || journey_harness_failure "the production check of $product did not run; see $JOURNEY_STEP_STDERR" - CHECK_CODES=$(diagnostic_codes "$JOURNEY_STEP_STDOUT" "$JOURNEY_STEP_STDERR") + check_status=$(sed -n 's/^check exit status \([0-9][0-9]*\)$/\1/p' "$JOURNEY_STEP_STDERR") + if [[ "$product" == adapter ]]; then + adapter_check_envelope "$JOURNEY_STEP_STDOUT" "$check_status" || + journey_harness_failure "Adapter production check report must be one check envelope matching its exit status; see $JOURNEY_STEP_STDOUT" + CHECK_CODES=$(diagnostic_codes "$JOURNEY_STEP_STDOUT") + else + CHECK_CODES=$(diagnostic_codes "$JOURNEY_STEP_STDOUT" "$JOURNEY_STEP_STDERR") + fi if [[ "$CHECK_CODES" != "$START_CODES" ]]; then journey_harness_failure "the production check of $product lists [${CHECK_CODES//$'\n'/ }] and its start lists [${START_CODES//$'\n'/ }]; the two lists must be equal (see $JOURNEY_STEP_STDOUT)" fi - check_status=$(sed -n 's/^check exit status \([0-9][0-9]*\)$/\1/p' "$JOURNEY_STEP_STDERR") production_case=$(production_outcome "$product" "$(<"$STATE_FILE")" "$check_status" "$CHECK_CODES") case "$production_case" in invalid) diff --git a/products/platform/journeys/rstack-dev.sh b/products/platform/journeys/rstack-dev.sh index 499f8f4481..e72f5988e5 100755 --- a/products/platform/journeys/rstack-dev.sh +++ b/products/platform/journeys/rstack-dev.sh @@ -21,13 +21,40 @@ # Run it from anywhere: # products/platform/journeys/rstack-dev.sh --bin-dir DIR [--product ID]... # [--out DIR] [--expected FILE [--strict]] [--keep] +# Use --product breg --attachments compose for the sibling receiver and +# unpublished private PostgreSQL attachment proof. +# Use --product casework --planted-error casework-missing-scope for the +# disposable scope diagnostic probe after T1. set -euo pipefail # shellcheck disable=SC1091 # lib.sh is checked on its own source "$(dirname -- "${BASH_SOURCE[0]}")/lib.sh" -journey_init rstack-dev -- "$@" +journey_init rstack-dev --value-option attachments --value-option planted-error -- "$@" +journey_option_value planted-error RSTACK_PLANTED_ERROR +case "$RSTACK_PLANTED_ERROR" in +'') ;; +casework-missing-scope) + [[ "${JOURNEY_PRODUCTS[*]}" == casework && "$JOURNEY_KEEP" == 0 ]] || + journey_usage_error "--planted-error casework-missing-scope requires --product casework and no --keep" + ;; +*) journey_usage_error "--planted-error $RSTACK_PLANTED_ERROR: choose casework-missing-scope" ;; +esac +journey_option_value attachments RSTACK_ATTACHMENTS +RSTACK_ATTACHMENTS=${RSTACK_ATTACHMENTS:-loopback} +case "$RSTACK_ATTACHMENTS" in +loopback) ;; +compose) + [[ "${JOURNEY_PRODUCTS[*]}" == breg && "$JOURNEY_KEEP" == 0 ]] || + journey_usage_error "--attachments compose requires --product breg and no --keep" + docker compose version >/dev/null || journey_usage_error "--attachments compose requires Docker Compose" + # shellcheck source=/dev/null # The opt-in fixture shares this runner's lifecycle. + source "$JOURNEY_LIB_DIR/projects/rstack-attachments.sh" + journey_at_cleanup stop_compose_attachments + ;; +*) journey_usage_error "--attachments $RSTACK_ATTACHMENTS: choose loopback or compose" ;; +esac journey_require_docker # The tools every selected product's init needs, and rstack itself. @@ -210,7 +237,7 @@ recipe() { messaging) PERSON=case-system CALL_METHOD=POST - CALL_PATH=/v1/messages + CALL_PATH=/v1/messages/receipt CALL_BODY='{"senderProfile":"reminders-sms","to":{"phone":"+15555550100"},"template":{"id":"appointment-reminder-sms","version":"1"},"locale":"en","data":{"name":"Ada Lovelace","day":"2026-10-01","office":"Central Registry Office"}}' ;; breg) @@ -400,9 +427,11 @@ write_keep() { field='.requestId' ;; messaging) - KEEP_PATH=/v1/messages/$message_id - KEEP_EXPECT=$message_id - return + path=/v1/messages + body=$CALL_BODY + field='.id' + options+=(--expect-status 202 + --typed "curl -H @HEADER_FILE -H 'Idempotency-Key:journey-keep' --json '$body' $url$path") ;; scheduling) local config @@ -433,20 +462,23 @@ write_keep() { [[ "$product" != casework ]] || write_path="$path?accessProfile=requester" journey_http "$step" "${options[@]}" --data-file "$work/keep-body.json" --capture "$field" saved_id "$method" "$url$write_path" || unexpected_answer "$step" case "$product" in - breg | coordinator) KEEP_PATH=$path/$saved_id ;; + breg | coordinator | messaging) KEEP_PATH=$path/$saved_id ;; casework) KEEP_PATH=$path/$saved_id ;; adapter) KEEP_PATH=$path ;; esac KEEP_EXPECT=$saved_id + if [[ "$product" == messaging && "$saved_id" == "$message_id" ]]; then + journey_harness_failure "the retention send did not create a distinct message" + fi } # start_run STEP PROJECT: `rstack dev start` on PROJECT as part of STEP. Sets # RUN, BASE_URL and START_FILE (the report) on success. Returns the command's # status; the caller records the outcome. start_run() { - local step=$1 project=$2 status=0 - journey_step "$step" --timeout 240 --concepts run-id-and-ttl,journey-file \ - --typed "rstack dev start $project" -- rstack_dev start "$project" || status=$? + local step=$1 project=$2 status=0 project_arg=./${2##*/} + journey_step "$step" --cwd "${project%/*}" --timeout 240 --concepts run-id-and-ttl,journey-file \ + --typed "rstack dev start $project_arg" -- rstack_dev start "$project_arg" || status=$? START_FILE=$JOURNEY_STEP_STDOUT if [[ $status -eq 0 ]]; then RUN=$(jq -er '.run_id' "$START_FILE") || journey_harness_failure "the start report of $CELL names no run id; see $START_FILE" @@ -477,6 +509,43 @@ issue_token() { journey_secret_register "token-$variable" "$variable" } +# Scope fixtures share an inert scope so both signed tokens remain access +# tokens. Their only authorization difference is the required staff scope. +prepare_casework_scope_probe() { + perl -0pi -e ' + my $entry = qr/^ staff:\n((?:^ {4}[^\n]*\n)+)/m; + !/^ staff-missing-scope:/m && /$entry/ or die "expected a generated staff plan entry\n"; + my $staff = $1; + my $control = $staff; + my $required = " - casework:staff\n"; + my $shared = " - casework:diagnostic-control\n"; + $control =~ s/^\Q$required\E/$shared/m or die "generated staff scope is missing\n"; + $staff =~ s/^\Q$required\E/$required$shared/m or die "generated staff scope is missing\n"; + s/$entry/ staff:\n$staff staff-missing-scope:\n$control/; + ' "$1" +} + +record_casework_scope_probe() { + # shellcheck disable=SC2034 # issue_token and --bearer use control by name. + local run=$1 url=$2 path=$3 work=$4 control='' trace + issue_token call "$run" staff-missing-scope control || + journey_harness_failure "cannot issue the Casework missing-scope control" + journey_http call --expect-status 403 --bearer control GET "$url$path" || + journey_harness_failure "Casework did not refuse the missing-scope control with HTTP 403" + journey_count errors-that-say-what-to-change 0 + trace=$(jq -er 'select(.code == "profile.not-authorized" and .failedCheck == "scope") + | .traceId | strings | select(test("^[0-9a-f]{32}$"))' "$JOURNEY_STEP_STDOUT") || return 0 + # shellcheck disable=SC2016 # jq binds $trace. + if journey_poll 5 -- jq -Rse --arg trace "$trace" ' + first(split("\n")[] | fromjson? | .fields | + select(.trace_id == $trace and .failed_check == "scope" + and .scope_claim == "scope" and .required_scope == "casework:staff") | + {trace_id, failed_check, scope_claim, required_scope})' \ + "$STATE_DIR/$run/logs/casework-runtime.log" >"$work/casework-scope-diagnostic.json"; then + journey_count errors-that-say-what-to-change + fi +} + # unexpected_answer STEP: the call answered with a status this journey has no # code for. It is a harness failure so that a new kind of refusal is looked at # and named, never recorded under a code the product did not print. @@ -503,8 +572,8 @@ walk_product() { project=$work/project # init: the product's own init. - init_command "$product" "$project" - journey_step init --concepts project -- "${INIT_COMMAND[@]}" || status=$? + init_command "$product" ./project + journey_step init --cwd "$work" --concepts project -- "${INIT_COMMAND[@]}" || status=$? if [[ $status -ne 0 ]]; then fail_with_product_code init "$JOURNEY_STEP_STDOUT" "$JOURNEY_STEP_STDERR" journey_cell_end @@ -534,12 +603,20 @@ walk_product() { # start: one command, after supplying the optional fixture endpoints. case "$product" in - breg) add_contact_hook "$project" ;; + breg) + add_contact_hook "$project" + [[ "$RSTACK_ATTACHMENTS" != compose ]] || prepare_compose_attachments "$project" "$work" + ;; documents) add_documents_hooks "$project" ;; casework) - # Use the generated test person's issuer for the starter's - # trusted producer on this disposable project. - perl -pi -e 's@^ issuer: http://127[.]0[.]0[.]1:8093$@ issuer: https://identity.casework.example.test@' "$project/casework.yaml" + # Released starters can still name the old loopback issuer. + if grep -Fxq ' issuer: http://127.0.0.1:8093' "$project/casework.yaml"; then + perl -pi -e 's@^ issuer: http://127[.]0[.]0[.]1:8093$@ issuer: https://identity.casework.example.test@' "$project/casework.yaml" + fi + if [[ "${RSTACK_PLANTED_ERROR:-}" == casework-missing-scope ]]; then + prepare_casework_scope_probe "$project/dev.yaml" || + journey_harness_failure "cannot prepare the Casework missing-scope control" + fi ;; adapter) start_adapter_source "$project" "$work" ;; evidence) start_evidence_source "$project" ;; @@ -600,37 +677,47 @@ walk_product() { case "$product" in coordinator) call_options+=(--capture '.workflowRevision' workflow_revision) ;; casework) CALL_PATH+='?accessProfile=staff' ;; + messaging) + # Start already submitted the exact starter request. The receipt route + # uses its original request and key and does not submit another message. + printf '%s\n' "$CALL_BODY" >"$work/call-body.json" + call_options+=(--expect-status 200 --header 'Content-Type: application/json' --header 'Idempotency-Key: send-a-reminder-sms' + --data-file "$work/call-body.json" --capture '.id | strings | select(length > 0)' message_id --concepts idempotency-key + --typed "curl -H @HEADER_FILE -H 'Idempotency-Key:send-a-reminder-sms' --json '$CALL_BODY' $url$CALL_PATH") + ;; esac - if [[ -n "$CALL_BODY" ]]; then - printf '%s\n' "$CALL_BODY" | journey_write_file "$work/call-body.json" - call_options+=(--header 'Content-Type: application/json' --header 'Idempotency-Key: journey-first-call' --data-file "$work/call-body.json" --capture '.id' message_id) - fi journey_http call "${call_options[@]}" "$CALL_METHOD" "$url$CALL_PATH" || status=$? if [[ $status -ne 0 ]]; then unexpected_answer call fi if [[ "$product" == messaging ]]; then - journey_http call --expect-status 200 --bearer token GET "$url/v1/messages/$message_id" || unexpected_answer call - jq -e --arg id "$message_id" '.id == $id' "$JOURNEY_STEP_STDOUT" >/dev/null || - journey_harness_failure "the message read did not return the submitted message" + jq -e --arg id "$message_id" '.links.self == ("/v1/messages/" + $id)' "$JOURNEY_STEP_STDOUT" >/dev/null || + journey_harness_failure "the starter message receipt did not identify its retained message" fi - journey_pass call if [[ "$product" == messaging || ("$CALL_METHOD" == GET && -n "$PERSON") ]]; then journey_reached t1 first_read=1 fi + if [[ "$product" == casework && "${RSTACK_PLANTED_ERROR:-}" == casework-missing-scope ]]; then + record_casework_scope_probe "$run" "$url" "$CALL_PATH" "$work" + fi + journey_pass call # The BReg and Documents writes also test retention after restart. case "$product" in breg) local sink write_keep "$product" "$work" "$project" "$url" "$run" - sink=$(jq -er '.bregHookSink.receivedUrl' "$START_FILE") - journey_poll 30 -- hook_received "$sink" "$KEEP_EXPECT" || - journey_harness_failure "the BReg hook sink did not receive the retained contact's creation event" - journey_http hook GET "$sink" || unexpected_answer hook - breg_hook_matches "$KEEP_EXPECT" "$JOURNEY_STEP_STDOUT" || - journey_harness_failure "the BReg hook receipt does not contain the retained contact's creation event" + if [[ "$RSTACK_ATTACHMENTS" == compose ]]; then + verify_sibling_hook "$KEEP_EXPECT" managed + else + sink=$(jq -er '.bregHookSink.receivedUrl' "$START_FILE") + journey_poll 30 -- hook_received "$sink" "$KEEP_EXPECT" || + journey_harness_failure "the BReg hook sink did not receive the retained contact's creation event" + journey_http hook GET "$sink" || unexpected_answer hook + breg_hook_matches "$KEEP_EXPECT" "$JOURNEY_STEP_STDOUT" || + journey_harness_failure "the BReg hook receipt does not contain the retained contact's creation event" + fi journey_pass hook ;; documents) @@ -703,6 +790,10 @@ walk_product() { documents_ready_matches "$documents_receipt" "$JOURNEY_STEP_STDOUT" || journey_harness_failure "the retained document no longer identifies the ready version" fi + if [[ "$product" == messaging ]]; then + jq -e --arg id "$KEEP_EXPECT" '.id == $id' "$JOURNEY_STEP_STDOUT" >/dev/null || + journey_harness_failure "the retained read did not return the distinct message sent before restart" + fi if [[ "$method" == GET && $first_read -eq 0 ]]; then journey_reached t1 fi @@ -721,7 +812,11 @@ walk_product() { # attach: only products with a database accept a PostgreSQL server. if [[ "$uses_postgres" == true ]]; then - attach_database "$project" || status=$? + if [[ "$RSTACK_ATTACHMENTS" == compose ]]; then + attach_compose_database "$project" "$work" || status=$? + else + attach_database "$project" || status=$? + fi if [[ $status -ne 0 ]]; then stop_live_runs journey_cell_end @@ -740,6 +835,7 @@ walk_product() { journey_poll 30 -- state_is_empty || journey_harness_failure "the state of run $last did not go after its stop" journey_check_absent "$(run_containers "$last" | head -n 1)" "$(run_containers "$last" | tail -n 1)" || journey_harness_failure "a container of run $last remains after its stop" + [[ "$RSTACK_ATTACHMENTS" != compose ]] || verify_compose_services_running journey_pass stop [[ "$product" != evidence ]] || stop_evidence_source journey_cell_end diff --git a/products/platform/journeys/test_journey_tables.py b/products/platform/journeys/test_journey_tables.py index e289fc43a9..dcbb284427 100644 --- a/products/platform/journeys/test_journey_tables.py +++ b/products/platform/journeys/test_journey_tables.py @@ -18,6 +18,7 @@ import json import os import re +import signal import subprocess import tempfile import time @@ -649,6 +650,164 @@ def test_zero_diagnostics_requires_a_successful_check_and_an_explicit_case(self) self.assertEqual(result.strip(), expected) +class AdapterPromotion(unittest.TestCase): + def run_promotion(self, mode, check_report="", check_exit=0, stubborn=False): + source = (TABLES / "promote.sh").read_text(encoding="utf-8") + start = source[source.index("# diagnostic_codes FILE"): + source.index("# FIX_TABLE:")] + walk = re.search(r"^walk_product\(\) \{\n.*?^\}\n", source, re.M | re.S) + self.assertIsNotNone(walk) + driver = r""" +source "$1/lib.sh" +journey_init promote -- --product adapter --out "$FIXTURE/run" +FROM=$FIXTURE/input +recorded=$FROM/work/adapter +mkdir -p "$recorded" +printf 'fixture response\n' >"$recorded/call.response" +printf 'fixture contract\n' >"$recorded/call.contract" +printf 'aud\n' >"$recorded/call.claims" +input_outcome() { printf -v "$2" finished; } +locate_input() { PORT=12345; READY_PATH=/ready; } +recipe() { SERVE_COMMAND=("$FIXTURE/adapter"); CHECK_COMMAND=(fixture_check); } +call_recipe() { CALL_METHOD=POST; CALL_PATH=/v1/records/person; CALL_OPTIONS=(); } +take_over_input() { :; } +curl() { [[ "$MODE" == check && -f "$FIXTURE/pid" ]]; } +fixture_check() { printf '%s' "$CHECK_REPORT"; return "$CHECK_EXIT"; } +fetch_token() { printf -v "$2" fixture; } +apply_fix() { [[ "$1" == adapter.config.invalid-fixture ]]; } +journey_claim_names() { printf 'aud\n'; } +journey_request_contract() { printf 'fixture contract\n'; } +journey_start() { :; } +journey_ready() { :; } +journey_http() { JOURNEY_HTTP_STATUS=201; JOURNEY_STEP_STDOUT=$recorded/call.response; } +journey_stop() { :; } +if [[ "$MODE" == timeout ]]; then + eval "$(declare -f journey__watchdog | sed '1s/journey__watchdog/fixture_watchdog/')" + journey__watchdog() { + [[ "$2" != 90 ]] || set -- "$1" 2 "$3" "$4" + fixture_watchdog "$@" + } +fi +""" + start + "\nport_is_free() { :; }\n" + walk.group(0) + "\nwalk_product adapter\njourney_finish\n" + adapter = r"""#!/usr/bin/env python3 +import os +import signal +import sys +import time +from pathlib import Path + +if os.environ["MODE"] == "refusal": + print("error[adapter.config.invalid-fixture] synthetic refusal", file=sys.stderr) + sys.exit(1) + +fixture = Path(os.environ["FIXTURE"]) + +def terminate(_signal, _frame): + (fixture / "term").touch() + if os.environ["STUBBORN"] != "1": + sys.exit(143) + +signal.signal(signal.SIGTERM, terminate) +(fixture / "pid.tmp").write_text(str(os.getpid())) +(fixture / "pid.tmp").rename(fixture / "pid") +time.sleep(8) +""" + with tempfile.TemporaryDirectory() as directory: + fixture = Path(directory) + executable = fixture / "adapter" + executable.write_text(adapter, encoding="utf-8") + executable.chmod(0o700) + with subprocess.Popen( + ["bash", "-euo", "pipefail", "-c", driver, "promote-adapter", str(TABLES)], + env={**os.environ, "JOURNEY_TABLES_DIR": str(TABLES), + "JOURNEY_KILL_GRACE": "1", "FIXTURE": directory, "MODE": mode, + "CHECK_REPORT": check_report, "CHECK_EXIT": str(check_exit), + "STUBBORN": str(int(stubborn))}, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, start_new_session=True, + ) as process: + try: + pid_file = fixture / "pid" + if mode == "cancel": + deadline = time.monotonic() + 8 + while not pid_file.exists() and process.poll() is None and time.monotonic() < deadline: + time.sleep(0.02) + self.assertTrue(pid_file.exists(), "Adapter never reached startup") + process.terminate() + _, errors = process.communicate(timeout=14) + run = fixture / "run" + report = json.loads((run / "run.json").read_text(encoding="utf-8")) + if mode in ("timeout", "cancel"): + self.assertTrue(pid_file.exists(), errors) + status = subprocess.run( + ["ps", "-o", "stat=", "-p", pid_file.read_text()], + capture_output=True, text=True, + ).stdout.strip() + self.assertEqual( + ((fixture / "term").exists(), bool(status and not status.startswith("Z"))), + (True, False), errors, + ) + self.assertFalse((run / "adapter/production-start.state").exists()) + self.assertEqual(report["cleanup"]["failures"], [], errors) + summary = run / "summary.json" + return report, json.loads(summary.read_text()) if summary.exists() else None + finally: + # The group contains only the fixture, including an escaped + # fake Adapter when the runner under test is broken. + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + self.assertIsNotNone(process.poll()) + + def test_startup_watchdog_stops_the_server(self): + report, _ = self.run_promotion("timeout") + self.assertEqual(report["exitStatus"], 3) + self.assertIn("did not finish within 90 seconds", report["harnessFailure"]) + + def test_cancellation_reaps_the_server_even_if_term_is_ignored(self): + report, _ = self.run_promotion("cancel", stubborn=True) + self.assertEqual(report["exitStatus"], 143) + + @staticmethod + def envelope(**fields): + return json.dumps({ + "apiVersion": "id.registrystack.org/formats/adapter/ctl-report/v1alpha1", + "kind": "AdapterCtlReport", "command": "check", "status": "complete", + "ok": True, "diagnostics": [], **fields, + }) + + def test_unmatched_check_envelope_fails_before_refusal_count(self): + valid = self.envelope() + cases = { + "blank": "", "malformed": '{"ok":', "two objects": valid + "\n" + valid, + "wrong command": self.envelope(command="provision"), + "wrong outcome": self.envelope(ok=False), + "wrong diagnostics": self.envelope(diagnostics={}), + "malformed diagnostic": self.envelope(diagnostics=[{"code": "bad", "message": 1}]), + } + for label, output in cases.items(): + with self.subTest(label=label): + report, summary = self.run_promotion("check", output) + self.assertEqual(report["exitStatus"], 3) + self.assertIn("Adapter production check report", report["harnessFailure"]) + self.assertIsNone(summary) + + def test_valid_check_counts_distinct_matched_refusals(self): + refusal = {"code": "adapter.config.invalid-fixture", "message": "synthetic refusal", + "suggestedAction": "Correct the fixture."} + cases = ( + ("check", self.envelope(), 0, 0), + ("refusal", self.envelope(ok=False, status="domain-refusal", + diagnostics=[refusal, refusal]), 1, 1), + ) + for mode, output, exit_status, count in cases: + with self.subTest(mode=mode): + report, summary = self.run_promotion(mode, output, check_exit=exit_status) + self.assertEqual(report["exitStatus"], 0, report["harnessFailure"]) + cell, = summary["cells"] + self.assertEqual(cell["productionRefusals"], count) + self.assertEqual(cell["total"]["refusalsMet"], count) + + class LoggedStage(unittest.TestCase): """`logged_stage` maps the last refusal line's `failed_check` label onto a stage word.""" @@ -956,6 +1115,86 @@ def test_promote_refuses_thunderid_run_directory(self): class CaseworkProducerFixture(unittest.TestCase): + def test_planted_scope_counts_only_the_correlated_actionable_diagnostic(self): + source = (TABLES / "rstack-dev.sh").read_text(encoding="utf-8") + probe = re.search(r"^record_casework_scope_probe\(\) \{\n.*?^\}\n", source, re.M | re.S) + self.assertIsNotNone(probe) + driver = r""" +STATE_DIR=$1 +JOURNEY_STEP_STDOUT=$1/response.json +issue_token() { :; } +journey_http() { [[ "$*" == "call --expect-status 403 --bearer control GET http://localhost/read" ]]; } +journey_harness_failure() { printf '%s\n' "$1" >&2; exit 3; } +journey_poll() { shift 2; "$@"; } +journey_count() { printf '%s\n' "${2:-1}"; } +record_casework_scope_probe sample http://localhost /read "$1" +""" + trace = "01a2333e0412314aaf6d6dbbe6fd98c0" + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + (root / "response.json").write_text(json.dumps({ + "code": "profile.not-authorized", "failedCheck": "scope", "traceId": trace, + }), encoding="utf-8") + logs = root / "sample/logs" + logs.mkdir(parents=True) + for label, overrides, count in (("matching", {}, "0\n1"), ("other trace", {"trace_id": "other"}, "0"), + ("missing remedy", {"required_scope": ""}, "0")): + with self.subTest(label=label): + (logs / "casework-runtime.log").write_text(json.dumps({"fields": { + "trace_id": trace, "failed_check": "scope", "scope_claim": "scope", + "required_scope": "casework:staff", **overrides, + }}), encoding="utf-8") + result = subprocess.check_output( + ["bash", "-eu", "-c", probe.group(0) + driver, "casework-scope-count", directory], + text=True, timeout=5, + ) + self.assertEqual(result.strip(), count) + + def test_planted_scope_fixture_preserves_staff_authority_and_only_omits_required_scope(self): + source = (TABLES / "rstack-dev.sh").read_text(encoding="utf-8") + prepare = re.search(r"^prepare_casework_scope_probe\(\) \{\n.*?^\}\n", source, re.M | re.S) + self.assertIsNotNone(prepare) + with tempfile.TemporaryDirectory() as directory: + path = Path(directory) / "dev.yaml" + original = {"client": "staff", "subject": "staff", "grants": {"casework": { + "claims": {"registry_actor_kind": "human"}, "profile": "staff", "scopes": ["casework:staff"], + }}} + path.write_text(yaml.safe_dump({"people": {"staff": original, "supervisor": {"client": "supervisor"}}, + "products": [{"product": "casework"}]}), encoding="utf-8") + subprocess.run( + ["bash", "-eu", "-c", prepare.group(0) + '\nprepare_casework_scope_probe "$1"', + "casework-scope-probe", str(path)], check=True, timeout=5, + ) + people = yaml.safe_load(path.read_text(encoding="utf-8"))["people"] + staff, control = people["staff"], people["staff-missing-scope"] + scopes = staff["grants"]["casework"].pop("scopes") + control_scopes = control["grants"]["casework"].pop("scopes") + self.assertEqual(staff, control) + self.assertEqual(set(scopes) - set(control_scopes), {"casework:staff"}) + self.assertTrue(control_scopes and set(control_scopes) < set(scopes)) + self.assertEqual(people["supervisor"], {"client": "supervisor"}) + + def test_managed_starter_only_rewrites_the_released_issuer(self): + source = (TABLES / "rstack-dev.sh").read_text(encoding="utf-8") + start = source[source.index("# start: one command"):source.index("start_run start")] + case = re.search(r"^\tcasework\)\n(.*?)^\t\t;;", start, re.M | re.S) + self.assertIsNotNone(case) + legacy = "http://127.0.0.1:8093" + aligned = "https://identity.casework.example.test" + for issuer in (legacy, aligned): + with self.subTest(issuer=issuer), tempfile.TemporaryDirectory() as directory: + project = Path(directory) + policy = project / "casework.yaml" + policy.write_text(f" issuer: {issuer}\n subject: fixture-subject\n", encoding="utf-8") + inode = policy.stat().st_ino + subprocess.run( + ["bash", "-eu", "-c", 'project=$1\n' + case.group(1), "casework-starter", directory], + check=True, timeout=5, + ) + self.assertEqual(policy.read_text(), f" issuer: {aligned}\n subject: fixture-subject\n") + if issuer == aligned: + self.assertEqual(policy.stat().st_ino, inode) + def test_binds_either_standalone_starter_issuer(self): script = (TABLES / "own-provider.sh").read_text(encoding="utf-8") functions = [] @@ -1004,6 +1243,8 @@ def walk(self, product, delivered): scratch=$2 product=$3 delivered=$4 trace=$scratch/trace LIVE_RUNS='' +RSTACK_ATTACHMENTS=loopback +[[ "$delivered" != sibling-attachments ]] || RSTACK_ATTACHMENTS=compose printf '{"authentication":{"oidc":{"issuers":{"fixture":{}}}},"audit":{"path":"%s/audit.jsonl"}}\n' \ "$scratch" >"$scratch/runtime.json" : >"$scratch/audit.jsonl" @@ -1012,6 +1253,9 @@ def walk(self, product, delivered): init_command() { INIT_COMMAND=(write_starter "$2"); } add_contact_hook() { :; } add_documents_hooks() { :; } +prepare_compose_attachments() { printf '%s\n' 'prepare Compose attachments' >>"$trace"; } +verify_sibling_hook() { printf 'check sibling hook %s\n' "$1" >>"$trace"; } +verify_compose_services_running() { printf '%s\n' 'Compose services outlive rstack' >>"$trace"; } start_evidence_source() { :; } stop_evidence_source() { :; } measure_reader_action() { @@ -1121,16 +1365,16 @@ def walk(self, product, delivered): JOURNEY_STEP_STDOUT=$scratch/response.json if [[ "$CELL" == messaging ]]; then case "${@: -2:1} ${!#}" in - 'POST http://127.0.0.1:49192/v1/messages') - message_id=message-1 - printf '%s\n' 'submit message' >>"$trace" - ;; - 'GET http://127.0.0.1:49192/v1/messages/message-1') - printf '%s\n' 'read submitted message' >>"$trace" + 'POST http://127.0.0.1:49192/v1/messages/receipt') + [[ " $* " == *' Idempotency-Key: send-a-reminder-sms '* ]] + [[ " $* " == *' --concepts idempotency-key '* ]] + message_id=starter-message + printf '%s\n' 'read starter message receipt' >>"$trace" + jq -c . "$work/call-body.json" >>"$trace" ;; *) return 1 ;; esac - printf '%s\n' '{"id":"message-1"}' >"$JOURNEY_STEP_STDOUT" + printf '%s\n' '{"id":"starter-message","links":{"self":"/v1/messages/starter-message"}}' >"$JOURNEY_STEP_STDOUT" else printf '%s\n' '{}' >"$JOURNEY_STEP_STDOUT" fi @@ -1146,7 +1390,11 @@ def walk(self, product, delivered): ;; keep) printf '%s\n' 'read retained record' >>"$trace" - printf '%s\n' '{"recordId":"retained-id"}' >"$JOURNEY_STEP_STDOUT" + if [[ "$CELL" == messaging ]]; then + printf '%s\n' '{"id":"retained-id"}' >"$JOURNEY_STEP_STDOUT" + else + printf '%s\n' '{"recordId":"retained-id"}' >"$JOURNEY_STEP_STDOUT" + fi ;; *) return 1 ;; esac @@ -1156,6 +1404,7 @@ def walk(self, product, delivered): edit_for_restart() { :; } audit_was_appended() { :; } attach_database() { journey_pass attach; } +attach_compose_database() { printf '%s\n' 'attach private Compose database' >>"$trace"; journey_pass attach; } run_containers() { printf '%s\n' 'fake-container'; } journey_check_absent() { :; } @@ -1197,11 +1446,25 @@ def test_starter_first_read_uses_four_reader_commands(self): self.assertIn(("plan", "pass"), outcomes) self.assertIn(("issuer", "pass"), outcomes) - def test_messaging_reads_the_submitted_message_before_restart(self): + def test_breg_compose_attachments_requires_the_sibling_hook_and_private_database(self): + result, outcomes, trace = self.walk("breg", "sibling-attachments") + self.assertEqual(result.returncode, 0, result.stdout + result.stderr) + self.assertIn(("hook", "pass"), outcomes) + self.assertIn(("attach", "pass"), outcomes) + self.assertEqual(trace, ["prepare Compose attachments", "write breg", "check sibling hook retained-id", + "read retained record", "attach private Compose database", + "Compose services outlive rstack"]) + + def test_messaging_reads_the_starter_receipt_in_four_reader_commands(self): result, _, trace = self.walk("messaging", "first-hour") self.assertEqual(result.returncode, 0, result.stdout + result.stderr) - self.assertEqual(trace[:2], ["submit message", "read submitted message"]) - self.assertEqual(trace[-1], "5") + self.assertEqual(trace[0], "read starter message receipt") + example = REPO / "products/messaging/examples/starter/dev-journeys.yaml" + starter = yaml.safe_load(example.read_text(encoding="utf-8")) + journey = next(journey for journey in starter["journeys"] if journey["id"] == "send-a-reminder-sms") + self.assertEqual(json.loads(trace[1]), journey["steps"][0]["body"]) + self.assertEqual(trace[2], "write messaging") + self.assertEqual(trace[-1], "4") def test_evidence_first_read_uses_the_checked_start(self): result, outcomes, trace = self.walk("evidence", "first-hour") @@ -1265,6 +1528,181 @@ def test_documents_refuses_unmatched_capture_or_readback(self): self.assertEqual(trace, []) +class DevelopmentAttachments(unittest.TestCase): + def test_compose_keeps_postgres_unpublished_and_receiver_loopback_only(self): + fixture = yaml.safe_load((TABLES / "projects/rstack-attachments.compose.yaml").read_text()) + database = fixture["services"]["db"] + receiver = fixture["services"]["receiver"] + self.assertNotIn("ports", database) + self.assertNotIn("network_mode", database) + self.assertNotIn("network_mode", receiver) + self.assertEqual(receiver["ports"], ["127.0.0.1::8109"]) + self.assertEqual(database["secrets"], ["db-password"]) + self.assertEqual(receiver["secrets"], ["hook-key"]) + for service in (database, receiver): + self.assertRegex(service["image"], r"@sha256:[0-9a-f]{64}$") + self.assertEqual(service["pull_policy"], "never") + + def test_private_postgres_check_requires_the_exact_endpoint_for_both_roles(self): + script = TABLES / "projects/check-private-postgres.py" + address = "172.20.0.4" + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + config = root / "runtime.json" + for role in ("runtime", "migration"): + (root / role).write_text(f"postgresql://test:test@{address}:5432/fixture?sslmode=disable") + config.write_text(json.dumps({ + "secretProviders": {"file": {"root": str(root)}}, + "database": {"transport": "private-network-plaintext", "runtimeUrlRef": "secret:file/runtime", + "migrationUrlRef": "secret:file/migration"}, + })) + command = ["python3", str(script), str(config), address] + accepted = subprocess.run(command, check=True, capture_output=True, text=True) + self.assertEqual(json.loads(accepted.stdout)["rolesPinned"], ["runtime", "migration"]) + (root / "migration").write_text("postgresql://test:test@172.20.0.5:5432/fixture?sslmode=disable") + refused = subprocess.run(command, capture_output=True, text=True) + self.assertNotEqual(refused.returncode, 0) + self.assertNotIn("postgresql://", refused.stderr) + + +class ManagedSchedulingStartup(unittest.TestCase): + def run_interrupted_start(self, mode, stop_failure=False): + source = (TABLES / "own-provider.sh").read_text(encoding="utf-8") + managed = source[source.index("COMPOSED_MANAGED_RUN=''\n"): + source.index("composed_scheduling_url() {")] + driver = r""" +source "$1/lib.sh" +journey_init own-provider -- --product scheduling --out "$FIXTURE/run" +journey_cell_begin scheduling +SECRETS=$JOURNEY_OUT/secrets +ADMIN_URL_FILE=$FIXTURE/admin-url +COMPOSED_RSTACK_BIN=$FIXTURE/launcher +SERVER_BIN=$COMPOSED_RSTACK_BIN TOOL_BIN=$COMPOSED_RSTACK_BIN +if [[ "$2" == timeout ]]; then + eval "$(declare -f journey__watchdog | sed '1s/journey__watchdog/fixture_watchdog/')" + journey__watchdog() { + [[ "$2" != 120 ]] || set -- "$1" 2 "$3" "$4" + fixture_watchdog "$@" + } +fi +""" + managed + r""" +start_composed_managed_scheduling "$FIXTURE" "$FIXTURE/start.json" +journey_finish +""" + launcher = r"""#!/usr/bin/env python3 +import os +import shutil +import signal +import subprocess +import sys +import time +from pathlib import Path + +fixture = Path(os.environ["FIXTURE"]) +run = Path(os.environ["RSTACK_DEV_STATE_DIR"]) / ("a" * 32) +if sys.argv[6] == "stop": + if os.environ.get("RSTACK_SCHEDULINGCTL_BIN") != sys.argv[0]: + sys.exit(6) + if sys.argv[7] != run.name or not (run / "recovery").exists(): + sys.exit(7) + if not (fixture / "term").exists() or not (fixture / "child-stopped").exists(): + sys.exit(8) + (fixture / "stop").touch() + if os.environ["STOP_FAILURE"] == "1": + sys.exit(9) + shutil.rmtree(run) + sys.exit(0) + +child = subprocess.Popen([sys.executable, "-c", "import time; time.sleep(8)"]) + +def terminate(_signal, _frame): + (fixture / "term").touch() + sys.exit(143) + +signal.signal(signal.SIGTERM, terminate) +try: + run.mkdir(parents=True) + (run / "recovery").write_text("owned recovery fixture", encoding="utf-8") + (fixture / "pids.tmp").write_text(f"{os.getpid()} {child.pid}", encoding="utf-8") + (fixture / "pids.tmp").rename(fixture / "pids") + time.sleep(7) +finally: + child.terminate() + child.wait(timeout=2) + (fixture / "child-stopped").touch() +""" + with tempfile.TemporaryDirectory() as directory: + fixture = Path(directory) + (fixture / "admin-url").write_text("postgresql://fixture@127.0.0.1/test") + executable = fixture / "launcher" + executable.write_text(launcher, encoding="utf-8") + executable.chmod(0o700) + pids = fixture / "pids" + with subprocess.Popen( + ["bash", "-euo", "pipefail", "-c", driver, + "managed-scheduling-start", str(TABLES), mode], + env={**os.environ, "JOURNEY_TABLES_DIR": str(TABLES), + "FIXTURE": directory, "STOP_FAILURE": str(int(stop_failure))}, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, + start_new_session=True, + ) as process: + try: + deadline = time.monotonic() + 8 + while not pids.exists() and process.poll() is None and time.monotonic() < deadline: + time.sleep(0.02) + if not pids.exists(): + _, errors = process.communicate(timeout=10) + self.fail(f"managed launcher never reached startup: {errors}") + if mode == "cancel": + process.terminate() + _, errors = process.communicate(timeout=10) + term_seen = (fixture / "term").exists() + stop_seen = (fixture / "stop").exists() + managed_root = fixture / "run/secrets/scheduling-managed" + retained = (managed_root / "state" / ("a" * 32) / "recovery").is_file() + live = [] + for pid in pids.read_text(encoding="utf-8").split(): + status = subprocess.run( + ["ps", "-o", "stat=", "-p", pid], capture_output=True, text=True, + ).stdout.strip() + if status and not status.startswith("Z"): + live.append(pid) + report = json.loads((fixture / "run/run.json").read_text(encoding="utf-8")) + self.assertEqual(process.returncode, 143 if mode == "cancel" else 3, errors) + if mode == "timeout": + self.assertIn("did not finish within 120 seconds", report["harnessFailure"]) + self.assertFalse((fixture / "start.json").exists(), "unexpected start report") + self.assertEqual( + (term_seen, stop_seen, live, retained), + (True, True, [], stop_failure), errors, + ) + self.assertEqual(managed_root.exists(), stop_failure) + failures = report["cleanup"]["failures"] + self.assertEqual( + "cleanup hook cleanup_composed_managed_scheduling failed" in failures, + stop_failure, failures, + ) + if not stop_failure: + self.assertEqual(failures, [], errors) + else: + self.assertIn(f"managed Scheduling recovery state retained at {managed_root}", failures) + finally: + # The group contains only the fixture. Reap any escaped + # fake launcher and child when running against a broken runner. + subprocess.run( + ["kill", "-TERM", "--", f"-{process.pid}"], capture_output=True, + ) + + def test_startup_timeout_reaches_launcher_and_waits_for_child(self): + self.run_interrupted_start("timeout") + + def test_cancellation_before_run_id_stops_owned_state_after_launcher(self): + self.run_interrupted_start("cancel") + + def test_failed_shutdown_keeps_owned_recovery_state(self): + self.run_interrupted_start("cancel", stop_failure=True) + + class HookReceiverAndAdapterSource(unittest.TestCase): def test_hook_receiver_signature_verification(self): spec = importlib.util.spec_from_file_location( @@ -1303,9 +1741,9 @@ def test_hook_receiver_signature_verification(self): self.assertEqual(wrong_key_status, 403) def test_assert_signed_hook_acceptance_validates_value_free_record(self): - script = (TABLES / "own-provider.sh").read_text(encoding="utf-8") + script = (TABLES / "lib.sh").read_text(encoding="utf-8") match = re.search(r"^assert_signed_hook_acceptance\(\) \{\n.*?^\}\n", script, re.S | re.M) - self.assertIsNotNone(match, "own-provider must define assert_signed_hook_acceptance") + self.assertIsNotNone(match, "lib must define assert_signed_hook_acceptance") good = { "event": "signed-hook-accepted", "path": "/scheduling-events", diff --git a/products/platform/journeys/test_lib.sh b/products/platform/journeys/test_lib.sh index fc94e323fa..b5bb73992d 100644 --- a/products/platform/journeys/test_lib.sh +++ b/products/platform/journeys/test_lib.sh @@ -1819,6 +1819,8 @@ case_http() { drive 0 SCENARIO=http EXPECT_REFUSAL=1 -- --product alpha check "the observed 401 remains in the HTTP transcript" has "HTTP/1.1 401" "$out/alpha/call.http" check "the checked refusal passes the journey step" has $'alpha\tcall\tpass\t-' "$out/cells.tsv" + check_equal "a passing expected HTTP refusal adds no reader friction" 0 \ + "$(json '.cells[] | select(.product == "alpha") | .total.refusalsMet' "$out/summary.json")" begin_case http-source-bearer printf '{"access_token":"%s"}\n' "$token" >"$state/http-body.1" From a05c7b1659b1f277ee90cb13784ee2625da05ce9 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 19/55] feat(release): ship the Session binary from v0.51.0 Folds these reviewed commits: - fix(release): classify the Session binary as a distribution-only asset - feat(release): ship the Session binary from v0.51.0 Signed-off-by: Jeremi Joslin --- AGENTS.md | 5 +++-- crates/registry-rstack/src/model.rs | 2 +- .../registry-rstack/tests/release_manifest.rs | 14 +++++++++++++ crates/registry-session/README.md | 6 ++++-- .../scripts/generate-cli-reference.test.mjs | 6 +++--- .../src/content/docs/configure/session.mdx | 4 ++-- .../content/docs/reference/api-stability.mdx | 3 +-- docs/site/src/data/cli-reference.yaml | 2 +- products/platform/AGENTS.md | 2 +- products/platform/CHANGELOG.md | 7 +++++++ products/platform/README.md | 4 ++-- release/NIGHTLY.md | 6 +++--- release/OPERATIONS.md | 6 ++++-- release/VERIFY.md | 6 +++--- release/scripts/release_roster.py | 5 +++-- release/scripts/rstack_components.py | 2 +- release/scripts/test_registry_release.py | 20 ++++++++++++++----- .../scripts/test_registry_release_plans.py | 2 ++ release/scripts/test_release_roster.py | 16 ++++++++------- release/scripts/test_release_units.py | 13 ++++++++++++ release/scripts/test_rstack_components.py | 12 +++++++++++ release/units.yaml | 10 ++++++++++ 22 files changed, 114 insertions(+), 39 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 7f18798c38..fff41273da 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -362,8 +362,9 @@ Envoy gateway. It holds a person's tokens in memory and answers the gateway's per-call check. It issues no token and adds no product authority. Among workspace crates it depends on `registry-platform-*` only, and no product crate depends on it. It runs as one replica, with a check listener private to -the gateway. It is held out of releases while `SESSION_FIRST_RELEASE` in -`release/scripts/release_roster.py` is unset. +the gateway. Numbered releases ship its binary from v0.51.0, as +`SESSION_FIRST_RELEASE` in `release/scripts/release_roster.py` sets. `rstack` +does not install it. The adopter demo is maintained separately in [`registrystack/solmara-lab`](https://github.com/registrystack/solmara-lab). diff --git a/crates/registry-rstack/src/model.rs b/crates/registry-rstack/src/model.rs index 7192f6debe..1f8f7df973 100644 --- a/crates/registry-rstack/src/model.rs +++ b/crates/registry-rstack/src/model.rs @@ -11,7 +11,7 @@ const RELEASE_SCHEMAS: [&str; 2] = [ const PLATFORMS: [&str; 3] = ["linux-amd64", "linux-arm64", "macos-arm64"]; // Binaries published as standalone release assets that rstack never installs. // Mirrors DISTRIBUTION_ONLY_BINARIES in release/scripts/rstack_components.py. -const DISTRIBUTION_ONLY_BINARIES: [&str; 1] = ["registry-language-server"]; +const DISTRIBUTION_ONLY_BINARIES: [&str; 2] = ["registry-language-server", "registry-session"]; #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(deny_unknown_fields)] diff --git a/crates/registry-rstack/tests/release_manifest.rs b/crates/registry-rstack/tests/release_manifest.rs index 574d34ed9c..1f8e96ae8c 100644 --- a/crates/registry-rstack/tests/release_manifest.rs +++ b/crates/registry-rstack/tests/release_manifest.rs @@ -245,6 +245,18 @@ fn distribution_only_language_server_needs_no_component() { .contains_key("language-server")); } +#[test] +fn distribution_only_session_needs_no_component() { + let mut value = stack_v3_document(); + for platform in ["linux-amd64", "linux-arm64", "macos-arm64.tar.gz"] { + push_binary_payload(&mut value, &format!("registry-session-v0.44.0-{platform}")); + } + + let manifest = ReleaseManifest::parse(&serde_json::to_vec(&value).unwrap()) + .expect("the session service is a release asset, not an rstack component"); + assert!(!manifest.components.components.contains_key("session")); +} + #[test] fn unclassified_binary_payload_is_rejected() { for name in [ @@ -253,6 +265,8 @@ fn unclassified_binary_payload_is_rejected() { "registry-language-server-v0.44.0-windows-amd64", "registry-language-server-v0.44.0-macos-arm64", "registry-language-server-extra-v0.44.0-linux-amd64", + "registry-session-v0.44.0-macos-arm64", + "registry-session-v0.44.0-windows-amd64", ] { let mut value = stack_v3_document(); push_binary_payload(&mut value, name); diff --git a/crates/registry-session/README.md b/crates/registry-session/README.md index ae746385a3..70209fce28 100644 --- a/crates/registry-session/README.md +++ b/crates/registry-session/README.md @@ -8,8 +8,10 @@ bearer token to attach. The service checks. It never proxies. This is not an identity provider or a token issuer. It uses the configured identity provider's authorization-code and refresh-token flows. Sessions and pending sign-ins live only in memory, in one replica. A restart loses them. -The binary is source-build only while `SESSION_FIRST_RELEASE` in -`release/scripts/release_roster.py` is unset. +Numbered releases ship the binary for Linux amd64, Linux arm64 and macOS arm64 +from v0.51.0, as `SESSION_FIRST_RELEASE` in +`release/scripts/release_roster.py` sets. It is a standalone release asset: +`rstack` does not install it, and it has no installer or container image. ## Configuration and commands diff --git a/docs/site/scripts/generate-cli-reference.test.mjs b/docs/site/scripts/generate-cli-reference.test.mjs index 0d5aa2aabe..fb22e980b4 100644 --- a/docs/site/scripts/generate-cli-reference.test.mjs +++ b/docs/site/scripts/generate-cli-reference.test.mjs @@ -98,14 +98,14 @@ test('renders the committed catalogue while keeping the job host unreviewed and assert.doesNotMatch(pages.get('index.mdx'), /\(\.\/adapter-job\/\)/u); }); -test('keeps the session service unreviewed and source-build-only', async () => { +test('keeps the session service unreviewed with its numbered-release asset', async () => { const repoRoot = fileURLToPath(new URL('../../../', import.meta.url)); const docsRoot = fileURLToPath(new URL('../', import.meta.url)); const catalog = validateCatalog(await loadCatalog(repoRoot)); assert.ok(catalog.binaries.some((binary) => binary.name === 'registry-session')); const metadata = YAML.parse(await readFile(join(docsRoot, 'src/data/cli-reference.yaml'), 'utf8')); assert.ok(metadata.unreviewed_binaries.includes('registry-session')); - assert.ok(metadata.source_build_only_binaries.includes('registry-session')); + assert.ok(!metadata.source_build_only_binaries.includes('registry-session')); const pages = renderCatalog(catalog, metadata); for (const name of [ 'registry-session.mdx', @@ -114,7 +114,7 @@ test('keeps the session service unreviewed and source-build-only', async () => { ]) { assert.match(pages.get(name), /status: draft\ndraft: true/u); assert.match(pages.get(name), /last_reviewed: "unreviewed"/u); - assert.match(pages.get(name), /It has no numbered-release asset/u); + assert.doesNotMatch(pages.get(name), /no numbered-release asset/u); } assert.doesNotMatch(pages.get('index.mdx'), /\(\.\/registry-session\/\)/u); }); diff --git a/docs/site/src/content/docs/configure/session.mdx b/docs/site/src/content/docs/configure/session.mdx index b1a9b5899a..8d4b57a09f 100644 --- a/docs/site/src/content/docs/configure/session.mdx +++ b/docs/site/src/content/docs/configure/session.mdx @@ -25,8 +25,8 @@ The service is a relying party, not an identity provider or token issuer. It uses authorisation-code sign-in with PKCE and obtains one token set per distinct audience. The provider must return JWT access tokens with a readable audience, a lifetime and refresh tokens. -Build `registry-session` from the workspace source with `cargo build --locked -p registry-session`. -It is held out of numbered releases. +Numbered releases from v0.51.0 publish `registry-session` for Linux amd64, Linux arm64 and macOS arm64, beside the release's `SHA256SUMS`. +`rstack` does not install it: download the asset for your platform, or build it from the workspace source with `cargo build --locked -p registry-session`. Use `registry-session --help` for its command tree. {/* Evidence: crates/registry-session/src/signin.rs authorization_location, complete; diff --git a/docs/site/src/content/docs/reference/api-stability.mdx b/docs/site/src/content/docs/reference/api-stability.mdx index 4025926467..da50ca6153 100644 --- a/docs/site/src/content/docs/reference/api-stability.mdx +++ b/docs/site/src/content/docs/reference/api-stability.mdx @@ -148,8 +148,7 @@ release without deprecation: Engine, Casework, an external HTTP service, or the evaluation host, and are promised Registry Document Store is held out of the 1.0 release. -The session service is source-build only while `SESSION_FIRST_RELEASE` is unset. -No release script builds, stages or publishes `registry-session` yet. +Numbered releases ship the session service binary, `registry-session`, from v0.51.0. Before `v1.0.0`, one breaking release moves the promised products' version strings from `v1alpha1` to stable versions, so a `v1alpha1` version string that a 1.x release reads or writes diff --git a/docs/site/src/data/cli-reference.yaml b/docs/site/src/data/cli-reference.yaml index 499eb78b0c..c44a06ee35 100644 --- a/docs/site/src/data/cli-reference.yaml +++ b/docs/site/src/data/cli-reference.yaml @@ -12,4 +12,4 @@ status: current last_reviewed: 2026-11-28 unreviewed_binaries: [adapter, adapter-job, adapterctl, coordinator, coordinatorctl, documents, documentsctl, evidence-oid4vp, manifest, registry-mcp, registry-session, rstack, discovery, discoveryctl] -source_build_only_binaries: [adapter-job, evidence-oid4vp, registry-mcp, registry-session] +source_build_only_binaries: [adapter-job, evidence-oid4vp, registry-mcp] diff --git a/products/platform/AGENTS.md b/products/platform/AGENTS.md index 3f1d2fdbee..ec9675ce6f 100644 --- a/products/platform/AGENTS.md +++ b/products/platform/AGENTS.md @@ -12,7 +12,7 @@ fragments. `registry-session` depends on `registry-platform-*` workspace crates only. No product crate depends on it. It issues no tokens and owns no product authorisation. Keep its check listener private to the gateway and run one replica. `SESSION_FIRST_RELEASE` in `release/scripts/release_roster.py` -holds it out of releases while unset. +adds its binary to numbered releases from v0.51.0. Platform also owns [the configuration conventions](CONFIG-CONVENTIONS.md), the rules every product's configuration formats follow, and the shared reader diff --git a/products/platform/CHANGELOG.md b/products/platform/CHANGELOG.md index b170e7aa29..3c344dfabe 100644 --- a/products/platform/CHANGELOG.md +++ b/products/platform/CHANGELOG.md @@ -4,6 +4,13 @@ - `rstack dev check` refuses incompatible owner reports and mismatched identity facts. For Messaging it also checks the staged package, runtime input and tool around facts generation. +- Numbered releases ship `registry-session` for Linux amd64, Linux arm64 and + macOS arm64. It is a standalone release asset: `rstack` does not install it, + and it has no installer or container image. Upgrade: `rstack update` from + v0.44.0 to v0.50.0 refuses this release, because those `rstack` versions do + not recognise the `registry-session` asset. Run this release's `rstack` + installer as for a first installation, naming the components you use. + Later updates work from this release. - `rstack dev` can attach to PostgreSQL on an isolated development network when the administrator URL selects `transport=private-network-plaintext`. The runner pins the checked numeric address in the generated product URLs. diff --git a/products/platform/README.md b/products/platform/README.md index 24a8a87744..75f437c85e 100644 --- a/products/platform/README.md +++ b/products/platform/README.md @@ -18,8 +18,8 @@ Platform also owns the [session service](../../crates/registry-session/README.md `registry-session`. It holds a person's tokens on the server and answers an Envoy gateway's per-call check. It uses only platform workspace dependencies, and no product crate depends on it. Sessions live in memory in one replica. -The check listener is private to the gateway. The service stays source-build -only while `SESSION_FIRST_RELEASE` is unset. +The check listener is private to the gateway. Numbered releases ship its +binary from v0.51.0, as `SESSION_FIRST_RELEASE` sets. ## Crates diff --git a/release/NIGHTLY.md b/release/NIGHTLY.md index 505faa045e..4bb4a8550d 100644 --- a/release/NIGHTLY.md +++ b/release/NIGHTLY.md @@ -59,9 +59,9 @@ to v2.4 and v2.5 respectively, from the base version that version; `nightly.json`, the asset name, and its checksum authenticate the exact nightly source. No profile carries the Registry Document Store, which stays held out while -`DOCUMENTS_FIRST_RELEASE` is `None`. The session service is also held out -while `SESSION_FIRST_RELEASE` is `None`. No release script builds -`registry-session` yet. An incompatible inventory requires a +`DOCUMENTS_FIRST_RELEASE` is `None`. No profile carries `registry-session` +either: `SESSION_FIRST_RELEASE` adds it to numbered releases only, and the +frozen nightly inventories keep their existing set. An incompatible inventory requires a new schema and profile. The reader still accepts frozen `registry-stack.nightly.v1` manifests, including historical v0.39.0 nightlies that carried Relay, so an existing channel head can be reconciled and advanced diff --git a/release/OPERATIONS.md b/release/OPERATIONS.md index 24e54aa5ef..0ce5d1d311 100644 --- a/release/OPERATIONS.md +++ b/release/OPERATIONS.md @@ -216,8 +216,10 @@ exclude its image, binaries, installers, and client namespace. `RENDER_FIRST_RELEASE`, and `EVIDENCE_OID4VCI_IMAGE_FIRST_RELEASE` in `release/scripts/release_roster.py` own those boundaries. The Document Store is held out of every release while `DOCUMENTS_FIRST_RELEASE` is `None`. -The session service is held out while `SESSION_FIRST_RELEASE` is `None`. -No release script builds, stages or publishes `registry-session` yet. +`SESSION_FIRST_RELEASE` adds the `registry-session` binary for Linux amd64, +Linux arm64 and macOS arm64 from `v0.51.0`. It is a standalone asset of the +`session` release unit, not an `rstack` component, and has no image or +installer. The existing OID4VCI binary stays in earlier inventories. v0.38.0 also adds the Linux amd64 `discoveryctl` asset beside the existing Discovery runtime asset, completing the released authoring and runtime pair. Earlier releases require operators to diff --git a/release/VERIFY.md b/release/VERIFY.md index afce0e149b..1be92c8099 100644 --- a/release/VERIFY.md +++ b/release/VERIFY.md @@ -285,9 +285,9 @@ Registry Adapter binaries join in `v0.46.0`, as set by The Registry Document Store is held out of every release while `DOCUMENTS_FIRST_RELEASE` is `None`, and no release roster names it. `SESSION_FIRST_RELEASE` controls the `registry-session` binary for numbered -Linux amd64, Linux arm64 and macOS arm64 payloads. It remains unset pending -native release qualification. Session has no image or installer in this -roster, and the frozen nightly profiles keep their existing inventory. +Linux amd64, Linux arm64 and macOS arm64 payloads from `v0.51.0`. Session has +no image or installer in this roster, `rstack` does not install it, and the +frozen nightly profiles keep their existing inventory. `BREG_SERVICES_FIRST_RELEASE`, `MESSAGING_FIRST_RELEASE`, `RENDER_FIRST_RELEASE`, `EVIDENCE_OID4VCI_IMAGE_FIRST_RELEASE`, and the three Coordinator release constants in `release/scripts/release_roster.py` diff --git a/release/scripts/release_roster.py b/release/scripts/release_roster.py index f3ec613e85..12dcd8c463 100644 --- a/release/scripts/release_roster.py +++ b/release/scripts/release_roster.py @@ -69,7 +69,8 @@ it is releasable. ``SESSION_FIRST_RELEASE`` decides which numbered release first includes the -``registry-session`` binary in the native platform builds. Its image and +``registry-session`` binary in the native platform builds, from v0.51.0. It is +a standalone release asset that ``rstack`` does not install. Its image and the frozen nightly inventories are independent of this gate. ``PYTHON_311_ABI_FIRST_RELEASE`` is the single place that decides which @@ -113,7 +114,7 @@ DOCUMENTS_FIRST_RELEASE: tuple[int, int, int] | None = None -SESSION_FIRST_RELEASE: tuple[int, int, int] | None = None +SESSION_FIRST_RELEASE: tuple[int, int, int] | None = (0, 51, 0) COORDINATOR_BINARY_FIRST_RELEASE: tuple[int, int, int] = (0, 44, 0) diff --git a/release/scripts/rstack_components.py b/release/scripts/rstack_components.py index f7032e34ff..e9b838a22b 100644 --- a/release/scripts/rstack_components.py +++ b/release/scripts/rstack_components.py @@ -82,7 +82,7 @@ # These release binaries are consumed directly and are deliberately not # installed as product components by rstack. -DISTRIBUTION_ONLY_BINARIES = {"registry-language-server"} +DISTRIBUTION_ONLY_BINARIES = {"registry-language-server", "registry-session"} def _binary_name(asset_name: str, tag: str) -> tuple[str, str]: diff --git a/release/scripts/test_registry_release.py b/release/scripts/test_registry_release.py index ca17511f45..57e0b3cbff 100755 --- a/release/scripts/test_registry_release.py +++ b/release/scripts/test_registry_release.py @@ -3966,6 +3966,8 @@ def released(version: str) -> dict[str, str]: inventory.update({"rstack": version, "rstack-installer": version}) if module.release_roster.language_server_in_release(version_tuple): inventory["registry-language-server"] = version + if module.release_roster.session_in_release(version_tuple): + inventory["registry-session"] = version if module.release_roster.scheduling_installer_in_release(version_tuple): inventory["scheduling-installer"] = version if version_tuple >= (0, 39, 0): @@ -4090,6 +4092,8 @@ def released(version: str) -> dict[str, str]: inventory.update({"rstack": version, "rstack-installer": version}) if roster.language_server_in_release(version_tuple): inventory["registry-language-server"] = version + if roster.session_in_release(version_tuple): + inventory["registry-session"] = version if roster.scheduling_installer_in_release(version_tuple): inventory["scheduling-installer"] = version inventory.update({f"{name}-installer": version for name in module.release_roster.additional_installers(version_tuple)}) @@ -4122,11 +4126,13 @@ def released(version: str) -> dict[str, str]: before_session = released("0.50.0") at_session = released("0.51.0") session = "registry-session" - with mock.patch.object(module.release_roster, "SESSION_FIRST_RELEASE", (0, 51, 0)): - self.assertEqual([], module.artifact_inventory_errors("0.50.0", before_session)) - self.assertTrue(module.artifact_inventory_errors("0.50.0", before_session | {session: "0.50.0"})) - self.assertTrue(module.artifact_inventory_errors("0.51.0", at_session)) - self.assertEqual([], module.artifact_inventory_errors("0.51.0", at_session | {session: "0.51.0"})) + self.assertNotIn(session, before_session) + self.assertEqual("0.51.0", at_session[session]) + self.assertEqual([], module.artifact_inventory_errors("0.50.0", before_session)) + self.assertTrue(module.artifact_inventory_errors("0.50.0", before_session | {session: "0.50.0"})) + self.assertEqual([], module.artifact_inventory_errors("0.51.0", at_session)) + without_session = {name: value for name, value in at_session.items() if name != session} + self.assertTrue(module.artifact_inventory_errors("0.51.0", without_session)) # Holding the image does not hold the independently released binaries. with mock.patch.object( @@ -4257,6 +4263,8 @@ def test_breg_services_release_surface_begins_at_their_first_release( current.update({"rstack": version, "rstack-installer": version}) if module.release_roster.language_server_in_release(version_tuple): current["registry-language-server"] = version + if module.release_roster.session_in_release(version_tuple): + current["registry-session"] = version if module.release_roster.scheduling_installer_in_release(version_tuple): current["scheduling-installer"] = version current.update({f"{name}-installer": version for name in module.release_roster.additional_installers(version_tuple)}) @@ -6214,6 +6222,8 @@ def write_manifest( artifacts["rstack-installer"] = version if load_release_roster().language_server_in_release(version_tuple): artifacts["registry-language-server"] = version + if load_release_roster().session_in_release(version_tuple): + artifacts["registry-session"] = version if load_release_roster().scheduling_installer_in_release(version_tuple): artifacts["scheduling-installer"] = version if version_tuple >= (0, 39, 0): diff --git a/release/scripts/test_registry_release_plans.py b/release/scripts/test_registry_release_plans.py index c2a73948d8..0e479f25e9 100644 --- a/release/scripts/test_registry_release_plans.py +++ b/release/scripts/test_registry_release_plans.py @@ -177,6 +177,8 @@ def manifest(version: str, release_id: str, source_ref: str, status: str) -> dic inventory += ("rstack", "rstack-installer") if REGISTRY_RELEASE.release_roster.language_server_in_release(version_tuple): inventory += ("registry-language-server",) + if REGISTRY_RELEASE.release_roster.session_in_release(version_tuple): + inventory += ("registry-session",) if REGISTRY_RELEASE.release_roster.scheduling_installer_in_release(version_tuple): inventory += ("scheduling-installer",) if version_tuple >= (0, 39, 0): diff --git a/release/scripts/test_release_roster.py b/release/scripts/test_release_roster.py index ef760bad06..f98e3871bd 100644 --- a/release/scripts/test_release_roster.py +++ b/release/scripts/test_release_roster.py @@ -115,14 +115,16 @@ def test_document_store_is_held_out_of_every_release(self) -> None: self.assertFalse(release_roster.documents_in_release((0, 43, 99))) self.assertTrue(release_roster.documents_in_release((0, 44, 0))) - def test_session_service_is_held_out_of_every_release(self) -> None: - self.assertIsNone(release_roster.SESSION_FIRST_RELEASE) - for version in ((0, 48, 0), (0, 49, 0), (1, 0, 0)): + def test_session_service_joins_the_numbered_v0_51_0_release(self) -> None: + binary = ("registry-session", "registry-session") + self.assertEqual((0, 51, 0), release_roster.SESSION_FIRST_RELEASE) + for version in ((0, 48, 0), (0, 49, 0), (0, 50, 0)): self.assertFalse(release_roster.session_in_release(version)) - self.assertNotIn( - ("registry-session", "registry-session"), - release_roster.additional_platform_builds(version), - ) + self.assertNotIn(binary, release_roster.additional_platform_builds(version)) + for version in ((0, 51, 0), (1, 0, 0)): + self.assertTrue(release_roster.session_in_release(version)) + self.assertIn(binary, release_roster.additional_platform_builds(version)) + self.assertNotIn(binary, release_roster.additional_platform_builds(version, nightly=True)) def test_session_first_release_adds_its_native_binary_to_the_roster(self) -> None: binary = ("registry-session", "registry-session") diff --git a/release/scripts/test_release_units.py b/release/scripts/test_release_units.py index d494d57819..a299c8e965 100644 --- a/release/scripts/test_release_units.py +++ b/release/scripts/test_release_units.py @@ -41,6 +41,7 @@ def test_registry_maps_every_approved_release_unit(self) -> None: "messaging", "render", "scheduling", + "session", }, set(registry.names), ) @@ -69,6 +70,18 @@ def test_language_server_owns_only_its_standalone_artifacts(self) -> None: ), ) + def test_session_owns_only_its_native_platform_artifacts(self) -> None: + registry = self.module.load_registry() + unit = registry.get("session") + self.assertEqual(("registry-session",), unit.members) + for name in ( + "registry-session-v0.51.0-linux-amd64", + "registry-session-v0.51.0-linux-arm64", + "registry-session-v0.51.0-macos-arm64.tar.gz", + ): + with self.subTest(name=name): + self.assertEqual("session", registry.artifact_owner(name)) + def test_discovery_identity_and_candidate_roster_are_unit_scoped(self) -> None: self.assertEqual("v1.2.3", self.module.asset_tag("1.2.3")) self.assertEqual( diff --git a/release/scripts/test_rstack_components.py b/release/scripts/test_rstack_components.py index 7b327d8eae..c8b39abf50 100644 --- a/release/scripts/test_rstack_components.py +++ b/release/scripts/test_rstack_components.py @@ -6,6 +6,7 @@ import json import re import unittest +from unittest import mock from pathlib import Path from release.scripts import release_candidate, rstack_components @@ -90,6 +91,17 @@ def test_language_server_remains_a_distribution_only_binary(self) -> None: rstack_components.DISTRIBUTION_ONLY_BINARIES, ) + def test_session_is_a_distribution_only_binary_when_it_joins_the_release(self) -> None: + with mock.patch.object(release_candidate.release_roster, "SESSION_FIRST_RELEASE", (0, 51, 0)): + current = payloads("0.51.0") + self.assertIn( + "registry-session-v0.51.0-linux-amd64", + {payload["name"] for payload in current}, + ) + document = rstack_components.build_component_manifest("0.51.0", current) + self.assertNotIn("session", document["components"]) + self.assertIn("registry-session", rstack_components.DISTRIBUTION_ONLY_BINARIES) + def test_rstack_validator_exempts_the_same_distribution_only_binaries(self) -> None: model = ( Path(__file__).resolve().parents[2] / "crates/registry-rstack/src/model.rs" diff --git a/release/units.yaml b/release/units.yaml index d39b6b88a0..3b2b1c3df8 100644 --- a/release/units.yaml +++ b/release/units.yaml @@ -153,6 +153,16 @@ "artifact_patterns": ["scheduling-v*-*", "scheduling-install.sh", "schedulingctl-v*-*"], "dependencies": [], "candidate": null + }, + "session": { + "display_name": "Registry Session", + "status": "held", + "tag_prefix": "session/", + "asset_prefix": "registry-session", + "members": ["registry-session"], + "artifact_patterns": ["registry-session-v*-*"], + "dependencies": [], + "candidate": null } } } From f7321195742cd7d0b3a4cf9b96a59fa9e74dfa99 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 20/55] feat(platform): accept Compose secret mounts explicitly and read public documents as public Folds these reviewed commits: - feat(platform): accept Compose secret mounts explicitly and read public documents as public - fix(evidence): classify provision as a JSON-reporting command Signed-off-by: Jeremi Joslin --- crates/registry-adapter-core/src/runtime.rs | 6 +- crates/registry-adapter-engine/src/load.rs | 4 +- crates/registry-adapter-job/src/store.rs | 2 +- crates/registry-adapter/src/serve.rs | 4 +- .../registry-adapterctl/src/job_provision.rs | 8 +- crates/registry-adapterctl/src/provision.rs | 8 +- .../src/action_evidence_config.rs | 4 +- crates/registry-breg/src/event_destination.rs | 2 +- crates/registry-breg/src/runtime_config.rs | 8 +- crates/registry-bregctl/src/provision.rs | 8 +- crates/registry-casework/src/config.rs | 16 +- crates/registry-casework/src/store.rs | 16 +- crates/registry-caseworkctl/src/provision.rs | 2 +- .../schema/connections.schema.json | 15 +- crates/registry-cli-api/src/connection.rs | 2 +- crates/registry-coordinator/src/access.rs | 2 +- .../src/access/token_characterisation.rs | 4 +- crates/registry-coordinator/src/deployment.rs | 2 +- crates/registry-coordinator/src/provision.rs | 13 +- .../tests/static_key_set.rs | 2 +- .../registry-coordinator/tests/support/mod.rs | 4 +- crates/registry-documents/src/config.rs | 16 +- crates/registry-documents/src/store.rs | 16 +- crates/registry-documentsctl/src/provision.rs | 8 +- crates/registry-evidence-oid4vp/src/auth.rs | 2 +- crates/registry-evidencectl/src/lib.rs | 1 + .../src/store_provision.rs | 10 +- crates/registry-mcp-edge/src/config.rs | 15 +- crates/registry-messaging/src/config.rs | 8 +- crates/registry-messaging/src/providers.rs | 15 +- .../registry-messaging/src/smtp/settings.rs | 12 +- crates/registry-messaging/src/store.rs | 16 +- crates/registry-messagingctl/src/provision.rs | 8 +- crates/registry-platform-config/src/blocks.rs | 58 ++++++- .../src/blocks_tests.rs | 53 ++++++- .../registry-platform-config/src/secrets.rs | 138 +++++++++++++---- .../src/secrets_tests.rs | 146 +++++++++++++++++- .../registry-platform-objectstore/src/s3.rs | 9 +- .../src/task_grant/config.rs | 2 +- crates/registry-render/src/auth.rs | 7 +- crates/registry-render/src/runtime.rs | 13 ++ crates/registry-render/src/seal.rs | 7 +- crates/registry-scheduling/src/config.rs | 8 +- crates/registry-scheduling/src/store.rs | 16 +- .../registry-schedulingctl/src/provision.rs | 8 +- .../docs/security/hardening-checklist.mdx | 34 ++-- .../src/content/docs/security/messaging.mdx | 11 +- .../schemas/job-runtime.v1alpha1.schema.json | 15 +- .../schemas/runtime.v1alpha1.schema.json | 15 +- .../mcp-runtime/mcp-runtime.schema.json | 15 +- .../review-runtime/review-runtime.schema.json | 15 +- .../generated/runtime/runtime.schema.json | 15 +- .../generated/runtime/runtime.schema.json | 15 +- .../generated/runtime/runtime.schema.json | 15 +- .../generated/runtime/runtime.schema.json | 15 +- .../oid4vci-runtime.schema.json | 15 +- .../oid4vp-runtime/oid4vp-runtime.schema.json | 15 +- .../generated/runtime/runtime.schema.json | 15 +- products/platform/CHANGELOG.md | 12 ++ .../mcp-runtime/mcp-runtime.schema.json | 15 +- .../runtime-config-blocks.schema.json | 15 +- .../session-runtime.schema.json | 15 +- .../schemas/task-connection.schema.json | 15 +- products/render/schemas/runtime.schema.json | 15 +- .../generated/runtime/runtime.schema.json | 15 +- 65 files changed, 866 insertions(+), 170 deletions(-) diff --git a/crates/registry-adapter-core/src/runtime.rs b/crates/registry-adapter-core/src/runtime.rs index 8e766523eb..2d1b7c1cb0 100644 --- a/crates/registry-adapter-core/src/runtime.rs +++ b/crates/registry-adapter-core/src/runtime.rs @@ -807,9 +807,9 @@ mod tests { id: LocalId::new("case-deployment").expect("id"), endpoints: UniqueIdList::new(vec![binding()]).expect("unique"), secret_providers: Some(SecretProvidersConfig { - file: Some(registry_platform_config::FileSecretProviderConfig { - root: "/run/secrets/adapter".into(), - }), + file: Some(registry_platform_config::FileSecretProviderConfig::new( + "/run/secrets/adapter".into(), + )), environment: None, }), outbound_tls: Some(OutboundTls { diff --git a/crates/registry-adapter-engine/src/load.rs b/crates/registry-adapter-engine/src/load.rs index 998fb86cd8..35c0fd49ee 100644 --- a/crates/registry-adapter-engine/src/load.rs +++ b/crates/registry-adapter-engine/src/load.rs @@ -2158,9 +2158,7 @@ audit: {retentionDays: 90} std::fs::set_permissions(&token, std::fs::Permissions::from_mode(0o600)) .expect("private mode"); let providers = SecretProvidersConfig { - file: Some(FileSecretProviderConfig { - root: root.path().to_path_buf(), - }), + file: Some(FileSecretProviderConfig::new(root.path().to_path_buf())), environment: None, }; diff --git a/crates/registry-adapter-job/src/store.rs b/crates/registry-adapter-job/src/store.rs index 5dc4a03766..2c51791e9c 100644 --- a/crates/registry-adapter-job/src/store.rs +++ b/crates/registry-adapter-job/src/store.rs @@ -745,7 +745,7 @@ fn tls_connector( .map_err(|_| invalid("no platform root certificate could be loaded")); }; let protected = resolver - .resolve(reference.as_str()) + .resolve_public_document(reference.as_str()) .map_err(|error| store_secret_error("caBundleRef", reference.as_str(), &error))?; postgres_tls_from_pem(protected.expose_secret()).map_err(|_| { StoreError::Pool("store.caBundleRef: put a usable PEM CA bundle in the secret".to_owned()) diff --git a/crates/registry-adapter/src/serve.rs b/crates/registry-adapter/src/serve.rs index 9350638609..f8dc460e39 100644 --- a/crates/registry-adapter/src/serve.rs +++ b/crates/registry-adapter/src/serve.rs @@ -277,7 +277,7 @@ async fn issuer_keys( ), JwksSource::Static { document_ref } | JwksSource::TestIssuer { document_ref } => { let document = resolver - .resolve(document_ref) + .resolve_public_document(document_ref) .map_err(|_| invalid("the static key document could not be resolved"))?; let jwks = parse_static_jwks(document.expose_secret()).map_err(|error| { match error { @@ -425,7 +425,7 @@ fn tls_connector( } if let Some(reference) = &config.ca_bundle_ref { let certificate = resolver - .resolve(reference) + .resolve_public_document(reference) .map_err(|_| invalid("the trusted root could not be resolved"))?; let mut roots = rustls::RootCertStore::empty(); use rustls::pki_types::pem::PemObject as _; diff --git a/crates/registry-adapterctl/src/job_provision.rs b/crates/registry-adapterctl/src/job_provision.rs index 714783bd35..df6bc745b5 100644 --- a/crates/registry-adapterctl/src/job_provision.rs +++ b/crates/registry-adapterctl/src/job_provision.rs @@ -80,7 +80,13 @@ pub(crate) fn load( ) })?; let resolve = |member: &str, reference: &SecretReference| { - resolver.resolve(reference.as_str()).map_err(|error| { + // The CA bundle is a public document; the URLs are secrets. + let read = if member == "caBundleRef" { + resolver.resolve_public_document(reference.as_str()) + } else { + resolver.resolve(reference.as_str()) + }; + read.map_err(|error| { refuse( &format!("/store/{member}"), describe_secret_failure(&format!("store.{member}"), reference.as_str(), &error), diff --git a/crates/registry-adapterctl/src/provision.rs b/crates/registry-adapterctl/src/provision.rs index 8d10db71a1..88ba0eb0f3 100644 --- a/crates/registry-adapterctl/src/provision.rs +++ b/crates/registry-adapterctl/src/provision.rs @@ -78,7 +78,13 @@ pub(crate) fn load( ) })?; let resolve = |member: &str, reference: &str| { - secrets.resolve(reference).map_err(|error| { + // The CA bundle is a public document; the URLs are secrets. + let read = if member == "caBundleRef" { + secrets.resolve_public_document(reference) + } else { + secrets.resolve(reference) + }; + read.map_err(|error| { refuse( "config.refused", &format!("/database/{member}"), diff --git a/crates/registry-breg/src/action_evidence_config.rs b/crates/registry-breg/src/action_evidence_config.rs index ef601cf818..dbf9ef48e9 100644 --- a/crates/registry-breg/src/action_evidence_config.rs +++ b/crates/registry-breg/src/action_evidence_config.rs @@ -95,14 +95,14 @@ pub fn activate( .as_ref() .map(|reference| { secrets - .resolve_reference(reference) + .resolve_public_document_reference(reference) .map(|secret| secret.expose_secret().to_vec()) .map_err(|_| Error::Secret) }) .transpose()?; let token_provider = token_provider(binding, secrets, ca_bundle.as_deref())?; let keys = secrets - .resolve_reference(&binding.trusted_jwks_ref) + .resolve_public_document_reference(&binding.trusted_jwks_ref) .map_err(|_| Error::Secret)?; let jwks = registry_platform_crypto::parse_json_strict(keys.expose_secret()) .map_err(|_| Error::InvalidBinding)?; diff --git a/crates/registry-breg/src/event_destination.rs b/crates/registry-breg/src/event_destination.rs index 942aea3859..146ac86eb7 100644 --- a/crates/registry-breg/src/event_destination.rs +++ b/crates/registry-breg/src/event_destination.rs @@ -496,7 +496,7 @@ impl EventDestinationConfig { let ca_bundle = tls .ca_bundle_ref .as_ref() - .map(|reference| secrets.resolve_reference(reference)) + .map(|reference| secrets.resolve_public_document_reference(reference)) .transpose()?; let client_identity = tls .client_identity_ref diff --git a/crates/registry-breg/src/runtime_config.rs b/crates/registry-breg/src/runtime_config.rs index 9adc280ea2..ee74636545 100644 --- a/crates/registry-breg/src/runtime_config.rs +++ b/crates/registry-breg/src/runtime_config.rs @@ -1748,7 +1748,7 @@ impl RuntimeConfig { .with_attempt_timeout(self.operational_timeouts.http_request) .with_connect_timeout(self.operational_timeouts.http_request); if let Some(reference) = &oauth.ca_bundle_ref { - let ca = resolver.resolve_reference(reference)?; + let ca = resolver.resolve_public_document_reference(reference)?; provider = provider.with_trusted_root_certificates(ca.expose_secret().to_vec()); } Arc::new( @@ -2223,7 +2223,9 @@ impl RuntimeConfig { }; let connection = match &self.database.ca_bundle_ref { Some(roots_ref) => { - let roots = self.secret_resolver()?.resolve_reference(roots_ref)?; + let roots = self + .secret_resolver()? + .resolve_public_document_reference(roots_ref)?; ConnectionConfig::require_tls_config_with_roots_pem( postgres, roots.expose_secret(), @@ -3309,7 +3311,7 @@ impl OidcVerifierConfig { } OidcJwksSource::Static { document_ref } => { let document = resolver - .resolve_reference(document_ref) + .resolve_public_document_reference(document_ref) .map_err(|_| RuntimeConfigError::InvalidOidc)?; if document.is_empty() || u64::try_from(document.len()) diff --git a/crates/registry-bregctl/src/provision.rs b/crates/registry-bregctl/src/provision.rs index c0d4680736..7b1c23c9ff 100644 --- a/crates/registry-bregctl/src/provision.rs +++ b/crates/registry-bregctl/src/provision.rs @@ -93,7 +93,13 @@ pub(crate) fn load( .secret_resolver() .map_err(|error| runtime_file_refused(&absolute, &error))?; let resolve = |member: &str, reference| { - secrets.resolve_reference(reference).map_err(|_| { + // The CA bundle is a public document; the URLs are secrets. + let read = if member == "caBundleRef" { + secrets.resolve_public_document_reference(reference) + } else { + secrets.resolve_reference(reference) + }; + read.map_err(|_| { refused( "config.refused", &format!("/database/{member}"), diff --git a/crates/registry-casework/src/config.rs b/crates/registry-casework/src/config.rs index 9992084b05..28c15649f8 100644 --- a/crates/registry-casework/src/config.rs +++ b/crates/registry-casework/src/config.rs @@ -1881,13 +1881,15 @@ async fn issuer_keys( issuer: id.to_owned(), reason, }; - let document = secrets.resolve(document_ref).map_err(|error| { - jwks_secret(describe_secret_failure( - &format!("authentication.oidc.issuers.{id}.jwksSource.documentRef"), - document_ref, - &error, - )) - })?; + let document = secrets + .resolve_public_document(document_ref) + .map_err(|error| { + jwks_secret(describe_secret_failure( + &format!("authentication.oidc.issuers.{id}.jwksSource.documentRef"), + document_ref, + &error, + )) + })?; let jwks = parse_static_jwks(document.expose_secret()).map_err(|error| match error { OidcError::StaticKeySet(refusal) => jwks_secret(refusal.to_string()), diff --git a/crates/registry-casework/src/store.rs b/crates/registry-casework/src/store.rs index 85bd647f3c..97817bac20 100644 --- a/crates/registry-casework/src/store.rs +++ b/crates/registry-casework/src/store.rs @@ -706,13 +706,15 @@ fn tls_connector( return Err(StoreError::Configuration); } if let Some(reference) = &config.ca_bundle_ref { - let certificate = secrets.resolve(reference).map_err(|error| { - StoreError::SecretConfiguration(describe_secret_failure( - "database.caBundleRef", - reference, - &error, - )) - })?; + let certificate = secrets + .resolve_public_document(reference) + .map_err(|error| { + StoreError::SecretConfiguration(describe_secret_failure( + "database.caBundleRef", + reference, + &error, + )) + })?; let mut roots = rustls::RootCertStore::empty(); use rustls::pki_types::pem::PemObject as _; let mut count = 0usize; diff --git a/crates/registry-caseworkctl/src/provision.rs b/crates/registry-caseworkctl/src/provision.rs index c84aae73fd..b5c1ae4cfa 100644 --- a/crates/registry-caseworkctl/src/provision.rs +++ b/crates/registry-caseworkctl/src/provision.rs @@ -78,7 +78,7 @@ fn load(path: &Path, declared: DeclaredPosture) -> Result {} - None => providers.file = Some(FileSecretProviderConfig { root }), + None => providers.file = Some(FileSecretProviderConfig::new(root)), } Ok(reference) } diff --git a/crates/registry-coordinator/src/access.rs b/crates/registry-coordinator/src/access.rs index ecad3c0531..f68377dbdf 100644 --- a/crates/registry-coordinator/src/access.rs +++ b/crates/registry-coordinator/src/access.rs @@ -717,7 +717,7 @@ impl IssuerConfig { let value = secrets .resolver(development) .map_err(|_| refused())? - .resolve(document_ref) + .resolve_public_document(document_ref) .map_err(|_| refused())?; Arc::new(JwksFetcher::new_static( parse_static_jwks(value.expose_secret()).map_err(|error| match error { diff --git a/crates/registry-coordinator/src/access/token_characterisation.rs b/crates/registry-coordinator/src/access/token_characterisation.rs index 94bc03bcf8..1ab7ec9c0d 100644 --- a/crates/registry-coordinator/src/access/token_characterisation.rs +++ b/crates/registry-coordinator/src/access/token_characterisation.rs @@ -213,7 +213,9 @@ fn static_secrets(root: &std::path::Path, signer: &TokenSigner) -> SecretProvide .expect("owner-only key file"); } SecretProvidersConfig { - file: Some(registry_platform_config::FileSecretProviderConfig { root: root_path }), + file: Some(registry_platform_config::FileSecretProviderConfig::new( + root_path, + )), environment: None, } } diff --git a/crates/registry-coordinator/src/deployment.rs b/crates/registry-coordinator/src/deployment.rs index 51e0d371b2..bac4b4f091 100644 --- a/crates/registry-coordinator/src/deployment.rs +++ b/crates/registry-coordinator/src/deployment.rs @@ -639,7 +639,7 @@ fn tls( let _ = rustls::crypto::ring::default_provider().install_default(); if let Some(r) = &database.ca_bundle_ref { let value = secrets - .resolve(r) + .resolve_public_document(r) .map_err(|_| fail("make the database TLS root available"))?; use rustls::pki_types::pem::PemObject as _; let mut roots = rustls::RootCertStore::empty(); diff --git a/crates/registry-coordinator/src/provision.rs b/crates/registry-coordinator/src/provision.rs index 349a34a588..e470e2b681 100644 --- a/crates/registry-coordinator/src/provision.rs +++ b/crates/registry-coordinator/src/provision.rs @@ -94,9 +94,16 @@ fn load(path: &Path, declared: DeclaredPosture) -> Result Some( - secret_text(&resolver, reference, "/database/caBundleRef") - .map_err(|diagnostic| vec![*diagnostic])? - .as_bytes() + resolver + .resolve_public_document(reference) + .map_err(|_| { + vec![*refusal( + "/database/caBundleRef", + "the referenced CA bundle could not be read", + "Make the CA bundle the runtime file names available to this command.", + )] + })? + .expose_secret() .to_vec(), ), None => None, diff --git a/crates/registry-coordinator/tests/static_key_set.rs b/crates/registry-coordinator/tests/static_key_set.rs index 6e5d8f8330..266a899028 100644 --- a/crates/registry-coordinator/tests/static_key_set.rs +++ b/crates/registry-coordinator/tests/static_key_set.rs @@ -30,7 +30,7 @@ async fn build(document: &Value) -> Result<(), registry_coordinator::Coordinator fs::write(&file, document.to_string()).unwrap(); fs::set_permissions(&file, fs::Permissions::from_mode(0o600)).unwrap(); let secrets = SecretProvidersConfig { - file: Some(FileSecretProviderConfig { root: root_path }), + file: Some(FileSecretProviderConfig::new(root_path)), environment: None, }; let envelope = RuntimeEnvelope { diff --git a/crates/registry-coordinator/tests/support/mod.rs b/crates/registry-coordinator/tests/support/mod.rs index bcbf639a78..9a60cbf788 100644 --- a/crates/registry-coordinator/tests/support/mod.rs +++ b/crates/registry-coordinator/tests/support/mod.rs @@ -80,9 +80,7 @@ pub fn config( event_sources: BTreeMap::new(), deployment: None, secret_providers: SecretProvidersConfig { - file: Some(FileSecretProviderConfig { - root: root.to_path_buf(), - }), + file: Some(FileSecretProviderConfig::new(root.to_path_buf())), environment: Some(EnvironmentSecretProviderConfig {}), }, database: registry_platform_config::DatabaseConfig { diff --git a/crates/registry-documents/src/config.rs b/crates/registry-documents/src/config.rs index 9615637320..defeeba877 100644 --- a/crates/registry-documents/src/config.rs +++ b/crates/registry-documents/src/config.rs @@ -767,13 +767,15 @@ impl RuntimeConfig { network.declared_jwks_fetch_policy(), ), JwksSource::Static { document_ref } | JwksSource::TestIssuer { document_ref } => { - let document = secrets.resolve(document_ref).map_err(|error| { - RuntimeConfigError::OidcJwksSecret(describe_secret_failure( - &document_field, - document_ref, - &error, - )) - })?; + let document = secrets + .resolve_public_document(document_ref) + .map_err(|error| { + RuntimeConfigError::OidcJwksSecret(describe_secret_failure( + &document_field, + document_ref, + &error, + )) + })?; let jwks = parse_static_key_set(&document_field, document.expose_secret())?; JwksFetcher::new_static(jwks, JwksFetcherConfig::defaults()) } diff --git a/crates/registry-documents/src/store.rs b/crates/registry-documents/src/store.rs index d3f8081f7d..338df54c31 100644 --- a/crates/registry-documents/src/store.rs +++ b/crates/registry-documents/src/store.rs @@ -385,13 +385,15 @@ fn tls_connector( return Err(StoreError::Configuration); } if let Some(reference) = &config.ca_bundle_ref { - let certificate = secrets.resolve(reference).map_err(|error| { - StoreError::SecretConfiguration(describe_secret_failure( - "database.caBundleRef", - reference, - &error, - )) - })?; + let certificate = secrets + .resolve_public_document(reference) + .map_err(|error| { + StoreError::SecretConfiguration(describe_secret_failure( + "database.caBundleRef", + reference, + &error, + )) + })?; let mut roots = rustls::RootCertStore::empty(); use rustls::pki_types::pem::PemObject as _; let mut count = 0usize; diff --git a/crates/registry-documentsctl/src/provision.rs b/crates/registry-documentsctl/src/provision.rs index a5118bdacc..df4cca3d74 100644 --- a/crates/registry-documentsctl/src/provision.rs +++ b/crates/registry-documentsctl/src/provision.rs @@ -71,7 +71,13 @@ pub(crate) fn load( ) })?; let resolve = |member: &str, reference: &str| { - secrets.resolve(reference).map_err(|error| { + // The CA bundle is a public document; the URLs are secrets. + let read = if member == "caBundleRef" { + secrets.resolve_public_document(reference) + } else { + secrets.resolve(reference) + }; + read.map_err(|error| { refuse( "config.refused", &format!("/database/{member}"), diff --git a/crates/registry-evidence-oid4vp/src/auth.rs b/crates/registry-evidence-oid4vp/src/auth.rs index 8625098d2f..d58f669a2d 100644 --- a/crates/registry-evidence-oid4vp/src/auth.rs +++ b/crates/registry-evidence-oid4vp/src/auth.rs @@ -221,7 +221,7 @@ impl TokenAuthenticator { } JwksSource::Static { document_ref } | JwksSource::TestIssuer { document_ref } => { let document = secrets - .resolve(document_ref) + .resolve_public_document(document_ref) .map_err(|_| AuthSetupError::StaticKeySecret)?; let jwks = parse_static_jwks(document.expose_secret()) .map_err(|error| AuthSetupError::StaticKeySet(error.to_string()))?; diff --git a/crates/registry-evidencectl/src/lib.rs b/crates/registry-evidencectl/src/lib.rs index 39f420d415..93724e8f3f 100644 --- a/crates/registry-evidencectl/src/lib.rs +++ b/crates/registry-evidencectl/src/lib.rs @@ -1771,6 +1771,7 @@ mod tests { "target explain", "tooling editor", "oid4vci check", + "provision", ]; /// Protocol and artifact output, or a foreground service without a report. diff --git a/crates/registry-evidencectl/src/store_provision.rs b/crates/registry-evidencectl/src/store_provision.rs index f0a1fd2189..7c0c86876b 100644 --- a/crates/registry-evidencectl/src/store_provision.rs +++ b/crates/registry-evidencectl/src/store_provision.rs @@ -93,7 +93,7 @@ fn diagnostics(config: &StoreProvisionDocument, defers: impl Fn(&str) -> bool) - let mut block = |error: registry_platform_config::ConfigBlockError| { findings.push(Diagnostic::error( "evidence.store-provision.configuration", - &format!("/{}", error.field().replace('.', "/")), + format!("/{}", error.field().replace('.', "/")), error.to_string(), "Correct the named field in the provisioning file.", )); @@ -254,7 +254,13 @@ fn load(path: &Path, declared: DeclaredPosture) -> Result { let field = format!("{base}.jwksSource.documentRef"); - let secret = secrets.resolve(document_ref).map_err(|error| { - IssuerBuildError::Secret { - field: field.clone(), - reference: document_ref.clone(), - error, - } - })?; + let secret = + secrets + .resolve_public_document(document_ref) + .map_err(|error| IssuerBuildError::Secret { + field: field.clone(), + reference: document_ref.clone(), + error, + })?; let keys = parse_static_jwks(secret.expose_secret()).map_err(|error| { IssuerBuildError::StaticKeySet { field: field.clone(), diff --git a/crates/registry-messaging/src/config.rs b/crates/registry-messaging/src/config.rs index 203cd5ea30..fa9921dde9 100644 --- a/crates/registry-messaging/src/config.rs +++ b/crates/registry-messaging/src/config.rs @@ -1250,12 +1250,12 @@ impl RuntimeConfig { } OidcJwksSource::Static { document_ref } | OidcJwksSource::TestIssuer { document_ref } => { - let document = secrets.resolve(document_ref).map_err(|error| { - RuntimeConfigError::OidcJwksSecret { + let document = secrets + .resolve_public_document(document_ref) + .map_err(|error| RuntimeConfigError::OidcJwksSecret { issuer: id.to_owned(), message: describe_secret_failure(&document_field, document_ref, &error), - } - })?; + })?; let jwks = parse_static_jwks(document.expose_secret()).map_err(|error| { match error { // The document is the operator's own file, so its text names the diff --git a/crates/registry-messaging/src/providers.rs b/crates/registry-messaging/src/providers.rs index 6cb3a06c4a..f7db2e9287 100644 --- a/crates/registry-messaging/src/providers.rs +++ b/crates/registry-messaging/src/providers.rs @@ -91,9 +91,18 @@ pub fn activate_providers( .to_owned(), ) })?; - Some(resolve(secrets, "bundleRef", &profile.bundle_ref).map_err( - |reason| refused(format!("tlsTrustProfiles.{name}: {reason}")), - )?) + Some( + secrets + .resolve_public_document(&profile.bundle_ref) + .map_err(|error| { + let reason = describe_secret_failure( + "bundleRef", + &profile.bundle_ref, + &error, + ); + refused(format!("tlsTrustProfiles.{name}: {reason}")) + })?, + ) } }; let provider = Arc::new( diff --git a/crates/registry-messaging/src/smtp/settings.rs b/crates/registry-messaging/src/smtp/settings.rs index ee5ad1ce32..1203b3da2c 100644 --- a/crates/registry-messaging/src/smtp/settings.rs +++ b/crates/registry-messaging/src/smtp/settings.rs @@ -310,9 +310,15 @@ impl SmtpProviderSettings { fn tls_parameters(&self, secrets: &SecretResolver) -> Result { let mut builder = TlsParameters::builder(self.host.clone()); if let Some(reference) = &self.ca_bundle_ref { - let pem = secrets.resolve(reference).map_err(|error| { - SmtpSettingsError::Secret(describe_secret_failure("caBundleRef", reference, &error)) - })?; + let pem = secrets + .resolve_public_document(reference) + .map_err(|error| { + SmtpSettingsError::Secret(describe_secret_failure( + "caBundleRef", + reference, + &error, + )) + })?; let certificates = CertificateDer::pem_slice_iter(pem.expose_secret()) .collect::, _>>() .map_err(|_| SmtpSettingsError::InvalidTrustedRootCertificate)?; diff --git a/crates/registry-messaging/src/store.rs b/crates/registry-messaging/src/store.rs index a242049777..502cf4b469 100644 --- a/crates/registry-messaging/src/store.rs +++ b/crates/registry-messaging/src/store.rs @@ -460,13 +460,15 @@ fn tls_connector( return Err(StoreError::Configuration); } if let Some(reference) = &config.ca_bundle_ref { - let certificate = secrets.resolve(reference).map_err(|error| { - StoreError::SecretConfiguration(describe_secret_failure( - "database.caBundleRef", - reference, - &error, - )) - })?; + let certificate = secrets + .resolve_public_document(reference) + .map_err(|error| { + StoreError::SecretConfiguration(describe_secret_failure( + "database.caBundleRef", + reference, + &error, + )) + })?; let mut roots = rustls::RootCertStore::empty(); use rustls::pki_types::pem::PemObject as _; let mut count = 0usize; diff --git a/crates/registry-messagingctl/src/provision.rs b/crates/registry-messagingctl/src/provision.rs index 8388648e78..e826deaa0c 100644 --- a/crates/registry-messagingctl/src/provision.rs +++ b/crates/registry-messagingctl/src/provision.rs @@ -75,7 +75,13 @@ pub(crate) fn load( ) })?; let resolve = |member: &str, reference: &str| { - secrets.resolve(reference).map_err(|error| { + // The CA bundle is a public document; the URLs are secrets. + let read = if member == "caBundleRef" { + secrets.resolve_public_document(reference) + } else { + secrets.resolve(reference) + }; + read.map_err(|error| { refuse( "config.refused", &format!("/database/{member}"), diff --git a/crates/registry-platform-config/src/blocks.rs b/crates/registry-platform-config/src/blocks.rs index 74ea24fbda..c6e035e9bd 100644 --- a/crates/registry-platform-config/src/blocks.rs +++ b/crates/registry-platform-config/src/blocks.rs @@ -138,9 +138,52 @@ pub struct FileSecretProviderConfig { /// the runtime user with mode 0400 or 0600, or owned by root with no /// access beyond group read (0440 or 0640) when the runtime is not root. /// A process that declared development loads a file with looser read or - /// mode bits and logs a warning. + /// mode bits and logs a warning. A public document, such as a static JWKS + /// or a CA bundle, may also be readable by group and others. #[cfg_attr(feature = "schema", schemars(extend("pattern" = "^/")))] pub root: PathBuf, + /// `compose-native` also accepts a root-owned regular file with one hard + /// link and mode exactly 0444, the shape of a Docker Compose secret mount. + /// Every user in the container can read such a file. Startup and `check` + /// report this explicit production setting. Absent, the stricter rule + /// above applies. + #[serde(default, skip_serializing_if = "Option::is_none")] + #[cfg_attr(feature = "schema", schemars(with = "Stated"))] + mount_policy: Option>, +} + +impl FileSecretProviderConfig { + /// The standard file provider, with the strict production permission policy. + #[must_use] + pub fn new(root: PathBuf) -> Self { + Self { + root, + mount_policy: None, + } + } +} + +static COMPOSE_NATIVE_SECRET_MOUNT: ExplicitProductionSetting = ExplicitProductionSetting { + code: "platform.posture.compose-native-secret-mount", + key: "mountPolicy", + summary: "The file secret provider accepts root-owned, mode 0444 Compose mounts", +}; + +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)] +#[serde(rename_all = "kebab-case")] +enum SecretMountPolicy { + ComposeNative, +} + +impl ExplicitClass for SecretMountPolicy { + const SETTINGS: &'static [&'static ExplicitProductionSetting] = &[&COMPOSE_NATIVE_SECRET_MOUNT]; + + fn explicit_setting(&self) -> Option<&'static ExplicitProductionSetting> { + match self { + Self::ComposeNative => Some(&COMPOSE_NATIVE_SECRET_MOUNT), + } + } } /// The environment secret provider. It takes no settings. @@ -218,7 +261,18 @@ impl SecretProvidersConfig { .as_ref() .map_or_else(|| Path::new(""), |file| file.root.as_path()), ) - .map(|resolver| resolver.in_development(witness)) + .map(|resolver| { + let resolver = resolver.in_development(witness); + if self.file.as_ref().is_some_and(|file| { + file.mount_policy + .as_ref() + .is_some_and(|policy| *policy.get() == SecretMountPolicy::ComposeNative) + }) { + resolver.with_compose_native_mounts() + } else { + resolver + } + }) } } diff --git a/crates/registry-platform-config/src/blocks_tests.rs b/crates/registry-platform-config/src/blocks_tests.rs index 328904befa..22d7c16419 100644 --- a/crates/registry-platform-config/src/blocks_tests.rs +++ b/crates/registry-platform-config/src/blocks_tests.rs @@ -91,7 +91,7 @@ fn secret_providers_resolver_relaxes_secret_file_permissions_only_with_a_develop .expect("set 0644"); let config = SecretProvidersConfig { - file: Some(FileSecretProviderConfig { root: canonical }), + file: Some(FileSecretProviderConfig::new(canonical)), environment: None, }; @@ -128,6 +128,57 @@ fn secret_providers_resolver_relaxes_secret_file_permissions_only_with_a_develop assert_eq!(secret.expose_secret(), b"shared-secret-canary"); } +#[test] +fn compose_native_mount_is_an_explicit_production_setting_at_its_member() { + #[derive(Deserialize)] + #[serde(rename_all = "camelCase")] + struct Runtime { + secret_providers: SecretProvidersConfig, + } + + let loader = crate::RuntimeConfigLoader::new( + crate::RuntimeEnvelope { + api_version: "registry.registrystack.org/example/v1alpha1", + kind: "ExampleRuntimeConfig", + }, + crate::DeclaredPosture { + posture: crate::Posture::Production, + source: crate::PostureSource::Flag, + }, + ); + let strict = "apiVersion: registry.registrystack.org/example/v1alpha1\nkind: ExampleRuntimeConfig\nsecretProviders:\n file:\n root: /run/secrets\n"; + let omitted = loader.parse_str::(strict, |_| None).unwrap(); + assert!(omitted.posture.explicit_settings().is_empty()); + + let explicit = format!("{strict} mountPolicy: compose-native\n"); + let loaded = loader.parse_str::(&explicit, |_| None).unwrap(); + assert!(loaded.development.is_none()); + loaded.config.secret_providers.check().unwrap(); + let [notice] = loaded.posture.explicit_settings() else { + panic!("one explicit setting is recorded"); + }; + assert_eq!( + notice.setting.code, + "platform.posture.compose-native-secret-mount" + ); + assert_eq!( + notice.pointer.as_deref(), + Some("/secretProviders/file/mountPolicy") + ); + assert!(notice.position.is_some()); + assert!(loaded + .posture + .ready_member() + .get("explicitProductionSettings") + .is_none()); + assert!(loader + .parse_str::( + &explicit.replace("compose-native", "allow-world-readable"), + |_| None + ) + .is_err()); +} + #[test] fn database_debug_redacts_every_reference() { let database: DatabaseConfig = read_block( diff --git a/crates/registry-platform-config/src/secrets.rs b/crates/registry-platform-config/src/secrets.rs index b259994bea..106c64b3f0 100644 --- a/crates/registry-platform-config/src/secrets.rs +++ b/crates/registry-platform-config/src/secrets.rs @@ -393,12 +393,25 @@ impl fmt::Debug for ProtectedSecret { /// The production rule accepts a file owned by the runtime user with mode 0400 /// or 0600, and a root-owned file with no bit outside 0640 when the runtime is /// not root. [`Self::in_development`] relaxes the read and mode-bit checks to a -/// warning for a process that declared development. +/// warning for a process that declared development. The file provider's +/// explicit `mountPolicy: compose-native` setting also accepts a root-owned, +/// single-link regular file with mode exactly 0444. A public document read +/// through [`Self::resolve_public_document`] skips only the group and world +/// read checks. #[derive(Debug)] pub struct SecretResolver { providers: BTreeSet, file_root: PathBuf, + file_access: FileAccess, +} + +#[derive(Clone, Copy, Debug, Default)] +struct FileAccess { development: bool, + compose_native: bool, + /// A public document such as a JWKS or a CA bundle: anyone may read it, + /// so only who can change it is checked. + public_document: bool, } impl SecretResolver { @@ -411,7 +424,7 @@ impl SecretResolver { Self { providers: BTreeSet::new(), file_root: PathBuf::new(), - development: false, + file_access: FileAccess::default(), } } @@ -430,22 +443,40 @@ impl SecretResolver { Ok(Self { providers, file_root, - development: false, + file_access: FileAccess::default(), }) } /// Apply the development rule when the process holds the witness. Without - /// it the resolver keeps the production rule, so a production path cannot - /// relax the rule by mistake. + /// it the resolver keeps the configured production rule. #[must_use] pub fn in_development(mut self, witness: Option<&DevelopmentWitness>) -> Self { - self.development = witness.is_some(); + self.file_access.development = witness.is_some(); + self + } + + pub(crate) fn with_compose_native_mounts(mut self) -> Self { + self.file_access.compose_native = true; self } /// Run every check a read runs, without retaining the bytes. A check tool /// uses this to give the verdict the runtime would give. pub fn inspect_reference(&self, reference: &SecretReference) -> Result<(), SecretError> { + self.inspect_with(reference, self.file_access) + } + + /// [`Self::inspect_reference`] for a public document, with the rule + /// [`Self::resolve_public_document_reference`] applies. + pub fn inspect_public_document(&self, reference: &SecretReference) -> Result<(), SecretError> { + self.inspect_with(reference, self.public_access()) + } + + fn inspect_with( + &self, + reference: &SecretReference, + access: FileAccess, + ) -> Result<(), SecretError> { if !self.providers.contains(&reference.provider()) { return Err(SecretError::ProviderDisabled); } @@ -454,11 +485,40 @@ impl SecretResolver { .map(|_| ()) .ok_or(SecretError::Unavailable), SecretProvider::File => { - open_secret_file(&self.file_root, reference.name(), self.development).map(|_| ()) + open_secret_file(&self.file_root, reference.name(), access).map(|_| ()) } } } + /// Resolve a public document, such as a static JWKS or a PEM CA bundle, + /// named by a `secret:env/NAME` or `secret:file/name` reference. + /// + /// Public documents are not secrets: a file may be readable by group and + /// others, so a root-owned mode 0444 Compose mount loads with no setting. + /// Every other file check still applies: a single-link regular file owned + /// by root or the runtime user, with no group or world write and no + /// execute or special bit, reached by the root-confined walk. The caller + /// still parses and checks the document itself. + pub fn resolve_public_document(&self, reference: &str) -> Result { + let reference = SecretReference::parse(reference)?; + self.resolve_public_document_reference(&reference) + } + + /// [`Self::resolve_public_document`] for an already parsed reference. + pub fn resolve_public_document_reference( + &self, + reference: &SecretReference, + ) -> Result { + validate_secret(self.read_with(reference, self.public_access())?.0) + } + + fn public_access(&self) -> FileAccess { + FileAccess { + public_document: true, + ..self.file_access + } + } + /// Resolve one exact `secret:env/NAME` or `secret:file/name` reference. pub fn resolve(&self, reference: &str) -> Result { let reference = SecretReference::parse(reference)?; @@ -482,6 +542,14 @@ impl SecretResolver { pub fn resolve_binary_reference( &self, reference: &SecretReference, + ) -> Result { + self.read_with(reference, self.file_access) + } + + fn read_with( + &self, + reference: &SecretReference, + access: FileAccess, ) -> Result { if !self.providers.contains(&reference.provider()) { return Err(SecretError::ProviderDisabled); @@ -489,9 +557,7 @@ impl SecretResolver { let bytes = match reference.provider() { SecretProvider::Environment => read_environment(reference.name())?, - SecretProvider::File => { - read_secret_file(&self.file_root, reference.name(), self.development)? - } + SecretProvider::File => read_secret_file(&self.file_root, reference.name(), access)?, }; validate_binary_secret(bytes) } @@ -519,9 +585,9 @@ pub const MAX_SECRET_LINKS: usize = 8; fn read_secret_file( root: &Path, name: &str, - development: bool, + access: FileAccess, ) -> Result>, SecretError> { - read_bounded(open_secret_file(root, name, development)?) + read_bounded(open_secret_file(root, name, access)?) } /// What the rule looks at in an opened file. @@ -549,7 +615,7 @@ enum FileKind { fn judge( facts: Facts, euid: u32, - development: bool, + access: FileAccess, ) -> Result, SecretFileCheck> { use SecretFileCheck::{ GroupAccess, HardLinked, ModeBits, NotRegular, Owner, WorldReadable, WorldWritable, @@ -567,19 +633,31 @@ fn judge( if facts.mode & 0o002 != 0 { return Err(WorldWritable); } + if access.compose_native && facts.uid == 0 && facts.mode == 0o444 { + return Ok(Vec::new()); + } let own = facts.uid == euid; let mut failed = Vec::new(); - if facts.mode & 0o005 != 0 { - failed.push(WorldReadable); - } - let group_bits = if own { 0o070 } else { 0o030 }; - if facts.mode & group_bits != 0 { - failed.push(GroupAccess); - } - if facts.mode & 0o7100 != 0 || (own && facts.mode & 0o400 == 0) { - failed.push(ModeBits); + if access.public_document { + if facts.mode & 0o030 != 0 { + failed.push(GroupAccess); + } + if facts.mode & 0o7101 != 0 || (own && facts.mode & 0o400 == 0) { + failed.push(ModeBits); + } + } else { + if facts.mode & 0o005 != 0 { + failed.push(WorldReadable); + } + let group_bits = if own { 0o070 } else { 0o030 }; + if facts.mode & group_bits != 0 { + failed.push(GroupAccess); + } + if facts.mode & 0o7100 != 0 || (own && facts.mode & 0o400 == 0) { + failed.push(ModeBits); + } } - match (development, failed.first()) { + match (access.development, failed.first()) { (false, Some(check)) => Err(*check), _ => Ok(failed), } @@ -588,7 +666,7 @@ fn judge( /// Walk `name` from the root by openat steps, following only relative /// downward links, then judge the descriptor that will be read. #[cfg(unix)] -fn open_secret_file(root: &Path, name: &str, development: bool) -> Result { +fn open_secret_file(root: &Path, name: &str, access: FileAccess) -> Result { use rustix::{ fs::{Mode, OFlags}, io::Errno, @@ -652,12 +730,12 @@ fn open_secret_file(root: &Path, name: &str, development: bool) -> Result Result<(), SecretError> { +fn judge_file(file: &File, access: FileAccess) -> Result<(), SecretError> { use std::os::unix::fs::{FileTypeExt as _, MetadataExt as _, PermissionsExt as _}; let metadata = file.metadata().map_err(|_| SecretError::Read)?; @@ -679,7 +757,7 @@ fn judge_file(file: &File, development: bool) -> Result<(), SecretError> { mode: metadata.permissions().mode() & 0o7777, nlink: metadata.nlink(), }; - match judge(facts, rustix::process::geteuid().as_raw(), development) { + match judge(facts, rustix::process::geteuid().as_raw(), access) { Err(check) => Err(SecretError::UnsafeFile(check)), Ok(warnings) => { for check in warnings { @@ -701,13 +779,13 @@ fn judge_file(file: &File, development: bool) -> Result<(), SecretError> { fn read_secret_file( root: &Path, name: &str, - development: bool, + access: FileAccess, ) -> Result>, SecretError> { - read_bounded(open_secret_file(root, name, development)?) + read_bounded(open_secret_file(root, name, access)?) } #[cfg(not(unix))] -fn open_secret_file(root: &Path, name: &str, _development: bool) -> Result { +fn open_secret_file(root: &Path, name: &str, _access: FileAccess) -> Result { let path = root.join(name); let metadata = std::fs::symlink_metadata(&path).map_err(|_| SecretError::Unavailable)?; if metadata.file_type().is_symlink() || !metadata.is_file() { diff --git a/crates/registry-platform-config/src/secrets_tests.rs b/crates/registry-platform-config/src/secrets_tests.rs index a09e5f8a0c..51acf33774 100644 --- a/crates/registry-platform-config/src/secrets_tests.rs +++ b/crates/registry-platform-config/src/secrets_tests.rs @@ -88,18 +88,100 @@ fn the_decision_table_gives_one_answer_per_owner_mode_and_posture() { for (row, euid, uid, mode, kind, nlink, production, development) in rows { let f = facts(*kind, *uid, *mode, *nlink); assert_eq!( - observed(judge(f, *euid, false)), + observed(judge(f, *euid, FileAccess::default())), *production, "{row} in production" ); assert_eq!( - observed(judge(f, *euid, true)), + observed(judge( + f, + *euid, + FileAccess { + development: true, + ..FileAccess::default() + } + )), *development, "{row} in development" ); } } +#[test] +fn compose_native_adds_only_root_owned_single_link_mode_0444() { + use FileKind::{Directory, Regular}; + use Outcome::{Load, Refuse}; + const APP: u32 = 10001; + let access = FileAccess { + compose_native: true, + ..FileAccess::default() + }; + for (uid, mode, kind, nlink, expected) in [ + (0, 0o444, Regular, 1, Load), + (0, 0o440, Regular, 1, Load), + (APP, 0o400, Regular, 1, Load), + (APP, 0o444, Regular, 1, Refuse(WorldReadable)), + (10002, 0o444, Regular, 1, Refuse(Owner)), + (0, 0o644, Regular, 1, Refuse(WorldReadable)), + (0, 0o464, Regular, 1, Refuse(WorldReadable)), + (0, 0o446, Regular, 1, Refuse(WorldWritable)), + (0, 0o444, Regular, 2, Refuse(HardLinked)), + (0, 0o444, Directory, 1, Refuse(NotRegular)), + ] { + assert_eq!( + observed(judge(facts(kind, uid, mode, nlink), APP, access)), + expected + ); + } +} + +#[test] +fn a_public_document_drops_only_the_read_checks() { + use FileKind::{Directory, Regular}; + use Outcome::{Load, Refuse, Warn}; + const APP: u32 = 10001; + let production = FileAccess { + public_document: true, + ..FileAccess::default() + }; + let development = FileAccess { + development: true, + ..production + }; + #[rustfmt::skip] + let rows: &[(&str, u32, u32, FileKind, u64, Outcome, Outcome)] = &[ + ("compose JWKS", 0, 0o444, Regular, 1, Load, Load), + ("root 0644", 0, 0o644, Regular, 1, Load, Load), + ("root 0640", 0, 0o640, Regular, 1, Load, Load), + ("own 0444", APP, 0o444, Regular, 1, Load, Load), + ("own 0644", APP, 0o644, Regular, 1, Load, Load), + ("own 0400", APP, 0o400, Regular, 1, Load, Load), + ("group write", 0, 0o464, Regular, 1, Refuse(GroupAccess), Warn(&[GroupAccess])), + ("own group w", APP, 0o664, Regular, 1, Refuse(GroupAccess), Warn(&[GroupAccess])), + ("group exec", 0, 0o454, Regular, 1, Refuse(GroupAccess), Warn(&[GroupAccess])), + ("world exec", 0, 0o445, Regular, 1, Refuse(ModeBits), Warn(&[ModeBits])), + ("owner exec", APP, 0o544, Regular, 1, Refuse(ModeBits), Warn(&[ModeBits])), + ("setuid", 0, 0o4444, Regular, 1, Refuse(ModeBits), Warn(&[ModeBits])), + ("world write", 0, 0o446, Regular, 1, Refuse(WorldWritable), Refuse(WorldWritable)), + ("other owner", 10002, 0o444, Regular, 1, Refuse(Owner), Refuse(Owner)), + ("hard linked", 0, 0o444, Regular, 2, Refuse(HardLinked), Refuse(HardLinked)), + ("directory", 0, 0o555, Directory, 1, Refuse(NotRegular), Refuse(NotRegular)), + ]; + for (row, uid, mode, kind, nlink, in_production, in_development) in rows { + let f = facts(*kind, *uid, *mode, *nlink); + assert_eq!( + observed(judge(f, APP, production)), + *in_production, + "{row} in production" + ); + assert_eq!( + observed(judge(f, APP, development)), + *in_development, + "{row} in development" + ); + } +} + #[test] fn every_check_has_a_unique_code_a_value_free_message_and_a_full_stop_fix() { let all = [ @@ -216,6 +298,66 @@ mod filesystem { .map(|secret| secret.expose_secret().to_vec()) } + fn load_public(resolver: &SecretResolver, name: &str) -> Result, SecretError> { + resolver + .resolve_public_document(&format!("secret:file/{name}")) + .map(|document| document.expose_secret().to_vec()) + } + + #[test] + fn a_world_readable_public_document_loads_without_any_secret_setting() { + let root = tempfile::tempdir().expect("root"); + write(root.path(), "jwks.json", 0o444); + write(root.path(), "ca.pem", 0o644); + let resolver = resolver(root.path()); + assert_eq!( + load_public(&resolver, "jwks.json").expect("loads"), + b"file-canary" + ); + assert_eq!( + load_public(&resolver, "ca.pem").expect("loads"), + b"file-canary" + ); + let reference = SecretReference::parse("secret:file/jwks.json").expect("reference"); + resolver + .inspect_public_document(&reference) + .expect("the check gives the same verdict"); + assert_eq!( + load(&resolver, "jwks.json"), + Err(SecretError::UnsafeFile(WorldReadable)), + "a secret read keeps the strict rule" + ); + assert_eq!( + resolver.inspect_reference(&reference), + Err(SecretError::UnsafeFile(WorldReadable)) + ); + } + + #[test] + fn a_writable_or_escaping_public_document_is_refused() { + let root = tempfile::tempdir().expect("root"); + write(root.path(), "group-writable.json", 0o664); + write(root.path(), "world-writable.json", 0o666); + let outside = tempfile::tempdir().expect("outside"); + write(outside.path(), "jwks.json", 0o444); + symlink(outside.path().join("jwks.json"), root.path().join("escape")).expect("link"); + let resolver = resolver(root.path()); + assert_eq!( + load_public(&resolver, "group-writable.json"), + Err(SecretError::UnsafeFile(GroupAccess)) + ); + assert_eq!( + load_public(&resolver, "world-writable.json"), + Err(SecretError::UnsafeFile(WorldWritable)) + ); + assert_eq!( + load_public(&resolver, "escape"), + load(&resolver, "escape"), + "an absolute link is refused as it is for a secret" + ); + assert!(load_public(&resolver, "escape").is_err()); + } + #[test] fn a_relative_link_inside_the_root_loads_the_file_it_names() { let root = tempfile::tempdir().expect("root"); diff --git a/crates/registry-platform-objectstore/src/s3.rs b/crates/registry-platform-objectstore/src/s3.rs index 15ae9aea63..26f8d28534 100644 --- a/crates/registry-platform-objectstore/src/s3.rs +++ b/crates/registry-platform-objectstore/src/s3.rs @@ -218,8 +218,13 @@ impl S3Settings { .connect_timeout(connect_timeout(self.timeout)) .destination(&self.destination); if let Some(reference) = &self.ca_bundle_ref { - builder = - builder.trusted_root_certificates(resolve(reference)?.expose_secret().to_vec()); + builder = builder.trusted_root_certificates( + resolver + .resolve_public_document_reference(reference) + .map_err(|_| ObjectStoreError::Secret)? + .expose_secret() + .to_vec(), + ); } let scope = hex::encode(Sha256::digest(scope_input.as_bytes())); let binding_digest = binding_digest(namespace, &self.bucket_url, &self.region, &scope)?; diff --git a/crates/registry-platform-oidc/src/task_grant/config.rs b/crates/registry-platform-oidc/src/task_grant/config.rs index bb0501ca76..f172f2c9d7 100644 --- a/crates/registry-platform-oidc/src/task_grant/config.rs +++ b/crates/registry-platform-oidc/src/task_grant/config.rs @@ -145,7 +145,7 @@ impl TaskGrantStatusRegistry { let ca = config .ca_bundle_ref .as_ref() - .map(|reference| secrets.resolve_reference(reference)) + .map(|reference| secrets.resolve_public_document_reference(reference)) .transpose() .map_err(|_| TaskGrantError::Configuration)?; let mut token = PrivateKeyJwtConfig::new( diff --git a/crates/registry-render/src/auth.rs b/crates/registry-render/src/auth.rs index dc275abfa9..65073d5040 100644 --- a/crates/registry-render/src/auth.rs +++ b/crates/registry-render/src/auth.rs @@ -71,9 +71,12 @@ async fn entry_verifier( } registry_platform_config::JwksSource::Static { document_ref } | registry_platform_config::JwksSource::TestIssuer { document_ref } => { - let bytes = crate::runtime::resolve_secret(runtime, witness, document_ref)?; + let document = crate::runtime::resolve_public_document(runtime, witness, document_ref) + .map_err(|error| { + RenderProblem::new(ProblemKind::RuntimeInvalid, format!("{error}")) + })?; let keys = - registry_platform_oidc::parse_static_jwks(&bytes).map_err(|error| match error { + registry_platform_oidc::parse_static_jwks(document.expose_secret()).map_err(|error| match error { OidcError::StaticKeySet(refused) => RenderProblem::new( ProblemKind::RuntimeInvalid, format!( diff --git a/crates/registry-render/src/runtime.rs b/crates/registry-render/src/runtime.rs index d6cc696eb8..371a6814fe 100644 --- a/crates/registry-render/src/runtime.rs +++ b/crates/registry-render/src/runtime.rs @@ -2221,6 +2221,19 @@ pub fn resolve_protected_secret( .resolve(reference) } +/// Resolve a public document, such as a static JWKS or a PEM CA bundle, under +/// the providers the runtime declares. Group and other may read the file. +pub fn resolve_public_document( + runtime: &RenderRuntime, + witness: Option<&DevelopmentWitness>, + reference: &str, +) -> Result { + runtime + .secret_providers + .resolver(witness)? + .resolve_public_document(reference) +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/registry-render/src/seal.rs b/crates/registry-render/src/seal.rs index 0d0a120481..f02ff67847 100644 --- a/crates/registry-render/src/seal.rs +++ b/crates/registry-render/src/seal.rs @@ -1199,8 +1199,8 @@ impl TimestampAuthority { let Some(reference) = authority.ca_bundle_ref.as_deref() else { return Self::new(seal_id, authority, None, peer_policy); }; - let bundle = crate::runtime::resolve_protected_secret(runtime, witness, reference) - .map_err(|error| { + let bundle = crate::runtime::resolve_public_document(runtime, witness, reference).map_err( + |error| { refusal( seal_id, "timestampAuthority/caBundleRef", @@ -1212,7 +1212,8 @@ impl TimestampAuthority { "Provide the timestamp authority's PEM CA bundle under the secret provider \ the reference names.", ) - })?; + }, + )?; Self::new( seal_id, authority, diff --git a/crates/registry-scheduling/src/config.rs b/crates/registry-scheduling/src/config.rs index 0f8b2328a2..ce061cf4d2 100644 --- a/crates/registry-scheduling/src/config.rs +++ b/crates/registry-scheduling/src/config.rs @@ -1339,12 +1339,12 @@ impl RuntimeConfig { ) } JwksSource::Static { document_ref } | JwksSource::TestIssuer { document_ref } => { - let document = secrets.resolve(document_ref).map_err(|error| { - RuntimeConfigError::OidcJwksSecret { + let document = secrets + .resolve_public_document(document_ref) + .map_err(|error| RuntimeConfigError::OidcJwksSecret { issuer: id.to_owned(), message: describe_secret_failure(&document_field, document_ref, &error), - } - })?; + })?; let jwks = parse_static_jwks(document.expose_secret()).map_err(|error| { match error { // The operator's document broke a key set rule: say diff --git a/crates/registry-scheduling/src/store.rs b/crates/registry-scheduling/src/store.rs index d70eebedb7..ead4b590e5 100644 --- a/crates/registry-scheduling/src/store.rs +++ b/crates/registry-scheduling/src/store.rs @@ -5693,13 +5693,15 @@ fn tls_connector( return Err(StoreError::Configuration); } if let Some(reference) = &config.ca_bundle_ref { - let certificate = secrets.resolve(reference).map_err(|error| { - StoreError::SecretConfiguration(describe_secret_failure( - "database.caBundleRef", - reference, - &error, - )) - })?; + let certificate = secrets + .resolve_public_document(reference) + .map_err(|error| { + StoreError::SecretConfiguration(describe_secret_failure( + "database.caBundleRef", + reference, + &error, + )) + })?; let mut roots = rustls::RootCertStore::empty(); use rustls::pki_types::pem::PemObject as _; let mut count = 0usize; diff --git a/crates/registry-schedulingctl/src/provision.rs b/crates/registry-schedulingctl/src/provision.rs index a4d30ea8db..34c1aedacf 100644 --- a/crates/registry-schedulingctl/src/provision.rs +++ b/crates/registry-schedulingctl/src/provision.rs @@ -75,7 +75,13 @@ pub(crate) fn load( ) })?; let resolve = |member: &str, reference: &str| { - secrets.resolve(reference).map_err(|error| { + // The CA bundle is a public document; the URLs are secrets. + let read = if member == "caBundleRef" { + secrets.resolve_public_document(reference) + } else { + secrets.resolve(reference) + }; + read.map_err(|error| { refuse( "config.refused", &format!("/database/{member}"), diff --git a/docs/site/src/content/docs/security/hardening-checklist.mdx b/docs/site/src/content/docs/security/hardening-checklist.mdx index 3e8a54adec..d14ae2b4f1 100644 --- a/docs/site/src/content/docs/security/hardening-checklist.mdx +++ b/docs/site/src/content/docs/security/hardening-checklist.mdx @@ -93,6 +93,11 @@ A file the runtime user owns with any group access is refused. Group read is acc file root owns. Give that file's group to the runtime user alone, because every member of the group can read the secret. On a plain host that is every member of the group in `/etc/group`. +Two inputs widen only the read checks. The explicit `secretProviders.file.mountPolicy: compose-native` +setting also accepts a root-owned file at mode exactly `0444`, the Docker Compose secret shape. A +[public document](#public-configuration-files), such as a static JWKS or a CA bundle, may be read by +group and others with no setting. + Registry Evidence and both wallet adapters require a real secret root directory owned by root or the runtime account. The runtime must be able to open and search it. Clear group and other write bits in both postures, even on a read-only mount. `evidencectl doctor` checks the same root rule. @@ -123,11 +128,19 @@ refusal holds in development. Production refuses all of them. on a memory-backed volume. - **The Helm chart.** The chart stages each secret into a memory volume owned by the runtime user at mode `0400`, which the rule accepts. It does not use `fsGroup`. See the chart's README. -- **Docker Compose.** Set ownership and mode on the host. Compose ignores `uid`, `gid`, and - `mode` for [file-backed service secrets](https://docs.docker.com/reference/compose-file/container-spec/#secrets). - Mount the directory read-only and verify the numeric IDs and permissions inside the container. - Follow the [Messaging Compose setup](../../operate/messaging/#mount-secret-files-with-docker-compose) - for a directory bind and replacement procedure. +- **Docker Compose.** Compose ignores `uid`, `gid`, and `mode` for + [file-backed service secrets](https://docs.docker.com/reference/compose-file/container-spec/#secrets), + and on some hosts presents each file root-owned at mode `0444`, which the default rule refuses. + Either set ownership and mode on the host, mount the directory read-only and verify the numeric + IDs and permissions inside the container, or write + `secretProviders.file.mountPolicy: compose-native`. That setting admits only a root-owned + regular file with one link and mode exactly `0444` under the declared root. Every user in the + container can read such a file, so use it in a container that runs one service under one + runtime identity. Startup and the production check report the setting as + `platform.posture.compose-native-secret-mount`. Writable files, other owners, extra links and + paths outside the root stay refused. The + [Messaging Compose setup](../../operate/messaging/#mount-secret-files-with-docker-compose) + shows both routes. {/* Evidence: crates/registry-evidence/src/bundle.rs, validate_secret_root; deploy/helm/registry-stack/templates/evidence-deployment.yaml, stage-evidence-inputs; @@ -138,9 +151,12 @@ refusal holds in development. Production refuses all of them. Protect who can replace public trust material. Replacing an issuer's static JWKS or a CA bundle changes which keys or certificates your deployment trusts. -- If an input such as `jwksSource.documentRef` or `database.caBundleRef` references - `secret:file/`, stage it with the same owner, mode and link rules as the other files under - `secretProviders.file.root`. +- A static JWKS or a CA bundle is a public document, not a secret. An input such as + `jwksSource.documentRef` or `database.caBundleRef` may reference `secret:file/`. The + runtime then reads it under `secretProviders.file.root` with the walk, owner and link rules of a + secret, but group and other may read it. A root-owned Compose mount at mode `0444` needs no + setting. Group or other write access, an execute bit, another owner or a second link is still + refused. The runtime still parses the JWKS or PEM before use. - If a runtime checks its configuration path with the shared trusted path rule, give it an absolute, normalised path without symbolic links. In production, root or the runtime user must own the file and its ancestors. Clear group and other write access. The rule permits a root-owned sticky @@ -151,7 +167,7 @@ changes which keys or certificates your deployment trusts. {/* Evidence: crates/registry-platform-config/src/blocks.rs, JwksSource, DatabaseConfig; crates/registry-platform-config/src/loader.rs, require_trusted_runtime_path; - crates/registry-platform-config/src/secrets.rs, SecretResolver, open_secret_file. */} + crates/registry-platform-config/src/secrets.rs, SecretResolver, resolve_public_document, open_secret_file. */} ## Check BReg and Casework authority diff --git a/docs/site/src/content/docs/security/messaging.mdx b/docs/site/src/content/docs/security/messaging.mdx index 4b6ccfc23a..7307ba028c 100644 --- a/docs/site/src/content/docs/security/messaging.mdx +++ b/docs/site/src/content/docs/security/messaging.mdx @@ -360,6 +360,13 @@ The boundaries hold only if your deployment does the following. queued, `unknown` and retained callback work has settled; or drain or cancel those messages first. Same receiver credential rotation needs none of this. +14. Write `secretProviders.file.mountPolicy: compose-native` only for a container that runs + Messaging alone under one runtime identity. + The setting accepts root-owned Compose secret mounts at mode `0444`, which every user in the + container can read. + Startup and `messagingctl check` report it as `platform.posture.compose-native-secret-mount`. + Without it, stage the secret directory with the hardened owner and mode instead. + A static JWKS or CA bundle is a public document and needs no setting. {/* Evidence: crates/registry-messaging-core/src/package.rs idempotent_submit, accept_duplicates; crates/registry-messaging/src/package.rs a_symbolic_link_anywhere_in_the_package_is_refused; @@ -370,7 +377,9 @@ The boundaries hold only if your deployment does the following. crates/registry-messaging/src/config.rs runtime_reads_the_explicit_http_issuer_opt_in; crates/registry-messaging/src/http_provider/aws_tests.rs aws_settings; crates/registry-messaging/tests/postgres_messages.rs - an_exact_retry_across_an_audit_key_rotation_replays_and_never_sends_again. */} + an_exact_retry_across_an_audit_key_rotation_replays_and_never_sends_again; + crates/registry-platform-config/src/blocks.rs COMPOSE_NATIVE_SECRET_MOUNT; + crates/registry-platform-config/src/secrets.rs resolve_public_document. */} ## Accepted residuals diff --git a/products/adapter/schemas/job-runtime.v1alpha1.schema.json b/products/adapter/schemas/job-runtime.v1alpha1.schema.json index 8cd2717407..43fe2b3acf 100644 --- a/products/adapter/schemas/job-runtime.v1alpha1.schema.json +++ b/products/adapter/schemas/job-runtime.v1alpha1.schema.json @@ -123,8 +123,15 @@ "additionalProperties": false, "description": "The file secret provider.", "properties": { + "mountPolicy": { + "$ref": "#/$defs/SecretMountPolicy", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "x-registry-explicit-production": [ + "platform.posture.compose-native-secret-mount" + ] + }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -850,6 +857,12 @@ } ] }, + "SecretMountPolicy": { + "enum": [ + "compose-native" + ], + "type": "string" + }, "SecretProvidersConfig": { "additionalProperties": false, "anyOf": [ diff --git a/products/adapter/schemas/runtime.v1alpha1.schema.json b/products/adapter/schemas/runtime.v1alpha1.schema.json index ba0b9c1e61..757a51fcb0 100644 --- a/products/adapter/schemas/runtime.v1alpha1.schema.json +++ b/products/adapter/schemas/runtime.v1alpha1.schema.json @@ -306,8 +306,15 @@ "additionalProperties": false, "description": "The file secret provider.", "properties": { + "mountPolicy": { + "$ref": "#/$defs/SecretMountPolicy", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "x-registry-explicit-production": [ + "platform.posture.compose-native-secret-mount" + ] + }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -699,6 +706,12 @@ "$ref": "#/$defs/ExternalId", "description": "The name of the claim that carries scopes." }, + "SecretMountPolicy": { + "enum": [ + "compose-native" + ], + "type": "string" + }, "SecretProvidersConfig": { "additionalProperties": false, "anyOf": [ diff --git a/products/breg/generated/mcp-runtime/mcp-runtime.schema.json b/products/breg/generated/mcp-runtime/mcp-runtime.schema.json index 6a59ea013e..9c6e2a9ba6 100644 --- a/products/breg/generated/mcp-runtime/mcp-runtime.schema.json +++ b/products/breg/generated/mcp-runtime/mcp-runtime.schema.json @@ -222,8 +222,15 @@ "additionalProperties": false, "description": "The file secret provider.", "properties": { + "mountPolicy": { + "$ref": "#/$defs/SecretMountPolicy", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "x-registry-explicit-production": [ + "platform.posture.compose-native-secret-mount" + ] + }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -625,6 +632,12 @@ "pattern": "^[!#-\\[\\]-~]+$", "type": "string" }, + "SecretMountPolicy": { + "enum": [ + "compose-native" + ], + "type": "string" + }, "SecretProvidersConfig": { "additionalProperties": false, "anyOf": [ diff --git a/products/breg/generated/review-runtime/review-runtime.schema.json b/products/breg/generated/review-runtime/review-runtime.schema.json index 6c87764833..f6e1dbce9b 100644 --- a/products/breg/generated/review-runtime/review-runtime.schema.json +++ b/products/breg/generated/review-runtime/review-runtime.schema.json @@ -127,8 +127,15 @@ "additionalProperties": false, "description": "The file secret provider.", "properties": { + "mountPolicy": { + "$ref": "#/$defs/SecretMountPolicy", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "x-registry-explicit-production": [ + "platform.posture.compose-native-secret-mount" + ] + }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -274,6 +281,12 @@ "pattern": "^[!#-\\[\\]-~]+$", "type": "string" }, + "SecretMountPolicy": { + "enum": [ + "compose-native" + ], + "type": "string" + }, "SecretProvidersConfig": { "additionalProperties": false, "anyOf": [ diff --git a/products/breg/generated/runtime/runtime.schema.json b/products/breg/generated/runtime/runtime.schema.json index 622232a8bc..78313319d4 100644 --- a/products/breg/generated/runtime/runtime.schema.json +++ b/products/breg/generated/runtime/runtime.schema.json @@ -716,8 +716,15 @@ "additionalProperties": false, "description": "The file secret provider.", "properties": { + "mountPolicy": { + "$ref": "#/$defs/SecretMountPolicy", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "x-registry-explicit-production": [ + "platform.posture.compose-native-secret-mount" + ] + }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -2340,6 +2347,12 @@ "$ref": "#/$defs/ExternalId", "description": "The name of the claim that carries scopes." }, + "SecretMountPolicy": { + "enum": [ + "compose-native" + ], + "type": "string" + }, "SecretProvidersConfig": { "additionalProperties": false, "anyOf": [ diff --git a/products/casework/generated/runtime/runtime.schema.json b/products/casework/generated/runtime/runtime.schema.json index 9c5aca82d1..6608e9dee5 100644 --- a/products/casework/generated/runtime/runtime.schema.json +++ b/products/casework/generated/runtime/runtime.schema.json @@ -552,8 +552,15 @@ "additionalProperties": false, "description": "The file secret provider.", "properties": { + "mountPolicy": { + "$ref": "#/$defs/SecretMountPolicy", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "x-registry-explicit-production": [ + "platform.posture.compose-native-secret-mount" + ] + }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -799,6 +806,12 @@ "$ref": "#/$defs/ExternalId", "description": "The name of the claim that carries scopes." }, + "SecretMountPolicy": { + "enum": [ + "compose-native" + ], + "type": "string" + }, "SecretProvidersConfig": { "additionalProperties": false, "anyOf": [ diff --git a/products/coordinator/generated/runtime/runtime.schema.json b/products/coordinator/generated/runtime/runtime.schema.json index df12c4babe..b87878db7e 100644 --- a/products/coordinator/generated/runtime/runtime.schema.json +++ b/products/coordinator/generated/runtime/runtime.schema.json @@ -779,8 +779,15 @@ "additionalProperties": false, "description": "The file secret provider.", "properties": { + "mountPolicy": { + "$ref": "#/$defs/SecretMountPolicy", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "x-registry-explicit-production": [ + "platform.posture.compose-native-secret-mount" + ] + }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -1088,6 +1095,12 @@ "$ref": "#/$defs/ExternalId", "description": "The name of the claim that carries scopes." }, + "SecretMountPolicy": { + "enum": [ + "compose-native" + ], + "type": "string" + }, "SecretProvidersConfig": { "additionalProperties": false, "anyOf": [ diff --git a/products/documents/generated/runtime/runtime.schema.json b/products/documents/generated/runtime/runtime.schema.json index 5578a36259..9d29d68160 100644 --- a/products/documents/generated/runtime/runtime.schema.json +++ b/products/documents/generated/runtime/runtime.schema.json @@ -305,8 +305,15 @@ "additionalProperties": false, "description": "The file secret provider.", "properties": { + "mountPolicy": { + "$ref": "#/$defs/SecretMountPolicy", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "x-registry-explicit-production": [ + "platform.posture.compose-native-secret-mount" + ] + }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -631,6 +638,12 @@ "$ref": "#/$defs/ExternalId", "description": "The name of the claim that carries scopes." }, + "SecretMountPolicy": { + "enum": [ + "compose-native" + ], + "type": "string" + }, "SecretProvidersConfig": { "additionalProperties": false, "anyOf": [ diff --git a/products/evidence/generated/oid4vci-runtime/oid4vci-runtime.schema.json b/products/evidence/generated/oid4vci-runtime/oid4vci-runtime.schema.json index 47d436e6a1..75b9566696 100644 --- a/products/evidence/generated/oid4vci-runtime/oid4vci-runtime.schema.json +++ b/products/evidence/generated/oid4vci-runtime/oid4vci-runtime.schema.json @@ -182,8 +182,15 @@ "additionalProperties": false, "description": "The file secret provider.", "properties": { + "mountPolicy": { + "$ref": "#/$defs/SecretMountPolicy", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "x-registry-explicit-production": [ + "platform.posture.compose-native-secret-mount" + ] + }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -549,6 +556,12 @@ "$ref": "#/$defs/ExternalId", "description": "The name of the claim that carries scopes." }, + "SecretMountPolicy": { + "enum": [ + "compose-native" + ], + "type": "string" + }, "SecretProvidersConfig": { "additionalProperties": false, "anyOf": [ diff --git a/products/evidence/generated/oid4vp-runtime/oid4vp-runtime.schema.json b/products/evidence/generated/oid4vp-runtime/oid4vp-runtime.schema.json index faaa870574..959afaf9eb 100644 --- a/products/evidence/generated/oid4vp-runtime/oid4vp-runtime.schema.json +++ b/products/evidence/generated/oid4vp-runtime/oid4vp-runtime.schema.json @@ -309,8 +309,15 @@ "additionalProperties": false, "description": "The file secret provider.", "properties": { + "mountPolicy": { + "$ref": "#/$defs/SecretMountPolicy", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "x-registry-explicit-production": [ + "platform.posture.compose-native-secret-mount" + ] + }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -613,6 +620,12 @@ "$ref": "#/$defs/ExternalId", "description": "The name of the claim that carries scopes." }, + "SecretMountPolicy": { + "enum": [ + "compose-native" + ], + "type": "string" + }, "SecretProvidersConfig": { "additionalProperties": false, "anyOf": [ diff --git a/products/messaging/generated/runtime/runtime.schema.json b/products/messaging/generated/runtime/runtime.schema.json index 336fdbf157..3b883e4755 100644 --- a/products/messaging/generated/runtime/runtime.schema.json +++ b/products/messaging/generated/runtime/runtime.schema.json @@ -288,8 +288,15 @@ "additionalProperties": false, "description": "The file secret provider.", "properties": { + "mountPolicy": { + "$ref": "#/$defs/SecretMountPolicy", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "x-registry-explicit-production": [ + "platform.posture.compose-native-secret-mount" + ] + }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -956,6 +963,12 @@ "$ref": "#/$defs/ExternalId", "description": "The name of the claim that carries scopes." }, + "SecretMountPolicy": { + "enum": [ + "compose-native" + ], + "type": "string" + }, "SecretProvidersConfig": { "additionalProperties": false, "anyOf": [ diff --git a/products/platform/CHANGELOG.md b/products/platform/CHANGELOG.md index 3c344dfabe..0226f3a293 100644 --- a/products/platform/CHANGELOG.md +++ b/products/platform/CHANGELOG.md @@ -4,6 +4,18 @@ - `rstack dev check` refuses incompatible owner reports and mismatched identity facts. For Messaging it also checks the staged package, runtime input and tool around facts generation. +- The file secret provider accepts `mountPolicy: compose-native`, an explicit + production setting that also admits a root-owned, single-link regular file + with mode exactly `0444`, the Docker Compose secret mount shape, under the + declared root. Startup and `check` report + `platform.posture.compose-native-secret-mount`. The default rule still + refuses that shape, and writable files, other owners, extra links and paths + outside the root stay refused in every case. +- Every runtime reads a static JWKS (`jwksSource.documentRef`) and every CA + bundle (`caBundleRef`, Messaging `tlsTrustProfiles.*.bundleRef`) as a public + document: group and other may read the file, with no setting. Owner, link, + write and walk checks still apply, and the document is still parsed before + use. - Numbered releases ship `registry-session` for Linux amd64, Linux arm64 and macOS arm64. It is a standalone release asset: `rstack` does not install it, and it has no installer or container image. Upgrade: `rstack update` from diff --git a/products/platform/generated/mcp-runtime/mcp-runtime.schema.json b/products/platform/generated/mcp-runtime/mcp-runtime.schema.json index 69fd075797..be01339097 100644 --- a/products/platform/generated/mcp-runtime/mcp-runtime.schema.json +++ b/products/platform/generated/mcp-runtime/mcp-runtime.schema.json @@ -310,8 +310,15 @@ "additionalProperties": false, "description": "The file secret provider.", "properties": { + "mountPolicy": { + "$ref": "#/$defs/SecretMountPolicy", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "x-registry-explicit-production": [ + "platform.posture.compose-native-secret-mount" + ] + }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -836,6 +843,12 @@ "pattern": "^[!#-\\[\\]-~]+$", "type": "string" }, + "SecretMountPolicy": { + "enum": [ + "compose-native" + ], + "type": "string" + }, "SecretProvidersConfig": { "additionalProperties": false, "anyOf": [ diff --git a/products/platform/generated/runtime-config-blocks.schema.json b/products/platform/generated/runtime-config-blocks.schema.json index 2a274bd183..508178e1dc 100644 --- a/products/platform/generated/runtime-config-blocks.schema.json +++ b/products/platform/generated/runtime-config-blocks.schema.json @@ -589,8 +589,15 @@ "additionalProperties": false, "description": "The file secret provider.", "properties": { + "mountPolicy": { + "$ref": "#/$defs/SecretMountPolicy", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "x-registry-explicit-production": [ + "platform.posture.compose-native-secret-mount" + ] + }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -972,6 +979,12 @@ "$ref": "#/$defs/ExternalId", "description": "The name of the claim that carries scopes." }, + "SecretMountPolicy": { + "enum": [ + "compose-native" + ], + "type": "string" + }, "SecretProvidersConfig": { "additionalProperties": false, "anyOf": [ diff --git a/products/platform/generated/session-runtime/session-runtime.schema.json b/products/platform/generated/session-runtime/session-runtime.schema.json index dcf7cf8336..2db6d6be04 100644 --- a/products/platform/generated/session-runtime/session-runtime.schema.json +++ b/products/platform/generated/session-runtime/session-runtime.schema.json @@ -145,8 +145,15 @@ "additionalProperties": false, "description": "The file secret provider.", "properties": { + "mountPolicy": { + "$ref": "#/$defs/SecretMountPolicy", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "x-registry-explicit-production": [ + "platform.posture.compose-native-secret-mount" + ] + }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -563,6 +570,12 @@ "pattern": "^[!#-\\[\\]-~]+$", "type": "string" }, + "SecretMountPolicy": { + "enum": [ + "compose-native" + ], + "type": "string" + }, "SecretProvidersConfig": { "additionalProperties": false, "anyOf": [ diff --git a/products/platform/schemas/task-connection.schema.json b/products/platform/schemas/task-connection.schema.json index 8d7dcf5b10..1c20d44531 100644 --- a/products/platform/schemas/task-connection.schema.json +++ b/products/platform/schemas/task-connection.schema.json @@ -16,8 +16,15 @@ "additionalProperties": false, "description": "The file secret provider.", "properties": { + "mountPolicy": { + "$ref": "#/$defs/SecretMountPolicy", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "x-registry-explicit-production": [ + "platform.posture.compose-native-secret-mount" + ] + }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -27,6 +34,12 @@ ], "type": "object" }, + "SecretMountPolicy": { + "enum": [ + "compose-native" + ], + "type": "string" + }, "SecretProvidersConfig": { "additionalProperties": false, "anyOf": [ diff --git a/products/render/schemas/runtime.schema.json b/products/render/schemas/runtime.schema.json index 2a6e343038..a88318513b 100644 --- a/products/render/schemas/runtime.schema.json +++ b/products/render/schemas/runtime.schema.json @@ -177,8 +177,15 @@ "additionalProperties": false, "description": "The file secret provider.", "properties": { + "mountPolicy": { + "$ref": "#/$defs/SecretMountPolicy", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "x-registry-explicit-production": [ + "platform.posture.compose-native-secret-mount" + ] + }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -708,6 +715,12 @@ } ] }, + "SecretMountPolicy": { + "enum": [ + "compose-native" + ], + "type": "string" + }, "SecretProvidersConfig": { "additionalProperties": false, "anyOf": [ diff --git a/products/scheduling/generated/runtime/runtime.schema.json b/products/scheduling/generated/runtime/runtime.schema.json index 308e1f008d..7e108ef536 100644 --- a/products/scheduling/generated/runtime/runtime.schema.json +++ b/products/scheduling/generated/runtime/runtime.schema.json @@ -332,8 +332,15 @@ "additionalProperties": false, "description": "The file secret provider.", "properties": { + "mountPolicy": { + "$ref": "#/$defs/SecretMountPolicy", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "x-registry-explicit-production": [ + "platform.posture.compose-native-secret-mount" + ] + }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -920,6 +927,12 @@ "$ref": "#/$defs/ExternalId", "description": "The name of the claim that carries scopes." }, + "SecretMountPolicy": { + "enum": [ + "compose-native" + ], + "type": "string" + }, "SecretProvidersConfig": { "additionalProperties": false, "anyOf": [ From 7c81a26010141c0958e44f7d81114e84dc688a9e Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:16 +0000 Subject: [PATCH 21/55] fix(dev): check the Scheduling caller after roles resolve and generate bounded BReg revision routes Folds these reviewed commits: - fix(dev): check the external Scheduling caller after roles resolve - chore: regenerate the CLI catalogue, dev schema and Coordinator client on the rebased lane - docs(previews): show when a service needs a flow - fix(preview): generate and admit bounded BReg revision routes - docs(messaging): lead the Compose guide with the explicit native secret mount - docs(breg): read the first tutorial's dev files from the scaffold - test(dev): box the saved-report test diagnostic - fix(identifiers): catalogue the ctl-report, store-provision and Session route inventory schemas - fix(session): state the port check without a double negation Signed-off-by: Jeremi Joslin --- clients/typescript/generate.ts | 20 +- clients/typescript/generated/coordinator.ts | 190 +++++------ clients/typescript/preview/build.mjs | 7 +- clients/typescript/preview/gateway.mjs | 18 +- .../typescript/preview/tests/preview.test.mjs | 50 ++- clients/typescript/tests/generator.test.ts | 52 +++ crates/registry-cli-docs/catalog.json | 318 +++++++++++++++++- .../registry-rstack-dev/src/external_breg.rs | 33 +- .../src/owner_report_tests.rs | 18 +- crates/registry-rstack-dev/src/plan.rs | 9 + crates/registry-rstack-dev/src/preview.rs | 38 ++- crates/registry-rstack-dev/src/roles.rs | 2 + crates/registry-session/src/gateway/verify.rs | 4 +- .../src/content/docs/operate/messaging.mdx | 48 ++- .../src/content/docs/tutorials/first-breg.mdx | 34 +- .../identifiers/contracts/catalog-source.json | 8 + .../identifiers/generated/catalog.v1.json | 176 ++++++---- .../business-registration/README.md | 10 +- .../medical-renewal/README.md | 13 +- .../generated/dev/dev.v1alpha1.schema.json | 16 + 20 files changed, 804 insertions(+), 260 deletions(-) diff --git a/clients/typescript/generate.ts b/clients/typescript/generate.ts index 0ad6eba692..d976d9e134 100644 --- a/clients/typescript/generate.ts +++ b/clients/typescript/generate.ts @@ -154,20 +154,25 @@ const record = '[a-z0-9][a-z0-9-]*' const bregRoutes = [ 'records/' + record + '(?::(?:lookup|batch|snapshot|current|as-of)|/ingestion-runs' + '(?:/\\{run_id\\}(?:/(?:cancel|chunks(?:/\\{chunk_index\\}/receipt)?))?)?|/\\{record_id\\}' + - '(?:/(?:' + record + '|attachments/' + record + '))?)?', + '(?:/(?:' + record + '|attachments/' + record + '|revisions/\\{revision\\}))?)?', 'actions/' + record + '(?:/(?:proposals|availability|target-conditions))?', 'proposals(?:/review-context|/\\{proposal_id\\}(?:/(?:apply|cancel|edit|rebase|retry|revise|review-context|' + - 'review-status|task-grant-context|submit|submissions/\\{submission_version\\}|attachments/' + record + '))?)?', + 'review-status|task-grant-context|submit|submissions/\\{submission_version\\}|attachments/' + record + + '|additions/(?:' + record + '|\\{addition_id\\})|asks/\\{ask_id\\}/answer))?)?', 'statistics/' + record + '(?::(?:live|exact)|/releases(?::series|/\\{period\\}' + - '(?:/versions(?::dry-run|/\\{version\\}(?:/withdrawal)?))?)?)', + '(?:/versions(?::dry-run|/\\{version\\}(?:/withdrawal)?)?)?)?)', + 'external-views/' + record + '/' + record + '/records(?:/\\{root\\}(?:/refresh)?)?', + 'external-refresh-plans/\\{plan\\}/source-changes', 'review-completions', ] const bregRoute = new RegExp('^/v1/(?:' + bregRoutes.join('|') + ')$') -// A record patch can target fields of different types, so BReg leaves its value open. +// BReg leaves patch values open because they can target fields of different types. const bregPatchValue = new RegExp( - '^/paths/~1v1~1records~1' + record + '~1\\{record_id\\}/patch/requestBody/content/' + - 'application~1json-patch\\+json/schema/items/properties/value$', + '^/paths/~1v1~1records~1' + record + + '(?:~1\\{record_id\\}/patch/requestBody/content/application~1json-patch\\+json/schema/items' + + '|:batch/post/requestBody/content/application~1json/schema/properties/items/items/oneOf/1/properties/patch/items)' + + '/properties/value$', 'u', ) @@ -756,7 +761,8 @@ export function generate(source: string, settings: Settings = {}): string { mode = 'json' validationRoots.add(schemaAt) } - else if (media === 'application/dc+sd-jwt' || media.endsWith('+jwt')) mode = 'text' + else if (media === 'application/dc+sd-jwt' || media.endsWith('+jwt') + || (breg && method === 'get' && path.startsWith('/v1/statistics/') && media === 'text/csv')) mode = 'text' else if (media === '*/*' || media === 'application/octet-stream' || media === 'application/pdf') mode = 'binary' else mode = fail(schemaAt, 'unsupported success media') responseMedia.add(media) diff --git a/clients/typescript/generated/coordinator.ts b/clients/typescript/generated/coordinator.ts index 04670f6dec..56e5c25f4e 100644 --- a/clients/typescript/generated/coordinator.ts +++ b/clients/typescript/generated/coordinator.ts @@ -1,5 +1,5 @@ -// Generated for Stack version 0.51.0, client version 0.51.0. -// Source SHA-256 ceb74bca2a70c748c48a052b88a58b03f3e05215913e3a05daecf0ee8a19cb16 +// Generated for Stack version 0.50.0, client version 0.50.0. +// Source SHA-256 bfc1de8b64985751de37a6f66efbca724d2878101aa47b15cb40a4192e76ffc2 // Unconstrained JSON /components/schemas/HookEnvelope/properties/data // Unconstrained JSON /components/schemas/RunStatus/properties/output // Unconstrained JSON /components/schemas/Start/properties/input @@ -40,7 +40,7 @@ export interface Operations { "ready": { input: CallOptions & { accept?: "application/json" | "*/*" }; required: false; output: ({ "developmentSettings": (Array<({ "code": (string); "pointer": (string) })>); "posture": ("production" | "development"); "ready": (boolean); "status": "ready" }) } "completeExecutionRecovery": { input: CallOptions & ({ body: Schema_ExecutionRecovery }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ExecutionReviewed } "doctor": { input: CallOptions & { accept?: "application/json" | "*/*" }; required: false; output: Schema_Doctor } - "admitEvent": { input: CallOptions & { path: { "workflow": (string); "trigger": (string) } } & { headers: { "webhook-id": (string); "webhook-timestamp": (string); "webhook-signature": (string) } } & ({ body: Uint8Array }); required: true; output: undefined } + "admitEvent": { input: CallOptions & { path: { "workflowId": (string); "triggerId": (string) } } & { headers: { "webhook-id": (string); "webhook-timestamp": (string); "webhook-signature": (string) } } & ({ body: Uint8Array }); required: true; output: undefined } "releaseAdmissionHold": { input: CallOptions & ({ body: Schema_AdmissionRelease }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AdmissionHold } "releaseRestoreHold": { input: CallOptions & ({ body: Schema_Reason }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_Hold } "restoreHold": { input: CallOptions & ({ body: Schema_Reason }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_Hold } @@ -48,13 +48,13 @@ export interface Operations { "receiveReviewCompletion": { input: CallOptions & { headers: { "Registry-Recipient-Binding": (string); "webhook-id": (string); "webhook-timestamp": (string); "webhook-signature": (string) } } & ({ body: Uint8Array }); required: true; output: undefined } "listRuns": { input: CallOptions & { query?: { "limit"?: (number); "cursor"?: (string); "state"?: ("running" | "finished" | "failed" | "cancelled" | "cancelled-after-effect" | "expired" | "attention" | "cancel-requested") & (string); "attention"?: (boolean); "proposal"?: (string); "turn"?: ("party" | "official" | "nobody") & (string); "outcome"?: (string) } } & { accept?: "application/json" | "*/*" }; required: false; output: Schema_RunList } "startRun": { input: CallOptions & ({ body: Schema_Start }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_RunStatus } - "runStatus": { input: CallOptions & { path: { "run": (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_RunStatus } - "cancelRun": { input: CallOptions & { path: { "run": (string) } } & ({ body: Schema_Reason }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_RunStatus } - "checkNow": { input: CallOptions & { path: { "run": (string) } } & ({ body: Schema_CheckNow }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_CheckNowResult } - "inspectRun": { input: CallOptions & { path: { "run": (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_RunInspection } - "reconcileRun": { input: CallOptions & { path: { "run": (string) } } & ({ body: Schema_Reason }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_RunInspection } - "retrySame": { input: CallOptions & { path: { "run": (string) } } & ({ body: Schema_Reason }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_RetryScheduled } - "workflowContract": { input: CallOptions & { path: { "workflow": (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_WorkflowContract } + "runStatus": { input: CallOptions & { path: { "runId": (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_RunStatus } + "cancelRun": { input: CallOptions & { path: { "runId": (string) } } & ({ body: Schema_Reason }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_RunStatus } + "checkNow": { input: CallOptions & { path: { "runId": (string) } } & ({ body: Schema_CheckNow }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_CheckNowResult } + "inspectRun": { input: CallOptions & { path: { "runId": (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_RunInspection } + "reconcileRun": { input: CallOptions & { path: { "runId": (string) } } & ({ body: Schema_Reason }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_RunInspection } + "retrySame": { input: CallOptions & { path: { "runId": (string) } } & ({ body: Schema_Reason }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_RetryScheduled } + "workflowContract": { input: CallOptions & { path: { "workflowId": (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_WorkflowContract } } const rules: Record = Object.fromEntries([ @@ -108,13 +108,13 @@ const rules: Record = Object.fromEntries([ ["/paths/~1v1~1doctor/get/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], ["/paths/~1v1~1doctor/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], ["/paths/~1v1~1doctor/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], - ["/paths/~1v1~1events~1{workflow}~1{trigger}/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"event.invalid\",\"input.invalid\",\"request.invalid\"]}}}]}")], - ["/paths/~1v1~1events~1{workflow}~1{trigger}/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"event.unauthenticated\"]}}}]}")], - ["/paths/~1v1~1events~1{workflow}~1{trigger}/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], - ["/paths/~1v1~1events~1{workflow}~1{trigger}/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"admission.held\",\"admission.recovery-only\",\"binding.conflict\",\"binding.live-conflict\",\"definition.refused\",\"deployment.activation-changed\",\"deployment.refused\",\"execution.held\",\"idempotency.key-reused\"]}}}]}")], - ["/paths/~1v1~1events~1{workflow}~1{trigger}/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"event.too-large\",\"request.body-too-large\"]}}}]}")], - ["/paths/~1v1~1events~1{workflow}~1{trigger}/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], - ["/paths/~1v1~1events~1{workflow}~1{trigger}/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], + ["/paths/~1v1~1events~1{workflowId}~1{triggerId}/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"event.invalid\",\"input.invalid\",\"request.invalid\"]}}}]}")], + ["/paths/~1v1~1events~1{workflowId}~1{triggerId}/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"event.unauthenticated\"]}}}]}")], + ["/paths/~1v1~1events~1{workflowId}~1{triggerId}/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], + ["/paths/~1v1~1events~1{workflowId}~1{triggerId}/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"admission.held\",\"admission.recovery-only\",\"binding.conflict\",\"binding.live-conflict\",\"definition.refused\",\"deployment.activation-changed\",\"deployment.refused\",\"execution.held\",\"idempotency.key-reused\"]}}}]}")], + ["/paths/~1v1~1events~1{workflowId}~1{triggerId}/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"event.too-large\",\"request.body-too-large\"]}}}]}")], + ["/paths/~1v1~1events~1{workflowId}~1{triggerId}/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], + ["/paths/~1v1~1events~1{workflowId}~1{triggerId}/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], ["/paths/~1v1~1release-admission-hold/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/AdmissionHold\"}")], ["/paths/~1v1~1release-admission-hold/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\",\"request.reason-invalid\"]}}}]}")], ["/paths/~1v1~1release-admission-hold/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], @@ -177,75 +177,75 @@ const rules: Record = Object.fromEntries([ ["/paths/~1v1~1runs/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.unsupported-media-type\"]}}}]}")], ["/paths/~1v1~1runs/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], ["/paths/~1v1~1runs/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/RunStatus\"}")], - ["/paths/~1v1~1runs~1{run}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"operation.not-authorized\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"run.not-visible\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}/get/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1cancel/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/RunStatus\"}")], - ["/paths/~1v1~1runs~1{run}~1cancel/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\",\"request.reason-invalid\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1cancel/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1cancel/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"operation.not-authorized\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1cancel/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"run.not-visible\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1cancel/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1cancel/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"run.definition-incompatible\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1cancel/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.body-too-large\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1cancel/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.unsupported-media-type\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1cancel/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1cancel/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1check/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/CheckNowResult\"}")], - ["/paths/~1v1~1runs~1{run}~1check/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1check/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1check/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"operation.not-authorized\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1check/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"run.not-visible\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1check/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1check/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"check.not-waiting\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1check/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.body-too-large\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1check/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.unsupported-media-type\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1check/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1check/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1inspect/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/RunInspection\"}")], - ["/paths/~1v1~1runs~1{run}~1inspect/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1inspect/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1inspect/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"operation.not-authorized\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1inspect/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"run.not-visible\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1inspect/get/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1inspect/get/responses/409/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"binding.conflict\",\"definition.refused\",\"run.payload-erased\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1inspect/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1inspect/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1reconcile/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/RunInspection\"}")], - ["/paths/~1v1~1runs~1{run}~1reconcile/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\",\"request.reason-invalid\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1reconcile/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1reconcile/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"operation.not-authorized\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1reconcile/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"run.not-visible\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1reconcile/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1reconcile/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"binding.conflict\",\"definition.refused\",\"reconcile.raced\",\"reconcile.refused\",\"reconcile.unsupported\",\"run.definition-incompatible\",\"run.payload-erased\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1reconcile/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.body-too-large\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1reconcile/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.unsupported-media-type\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1reconcile/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1reconcile/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1retry-same/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/RetryScheduled\"}")], - ["/paths/~1v1~1runs~1{run}~1retry-same/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\",\"request.reason-invalid\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1retry-same/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1retry-same/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"operation.not-authorized\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1retry-same/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"run.not-visible\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1retry-same/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1retry-same/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"binding.conflict\",\"definition.refused\",\"evaluation.uncertain\",\"mutation.uncertain\",\"receipt.expired\",\"retry.refused\",\"run.definition-incompatible\",\"run.payload-erased\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1retry-same/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.body-too-large\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1retry-same/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.unsupported-media-type\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1retry-same/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], - ["/paths/~1v1~1runs~1{run}~1retry-same/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], - ["/paths/~1v1~1workflows~1{workflow}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/WorkflowContract\"}")], - ["/paths/~1v1~1workflows~1{workflow}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], - ["/paths/~1v1~1workflows~1{workflow}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"operation.not-authorized\"]}}}]}")], - ["/paths/~1v1~1workflows~1{workflow}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"workflow.not-served\"]}}}]}")], - ["/paths/~1v1~1workflows~1{workflow}/get/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], - ["/paths/~1v1~1workflows~1{workflow}/get/responses/409/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"deployment.activation-changed\",\"deployment.refused\"]}}}]}")], - ["/paths/~1v1~1workflows~1{workflow}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], - ["/paths/~1v1~1workflows~1{workflow}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/RunStatus\"}")], + ["/paths/~1v1~1runs~1{runId}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"operation.not-authorized\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"run.not-visible\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}/get/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1cancel/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/RunStatus\"}")], + ["/paths/~1v1~1runs~1{runId}~1cancel/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\",\"request.reason-invalid\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1cancel/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1cancel/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"operation.not-authorized\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1cancel/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"run.not-visible\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1cancel/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1cancel/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"run.definition-incompatible\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1cancel/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.body-too-large\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1cancel/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.unsupported-media-type\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1cancel/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1cancel/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1check/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/CheckNowResult\"}")], + ["/paths/~1v1~1runs~1{runId}~1check/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1check/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1check/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"operation.not-authorized\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1check/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"run.not-visible\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1check/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1check/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"check.not-waiting\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1check/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.body-too-large\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1check/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.unsupported-media-type\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1check/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1check/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1inspect/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/RunInspection\"}")], + ["/paths/~1v1~1runs~1{runId}~1inspect/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1inspect/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1inspect/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"operation.not-authorized\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1inspect/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"run.not-visible\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1inspect/get/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1inspect/get/responses/409/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"binding.conflict\",\"definition.refused\",\"run.payload-erased\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1inspect/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1inspect/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/RunInspection\"}")], + ["/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\",\"request.reason-invalid\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"operation.not-authorized\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"run.not-visible\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"binding.conflict\",\"definition.refused\",\"reconcile.raced\",\"reconcile.refused\",\"reconcile.unsupported\",\"run.definition-incompatible\",\"run.payload-erased\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.body-too-large\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.unsupported-media-type\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/RetryScheduled\"}")], + ["/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\",\"request.reason-invalid\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"operation.not-authorized\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"run.not-visible\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"binding.conflict\",\"definition.refused\",\"evaluation.uncertain\",\"mutation.uncertain\",\"receipt.expired\",\"retry.refused\",\"run.definition-incompatible\",\"run.payload-erased\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.body-too-large\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.unsupported-media-type\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], + ["/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], + ["/paths/~1v1~1workflows~1{workflowId}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/WorkflowContract\"}")], + ["/paths/~1v1~1workflows~1{workflowId}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], + ["/paths/~1v1~1workflows~1{workflowId}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"operation.not-authorized\"]}}}]}")], + ["/paths/~1v1~1workflows~1{workflowId}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"workflow.not-served\"]}}}]}")], + ["/paths/~1v1~1workflows~1{workflowId}/get/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], + ["/paths/~1v1~1workflows~1{workflowId}/get/responses/409/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"deployment.activation-changed\",\"deployment.refused\"]}}}]}")], + ["/paths/~1v1~1workflows~1{workflowId}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"runtime.failure\"]}}}]}")], + ["/paths/~1v1~1workflows~1{workflowId}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"audit.response-unavailable\",\"service.unavailable\"]}}}]}")], ]) const routes: Record = Object.create(null) type Definition = Omit & { problems?: Record; responses: Record> } @@ -254,7 +254,7 @@ const definitions: Record = Object.fromEntries([ ["ready", JSON.parse("{\"method\":\"GET\",\"path\":\"/ready\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1ready/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"405\":\"/paths/~1ready/get/responses/405/content/application~1problem+json/schema\"}}")], ["completeExecutionRecovery", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/complete-execution-recovery\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1complete-execution-recovery/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1complete-execution-recovery/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1complete-execution-recovery/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1complete-execution-recovery/post/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1complete-execution-recovery/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1complete-execution-recovery/post/responses/409/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1complete-execution-recovery/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1complete-execution-recovery/post/responses/415/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1complete-execution-recovery/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1complete-execution-recovery/post/responses/503/content/application~1problem+json/schema\"}}")], ["doctor", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/doctor\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1doctor/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"401\":\"/paths/~1v1~1doctor/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1doctor/get/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1doctor/get/responses/405/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1doctor/get/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1doctor/get/responses/503/content/application~1problem+json/schema\"}}")], - ["admitEvent", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/events/{workflow}/{trigger}\",\"responses\":{\"204\":[{\"mode\":\"empty\"}]},\"keyed\":false,\"signed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1events~1{workflow}~1{trigger}/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1events~1{workflow}~1{trigger}/post/responses/401/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1events~1{workflow}~1{trigger}/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1events~1{workflow}~1{trigger}/post/responses/409/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1events~1{workflow}~1{trigger}/post/responses/413/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1events~1{workflow}~1{trigger}/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1events~1{workflow}~1{trigger}/post/responses/503/content/application~1problem+json/schema\"}}")], + ["admitEvent", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/events/{workflowId}/{triggerId}\",\"responses\":{\"204\":[{\"mode\":\"empty\"}]},\"keyed\":false,\"signed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1events~1{workflowId}~1{triggerId}/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1events~1{workflowId}~1{triggerId}/post/responses/401/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1events~1{workflowId}~1{triggerId}/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1events~1{workflowId}~1{triggerId}/post/responses/409/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1events~1{workflowId}~1{triggerId}/post/responses/413/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1events~1{workflowId}~1{triggerId}/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1events~1{workflowId}~1{triggerId}/post/responses/503/content/application~1problem+json/schema\"}}")], ["releaseAdmissionHold", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/release-admission-hold\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1release-admission-hold/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1release-admission-hold/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1release-admission-hold/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1release-admission-hold/post/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1release-admission-hold/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1release-admission-hold/post/responses/409/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1release-admission-hold/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1release-admission-hold/post/responses/415/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1release-admission-hold/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1release-admission-hold/post/responses/503/content/application~1problem+json/schema\"}}")], ["releaseRestoreHold", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/release-restore-hold\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1release-restore-hold/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1release-restore-hold/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1release-restore-hold/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1release-restore-hold/post/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1release-restore-hold/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1release-restore-hold/post/responses/409/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1release-restore-hold/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1release-restore-hold/post/responses/415/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1release-restore-hold/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1release-restore-hold/post/responses/503/content/application~1problem+json/schema\"}}")], ["restoreHold", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/restore-hold\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1restore-hold/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1restore-hold/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1restore-hold/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1restore-hold/post/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1restore-hold/post/responses/405/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1restore-hold/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1restore-hold/post/responses/415/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1restore-hold/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1restore-hold/post/responses/503/content/application~1problem+json/schema\"}}")], @@ -262,13 +262,13 @@ const definitions: Record = Object.fromEntries([ ["receiveReviewCompletion", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-completions\",\"responses\":{\"204\":[{\"mode\":\"empty\"}]},\"keyed\":false,\"signed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-completions/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-completions/post/responses/401/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1review-completions/post/responses/405/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-completions/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-completions/post/responses/415/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-completions/post/responses/503/content/application~1problem+json/schema\"}}")], ["listRuns", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/runs\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1runs/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1runs/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1runs/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1runs/get/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1runs/get/responses/405/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1runs/get/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1runs/get/responses/503/content/application~1problem+json/schema\"}}")], ["startRun", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/runs\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1runs/post/responses/200/content/application~1json/schema\"}]},\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1runs/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1runs/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1runs/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1runs/post/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1runs/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1runs/post/responses/409/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1runs/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1runs/post/responses/415/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1runs/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1runs/post/responses/503/content/application~1problem+json/schema\"}}")], - ["runStatus", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/runs/{run}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1runs~1{run}/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1runs~1{run}/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1runs~1{run}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1runs~1{run}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1runs~1{run}/get/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1runs~1{run}/get/responses/405/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1runs~1{run}/get/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1runs~1{run}/get/responses/503/content/application~1problem+json/schema\"}}")], - ["cancelRun", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/runs/{run}/cancel\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1runs~1{run}~1cancel/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1runs~1{run}~1cancel/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1runs~1{run}~1cancel/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1runs~1{run}~1cancel/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1runs~1{run}~1cancel/post/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1runs~1{run}~1cancel/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1runs~1{run}~1cancel/post/responses/409/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1runs~1{run}~1cancel/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1runs~1{run}~1cancel/post/responses/415/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1runs~1{run}~1cancel/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1runs~1{run}~1cancel/post/responses/503/content/application~1problem+json/schema\"}}")], - ["checkNow", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/runs/{run}/check\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1runs~1{run}~1check/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1runs~1{run}~1check/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1runs~1{run}~1check/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1runs~1{run}~1check/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1runs~1{run}~1check/post/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1runs~1{run}~1check/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1runs~1{run}~1check/post/responses/409/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1runs~1{run}~1check/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1runs~1{run}~1check/post/responses/415/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1runs~1{run}~1check/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1runs~1{run}~1check/post/responses/503/content/application~1problem+json/schema\"}}")], - ["inspectRun", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/runs/{run}/inspect\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1runs~1{run}~1inspect/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1runs~1{run}~1inspect/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1runs~1{run}~1inspect/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1runs~1{run}~1inspect/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1runs~1{run}~1inspect/get/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1runs~1{run}~1inspect/get/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1runs~1{run}~1inspect/get/responses/409/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1runs~1{run}~1inspect/get/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1runs~1{run}~1inspect/get/responses/503/content/application~1problem+json/schema\"}}")], - ["reconcileRun", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/runs/{run}/reconcile\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1runs~1{run}~1reconcile/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1runs~1{run}~1reconcile/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1runs~1{run}~1reconcile/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1runs~1{run}~1reconcile/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1runs~1{run}~1reconcile/post/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1runs~1{run}~1reconcile/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1runs~1{run}~1reconcile/post/responses/409/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1runs~1{run}~1reconcile/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1runs~1{run}~1reconcile/post/responses/415/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1runs~1{run}~1reconcile/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1runs~1{run}~1reconcile/post/responses/503/content/application~1problem+json/schema\"}}")], - ["retrySame", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/runs/{run}/retry-same\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1runs~1{run}~1retry-same/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1runs~1{run}~1retry-same/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1runs~1{run}~1retry-same/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1runs~1{run}~1retry-same/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1runs~1{run}~1retry-same/post/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1runs~1{run}~1retry-same/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1runs~1{run}~1retry-same/post/responses/409/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1runs~1{run}~1retry-same/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1runs~1{run}~1retry-same/post/responses/415/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1runs~1{run}~1retry-same/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1runs~1{run}~1retry-same/post/responses/503/content/application~1problem+json/schema\"}}")], - ["workflowContract", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/workflows/{workflow}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1workflows~1{workflow}/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"401\":\"/paths/~1v1~1workflows~1{workflow}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1workflows~1{workflow}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1workflows~1{workflow}/get/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1workflows~1{workflow}/get/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1workflows~1{workflow}/get/responses/409/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1workflows~1{workflow}/get/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1workflows~1{workflow}/get/responses/503/content/application~1problem+json/schema\"}}")], + ["runStatus", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/runs/{runId}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1runs~1{runId}/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1runs~1{runId}/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1runs~1{runId}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1runs~1{runId}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1runs~1{runId}/get/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1runs~1{runId}/get/responses/405/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1runs~1{runId}/get/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1runs~1{runId}/get/responses/503/content/application~1problem+json/schema\"}}")], + ["cancelRun", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/runs/{runId}/cancel\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1runs~1{runId}~1cancel/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1runs~1{runId}~1cancel/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1runs~1{runId}~1cancel/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1runs~1{runId}~1cancel/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1runs~1{runId}~1cancel/post/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1runs~1{runId}~1cancel/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1runs~1{runId}~1cancel/post/responses/409/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1runs~1{runId}~1cancel/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1runs~1{runId}~1cancel/post/responses/415/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1runs~1{runId}~1cancel/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1runs~1{runId}~1cancel/post/responses/503/content/application~1problem+json/schema\"}}")], + ["checkNow", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/runs/{runId}/check\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1runs~1{runId}~1check/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1runs~1{runId}~1check/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1runs~1{runId}~1check/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1runs~1{runId}~1check/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1runs~1{runId}~1check/post/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1runs~1{runId}~1check/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1runs~1{runId}~1check/post/responses/409/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1runs~1{runId}~1check/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1runs~1{runId}~1check/post/responses/415/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1runs~1{runId}~1check/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1runs~1{runId}~1check/post/responses/503/content/application~1problem+json/schema\"}}")], + ["inspectRun", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/runs/{runId}/inspect\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1runs~1{runId}~1inspect/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1runs~1{runId}~1inspect/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1runs~1{runId}~1inspect/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1runs~1{runId}~1inspect/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1runs~1{runId}~1inspect/get/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1runs~1{runId}~1inspect/get/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1runs~1{runId}~1inspect/get/responses/409/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1runs~1{runId}~1inspect/get/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1runs~1{runId}~1inspect/get/responses/503/content/application~1problem+json/schema\"}}")], + ["reconcileRun", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/runs/{runId}/reconcile\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/409/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/415/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1runs~1{runId}~1reconcile/post/responses/503/content/application~1problem+json/schema\"}}")], + ["retrySame", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/runs/{runId}/retry-same\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/409/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/415/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1runs~1{runId}~1retry-same/post/responses/503/content/application~1problem+json/schema\"}}")], + ["workflowContract", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/workflows/{workflowId}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1workflows~1{workflowId}/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"401\":\"/paths/~1v1~1workflows~1{workflowId}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1workflows~1{workflowId}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1workflows~1{workflowId}/get/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1workflows~1{workflowId}/get/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1workflows~1{workflowId}/get/responses/409/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1workflows~1{workflowId}/get/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1workflows~1{workflowId}/get/responses/503/content/application~1problem+json/schema\"}}")], ]) for (const [id, definition] of Object.entries(definitions)) { const responses: Operation["responses"] = {} @@ -281,7 +281,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.51.0") + assertClientVersion("0.50.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/preview/build.mjs b/clients/typescript/preview/build.mjs index da94701b36..e90f877dfd 100644 --- a/clients/typescript/preview/build.mjs +++ b/clients/typescript/preview/build.mjs @@ -53,10 +53,11 @@ async function runGenerator(plan, staged) { '--output', join(staged, 'generated', 'service.ts'), ], { cwd: staged, timeout: 90_000, maxBuffer: 1024 * 1024 }) } catch (error) { - if (/cannot start Proposals/u.test(String(error.stderr ?? ''))) { - throw new Error('The preview actor cannot start Proposals in this project. Select a preview actor whose BReg profile can start Proposals.') + const diagnostic = String(error.stderr ?? '').trim() + if (/cannot start Proposals/u.test(diagnostic)) { + throw new Error(diagnostic + '\nSelect a preview actor whose BReg profile can start Proposals.') } - throw new Error('Preview client generation failed. Check the native project and install matching BReg tools.') + throw new Error(diagnostic || 'Preview client generation failed. Check the native project and install matching BReg tools.') } } diff --git a/clients/typescript/preview/gateway.mjs b/clients/typescript/preview/gateway.mjs index 2ce51fac61..81cbecb9e8 100644 --- a/clients/typescript/preview/gateway.mjs +++ b/clients/typescript/preview/gateway.mjs @@ -10,6 +10,9 @@ const maxStaticSize = 32 * 1024 * 1024 const timeout = 15_000 const segment = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u const uuid = /^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/iu +const revision = /^[1-9][0-9]{0,18}$/u +const maximumRevision = '9223372036854775807' +const recordParameter = part => part === '{recordId}' || part === '{record_id}' const contentTypes = new Map([ ['.css', 'text/css; charset=utf-8'], ['.html', 'text/html; charset=utf-8'], @@ -31,9 +34,10 @@ class RequestError extends Error { function compilePaths(paths = []) { if (!Array.isArray(paths)) throw new Error('Expected a list of preview routes per method.') return paths.map((path) => { - const parts = typeof path === 'string' && path.startsWith('/v1/') ? path.slice(1).split('/') : [] - if (parts.length < 2 || parts.filter(part => part === '{recordId}').length > 1 || !parts.every(part => segment.test(part) || part === '{recordId}')) { - throw new Error('Expected an exact /v1/ preview route with {recordId} for a Record ID.') + const parts = typeof path === 'string' && path.length <= 256 && path.startsWith('/v1/') ? path.slice(1).split('/') : [] + if (parts.length < 2 || parts.filter(recordParameter).length > 1 || parts.filter(part => part === '{revision}').length > 1 + || !parts.every(part => segment.test(part) || recordParameter(part) || part === '{revision}')) { + throw new Error('Expected an exact /v1/ preview route with distinct Record ID and revision parameters.') } return parts }) @@ -58,8 +62,12 @@ export function previewPolicy(preview) { allowsBreg(method, path) { const parts = path.slice(1).split('/') return routes.get(method)?.some(route => - route.length === parts.length && route.every((part, index) => - part === '{recordId}' ? uuid.test(parts[index]) : part === parts[index]), + route.length === parts.length && route.every((part, index) => { + const value = parts[index] + if (recordParameter(part)) return uuid.test(value) + if (part === '{revision}') return revision.test(value) && (value.length < maximumRevision.length || value <= maximumRevision) + return part === value + }), ) }, } diff --git a/clients/typescript/preview/tests/preview.test.mjs b/clients/typescript/preview/tests/preview.test.mjs index 097b9a796d..a7d28e215c 100644 --- a/clients/typescript/preview/tests/preview.test.mjs +++ b/clients/typescript/preview/tests/preview.test.mjs @@ -1,15 +1,61 @@ import { strict as assert } from 'node:assert' -import { mkdtemp, mkdir, rm, symlink, writeFile } from 'node:fs/promises' +import { mkdtemp, mkdir, realpath, rm, symlink, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { createServer, request } from 'node:http' import { test } from 'node:test' import { startFunctionHost } from '../host.mjs' -import { collectStaticFiles, startPreviewGateway } from '../gateway.mjs' +import { collectStaticFiles, previewPolicy, startPreviewGateway } from '../gateway.mjs' import { prepareRuntimeConfig } from '../config.mjs' import { buildPreview } from '../build.mjs' import { createHash } from 'node:crypto' +test('preview policy matches both Record revision parameters without expanding methods or routes', () => { + const recordId = '00000000-0000-0000-0000-000000000001' + const root = '/v1/records/applications/' + for (const id of ['{record_id}', '{recordId}']) { + const policy = previewPolicy({ page: '/', functions: [], breg: { get: [root + id + '/revisions/{revision}'] } }) + assert.equal(policy.allowsBreg('GET', root + recordId + '/revisions/2'), true) + assert.equal(policy.allowsBreg('GET', root + recordId + '/revisions/9223372036854775807'), true) + assert.equal(policy.allowsBreg('POST', root + recordId + '/revisions/2'), false) + for (const suffix of ['0', '-1', '2%2fother', '9223372036854775808', '2/another']) { + assert.equal(policy.allowsBreg('GET', root + recordId + '/revisions/' + suffix), false) + } + assert.equal(policy.allowsBreg('GET', root + 'not-a-uuid/revisions/2'), false) + } + for (const path of [root + '{anything}', root + '{recordId}/{record_id}', root + '{recordId}/revisions/{revision}/{revision}']) { + assert.throws(() => previewPolicy({ page: '/', functions: [], breg: { get: [path] } }), /preview route/u) + } +}) + +test('preview build forwards the generator diagnostic', async (t) => { + const root = await realpath(await mkdtemp(join(tmpdir(), 'registry-preview-diagnostic-'))) + t.after(() => rm(root, { recursive: true })) + const file = join(root, 'service.yaml') + const ui = join(root, 'web') + const entry = join(root, 'functions', 'renew', 'index.ts') + const generator = join(root, 'generator') + await mkdir(ui) + await mkdir(join(root, 'functions', 'renew'), { recursive: true }) + await writeFile(file, 'fixture declaration') + await writeFile(entry, 'export default () => {}') + const diagnostic = '/paths/~1v1~1records~1fixture/get: unsupported fixture schema' + await writeFile(generator, `#!/bin/sh\nprintf '%s\\n' '${diagnostic}' >&2\nexit 1\n`, { mode: 0o700 }) + const execPath = process.execPath + process.execPath = generator + try { + await assert.rejects(buildPreview({ + file, workspaceRoot: root, declarationDigest: createHash('sha256').update('fixture declaration').digest('hex'), + product: { id: 'licenses', member: 'licenses', project: root, profile: 'holder' }, + ui: { project: ui, output: join(ui, 'dist') }, + functions: { renew: entry }, + preview: { page: '/', breg: {}, functions: ['renew'] }, + }, join(root, 'artifact')), { message: diagnostic }) + } finally { + process.execPath = execPath + } +}) + test('prepare binds the run to the declaration, product, audience and loopback address', async (t) => { const root = await mkdtemp(join(tmpdir(), 'registry-preview-test-')) t.after(() => rm(root, { recursive: true })) diff --git a/clients/typescript/tests/generator.test.ts b/clients/typescript/tests/generator.test.ts index f0ad4982b7..3d8798023a 100644 --- a/clients/typescript/tests/generator.test.ts +++ b/clients/typescript/tests/generator.test.ts @@ -26,6 +26,58 @@ test('BReg refuses paths outside the route scheme', () => { const input = { ...document({ type: 'string' }), paths: { '/v1/foreign': {} } } assert.throws(() => generate(JSON.stringify(input), { breg: true }), /\/paths\/~1v1~1foreign/) }) +test('BReg generates a typed call for Record revision reads', () => { + const path = '/v1/records/applications/{record_id}/revisions/{revision}' + const input = { ...document({ type: 'string' }), paths: { [path]: { get: { + operationId: 'readApplicationRevision', + parameters: [ + { in: 'path', name: 'record_id', required: true, schema: { type: 'string', format: 'uuid' } }, + { in: 'path', name: 'revision', required: true, schema: { type: 'integer', minimum: 1 } }, + ], + responses: { 200: { description: 'ok', content: { 'application/json': { schema: { type: 'string' } } } } }, + } } } } + const output = generate(JSON.stringify(input), { breg: true }) + assert.match(output, /"readApplicationRevision": \{ input:.*"record_id": \(string\); "revision": \(number\)/u) + assert.ok(output.includes(path)) + const unsupported = { ...input, paths: { [path.replace('{revision}', '{other}')]: input.paths[path] } } + assert.throws(() => generate(JSON.stringify(unsupported), { breg: true }), /outside BReg route scheme/u) +}) +test('BReg accepts the route families emitted by the native fixture set', () => { + for (const path of [ + '/v1/statistics/entry-counts/releases/{period}/versions', + '/v1/external-refresh-plans/{plan}/source-changes', + '/v1/external-views/licence-holder-indexed/holder/records', + '/v1/external-views/licence-holder-indexed/holder/records/{root}', + '/v1/external-views/licence-holder-indexed/holder/records/{root}/refresh', + '/v1/proposals/{proposal_id}/additions/supporting', + '/v1/proposals/{proposal_id}/additions/{addition_id}', + '/v1/proposals/{proposal_id}/asks/{ask_id}/answer', + ]) assert.doesNotThrow(() => generate(JSON.stringify({ ...document({ type: 'string' }), paths: { [path]: {} } }), { breg: true }), path) +}) + +test('BReg generates a CSV alternative on statistical releases', () => { + const path = '/v1/statistics/entry-counts/releases/{period}' + const operation = { operationId: 'publishedRelease', parameters: [ + { in: 'path', name: 'period', required: true, schema: { type: 'string' } }, + ], responses: { 200: { description: 'ok', content: { 'text/csv': { schema: { type: 'string' } } } } } } + const input = { ...document({ type: 'string' }), paths: { [path]: { get: operation } } } + assert.match(generate(JSON.stringify(input), { breg: true }), /WireText<"text\/csv">/u) + const nonStatistic = { ...input, paths: { '/v1/records/entries': { get: { ...operation, parameters: [] } } } } + assert.throws(() => generate(JSON.stringify(nonStatistic), { breg: true }), /unsupported success media/u) +}) + +test('BReg generates only the native batch patch value as unconstrained JSON', () => { + const batchPatch = (field: string) => ({ type: 'object', properties: { items: { type: 'array', items: { oneOf: [ + { type: 'string', const: 'other' }, + { type: 'object', properties: { patch: { type: 'array', items: { type: 'object', properties: { [field]: true } } } } }, + ] } } } }) + const input = (field: string) => ({ ...document({ type: 'string' }), paths: { + '/v1/records/entries:batch': { post: { operationId: 'batchEntries', responses: success, + requestBody: { content: { 'application/json': { schema: batchPatch(field) } } } } }, + } }) + assert.ok(generate(JSON.stringify(input('value')), { breg: true }).includes('// Unconstrained JSON ')) + assert.throws(() => generate(JSON.stringify(input('extra')), { breg: true }), /outside the reviewed allowlist/u) +}) test('a generated module exports its Client over a Transport and no factory', () => { const output = generate(JSON.stringify({ ...document({ type: 'string' }), info: { title: 'licence-registry' } })) assert.match(output, /^export class Client \{$/mu) diff --git a/crates/registry-cli-docs/catalog.json b/crates/registry-cli-docs/catalog.json index 1db71b3d5f..27384f14fa 100644 --- a/crates/registry-cli-docs/catalog.json +++ b/crates/registry-cli-docs/catalog.json @@ -13563,7 +13563,7 @@ { "name": "check", "invocation": "coordinatorctl check", - "about": "Validate the workflow, functions and root YAML companions offline", + "about": "Validate the workflow, Transforms and root YAML companions offline", "long_about": null, "usage": "coordinatorctl check [OPTIONS]", "arguments": [], @@ -13669,7 +13669,7 @@ { "name": "explain", "invocation": "coordinatorctl explain", - "about": "Explain a checked graph, mappings and execution bounds offline, or the helpers Functions may call", + "about": "Explain a checked graph, mappings and execution bounds offline, or the helpers Transforms may call", "long_about": null, "usage": "coordinatorctl explain [OPTIONS] --project \n coordinatorctl explain ", "arguments": [], @@ -13728,11 +13728,11 @@ "constraints": [], "subcommands": [ { - "name": "functions", - "invocation": "coordinatorctl explain functions", - "about": "List the helpers a pure Function may call, with the interpreter ABI and limits", + "name": "transforms", + "invocation": "coordinatorctl explain transforms", + "about": "List the helpers a pure Transform may call, with the interpreter ABI and limits", "long_about": null, - "usage": "coordinatorctl explain functions [OPTIONS]", + "usage": "coordinatorctl explain transforms [OPTIONS]", "arguments": [], "options": [ { @@ -19399,11 +19399,11 @@ "invocation": "evidencectl check", "about": "Check a normalized project and, when selected, deployment closure, or one tooling file, offline", "long_about": null, - "usage": "evidencectl check [OPTIONS] >", + "usage": "evidencectl check [OPTIONS] |--store-provision-config >", "arguments": [ { "display": "[PROJECT]", - "description": "Editable Evidence project directory. Required unless --file is given", + "description": "Editable Evidence project directory. Required unless --file or --store-provision-config is given", "always_required": false, "repeatable": false, "default_values": [], @@ -19430,6 +19430,24 @@ "possible_values": [], "environment": null }, + { + "display": "--store-provision-config ", + "description": "Check a store provisioning file offline without resolving secrets", + "always_required": false, + "repeatable": false, + "default_values": [], + "possible_values": [], + "environment": null + }, + { + "display": "--environment", + "description": "Resolve text substitutions in the provisioning file from the environment", + "always_required": false, + "repeatable": false, + "default_values": [], + "possible_values": [], + "environment": null + }, { "display": "--target ", "description": "Explicit deployment target whose governance and runtime structure are checked", @@ -19488,7 +19506,15 @@ "when": null, "arguments": [ "[PROJECT]", - "--file " + "--file ", + "--store-provision-config " + ] + }, + { + "kind": "requires-all", + "when": "--environment", + "arguments": [ + "--store-provision-config " ] }, { @@ -19506,6 +19532,14 @@ "--production" ] }, + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--file ", + "--store-provision-config " + ] + }, { "kind": "mutually-exclusive", "when": null, @@ -19521,6 +19555,30 @@ "--file ", "[PROJECT]" ] + }, + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--production", + "--store-provision-config " + ] + }, + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--store-provision-config ", + "--target " + ] + }, + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--store-provision-config ", + "[PROJECT]" + ] } ], "subcommands": [] @@ -23647,6 +23705,112 @@ "constraints": [], "subcommands": [] }, + { + "name": "provision", + "invocation": "evidencectl provision", + "about": "Create split PostgreSQL roles and an empty database for a held Evidence store", + "long_about": null, + "usage": "evidencectl provision [OPTIONS] --runtime-config ", + "arguments": [], + "options": [ + { + "display": "--admin-url-file ", + "description": "File holding the administrator PostgreSQL URL", + "always_required": false, + "repeatable": false, + "default_values": [], + "possible_values": [], + "environment": null + }, + { + "display": "--admin-url-env ", + "description": "Name of the environment variable holding the administrator PostgreSQL URL", + "always_required": false, + "repeatable": false, + "default_values": [], + "possible_values": [], + "environment": null + }, + { + "display": "--print-sql", + "description": "Print the SQL script and connect to nothing", + "always_required": false, + "repeatable": false, + "default_values": [], + "possible_values": [], + "environment": null + }, + { + "display": "--posture ", + "description": "Declared posture: development or production. Unset means production", + "always_required": false, + "repeatable": false, + "default_values": [], + "possible_values": [], + "environment": null + }, + { + "display": "--runtime-config ", + "description": "Runtime configuration file for Evidence store provisioning", + "always_required": true, + "repeatable": false, + "default_values": [], + "possible_values": [], + "environment": null + }, + { + "display": "--format ", + "description": "Emit the selected command's report in this format. `junit` is accepted only by `test` and `fixtures run`", + "always_required": false, + "repeatable": false, + "default_values": [ + "human" + ], + "possible_values": [ + "human", + "json", + "junit" + ], + "environment": null + }, + { + "display": "-h, --help", + "description": "Print help", + "always_required": false, + "repeatable": false, + "default_values": [], + "possible_values": [], + "environment": null + } + ], + "constraints": [ + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--admin-url-env ", + "--admin-url-file " + ] + }, + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--admin-url-env ", + "--print-sql" + ] + }, + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--admin-url-file ", + "--print-sql" + ] + } + ], + "subcommands": [] + }, { "name": "runtime", "invocation": "evidencectl runtime", @@ -27551,6 +27715,24 @@ "possible_values": [], "environment": null }, + { + "display": "--route-inventory-out ", + "description": "Write browser paths for the selected Base Registry Engine route from a verified loopback HTTPS assembly", + "always_required": false, + "repeatable": false, + "default_values": [], + "possible_values": [], + "environment": null + }, + { + "display": "--checked-route ", + "description": "Select the Base Registry Engine module for the browser route inventory", + "always_required": false, + "repeatable": false, + "default_values": [], + "possible_values": [], + "environment": null + }, { "display": "--standalone-out ", "description": "Write one complete Envoy JSON configuration using loopback listeners and upstreams", @@ -27578,6 +27760,24 @@ "possible_values": [], "environment": null }, + { + "display": "--tls-certificate ", + "description": "Absolute filename of the certificate chain for dedicated loopback HTTPS", + "always_required": false, + "repeatable": false, + "default_values": [], + "possible_values": [], + "environment": null + }, + { + "display": "--tls-key ", + "description": "Absolute filename of the Envoy TLS private key", + "always_required": false, + "repeatable": false, + "default_values": [], + "possible_values": [], + "environment": null + }, { "display": "--posture ", "description": "Declared posture: development or production. Unset means production.", @@ -27608,6 +27808,22 @@ "--standalone-out " ] }, + { + "kind": "requires-all", + "when": "--route-inventory-out ", + "arguments": [ + "--verify-assembled ", + "--checked-route " + ] + }, + { + "kind": "requires-all", + "when": "--checked-route ", + "arguments": [ + "--verify-assembled ", + "--route-inventory-out " + ] + }, { "kind": "requires-all", "when": "--standalone-out ", @@ -27623,6 +27839,24 @@ "--standalone-out " ] }, + { + "kind": "requires-all", + "when": "--tls-certificate ", + "arguments": [ + "--listen
", + "--standalone-out ", + "--tls-key " + ] + }, + { + "kind": "requires-all", + "when": "--tls-key ", + "arguments": [ + "--standalone-out ", + "--tls-certificate ", + "--listen
" + ] + }, { "kind": "mutually-exclusive", "when": null, @@ -29838,14 +30072,14 @@ { "name": "check", "invocation": "rstack dev check", - "about": "Validate a development plan without starting services", + "about": "Validate a development plan or the structure of a saved owner report without starting services", "long_about": null, - "usage": "rstack dev check [OPTIONS] ", + "usage": "rstack dev check [OPTIONS] [PROJECT]", "arguments": [ { - "display": "", + "display": "[PROJECT]", "description": "Project directory containing dev.yaml and, when it declares audiences, service.yaml", - "always_required": true, + "always_required": false, "repeatable": false, "default_values": [], "possible_values": [], @@ -29853,6 +30087,27 @@ } ], "options": [ + { + "display": "--owner-report ", + "description": "Saved JSON report to check structurally", + "always_required": false, + "repeatable": false, + "default_values": [], + "possible_values": [], + "environment": null + }, + { + "display": "--owner-report-format ", + "description": "Exact saved document format", + "always_required": false, + "repeatable": false, + "default_values": [], + "possible_values": [ + "casework-report", + "breg-identity-facts-report" + ], + "environment": null + }, { "display": "--deny-warnings", "description": "Refuse an unaccepted warning. Development posture listings do not count", @@ -29886,7 +30141,38 @@ "environment": null } ], - "constraints": [], + "constraints": [ + { + "kind": "requires-all", + "when": "--owner-report ", + "arguments": [ + "--owner-report-format " + ] + }, + { + "kind": "requires-all", + "when": "--owner-report-format ", + "arguments": [ + "--owner-report " + ] + }, + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--owner-report ", + "[PROJECT]" + ] + }, + { + "kind": "mutually-exclusive", + "when": null, + "arguments": [ + "--owner-report-format ", + "[PROJECT]" + ] + } + ], "subcommands": [] }, { @@ -29918,7 +30204,7 @@ }, { "display": "--database-url ", - "description": "PostgreSQL administrator URL (verified TLS, or loopback with sslmode=disable). Defaults to RSTACK_DEV_DATABASE_URL; without either, the run starts its own PostgreSQL server in Docker", + "description": "PostgreSQL administrator URL. Defaults to verified TLS. For development, select loopback plaintext with sslmode=disable or private network plaintext with transport=private-network-plaintext. Defaults to RSTACK_DEV_DATABASE_URL; without either, the run starts its own PostgreSQL server in Docker", "always_required": false, "repeatable": false, "default_values": [], @@ -30161,7 +30447,7 @@ }, { "display": "--database-url ", - "description": "PostgreSQL administrator URL for --recover (verified TLS, or loopback with sslmode=disable). Defaults to RSTACK_DEV_DATABASE_URL; a run that started its own server needs none", + "description": "The same PostgreSQL administrator URL used at start, including its transport choice. Defaults to RSTACK_DEV_DATABASE_URL; a run that started its own server needs none", "always_required": false, "repeatable": false, "default_values": [], diff --git a/crates/registry-rstack-dev/src/external_breg.rs b/crates/registry-rstack-dev/src/external_breg.rs index 98ca725314..31249ffe58 100644 --- a/crates/registry-rstack-dev/src/external_breg.rs +++ b/crates/registry-rstack-dev/src/external_breg.rs @@ -101,10 +101,28 @@ impl TaskGrant { ) } - pub(super) fn validate_for_scheduling( + /// Once people are resolved from their roles, the assertion client must + /// name exactly one planned Scheduling caller. + pub(super) fn validate_scheduling_caller(&self, plan: &Plan) -> SemanticResult<()> { + require( + plan.people + .values() + .filter(|person| { + person.client == self.assertion_client + && person.grants.contains_key(&Product::Scheduling) + }) + .count() + == 1, + "/externalScheduling/taskGrant/assertionClient", + "The assertion client must name exactly one planned Scheduling caller.", + "Use the exact external booking client in one Scheduling grant entry.", + ) + } + + pub(super) fn validate_for_scheduling( &self, root: &Path, - plan: &Plan, + plan: &Plan, audience: &str, ) -> SemanticResult<()> { let same_origin = |endpoint: &str| { @@ -134,16 +152,7 @@ impl TaskGrant { "Use the issuer name in the Casework task grant.", )?; check( - identifier(&self.assertion_client) - && plan - .people - .values() - .filter(|person| { - person.client == self.assertion_client - && person.grants.contains_key(&Product::Scheduling) - }) - .count() - == 1, + identifier(&self.assertion_client), "assertionClient", "The assertion client must name exactly one planned Scheduling caller.", "Use the exact external booking client in one Scheduling grant entry.", diff --git a/crates/registry-rstack-dev/src/owner_report_tests.rs b/crates/registry-rstack-dev/src/owner_report_tests.rs index 4a650da70b..4a7c1704e9 100644 --- a/crates/registry-rstack-dev/src/owner_report_tests.rs +++ b/crates/registry-rstack-dev/src/owner_report_tests.rs @@ -7,12 +7,14 @@ const CASEWORK: &str = const BREG_IDENTITY_FACTS: &str = include_str!("../../../products/breg/examples/formats/identity-facts-report.json"); -fn decode(bytes: &[u8], format: Format) -> Result<(), Diagnostic> { +fn decode(bytes: &[u8], format: Format) -> Result<(), Box> { let (report, exit) = check_bytes("synthetic.json", bytes, format); if exit == 0 { Ok(()) } else { - Err(report.into_diagnostics().into_iter().next().unwrap()) + Err(Box::new( + report.into_diagnostics().into_iter().next().unwrap(), + )) } } @@ -221,9 +223,15 @@ fn saved_report_retains_positions_and_numeric_bounds_without_echoing_input() { #[test] fn saved_report_retains_unknown_key_locations_and_all_envelope_refusals() { - let source = CASEWORK.replace( - "\"version\": \"0.49.0-dev\"", - "\"version\": \"0.49.0-dev\",\n \"private-canary-one\": true,\n \"private-canary-two\": false", + let version = CASEWORK + .lines() + .find(|line| line.starts_with(" \"version\": ")) + .expect("the saved report states its version") + .trim_end_matches(','); + let source = CASEWORK.replacen( + version, + &format!("{version},\n \"private-canary-one\": true,\n \"private-canary-two\": false"), + 1, ); let (report, exit) = check_bytes("synthetic.json", source.as_bytes(), Format::CaseworkReport); assert_eq!(exit, 1); diff --git a/crates/registry-rstack-dev/src/plan.rs b/crates/registry-rstack-dev/src/plan.rs index 13f60d3cf9..c5a1c4da94 100644 --- a/crates/registry-rstack-dev/src/plan.rs +++ b/crates/registry-rstack-dev/src/plan.rs @@ -1741,6 +1741,9 @@ impl Plan { ), )?; } + if let Some(binding) = &self.external_scheduling { + binding.task_grant.validate_scheduling_caller(self)?; + } self.bindings.validate(self)?; Ok(()) } @@ -3933,6 +3936,10 @@ mod preview_tests { "/v1/records/licences/{recordId}", true )); + for id in ["{recordId}", "{record_id}"] { + let path = format!("/v1/records/applications/{id}/revisions/{{revision}}"); + assert!(super::super::preview::valid_path(&path, true), "{path}"); + } assert!(super::super::preview::valid_path("/check.html", false)); for path in [ "//elsewhere", @@ -3942,6 +3949,8 @@ mod preview_tests { "/v1/records?accessProfile=admin", "/v1/records/{anything}", "/v1/records/{recordId}/{recordId}", + "/v1/records/{recordId}/{record_id}", + "/v1/records/{recordId}/revisions/{revision}/{revision}", "/v1/records/#fragment", ] { assert!(!super::super::preview::valid_path(path, true), "{path}"); diff --git a/crates/registry-rstack-dev/src/preview.rs b/crates/registry-rstack-dev/src/preview.rs index 7026d7895e..e910e7bf58 100644 --- a/crates/registry-rstack-dev/src/preview.rs +++ b/crates/registry-rstack-dev/src/preview.rs @@ -181,7 +181,7 @@ impl Preview { return plan::refuse( &format!("/preview/breg/{method}"), "Preview routes need bounded literal BReg paths.", - "Use /v1/ paths with at most one {recordId} path segment, without query strings.", + "Use /v1/ paths with distinct Record ID and revision segments ({recordId}, {record_id}, {revision}), without query strings.", ).map_err(Into::into); } } @@ -253,23 +253,27 @@ pub(super) fn valid_path(path: &str, parameter: bool) -> bool { let Some(rest) = path.strip_prefix('/') else { return false; }; - let mut segments = rest.split('/'); + let mut record_id = false; + let mut revision = false; path.len() <= 256 - && segments - .clone() - .filter(|segment| *segment == "{recordId}") - .count() - <= 1 - && segments.all(|part| { - (parameter && part == "{recordId}") - || (part.len() <= 128 - && part - .as_bytes() - .first() - .is_some_and(u8::is_ascii_alphanumeric) - && part.bytes().all(|byte| { - byte.is_ascii_alphanumeric() || matches!(byte, b'-' | b'_' | b'.') - })) + && rest.split('/').all(|part| { + if parameter { + match part { + "{recordId}" | "{record_id}" => { + return !std::mem::replace(&mut record_id, true) + } + "{revision}" => return !std::mem::replace(&mut revision, true), + _ => {} + } + } + part.len() <= 128 + && part + .as_bytes() + .first() + .is_some_and(u8::is_ascii_alphanumeric) + && part + .bytes() + .all(|byte| byte.is_ascii_alphanumeric() || matches!(byte, b'-' | b'_' | b'.')) }) } diff --git a/crates/registry-rstack-dev/src/roles.rs b/crates/registry-rstack-dev/src/roles.rs index 1d0bbf4c8e..fb9b5c0245 100644 --- a/crates/registry-rstack-dev/src/roles.rs +++ b/crates/registry-rstack-dev/src/roles.rs @@ -169,6 +169,7 @@ pub(super) fn resolve( issuer, external_jwks_uri, external_breg, + external_scheduling, products, person_audience, people, @@ -259,6 +260,7 @@ pub(super) fn resolve( issuer, external_jwks_uri, external_breg, + external_scheduling, products, person_audience, people: resolved, diff --git a/crates/registry-session/src/gateway/verify.rs b/crates/registry-session/src/gateway/verify.rs index ac8a474abc..fea51f48fe 100644 --- a/crates/registry-session/src/gateway/verify.rs +++ b/crates/registry-session/src/gateway/verify.rs @@ -318,10 +318,10 @@ fn standalone_document( expected.clusters.extend(custom); } - let strip_port = !expected + let strip_port = expected .authority .rsplit_once(':') - .is_some_and(|(_, port)| port.parse::().is_ok()); + .is_none_or(|(_, port)| port.parse::().is_err()); let mut filters = expected.filters.clone(); filters.push(json!({ "name": "envoy.filters.http.router", diff --git a/docs/site/src/content/docs/operate/messaging.mdx b/docs/site/src/content/docs/operate/messaging.mdx index d552d9a266..e883c02eb0 100644 --- a/docs/site/src/content/docs/operate/messaging.mdx +++ b/docs/site/src/content/docs/operate/messaging.mdx @@ -216,7 +216,53 @@ breaks the join between records written before and after. ### Mount secret files with Docker Compose -Use the release image's default UID and GID `65532:65532` on a Linux Docker host. +Compose's native file secrets are the shortest route. Compose ignores the `uid`, `gid`, and +`mode` you declare for a file-backed secret, and on some hosts the container sees each file +owned by root at mode `0444`. The default secret rule refuses that shape. Accept it explicitly in +the runtime file: + +```yaml +secretProviders: + file: + root: /run/secrets + mountPolicy: compose-native +``` + +The setting admits only a regular file owned by root, with one hard link and mode exactly `0444`, +under the declared root. Every user in the container can read those files, so run Messaging alone +in its container under one runtime identity. Group or world write access, another owner, a +second link, and a path outside the root are still refused. A static JWKS or a CA bundle is a +public document and needs no setting. + +Compose mounts each secret at `/run/secrets/`. Declare each serving credential as a +Compose secret whose name matches its `secret:file/` reference: + +```yaml +services: + messaging: + read_only: true + secrets: + - smtp-password +secrets: + smtp-password: + file: ${MESSAGING_SMTP_PASSWORD_FILE:?set MESSAGING_SMTP_PASSWORD_FILE} +``` + +Declare `runtime-database-url`, `messaging-audit-key`, `smtp-username`, `sms-gateway-token`, and +`sms-gateway-callback-key` the same way. Keep the migration credential out of the serving service. + +`messagingctl check --production` prints +`Explicit production setting platform.posture.compose-native-secret-mount at /secretProviders/file/mountPolicy`, +and startup logs `explicit production setting in use` with the same code. Without the setting, +startup refuses the first secret file with `platform.secret-file.world-readable`. + +{/* Evidence: crates/registry-platform-config/src/blocks.rs, COMPOSE_NATIVE_SECRET_MOUNT; + crates/registry-platform-config/src/secrets.rs, judge and resolve_public_document; + crates/registry-platform-config/src/posture.rs, log_startup. */} + +#### Use a hardened secret directory + +Omit `mountPolicy` to keep the stricter rule. Use the release image's default UID and GID `65532:65532` on a Linux Docker host. Have the secret custodian create a dedicated directory owned by root, group `65532`, mode `0750`. Use regular files owned by root, group `65532`, mode `0440`, with exactly one hard link each. On the host, grant group `65532` only to the secret custodian. Restrict ACLs to the diff --git a/docs/site/src/content/docs/tutorials/first-breg.mdx b/docs/site/src/content/docs/tutorials/first-breg.mdx index b11b1ebdca..02b6617226 100644 --- a/docs/site/src/content/docs/tutorials/first-breg.mdx +++ b/docs/site/src/content/docs/tutorials/first-breg.mdx @@ -120,13 +120,11 @@ accessProfiles: `rstack dev` runs the project on your machine from a development plan. The plan lists the products to run and the synthetic people who call them, with the claims each person's test token carries. -`rstack breg init` wrote a starter `service.yaml`, `dev.yaml` and `dev-journeys.yaml`. Replace `dev.yaml` with this -plan, which gives the test caller `editor` the claim `zone-a` and `foreign-editor` the claim -`zone-b`: +`rstack breg init` already wrote the plan you need, so you do not change any file in this step. +Open `dev.yaml`. It gives the test caller `editor` the claim `zone-a` and `foreign-editor` the +claim `zone-b`: -```yaml title="dev.yaml" test-file -apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 -kind: RStackDev +```yaml title="dev.yaml" test-excerpt="dev.yaml" issuer: https://identity.directory.example.test products: - {product: breg, project: ., audience: "urn:example:local-directory"} @@ -137,31 +135,27 @@ people: roles: [directory-editor] claims: breg: {jurisdiction: zone-a} + purposes: {breg: directory-administration} foreign-editor: subject: synthetic-foreign-editor client: directory-editor roles: [directory-editor] claims: breg: {jurisdiction: zone-b} -# Both people match the profile, so each journey step names its person. -schemaTestPeople: - directory-contact: - create-contact: editor - read-contact: editor - conceal-contact-outside-jurisdiction: foreign-editor - obtain-email-condition: editor - update-contact-email: editor - read-updated-contact: editor - start-registration: editor - submit-registration: editor + purposes: {breg: directory-administration} +# Both people match the editor profile, so each schema-test step names its person. journeyFile: dev-journeys.yaml ``` +Each person's `roles` entry refers to a role in `service.yaml`, which selects the +`directory-editor` access profile for them. Each step in `tests/journeys.yaml` names the person who +runs it with `actor`. + The plan's `journeyFile` names the HTTP requests that `rstack dev` sends once the registry is -running. Replace `dev-journeys.yaml` at the project root with a journey that adds one contact in -`zone-a` as `editor` and reads it back. +running. Open `dev-journeys.yaml` at the project root. Its journey adds one contact in `zone-a` as +`editor` and reads it back: -```yaml title="dev-journeys.yaml" test-file +```yaml title="dev-journeys.yaml" test-excerpt="dev-journeys.yaml" apiVersion: id.registrystack.org/formats/rstack/journeys/v1alpha1 kind: RStackJourneys journeys: diff --git a/products/identifiers/contracts/catalog-source.json b/products/identifiers/contracts/catalog-source.json index 11b9d4ce38..dcfd97f4b7 100644 --- a/products/identifiers/contracts/catalog-source.json +++ b/products/identifiers/contracts/catalog-source.json @@ -309,6 +309,14 @@ "compatibilityLine": "v1alpha1", "description": "Registry Stack session service runtime configuration JSON Schema." }, + { + "glob": "products/platform/generated/session-runtime/session-route-inventory.v1alpha1.schema.json", + "sourcePath": "crates/registry-session/src/schema.rs", + "owner": "platform", + "status": "active", + "compatibilityLine": "v1alpha1", + "description": "Checked Registry Session browser route inventory JSON Schema." + }, { "glob": "products/platform/generated/mcp-runtime/*.schema.json", "sourcePath": "crates/registry-mcp/src/schema.rs", diff --git a/products/identifiers/generated/catalog.v1.json b/products/identifiers/generated/catalog.v1.json index ad5294efad..a3f8dcb426 100644 --- a/products/identifiers/generated/catalog.v1.json +++ b/products/identifiers/generated/catalog.v1.json @@ -1847,7 +1847,7 @@ "description": "Starts stay held after a restore until an operator releases the admission hold.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "admission.held", @@ -1866,7 +1866,7 @@ "description": "This instance runs in recovery-only mode and admits no runs. Send starts to the ordinary service.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "admission.recovery-only", @@ -1885,7 +1885,7 @@ "description": "The operation may have completed, but its audited result could not be released. Inspect the run before repeating the operation.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "audit.response-unavailable", @@ -1904,7 +1904,7 @@ "description": "The caller credential or completion signature is missing, invalid, or expired.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "authentication.refused", @@ -1923,7 +1923,7 @@ "description": "The run's original connection settings differ from this service's runtime configuration.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "binding.conflict", @@ -1942,7 +1942,7 @@ "description": "Connection settings that runs in progress use differ from this service's runtime configuration.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "binding.live-conflict", @@ -1961,7 +1961,7 @@ "description": "That step is not waiting.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "check.not-waiting", @@ -1977,10 +1977,10 @@ "compatibilityLine": "v1alpha1", "owner": "coordinator", "title": "Workflow definition refused", - "description": "The workflow's workflow definition, one of its mappings or one of its functions refused the request.", + "description": "The workflow's workflow definition, one of its mappings or one of its Transforms refused the request.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "definition.refused", @@ -1999,7 +1999,7 @@ "description": "An apply changed the active packages after this service started. Restart it with the runtime file that apply used.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "deployment.activation-changed", @@ -2018,7 +2018,7 @@ "description": "The deployment's activation, runtime configuration or state key custody check failed.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "deployment.refused", @@ -2037,7 +2037,7 @@ "description": "An evaluation may have completed at its provider, so the run is never evaluated again.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "evaluation.uncertain", @@ -2056,7 +2056,7 @@ "description": "The signed event must satisfy the accepted canonical envelope and typed event contract.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "event.invalid", @@ -2075,7 +2075,7 @@ "description": "The signed event exceeds the event value profile: 131072 canonical bytes, 32 levels of nesting, 4096 values, 256 items per array, 256 members per object, and 16384 bytes per string. Have the producer project fewer or smaller fields into the event.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "event.too-large", @@ -2094,7 +2094,7 @@ "description": "Send a fresh signed delivery from the exact configured source to its accepted trigger.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "event.unauthenticated", @@ -2113,7 +2113,7 @@ "description": "Execution is under restore hold until an operator releases it.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "execution.held", @@ -2132,7 +2132,7 @@ "description": "Supply an Idempotency-Key header of 1 to 256 bytes.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "idempotency.key-invalid", @@ -2151,7 +2151,7 @@ "description": "This idempotency key already started a run with different input.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "idempotency.key-reused", @@ -2170,7 +2170,7 @@ "description": "The start input does not satisfy the workflow's declared input schema and value bounds.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "input.invalid", @@ -2189,7 +2189,7 @@ "description": "A mutation may have completed at its provider, so the run never sends it again. Reconcile it when its operation offers a read-only receipt lookup; otherwise inspect or cancel the run.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "mutation.uncertain", @@ -2208,7 +2208,7 @@ "description": "The caller's policy does not allow this operation.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "operation.not-authorized", @@ -2227,7 +2227,7 @@ "description": "The original command's receipt can no longer be recovered. This is not evidence that the command was not sent.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "receipt.expired", @@ -2246,7 +2246,7 @@ "description": "The run's progress changed while it was being reconciled. Inspect it again.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "reconcile.raced", @@ -2265,7 +2265,7 @@ "description": "Reconcile applies only to a held mutation with a prepared command, its original binding and no active lease.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "reconcile.refused", @@ -2284,7 +2284,7 @@ "description": "The held operation has no original-result lookup.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "reconcile.unsupported", @@ -2303,7 +2303,7 @@ "description": "The request body exceeds the accepted size: 65536 bytes for a JSON request, or 1048576 bytes for a signed event delivery.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "request.body-too-large", @@ -2322,7 +2322,7 @@ "description": "The request could not be read as a Coordinator request.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "request.invalid", @@ -2341,7 +2341,7 @@ "description": "The list limit must be between 1 and 100.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "request.limit-out-of-range", @@ -2360,7 +2360,7 @@ "description": "The route exists but not for this method.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "request.method-not-allowed", @@ -2379,7 +2379,7 @@ "description": "The requested route does not exist.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "request.not-found", @@ -2398,7 +2398,7 @@ "description": "The reason or recovery reference must be a bounded reference without personal data or control characters.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "request.reason-invalid", @@ -2417,7 +2417,7 @@ "description": "The retention cutoff must be in the past and the limit between 1 and 100.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "request.retention-invalid", @@ -2436,7 +2436,7 @@ "description": "The request body could not be processed.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "request.unprocessable", @@ -2455,7 +2455,7 @@ "description": "The request body is not JSON.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "request.unsupported-media-type", @@ -2474,7 +2474,7 @@ "description": "This recovery action requires execution to be under restore hold.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "restore.hold-required", @@ -2493,7 +2493,7 @@ "description": "Held work no longer matches its protected definition or prepared command.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "restore.lease-incompatible", @@ -2512,7 +2512,7 @@ "description": "Execution history must be complete and the prior deployment fenced before recovery is reviewed.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "restore.review-required", @@ -2531,7 +2531,7 @@ "description": "Held work remains unresolved, so the restore hold cannot be released.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "restore.unresolved", @@ -2550,7 +2550,7 @@ "description": "Retry-same applies only to held work before its original deadline.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "retry.refused", @@ -2569,7 +2569,7 @@ "description": "This service's Coordinator version cannot interpret the run's pinned definition.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "run.definition-incompatible", @@ -2588,7 +2588,7 @@ "description": "No run with this identifier is visible to the caller.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "run.not-visible", @@ -2607,7 +2607,7 @@ "description": "Retention erased this run's payloads, so it can no longer be retried or reconciled.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "run.payload-erased", @@ -2626,7 +2626,7 @@ "description": "Coordinator could not complete the request.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "runtime.failure", @@ -2645,7 +2645,7 @@ "description": "A dependency of the Coordinator, such as its database, audit stream or token verifier, is unavailable. Try again after the service recovers.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "service.unavailable", @@ -2664,7 +2664,7 @@ "description": "This deployment does not serve the named workflow.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "workflow.not-served", @@ -2683,7 +2683,7 @@ "description": "The expected workflow revision differs from the active revision or the original admission.", "source": { "path": "crates/registry-coordinator/src/problem.rs", - "sha256": "45d584b668b183e59a2328f935f6caa523b3fef2d2e727e7d1faa98079d9e49f" + "sha256": "597d0f3d8488bd54437563b6149baa8410f6d44e16a7143e37bf990d0fd1f3de" }, "problem": { "code": "workflow.revision-mismatch", @@ -5267,7 +5267,7 @@ }, "artifact": { "path": "products/adapter/schemas/job-runtime.v1alpha1.schema.json", - "sha256": "0449f7d543ff800396616fe2464f8feefb4288d1e3efc67caf1d97f8e7e93083", + "sha256": "867bd2e4a48ffa4e639002d8b19522804d6716903c99508c2a4d4436a3b96398", "mediaType": "application/schema+json" } }, @@ -5447,7 +5447,7 @@ }, "artifact": { "path": "products/adapter/schemas/runtime.v1alpha1.schema.json", - "sha256": "c50ad7d98f4b14b07c89614872d9fe3963cd68590014e6a995dba4ef0d4229ff", + "sha256": "99d3b0f61717e804fde996a4f042d375a3957e4f6e07bd9d313ef31c1310529c", "mediaType": "application/schema+json" } }, @@ -5663,7 +5663,7 @@ }, "artifact": { "path": "products/breg/generated/mcp-runtime/mcp-runtime.schema.json", - "sha256": "2e625db395d51c21d1c3c5f02d4373ccc585c5c16ffceb247e3af61b2c3de808", + "sha256": "a1272f3d77f9a8e27425e8613d3a2cf76cb37e60eb90c6473660b9f7e0d3da8c", "mediaType": "application/schema+json" } }, @@ -5807,7 +5807,7 @@ }, "artifact": { "path": "products/breg/generated/review-runtime/review-runtime.schema.json", - "sha256": "28f0d22758368cef7718da05186ba475e4051308f3df1ab9452b5bec39b53112", + "sha256": "ec5d87d3668095586a821abd7a0f8b998bdad11f10123392188de6808bd129d9", "mediaType": "application/schema+json" } }, @@ -5843,7 +5843,7 @@ }, "artifact": { "path": "products/breg/generated/runtime/runtime.schema.json", - "sha256": "6a2681e545da5d44a2d2bc2912797cc481dc39089eafd712acf738c478a5a7b0", + "sha256": "d04c498a9cf820332b5d8a9f09b61e215bc0c3dca6d770b49e67cf4844626d9e", "mediaType": "application/schema+json" } }, @@ -5951,7 +5951,7 @@ }, "artifact": { "path": "products/casework/generated/runtime/runtime.schema.json", - "sha256": "f24571d637629b2d913ec6efb88944306c84dcd2b00ea8e03848049fd7574201", + "sha256": "43f97b7653608f98df7093fde327d515d76380213350af7c85d027e609c70099", "mediaType": "application/schema+json" } }, @@ -5965,11 +5965,11 @@ "description": "Registry Coordinator deterministic fixture authoring JSON Schema.", "source": { "path": "crates/registry-coordinator/src/scenarios.rs", - "sha256": "a3b78b3da6f9fcec6f5e40416295ae5ad481cdcdfb770c6bb1715e0fd7dfc3c9" + "sha256": "8ef5c37541be5c83c60fa82c20d615b79287df941b33c34b8d6a12ed83d562d9" }, "artifact": { "path": "products/coordinator/generated/fixture/fixture.schema.json", - "sha256": "1802438e02edad82557153c88818bbe2ffa8e243679f6d0306b811edc1adedb3", + "sha256": "7817d78eff4d92363247ecae6d7b672a4c25f51e46ec3b6507f403e55416830d", "mediaType": "application/schema+json" } }, @@ -5983,11 +5983,11 @@ "description": "Registry Coordinator portable project authoring JSON Schema.", "source": { "path": "crates/registry-coordinator/src/authoring.rs", - "sha256": "233ac8ce1b8f2a7c52bc39a2b48f55ba9ffc1c00be6dea1821089c9736ed8122" + "sha256": "5a69b78d0bd226766a8acaa1d25620309f3294b05aeef34250ea2cea6c6db267" }, "artifact": { "path": "products/coordinator/generated/project/project.schema.json", - "sha256": "69e53bda51ef36c2540769d13af80eaa09f6768b44d8379b79fe0886c7a53555", + "sha256": "4e6aec4ae96ea5a85738802f64e30cb7a4af439ec43fdf0c5b9d8cbe6d96e7ad", "mediaType": "application/schema+json" } }, @@ -6005,7 +6005,7 @@ }, "artifact": { "path": "products/coordinator/generated/runtime/runtime.schema.json", - "sha256": "131466a7fe178d178cd7121eddd15a7bd9229c36a570ad378cd2bff5658c7e7f", + "sha256": "24839c55d2b01edab884dcc18ee1324689dbd52fe958fba51fe55cc5b15d2099", "mediaType": "application/schema+json" } }, @@ -6167,7 +6167,7 @@ }, "artifact": { "path": "products/documents/generated/runtime/runtime.schema.json", - "sha256": "fdf6aa6c21a03c67c7cd656c55155f052d904637d14eadab49434dfd6b28cd8f", + "sha256": "d076eeea14926df9c8812c5e01f1a1e6dbfb2556e490404d848203ee67492de7", "mediaType": "application/schema+json" } }, @@ -6329,7 +6329,7 @@ }, "artifact": { "path": "products/evidence/generated/oid4vci-runtime/oid4vci-runtime.schema.json", - "sha256": "d0b24a5fd3be64a975e6132022e74e95e7258af054466b8b068c78e85e64e870", + "sha256": "01a20c74693699d6be5c62584edbf3137e49fbf2f3c2c4c5616004a873b5b765", "mediaType": "application/schema+json" } }, @@ -6347,7 +6347,7 @@ }, "artifact": { "path": "products/evidence/generated/oid4vp-runtime/oid4vp-runtime.schema.json", - "sha256": "a299d83c097229892bc82765782e86b7852bad3fddd4124d33b8b84ec0d66ca0", + "sha256": "81d70d9488a0bd7cdbaf897ad016fe9cca86b862b5ee5e6b891279b0197a52d6", "mediaType": "application/schema+json" } }, @@ -6405,6 +6405,24 @@ "mediaType": "application/schema+json" } }, + { + "uri": "https://id.registrystack.org/schemas/evidence/store-provision/store-provision.v1alpha1.schema.json", + "kind": "schema", + "status": "active", + "compatibilityLine": "v1alpha1", + "owner": "evidence", + "title": "Evidence store provisioning config", + "description": "Evidence authoring project marker and question JSON Schema.", + "source": { + "path": "crates/registry-evidence-authoring/src/schema.rs", + "sha256": "62464b27cb80552652f785f820ed3655cc9d48aa65dba30dcaea5696c5e79f70" + }, + "artifact": { + "path": "crates/registry-evidencectl/schemas/authoring/store-provision.schema.json", + "sha256": "ad586d201fb64370c09ec18bf9c6aa57f3a8833aaecac7ba748f09dc0bc36d51", + "mediaType": "application/schema+json" + } + }, { "uri": "https://id.registrystack.org/schemas/evidence/target-authority/target-authority.v1alpha1.schema.json", "kind": "schema", @@ -6563,7 +6581,7 @@ }, "artifact": { "path": "products/messaging/generated/runtime/runtime.schema.json", - "sha256": "a455dc4f8c409aa72b599b905b92270cbc0940d465ce57ad86c302b1c5e2974d", + "sha256": "5f42d3706e2b6ad00a430288c7c637395bbee43b8b7635fc0ceb990bebeb788d", "mediaType": "application/schema+json" } }, @@ -6635,7 +6653,7 @@ }, "artifact": { "path": "crates/registry-cli-api/schema/connections.schema.json", - "sha256": "8885a96cae62ec9a421f6327ec7b9d165991b6d7996763d20d018c3d7d249f39", + "sha256": "9d757eeac7bfd9a08ac7d421d6dd4620344d924becd31a77bcf7aec87d8e6b6c", "mediaType": "application/schema+json" } }, @@ -6707,7 +6725,7 @@ }, "artifact": { "path": "products/platform/generated/mcp-runtime/mcp-runtime.schema.json", - "sha256": "f8e707b47f804f8c8fb44589dda071ab0eab14593185ec9c9376bfc88455f9f7", + "sha256": "943bb3a53811c35e5cb9a3457a7c5225586e26dbea99b50b005825e5cd5df86a", "mediaType": "application/schema+json" } }, @@ -6721,7 +6739,7 @@ "description": "rstack error report JSON Schema.", "source": { "path": "crates/registry-rstack/src/cli.rs", - "sha256": "bcfb6c9aaa0911db294ea36fec384039ff55bc06ad84d9669bc78071a648d6b4" + "sha256": "c0fe7cb20b590714dd367fffab20a33ef4e3afb4272811d7e34b34bcb7757495" }, "artifact": { "path": "products/platform/schemas/rstack-dev-error.v1.schema.json", @@ -6729,6 +6747,24 @@ "mediaType": "application/schema+json" } }, + { + "uri": "https://id.registrystack.org/schemas/platform/session-route-inventory/session-route-inventory.v1alpha1.schema.json", + "kind": "schema", + "status": "active", + "compatibilityLine": "v1alpha1", + "owner": "platform", + "title": "Checked Registry Session route inventory", + "description": "Checked Registry Session browser route inventory JSON Schema.", + "source": { + "path": "crates/registry-session/src/schema.rs", + "sha256": "e80a34bb3965ff9d2cea8cdae58dc748db23ecb23c29eb53981f5b2abdc88665" + }, + "artifact": { + "path": "products/platform/generated/session-runtime/session-route-inventory.v1alpha1.schema.json", + "sha256": "b732312a4fb335fd6c1afcd6d146a5f3a402cc65a9a32a5c3be54c9541a6951f", + "mediaType": "application/schema+json" + } + }, { "uri": "https://id.registrystack.org/schemas/platform/session-runtime/session-runtime.v1alpha1.schema.json", "kind": "schema", @@ -6739,11 +6775,11 @@ "description": "Registry Stack session service runtime configuration JSON Schema.", "source": { "path": "crates/registry-session/src/schema.rs", - "sha256": "280ac4ba91fc96ef4421ccc9deac1bab492036b8e48f48c197ff4c2bbf817091" + "sha256": "e80a34bb3965ff9d2cea8cdae58dc748db23ecb23c29eb53981f5b2abdc88665" }, "artifact": { "path": "products/platform/generated/session-runtime/session-runtime.schema.json", - "sha256": "65afffcd321fa818de14a7f568ee36ee8f42ac621d686a0c58bc0bba163ddf8c", + "sha256": "c80019fe44d6032107978be57e1380b2fb060b527f535a4a1705b733b2517f01", "mediaType": "application/schema+json" } }, @@ -6761,7 +6797,7 @@ }, "artifact": { "path": "products/platform/schemas/task-connection.schema.json", - "sha256": "aa6f4dded82d3614a2ce83916b0e916c63b12def7678a9eab9eb8aa67e55a7dd", + "sha256": "d1e3b34b174de0afb1cf1c87895f51273541305d451e3fcb9891393448ebd745", "mediaType": "application/schema+json" } }, @@ -6833,7 +6869,7 @@ }, "artifact": { "path": "products/render/schemas/runtime.schema.json", - "sha256": "056770ac3ae7f273b82d4593ec2403c3706763e61c432d0615d8e6437c796d46", + "sha256": "f08bea3ff05ebcae08042409cc4616834460308489c220cc06d8e729b7e02bd7", "mediaType": "application/schema+json" } }, @@ -6851,7 +6887,7 @@ }, "artifact": { "path": "products/platform/generated/dev/dev.v1alpha1.schema.json", - "sha256": "b22f51c0b03704dfab13513765c70acc631e4a01807703bbfb279dc9120afcde", + "sha256": "88c6a55a99fa1df179ecbf0899a62755831e2052b65ad16d53856776e80d6617", "mediaType": "application/schema+json" } }, @@ -6959,7 +6995,7 @@ }, "artifact": { "path": "products/scheduling/generated/runtime/runtime.schema.json", - "sha256": "3994ba81be800176372d33491965eb6f756d0426d3262135bf500cce1d6a6949", + "sha256": "a631ed1da44c6778cc9574284c697ea60a824ebd26d338e5ec3e825262cec440", "mediaType": "application/schema+json" } }, diff --git a/products/platform/examples/service-previews/business-registration/README.md b/products/platform/examples/service-previews/business-registration/README.md index 2357392424..b57d9a5d99 100644 --- a/products/platform/examples/service-previews/business-registration/README.md +++ b/products/platform/examples/service-previews/business-registration/README.md @@ -5,6 +5,12 @@ printed URL, enter a synthetic business name and registration number such as `BR-BROWSER-2026-001` and select **Register business**. The confirmation reads the new business Record from BReg. +The form check and registration fit in one request. A service function +prepares the input and asks BReg to run the registration Action under the +registrar's authority. The function holds no authority of its own. If your +registration procedure must wait for an officer's decision or has steps that +someone needs to review, put those steps in a Coordinator flow. + - [service.yaml](service.yaml) names the register, frontend and function. - [The BReg project](project/registry.yaml) defines the Record, unique registration number, Action and registrar access profile. @@ -12,7 +18,7 @@ the new business Record from BReg. the same Action. - [dev.yaml](dev.yaml) selects the synthetic registrar and permits business reads and the registration function. -- [The registration function](functions/register-business/index.ts) receives - a typed BReg client for the request and invokes the Action as the registrar. +- [The registration service function](functions/register-business/index.ts) + receives a typed BReg client for the request. - [The page code](web/src/page.ts) calls the function and reads the created Record with the generated client. diff --git a/products/platform/examples/service-previews/medical-renewal/README.md b/products/platform/examples/service-previews/medical-renewal/README.md index 8cef0bc573..61531f06ad 100644 --- a/products/platform/examples/service-previews/medical-renewal/README.md +++ b/products/platform/examples/service-previews/medical-renewal/README.md @@ -5,14 +5,21 @@ printed URL, review the synthetic holder's medical licence and select **Renew licence**. The confirmation reads the updated expiry of 30 June 2028 from BReg. +The holder reviews the licence before submitting the form. A service function +then prepares the renewal and asks BReg to run the Action under the holder's +authority. The renewal fits in one request. If your renewal procedure must +wait for someone else to decide or has steps that someone needs to review, +put those steps in a Coordinator flow. + - [service.yaml](service.yaml) names the register, frontend and function. - [The BReg project](project/registry.yaml) defines the records, Action and access profiles. [The startup journey](dev-journeys.yaml) issues the licence through BReg before the browser opens. - [dev.yaml](dev.yaml) selects the synthetic holder and permits licence reads, the Action's target-conditions check and the renewal function. -- [The renewal function](functions/renew/index.ts) receives a typed BReg client - for the request. Its [handler](functions/renew/renew.ts) checks the request - and carries the reviewed revision and the same attempt key through a retry. +- [The renewal service function](functions/renew/index.ts) receives a typed BReg + client for the request. Its [handler](functions/renew/renew.ts) checks the + request and carries the reviewed revision and the same attempt key through a + retry. - [The page code](web/src/page.ts) presents the review and confirmation and keeps the attempt key for a retry. diff --git a/products/platform/generated/dev/dev.v1alpha1.schema.json b/products/platform/generated/dev/dev.v1alpha1.schema.json index e2de0691ec..47bb499528 100644 --- a/products/platform/generated/dev/dev.v1alpha1.schema.json +++ b/products/platform/generated/dev/dev.v1alpha1.schema.json @@ -390,6 +390,18 @@ "pattern": "^[^\\u0000-\\u001F\\u007F-\\u009F]+$", "type": "string" }, + "ExternalScheduling": { + "additionalProperties": false, + "properties": { + "taskGrant": { + "$ref": "#/$defs/TaskGrant" + } + }, + "required": [ + "taskGrant" + ], + "type": "object" + }, "Hook": { "additionalProperties": false, "properties": { @@ -768,6 +780,10 @@ "$ref": "#/$defs/Url", "description": "JWKS endpoint for an externally managed issuer. When set, the runner\ndelegates authentication to that issuer and does not mint person tokens." }, + "externalScheduling": { + "$ref": "#/$defs/ExternalScheduling", + "description": "One external task grant and its live status provider for a Scheduling fixture." + }, "issuer": { "anyOf": [ { From 89e16d746de6b8ac0629d9e98828d965027dbf4e Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 22/55] fix(platform): harden the Compose mount policy and the public-document read Folds these reviewed commits: - test(platform-config): pin that mountPolicy switches the resolver - feat(platform-config): expose whether the file provider states compose-native - fix(evidence): refuse compose-native secret mounts under the Version 1 key rule - feat(platform-config): add a strict secret provider block for operator-local files - fix(cli-api,thunderid-tooling): refuse mountPolicy in connection files - fix(evidencectl): refuse the Compose mount policy in doctor, as the runtime does - fix(schedulingctl): read secrets through the runtime's own resolver - feat(platform-config): name database members and render explicit settings - feat(provision): read each database member by kind and print explicit settings - fix(platform-config): word public-document refusals for public documents - fix(breg): refuse a private member in the Evidence trusted key set - docs(platform-config): describe the strict provider block in plain words - chore: regenerate the store-provision and connection schemas - feat(registry-mcp): report explicit production settings in check - feat(registry-session): report explicit production settings in check - test: pin the Compose mount policy and public reads at product call sites - fix(render): name secretProviders when a static key set's provider fails - docs(platform-config): word the mountPolicy description without position - docs: document the Compose mount policy and public-document reads per product - chore: regenerate schemas Signed-off-by: Jeremi Joslin --- crates/registry-adapter-engine/src/load.rs | 2 + .../registry-adapter-job/src/hook_ingress.rs | 2 + .../registry-adapterctl/src/job_provision.rs | 20 +-- crates/registry-adapterctl/src/provision.rs | 26 +-- .../src/action_evidence_config.rs | 31 +++- crates/registry-breg/src/runtime_config.rs | 21 ++- crates/registry-bregctl/src/provision.rs | 19 +- crates/registry-caseworkctl/src/provision.rs | 2 + .../schema/connections.schema.json | 59 +++---- crates/registry-cli-api/src/connection.rs | 20 +-- .../tests/connection_store.rs | 27 +++ crates/registry-coordinator/src/provision.rs | 7 +- crates/registry-documentsctl/src/provision.rs | 27 +-- .../registry-evidence-oid4vci/src/config.rs | 8 + .../tests/check_command.rs | 25 +++ crates/registry-evidence-oid4vp/src/config.rs | 8 + .../tests/check_command.rs | 25 +++ crates/registry-evidence/src/config.rs | 48 +++++ .../authoring/store-provision.schema.json | 40 ++--- crates/registry-evidencectl/src/doctor.rs | 18 ++ .../src/store_provision.rs | 27 ++- crates/registry-evidencectl/tests/doctor.rs | 31 ++++ crates/registry-mcp/src/config.rs | 22 ++- crates/registry-mcp/src/main.rs | 85 +++++---- crates/registry-mcp/tests/cli.rs | 26 +++ crates/registry-messaging/src/config.rs | 22 ++- crates/registry-messagingctl/src/lib.rs | 42 +++++ crates/registry-messagingctl/src/provision.rs | 23 ++- .../tests/provision_cli.rs | 39 +++++ crates/registry-platform-config/README.md | 24 ++- crates/registry-platform-config/src/blocks.rs | 164 +++++++++++++++++- .../src/blocks_tests.rs | 51 ++++++ crates/registry-platform-config/src/lib.rs | 15 +- .../registry-platform-config/src/posture.rs | 23 +++ .../registry-platform-config/src/secrets.rs | 92 +++++++++- .../src/secrets_tests.rs | 78 ++++++++- crates/registry-platform-provision/src/cli.rs | 28 +++ crates/registry-render/src/auth.rs | 14 +- crates/registry-schedulingctl/src/lib.rs | 48 +++++ .../registry-schedulingctl/src/provision.rs | 23 ++- crates/registry-schedulingctl/src/records.rs | 25 +-- crates/registry-session/README.md | 4 +- crates/registry-session/src/config.rs | 9 + crates/registry-session/src/offline.rs | 48 ++++- crates/registry-session/tests/binary.rs | 37 ++++ .../examples/journey-fixture/grant.rs | 4 +- .../src/task_connection.rs | 22 ++- .../docs/operate/deployment-posture.mdx | 8 +- .../docs/reference/render-configuration.mdx | 1 + docs/site/src/content/docs/security/breg.mdx | 7 + .../src/content/docs/security/casework.mdx | 7 + .../src/content/docs/security/coordinator.mdx | 7 + .../src/content/docs/security/documents.mdx | 7 + .../src/content/docs/security/evidence.mdx | 6 + .../docs/security/hardening-checklist.mdx | 24 ++- .../site/src/content/docs/security/render.mdx | 7 + .../src/content/docs/security/scheduling.mdx | 7 + .../schemas/job-runtime.v1alpha1.schema.json | 2 +- .../schemas/runtime.v1alpha1.schema.json | 2 +- products/breg/CHANGELOG.md | 2 + .../mcp-runtime/mcp-runtime.schema.json | 2 +- .../review-runtime/review-runtime.schema.json | 2 +- .../generated/runtime/runtime.schema.json | 2 +- .../generated/runtime/runtime.schema.json | 2 +- .../generated/runtime/runtime.schema.json | 2 +- .../generated/runtime/runtime.schema.json | 2 +- products/evidence/CHANGELOG.md | 5 + .../oid4vci-runtime.schema.json | 2 +- .../oid4vp-runtime/oid4vp-runtime.schema.json | 2 +- .../generated/runtime/runtime.schema.json | 2 +- products/platform/CHANGELOG.md | 26 ++- .../mcp-runtime/mcp-runtime.schema.json | 2 +- .../runtime-config-blocks.schema.json | 2 +- .../session-runtime.schema.json | 2 +- .../schemas/task-connection.schema.json | 39 ++--- products/render/schemas/runtime.schema.json | 2 +- .../generated/runtime/runtime.schema.json | 2 +- 77 files changed, 1344 insertions(+), 302 deletions(-) diff --git a/crates/registry-adapter-engine/src/load.rs b/crates/registry-adapter-engine/src/load.rs index 35c0fd49ee..cb725c69b6 100644 --- a/crates/registry-adapter-engine/src/load.rs +++ b/crates/registry-adapter-engine/src/load.rs @@ -517,6 +517,8 @@ fn secret_refusal_fix(error: &SecretError) -> &'static str { "create the file under secretProviders.file.root or set the variable" } SecretError::UnsafeFile(check) => check.suggested_action(), + SecretError::UnsafePublicDocument(check) => check.public_suggested_action(), + SecretError::PrivateKeyInPublicDocument => error.suggested_action(), SecretError::Read => "check that the service user can read the secret file", SecretError::InvalidValue => { "store a non-empty value with no NUL byte, within the secret size limit" diff --git a/crates/registry-adapter-job/src/hook_ingress.rs b/crates/registry-adapter-job/src/hook_ingress.rs index e4f67c6c31..22b6849e76 100644 --- a/crates/registry-adapter-job/src/hook_ingress.rs +++ b/crates/registry-adapter-job/src/hook_ingress.rs @@ -436,6 +436,8 @@ fn resolve_member( } SecretError::Unavailable => "the secret file is missing", SecretError::UnsafeFile(check) => check.suggested_action(), + SecretError::UnsafePublicDocument(check) => check.public_suggested_action(), + SecretError::PrivateKeyInPublicDocument => error.suggested_action(), SecretError::Read => "the secret file could not be read", SecretError::InvalidValue => "the secret is empty or contains a NUL byte", SecretError::ProviderDisabled => { diff --git a/crates/registry-adapterctl/src/job_provision.rs b/crates/registry-adapterctl/src/job_provision.rs index df6bc745b5..04d74553d4 100644 --- a/crates/registry-adapterctl/src/job_provision.rs +++ b/crates/registry-adapterctl/src/job_provision.rs @@ -4,7 +4,7 @@ use std::path::Path; use registry_adapter::engine::job_sources::{job_runtime_diagnostic, JobRuntimeConfig}; use registry_adapter_core::ADAPTER_JOB_RUNTIME_KIND; -use registry_platform_config::{describe_secret_failure, DeclaredPosture}; +use registry_platform_config::{describe_secret_failure, DatabaseMember, DeclaredPosture}; use registry_platform_provision::{ provision_transport, ProductDatabase, ProvisionInput, SchemaLayout, }; @@ -79,13 +79,8 @@ pub(crate) fn load( error.suggested_action(), ) })?; - let resolve = |member: &str, reference: &SecretReference| { - // The CA bundle is a public document; the URLs are secrets. - let read = if member == "caBundleRef" { - resolver.resolve_public_document(reference.as_str()) - } else { - resolver.resolve(reference.as_str()) - }; + let resolve = |member: DatabaseMember, reference: &SecretReference| { + let read = member.read(&resolver, reference.as_str()); read.map_err(|error| { refuse( &format!("/store/{member}"), @@ -94,7 +89,7 @@ pub(crate) fn load( ) }) }; - let url = |member: &str, reference: &SecretReference| { + let url = |member: DatabaseMember, reference: &SecretReference| { let secret = resolve(member, reference)?; std::str::from_utf8(secret.expose_secret()) .map(|text| Zeroizing::new(text.trim().to_owned())) @@ -113,14 +108,15 @@ pub(crate) fn load( btree_gist: false, spatial: None, }, - migration_url: url("migrationUrlRef", migration)?, - runtime_url: url("runtimeUrlRef", &store.runtime_url_ref)?, + migration_url: url(DatabaseMember::MigrationUrl, migration)?, + runtime_url: url(DatabaseMember::RuntimeUrl, &store.runtime_url_ref)?, ca_pem: store .ca_bundle_ref .as_ref() - .map(|reference| resolve("caBundleRef", reference)) + .map(|reference| resolve(DatabaseMember::CaBundle, reference)) .transpose()? .map(|secret| secret.expose_secret().to_vec()), transport: provision_transport(&store.database_config()), + explicit_settings: runtime.posture.explicit_setting_notices(), }) } diff --git a/crates/registry-adapterctl/src/provision.rs b/crates/registry-adapterctl/src/provision.rs index 88ba0eb0f3..449dc3b821 100644 --- a/crates/registry-adapterctl/src/provision.rs +++ b/crates/registry-adapterctl/src/provision.rs @@ -11,8 +11,8 @@ use registry_adapter_core::{ ADAPTER_RUNTIME_KIND, }; use registry_platform_config::{ - describe_secret_failure, DeclaredPosture, RuntimeConfigLoader, RuntimeEnvelope, SecretProvider, - SecretResolver, + describe_secret_failure, DatabaseMember, DeclaredPosture, RuntimeConfigLoader, RuntimeEnvelope, + SecretProvider, SecretResolver, }; use registry_platform_provision::{ provision_transport, ProductDatabase, ProvisionInput, SchemaLayout, @@ -64,6 +64,7 @@ pub(crate) fn load( .removed_keys(ADAPTER_FACADE_REMOVED_KEYS) .load::(&absolute) .map_err(|error| error.diagnostics().to_vec())?; + let explicit_settings = loaded.posture.explicit_setting_notices(); let config = loaded.config; let secrets = match config.secret_providers.as_ref() { Some(providers) => providers.resolver(loaded.development.as_ref()), @@ -77,13 +78,8 @@ pub(crate) fn load( "Correct secretProviders in the runtime file, then run provision again.", ) })?; - let resolve = |member: &str, reference: &str| { - // The CA bundle is a public document; the URLs are secrets. - let read = if member == "caBundleRef" { - secrets.resolve_public_document(reference) - } else { - secrets.resolve(reference) - }; + let resolve = |member: DatabaseMember, reference: &str| { + let read = member.read(&secrets, reference); read.map_err(|error| { refuse( "config.refused", @@ -93,7 +89,7 @@ pub(crate) fn load( ) }) }; - let url = |member: &str, reference: &str| { + let url = |member: DatabaseMember, reference: &str| { let secret = resolve(member, reference)?; std::str::from_utf8(secret.expose_secret()) .map(|text| Zeroizing::new(text.trim().to_owned())) @@ -106,13 +102,16 @@ pub(crate) fn load( ) }) }; - let migration_url = url("migrationUrlRef", &config.database.migration_url_ref)?; - let runtime_url = url("runtimeUrlRef", &config.database.runtime_url_ref)?; + let migration_url = url( + DatabaseMember::MigrationUrl, + &config.database.migration_url_ref, + )?; + let runtime_url = url(DatabaseMember::RuntimeUrl, &config.database.runtime_url_ref)?; let ca_pem = config .database .ca_bundle_ref .as_deref() - .map(|reference| resolve("caBundleRef", reference)) + .map(|reference| resolve(DatabaseMember::CaBundle, reference)) .transpose()? .map(|secret| secret.expose_secret().to_vec()); Ok(ProvisionInput { @@ -121,5 +120,6 @@ pub(crate) fn load( runtime_url, ca_pem, transport: provision_transport(&config.database), + explicit_settings, }) } diff --git a/crates/registry-breg/src/action_evidence_config.rs b/crates/registry-breg/src/action_evidence_config.rs index dbf9ef48e9..f3613baf8d 100644 --- a/crates/registry-breg/src/action_evidence_config.rs +++ b/crates/registry-breg/src/action_evidence_config.rs @@ -104,7 +104,9 @@ pub fn activate( let keys = secrets .resolve_public_document_reference(&binding.trusted_jwks_ref) .map_err(|_| Error::Secret)?; - let jwks = registry_platform_crypto::parse_json_strict(keys.expose_secret()) + // The key set may be readable by everyone, so it must hold public keys + // only: a private or symmetric member is refused, not loaded. + let jwks = registry_platform_oidc::public_jwks_document(keys.expose_secret()) .map_err(|_| Error::InvalidBinding)?; let jwks = serde_json::from_value(jwks).map_err(|_| Error::InvalidBinding)?; let mut config = registry_evidence_client::EvidenceClientConfig::new( @@ -422,11 +424,36 @@ mod tests { }; assert!(activate( &compiled, - &BTreeMap::from([("farmer-registry".into(), binding)]), + &BTreeMap::from([("farmer-registry".into(), binding.clone())]), &secrets, registry_platform_httputil::PeerPolicy::RefuseDevelopmentPeer, ) .unwrap() .is_some()); + + // The same key set with a private member staged by mistake. + let public = std::fs::read_to_string(directory.path().join("jwks")).unwrap(); + let private = public.replacen( + "\"kty\": \"EC\",", + "\"kty\": \"EC\",\n \"d\": \"AAAA\",", + 1, + ); + assert_ne!(private, public, "the private member is written"); + let path = directory.path().join("private-jwks"); + std::fs::write(&path, private).unwrap(); + std::fs::set_permissions(path, std::fs::Permissions::from_mode(0o644)).unwrap(); + let binding = EvidenceProviderConfig { + trusted_jwks_ref: SecretReference::parse("secret:file/private-jwks").unwrap(), + ..binding + }; + assert!(matches!( + activate( + &compiled, + &BTreeMap::from([("farmer-registry".into(), binding)]), + &secrets, + registry_platform_httputil::PeerPolicy::RefuseDevelopmentPeer, + ), + Err(crate::runtime_config::RuntimeConfigError::InvalidBinding) + )); } } diff --git a/crates/registry-breg/src/runtime_config.rs b/crates/registry-breg/src/runtime_config.rs index ee74636545..37725e8c2b 100644 --- a/crates/registry-breg/src/runtime_config.rs +++ b/crates/registry-breg/src/runtime_config.rs @@ -545,6 +545,10 @@ pub enum RuntimeConfigError { Secret, #[error("runtime configuration secret file refused: {} ({})", .0.message(), .0.code())] SecretFile(SecretFileCheck), + #[error("runtime configuration public document refused: {} ({})", .0.public_message(), .0.code())] + PublicDocumentFile(SecretFileCheck), + #[error("runtime configuration public document holds a PEM private key block")] + PublicDocumentPrivateKey, } /// The config path of the exposure key a wildcard metrics refusal names. @@ -597,7 +601,10 @@ impl RuntimeConfigError { Self::InvalidBounds => "breg.runtime.invalid-bounds", Self::PoolBudgetExceeded => "breg.runtime.pool-budget-exceeded", Self::InvalidWasmExecution => "breg.runtime.invalid-wasm-execution", - Self::Secret | Self::SecretFile(_) => "breg.runtime.secret", + Self::Secret + | Self::SecretFile(_) + | Self::PublicDocumentFile(_) + | Self::PublicDocumentPrivateKey => "breg.runtime.secret", } } @@ -606,7 +613,11 @@ impl RuntimeConfigError { fn path(&self) -> &str { match self { Self::Reader(refusal) => &refusal.deciding_diagnostic().path, - Self::InvalidBinding | Self::Secret | Self::SecretFile(_) => "", + Self::InvalidBinding + | Self::Secret + | Self::SecretFile(_) + | Self::PublicDocumentFile(_) + | Self::PublicDocumentPrivateKey => "", Self::InvalidExternalSource { path, .. } | Self::InvalidDeliveryKey { path, .. } | Self::DuplicateCompletionRecipient { path, .. } => path, @@ -746,6 +757,10 @@ impl RuntimeConfigError { "Make every secret reference resolve through the declared secret providers." } Self::SecretFile(check) => check.suggested_action(), + Self::PublicDocumentFile(check) => check.public_suggested_action(), + Self::PublicDocumentPrivateKey => { + SecretError::PrivateKeyInPublicDocument.suggested_action() + } } } @@ -818,6 +833,8 @@ impl From for RuntimeConfigError { fn from(error: SecretError) -> Self { match error { SecretError::UnsafeFile(check) => Self::SecretFile(check), + SecretError::UnsafePublicDocument(check) => Self::PublicDocumentFile(check), + SecretError::PrivateKeyInPublicDocument => Self::PublicDocumentPrivateKey, _ => Self::Secret, } } diff --git a/crates/registry-bregctl/src/provision.rs b/crates/registry-bregctl/src/provision.rs index 7b1c23c9ff..03f4e1c559 100644 --- a/crates/registry-bregctl/src/provision.rs +++ b/crates/registry-bregctl/src/provision.rs @@ -16,6 +16,7 @@ use registry_breg::runtime_config::{ load_runtime_config_without_package_root, RuntimeConfig, RuntimeConfigError, RUNTIME_CONFIG_KIND, }; +use registry_platform_config::DatabaseMember; use registry_platform_provision::{ provision_transport, ProductDatabase, ProvisionInput, SchemaLayout, Spatial, }; @@ -92,13 +93,8 @@ pub(crate) fn load( let secrets = config .secret_resolver() .map_err(|error| runtime_file_refused(&absolute, &error))?; - let resolve = |member: &str, reference| { - // The CA bundle is a public document; the URLs are secrets. - let read = if member == "caBundleRef" { - secrets.resolve_public_document_reference(reference) - } else { - secrets.resolve_reference(reference) - }; + let resolve = |member: DatabaseMember, reference| { + let read = member.read_reference(&secrets, reference); read.map_err(|_| { refused( "config.refused", @@ -108,7 +104,7 @@ pub(crate) fn load( ) }) }; - let url = |member: &str, reference| { + let url = |member: DatabaseMember, reference| { let secret = resolve(member, reference)?; std::str::from_utf8(secret.expose_secret()) .map(|text| Zeroizing::new(text.trim().to_owned())) @@ -122,11 +118,11 @@ pub(crate) fn load( }) }; let database = config.database(); - let migration_url = url("migrationUrlRef", database.migration_url_ref())?; - let runtime_url = url("runtimeUrlRef", database.runtime_url_ref())?; + let migration_url = url(DatabaseMember::MigrationUrl, database.migration_url_ref())?; + let runtime_url = url(DatabaseMember::RuntimeUrl, database.runtime_url_ref())?; let ca_pem = database .ca_bundle_ref() - .map(|reference| resolve("caBundleRef", reference)) + .map(|reference| resolve(DatabaseMember::CaBundle, reference)) .transpose()? .map(|secret| secret.expose_secret().to_vec()); let spatial = package @@ -144,5 +140,6 @@ pub(crate) fn load( runtime_url, ca_pem, transport: provision_transport(database.transport_config()), + explicit_settings: config.posture_report().explicit_setting_notices(), }) } diff --git a/crates/registry-caseworkctl/src/provision.rs b/crates/registry-caseworkctl/src/provision.rs index b5c1ae4cfa..bf8b0e0f88 100644 --- a/crates/registry-caseworkctl/src/provision.rs +++ b/crates/registry-caseworkctl/src/provision.rs @@ -49,6 +49,7 @@ fn load(path: &Path, declared: DeclaredPosture) -> Result Result, #[serde(default, skip_serializing_if = "Option::is_none")] - secret_providers: Option, + secret_providers: Option, auth: SavedAuth, } @@ -544,7 +544,7 @@ fn add(path: &Path, product: &str, mut args: AddConnectionArgs) -> Result<(), Ap } fn saved_auth( - secret_providers: &mut Option, + secret_providers: &mut Option, mut args: AddConnectionArgs, ) -> Result { let choices = usize::from(args.anonymous) @@ -776,7 +776,7 @@ fn secret( } fn resolve_secret( - providers: Option<&SecretProvidersConfig>, + providers: Option<&StrictSecretProvidersConfig>, reference: &SecretReference, ) -> Result { let providers = providers.ok_or(ApiError::Credential)?; @@ -791,7 +791,7 @@ fn resolve_secret( } fn file_reference( - secret_providers: &mut Option, + secret_providers: &mut Option, path: &Path, ) -> Result { let canonical = path @@ -810,7 +810,7 @@ fn file_reference( "the secret file name must use lowercase letters, digits, '.', '_' or '-'".to_owned(), ) })?; - let providers = secret_providers.get_or_insert_with(SecretProvidersConfig::default); + let providers = secret_providers.get_or_insert_with(StrictSecretProvidersConfig::default); match &providers.file { Some(existing) if existing.root != root => { return Err(ApiError::Usage( @@ -819,7 +819,7 @@ fn file_reference( )); } Some(_) => {} - None => providers.file = Some(FileSecretProviderConfig::new(root)), + None => providers.file = Some(StrictFileSecretProviderConfig { root }), } Ok(reference) } @@ -838,14 +838,14 @@ fn canonical_public_file(path: &Path) -> Result { } fn environment_reference( - secret_providers: &mut Option, + secret_providers: &mut Option, name: &str, ) -> Result { let reference = SecretReference::parse(format!("secret:env/{name}")).map_err(|_| { ApiError::Usage("the token environment variable name is invalid".to_owned()) })?; secret_providers - .get_or_insert_with(SecretProvidersConfig::default) + .get_or_insert_with(StrictSecretProvidersConfig::default) .environment = Some(EnvironmentSecretProviderConfig::default()); Ok(reference) } diff --git a/crates/registry-cli-api/tests/connection_store.rs b/crates/registry-cli-api/tests/connection_store.rs index 9c111e58ba..225d4e89cb 100644 --- a/crates/registry-cli-api/tests/connection_store.rs +++ b/crates/registry-cli-api/tests/connection_store.rs @@ -553,3 +553,30 @@ fn saved_connections_add_show_use_reread_credentials_and_acquire_private_key_jwt b"failure" ); } + +#[test] +fn a_saved_connection_file_refuses_the_compose_mount_policy() { + let _lock = ENVIRONMENT_LOCK + .lock() + .unwrap_or_else(|poison| poison.into_inner()); + let temporary = TempDir::new().unwrap(); + let file = temporary.path().join("connections.yaml"); + let strict = "apiVersion: id.registrystack.org/formats/platform/cli-connections/v1alpha1\nkind: PlatformCliConnections\nconnections:\n - product: breg\n name: offline\n baseUrl: https://registry.example.test/api\n secretProviders:\n file:\n root: /run/registry-cli\n auth:\n type: bearer\n tokenRef: secret:file/token\n"; + let check = |text: &str| { + fs::write(&file, text).unwrap(); + run_connection( + "breg", + ConnectionCommand::Check(CheckConnectionArgs { + file: file.clone(), + deny_warnings: false, + }), + ) + }; + check(strict).expect("the strict provider block passes the offline check"); + let stated = strict.replace( + " root: /run/registry-cli\n", + " root: /run/registry-cli\n mountPolicy: compose-native\n", + ); + let error = check(&stated).expect_err("a saved connection file has no mountPolicy"); + assert_eq!(error.exit_code(), 1); +} diff --git a/crates/registry-coordinator/src/provision.rs b/crates/registry-coordinator/src/provision.rs index e470e2b681..ac393b8acb 100644 --- a/crates/registry-coordinator/src/provision.rs +++ b/crates/registry-coordinator/src/provision.rs @@ -11,7 +11,7 @@ use std::path::Path; use std::process::ExitCode; -use registry_platform_config::{DeclaredPosture, SecretResolver}; +use registry_platform_config::{DeclaredPosture, PostureReport, SecretResolver}; use registry_platform_provision::cli::{ provision_transport, run_provision, OutputFormat, ProvisionArgs, ProvisionInput, }; @@ -119,6 +119,11 @@ fn load(path: &Path, declared: DeclaredPosture) -> Result) { + if self.secret_providers.compose_native_mounts() { + findings.push(Finding::error( + "evidence.oid4vci.secret-providers", + "/secretProviders/file/mountPolicy", + "the wallet delivery service keeps the Evidence Version 1 secret file rule, so it does not accept mountPolicy", + "Remove mountPolicy. Stage each secret file owned by the runtime user with mode 0400 or 0600, or owned by root with no bits outside 0640.", + )); + } if let Err(error) = self.secret_providers.check() { findings.push(match error.kind() { ConfigBlockErrorKind::RelativePath => Finding::error( diff --git a/crates/registry-evidence-oid4vci/tests/check_command.rs b/crates/registry-evidence-oid4vci/tests/check_command.rs index dc2feaa835..4a90e8985f 100644 --- a/crates/registry-evidence-oid4vci/tests/check_command.rs +++ b/crates/registry-evidence-oid4vci/tests/check_command.rs @@ -319,3 +319,28 @@ fn writable_secret_root_passes_offline_check_and_is_refused_by_serve_and_inspect ); } } + +#[test] +fn compose_native_secret_mounts_are_refused_under_the_version_1_key_rule() { + let text = example().replace( + " root: /run/secrets/evidence-oid4vci\n", + " root: /run/secrets/evidence-oid4vci\n mountPolicy: compose-native\n", + ); + assert_ne!(text, example(), "the member is written"); + let (_root, path) = write(&text); + + let output = check(&path, &["--format", "json"]); + assert_eq!(output.status.code(), Some(1)); + let document = json(&output); + assert!( + document["diagnostics"] + .as_array() + .unwrap() + .iter() + .any( + |diagnostic| diagnostic["code"] == "evidence.oid4vci.secret-providers" + && diagnostic["path"] == "/secretProviders/file/mountPolicy" + ), + "{document}" + ); +} diff --git a/crates/registry-evidence-oid4vp/src/config.rs b/crates/registry-evidence-oid4vp/src/config.rs index 1d108f8ee9..c888be2f4e 100644 --- a/crates/registry-evidence-oid4vp/src/config.rs +++ b/crates/registry-evidence-oid4vp/src/config.rs @@ -1387,6 +1387,14 @@ impl VerifierDocument { } fn secret_findings(&self, findings: &mut Vec) { + if self.secret_providers.compose_native_mounts() { + findings.push(Finding::error( + "evidence.oid4vp.secret-providers", + "/secretProviders/file/mountPolicy", + "the wallet presentation service keeps the Evidence Version 1 secret file rule, so it does not accept mountPolicy", + "Remove mountPolicy. Stage each secret file owned by the runtime user with mode 0400 or 0600, or owned by root with no bits outside 0640.", + )); + } if let Err(error) = self.secret_providers.check() { findings.push(match error.kind() { ConfigBlockErrorKind::RelativePath => Finding::error( diff --git a/crates/registry-evidence-oid4vp/tests/check_command.rs b/crates/registry-evidence-oid4vp/tests/check_command.rs index 1a2141f4a2..b956f5960c 100644 --- a/crates/registry-evidence-oid4vp/tests/check_command.rs +++ b/crates/registry-evidence-oid4vp/tests/check_command.rs @@ -204,3 +204,28 @@ fn an_explicitly_empty_claims_list_is_refused() { assert_eq!(output.status.code(), Some(1), "{output:?}"); assert_eq!(json(&output)["ok"], false); } + +#[test] +fn compose_native_secret_mounts_are_refused_under_the_version_1_key_rule() { + let text = example().replace( + " root: /run/secrets/evidence-oid4vp\n", + " root: /run/secrets/evidence-oid4vp\n mountPolicy: compose-native\n", + ); + assert_ne!(text, example(), "the member is written"); + let (_root, path) = write(&text); + + let output = check(&path, &["--format", "json"]); + assert_eq!(output.status.code(), Some(1)); + let document = json(&output); + assert!( + document["diagnostics"] + .as_array() + .unwrap() + .iter() + .any( + |diagnostic| diagnostic["code"] == "evidence.oid4vp.secret-providers" + && diagnostic["path"] == "/secretProviders/file/mountPolicy" + ), + "{document}" + ); +} diff --git a/crates/registry-evidence/src/config.rs b/crates/registry-evidence/src/config.rs index 9f7de935b4..976ce4c2e7 100644 --- a/crates/registry-evidence/src/config.rs +++ b/crates/registry-evidence/src/config.rs @@ -2496,6 +2496,9 @@ pub const RUNTIME_PACKAGE_CODE: &str = "evidence.runtime.invalid-package"; pub const RUNTIME_LISTENER_CODE: &str = "evidence.runtime.invalid-listener"; pub const RUNTIME_METRICS_LISTENER_CODE: &str = "evidence.runtime.invalid-metrics-listener"; pub const RUNTIME_SECRET_PROVIDERS_CODE: &str = "evidence.runtime.invalid-secret-providers"; +/// The remedy when an Evidence runtime states `mountPolicy`: its frozen +/// Version 1 rule never lets other users read a key file. +pub const COMPOSE_NATIVE_REFUSED_ACTION: &str = "Remove mountPolicy. Stage each secret file owned by the runtime user with mode 0400 or 0600, or owned by root with no bits outside 0640."; pub const RUNTIME_SIGNER_CODE: &str = "evidence.runtime.invalid-signer"; pub const RUNTIME_AUDIT_CODE: &str = "evidence.runtime.invalid-audit"; pub const RUNTIME_OUTBOUND_TLS_CODE: &str = "evidence.runtime.invalid-outbound-tls"; @@ -2842,6 +2845,17 @@ impl RuntimeConfig { )); } } + if self.secret_providers.compose_native_mounts() { + findings.push(RuntimeFinding::at_value( + RUNTIME_SECRET_PROVIDERS_CODE, + "/secretProviders/file/mountPolicy", + ConfigError::InvalidField( + "Evidence keeps the Version 1 secret file rule, so it does not accept mountPolicy", + "secretProviders.file.mountPolicy", + ), + COMPOSE_NATIVE_REFUSED_ACTION, + )); + } self.signer .findings(&self.secret_providers, providers_enabled, &mut findings); self.audit.findings(&mut findings); @@ -10926,6 +10940,40 @@ outboundTls: ) } + #[test] + fn a_compose_native_secret_mount_is_refused_under_the_version_1_key_rule() { + let findings = |text: &str| { + RuntimeConfig::decode_yaml_with( + text.as_bytes(), + DeclaredPosture { + posture: Posture::Production, + source: PostureSource::Default, + }, + |_| None, + ) + .expect("the shared reader accepts the member") + .config + .findings() + }; + let stated = LOADER_RUNTIME_DOCUMENT.replace( + "file: {root: /run/secrets/registry-evidence}", + "file: {root: /run/secrets/registry-evidence, mountPolicy: compose-native}", + ); + assert_ne!(stated, LOADER_RUNTIME_DOCUMENT, "the member is written"); + let refused = findings(&stated); + assert!( + refused + .iter() + .any(|finding| finding.code == RUNTIME_SECRET_PROVIDERS_CODE + && finding.pointer == "/secretProviders/file/mountPolicy" + && finding.action == COMPOSE_NATIVE_REFUSED_ACTION), + "{refused:?}" + ); + assert!(!findings(LOADER_RUNTIME_DOCUMENT) + .iter() + .any(|finding| finding.pointer == "/secretProviders/file/mountPolicy")); + } + #[test] fn a_runtime_file_with_the_retired_api_version_is_refused_with_the_replacement_named() { let retired = LOADER_RUNTIME_DOCUMENT.replace( diff --git a/crates/registry-evidencectl/schemas/authoring/store-provision.schema.json b/crates/registry-evidencectl/schemas/authoring/store-provision.schema.json index e84a7877b1..5fd67ff3be 100644 --- a/crates/registry-evidencectl/schemas/authoring/store-provision.schema.json +++ b/crates/registry-evidencectl/schemas/authoring/store-provision.schema.json @@ -60,12 +60,24 @@ "description": "The environment secret provider. It takes no settings.", "type": "object" }, - "FileSecretProviderConfig": { + "SecretReference": { + "description": "An exact secret reference: secret:file/name, resolved under secretProviders.file.root, or secret:env/NAME, resolved only when secretProviders.environment is declared.", + "pattern": "^(?:secret:env/[A-Z][A-Z0-9_]{0,127}|secret:file/[a-z][a-z0-9._-]{0,127})$", + "type": "string" + }, + "Store": { + "enum": [ + "status", + "oid4vci" + ], + "type": "string" + }, + "StrictFileSecretProviderConfig": { "additionalProperties": false, - "description": "The file secret provider.", + "description": "The file secret provider of an operator-local file.", "properties": { "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe user running the tool with mode 0400 or 0600, or owned by root with\nno access beyond group read (0440 or 0640) when that user is not root.\nA command that declared development loads a file with looser read or\nmode bits and logs a warning.", "pattern": "^/", "type": "string" } @@ -75,13 +87,13 @@ ], "type": "object" }, - "SecretProvidersConfig": { + "StrictSecretProvidersConfig": { "additionalProperties": false, "anyOf": [ { "properties": { "file": { - "$ref": "#/$defs/FileSecretProviderConfig" + "$ref": "#/$defs/StrictFileSecretProviderConfig" } }, "required": [ @@ -99,30 +111,18 @@ ] } ], - "description": "The secret providers a runtime enables. A reference is resolved only by a\nprovider declared here: `secret:file/name` under `file.root`, and\n`secret:env/NAME` only when `environment: {}` is present.", + "description": "The secret providers of an operator-local file read outside any runtime,\nsuch as a saved CLI connection or a task connection. It enables the same\nproviders as a runtime's `secretProviders` without the Compose mount\npolicy: nothing reports an explicit production setting for these files,\nso the strict file rule always applies.", "properties": { "environment": { "$ref": "#/$defs/EnvironmentSecretProviderConfig", "description": "Enables `secret:env/NAME` references, read from the process\nenvironment. Declared as an empty mapping: `environment: {}`." }, "file": { - "$ref": "#/$defs/FileSecretProviderConfig", + "$ref": "#/$defs/StrictFileSecretProviderConfig", "description": "Enables `secret:file/name` references, read from files under `root`." } }, "type": "object" - }, - "SecretReference": { - "description": "An exact secret reference: secret:file/name, resolved under secretProviders.file.root, or secret:env/NAME, resolved only when secretProviders.environment is declared.", - "pattern": "^(?:secret:env/[A-Z][A-Z0-9_]{0,127}|secret:file/[a-z][a-z0-9._-]{0,127})$", - "type": "string" - }, - "Store": { - "enum": [ - "status", - "oid4vci" - ], - "type": "string" } }, "$id": "https://id.registrystack.org/schemas/evidence/store-provision/store-provision.v1alpha1.schema.json", @@ -141,7 +141,7 @@ "type": "string" }, "secretProviders": { - "$ref": "#/$defs/SecretProvidersConfig" + "$ref": "#/$defs/StrictSecretProvidersConfig" }, "store": { "$ref": "#/$defs/Store", diff --git a/crates/registry-evidencectl/src/doctor.rs b/crates/registry-evidencectl/src/doctor.rs index e3d8ac1f16..53391a11b9 100644 --- a/crates/registry-evidencectl/src/doctor.rs +++ b/crates/registry-evidencectl/src/doctor.rs @@ -302,6 +302,24 @@ fn check_secrets( let mut root_run = CheckRun::new("secret root", project); root_run.read_declaration(); + // Evidence keeps the Version 1 secret file rule and refuses the Compose + // mount policy, so doctor refuses it too. Every other file then gets the + // strict verdict the runtime gives below. + if runtime + .get("secretProviders") + .and_then(|providers| providers.get("file")) + .and_then(|file| file.get("mountPolicy")) + .is_some() + { + root_run.refuse( + runtime_path, + "/secretProviders/file/mountPolicy (evidence.runtime.invalid-secret-providers): \ + Evidence keeps the Version 1 secret file rule, so it does not accept mountPolicy. \ + Remove mountPolicy. Stage each secret file owned by the runtime user with mode \ + 0400 or 0600, or owned by root with no bits outside 0640." + .to_owned(), + ); + } if let Err(error) = registry_platform_config::validate_secret_root(&root) { let diagnostic = error.diagnostic(); root_run.refuse( diff --git a/crates/registry-evidencectl/src/store_provision.rs b/crates/registry-evidencectl/src/store_provision.rs index 7c0c86876b..e9981cdd53 100644 --- a/crates/registry-evidencectl/src/store_provision.rs +++ b/crates/registry-evidencectl/src/store_provision.rs @@ -4,8 +4,8 @@ use std::{path::Path, process::ExitCode}; use registry_platform_config::{ - describe_secret_failure, DatabaseConfig, DatabaseTransport, DeclaredPosture, - RuntimeConfigLoader, RuntimeEnvelope, SecretProvidersConfig, DEFAULT_STAND_IN, + describe_secret_failure, DatabaseConfig, DatabaseMember, DatabaseTransport, DeclaredPosture, + RuntimeConfigLoader, RuntimeEnvelope, StrictSecretProvidersConfig, DEFAULT_STAND_IN, }; use registry_platform_provision::{ provision_transport, run_provision, ProductDatabase, ProvisionArgs, ProvisionInput, @@ -74,7 +74,7 @@ pub(crate) struct StoreProvisionDocument { /// The Evidence PostgreSQL store this database is reserved for. store: Store, database: DatabaseConfig, - secret_providers: SecretProvidersConfig, + secret_providers: StrictSecretProvidersConfig, } fn loader(declared: DeclaredPosture) -> RuntimeConfigLoader { @@ -253,13 +253,8 @@ fn load(path: &Path, declared: DeclaredPosture) -> Result Result Result (Report, bool) { + let (report, unavailable, _) = Self::check_with_settings(path, environment, declared); + (report, unavailable) + } + + /// [`Self::check_status_with_posture`], with the explicit production + /// settings the file states, which `check` reports beside its diagnostics. + pub fn check_with_settings( + path: &Path, + environment: bool, + declared: DeclaredPosture, + ) -> ( + Report, + bool, + Vec, + ) { let (checked, report) = read_runtime(path, environment, declared); - (report, checked.unavailable) + let settings = checked + .loaded + .as_ref() + .map(|loaded| loaded.posture.explicit_settings().to_vec()) + .unwrap_or_default(); + (report, checked.unavailable, settings) } pub fn validate( &self, diff --git a/crates/registry-mcp/src/main.rs b/crates/registry-mcp/src/main.rs index 5e09f9bf07..5a6de47303 100644 --- a/crates/registry-mcp/src/main.rs +++ b/crates/registry-mcp/src/main.rs @@ -111,36 +111,54 @@ async fn main() -> ExitCode { if let Command::Check(arguments) = cli.command { let given = &runtime_config; - let (report, unavailable) = match registry_breg_mcp::check::absolute_runtime_path(given) { - Some(path) => { - let (mut report, unavailable) = RuntimeConfig::check_status_with_posture( - &path, - arguments.environment, - declared, - ); - registry_breg_mcp::check::restore_diagnostic_path( - report.diagnostics_mut(), - &path, - given, - ); - (report, unavailable) - } - None => { - use registry_platform_yaml::{Diagnostic, Report, Source}; - let mut diagnostic = Diagnostic::error( - "platform.runtime-config.unavailable", - "", - "the runtime file path could not be made absolute", - "Name the runtime file by an absolute path, then run the check again.", - ); - diagnostic.source = Some(Source { - file: given.display().to_string(), - line: None, - column: None, + let (report, unavailable, settings) = + match registry_breg_mcp::check::absolute_runtime_path(given) { + Some(path) => { + let (mut report, unavailable, settings) = + RuntimeConfig::check_with_settings(&path, arguments.environment, declared); + registry_breg_mcp::check::restore_diagnostic_path( + report.diagnostics_mut(), + &path, + given, + ); + (report, unavailable, settings) + } + None => { + use registry_platform_yaml::{Diagnostic, Report, Source}; + let mut diagnostic = Diagnostic::error( + "platform.runtime-config.unavailable", + "", + "the runtime file path could not be made absolute", + "Name the runtime file by an absolute path, then run the check again.", + ); + diagnostic.source = Some(Source { + file: given.display().to_string(), + line: None, + column: None, + }); + (Report::new(vec![diagnostic]), true, Vec::new()) + } + }; + // Each explicit production setting the file states, as every check + // reports it: a fact for review, not a diagnostic. + let explicit: Vec = settings + .iter() + .map(|found| { + let mut line = serde_json::json!({ + "code": found.setting.code, + "file": given.display().to_string(), + "summary": found.setting.summary, }); - (Report::new(vec![diagnostic]), true) - } - }; + if let Some(pointer) = &found.pointer { + line["pointer"] = pointer.as_str().into(); + } + if let Some(position) = found.position { + line["line"] = position.line.into(); + line["column"] = position.column.into(); + } + line + }) + .collect(); let failed = unavailable || report.has_errors() || (arguments.deny_warnings @@ -154,9 +172,14 @@ async fn main() -> ExitCode { }; eprintln!("{headline}\n{}", report.render_human()); } - Format::Human => print!("{}", report.render_human()), + Format::Human => { + for found in &settings { + eprintln!("{}", found.notice()); + } + print!("{}", report.render_human()); + } Format::Json => match serde_json::to_string_pretty( - &serde_json::json!({"ok":!failed,"command":"check","status":if unavailable {"operational-failure"} else if failed {"domain-refusal"} else {"complete"},"apiVersion":"id.registrystack.org/formats/platform/mcp-ctl-report/v1alpha1","kind":"PlatformMcpCtlReport","version":env!("CARGO_PKG_VERSION"),"filesChecked":1,"errors":report.error_count(),"warnings":report.warning_count(),"diagnostics":report.to_json_value(),"posture":{"value":declared.posture.as_str(),"source":declared.source.as_str()}}), + &serde_json::json!({"ok":!failed,"command":"check","status":if unavailable {"operational-failure"} else if failed {"domain-refusal"} else {"complete"},"apiVersion":"id.registrystack.org/formats/platform/mcp-ctl-report/v1alpha1","kind":"PlatformMcpCtlReport","version":env!("CARGO_PKG_VERSION"),"filesChecked":1,"errors":report.error_count(),"warnings":report.warning_count(),"diagnostics":report.to_json_value(),"posture":{"value":declared.posture.as_str(),"source":declared.source.as_str()},"explicitProductionSettings":explicit}), ) { Ok(json) => println!("{json}"), Err(_) => { diff --git a/crates/registry-mcp/tests/cli.rs b/crates/registry-mcp/tests/cli.rs index 906af94f68..4a1b9e7223 100644 --- a/crates/registry-mcp/tests/cli.rs +++ b/crates/registry-mcp/tests/cli.rs @@ -251,6 +251,32 @@ fn the_shipped_example_passes_a_production_check() { assert_eq!(report["diagnostics"], serde_json::json!([]), "{report}"); } +#[test] +fn check_reports_the_explicit_production_settings_the_file_states() { + let directory = private_fixture_directory().unwrap(); + let plain = std::fs::read_to_string(example()).unwrap(); + let path = stage_runtime(directory.path().join("plain.yaml"), plain.as_bytes()); + let (exit, report) = check_json(&path, &[]); + assert_eq!(exit, Some(0), "{report}"); + assert_eq!(report["explicitProductionSettings"], serde_json::json!([])); + + let stated = plain.replace( + "secretProviders:\n environment: {}\n", + "secretProviders:\n environment: {}\n file:\n root: /run/registry-mcp/secrets\n mountPolicy: compose-native\n", + ); + assert_ne!(stated, plain, "the member is written"); + let path = stage_runtime(directory.path().join("stated.yaml"), stated.as_bytes()); + let (exit, report) = check_json(&path, &[]); + assert_eq!(exit, Some(0), "{report}"); + let settings = report["explicitProductionSettings"].as_array().unwrap(); + assert!( + settings.iter().any(|setting| setting["code"] + == "platform.posture.compose-native-secret-mount" + && setting["pointer"] == "/secretProviders/file/mountPolicy"), + "{report}" + ); +} + #[test] fn the_shipped_example_separates_the_public_resource_from_the_listener() { use registry_mcp::config::{ProviderConfig, RuntimeConfig}; diff --git a/crates/registry-messaging/src/config.rs b/crates/registry-messaging/src/config.rs index fa9921dde9..4db247638f 100644 --- a/crates/registry-messaging/src/config.rs +++ b/crates/registry-messaging/src/config.rs @@ -2370,6 +2370,15 @@ pub(crate) mod tests { /// key source from it. #[cfg(unix)] async fn static_key_source(document: &str) -> Result<(), RuntimeConfigError> { + static_key_source_with_mode(document, 0o600).await + } + + /// [`static_key_source`] with the key set file at `mode`. + #[cfg(unix)] + async fn static_key_source_with_mode( + document: &str, + mode: u32, + ) -> Result<(), RuntimeConfigError> { use std::os::unix::fs::PermissionsExt as _; let root = tempfile::tempdir_in(std::env::temp_dir().canonicalize().unwrap()).unwrap(); @@ -2378,7 +2387,7 @@ pub(crate) mod tests { std::fs::set_permissions(&secrets, std::fs::Permissions::from_mode(0o700)).unwrap(); let file = secrets.join("issuer-jwks"); std::fs::write(&file, document).unwrap(); - std::fs::set_permissions(&file, std::fs::Permissions::from_mode(0o600)).unwrap(); + std::fs::set_permissions(&file, std::fs::Permissions::from_mode(mode)).unwrap(); let mut runtime = runtime_value(root.path()); runtime["authentication"]["oidc"]["issuers"]["main"]["jwksSource"] = json!({"type": "static", "documentRef": "secret:file/issuer-jwks"}); @@ -2403,6 +2412,17 @@ pub(crate) mod tests { key } + /// A key set is a public document: a world-readable file loads, where a + /// secret at the same mode is refused. + #[cfg(unix)] + #[tokio::test] + async fn a_world_readable_static_key_set_loads_as_a_public_document() { + let document = json!({"keys": [static_key(json!({}))]}); + static_key_source_with_mode(&document.to_string(), 0o644) + .await + .expect("a world-readable key set loads"); + } + #[cfg(unix)] #[tokio::test] async fn a_static_key_set_with_members_it_does_not_know_loads() { diff --git a/crates/registry-messagingctl/src/lib.rs b/crates/registry-messagingctl/src/lib.rs index 713486fa54..64bcd67ab0 100644 --- a/crates/registry-messagingctl/src/lib.rs +++ b/crates/registry-messagingctl/src/lib.rs @@ -2817,6 +2817,48 @@ audit: ); } + #[test] + fn the_compose_mount_policy_is_listed_by_check_and_recorded_for_startup() { + let (root, path) = project(""); + let text = std::fs::read_to_string(&path).unwrap(); + let providers = "secretProviders:\n environment: {}\n"; + assert!(text.contains(providers), "{text}"); + let secrets = root.path().canonicalize().unwrap().join("secrets"); + std::fs::write( + &path, + text.replace( + providers, + &format!( + "{providers} file:\n root: {}\n mountPolicy: compose-native\n", + secrets.display() + ), + ), + ) + .unwrap(); + let (exit, report) = check_json(&path); + assert_eq!(exit, ExitCode::SUCCESS, "{report}"); + assert!( + report["explicitProductionSettings"] + .as_array() + .unwrap() + .iter() + .any( + |line| line["code"] == "platform.posture.compose-native-secret-mount" + && line["pointer"] == "/secretProviders/file/mountPolicy" + ), + "{report}" + ); + // Startup logs every setting the loaded posture records. + let config = RuntimeConfig::load(&path, registry_messaging::config::DEFAULT_POSTURE) + .expect("the runtime file loads"); + assert!(config + .posture_report() + .explicit_setting_notices() + .iter() + .any(|notice| notice + .contains("compose-native-secret-mount at /secretProviders/file/mountPolicy"))); + } + #[test] fn a_check_lists_the_explicit_production_settings_the_runtime_states() { let (_root, path) = project(""); diff --git a/crates/registry-messagingctl/src/provision.rs b/crates/registry-messagingctl/src/provision.rs index e826deaa0c..157fe168f8 100644 --- a/crates/registry-messagingctl/src/provision.rs +++ b/crates/registry-messagingctl/src/provision.rs @@ -8,7 +8,7 @@ use std::path::Path; use registry_messaging::config::{startup_report, RuntimeConfig}; use registry_messaging_core::MESSAGING_RUNTIME_KIND; -use registry_platform_config::describe_secret_failure; +use registry_platform_config::{describe_secret_failure, DatabaseMember}; use registry_platform_provision::{ provision_transport, ProductDatabase, ProvisionInput, SchemaLayout, }; @@ -74,13 +74,8 @@ pub(crate) fn load( "Correct secretProviders in the runtime file, then run provision again.", ) })?; - let resolve = |member: &str, reference: &str| { - // The CA bundle is a public document; the URLs are secrets. - let read = if member == "caBundleRef" { - secrets.resolve_public_document(reference) - } else { - secrets.resolve(reference) - }; + let resolve = |member: DatabaseMember, reference: &str| { + let read = member.read(&secrets, reference); read.map_err(|error| { refuse( "config.refused", @@ -90,7 +85,7 @@ pub(crate) fn load( ) }) }; - let url = |member: &str, reference: &str| { + let url = |member: DatabaseMember, reference: &str| { let secret = resolve(member, reference)?; std::str::from_utf8(secret.expose_secret()) .map(|text| Zeroizing::new(text.trim().to_owned())) @@ -103,13 +98,16 @@ pub(crate) fn load( ) }) }; - let migration_url = url("migrationUrlRef", &config.database.migration_url_ref)?; - let runtime_url = url("runtimeUrlRef", &config.database.runtime_url_ref)?; + let migration_url = url( + DatabaseMember::MigrationUrl, + &config.database.migration_url_ref, + )?; + let runtime_url = url(DatabaseMember::RuntimeUrl, &config.database.runtime_url_ref)?; let ca_pem = config .database .ca_bundle_ref .as_deref() - .map(|reference| resolve("caBundleRef", reference)) + .map(|reference| resolve(DatabaseMember::CaBundle, reference)) .transpose()? .map(|secret| secret.expose_secret().to_vec()); Ok(ProvisionInput { @@ -118,5 +116,6 @@ pub(crate) fn load( runtime_url, ca_pem, transport: provision_transport(&config.database), + explicit_settings: config.posture_report().explicit_setting_notices(), }) } diff --git a/crates/registry-messagingctl/tests/provision_cli.rs b/crates/registry-messagingctl/tests/provision_cli.rs index 60e448a720..31e6a1aeab 100644 --- a/crates/registry-messagingctl/tests/provision_cli.rs +++ b/crates/registry-messagingctl/tests/provision_cli.rs @@ -191,6 +191,45 @@ fn print_sql_writes_the_script_and_no_password() { } } +#[test] +fn a_world_readable_ca_bundle_loads_and_the_mount_policy_is_noticed() { + let directory = scratch(); + let runtime = write_runtime(directory.path()); + // A CA bundle is a public document: a mode 0644 file loads, where a + // secret at that mode is refused. + let ca = directory.path().join("secrets").join("database-ca.pem"); + std::fs::write( + &ca, + "-----BEGIN CERTIFICATE-----\nMIIB\n-----END CERTIFICATE-----\n", + ) + .unwrap(); + std::fs::set_permissions(&ca, std::fs::Permissions::from_mode(0o644)).unwrap(); + let text = std::fs::read_to_string(&runtime).unwrap(); + let stated = text + .replace( + " migrationUrlRef: secret:file/migration-database-url\n", + " migrationUrlRef: secret:file/migration-database-url\n caBundleRef: secret:file/database-ca.pem\n", + ) + .replace( + "secretProviders:\n file:\n", + "secretProviders:\n file:\n mountPolicy: compose-native\n", + ); + assert_eq!(stated.matches("caBundleRef").count(), 1, "{stated}"); + assert!(stated.contains("mountPolicy"), "{stated}"); + std::fs::write(&runtime, stated).unwrap(); + + let output = ctl(&["provision", "--runtime-config", &runtime, "--print-sql"]); + let stdout = String::from_utf8(output.stdout).unwrap(); + let stderr = String::from_utf8(output.stderr).unwrap(); + assert_eq!(output.status.code(), Some(0), "{stdout}{stderr}"); + assert!( + stderr.contains( + "Explicit production setting platform.posture.compose-native-secret-mount at /secretProviders/file/mountPolicy." + ), + "{stderr}" + ); +} + #[test] fn print_sql_as_json_reports_nothing_executed() { let directory = scratch(); diff --git a/crates/registry-platform-config/README.md b/crates/registry-platform-config/README.md index 5ba2ff1409..900eb4f813 100644 --- a/crates/registry-platform-config/README.md +++ b/crates/registry-platform-config/README.md @@ -12,7 +12,8 @@ apply the same provider allowlist, regular-file checks, size bounds, redacted diagnostics, and zeroization. The consumer validates its key format and length; the resolver does not decode, trim, or reinterpret file contents. -A secret file is read through one rule. The name may be a relative link that +A secret file is read through one rule, with two explicit widenings described +below. The name may be a relative link that stays below `secretProviders.file.root` (downward steps only, at most 8 links, no `..`, no absolute target). The file it reaches must be a regular file with one hard link and no write access for others, and either owned by the runtime @@ -25,6 +26,17 @@ and `SecretError::suggested_action()` gives the fix for any failure. `SecretResolver::inspect_reference` runs the same checks without reading the bytes. +The file provider's `mountPolicy: compose-native` also accepts a root-owned, +single-link file at mode exactly 0444, the Docker Compose secret mount shape. +It is an explicit production setting: startup, `check` and the `provision` +tools report it. A public document, such as a static JWKS or a CA bundle, is +read with `resolve_public_document`, which keeps the walk, owner, link and +write checks but lets group and others read the file. Its refusals are +`SecretError::UnsafePublicDocument`, worded for a public document, and it +refuses a file holding a PEM private key block +(`SecretError::PrivateKeyInPublicDocument`). `inspect_public_document` checks +one without reading it. + ## Loader `RuntimeConfigLoader` reads one runtime configuration file named by an @@ -111,9 +123,15 @@ accepted reference through the explicitly enabled environment or file provider. - `SecretProvidersConfig`: `file.root` enables `secret:file/name`, and `environment: {}` enables `secret:env/NAME`. At least one must be declared, - and a reference to an undeclared provider is refused. + and a reference to an undeclared provider is refused. `file.mountPolicy` + is the Compose mount setting above, and `compose_native_mounts()` lets a + product whose contract keeps the strict rule refuse it. +- `StrictSecretProvidersConfig`: the same providers without `mountPolicy`, for + operator-local files read outside any runtime, such as saved CLI + connections and task connections. - `DatabaseConfig`: `runtimeUrlRef`, `migrationUrlRef`, and an optional - `caBundleRef`. + `caBundleRef`. `DatabaseMember` names each of them and reads it with the + rule it takes: the CA bundle as a public document, each URL as a secret. - `DestinationTransport`: `verified-tls`, `loopback-plaintext` or `private-network-plaintext`. Only the last is an explicit production setting. - `PrivateRanges`: the `allowedPrivateCidrs` list of `PrivateRange` values from diff --git a/crates/registry-platform-config/src/blocks.rs b/crates/registry-platform-config/src/blocks.rs index c6e035e9bd..e4fa6641f5 100644 --- a/crates/registry-platform-config/src/blocks.rs +++ b/crates/registry-platform-config/src/blocks.rs @@ -20,7 +20,8 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; use crate::{ DestinationTransport, DevelopmentClass, DevelopmentOnlyRefused, DevelopmentSetting, DevelopmentWitness, ExplicitClass, ExplicitProductionSetting, Gated, PrivateRanges, - SecretError, SecretProvider, SecretReference, SecretResolver, Stated, MAX_SECRET_BYTES, + ProtectedSecret, SecretError, SecretProvider, SecretReference, SecretResolver, Stated, + MAX_SECRET_BYTES, }; /// The schema pattern of a field that must name an enabled secret provider. @@ -145,8 +146,8 @@ pub struct FileSecretProviderConfig { /// `compose-native` also accepts a root-owned regular file with one hard /// link and mode exactly 0444, the shape of a Docker Compose secret mount. /// Every user in the container can read such a file. Startup and `check` - /// report this explicit production setting. Absent, the stricter rule - /// above applies. + /// report this explicit production setting. Without it, only the file + /// shapes `root` describes are accepted. #[serde(default, skip_serializing_if = "Option::is_none")] #[cfg_attr(feature = "schema", schemars(with = "Stated"))] mount_policy: Option>, @@ -248,6 +249,18 @@ impl SecretProvidersConfig { providers } + /// Whether the file provider states `mountPolicy: compose-native`. A + /// product whose contract keeps the strict file rule refuses the block + /// when this is true. + #[must_use] + pub fn compose_native_mounts(&self) -> bool { + self.file.as_ref().is_some_and(|file| { + file.mount_policy + .as_ref() + .is_some_and(|policy| *policy.get() == SecretMountPolicy::ComposeNative) + }) + } + /// A resolver for exactly the providers this block enables. When the /// process holds a [`DevelopmentWitness`], the file provider relaxes the /// read and mode-bit checks to a warning. @@ -263,11 +276,7 @@ impl SecretProvidersConfig { ) .map(|resolver| { let resolver = resolver.in_development(witness); - if self.file.as_ref().is_some_and(|file| { - file.mount_policy - .as_ref() - .is_some_and(|policy| *policy.get() == SecretMountPolicy::ComposeNative) - }) { + if self.compose_native_mounts() { resolver.with_compose_native_mounts() } else { resolver @@ -276,6 +285,82 @@ impl SecretProvidersConfig { } } +/// The secret providers of an operator-local file read outside any runtime, +/// such as a saved CLI connection or a task connection. It enables the same +/// providers as a runtime's `secretProviders` without the Compose mount +/// policy: nothing reports an explicit production setting for these files, +/// so the strict file rule always applies. +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[cfg_attr( + feature = "schema", + schemars(extend("anyOf" = [ + {"required": ["file"], "properties": {"file": {"$ref": "#/$defs/StrictFileSecretProviderConfig"}}}, + {"required": ["environment"], "properties": {"environment": {"$ref": "#/$defs/EnvironmentSecretProviderConfig"}}} + ])) +)] +#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct StrictSecretProvidersConfig { + /// Enables `secret:file/name` references, read from files under `root`. + #[serde(default, skip_serializing_if = "Option::is_none")] + #[cfg_attr(feature = "schema", schemars(with = "StrictFileSecretProviderConfig"))] + pub file: Option, + /// Enables `secret:env/NAME` references, read from the process + /// environment. Declared as an empty mapping: `environment: {}`. + #[serde(default, skip_serializing_if = "Option::is_none")] + #[cfg_attr(feature = "schema", schemars(with = "EnvironmentSecretProviderConfig"))] + pub environment: Option, +} + +/// The file secret provider of an operator-local file. +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct StrictFileSecretProviderConfig { + /// Absolute directory holding one file per secret. A name may be a + /// relative link that stays below this directory, through at most 8 links. + /// The file it reaches must be a regular file with one hard link, owned by + /// the user running the tool with mode 0400 or 0600, or owned by root with + /// no access beyond group read (0440 or 0640) when that user is not root. + /// A command that declared development loads a file with looser read or + /// mode bits and logs a warning. + #[cfg_attr(feature = "schema", schemars(extend("pattern" = "^/")))] + pub root: PathBuf, +} + +impl StrictSecretProvidersConfig { + /// The same providers as a runtime block with no `mountPolicy`, which is + /// how every check and the resolver read them. + #[must_use] + pub fn as_runtime_block(&self) -> SecretProvidersConfig { + SecretProvidersConfig { + file: self + .file + .as_ref() + .map(|file| FileSecretProviderConfig::new(file.root.clone())), + environment: self.environment.clone(), + } + } + + /// See [`SecretProvidersConfig::check`]. + pub fn check(&self) -> Result<(), ConfigBlockError> { + self.as_runtime_block().check() + } + + /// See [`SecretProvidersConfig::check_reference`]. + pub fn check_reference(&self, field: &str, raw: &str) -> Result<(), ConfigBlockError> { + self.as_runtime_block().check_reference(field, raw) + } + + /// A resolver with the strict file rule. See [`SecretProvidersConfig::resolver`]. + pub fn resolver( + &self, + witness: Option<&DevelopmentWitness>, + ) -> Result { + self.as_runtime_block().resolver(witness) + } +} + /// Explain one refused secret reference without disclosing what it protects. /// /// The reference is operator-authored text read from a configuration file, so @@ -301,6 +386,16 @@ pub fn describe_secret_failure(field: &str, _reference: &str, error: &SecretErro check.code(), check.suggested_action() ), + SecretError::UnsafePublicDocument(check) => format!( + "{} ({}). {}", + check.public_message(), + check.code(), + check.public_suggested_action() + ), + SecretError::PrivateKeyInPublicDocument => format!( + "the public document holds a PEM private key block. {}", + error.suggested_action() + ), SecretError::Read => "the secret could not be read".to_owned(), SecretError::InvalidValue => format!( "the secret value must be non-empty text of at most {MAX_SECRET_BYTES} bytes \ @@ -338,6 +433,59 @@ pub struct DatabaseConfig { pub transport: Option>, } +/// One secret reference of a database block, and how a tool reads it: the CA +/// bundle is a public document, and each URL is a secret. A provisioning tool +/// names the member it reads, so the read follows the member and a renamed key +/// cannot fall back to the wrong rule. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum DatabaseMember { + RuntimeUrl, + MigrationUrl, + CaBundle, +} + +impl DatabaseMember { + /// The member's key in the database block. + #[must_use] + pub fn key(self) -> &'static str { + match self { + Self::RuntimeUrl => "runtimeUrlRef", + Self::MigrationUrl => "migrationUrlRef", + Self::CaBundle => "caBundleRef", + } + } + + /// Read the member's reference with the rule the member takes. + pub fn read( + self, + resolver: &SecretResolver, + reference: &str, + ) -> Result { + match self { + Self::CaBundle => resolver.resolve_public_document(reference), + Self::RuntimeUrl | Self::MigrationUrl => resolver.resolve(reference), + } + } + + /// [`Self::read`] for a parsed reference. + pub fn read_reference( + self, + resolver: &SecretResolver, + reference: &SecretReference, + ) -> Result { + match self { + Self::CaBundle => resolver.resolve_public_document_reference(reference), + Self::RuntimeUrl | Self::MigrationUrl => resolver.resolve_reference(reference), + } + } +} + +impl fmt::Display for DatabaseMember { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter.write_str(self.key()) + } +} + impl fmt::Debug for DatabaseConfig { fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { formatter diff --git a/crates/registry-platform-config/src/blocks_tests.rs b/crates/registry-platform-config/src/blocks_tests.rs index 22d7c16419..bc28f71074 100644 --- a/crates/registry-platform-config/src/blocks_tests.rs +++ b/crates/registry-platform-config/src/blocks_tests.rs @@ -78,6 +78,44 @@ fn the_resolver_enables_exactly_the_declared_providers() { )); } +#[cfg(unix)] +#[test] +fn a_database_ca_bundle_reads_as_a_public_document_and_a_url_as_a_secret() { + use std::os::unix::fs::PermissionsExt as _; + + let root = tempfile::tempdir().expect("tempdir"); + let canonical = std::fs::canonicalize(root.path()).expect("canonical root"); + let shared = canonical.join("shared"); + std::fs::write(&shared, b"-----BEGIN CERTIFICATE-----\n").expect("write file"); + std::fs::set_permissions(&shared, std::fs::Permissions::from_mode(0o644)).expect("set 0644"); + let resolver = SecretProvidersConfig { + file: Some(FileSecretProviderConfig::new(canonical)), + environment: None, + } + .resolver(None) + .expect("production resolver"); + + assert_eq!(DatabaseMember::CaBundle.key(), "caBundleRef"); + assert_eq!(DatabaseMember::MigrationUrl.to_string(), "migrationUrlRef"); + assert!(DatabaseMember::CaBundle + .read(&resolver, "secret:file/shared") + .is_ok()); + let reference = SecretReference::parse("secret:file/shared").unwrap(); + assert!(DatabaseMember::CaBundle + .read_reference(&resolver, &reference) + .is_ok()); + for member in [DatabaseMember::RuntimeUrl, DatabaseMember::MigrationUrl] { + assert_eq!( + member.read(&resolver, "secret:file/shared").unwrap_err(), + SecretError::UnsafeFile(crate::SecretFileCheck::WorldReadable) + ); + assert_eq!( + member.read_reference(&resolver, &reference).unwrap_err(), + SecretError::UnsafeFile(crate::SecretFileCheck::WorldReadable) + ); + } +} + #[cfg(unix)] #[test] fn secret_providers_resolver_relaxes_secret_file_permissions_only_with_a_development_witness() { @@ -149,11 +187,24 @@ fn compose_native_mount_is_an_explicit_production_setting_at_its_member() { let strict = "apiVersion: registry.registrystack.org/example/v1alpha1\nkind: ExampleRuntimeConfig\nsecretProviders:\n file:\n root: /run/secrets\n"; let omitted = loader.parse_str::(strict, |_| None).unwrap(); assert!(omitted.posture.explicit_settings().is_empty()); + assert!(!omitted + .config + .secret_providers + .resolver(None) + .unwrap() + .admits_compose_native_mounts()); let explicit = format!("{strict} mountPolicy: compose-native\n"); let loaded = loader.parse_str::(&explicit, |_| None).unwrap(); assert!(loaded.development.is_none()); loaded.config.secret_providers.check().unwrap(); + // The member, and only the member, switches the resolver to the Compose rule. + assert!(loaded + .config + .secret_providers + .resolver(None) + .unwrap() + .admits_compose_native_mounts()); let [notice] = loaded.posture.explicit_settings() else { panic!("one explicit setting is recorded"); }; diff --git a/crates/registry-platform-config/src/lib.rs b/crates/registry-platform-config/src/lib.rs index e2fc8a6ddd..1d4a4afa14 100644 --- a/crates/registry-platform-config/src/lib.rs +++ b/crates/registry-platform-config/src/lib.rs @@ -38,13 +38,14 @@ pub use blocks::{ is_sha256_label, plaintext_host_addresses, published_http_issuer_setting, resolve_database_host, url_hook_destinations, AdmittedClients, AttachmentVerifierConfig, AttemptTimeoutMilliseconds, AuditKeyConfig, AuditKeyCustody, CheckedHost, ConfigBlockError, - ConfigBlockErrorKind, DatabaseConfig, DatabaseHost, DatabaseTransport, DatabaseTransportError, - EnvironmentSecretProviderConfig, FileSecretProviderConfig, HostResolver, InsecureHttp, - JwksSource, ListenerBind, ListenerConfig, ListenerNetworkExposure, MetricsListenerConfig, - ObjectStorageConfig, OidcClientsConfig, OidcIssuerConfig, OidcPackageClientsConfig, - PackageClients, PackageClientsError, PackageConfig, PackageDigestMismatch, PermittedTransport, - PrivateListenerConfig, SecretProvidersConfig, TaskGrantStatusConfig, TlsTermination, - UrlHookDestinationConfig, DEFAULT_ATTEMPT_TIMEOUT_MILLISECONDS, + ConfigBlockErrorKind, DatabaseConfig, DatabaseHost, DatabaseMember, DatabaseTransport, + DatabaseTransportError, EnvironmentSecretProviderConfig, FileSecretProviderConfig, + HostResolver, InsecureHttp, JwksSource, ListenerBind, ListenerConfig, ListenerNetworkExposure, + MetricsListenerConfig, ObjectStorageConfig, OidcClientsConfig, OidcIssuerConfig, + OidcPackageClientsConfig, PackageClients, PackageClientsError, PackageConfig, + PackageDigestMismatch, PermittedTransport, PrivateListenerConfig, SecretProvidersConfig, + StrictFileSecretProviderConfig, StrictSecretProvidersConfig, TaskGrantStatusConfig, + TlsTermination, UrlHookDestinationConfig, DEFAULT_ATTEMPT_TIMEOUT_MILLISECONDS, DEFAULT_HOOK_ATTEMPT_TIMEOUT_MILLISECONDS, DEFAULT_HOOK_MAXIMUM_ATTEMPTS, DEFAULT_TASK_GRANT_STATUS_PATH, DEFAULT_TASK_GRANT_STATUS_SCOPE, MAX_ASSERTION_ISSUERS_PER_CLIENT, MAX_ASSERTION_ISSUER_BYTES, MAX_ASSERTION_ISSUER_CLIENTS, diff --git a/crates/registry-platform-config/src/posture.rs b/crates/registry-platform-config/src/posture.rs index 22065ef648..ba82c72fa4 100644 --- a/crates/registry-platform-config/src/posture.rs +++ b/crates/registry-platform-config/src/posture.rs @@ -451,6 +451,20 @@ pub struct FoundExplicitSetting { pub origin: SettingOrigin, } +impl FoundExplicitSetting { + /// The one line a command prints for this setting, as the check commands + /// print it: the code, the member and what the setting relaxes. + #[must_use] + pub fn notice(&self) -> String { + format!( + "Explicit production setting {} at {}. {}.", + self.setting.code, + self.pointer.as_deref().unwrap_or_default(), + self.setting.summary + ) + } +} + /// What one decode found: the development-only settings a [`Gated`] recorded /// and the explicit production settings a [`Stated`] recorded. #[derive(Clone, Debug, Default)] @@ -559,6 +573,15 @@ impl PostureReport { &self.explicit } + /// [`FoundExplicitSetting::notice`] for each explicit production setting. + #[must_use] + pub fn explicit_setting_notices(&self) -> Vec { + self.explicit + .iter() + .map(FoundExplicitSetting::notice) + .collect() + } + /// The one decision. Production refuses every recorded setting and /// development accepts and lists them, under the same codes. #[must_use] diff --git a/crates/registry-platform-config/src/secrets.rs b/crates/registry-platform-config/src/secrets.rs index 106c64b3f0..844e4a3831 100644 --- a/crates/registry-platform-config/src/secrets.rs +++ b/crates/registry-platform-config/src/secrets.rs @@ -193,6 +193,13 @@ pub enum SecretError { Unavailable, #[error("the referenced secret file is unsafe")] UnsafeFile(SecretFileCheck), + /// A public document's file failed a check. The check is the one a + /// secret file fails, worded for a document anyone may read. + #[error("the referenced public document file is unsafe")] + UnsafePublicDocument(SecretFileCheck), + /// A public document holds a PEM private key block. + #[error("the referenced public document holds a private key")] + PrivateKeyInPublicDocument, #[error("the referenced secret could not be read")] Read, #[error("the referenced secret value is invalid")] @@ -218,6 +225,10 @@ impl SecretError { "Create the secret under the configured provider, or correct the name." } Self::UnsafeFile(check) => check.suggested_action(), + Self::UnsafePublicDocument(check) => check.public_suggested_action(), + Self::PrivateKeyInPublicDocument => { + "Put only certificates or public keys in the document, and keep the private key in its own secret file." + } Self::Read => "Check that the secret can be read by the runtime user.", Self::InvalidValue => { "Store a non-empty value of at most 64 KiB, without NUL bytes unless the secret is a binary key." @@ -326,6 +337,51 @@ impl SecretFileCheck { } } + /// [`Self::message`] for a public document such as a JWKS or a CA bundle. + #[must_use] + pub const fn public_message(self) -> &'static str { + match self { + Self::LinkLeavesRoot => { + "the public document is reached through a link that leaves secretProviders.file.root" + } + Self::TooManyLinks => "the public document is reached through more than 8 links", + Self::CannotOpen => "the runtime user cannot open the public document", + Self::NotRegular => "the public document is not a regular file", + Self::HardLinked => "the public document has more than one hard link", + Self::Owner => "the public document is owned by neither the runtime user nor root", + Self::WorldWritable => { + "users outside the file's owner and group can write the public document" + } + Self::WorldReadable | Self::GroupAccess => "the public document's group can write or execute it", + Self::ModeBits => { + "the public document has an execute, setuid, setgid or sticky bit, or its owner cannot read it" + } + } + } + + /// [`Self::suggested_action`] for a public document: anyone may read it, + /// so only who can change it matters. + #[must_use] + pub const fn public_suggested_action(self) -> &'static str { + match self { + Self::LinkLeavesRoot + | Self::TooManyLinks + | Self::NotRegular + | Self::HardLinked => self.suggested_action(), + Self::CannotOpen => { + "Let the runtime user read the file, for example mode 0644, or 0444 owned by root." + } + Self::Owner => "Give the file to the runtime user or to root.", + Self::WorldWritable => "Remove write access for others (chmod o-w).", + Self::WorldReadable | Self::GroupAccess => { + "Remove group write and execute (chmod g-wx)." + } + Self::ModeBits => { + "Clear the execute, setuid, setgid and sticky bits, and let the owner read the file, for example mode 0644." + } + } + } + /// Whether a development process loads the file with a warning instead of /// refusing it. Production refuses every check. #[must_use] @@ -460,6 +516,13 @@ impl SecretResolver { self } + /// Whether this resolver admits root-owned mode 0444 Compose mounts, so a + /// test can prove which configurations switch the rule on. + #[cfg(test)] + pub(crate) fn admits_compose_native_mounts(&self) -> bool { + self.file_access.compose_native + } + /// Run every check a read runs, without retaining the bytes. A check tool /// uses this to give the verdict the runtime would give. pub fn inspect_reference(&self, reference: &SecretReference) -> Result<(), SecretError> { @@ -470,6 +533,7 @@ impl SecretResolver { /// [`Self::resolve_public_document_reference`] applies. pub fn inspect_public_document(&self, reference: &SecretReference) -> Result<(), SecretError> { self.inspect_with(reference, self.public_access()) + .map_err(public_document_error) } fn inspect_with( @@ -509,7 +573,17 @@ impl SecretResolver { &self, reference: &SecretReference, ) -> Result { - validate_secret(self.read_with(reference, self.public_access())?.0) + let document = validate_secret( + self.read_with(reference, self.public_access()) + .map_err(public_document_error)? + .0, + )?; + // A public document may be readable by everyone, so a private key + // staged in it by mistake is refused rather than loaded. + if holds_pem_private_key(document.expose_secret()) { + return Err(SecretError::PrivateKeyInPublicDocument); + } + Ok(document) } fn public_access(&self) -> FileAccess { @@ -663,6 +737,22 @@ fn judge( } } +/// A file refusal from a public-document read names the public document. +fn public_document_error(error: SecretError) -> SecretError { + match error { + SecretError::UnsafeFile(check) => SecretError::UnsafePublicDocument(check), + other => other, + } +} + +/// Whether `bytes` hold a PEM private key block of any kind: PKCS #8 +/// (encrypted or not), RSA, EC, DSA or OpenSSH. +fn holds_pem_private_key(bytes: &[u8]) -> bool { + bytes + .windows(b"PRIVATE KEY-----".len()) + .any(|window| window == b"PRIVATE KEY-----") +} + /// Walk `name` from the root by openat steps, following only relative /// downward links, then judge the descriptor that will be read. #[cfg(unix)] diff --git a/crates/registry-platform-config/src/secrets_tests.rs b/crates/registry-platform-config/src/secrets_tests.rs index 51acf33774..cc943c4057 100644 --- a/crates/registry-platform-config/src/secrets_tests.rs +++ b/crates/registry-platform-config/src/secrets_tests.rs @@ -344,18 +344,80 @@ mod filesystem { let resolver = resolver(root.path()); assert_eq!( load_public(&resolver, "group-writable.json"), - Err(SecretError::UnsafeFile(GroupAccess)) + Err(SecretError::UnsafePublicDocument(GroupAccess)) ); assert_eq!( load_public(&resolver, "world-writable.json"), - Err(SecretError::UnsafeFile(WorldWritable)) + Err(SecretError::UnsafePublicDocument(WorldWritable)) ); - assert_eq!( - load_public(&resolver, "escape"), - load(&resolver, "escape"), - "an absolute link is refused as it is for a secret" - ); - assert!(load_public(&resolver, "escape").is_err()); + // An absolute link is refused by the check that refuses it for a + // secret, worded for a public document. + match (load_public(&resolver, "escape"), load(&resolver, "escape")) { + ( + Err(SecretError::UnsafePublicDocument(public)), + Err(SecretError::UnsafeFile(secret)), + ) => assert_eq!(public, secret), + other => panic!("{other:?}"), + } + } + + #[test] + fn a_public_document_refusal_gives_public_document_advice() { + let root = tempfile::tempdir().expect("root"); + write(root.path(), "group-writable.json", 0o664); + let error = load_public(&resolver(root.path()), "group-writable.json").unwrap_err(); + let SecretError::UnsafePublicDocument(check) = error else { + panic!("{error:?}"); + }; + for text in [ + check.public_message(), + check.public_suggested_action(), + error.suggested_action(), + ] { + assert!(!text.contains("secret file"), "{text}"); + assert!(!text.contains("0400 or 0600"), "{text}"); + } + let described = crate::describe_secret_failure("jwksSource.documentRef", "", &error); + assert!(described.contains("public document"), "{described}"); + assert!(!described.contains("0400 or 0600"), "{described}"); + } + + #[test] + fn a_public_document_holding_a_private_key_is_refused() { + let root = tempfile::tempdir().expect("root"); + for (name, block) in [ + ("pkcs8.pem", "PRIVATE KEY"), + ("rsa.pem", "RSA PRIVATE KEY"), + ("ec.pem", "EC PRIVATE KEY"), + ("encrypted.pem", "ENCRYPTED PRIVATE KEY"), + ] { + let path = root.path().join(name); + fs::write( + &path, + format!( + "-----BEGIN CERTIFICATE-----\nMIIB\n-----END CERTIFICATE-----\n\ + -----BEGIN {block}-----\nMIIE\n-----END {block}-----\n" + ), + ) + .expect("write"); + fs::set_permissions(&path, fs::Permissions::from_mode(0o644)).expect("mode"); + } + let resolver = resolver(root.path()); + for name in ["pkcs8.pem", "rsa.pem", "ec.pem", "encrypted.pem"] { + assert_eq!( + load_public(&resolver, name), + Err(SecretError::PrivateKeyInPublicDocument), + "{name}" + ); + } + let bundle = root.path().join("ca.pem"); + fs::write( + &bundle, + "-----BEGIN CERTIFICATE-----\nMIIB\n-----END CERTIFICATE-----\n", + ) + .expect("write"); + fs::set_permissions(&bundle, fs::Permissions::from_mode(0o644)).expect("mode"); + assert!(load_public(&resolver, "ca.pem").is_ok()); } #[test] diff --git a/crates/registry-platform-provision/src/cli.rs b/crates/registry-platform-provision/src/cli.rs index 22e4402b94..c3480e7cff 100644 --- a/crates/registry-platform-provision/src/cli.rs +++ b/crates/registry-platform-provision/src/cli.rs @@ -95,6 +95,10 @@ pub struct ProvisionInput { pub ca_pem: Option>, /// How the runtime connects to PostgreSQL, from `database.transport`. pub transport: DatabaseTransport, + /// One notice per explicit production setting the runtime file states, + /// from [`registry_platform_config::FoundExplicitSetting::notice`]. The + /// runner writes each to stderr, as the runtime logs it at startup. + pub explicit_settings: Vec, } /// Result class of a run, as in every other verb's report. @@ -796,6 +800,11 @@ fn run_with( return output.refusal(&report); } }; + for notice in &input.explicit_settings { + // A notice that cannot reach stderr leaves nothing else to tell; the + // run continues and the report still carries its outcome. + let _ = writeln!(output.stderr, "{notice}"); + } report.product = Some(input.product.product.to_owned()); let dotted_section = section.replace('/', "."); let (Some(migration), Some(runtime)) = ( @@ -1160,6 +1169,7 @@ mod tests { runtime_url: Zeroizing::new(runtime.to_owned()), ca_pem: None, transport: DatabaseTransport::VerifiedTls, + explicit_settings: Vec::new(), } } @@ -1394,6 +1404,22 @@ mod tests { // ---- print mode ---- + #[test] + fn the_runtime_file_explicit_settings_are_printed_on_stderr() { + let notice = "Explicit production setting platform.posture.compose-native-secret-mount at /secretProviders/file/mountPolicy. The file secret provider accepts root-owned, mode 0444 Compose mounts."; + for arguments in [ + &["--print-sql"][..], + &["--print-sql", "--format", "json"][..], + ] { + let mut input = split_input(); + input.explicit_settings = vec![notice.to_owned()]; + let run = execute_run(arguments, None, Ok(input), &must_not_run); + assert_eq!(run.exit, 0, "{}", run.all_output()); + assert!(run.stderr.contains(notice), "{arguments:?}: {}", run.stderr); + assert!(!run.stdout.contains(notice), "{arguments:?}"); + } + } + #[test] fn print_mode_writes_only_the_script_to_stdout() { let run = execute_run(&["--print-sql"], None, Ok(split_input()), &must_not_run); @@ -2683,6 +2709,7 @@ mod tests { runtime_url: input.runtime_url.clone(), ca_pem: None, transport: DatabaseTransport::LoopbackPlaintext, + explicit_settings: Vec::new(), }), &created_everything, declared, @@ -2941,6 +2968,7 @@ mod postgres_tests { )), ca_pem: Some(ca.clone()), transport: DatabaseTransport::VerifiedTls, + explicit_settings: Vec::new(), }; let _cleanup = Cleanup { admin: admin_config(&admin_url, Some(&ca)).expect("administrator config"), diff --git a/crates/registry-render/src/auth.rs b/crates/registry-render/src/auth.rs index 65073d5040..576c3fc5eb 100644 --- a/crates/registry-render/src/auth.rs +++ b/crates/registry-render/src/auth.rs @@ -71,7 +71,19 @@ async fn entry_verifier( } registry_platform_config::JwksSource::Static { document_ref } | registry_platform_config::JwksSource::TestIssuer { document_ref } => { - let document = crate::runtime::resolve_public_document(runtime, witness, document_ref) + // A provider that cannot be built is named as such, as every other + // reference this runtime resolves names it. + let resolver = runtime + .secret_providers + .resolver(witness) + .map_err(|error| { + RenderProblem::new( + ProblemKind::RuntimeInvalid, + format!("secretProviders: {error}"), + ) + })?; + let document = resolver + .resolve_public_document(document_ref) .map_err(|error| { RenderProblem::new(ProblemKind::RuntimeInvalid, format!("{error}")) })?; diff --git a/crates/registry-schedulingctl/src/lib.rs b/crates/registry-schedulingctl/src/lib.rs index bb22fa267f..ae7ec5e094 100644 --- a/crates/registry-schedulingctl/src/lib.rs +++ b/crates/registry-schedulingctl/src/lib.rs @@ -2676,6 +2676,54 @@ mod tests { assert_eq!(report["status"], "operational-failure"); } + #[test] + fn the_compose_mount_policy_is_listed_by_check_and_recorded_for_startup() { + let (root, project) = initialized("standalone-exact-time"); + let runtime = runtime_config(root.path(), &project); + let text = std::fs::read_to_string(&runtime).unwrap(); + let providers = "secretProviders:\n file:\n"; + assert!(text.contains(providers), "{text}"); + std::fs::write( + &runtime, + text.replacen( + providers, + &format!("{providers} mountPolicy: compose-native\n"), + 1, + ), + ) + .unwrap(); + let (exit, report, _) = run_json(&[ + "check", + project.to_str().unwrap(), + "--runtime-config", + runtime.to_str().unwrap(), + ]); + assert_eq!(exit, ExitCode::SUCCESS, "{report}"); + assert!( + report["explicitProductionSettings"] + .as_array() + .unwrap() + .iter() + .any( + |line| line["code"] == "platform.posture.compose-native-secret-mount" + && line["pointer"] == "/secretProviders/file/mountPolicy" + ), + "{report}" + ); + // Startup logs every setting the loaded posture records. + let config = registry_scheduling::config::RuntimeConfig::load( + &runtime, + registry_scheduling::config::DEFAULT_POSTURE, + ) + .expect("the runtime file loads"); + assert!(config + .posture_report() + .explicit_setting_notices() + .iter() + .any(|notice| notice + .contains("compose-native-secret-mount at /secretProviders/file/mountPolicy"))); + } + /// `check --runtime-config` lists the settings the file states on purpose /// as facts for a reviewer. They never change the verdict. #[test] diff --git a/crates/registry-schedulingctl/src/provision.rs b/crates/registry-schedulingctl/src/provision.rs index 34c1aedacf..d123514d9d 100644 --- a/crates/registry-schedulingctl/src/provision.rs +++ b/crates/registry-schedulingctl/src/provision.rs @@ -6,7 +6,7 @@ use std::path::Path; -use registry_platform_config::describe_secret_failure; +use registry_platform_config::{describe_secret_failure, DatabaseMember}; use registry_platform_provision::{ provision_transport, ProductDatabase, ProvisionInput, SchemaLayout, }; @@ -74,13 +74,8 @@ pub(crate) fn load( "Correct secretProviders in the runtime file, then run provision again.", ) })?; - let resolve = |member: &str, reference: &str| { - // The CA bundle is a public document; the URLs are secrets. - let read = if member == "caBundleRef" { - secrets.resolve_public_document(reference) - } else { - secrets.resolve(reference) - }; + let resolve = |member: DatabaseMember, reference: &str| { + let read = member.read(&secrets, reference); read.map_err(|error| { refuse( "config.refused", @@ -90,7 +85,7 @@ pub(crate) fn load( ) }) }; - let url = |member: &str, reference: &str| { + let url = |member: DatabaseMember, reference: &str| { let secret = resolve(member, reference)?; std::str::from_utf8(secret.expose_secret()) .map(|text| Zeroizing::new(text.trim().to_owned())) @@ -103,13 +98,16 @@ pub(crate) fn load( ) }) }; - let migration_url = url("migrationUrlRef", &config.database.migration_url_ref)?; - let runtime_url = url("runtimeUrlRef", &config.database.runtime_url_ref)?; + let migration_url = url( + DatabaseMember::MigrationUrl, + &config.database.migration_url_ref, + )?; + let runtime_url = url(DatabaseMember::RuntimeUrl, &config.database.runtime_url_ref)?; let ca_pem = config .database .ca_bundle_ref .as_deref() - .map(|reference| resolve("caBundleRef", reference)) + .map(|reference| resolve(DatabaseMember::CaBundle, reference)) .transpose()? .map(|secret| secret.expose_secret().to_vec()); Ok(ProvisionInput { @@ -118,5 +116,6 @@ pub(crate) fn load( runtime_url, ca_pem, transport: provision_transport(&config.database), + explicit_settings: config.posture_report().explicit_setting_notices(), }) } diff --git a/crates/registry-schedulingctl/src/records.rs b/crates/registry-schedulingctl/src/records.rs index d0ec950cd5..dc309bbdba 100644 --- a/crates/registry-schedulingctl/src/records.rs +++ b/crates/registry-schedulingctl/src/records.rs @@ -18,7 +18,7 @@ use std::fs; use std::path::Path; use anyhow::{anyhow, Context, Result}; -use registry_platform_config::{SecretProvider, SecretResolver}; +use registry_platform_config::SecretResolver; use registry_scheduling::audit::{with_event_id, SchedulingAudit}; use registry_scheduling::config::RuntimeConfig; use registry_scheduling::runtime::open_audit; @@ -223,23 +223,14 @@ fn counts(facts: &SchedulingFacts) -> Value { }) } +/// The runtime's own resolver: the providers it enables, its file mount +/// policy and its development witness, so the tool reads a secret exactly +/// as the runtime does. pub(crate) fn secret_resolver(config: &RuntimeConfig) -> Result { - let mut providers = Vec::new(); - if config.secret_providers.file.is_some() { - providers.push(SecretProvider::File); - } - if config.secret_providers.environment.is_some() { - providers.push(SecretProvider::Environment); - } - SecretResolver::new( - providers, - config - .secret_providers - .file - .as_ref() - .map_or_else(|| Path::new(""), |file| file.root.as_path()), - ) - .context("configuring the Scheduling secret providers") + config + .secret_providers + .resolver(config.development_witness()) + .context("configuring the Scheduling secret providers") } #[cfg(test)] diff --git a/crates/registry-session/README.md b/crates/registry-session/README.md index 70209fce28..a301d4453a 100644 --- a/crates/registry-session/README.md +++ b/crates/registry-session/README.md @@ -44,7 +44,9 @@ audit destination before listening. `registry-session --runtime-config /absolute/path/session-runtime.yaml check` checks the same runtime model offline. It reads no secret, calls no provider, opens no socket and writes no audit file. `--format json` writes a -`PlatformSessionCtlReport`. It exits 0 when accepted, 1 when refused (or on +`PlatformSessionCtlReport`, which lists each explicit production setting the +file states under `explicitProductionSettings`. The human output prints each +as a notice on stderr. It exits 0 when accepted, 1 when refused (or on a warning with `--deny-warnings`), 2 for usage errors and 3 for unreadable input. Without `--environment`, environment expressions are checked only for syntax and position. `--identity-receipt /absolute/path/identity-receipt.json` diff --git a/crates/registry-session/src/config.rs b/crates/registry-session/src/config.rs index f6e76399b0..ecb17ebed3 100644 --- a/crates/registry-session/src/config.rs +++ b/crates/registry-session/src/config.rs @@ -972,6 +972,9 @@ pub struct RuntimeCheck { /// Whether a member that decides a kind's audiences holds an expression /// the check did not substitute, so the audiences it derived are stand-ins. pub deferred_audiences: bool, + /// The explicit production settings the file states, which `check` + /// reports beside its diagnostics. + pub explicit_settings: Vec, } /// The route a request path belongs to. @@ -1245,6 +1248,11 @@ pub(crate) fn read_runtime_file( let deferred_audiences = check.loaded.as_ref().is_some_and(|loaded| { deferred_audience_inputs(&loaded.config, &|pointer| check.defers(pointer)) }); + let explicit_settings = check + .loaded + .as_ref() + .map(|loaded| loaded.posture.explicit_settings().to_vec()) + .unwrap_or_default(); if refused { check.loaded = None; } @@ -1254,6 +1262,7 @@ pub(crate) fn read_runtime_file( diagnostics, unavailable, deferred_audiences, + explicit_settings, }, ) } diff --git a/crates/registry-session/src/offline.rs b/crates/registry-session/src/offline.rs index 7ff0e006bc..be856a0592 100644 --- a/crates/registry-session/src/offline.rs +++ b/crates/registry-session/src/offline.rs @@ -64,13 +64,16 @@ struct CtlReport { errors: usize, warnings: usize, diagnostics: serde_json::Value, + /// Each explicit production setting the file states: a fact for review, + /// not a diagnostic. + explicit_production_settings: Vec, } /// Run `registry-session check` and report every finding (CFG-DIAG-4): exit 0 when /// nothing was refused, 1 when something was or a warning was reported under /// `--deny-warnings`, and 3 when the file could not be read. pub fn run(request: &CheckRequest<'_>, stdout: &mut dyn Write, stderr: &mut dyn Write) -> u8 { - let (mut diagnostics, mut unavailable) = + let (mut diagnostics, mut unavailable, settings) = check_runtime_file(request.runtime, request.environment, request.posture); if let (Some(receipt), false) = (request.identity_receipt, diagnostics.iter().any(is_error)) { let (found, unreadable) = receipt_diagnostics( @@ -107,6 +110,10 @@ pub fn run(request: &CheckRequest<'_>, stdout: &mut dyn Write, stderr: &mut dyn errors: report.error_count(), warnings: report.warning_count(), diagnostics: report.to_json_value(), + explicit_production_settings: settings + .iter() + .map(|found| setting_line(found, request.runtime)) + .collect(), }; let written = serde_json::to_writer_pretty(&mut *stdout, &document) .map_err(std::io::Error::other) @@ -116,6 +123,11 @@ pub fn run(request: &CheckRequest<'_>, stdout: &mut dyn Write, stderr: &mut dyn } } OutputFormat::Human if exit == 0 => { + for found in &settings { + if writeln!(stderr, "{}", found.notice()).is_err() { + return OPERATIONAL_FAILURE_EXIT; + } + } if stdout.write_all(report.render_human().as_bytes()).is_err() { return OPERATIONAL_FAILURE_EXIT; } @@ -134,14 +146,40 @@ pub fn run(request: &CheckRequest<'_>, stdout: &mut dyn Write, stderr: &mut dyn exit } +/// One explicit production setting as the JSON report lists it, with the +/// members every check report uses for it. +fn setting_line( + found: ®istry_platform_config::FoundExplicitSetting, + runtime: &Path, +) -> serde_json::Value { + let mut line = serde_json::json!({ + "code": found.setting.code, + "file": runtime.display().to_string(), + "summary": found.setting.summary, + }); + if let Some(pointer) = &found.pointer { + line["pointer"] = pointer.as_str().into(); + } + if let Some(position) = found.position { + line["line"] = position.line.into(); + line["column"] = position.column.into(); + } + line +} + /// Check the runtime file at `path` as given: the loader needs an absolute, /// lexically normal path, and every diagnostic names the file as given. -/// Returns the findings and whether the file could not be read at all. +/// Returns the findings, whether the file could not be read at all, and the +/// explicit production settings it states. fn check_runtime_file( path: &Path, environment: bool, posture: DeclaredPosture, -) -> (Vec, bool) { +) -> ( + Vec, + bool, + Vec, +) { let given = path.display().to_string(); let Some(absolute) = absolute_lexical(path) else { let mut diagnostic = Diagnostic::error( @@ -155,7 +193,7 @@ fn check_runtime_file( line: None, column: None, }); - return (vec![diagnostic], true); + return (vec![diagnostic], true, Vec::new()); }; let checked = crate::config::check_runtime(&absolute, environment, posture); let absolute = absolute.display().to_string(); @@ -176,7 +214,7 @@ fn check_runtime_file( diagnostic }) .collect(); - (diagnostics, checked.unavailable) + (diagnostics, checked.unavailable, checked.explicit_settings) } /// `path` made absolute against the working directory, with `.` and `..` diff --git a/crates/registry-session/tests/binary.rs b/crates/registry-session/tests/binary.rs index fe30a66565..693cc17ba5 100644 --- a/crates/registry-session/tests/binary.rs +++ b/crates/registry-session/tests/binary.rs @@ -117,6 +117,43 @@ async fn the_offline_check_passes_a_good_file_and_reports_json() { assert_eq!(report["kind"], "PlatformSessionCtlReport"); } +#[tokio::test] +async fn the_offline_check_reports_the_explicit_production_settings() { + let harness = Harness::start().await; + let runtime = runtime_file(&harness); + let (code, stdout, stderr) = run(&runtime, &["--format", "json"]); + assert_eq!(code, 0, "{stderr}"); + let report: serde_json::Value = serde_json::from_str(&stdout).expect("json report"); + assert_eq!(report["explicitProductionSettings"], json!([])); + + let text = std::fs::read_to_string(&runtime).expect("runtime file"); + let stated = text.replacen( + "secretProviders:\n file:\n", + "secretProviders:\n file:\n mountPolicy: compose-native\n", + 1, + ); + assert_ne!(stated, text, "the member is written"); + std::fs::write(&runtime, stated).expect("rewrite the runtime file"); + let (code, stdout, stderr) = run(&runtime, &["--format", "json"]); + assert_eq!(code, 0, "{stderr}"); + let report: serde_json::Value = serde_json::from_str(&stdout).expect("json report"); + let settings = report["explicitProductionSettings"].as_array().unwrap(); + assert!( + settings.iter().any(|setting| setting["code"] + == "platform.posture.compose-native-secret-mount" + && setting["pointer"] == "/secretProviders/file/mountPolicy"), + "{report}" + ); + let (code, _, stderr) = run(&runtime, &[]); + assert_eq!(code, 0, "{stderr}"); + assert!( + stderr.contains( + "Explicit production setting platform.posture.compose-native-secret-mount at /secretProviders/file/mountPolicy." + ), + "{stderr}" + ); +} + #[tokio::test] async fn a_receipt_that_matches_passes_and_a_typo_fails_naming_the_kind() { let harness = Harness::start().await; diff --git a/crates/registry-thunderid-tooling/examples/journey-fixture/grant.rs b/crates/registry-thunderid-tooling/examples/journey-fixture/grant.rs index f4ec322e2c..7e69792eec 100644 --- a/crates/registry-thunderid-tooling/examples/journey-fixture/grant.rs +++ b/crates/registry-thunderid-tooling/examples/journey-fixture/grant.rs @@ -5,7 +5,7 @@ use std::io::{Read, Write}; use std::os::unix::fs::{DirBuilderExt, MetadataExt, OpenOptionsExt}; use std::path::{Path, PathBuf}; -use registry_platform_config::{SecretProvidersConfig, SecretReference}; +use registry_platform_config::{SecretReference, StrictSecretProvidersConfig}; use registry_platform_crypto::PrivateJwk; use registry_platform_httputil::PeerPolicy; use registry_thunderid_tooling::{ @@ -31,7 +31,7 @@ struct Connection { token_endpoint: String, client_assertion_audience: String, bootstrap_resource: String, - secret_providers: SecretProvidersConfig, + secret_providers: StrictSecretProvidersConfig, clients: BTreeMap, } diff --git a/crates/registry-thunderid-tooling/src/task_connection.rs b/crates/registry-thunderid-tooling/src/task_connection.rs index 800e808cf8..be11bff5f7 100644 --- a/crates/registry-thunderid-tooling/src/task_connection.rs +++ b/crates/registry-thunderid-tooling/src/task_connection.rs @@ -9,7 +9,9 @@ use std::collections::BTreeMap; -use registry_platform_config::{ConfigBlockErrorKind, SecretProvidersConfig, SecretReference}; +use registry_platform_config::{ + ConfigBlockErrorKind, SecretReference, StrictSecretProvidersConfig, +}; use registry_platform_yaml::{ escape_pointer_segment, ApiVersion, Decoded, Diagnostic, Document, EnvelopeRule, Expect, ExternalId, FormatSpec, Reader, RemovedKey, Report, Severity, UniqueList, Url, @@ -78,7 +80,7 @@ pub(crate) struct TaskConnection { /// assertion: an absolute URI without a fragment or user information. pub(crate) bootstrap_resource: ExternalId, /// The providers that resolve each client's `assertionKeyRef`. - pub(crate) secret_providers: SecretProvidersConfig, + pub(crate) secret_providers: StrictSecretProvidersConfig, /// The registered clients, by client id: 1 to 32. A client id is 1 to /// 64 lowercase letters, digits, or `-`, since it also names the header /// file a grant is written to. @@ -454,6 +456,22 @@ clients: ); } + #[test] + fn a_task_connection_refuses_the_compose_mount_policy() { + let text = VALID.replace( + " root: /home/operator/.task-keys\n", + " root: /home/operator/.task-keys\n mountPolicy: compose-native\n", + ); + assert_ne!(text, VALID, "the member is written"); + assert_eq!( + codes(&text), + [pair( + "config.unknown-key", + "/secretProviders/file/mountPolicy" + )] + ); + } + #[test] fn endpoints_are_https_or_loopback_http_without_a_query() { for (endpoint, accepted) in [ diff --git a/docs/site/src/content/docs/operate/deployment-posture.mdx b/docs/site/src/content/docs/operate/deployment-posture.mdx index 8ffae6cd6b..4ffca6f2c5 100644 --- a/docs/site/src/content/docs/operate/deployment-posture.mdx +++ b/docs/site/src/content/docs/operate/deployment-posture.mdx @@ -86,8 +86,10 @@ Explicit production settings are valid in every posture. They represent deliberate operator choices that relax a stricter default, such as `accessTokenType: JWT`, a custom `scopeClaim`, issuer-level `actorKind` or `clientActorKinds`, loopback HTTP issuer URLs, `private-network-plaintext` observer hook destinations in -Document Store and Registry Scheduling, or -`anonymousHttps: operator-approved` in Registry Adapter. +Document Store and Registry Scheduling, +`anonymousHttps: operator-approved` in Registry Adapter, or +`secretProviders.file.mountPolicy: compose-native`, which accepts root-owned Docker Compose +secret mounts at mode `0444` (Registry Evidence and both wallet adapters refuse it). Explicit production settings never refuse and are never diagnostics or warnings: @@ -98,7 +100,7 @@ Explicit production settings never refuse and are never diagnostics or warnings: {/* Evidence: crates/registry-platform-config/src/posture.rs, DevelopmentClass, Gated, ExplicitClass, Stated, PostureReport, ready_member, log_startup, has_denied_warnings; - crates/registry-platform-config/src/blocks.rs, DatabaseTransport; + crates/registry-platform-config/src/blocks.rs, DatabaseTransport, COMPOSE_NATIVE_SECRET_MOUNT; crates/registry-platform-config/src/caller_issuers.rs, ExplicitProductionSetting; crates/registry-platform-config/src/destination.rs, private-network-plaintext; crates/registry-cli-report/tests/envelope.rs, explicitProductionSettings. */} diff --git a/docs/site/src/content/docs/reference/render-configuration.mdx b/docs/site/src/content/docs/reference/render-configuration.mdx index de6e2011bf..ccefe92cc8 100644 --- a/docs/site/src/content/docs/reference/render-configuration.mdx +++ b/docs/site/src/content/docs/reference/render-configuration.mdx @@ -162,6 +162,7 @@ Serve and `check` report these as runtime problems at the position of the key. | `render.runtime.seal-not-bound` | A document type names a seal `signing.seals` does not bind (error). | | `render.runtime.seal-unused` | A runtime seal is named by no document type (warning). | | `render.posture.seals-not-served` | Document types name seals and the runtime has no `signing` block. Production refuses the combination. Development warns and renders the documents unsealed. | +| `platform.posture.compose-native-secret-mount` | `secretProviders.file.mountPolicy` is `compose-native`, so the file provider also accepts a root-owned, single-link file at mode `0444`, which every user in the container can read. Production accepts it as an explicit setting: `serve` logs it and `check --format json` lists it under `explicitProductionSettings`. `/ready` does not report it. | | `platform.posture.unrestricted-clients` | An issuer entry's `allowedClients` is `unrestricted`, so OIDC admits every client that issuer verifies. Production accepts it as an explicit setting: `serve` logs it and `check --format json` lists it under `explicitProductionSettings`. `/ready` does not report it. | `test-seal` reports `render.posture.test-signing` when you run it in production. diff --git a/docs/site/src/content/docs/security/breg.mdx b/docs/site/src/content/docs/security/breg.mdx index db85899f9b..eb9eaadce7 100644 --- a/docs/site/src/content/docs/security/breg.mdx +++ b/docs/site/src/content/docs/security/breg.mdx @@ -875,6 +875,13 @@ and its ancestors. Deny other write access in every posture and group write acce crates/registry-breg/tests/consent_access.rs, a_consent_scope_requires_explicit_fields_on_direct_reads_and_read_paths; crates/registry-breg/tests/package_change_plan.rs, stored_field_ceiling_widens_compiled_access_on_successor_field_changes. */} +Secret files follow the [hardening checklist](../hardening-checklist/#secret-files). The +explicit `secretProviders.file.mountPolicy: compose-native` setting lets every user in the +container read root-owned `0444` secret mounts. Write it only for a container that runs this +service alone under one runtime identity. + +{/* Evidence: crates/registry-platform-config/src/blocks.rs, COMPOSE_NATIVE_SECRET_MOUNT. */} + ## Accepted residuals The residuals are ordered by operator impact. diff --git a/docs/site/src/content/docs/security/casework.mdx b/docs/site/src/content/docs/security/casework.mdx index ce300d4488..22ec3378a0 100644 --- a/docs/site/src/content/docs/security/casework.mdx +++ b/docs/site/src/content/docs/security/casework.mdx @@ -299,6 +299,13 @@ The residuals refer to these obligations by number. (`CASEWORK-SEC-16`). Producer profiles, which are services, share one claim among themselves. +Secret files follow the [hardening checklist](../hardening-checklist/#secret-files). The +explicit `secretProviders.file.mountPolicy: compose-native` setting lets every user in the +container read root-owned `0444` secret mounts. Write it only for a container that runs this +service alone under one runtime identity. + +{/* Evidence: crates/registry-platform-config/src/blocks.rs, COMPOSE_NATIVE_SECRET_MOUNT. */} + ## Accepted residuals Each residual lists the condition, the consequence, the mitigation, and the related matrix diff --git a/docs/site/src/content/docs/security/coordinator.mdx b/docs/site/src/content/docs/security/coordinator.mdx index 150a5b50fa..f8d21c5075 100644 --- a/docs/site/src/content/docs/security/coordinator.mdx +++ b/docs/site/src/content/docs/security/coordinator.mdx @@ -927,6 +927,13 @@ The residuals refer to them by number. caller_policies_list_the_exact_subjects_they_admit, every_connection_credential_states_its_client_assertion_audience. */} +Secret files follow the [hardening checklist](../hardening-checklist/#secret-files). The +explicit `secretProviders.file.mountPolicy: compose-native` setting lets every user in the +container read root-owned `0444` secret mounts. Write it only for a container that runs this +service alone under one runtime identity. + +{/* Evidence: crates/registry-platform-config/src/blocks.rs, COMPOSE_NATIVE_SECRET_MOUNT. */} + ## Accepted residuals Each residual names the condition under which it applies, its consequence, and the mitigation. diff --git a/docs/site/src/content/docs/security/documents.mdx b/docs/site/src/content/docs/security/documents.mdx index 58aa1cf5fd..9c19416504 100644 --- a/docs/site/src/content/docs/security/documents.mdx +++ b/docs/site/src/content/docs/security/documents.mdx @@ -223,6 +223,13 @@ The guarantees hold only when you meet these obligations. an_exhausted_transfer_budget_refuses_uploads_and_downloads; crates/registry-documents/src/config.rs allow_insecure_http. */} +Secret files follow the [hardening checklist](../hardening-checklist/#secret-files). The +explicit `secretProviders.file.mountPolicy: compose-native` setting lets every user in the +container read root-owned `0444` secret mounts. Write it only for a container that runs this +service alone under one runtime identity. + +{/* Evidence: crates/registry-platform-config/src/blocks.rs, COMPOSE_NATIVE_SECRET_MOUNT. */} + ## Accepted residuals Related rows are the neighbouring enforced behaviour, not the residual itself. diff --git a/docs/site/src/content/docs/security/evidence.mdx b/docs/site/src/content/docs/security/evidence.mdx index ab3ddf3b30..1229548ba5 100644 --- a/docs/site/src/content/docs/security/evidence.mdx +++ b/docs/site/src/content/docs/security/evidence.mdx @@ -501,6 +501,12 @@ holds the duties no service-side control can hold for you: products/evidence/contracts/runtime.schema.yaml, secretProviders; crates/registry-evidence/src/bundle.rs, validate_read_only. */} +Registry Evidence and both wallet adapters refuse `secretProviders.file.mountPolicy`, so their +key files keep the owner-only rule on Docker Compose too. See the +[hardening checklist](../hardening-checklist/#secret-files). + +{/* Evidence: crates/registry-evidence/src/config.rs, COMPOSE_NATIVE_REFUSED_ACTION. */} + ## Report a vulnerability Report a suspected vulnerability through the process in diff --git a/docs/site/src/content/docs/security/hardening-checklist.mdx b/docs/site/src/content/docs/security/hardening-checklist.mdx index d14ae2b4f1..8f13456ea9 100644 --- a/docs/site/src/content/docs/security/hardening-checklist.mdx +++ b/docs/site/src/content/docs/security/hardening-checklist.mdx @@ -137,12 +137,22 @@ refusal holds in development. Production refuses all of them. regular file with one link and mode exactly `0444` under the declared root. Every user in the container can read such a file, so use it in a container that runs one service under one runtime identity. Startup and the production check report the setting as - `platform.posture.compose-native-secret-mount`. Writable files, other owners, extra links and - paths outside the root stay refused. The + `platform.posture.compose-native-secret-mount`, and the `provision` tools print it when they + read the runtime file. Writable files, other owners, extra links and paths outside the root + stay refused. A runtime that runs as root gains only the `0444` shape: stage its own files at + `0400` or `0600`, because a root-owned `0440` file is still refused. Registry Evidence and both + wallet adapters refuse the setting, since their key rule never lets other users read a key + file. Saved CLI connections and task connection files do not accept it. + The [Messaging Compose setup](../../operate/messaging/#mount-secret-files-with-docker-compose) shows both routes. {/* Evidence: crates/registry-evidence/src/bundle.rs, validate_secret_root; + crates/registry-platform-config/src/blocks.rs, COMPOSE_NATIVE_SECRET_MOUNT, StrictSecretProvidersConfig; + crates/registry-platform-config/src/secrets_tests.rs, compose_native_adds_only_root_owned_single_link_mode_0444; + crates/registry-platform-config/src/blocks_tests.rs, compose_native_mount_is_an_explicit_production_setting_at_its_member; + crates/registry-evidence/src/config.rs, COMPOSE_NATIVE_REFUSED_ACTION; + crates/registry-platform-provision/src/cli.rs, the_runtime_file_explicit_settings_are_printed_on_stderr; deploy/helm/registry-stack/templates/evidence-deployment.yaml, stage-evidence-inputs; deploy/helm/registry-stack/README.md, Images and workload security. */} @@ -156,7 +166,9 @@ changes which keys or certificates your deployment trusts. runtime then reads it under `secretProviders.file.root` with the walk, owner and link rules of a secret, but group and other may read it. A root-owned Compose mount at mode `0444` needs no setting. Group or other write access, an execute bit, another owner or a second link is still - refused. The runtime still parses the JWKS or PEM before use. + refused, with a fix worded for a public document. A file that holds a PEM private key block is + refused, and a key set with a private or symmetric member is refused, so key material staged in + the wrong file never loads. The runtime still parses the JWKS or PEM before use. - If a runtime checks its configuration path with the shared trusted path rule, give it an absolute, normalised path without symbolic links. In production, root or the runtime user must own the file and its ancestors. Clear group and other write access. The rule permits a root-owned sticky @@ -165,9 +177,11 @@ changes which keys or certificates your deployment trusts. product's production configuration check, then confirm readiness. To verify a CA or key set, also exercise an operation that connects to the configured peer or verifies its token. -{/* Evidence: crates/registry-platform-config/src/blocks.rs, JwksSource, DatabaseConfig; +{/* Evidence: crates/registry-platform-config/src/blocks.rs, JwksSource, DatabaseConfig, DatabaseMember; crates/registry-platform-config/src/loader.rs, require_trusted_runtime_path; - crates/registry-platform-config/src/secrets.rs, SecretResolver, resolve_public_document, open_secret_file. */} + crates/registry-platform-config/src/secrets.rs, SecretResolver, resolve_public_document, open_secret_file; + crates/registry-platform-config/src/secrets_tests.rs, a_public_document_drops_only_the_read_checks, a_public_document_holding_a_private_key_is_refused; + crates/registry-breg/src/action_evidence_config.rs, public_jwks_document. */} ## Check BReg and Casework authority diff --git a/docs/site/src/content/docs/security/render.mdx b/docs/site/src/content/docs/security/render.mdx index 1a5e076457..238998c31c 100644 --- a/docs/site/src/content/docs/security/render.mdx +++ b/docs/site/src/content/docs/security/render.mdx @@ -217,6 +217,13 @@ rules only. crates/registry-render/src/pdf_signature.rs sealable_holds_pdf_a_1_2_and_3_to_their_string_length_limits. */} +Secret files follow the [hardening checklist](../hardening-checklist/#secret-files). The +explicit `secretProviders.file.mountPolicy: compose-native` setting lets every user in the +container read root-owned `0444` secret mounts. Write it only for a container that runs this +service alone under one runtime identity. + +{/* Evidence: crates/registry-platform-config/src/blocks.rs, COMPOSE_NATIVE_SECRET_MOUNT. */} + ## How refusals are recorded For OIDC bearer requests, Render matches the exact entry in `authentication.oidc.issuers`. diff --git a/docs/site/src/content/docs/security/scheduling.mdx b/docs/site/src/content/docs/security/scheduling.mdx index 85bc2bda3d..ee594067b7 100644 --- a/docs/site/src/content/docs/security/scheduling.mdx +++ b/docs/site/src/content/docs/security/scheduling.mdx @@ -202,6 +202,13 @@ The guarantees hold only when you meet these obligations. crates/registry-schedulingctl/tests/activation_postgres.rs an_apply_whose_response_audit_entry_is_refused_reports_it_applied_unaudited. */} +Secret files follow the [hardening checklist](../hardening-checklist/#secret-files). The +explicit `secretProviders.file.mountPolicy: compose-native` setting lets every user in the +container read root-owned `0444` secret mounts. Write it only for a container that runs this +service alone under one runtime identity. + +{/* Evidence: crates/registry-platform-config/src/blocks.rs, COMPOSE_NATIVE_SECRET_MOUNT. */} + ## Accepted residuals Each residual names the condition under which it applies, its consequence, the operator diff --git a/products/adapter/schemas/job-runtime.v1alpha1.schema.json b/products/adapter/schemas/job-runtime.v1alpha1.schema.json index 43fe2b3acf..65edca9821 100644 --- a/products/adapter/schemas/job-runtime.v1alpha1.schema.json +++ b/products/adapter/schemas/job-runtime.v1alpha1.schema.json @@ -125,7 +125,7 @@ "properties": { "mountPolicy": { "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", "x-registry-explicit-production": [ "platform.posture.compose-native-secret-mount" ] diff --git a/products/adapter/schemas/runtime.v1alpha1.schema.json b/products/adapter/schemas/runtime.v1alpha1.schema.json index 757a51fcb0..1292518000 100644 --- a/products/adapter/schemas/runtime.v1alpha1.schema.json +++ b/products/adapter/schemas/runtime.v1alpha1.schema.json @@ -308,7 +308,7 @@ "properties": { "mountPolicy": { "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", "x-registry-explicit-production": [ "platform.posture.compose-native-secret-mount" ] diff --git a/products/breg/CHANGELOG.md b/products/breg/CHANGELOG.md index dcedadc563..e47f5529d5 100644 --- a/products/breg/CHANGELOG.md +++ b/products/breg/CHANGELOG.md @@ -5,6 +5,8 @@ - Record and read-path permissions can select stored fields with `readableFields.upToClassification`. Consent-gated permissions require explicit fields. +- The Evidence provider `trustedJwksRef` key set is read as a public document + and refused when it holds a private or symmetric member. ## 0.49.0 - 2026-12-01 diff --git a/products/breg/generated/mcp-runtime/mcp-runtime.schema.json b/products/breg/generated/mcp-runtime/mcp-runtime.schema.json index 9c6e2a9ba6..670c75ac18 100644 --- a/products/breg/generated/mcp-runtime/mcp-runtime.schema.json +++ b/products/breg/generated/mcp-runtime/mcp-runtime.schema.json @@ -224,7 +224,7 @@ "properties": { "mountPolicy": { "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", "x-registry-explicit-production": [ "platform.posture.compose-native-secret-mount" ] diff --git a/products/breg/generated/review-runtime/review-runtime.schema.json b/products/breg/generated/review-runtime/review-runtime.schema.json index f6e1dbce9b..17e32d145f 100644 --- a/products/breg/generated/review-runtime/review-runtime.schema.json +++ b/products/breg/generated/review-runtime/review-runtime.schema.json @@ -129,7 +129,7 @@ "properties": { "mountPolicy": { "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", "x-registry-explicit-production": [ "platform.posture.compose-native-secret-mount" ] diff --git a/products/breg/generated/runtime/runtime.schema.json b/products/breg/generated/runtime/runtime.schema.json index 78313319d4..d147742477 100644 --- a/products/breg/generated/runtime/runtime.schema.json +++ b/products/breg/generated/runtime/runtime.schema.json @@ -718,7 +718,7 @@ "properties": { "mountPolicy": { "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", "x-registry-explicit-production": [ "platform.posture.compose-native-secret-mount" ] diff --git a/products/casework/generated/runtime/runtime.schema.json b/products/casework/generated/runtime/runtime.schema.json index 6608e9dee5..9a872c2c64 100644 --- a/products/casework/generated/runtime/runtime.schema.json +++ b/products/casework/generated/runtime/runtime.schema.json @@ -554,7 +554,7 @@ "properties": { "mountPolicy": { "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", "x-registry-explicit-production": [ "platform.posture.compose-native-secret-mount" ] diff --git a/products/coordinator/generated/runtime/runtime.schema.json b/products/coordinator/generated/runtime/runtime.schema.json index b87878db7e..26f0669f7e 100644 --- a/products/coordinator/generated/runtime/runtime.schema.json +++ b/products/coordinator/generated/runtime/runtime.schema.json @@ -781,7 +781,7 @@ "properties": { "mountPolicy": { "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", "x-registry-explicit-production": [ "platform.posture.compose-native-secret-mount" ] diff --git a/products/documents/generated/runtime/runtime.schema.json b/products/documents/generated/runtime/runtime.schema.json index 9d29d68160..f3a7eeec38 100644 --- a/products/documents/generated/runtime/runtime.schema.json +++ b/products/documents/generated/runtime/runtime.schema.json @@ -307,7 +307,7 @@ "properties": { "mountPolicy": { "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", "x-registry-explicit-production": [ "platform.posture.compose-native-secret-mount" ] diff --git a/products/evidence/CHANGELOG.md b/products/evidence/CHANGELOG.md index d07ee62f37..4b4e5beaf4 100644 --- a/products/evidence/CHANGELOG.md +++ b/products/evidence/CHANGELOG.md @@ -2,6 +2,11 @@ ## Unreleased +- Evidence, the OID4VCI delivery service and the OID4VP verifier refuse + `secretProviders.file.mountPolicy`, keeping the Version 1 rule that a key + file is never readable by other users. `evidencectl doctor` reports the same + refusal, and the store-provision document does not accept the member. + ## 0.49.0 - 2026-12-01 - BREAKING: Evidence project, bundle, authority, audit, and client lookup declarations use `lookups` and single references use `lookup`. Migration: From v0.48.0, keep the previous binary, bundle, runtime file, authority store, and the active and numeric sealed files for both the service audit and its activation companion (`evidence.jsonl` and `evidence.activation.jsonl` for an `audit.path` of `evidence.jsonl`). Read authority with the v0.48.0 `evidence authority history --runtime-config OLD_RUNTIME`. Inspect the production audit JSON Lines using the matching release's audit schema and activation contract. Copy the authored project and target without the generated authority state. Set fresh `package.root` and `audit.path` values in the copy before packaging, and preserve or explicitly bind its referenced secrets and source extract. Rename `selectorProfiles` to `lookups` and `selectorProfile` (Python `selector_profile`) to `lookup` where the contract renamed those fields. Migrate the target issuer into `authentication.oidc.issuers`. Run `evidencectl package --target TARGET --output CANDIDATE PROJECT` and install the rebuilt bundle at the new package root. The fresh authority root is derived from the copied target directory. Run `evidence authority activate --runtime-config FILE --document CANDIDATE/compiled-authority.yaml`. Confirm sequence 1 in `evidence authority history --runtime-config FILE`, run `evidence check --runtime-config FILE --require-runtime-dependencies`, and start Evidence with `evidence serve --runtime-config FILE`. Verify a fresh signed assertion, its access and disclosure records in the new service stream, and the activation pair in the new activation companion before resuming traffic. diff --git a/products/evidence/generated/oid4vci-runtime/oid4vci-runtime.schema.json b/products/evidence/generated/oid4vci-runtime/oid4vci-runtime.schema.json index 75b9566696..834ebdc45e 100644 --- a/products/evidence/generated/oid4vci-runtime/oid4vci-runtime.schema.json +++ b/products/evidence/generated/oid4vci-runtime/oid4vci-runtime.schema.json @@ -184,7 +184,7 @@ "properties": { "mountPolicy": { "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", "x-registry-explicit-production": [ "platform.posture.compose-native-secret-mount" ] diff --git a/products/evidence/generated/oid4vp-runtime/oid4vp-runtime.schema.json b/products/evidence/generated/oid4vp-runtime/oid4vp-runtime.schema.json index 959afaf9eb..db104eb886 100644 --- a/products/evidence/generated/oid4vp-runtime/oid4vp-runtime.schema.json +++ b/products/evidence/generated/oid4vp-runtime/oid4vp-runtime.schema.json @@ -311,7 +311,7 @@ "properties": { "mountPolicy": { "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", "x-registry-explicit-production": [ "platform.posture.compose-native-secret-mount" ] diff --git a/products/messaging/generated/runtime/runtime.schema.json b/products/messaging/generated/runtime/runtime.schema.json index 3b883e4755..98672fd462 100644 --- a/products/messaging/generated/runtime/runtime.schema.json +++ b/products/messaging/generated/runtime/runtime.schema.json @@ -290,7 +290,7 @@ "properties": { "mountPolicy": { "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", "x-registry-explicit-production": [ "platform.posture.compose-native-secret-mount" ] diff --git a/products/platform/CHANGELOG.md b/products/platform/CHANGELOG.md index 0226f3a293..7cbb89c3c3 100644 --- a/products/platform/CHANGELOG.md +++ b/products/platform/CHANGELOG.md @@ -7,15 +7,27 @@ - The file secret provider accepts `mountPolicy: compose-native`, an explicit production setting that also admits a root-owned, single-link regular file with mode exactly `0444`, the Docker Compose secret mount shape, under the - declared root. Startup and `check` report + declared root. Startup, `check` (including `registry-mcp check` and + `registry-session check`) and the `provision` tools report `platform.posture.compose-native-secret-mount`. The default rule still refuses that shape, and writable files, other owners, extra links and paths - outside the root stay refused in every case. -- Every runtime reads a static JWKS (`jwksSource.documentRef`) and every CA - bundle (`caBundleRef`, Messaging `tlsTrustProfiles.*.bundleRef`) as a public - document: group and other may read the file, with no setting. Owner, link, - write and walk checks still apply, and the document is still parsed before - use. + outside the root stay refused in every case. Registry Evidence and both + wallet adapters refuse the setting, and saved CLI connections and task + connection files do not accept it. +- Every runtime reads a static JWKS (`jwksSource.documentRef`, BReg + `trustedJwksRef`) and every CA bundle (`caBundleRef`, Messaging + `tlsTrustProfiles.*.bundleRef`) as a public document, and so do the + `provision` tools for `database.caBundleRef`: group and other may read the + file, with no setting. Owner, link, write and walk checks still apply, and + the document is still parsed before use. A public document that holds a PEM + private key block is refused, and a refused public document is described + with public-document wording. +- BREAKING for Rust callers of `registry-platform-config`: `SecretError` gains + `UnsafePublicDocument` and `PrivateKeyInPublicDocument`, and + `ProvisionInput` gains `explicit_settings`. Migration: add arms for the two + variants to exhaustive matches (`SecretFileCheck::public_message` and + `public_suggested_action` give their text), and fill `explicit_settings` + from `PostureReport::explicit_setting_notices`. - Numbered releases ship `registry-session` for Linux amd64, Linux arm64 and macOS arm64. It is a standalone release asset: `rstack` does not install it, and it has no installer or container image. Upgrade: `rstack update` from diff --git a/products/platform/generated/mcp-runtime/mcp-runtime.schema.json b/products/platform/generated/mcp-runtime/mcp-runtime.schema.json index be01339097..0d59c64a31 100644 --- a/products/platform/generated/mcp-runtime/mcp-runtime.schema.json +++ b/products/platform/generated/mcp-runtime/mcp-runtime.schema.json @@ -312,7 +312,7 @@ "properties": { "mountPolicy": { "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", "x-registry-explicit-production": [ "platform.posture.compose-native-secret-mount" ] diff --git a/products/platform/generated/runtime-config-blocks.schema.json b/products/platform/generated/runtime-config-blocks.schema.json index 508178e1dc..fb523197a7 100644 --- a/products/platform/generated/runtime-config-blocks.schema.json +++ b/products/platform/generated/runtime-config-blocks.schema.json @@ -591,7 +591,7 @@ "properties": { "mountPolicy": { "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", "x-registry-explicit-production": [ "platform.posture.compose-native-secret-mount" ] diff --git a/products/platform/generated/session-runtime/session-runtime.schema.json b/products/platform/generated/session-runtime/session-runtime.schema.json index 2db6d6be04..2b746747f8 100644 --- a/products/platform/generated/session-runtime/session-runtime.schema.json +++ b/products/platform/generated/session-runtime/session-runtime.schema.json @@ -147,7 +147,7 @@ "properties": { "mountPolicy": { "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", "x-registry-explicit-production": [ "platform.posture.compose-native-secret-mount" ] diff --git a/products/platform/schemas/task-connection.schema.json b/products/platform/schemas/task-connection.schema.json index 1c20d44531..16110d47f3 100644 --- a/products/platform/schemas/task-connection.schema.json +++ b/products/platform/schemas/task-connection.schema.json @@ -12,19 +12,17 @@ "pattern": "^[^\\u0000-\\u001F\\u007F-\\u009F]+$", "type": "string" }, - "FileSecretProviderConfig": { + "SecretReference": { + "description": "An exact secret reference: secret:file/name, resolved under secretProviders.file.root, or secret:env/NAME, resolved only when secretProviders.environment is declared.", + "pattern": "^(?:secret:env/[A-Z][A-Z0-9_]{0,127}|secret:file/[a-z][a-z0-9._-]{0,127})$", + "type": "string" + }, + "StrictFileSecretProviderConfig": { "additionalProperties": false, - "description": "The file secret provider.", + "description": "The file secret provider of an operator-local file.", "properties": { - "mountPolicy": { - "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", - "x-registry-explicit-production": [ - "platform.posture.compose-native-secret-mount" - ] - }, "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe user running the tool with mode 0400 or 0600, or owned by root with\nno access beyond group read (0440 or 0640) when that user is not root.\nA command that declared development loads a file with looser read or\nmode bits and logs a warning.", "pattern": "^/", "type": "string" } @@ -34,19 +32,13 @@ ], "type": "object" }, - "SecretMountPolicy": { - "enum": [ - "compose-native" - ], - "type": "string" - }, - "SecretProvidersConfig": { + "StrictSecretProvidersConfig": { "additionalProperties": false, "anyOf": [ { "properties": { "file": { - "$ref": "#/$defs/FileSecretProviderConfig" + "$ref": "#/$defs/StrictFileSecretProviderConfig" } }, "required": [ @@ -64,24 +56,19 @@ ] } ], - "description": "The secret providers a runtime enables. A reference is resolved only by a\nprovider declared here: `secret:file/name` under `file.root`, and\n`secret:env/NAME` only when `environment: {}` is present.", + "description": "The secret providers of an operator-local file read outside any runtime,\nsuch as a saved CLI connection or a task connection. It enables the same\nproviders as a runtime's `secretProviders` without the Compose mount\npolicy: nothing reports an explicit production setting for these files,\nso the strict file rule always applies.", "properties": { "environment": { "$ref": "#/$defs/EnvironmentSecretProviderConfig", "description": "Enables `secret:env/NAME` references, read from the process\nenvironment. Declared as an empty mapping: `environment: {}`." }, "file": { - "$ref": "#/$defs/FileSecretProviderConfig", + "$ref": "#/$defs/StrictFileSecretProviderConfig", "description": "Enables `secret:file/name` references, read from files under `root`." } }, "type": "object" }, - "SecretReference": { - "description": "An exact secret reference: secret:file/name, resolved under secretProviders.file.root, or secret:env/NAME, resolved only when secretProviders.environment is declared.", - "pattern": "^(?:secret:env/[A-Z][A-Z0-9_]{0,127}|secret:file/[a-z][a-z0-9._-]{0,127})$", - "type": "string" - }, "TaskClient": { "additionalProperties": false, "description": "One registered client.", @@ -194,7 +181,7 @@ "type": "string" }, "secretProviders": { - "$ref": "#/$defs/SecretProvidersConfig", + "$ref": "#/$defs/StrictSecretProvidersConfig", "description": "The providers that resolve each client's `assertionKeyRef`." }, "tokenEndpoint": { diff --git a/products/render/schemas/runtime.schema.json b/products/render/schemas/runtime.schema.json index a88318513b..2d93323b55 100644 --- a/products/render/schemas/runtime.schema.json +++ b/products/render/schemas/runtime.schema.json @@ -179,7 +179,7 @@ "properties": { "mountPolicy": { "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", "x-registry-explicit-production": [ "platform.posture.compose-native-secret-mount" ] diff --git a/products/scheduling/generated/runtime/runtime.schema.json b/products/scheduling/generated/runtime/runtime.schema.json index 7e108ef536..1a2795d840 100644 --- a/products/scheduling/generated/runtime/runtime.schema.json +++ b/products/scheduling/generated/runtime/runtime.schema.json @@ -334,7 +334,7 @@ "properties": { "mountPolicy": { "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Absent, the stricter rule\nabove applies.", + "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", "x-registry-explicit-production": [ "platform.posture.compose-native-secret-mount" ] From 2bbef8d33a43343f2f5acdde1b3b11cfbe3b8f90 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 23/55] fix(deploy): make the business registration reference host runnable as written Folds these reviewed commits: - test(evidence-oid4vci): write the schema test's reference offers as issuer entries - fix(preview): load business registration assets by relative URL - fix(deploy): assign reference registrars through service roles - test(deploy): run the reference host's Node tests in the deployment suite - docs(deploy): make the business registration reference runnable as written - fix(deploy): keep issuer key material read-only and PostgreSQL unprivileged - docs(deploy): correct the reference steps a Compose run exposed Signed-off-by: Jeremi Joslin --- .../registry-evidence-oid4vci/src/schema.rs | 27 ++- .../examples/business-registration/README.md | 196 +++++++++++++++--- .../business-registration/compose.yaml | 10 +- .../examples/business-registration/host.mjs | 10 +- .../identity-deployment.yaml | 14 +- .../business-registration/service.yaml | 9 + .../business-registration/tests/host.test.mjs | 4 + .../tests/test_compose.py | 11 + .../tests/test_host_node.py | 35 ++++ .../tests/test_page_assets.py | 34 +++ .../web/public/index.html | 4 +- 11 files changed, 299 insertions(+), 55 deletions(-) create mode 100644 deploy/examples/business-registration/service.yaml create mode 100644 deploy/examples/business-registration/tests/test_host_node.py create mode 100644 deploy/examples/business-registration/tests/test_page_assets.py diff --git a/crates/registry-evidence-oid4vci/src/schema.rs b/crates/registry-evidence-oid4vci/src/schema.rs index c38d313e1b..0e6d3658ec 100644 --- a/crates/registry-evidence-oid4vci/src/schema.rs +++ b/crates/registry-evidence-oid4vci/src/schema.rs @@ -156,13 +156,20 @@ mod tests { "clientAssertionAudience": "https://mint.example.org" }, "offers": { - "issuer": "https://mint.example.org", - "jwksUri": "https://mint.example.org/.well-known/jwks.json", - "audiences": ["https://wallet.example.org"], - "algorithms": ["EdDSA"], - "allowedClients": ["adopter-front-end"], - "requiredScopes": ["oid4vci:offer"], - "maximumTokenLifetimeSeconds": 900 + "issuers": { + "primary": { + "issuer": "https://mint.example.org", + "jwksSource": { + "type": "uri", + "uri": "https://mint.example.org/.well-known/jwks.json" + }, + "audience": "https://wallet.example.org", + "algorithms": ["EdDSA"], + "allowedClients": ["adopter-front-end"], + "maximumTokenLifetimeSeconds": 900 + } + }, + "requiredScopes": ["oid4vci:offer"] }, "store": { "maximumOffers": 4096, @@ -218,7 +225,7 @@ mod tests { document["tokenClient"]["privateKeyRef"] = Value::from("/run/secrets/client.jwk") })); assert!(refused(&|document| { - document["offers"]["allowedClients"] = serde_json::json!([]) + document["offers"]["issuers"]["primary"]["allowedClients"] = serde_json::json!([]) })); assert!(refused(&|document| { document["offers"]["requiredScopes"] = Value::from("anything") @@ -230,13 +237,13 @@ mod tests { .remove("requiredScopes"); })); assert!(refused(&|document| { - document["offers"]["audiences"] = serde_json::json!(["a", "a"]) + document["offers"]["issuers"] = serde_json::json!({}) })); assert!(refused(&|document| { document["store"]["maximumOffers"] = Value::from(255) })); assert!(!refused(&|document| { - document["offers"]["allowedClients"] = Value::from("unrestricted") + document["offers"]["issuers"]["primary"]["allowedClients"] = Value::from("unrestricted") })); } diff --git a/deploy/examples/business-registration/README.md b/deploy/examples/business-registration/README.md index f0e58f1a3e..09e4627685 100644 --- a/deploy/examples/business-registration/README.md +++ b/deploy/examples/business-registration/README.md @@ -3,8 +3,10 @@ Run the business-registration preview's compiled function and static page with Registry Session, Envoy, ThunderID, BReg and PostgreSQL. The application opens at `https://127.0.0.1:8443/apply/`. Use a disposable project and synthetic -registrars. The example uses production posture and verified TLS with loopback -host bindings. +registrars. The example uses production posture and loopback host bindings. +Product, Session and database connections use verified TLS. Two issuer hops on +internal Docker networks are plain HTTP, as described in +[Plain HTTP issuer hops](#plain-http-issuer-hops). The browser receives an opaque Session cookie. Envoy checks it and supplies the registrar's access token on the private function and registry routes. @@ -12,19 +14,55 @@ The function uses that token for the existing BReg Action. BReg applies its own access profile, issuer, scope and row rules. The Node host has read-only bundle files and no database or issuer credentials. +## Plain HTTP issuer hops + +The edge terminates issuer TLS at `127.0.0.1:9443`. Behind it, two hops carry +issuer traffic as plain HTTP: + +- The edge sends issuer requests to `identity-gateway:8080` on the + `issuer-front` network. +- The identity gateway sends them to ThunderID on port 8090 on the + `identity-backend` network. ThunderID also listens on the + `identity-database` network, which it shares with PostgreSQL. + +These hops carry registrar passwords from the sign-in form, the Session client +secret, authorization codes, and access, ID and refresh tokens. The reference +accepts them because each network is internal, has only those members, and +every container drops all capabilities. The generated front gateway addresses +ThunderID by its service name, `thunderid:8090`, so the gateway cannot share +ThunderID's network namespace without putting plain ThunderID on the edge's +network. Treat any process that can join these networks as able to read issuer +traffic. A deployment across hosts needs TLS on both hops. + +Other reach is wider than the function needs: + +- The function host shares BReg's network namespace, so it can reach + `postgres:5432`. `pg_hba.conf` admits any role over TLS, including the + `postgres` superuser, from any address on the database network. +- The `ingress` network is not internal, so the Session and gateway namespace + has outbound internet access. +- The Node host accepts any well-formed bearer token on its private function + route. Any host process running as `REFERENCE_UID` can connect to the relay + sockets directly. BReg still verifies every token, so such a caller gains no + registry authority. + ## Prepare the deployment inputs -Use Docker Compose v2 on Linux amd64. Set `RECIPE` to the absolute path of this -directory and prepare a fresh private directory for `REFERENCE_CONFIG`. Stage -`breg`, `bregctl` and `registry-session` in `REFERENCE_ARTIFACTS`. Verify the -matching BReg release binaries against their manifest. Use a matching native -Session binary verified against the local candidate's artifact receipt until -Session is available in a numbered release. +Use Linux amd64 with Docker Engine, the Compose v2 plugin, `openssl`, `curl`, +`jq` and root access through `sudo` for the ownership step. The host test also +needs Node.js 24 with npm, and the two-person browser check needs Playwright. +Set `RECIPE` to the absolute path of this directory and prepare a fresh private +directory for `REFERENCE_CONFIG`. + +Use Registry Stack v0.51.0 or later. From v0.51.0, numbered releases ship +`registry-session` as a standalone asset beside the `rstack` installer. Stage +`breg`, `bregctl` and `registry-session` from the same release in +`REFERENCE_ARTIFACTS`, and verify each against the release manifest. Set these inputs in your shell and in a Compose environment file. Use absolute paths. Set `REFERENCE_UID` and `REFERENCE_GID` if the nonroot owner of these -inputs differs from 1000. Both Envoy relays use this same UID. Each Compose -project needs its own input, audit, checked-config and socket directories. +inputs differs from 1000. Both Envoy relays use this same UID. Run one instance +per host: the host ports 8443 and 9443 are fixed. | Variable | Value | | --- | --- | @@ -33,13 +71,32 @@ project needs its own input, audit, checked-config and socket directories. | `BUSINESS_BUNDLE` | Build output of the business-registration preview | | `BUSINESS_BUNDLE_SHA256` | Runtime file digest of the reviewed preview build | -Generate the preview bundle with the matching preview builder. The recipe uses -its `manifest.json`, `functions/register-business.mjs`, and the three files in +Build the preview bundle by starting the preview with `rstack dev`. Set +`PREVIEW` to the `products/platform/examples/service-previews/business-registration` +directory of the release source and `BUSINESS_BUNDLE` to a new empty directory. +The run writes its compiled preview into an `application-preview` directory +under its state directory. Copy the files before you stop the run. + +```bash +RSTACK_DEV_STATE_DIR=$(mktemp -d) +export RSTACK_DEV_STATE_DIR +(cd "$PREVIEW" && rstack dev start . --ttl 30m) | tee "$RSTACK_DEV_STATE_DIR/run.txt" +run=$(awk '$1 == "Run" {print $2}' "$RSTACK_DEV_STATE_DIR/run.txt") +built=$(find "$RSTACK_DEV_STATE_DIR" -type d -path "*$run*" -name application-preview) +static=$(jq -r .staticOutput "$built/manifest.json") +install -d "$BUSINESS_BUNDLE/functions" "$BUSINESS_BUNDLE/$static" +install -m 0644 "$built/manifest.json" "$BUSINESS_BUNDLE/" +install -m 0644 "$built/functions/register-business.mjs" "$BUSINESS_BUNDLE/functions/" +install -m 0644 "$built/$static/"{index.html,app.js,service.css} "$BUSINESS_BUNDLE/$static/" +rstack dev stop --clean "$run" +``` + +The recipe uses the bundle's `manifest.json`, `functions/register-business.mjs`, and the three files in the manifest's `staticOutput` directory, `index.html`, `app.js` and -`service.css`. Use a build whose page references its assets by relative URL so -the same page can run under `/apply/`. The digest covers each of these five -files and its relative path. Derive it once from the reviewed build, then -include that value in the instance's input file. +`service.css`. The page loads its assets by relative URL, so the same page +runs at `/` under `rstack dev` and at `/apply/` here. The digest covers each of +these five files and its relative path. Derive it once from the reviewed build, +then include that value in the instance's input file. ```bash bundle_host=$(docker build --quiet "$RECIPE") @@ -50,7 +107,10 @@ docker run --rm --network none \ Name the sealed BReg package from that preview project in both BReg inputs. Follow the [BReg test and package steps](../../../docs/site/src/content/docs/operate/breg.mdx) -with a separate schema-test database. Use the same package and recorded digest +with a separate schema-test database. The reference issuer is not running yet, +so give the test runtime a static JWKS (`jwksSource.documentRef`) for a +synthetic signing key and sign the schema-test tokens with that key. Use the +same package and recorded digest for activation and serving. Set `BREG_PACKAGE_DIGEST` in your shell from the package receipt. @@ -72,10 +132,34 @@ package receipt. | `gateway/envoy.json` | Reviewed complete Envoy configuration from the matching Session CLI | | `gateway-checked/`, `relay/`, `breg/audit/`, `session/audit/` | Empty private directories owned by the instance UID | +Make the three TLS pairs from one disposable CA. Keep the CA key in a private +directory outside `REFERENCE_CONFIG`, set as `REFERENCE_CA`. + +```bash +umask 077 +mkdir -p "$REFERENCE_CA" "$REFERENCE_CONFIG"/{app-tls,issuer-tls,postgres,trust} +ca="$REFERENCE_CA/reference-ca" +openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 -nodes -days 30 \ + -subj "/CN=Business registration reference CA" \ + -addext basicConstraints=critical,CA:TRUE -addext keyUsage=critical,keyCertSign,cRLSign \ + -keyout "$ca.key" -out "$ca.pem" +issue() { # issue DIRECTORY NAME SUBJECT_ALT_NAME + openssl req -newkey ec -pkeyopt ec_paramgen_curve:P-256 -nodes -subj "/CN=$2" \ + -keyout "$1/$2.key" -out "$REFERENCE_CA/$2.csr" + openssl x509 -req -in "$REFERENCE_CA/$2.csr" -CA "$ca.pem" -CAkey "$ca.key" -days 30 \ + -extfile <(printf 'subjectAltName=%s\nextendedKeyUsage=serverAuth\nbasicConstraints=critical,CA:FALSE\n' "$3") \ + -out "$1/$2.crt" +} +issue "$REFERENCE_CONFIG/app-tls" app IP:127.0.0.1 +issue "$REFERENCE_CONFIG/issuer-tls" issuer DNS:identity.reference.test +issue "$REFERENCE_CONFIG/postgres" server DNS:postgres +install -m 0644 "$ca.pem" "$REFERENCE_CONFIG/trust/https-ca.pem" +install -m 0644 "$ca.pem" "$REFERENCE_CONFIG/trust/postgres-ca.pem" +chmod 0755 "$REFERENCE_CONFIG/trust" +``` + The Session client secret equals `REGISTRAR_CLIENT_SECRET`. Both ThunderID `DB_CONFIG_PASSWORD` files carry the value in `postgres/thunderid-password`. -The PostgreSQL files must be readable by the image's UID 999 and the -ThunderID secrets by UID 10001. Give private keys and secret files mode 0600. Use distinct random values for admin, both registrar passwords, database and audit credentials. BReg URLs target `postgres:5432`; runtime and migration use different roles and @@ -84,12 +168,29 @@ passwords and point at the same registry database. BReg's CA file carries `identity.reference.test` to `127.0.0.1` and trust the HTTPS CA. Generate the issuer inputs with the matching `rstack identity generate thunderid` -command and [identity-deployment.yaml](identity-deployment.yaml). Use the -preview's BReg project and a host-side copy of the BReg runtime file whose -package and secret-provider roots exist and are readable. The private resource -files carry references to the secret names above. Stage the generated -`resources/`, `front-gateway/` and `identity-receipt.json` at the paths in the -table. Merge the generated ThunderID store settings into the serving deployment +command, [identity-deployment.yaml](identity-deployment.yaml) and the registrar +role in [service.yaml](service.yaml). Use the preview's BReg project and a +host-side copy of the BReg runtime file whose package and secret-provider roots +point at the staged admin inputs. Check the runtime as a production runtime and +pin the expected issuer. The private resource files carry references to the +secret names above. + +```bash +identity_work=$(mktemp -d) +sed -e "s|/run/breg/secrets|$REFERENCE_CONFIG/breg/admin/secrets|" \ + -e "s|/run/breg/package|$REFERENCE_CONFIG/breg/admin/package|" \ + "$REFERENCE_CONFIG/breg/admin/runtime.yaml" >"$identity_work/breg-runtime.yaml" +rstack identity generate thunderid --deployment "$RECIPE/identity-deployment.yaml" \ + --breg-project "$PREVIEW/project" --breg-runtime-config "$identity_work/breg-runtime.yaml" \ + --breg-production --expected-issuer https://identity.reference.test:9443 \ + --output "$identity_work/generated" +install -d -m 0700 "$REFERENCE_CONFIG/thunderid/resources" "$REFERENCE_CONFIG/thunderid/front-gateway" +install -m 0600 "$identity_work/generated/resources/resources.yaml" "$REFERENCE_CONFIG/thunderid/resources/" +install -m 0600 "$identity_work/generated/front-gateway/envoy.yaml" "$REFERENCE_CONFIG/thunderid/front-gateway/" +install -m 0600 "$identity_work/generated/identity-receipt.json" "$REFERENCE_CONFIG/thunderid/" +``` + +Merge the generated ThunderID store settings into the serving deployment file, retaining the supplied `server`, `jwt`, `crypto` and `database` blocks. The generated issuer, application registration, subject claims and registrar scope must agree with the BReg and Session files. @@ -127,10 +228,26 @@ separate gateway namespace. The two Envoy relays connect these namespaces over three private owner-only Unix sockets. The host app port passes TLS through to the Session-checked gateway. +### Set ownership and modes + +Each container reads its inputs under its own UID. Compose mounts each path +directly, so the modes of the parent directories do not matter to the +containers. + +| Paths under `REFERENCE_CONFIG` | Owner | Mode | Read by | +| --- | --- | --- | --- | +| `postgres/` and everything in it | 999:999, needs root | directories 0700, files 0600 | PostgreSQL, which refuses a key that its user does not own | +| `thunderid/bootstrap.yaml`, `thunderid/deployment.yaml`, `thunderid/resources/`, `thunderid/secrets/`, `thunderid/bootstrap-secrets/` | 10001:10001, needs root | directories 0700, files 0600 | ThunderID setup and the serving issuer | +| `trust/` | `REFERENCE_UID` | directory 0755, files 0644 | Every service, including ThunderID through `PGSSLROOTCERT` | +| Everything else | `REFERENCE_UID`:`REFERENCE_GID` | directories 0700, keys and secrets 0600 | Envoy, Session, BReg, the gateway check and the Node host | + +Apply the root-owned rows after the schema files are staged, in the next +section. + ## Start with empty state Set `REFERENCE_ENV` to the absolute path of the Compose environment file. -Choose a unique project name. Extract the database scripts before starting +Extract the database scripts before starting PostgreSQL. The initialization script creates only ThunderID's four databases and applies the matching schemas as the ThunderID role. @@ -144,6 +261,12 @@ for schema in config:configdb entity:entitydb runtime_transient:runtime_transien "dbscripts/${schema#*:}/postgres.sql" > "$REFERENCE_CONFIG/postgres/schema/${schema%%:*}.sql" done +sudo chown -R 999:999 "$REFERENCE_CONFIG/postgres" +sudo chmod -R u=rwX,go= "$REFERENCE_CONFIG/postgres" +thunderid_inputs=("$REFERENCE_CONFIG"/thunderid/{bootstrap.yaml,deployment.yaml,resources,secrets,bootstrap-secrets}) +sudo chown -R 10001:10001 "${thunderid_inputs[@]}" +sudo chmod -R u=rwX,go= "${thunderid_inputs[@]}" + "${compose[@]}" up --detach --wait postgres "${compose[@]}" run -T --rm thunderid-setup @@ -167,6 +290,9 @@ and encryption material live in project-owned volumes. `docker compose stop` preserves those volumes. Session state is in memory and a Session restart requires signing in again. +After setup, remove the bootstrap administrator password, or move it offline: +`sudo rm "$REFERENCE_CONFIG/thunderid/bootstrap-secrets/ADMIN_PASSWORD"`. + ## Check the routes Run `bash "$RECIPE/tests/smoke.sh" "$REFERENCE_CONFIG/trust/https-ca.pem"`. @@ -196,5 +322,23 @@ is refused, the protected page asks for sign-in again, and the second registrar can still read its Record. It checks application requests for browser-sent Authorization headers throughout. +## Remove the instance + +Stop the containers and remove the project's volumes, networks and the +locally built application image. Then remove the bundle digest image. + +```bash +"${compose[@]}" --profile setup down --volumes --remove-orphans --rmi local +docker image rm "$bundle_host" +``` + +The containers write into the private bind directories: audit JSONL files +under `breg/audit/` and `session/audit/`, relay sockets under `relay/`, the +checked `gateway-checked/envoy.json`, and the staged `postgres/schema/` files. +Keep the audit files if you need them, then delete `REFERENCE_CONFIG` with root, +because some files belong to UIDs 999 and 10001. Also delete `REFERENCE_CA`, +`BUSINESS_BUNDLE`, the identity work directory and the preview run's +`RSTACK_DEV_STATE_DIR`. + Release-candidate smoke wiring, published Session and Coordinator images, and the `rstack dev` route-parity gate are v0.52 work. diff --git a/deploy/examples/business-registration/compose.yaml b/deploy/examples/business-registration/compose.yaml index 5b9d164bb9..777591157f 100644 --- a/deploy/examples/business-registration/compose.yaml +++ b/deploy/examples/business-registration/compose.yaml @@ -175,8 +175,9 @@ services: - ${REFERENCE_CONFIG}/thunderid/resources:/opt/thunderid/config/resources:ro - ${REFERENCE_CONFIG}/thunderid/secrets:/run/identity-secrets:ro - &issuer-trust ${REFERENCE_CONFIG}/trust:/run/trust:ro - - &issuer-certs issuer-certs:/opt/thunderid/config/certs - - &issuer-secrets issuer-secrets:/opt/thunderid/config/secrets + # Only the one-shot setup writes the issuer's signing and encryption material. + - issuer-certs:/opt/thunderid/config/certs:ro + - issuer-secrets:/opt/thunderid/config/secrets:ro thunderid-setup: <<: *thunderid @@ -188,11 +189,12 @@ services: - ${REFERENCE_CONFIG}/thunderid/bootstrap.yaml:/opt/thunderid/deployment.yaml:ro - ${REFERENCE_CONFIG}/thunderid/bootstrap-secrets:/run/identity-secrets:ro - *issuer-trust - - *issuer-certs - - *issuer-secrets + - issuer-certs:/opt/thunderid/config/certs + - issuer-secrets:/opt/thunderid/config/secrets postgres: image: postgres:17.11@sha256:ff87138949ad9a46f32ff23bd6852b52ce024a13dffe9b4087be98292cdd3b4f + security_opt: [no-new-privileges:true] environment: POSTGRES_PASSWORD_FILE: /run/postgres/bootstrap-password command: diff --git a/deploy/examples/business-registration/host.mjs b/deploy/examples/business-registration/host.mjs index 9349b467d1..069c4f6330 100644 --- a/deploy/examples/business-registration/host.mjs +++ b/deploy/examples/business-registration/host.mjs @@ -71,7 +71,12 @@ function requestPage(request, assets) { return new Response(null, { status: 405, headers: { allow: 'GET, HEAD' } }) } return new Response(request.method === 'GET' ? bytes : null, { - headers: { 'content-type': pages.get(path), 'x-content-type-options': 'nosniff' }, + headers: { + 'content-type': pages.get(path), + 'x-content-type-options': 'nosniff', + // The same policy the rstack dev preview gateway sends with the page. + 'content-security-policy': "default-src 'self'; base-uri 'none'; frame-ancestors 'none'", + }, }) } @@ -125,7 +130,8 @@ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) const message = error.message === 'The preview bundle digest differs from the deployment pin.' ? error.message : 'The reference host could not load its checked bundle or start its private listeners.' - console.error(message) + // The error code (for example ENOENT or EADDRINUSE) names the cause without file contents. + console.error(error?.code ? `${message} (${error.code})` : message) process.exitCode = 1 } } diff --git a/deploy/examples/business-registration/identity-deployment.yaml b/deploy/examples/business-registration/identity-deployment.yaml index 8cc5566963..45e8c8c243 100644 --- a/deploy/examples/business-registration/identity-deployment.yaml +++ b/deploy/examples/business-registration/identity-deployment.yaml @@ -12,27 +12,19 @@ sessionApps: postLogoutRedirectUris: [https://127.0.0.1:8443/session/signed-out] products: [breg] tokenAttributes: [registry_actor_kind, registry_office] - grants: - - product: breg - accessProfiles: [business-registrar] + roles: [registrar] users: - id: reference-registrar username: reference-registrar email: reference-registrar@example.invalid passwordRef: secret:env/REGISTRAR_PASSWORD claims: - registry_actor_kind: human registry_office: central - grants: - - product: breg - accessProfiles: [business-registrar] + roles: [registrar] - id: reference-registrar-two username: reference-registrar-two email: reference-registrar-two@example.invalid passwordRef: secret:env/SECOND_REGISTRAR_PASSWORD claims: - registry_actor_kind: human registry_office: central - grants: - - product: breg - accessProfiles: [business-registrar] + roles: [registrar] diff --git a/deploy/examples/business-registration/service.yaml b/deploy/examples/business-registration/service.yaml new file mode 100644 index 0000000000..ae754caf1b --- /dev/null +++ b/deploy/examples/business-registration/service.yaml @@ -0,0 +1,9 @@ +apiVersion: id.registrystack.org/formats/rstack/service/v1alpha1 +kind: RStackService +# Identity generation reads these roles beside identity-deployment.yaml. They +# match the business-registration preview's own service.yaml. +roles: + registrar: + actorKind: human + claims: [registry_office] + accessProfiles: {breg: [business-registrar]} diff --git a/deploy/examples/business-registration/tests/host.test.mjs b/deploy/examples/business-registration/tests/host.test.mjs index d9a79d5529..4accdddacc 100644 --- a/deploy/examples/business-registration/tests/host.test.mjs +++ b/deploy/examples/business-registration/tests/host.test.mjs @@ -46,6 +46,10 @@ test('loads the checked bundle and serves only the declared function and page as assert.equal((await page.text()), 'index.html') assert.equal(page.headers.get('content-type'), 'text/html; charset=utf-8') assert.equal(page.headers.get('x-content-type-options'), 'nosniff') + assert.equal( + page.headers.get('content-security-policy'), + "default-src 'self'; base-uri 'none'; frame-ancestors 'none'", + ) assert.equal((await fetch(host.pagesOrigin + '/app.js', { method: 'HEAD' })).status, 200) assert.equal((await fetch(host.pagesOrigin + '/app.js', { method: 'POST' })).status, 405) for (const path of ['/manifest.json', '/functions/register-business.mjs', '/project/web/dist/index.html']) { diff --git a/deploy/examples/business-registration/tests/test_compose.py b/deploy/examples/business-registration/tests/test_compose.py index c8fc4a380f..e27d87d98a 100644 --- a/deploy/examples/business-registration/tests/test_compose.py +++ b/deploy/examples/business-registration/tests/test_compose.py @@ -75,6 +75,17 @@ def test_one_shots_keep_bootstrap_authority_out_of_serving_mounts(self): self.assertFalse(any("/config/resources" in mount["target"] for mount in boot)) self.assertFalse(any("/breg/admin" in mount["source"] for mount in self.services["breg"]["volumes"])) + def test_only_issuer_setup_writes_signing_material(self): + def issuer_volumes(name): + return {mount["source"]: mount.get("read_only", False) + for mount in self.services[name]["volumes"] if mount["type"] == "volume"} + self.assertEqual(issuer_volumes("thunderid"), {"issuer-certs": True, "issuer-secrets": True}) + self.assertEqual(issuer_volumes("thunderid-setup"), {"issuer-certs": False, "issuer-secrets": False}) + + def test_every_service_refuses_new_privileges(self): + for name, service in self.services.items(): + self.assertIn("no-new-privileges:true", service.get("security_opt", []), name) + def test_breg_waits_for_the_issuer_from_its_own_namespace(self): readiness = self.services["issuer-ready"] self.assertEqual(readiness["network_mode"], self.services["breg"]["network_mode"]) diff --git a/deploy/examples/business-registration/tests/test_host_node.py b/deploy/examples/business-registration/tests/test_host_node.py new file mode 100644 index 0000000000..2130488aa2 --- /dev/null +++ b/deploy/examples/business-registration/tests/test_host_node.py @@ -0,0 +1,35 @@ +"""Run the Node reference host's own tests from the deployment suite.""" + +from pathlib import Path +import shutil +import subprocess +import tempfile +import unittest + + +EXAMPLE = Path(__file__).resolve().parents[1] +NODE = shutil.which("node") +NPM = shutil.which("npm") + + +@unittest.skipUnless(NODE and NPM, "Node.js and npm are needed to test the reference host") +class ReferenceHost(unittest.TestCase): + def test_host_node_suite_passes(self): + # Install the locked dependencies in a scratch copy so the recipe stays unchanged. + with tempfile.TemporaryDirectory(prefix="reference-host-") as scratch: + work = Path(scratch) + for name in ("package.json", "package-lock.json", "host.mjs"): + shutil.copy2(EXAMPLE / name, work / name) + shutil.copytree(EXAMPLE / "tests", work / "tests") + for command in ( + [NPM, "ci", "--ignore-scripts", "--no-audit", "--no-fund"], + [NPM, "test"], + ): + result = subprocess.run(command, cwd=work, capture_output=True, text=True) + self.assertEqual( + result.returncode, 0, f"{' '.join(command[1:])} failed:\n{result.stdout}\n{result.stderr}" + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/deploy/examples/business-registration/tests/test_page_assets.py b/deploy/examples/business-registration/tests/test_page_assets.py new file mode 100644 index 0000000000..07882eb1f9 --- /dev/null +++ b/deploy/examples/business-registration/tests/test_page_assets.py @@ -0,0 +1,34 @@ +"""Check that the preview page this recipe serves under /apply/ loads its own assets.""" + +from html.parser import HTMLParser +from pathlib import Path +import unittest + + +ROOT = Path(__file__).resolve().parents[4] +PAGE = ROOT / "products/platform/examples/service-previews/business-registration/web/public/index.html" + + +class AssetReferences(HTMLParser): + def __init__(self): + super().__init__() + self.references = [] + + def handle_starttag(self, tag, attrs): + values = dict(attrs) + if tag == "link" and values.get("rel") == "stylesheet": + self.references.append(values["href"]) + elif tag == "script" and "src" in values: + self.references.append(values["src"]) + + +class PreviewPageAssets(unittest.TestCase): + def test_page_assets_resolve_under_any_page_route(self): + # rstack dev serves the page at / and the Session page route serves it at /apply/. + parser = AssetReferences() + parser.feed(PAGE.read_text(encoding="utf-8")) + self.assertEqual(sorted(parser.references), ["app.js", "service.css"]) + + +if __name__ == "__main__": + unittest.main() diff --git a/products/platform/examples/service-previews/business-registration/web/public/index.html b/products/platform/examples/service-previews/business-registration/web/public/index.html index 3a3eebfb2f..17b146d9b8 100644 --- a/products/platform/examples/service-previews/business-registration/web/public/index.html +++ b/products/platform/examples/service-previews/business-registration/web/public/index.html @@ -4,8 +4,8 @@ Register a business - - + + From 1de8dc3e74e54b3bf175d32639d19c29687b3e9c Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 24/55] feat(platform): use one product inventory for dev and service plans Folds these reviewed commits: - feat(platform): use one product inventory for dev and service plans - fix(platform): finish the dev.yaml inventory migration from review - fix(dev): place projected plan diagnostics at their authored keys - chore(identifiers): regenerate the catalogue for the carried schema changes Signed-off-by: Jeremi Joslin --- .../src/init_from_model/render.rs | 9 +- .../registry-bregctl/tests/local_package.rs | 2 +- crates/registry-caseworkctl/src/project.rs | 3 +- .../src/service_compiler.rs | 163 ++++++++++--- .../src/service_compiler/tests.rs | 215 ++++++++++++++++++ crates/registry-rstack-dev/src/lib.rs | 6 +- crates/registry-rstack-dev/src/plan.rs | 152 +++++++++---- crates/registry-rstack-dev/src/preview.rs | 14 +- crates/registry-rstack-dev/src/products.rs | 14 ++ .../registry-rstack-dev/tests/dev_schema.rs | 59 +++-- crates/registry-rstack/src/cli.rs | 48 ++-- crates/registry-rstack/tests/dev.rs | 22 +- crates/registry-rstack/tests/dev_run.rs | 141 +++++++++--- .../generate-breg-configuration.test.mjs | 3 +- .../run-a-project-with-rstack-dev.mdx | 20 +- .../derive-a-registry-from-publicschema.mdx | 7 +- .../src/content/docs/tutorials/first-breg.mdx | 7 +- .../tutorials/first-evidence-assertion.mdx | 7 +- .../docs/tutorials/first-messaging.mdx | 5 +- .../adapter/examples/dev-starter/dev.yaml | 5 +- products/breg/acceptance/facility/dev.yaml | 7 +- .../acceptance/generated-identifiers/dev.yaml | 7 +- .../acceptance/issuer-portability/dev.yaml | 7 +- .../reviewed-evidence-journey/dev.yaml | 11 +- .../acceptance/spatial-service-sites/dev.yaml | 7 +- products/breg/evidence/registry/dev.yaml | 9 +- .../breg/examples/external-views/dev.yaml | 9 +- products/breg/examples/facility/dev.yaml | 7 +- products/breg/examples/minimal/dev.yaml | 7 +- .../generic-operator-workflows/dev.yaml | 7 +- .../multi-reference-array-claim/dev.yaml | 7 +- products/breg/loadtest/support/loadenv.py | 4 +- .../examples/standalone-decision/dev.yaml | 5 +- .../examples/delayed-follow-up/dev.yaml | 7 +- .../source-registry/dev.yaml | 9 +- .../coordinator/scripts/test-real-services.py | 21 +- products/discovery/examples/starter/dev.yaml | 5 +- .../examples/development-starter/dev.yaml | 5 +- products/evidence/examples/fhir/dev.yaml | 7 +- .../evidence/examples/standalone/dev.yaml | 7 +- products/evidence/loadtest/support/loadenv.py | 4 +- .../evidence/loadtest/support/test_harness.py | 5 + .../identifiers/generated/catalog.v1.json | 46 ++-- products/messaging/examples/starter/dev.yaml | 5 +- products/platform/CHANGELOG.md | 1 + products/platform/config-formats.yaml | 12 +- .../projects/breg-project-dev/dev.yaml | 9 +- .../projects/breg-project-dev/service.yaml | 5 - products/platform/examples/licensing/dev.yaml | 11 +- .../generated/dev/dev.v1alpha1.schema.json | 114 ++++++---- .../dev/service.v1alpha1.schema.json | 19 +- products/platform/journeys/rstack-dev.sh | 10 +- products/platform/scripts/test-rstack-dev.py | 14 +- products/render/examples/starter/dev.yaml | 5 +- .../examples/resource-reservations/dev.yaml | 5 +- .../standalone-arrival-window/dev.yaml | 5 +- .../examples/standalone-exact-time/dev.yaml | 5 +- 57 files changed, 1011 insertions(+), 321 deletions(-) create mode 100644 crates/registry-platform-config/src/service_compiler/tests.rs diff --git a/crates/registry-bregctl/src/init_from_model/render.rs b/crates/registry-bregctl/src/init_from_model/render.rs index 7124567959..3c9d39f357 100644 --- a/crates/registry-bregctl/src/init_from_model/render.rs +++ b/crates/registry-bregctl/src/init_from_model/render.rs @@ -65,9 +65,12 @@ fn development_plan(plan: &Plan) -> String { yaml.line(0, "kind: RStackDev"); yaml.entry(0, "issuer", &base_iri(plan)); yaml.line(0, "products:"); - yaml.line(1, "- product: breg"); - yaml.line(2, "project: ."); - yaml.entry(2, "audience", &format!("urn:example:{}", plan.registry_id)); + yaml.line(1, "breg:"); + yaml.line(2, "projects:"); + yaml.line(3, "breg:"); + yaml.line(4, "path: ."); + yaml.line(0, "audiences:"); + yaml.entry(1, "breg", &format!("urn:example:{}", plan.registry_id)); yaml.line(0, "people:"); let callers = [ Some((OPERATOR_PROFILE, operator_principal(plan))), diff --git a/crates/registry-bregctl/tests/local_package.rs b/crates/registry-bregctl/tests/local_package.rs index 62802079d4..6e774987e8 100644 --- a/crates/registry-bregctl/tests/local_package.rs +++ b/crates/registry-bregctl/tests/local_package.rs @@ -22,7 +22,7 @@ fn project(root: &std::path::Path, extra: &str) { apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1\n\ kind: RStackDev\n\ issuer: https://issuer.example.invalid\n\ -products:\n - {{product: breg, project: ., audience: registry}}\n\ +products:\n breg: {{projects: {{breg: {{path: .}}}}}}\naudiences:\n breg: registry\n\ people:\n operator:\n subject: operator\n client: operator-client\n roles: [operator]\n\ journeyFile: dev-journeys.yaml\n\ {extra}" diff --git a/crates/registry-caseworkctl/src/project.rs b/crates/registry-caseworkctl/src/project.rs index 8bbe66a7f2..a9a976f216 100644 --- a/crates/registry-caseworkctl/src/project.rs +++ b/crates/registry-caseworkctl/src/project.rs @@ -349,7 +349,8 @@ fn development_plan(project: &CaseworkProject) -> Result<(String, String, String "apiVersion": "id.registrystack.org/formats/rstack/dev/v1alpha1", "kind": "RStackDev", "issuer": issuer, - "products": [{"product": "casework", "project": ".", "audience": "urn:example:casework"}], + "products": {"casework": {"path": "."}}, + "audiences": {"casework": "urn:example:casework"}, "people": people, "journeyFile": "dev-journeys.yaml", }))?; diff --git a/crates/registry-platform-config/src/service_compiler.rs b/crates/registry-platform-config/src/service_compiler.rs index 7c396dc900..384346f968 100644 --- a/crates/registry-platform-config/src/service_compiler.rs +++ b/crates/registry-platform-config/src/service_compiler.rs @@ -88,18 +88,23 @@ struct ManifestReference { #[serde(deny_unknown_fields)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema), schemars(extend("minProperties" = 1)))] struct ProductReferences { + adapter: Option, breg: Option, casework: Option, coordinator: Option, + discovery: Option, + documents: Option, evidence: Option, messaging: Option, + render: Option, + scheduling: Option, } #[derive(Deserialize)] #[serde(deny_unknown_fields)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] struct NamedProjects { - /// Projects keyed by service product ID. BReg IDs form the generated client member names. + /// Projects keyed by project ID. In a service, BReg IDs form the generated client member names. #[cfg_attr( feature = "schema", schemars(schema_with = "local_index::", extend("minProperties" = 1)) @@ -111,7 +116,7 @@ struct NamedProjects { #[serde(deny_unknown_fields)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] struct ProjectReference { - /// Directory containing the product's native project file, relative to this service file. + /// Directory containing the product's native project file, relative to the file that declares it. path: PathBuf, } @@ -130,6 +135,12 @@ pub fn service_schema() -> schemars::Schema { schemars::schema_for!(ServiceFile) } +/// The product inventory mapping shared by `service.yaml` and `dev.yaml`. +#[cfg(feature = "schema")] +pub fn product_inventory_schema(generator: &mut schemars::SchemaGenerator) -> schemars::Schema { + generator.subschema_for::() +} + #[cfg(feature = "schema")] fn roles_schema(generator: &mut schemars::SchemaGenerator) -> schemars::Schema { let mut roles = local_index::(generator); @@ -287,7 +298,14 @@ pub fn plan(file: &Path, options: Options<'_>) -> Result { let settings = Reader::new(path.display().to_string()) .with_hook(&mut AuthoredExpressions) .read(&read(&path)?, &Expect::one(&DEV_FORMAT))?; - let projection = project_dev(root, &settings, &products, doc)?; + let projection = if settings.span_of("/products").is_none() { + project_dev(root, &settings, &products, doc)? + } else if products.is_empty() { + let entries = dev_inventory(root, &settings)?; + project_dev(root, &settings, &entries, &settings)? + } else { + return Err(two_inventories(&settings, doc)); + }; (Some(root.to_owned()), Some(projection.native)) } None => (None, None), @@ -315,14 +333,16 @@ struct ServiceDocument { } fn read_service(file: &Path, workspace: Option<&Path>) -> Result { - let file = file.canonicalize().map_err(|_| unreadable(file))?; + // Refusals name the path as written, never where a link resolves. + let authored = file; + let file = file.canonicalize().map_err(|_| unreadable(authored))?; let directory = file.parent().ok_or_else(|| unreadable(&file))?; let workspace = match workspace { Some(root) => root.canonicalize().map_err(|_| unreadable(root))?, None => directory.to_owned(), }; if !file.starts_with(&workspace) || !workspace.is_dir() { - return Err(unreadable(&file)); + return Err(unreadable(authored)); } let decoded = Reader::new(file.display().to_string()) .with_hook(&mut AuthoredExpressions) @@ -340,13 +360,42 @@ fn read_service(file: &Path, workspace: Option<&Path>) -> Result Result<(Document, Vec), Report> { - let ServiceDocument { +/// The one product inventory of a development directory: the `products` of +/// its `dev.yaml`, or else those of a sibling `service.yaml`. Returns the +/// document that declares the inventory and its entries. +fn development_inventory( + root: &Path, + settings: &Document, +) -> Result<(Document, Vec), Report> { + let service_file = root.join("service.yaml"); + let service = service_file + .exists() + .then(|| read_service(&service_file, Some(root))) + .transpose()?; + if settings.span_of("/products").is_some() { + if let Some(service) = service + .as_ref() + .filter(|service| service.decoded.value.products.is_some()) + { + return Err(two_inventories(settings, &service.decoded.document)); + } + return Ok((settings.clone(), dev_inventory(root, settings)?)); + } + let Some(ServiceDocument { file, workspace, decoded, .. - } = read_service(&root.join("service.yaml"), Some(root))?; + }) = service + else { + return Err(problem( + settings, + "rstack.service.projects", + "/products", + "The development plan needs product projects.", + "Declare the native products to start under products in dev.yaml.", + )); + }; let directory = file .parent() .expect("a readable service file has a directory"); @@ -356,23 +405,66 @@ fn development_inventory(root: &Path) -> Result<(Document, Vec), Report "rstack.service.projects", "/products", "The development plan needs product projects.", - "Declare the native products to start in service.yaml.", + "Declare the native products to start in dev.yaml or service.yaml.", ) })?; let entries = products(references, &decoded.document, directory, &workspace)?; Ok((decoded.document, entries)) } +/// The products declared in development settings, resolved against their +/// directory. +fn dev_inventory(root: &Path, settings: &Document) -> Result, Report> { + if settings + .to_json_value() + .pointer("/products") + .is_some_and(Value::is_array) + { + return Err(problem( + settings, + "rstack.dev.products-list", + "/products", + "The development products are a mapping of product kinds, not a list.", + "Write each product as products..projects..path for breg, coordinator and evidence, or products..path for every other kind, and move its audience to audiences..", + )); + } + let workspace = root.canonicalize().map_err(|_| unreadable(root))?; + let references = settings.decode_at::("/products")?; + products(references, settings, &workspace, &workspace) +} + +fn two_inventories(settings: &Document, service: &Document) -> Report { + let mut report = problem( + settings, + "rstack.service.dev-products", + "/products", + "The service file already declares the development products.", + "Declare the products in one file: remove them from these development settings, or from service.yaml.", + ); + if let Some(diagnostic) = report.diagnostics_mut().first_mut() { + service.add_related_value(diagnostic, "/products", "the service file's products"); + } + report +} + +fn read_settings(root: &Path) -> Result { + let file = root.join("dev.yaml"); + Reader::new(file.display().to_string()) + .with_hook(&mut AuthoredExpressions) + .read(&read(&file)?, &Expect::one(&DEV_FORMAT)) +} + /// The native component kinds the launcher needs to select a development host. pub fn development_product_kinds(root: &Path) -> Result, Report> { - let (_, entries) = development_inventory(root)?; + let (_, entries) = development_inventory(root, &read_settings(root)?)?; Ok(entries.into_iter().map(|entry| entry.product).collect()) } -/// Apply the service beside dev.yaml while leaving native dev validation to its runner. +/// Apply the directory's product inventory to dev.yaml while leaving native +/// dev validation to its runner. pub fn development_plan(root: &Path, settings: &Document) -> Result { - let (service, entries) = development_inventory(root)?; - project_dev(root, settings, &entries, &service) + let (inventory, entries) = development_inventory(root, settings)?; + project_dev(root, settings, &entries, &inventory) } fn products( @@ -424,8 +516,13 @@ fn products( } } for (kind, manifest, reference) in [ + ("adapter", "project.yaml", references.adapter), ("casework", "casework.yaml", references.casework), + ("discovery", "origins.yaml", references.discovery), + ("documents", "documents.yaml", references.documents), ("messaging", "messaging.yaml", references.messaging), + ("render", "render.yaml", references.render), + ("scheduling", "scheduling.yaml", references.scheduling), ] { if let Some(reference) = reference { let source = format!("/products/{kind}/path"); @@ -577,7 +674,7 @@ pub struct DevelopmentPlan { } pub struct DevelopmentSources { - service: Document, + inventory: Document, products: Vec, } @@ -587,10 +684,10 @@ struct ProductSource { } impl DevelopmentSources { - /// Locate a native plan field in one of the two authored documents. + /// Locate a native plan field in the settings or the inventory document. pub fn locate<'a>(&'a self, settings: &'a Document, path: &'a str) -> (&'a Document, &'a str) { if path == "/products" { - return (&self.service, path); + return (&self.inventory, path); } if let Some(rest) = path.strip_prefix("/products/") { let (index, field) = rest.split_once('/').unwrap_or((rest, "")); @@ -602,7 +699,7 @@ impl DevelopmentSources { return if field == "audience" { (settings, &source.audience) } else { - (&self.service, &source.project) + (&self.inventory, &source.project) }; } } @@ -614,24 +711,15 @@ fn project_dev( root: &Path, doc: &Document, products: &[Product], - service: &Document, + inventory: &Document, ) -> Result { if products.is_empty() { return Err(problem( - service, + inventory, "rstack.service.projects", "/products", "The development plan needs product projects.", - "Declare the native products to start in service.yaml.", - )); - } - if doc.span_of("/products").is_some() { - return Err(problem( - doc, - "rstack.service.dev-products", - "/products", - "The service file supplies the development products.", - "Remove products from the development settings and give each service product an audience.", + "Declare the native products to start in dev.yaml or service.yaml.", )); } let mut audiences = doc.decode_at::>("/audiences")?; @@ -641,7 +729,7 @@ fn project_dev( for product in products { if !kinds.insert(product.product) { return Err(problem( - service, + inventory, "rstack.service.dev-product", &product.source, "The development runner accepts one project per product kind.", @@ -650,7 +738,7 @@ fn project_dev( } let relative = product.project.strip_prefix(root).map_err(|_| { problem( - service, + inventory, "rstack.service.dev-root", &product.source, "The development runner requires project paths inside the development directory.", @@ -667,8 +755,8 @@ fn project_dev( doc, "rstack.service.dev-audience", "/audiences", - "A service product needs a development audience.", - "Set audiences for all declared service product IDs.", + "A development product needs an audience.", + "Set audiences for all declared product IDs.", )); }; native_products @@ -683,8 +771,8 @@ fn project_dev( doc, "rstack.service.dev-audience", &format!("/audiences/{}", extra.as_str()), - "A development audience names an unknown service product.", - "Remove the audience or add its product to the service file.", + "A development audience names an unknown product.", + "Remove the audience or add its product to the inventory.", )); } let mut dev = doc.to_json_value(); @@ -696,7 +784,7 @@ fn project_dev( Ok(DevelopmentPlan { native: dev, sources: DevelopmentSources { - service: service.clone(), + inventory: inventory.clone(), products: sources, }, }) @@ -805,3 +893,6 @@ fn problem(doc: &Document, code: &str, pointer: &str, message: &str, next: &str) }); doc.report_with([diagnostic]) } + +#[cfg(test)] +mod tests; diff --git a/crates/registry-platform-config/src/service_compiler/tests.rs b/crates/registry-platform-config/src/service_compiler/tests.rs new file mode 100644 index 0000000000..904b9d6ade --- /dev/null +++ b/crates/registry-platform-config/src/service_compiler/tests.rs @@ -0,0 +1,215 @@ +use super::*; + +const DEV_HEADER: &str = "apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 +kind: RStackDev +issuer: https://issuer.example.test +journeyFile: dev-journeys.yaml +"; + +const SERVICE_HEADER: &str = + "apiVersion: id.registrystack.org/formats/rstack/service/v1alpha1\nkind: RStackService\n"; + +const DEV_INVENTORY: &str = "products: + breg: + projects: + breg: {path: registry} + casework: {path: casework} +audiences: + breg: urn:example:registry + casework: urn:example:casework +"; + +struct Directory { + _directory: tempfile::TempDir, + root: PathBuf, +} + +impl Directory { + fn new(dev: &str) -> Self { + let directory = tempfile::tempdir().unwrap(); + let root = directory.path().canonicalize().unwrap(); + for (project, manifest) in [("registry", "registry.yaml"), ("casework", "casework.yaml")] { + fs::create_dir(root.join(project)).unwrap(); + fs::write(root.join(project).join(manifest), "").unwrap(); + } + fs::write(root.join("dev.yaml"), format!("{DEV_HEADER}{dev}")).unwrap(); + Self { + _directory: directory, + root, + } + } + + fn service(self, body: &str) -> Self { + fs::write( + self.root.join("service.yaml"), + format!("{SERVICE_HEADER}{body}"), + ) + .unwrap(); + self + } + + fn settings(&self) -> Document { + let file = self.root.join("dev.yaml"); + Reader::new(file.display().to_string()) + .read(&fs::read(&file).unwrap(), &Expect::one(&DEV_FORMAT)) + .unwrap() + } + + fn plan(&self) -> Result { + development_plan(&self.root, &self.settings()) + } +} + +fn refusal(report: Report) -> Diagnostic { + let [diagnostic] = report.diagnostics() else { + panic!("expected exactly one diagnostic: {report}"); + }; + diagnostic.clone() +} + +fn source_file(diagnostic: &Diagnostic) -> String { + let file = &diagnostic + .source + .as_ref() + .expect("a located diagnostic") + .file; + Path::new(file) + .file_name() + .unwrap() + .to_string_lossy() + .into_owned() +} + +#[test] +fn a_dev_owned_inventory_projects_native_products_without_a_service_file() { + let directory = Directory::new(DEV_INVENTORY); + let plan = directory.plan().expect("the dev inventory projects"); + assert_eq!( + plan.native["products"], + json!([ + {"product": "breg", "project": "registry", "audience": "urn:example:registry"}, + {"product": "casework", "project": "casework", "audience": "urn:example:casework"}, + ]) + ); + assert!(plan.native.get("audiences").is_none()); + assert_eq!( + development_product_kinds(&directory.root).unwrap(), + ["breg", "casework"] + ); +} + +#[test] +fn a_roles_only_service_file_leaves_the_inventory_with_dev() { + let directory = Directory::new(DEV_INVENTORY) + .service("roles:\n clerk:\n actorKind: service\n accessProfiles: {breg: [clerk]}\n"); + let plan = directory.plan().expect("the dev inventory projects"); + assert_eq!(plan.native["products"][0]["product"], "breg"); +} + +#[test] +fn a_sibling_service_inventory_still_supplies_the_products() { + let directory = Directory::new("audiences: {records: urn:example:registry}\n") + .service("products:\n breg:\n projects:\n records: {path: registry}\n"); + let plan = directory.plan().expect("the service inventory projects"); + assert_eq!( + plan.native["products"], + json!([{"product": "breg", "project": "registry", "audience": "urn:example:registry"}]) + ); + assert_eq!( + development_product_kinds(&directory.root).unwrap(), + ["breg"] + ); +} + +#[test] +fn two_inventories_in_one_directory_are_refused_at_the_dev_products() { + let directory = Directory::new(DEV_INVENTORY) + .service("products:\n breg:\n projects:\n breg: {path: registry}\n"); + let diagnostic = refusal(directory.plan().err().expect("two inventories")); + assert_eq!(diagnostic.code, "rstack.service.dev-products"); + assert_eq!(diagnostic.path, "/products"); + assert_eq!(source_file(&diagnostic), "dev.yaml"); + let [related] = diagnostic.related.as_slice() else { + panic!("expected the service inventory as the related location"); + }; + assert!(related.file.ends_with("service.yaml"), "{}", related.file); + assert_eq!(related.path, "/products"); + assert_eq!(related.line, Some(4)); + assert!(development_product_kinds(&directory.root).is_err()); +} + +#[test] +fn the_retired_product_list_is_refused_with_the_mapping_named() { + let directory = Directory::new( + "products:\n - {product: breg, project: registry, audience: urn:example:registry}\naudiences: {breg: urn:example:registry}\n", + ); + let diagnostic = refusal(directory.plan().err().expect("the list is retired")); + assert_eq!(diagnostic.code, "rstack.dev.products-list"); + assert_eq!(diagnostic.path, "/products"); + assert_eq!( + diagnostic.suggested_action, + "Write each product as products..projects..path for breg, coordinator and evidence, or products..path for every other kind, and move its audience to audiences.." + ); + let source = diagnostic.source.as_ref().expect("a located diagnostic"); + assert_eq!((source.line, source.column), (Some(6), Some(3))); + assert_eq!(source_file(&diagnostic), "dev.yaml"); +} + +#[test] +fn a_directory_without_an_inventory_names_dev_yaml() { + let directory = Directory::new("audiences: {breg: urn:example:registry}\n"); + let diagnostic = refusal(directory.plan().err().expect("no inventory")); + assert_eq!(diagnostic.code, "rstack.service.projects"); + assert_eq!(source_file(&diagnostic), "dev.yaml"); +} + +#[test] +fn dev_inventory_refusals_point_into_dev_yaml() { + let directory = Directory::new(&DEV_INVENTORY.replace("{path: registry}", "{path: missing}")); + let diagnostic = refusal(directory.plan().err().expect("missing project")); + assert_eq!(diagnostic.path, "/products/breg/projects/breg/path"); + assert_eq!(source_file(&diagnostic), "dev.yaml"); + + let directory = + Directory::new(&DEV_INVENTORY.replace(" casework: urn:example:casework\n", "")); + let diagnostic = refusal(directory.plan().err().expect("missing audience")); + assert_eq!(diagnostic.code, "rstack.service.dev-audience"); + assert_eq!(diagnostic.path, "/audiences"); + assert_eq!(source_file(&diagnostic), "dev.yaml"); +} + +#[test] +fn an_explicit_dev_config_uses_its_own_inventory_beside_a_roles_only_service() { + let directory = Directory::new(DEV_INVENTORY) + .service("roles:\n clerk:\n actorKind: service\n accessProfiles: {breg: [clerk]}\n"); + let dev = directory.root.join("dev.yaml"); + let plan = plan( + &directory.root.join("service.yaml"), + Options { + workspace_root: None, + dev_config: Some(&dev), + checked_routes: None, + route_selections: &[], + for_client: false, + }, + ) + .expect("the roles-only service plans with the dev inventory"); + assert_eq!( + plan.dev_plan.expect("a dev projection")["products"][1], + json!({"product": "casework", "project": "casework", "audience": "urn:example:casework"}) + ); +} + +#[test] +fn single_project_runner_products_take_a_path() { + let directory = Directory::new( + "products:\n scheduling: {path: scheduling}\naudiences: {scheduling: urn:example:scheduling}\n", + ); + fs::create_dir(directory.root.join("scheduling")).unwrap(); + fs::write(directory.root.join("scheduling/scheduling.yaml"), "").unwrap(); + let plan = directory.plan().expect("a scheduling project"); + assert_eq!( + plan.native["products"], + json!([{"product": "scheduling", "project": "scheduling", "audience": "urn:example:scheduling"}]) + ); +} diff --git a/crates/registry-rstack-dev/src/lib.rs b/crates/registry-rstack-dev/src/lib.rs index 8ddc19f915..f8299600cd 100644 --- a/crates/registry-rstack-dev/src/lib.rs +++ b/crates/registry-rstack-dev/src/lib.rs @@ -939,12 +939,14 @@ fn check( Ok(report) => (report, DOMAIN_REFUSAL_EXIT), Err(error) => { if let Some(unavailable) = error.downcast_ref::() { - let report = Report::new(vec![Diagnostic::error( + let mut diagnostic = Diagnostic::error( "rstack.dev.check-unavailable", unavailable.field(), unavailable.reason(), unavailable.remedy(), - )]); + ); + diagnostic.source = unavailable.location().cloned(); + let report = Report::new(vec![diagnostic]); return write_check_report( report, OPERATIONAL_FAILURE_EXIT, diff --git a/crates/registry-rstack-dev/src/plan.rs b/crates/registry-rstack-dev/src/plan.rs index c5a1c4da94..e97d9ab655 100644 --- a/crates/registry-rstack-dev/src/plan.rs +++ b/crates/registry-rstack-dev/src/plan.rs @@ -103,35 +103,42 @@ pub(crate) fn schema() -> schemars::Schema { audiences.insert("minProperties".to_owned(), 1.into()); audiences.insert( "description".to_owned(), - "Token audiences keyed by the product IDs declared in service.yaml.".into(), + "Token audiences keyed by project ID: the member name under projects, or the product kind for a single path.".into(), + ); + let mut products = + registry_platform_config::service_compiler::product_inventory_schema(&mut generator); + products.insert( + "description".to_owned(), + "The products to start, as in service.yaml. Leave it out when a sibling service.yaml declares products.".into(), ); let mut schema = generator.into_root_schema_for::>(); - // The composed reader projects audiences into products before decoding Plan. - schema + // The composed reader projects products and audiences into the native + // product list before decoding Plan. + let properties = schema .get_mut("properties") .and_then(Value::as_object_mut) - .expect("Plan has a properties mapping") - .insert("audiences".to_owned(), audiences.to_value()); + .expect("Plan has a properties mapping"); + properties.insert("products".to_owned(), products.to_value()); + properties.insert("audiences".to_owned(), audiences.to_value()); + // The native product list item is internal once products is the mapping. schema + .get_mut("$defs") + .and_then(Value::as_object_mut) + .expect("Plan has definitions") + .remove("ProductPlan"); + let required = schema .get_mut("required") .and_then(Value::as_array_mut) - .expect("Plan has required properties") - .retain(|property| property != "products"); - schema.insert( - "oneOf".to_owned(), - serde_json::json!([ - {"required": ["products"]}, - {"required": ["audiences"]} - ]), - ); + .expect("Plan has required properties"); + required.retain(|property| property != "products"); + required.push("audiences".into()); schema.insert( "allOf".to_owned(), serde_json::json!([{ "if": {"required": ["preview"]}, "then": { - "required": ["audiences"], "properties": {"issuer": {"const": "run"}}, - "not": {"required": ["application"]} + "not": {"anyOf": [{"required": ["application"]}, {"required": ["products"]}]} } }]), ); @@ -1076,10 +1083,8 @@ fn read_plan(root: &Path, offline_check: bool) -> Result<(AuthoredPlan, Authored super::preview::verify_native_source(source, expected)?; } } - let (value, service) = resolved.map_err(|error| match error.downcast::() { - Ok(refusal) => source_refusal_report(&document, sources.as_ref(), &refusal).into(), - Err(error) => error, - })?; + let (value, service) = + resolved.map_err(|error| authored_error(&document, sources.as_ref(), error))?; Ok(( AuthoredPlan { value, @@ -1110,34 +1115,57 @@ fn decode_authored_plan( remedy: WRITE_THE_VALUE, }) .read(&bytes, &Expect::one(&FORMAT))?; - if document.span_of("/audiences").is_none() { - let value = document.decode()?; - return Ok(( - AuthoredPlan { - value, - document, - sources: None, - }, - digest, - )); - } let projection = registry_platform_config::service_compiler::development_plan(root, &document)?; let bytes = serde_json::to_vec(&projection.native)?; let decoded = Reader::new(&name) .decode::>(&bytes, &Expect::one(&FORMAT)) .map_err(|mut report| { + // The reader positioned these diagnostics in the projected JSON. + // Keep its choice of key, value or whole file, and place each one + // and its related notes in the authored file. + let projected = Reader::new(&name).read(&bytes, &Expect::one(&FORMAT)).ok(); for diagnostic in report.diagnostics_mut() { + let original = diagnostic + .source + .as_ref() + .map(|source| (source.line, source.column)); + let at_key = projected + .as_ref() + .and_then(|json| json.key_span_of(&diagnostic.path)) + .is_some_and(|span| { + original == Some((Some(span.start.line), Some(span.start.column))) + }); let (source, path) = projection.sources.locate(&document, &diagnostic.path); - let authored = source.diagnostic_at_value( + let place = if at_key { + Document::diagnostic_at_key + } else { + Document::diagnostic_at_value + }; + let mut authored = place( + source, diagnostic.severity, &diagnostic.code, path, &diagnostic.message, &diagnostic.suggested_action, ); + if original.is_some_and(|(line, _)| line.is_none()) { + if let Some(authored) = authored.source.as_mut() { + authored.line = None; + authored.column = None; + } + } diagnostic.path = authored.path; diagnostic.source = authored.source; diagnostic.artifact = authored.artifact; + for related in &mut diagnostic.related { + let (source, path) = projection.sources.locate(&document, &related.path); + let position = source.span_of(path).map(|span| span.start); + related.file = source.file().to_owned(); + related.line = position.map(|position| position.line); + related.column = position.map(|position| position.column); + related.path = path.to_owned(); + } } report })?; @@ -1155,6 +1183,35 @@ fn refusal_report(decoded: &AuthoredPlan, refusal: &SemanticRefu source_refusal_report(&decoded.document, decoded.sources.as_ref(), refusal) } +/// A plan refusal, or an unavailable product helper, at the authored location +/// of its native plan field. Other errors pass through unchanged. +fn authored_error( + document: &Document, + sources: Option<&DevelopmentSources>, + error: anyhow::Error, +) -> anyhow::Error { + let error = match error.downcast::() { + Ok(refusal) => return source_refusal_report(document, sources, &refusal).into(), + Err(error) => error, + }; + match error.downcast::() { + Ok(unavailable) => { + let (source, field) = sources.map_or((document, unavailable.field()), |sources| { + sources.locate(document, unavailable.field()) + }); + let position = source.span_of(field).map(|span| span.start); + let located = registry_platform_yaml::Source { + file: source.file().to_owned(), + line: position.map(|position| position.line), + column: position.map(|position| position.column), + }; + let field = field.to_owned(); + unavailable.at(&field, located).into() + } + Err(error) => error, + } +} + fn source_refusal_report( document: &Document, sources: Option<&DevelopmentSources>, @@ -1236,10 +1293,11 @@ pub(crate) fn check(root: &Path) -> Result { let inspection = match inspection { Ok(inspection) => inspection, Err(error) => { - return match error.downcast::() { - Ok(refusal) => Err(refusal_report(&decoded, &refusal).into()), - Err(error) => Err(error), - } + return Err(authored_error( + &decoded.document, + decoded.sources.as_ref(), + error, + )) } }; validate_application_authority(&decoded.value, &inspection) @@ -1269,7 +1327,15 @@ fn preview_plan( let Some(preview) = &decoded.value.preview else { return Ok(None); }; - let build = preview.build_plan(root, &decoded.value, decoded.sources.is_some()); + if decoded.document.span_of("/products").is_some() { + let refusal = SemanticRefusal::new( + "/products", + "A browser preview takes its products from the sibling service.yaml.", + "Declare the one BReg project under products in service.yaml and keep only audiences in dev.yaml.", + ); + return Err(refusal_report(decoded, &refusal).into()); + } + let build = preview.build_plan(root, &decoded.value); match build { Ok(build) => { anyhow::ensure!( @@ -2256,6 +2322,7 @@ mod tests { #[test] fn authored_role_and_fixture_errors_point_to_the_offending_item_or_key() { let root = tempfile::tempdir().unwrap(); + fs::write(root.path().join("registry.yaml"), "fixture").unwrap(); for (person, code, path) in [ ( "roles: [reader, reader]", @@ -2271,7 +2338,7 @@ mod tests { fs::write( root.path().join("dev.yaml"), format!( - "apiVersion: {API_VERSION}\nkind: {KIND}\nissuer: run\nproducts: []\npeople: {{reader: {{subject: reader, client: reader, {person}}}}}\njourneyFile: dev-journeys.yaml\n" + "apiVersion: {API_VERSION}\nkind: {KIND}\nissuer: run\nproducts: {{breg: {{projects: {{breg: {{path: .}}}}}}}}\naudiences: {{breg: urn:test:breg}}\npeople: {{reader: {{subject: reader, client: reader, {person}}}}}\njourneyFile: dev-journeys.yaml\n" ), ) .unwrap(); @@ -2294,11 +2361,13 @@ mod tests { fs::write(project.path().join("registry.yaml"), "fixture").unwrap(); fs::write(project.path().join("dev-journeys.yaml"), "fixture").unwrap(); fs::write(project.path().join("dev.yaml"), format!( - "apiVersion: {API_VERSION}\nkind: {KIND}\nissuer: https://issuer.example.test\nproducts: [{{product: breg, project: ., audience: urn:test:breg}}]\njourneyFile: dev-journeys.yaml\npeople: {{reader: {{subject: reader, client: reader, roles: [reader]}}}}\n" + "apiVersion: {API_VERSION}\nkind: {KIND}\nissuer: https://issuer.example.test\nproducts: {{breg: {{projects: {{breg: {{path: .}}}}}}}}\naudiences: {{breg: urn:test:breg}}\njourneyFile: dev-journeys.yaml\npeople: {{reader: {{subject: reader, client: reader, roles: [reader]}}}}\n" )).unwrap(); + // The inventory reader opens service.yaml first and refuses the link. let error = load(project.path()).err().unwrap().to_string(); + assert!(error.contains("rstack.service.read"), "{error}"); assert!( - error.contains("resolves outside the development project"), + !error.contains(&outside.path().display().to_string()), "{error}" ); } @@ -2967,7 +3036,8 @@ journeys: [] .unwrap(); let valid = json!({ "issuer": "https://issuer.example.invalid", - "products": [{"product": "breg", "project": ".", "audience": "registry"}], + "products": {"breg": {"projects": {"breg": {"path": "."}}}}, + "audiences": {"breg": "registry"}, "people": {"operator": { "subject": "operator", "client": "operator-client", "roles": ["operator"] diff --git a/crates/registry-rstack-dev/src/preview.rs b/crates/registry-rstack-dev/src/preview.rs index e910e7bf58..5299724d69 100644 --- a/crates/registry-rstack-dev/src/preview.rs +++ b/crates/registry-rstack-dev/src/preview.rs @@ -64,21 +64,15 @@ pub(super) struct PreviewProduct { } impl Preview { - pub(super) fn build_plan( - &self, - root: &Path, - native: &plan::Plan, - composed: bool, - ) -> Result { + pub(super) fn build_plan(&self, root: &Path, native: &plan::Plan) -> Result { let refusal = || { plan::refuse( "/preview", - "A browser preview requires one named BReg, a UI, declared functions, issuer run, and a composed plan.", - "Set audiences by product ID and remove any explicit application or external issuer from this preview.", + "A browser preview requires one named BReg in service.yaml, a UI, declared functions, and issuer run.", + "Declare the one BReg project under products in service.yaml, set its audience in dev.yaml, and remove any explicit application or external issuer from this preview.", ) }; - if !composed - || native.application.is_some() + if native.application.is_some() || native.issuer != "run" || native.products.len() != 1 || native.products[0].product != Product::Breg diff --git a/crates/registry-rstack-dev/src/products.rs b/crates/registry-rstack-dev/src/products.rs index b507632496..6c8ab2d20f 100644 --- a/crates/registry-rstack-dev/src/products.rs +++ b/crates/registry-rstack-dev/src/products.rs @@ -2602,6 +2602,7 @@ pub(super) struct ProductInspection { #[error("{reason}")] pub(super) struct InspectionUnavailable { field: String, + location: Option, reason: String, remedy: String, } @@ -2610,6 +2611,7 @@ impl InspectionUnavailable { fn new(field: &str, reason: &str, remedy: &str) -> Self { Self { field: field.to_owned(), + location: None, reason: reason.to_owned(), remedy: remedy.to_owned(), } @@ -2619,6 +2621,18 @@ impl InspectionUnavailable { &self.field } + /// The authored file and position of the field, once located. + pub(super) fn location(&self) -> Option<®istry_platform_yaml::Source> { + self.location.as_ref() + } + + /// The same refusal at the authored location of its native plan field. + pub(super) fn at(mut self, field: &str, location: registry_platform_yaml::Source) -> Self { + field.clone_into(&mut self.field); + self.location = Some(location); + self + } + pub(super) fn reason(&self) -> &str { &self.reason } diff --git a/crates/registry-rstack-dev/tests/dev_schema.rs b/crates/registry-rstack-dev/tests/dev_schema.rs index 0be4e1bb61..b51e06b193 100644 --- a/crates/registry-rstack-dev/tests/dev_schema.rs +++ b/crates/registry-rstack-dev/tests/dev_schema.rs @@ -113,42 +113,55 @@ fn the_plan_schema_names_the_rstack_dev_format() { } #[test] -fn the_dev_schema_accepts_either_native_products_or_service_audiences() { +fn the_dev_schema_takes_the_service_inventory_and_requires_audiences() { let documents = documents().expect("the development schemas generate"); let schema = compile(&documents["dev.v1alpha1.schema.json"]); - let native = example(EXAMPLES[0].1); - assert!(schema.is_valid(&native)); + let plan = example(EXAMPLES[0].1); + assert!(schema.is_valid(&plan)); - let mut composed = native; - let products = composed + let mut without_audiences = plan.clone(); + without_audiences .as_object_mut() .expect("the development example is a mapping") - .remove("products") - .expect("the native development example declares its products"); - assert!(!schema.is_valid(&composed)); + .remove("audiences"); + assert!( + !schema.is_valid(&without_audiences), + "audiences are required" + ); - let audiences = json!({"licences": "urn:example:licences", "casework": "urn:example:casework"}); - composed["audiences"] = audiences.clone(); + let mut service_owned = plan.clone(); + service_owned + .as_object_mut() + .expect("the development example is a mapping") + .remove("products"); assert!( - schema.is_valid(&composed), - "the runner accepts service audiences" + schema.is_valid(&service_owned), + "a sibling service.yaml may own the inventory" ); + for products in [ + json!([{"product": "breg", "project": "registry", "audience": "urn:example:licences"}]), + json!({"unknown": {"path": "registry"}}), + json!({"casework": {"projects": {"casework": {"path": "casework"}}}}), + ] { + let mut changed = plan.clone(); + changed["products"] = products; + assert!(!schema.is_valid(&changed), "{changed}"); + } + + let audiences = plan["audiences"].clone(); + let mut changed = plan; for invalid in [ json!({}), json!({"licences.branch": "urn:example:licences"}), json!({"licences": ""}), json!({"licences": null}), ] { - composed["audiences"] = invalid; - assert!(!schema.is_valid(&composed), "{composed}"); + changed["audiences"] = invalid; + assert!(!schema.is_valid(&changed), "{changed}"); } - composed["audiences"] = audiences; - composed["products"] = products; - assert!( - !schema.is_valid(&composed), - "the two product sources are exclusive" - ); + changed["audiences"] = audiences; + assert!(schema.is_valid(&changed)); } #[test] @@ -417,12 +430,10 @@ fn the_preview_examples_satisfy_the_composed_dev_and_service_schemas() { settings["issuer"] = json!("https://example.invalid"); assert!(!dev.is_valid(&settings), "a preview uses the run issuer"); settings["issuer"] = json!("run"); - settings.as_object_mut().unwrap().remove("audiences"); - settings["products"] = - json!([{"product":"breg", "project":"project", "audience":"urn:test:preview"}]); + settings["products"] = json!({"breg": {"projects": {"businesses": {"path": "project"}}}}); assert!( !dev.is_valid(&settings), - "a preview needs a composed service" + "a preview takes its products from service.yaml" ); } } diff --git a/crates/registry-rstack/src/cli.rs b/crates/registry-rstack/src/cli.rs index 1bb245d61f..9a2d48a022 100644 --- a/crates/registry-rstack/src/cli.rs +++ b/crates/registry-rstack/src/cli.rs @@ -1994,10 +1994,11 @@ impl DevNeeds { } } -/// The hosting products the project's dev.yaml lists under -/// `/products/*/product`, in hosting order. A missing, unreadable, oversized -/// or unparsable plan, or one without a products list, lists none: the first -/// available host then reports the real plan error, with the positioned +/// The hosting products the project's inventory names, in hosting order: the +/// product kinds under dev.yaml `products`, or else those of the sibling +/// service.yaml when dev.yaml only gives `audiences`. A missing, unreadable, +/// oversized or unparsable plan, or one without an inventory, lists none: the +/// first available host then reports the real plan error, with the positioned /// diagnostics every product gives for a malformed configuration file. fn plan_dev_products(project: &std::path::Path) -> Vec<&'static DevHost> { use registry_platform_yaml::{NodeValue, Reader, MAXIMUM_DOCUMENT_BYTES}; @@ -2013,30 +2014,25 @@ fn plan_dev_products(project: &std::path::Path) -> Vec<&'static DevHost> { let Ok(Some(root)) = Reader::new(file.display().to_string()).scan(&bytes) else { return Vec::new(); }; - if root.pointer("/audiences").is_some() { - let Ok(kinds) = service_plan::development_product_kinds(project) else { - return Vec::new(); - }; - return DEV_HOSTS + match root.pointer("/products").map(|node| &node.value) { + Some(NodeValue::Mapping(_)) => DEV_HOSTS .iter() - .filter(|host| kinds.contains(&host.component)) - .collect(); - } - let Some(NodeValue::Sequence(entries)) = root.pointer("/products").map(|node| &node.value) - else { - return Vec::new(); - }; - DEV_HOSTS - .iter() - .filter(|host| { - entries.iter().any(|entry| { - matches!( - entry.pointer("/product").map(|node| &node.value), - Some(NodeValue::String(text)) if text.text == host.component - ) + .filter(|host| { + root.pointer(&format!("/products/{}", host.component)) + .is_some() }) - }) - .collect() + .collect(), + None if root.pointer("/audiences").is_some() => { + let Ok(kinds) = service_plan::development_product_kinds(project) else { + return Vec::new(); + }; + DEV_HOSTS + .iter() + .filter(|host| kinds.contains(&host.component)) + .collect() + } + _ => Vec::new(), + } } /// The refusal when no host is available for an action that any host serves. diff --git a/crates/registry-rstack/tests/dev.rs b/crates/registry-rstack/tests/dev.rs index 5a5fae55f6..2126544891 100644 --- a/crates/registry-rstack/tests/dev.rs +++ b/crates/registry-rstack/tests/dev.rs @@ -619,15 +619,23 @@ fn root_and_dev_help_need_no_installation_or_binary_overrides() { fn write_plan(project: &Path, products: &[&str]) { let entries: Vec = products .iter() - .map(|product| { - format!(" - {{product: {product}, project: {product}, audience: \"urn:example:{product}\"}}\n") + .map(|product| match *product { + "breg" | "coordinator" | "evidence" => { + format!(" {product}: {{projects: {{{product}: {{path: {product}}}}}}}\n") + } + _ => format!(" {product}: {{path: {product}}}\n"), }) .collect(); + let audiences: Vec = products + .iter() + .map(|product| format!(" {product}: \"urn:example:{product}\"\n")) + .collect(); fs::write( project.join("dev.yaml"), format!( - "issuer: https://issuer.example\nproducts:\n{}", - entries.concat() + "issuer: https://issuer.example\nproducts:\n{}audiences:\n{}", + entries.concat(), + audiences.concat() ), ) .unwrap(); @@ -1086,11 +1094,11 @@ fn missing_breg_names_the_install_command_before_the_overrides() { } #[test] -fn casework_text_outside_the_products_list_does_not_require_casework() { +fn casework_text_outside_the_inventory_does_not_require_casework() { let tools = SourceTools::new(); fs::write( tools.project.join("dev.yaml"), - "# product: casework\nissuer: https://issuer.example\nproducts:\n - {product: breg, project: breg, audience: \"urn:example:breg\"}\njourneyFile: dev-journeys.yaml\nnotes:\n - name: \"product: casework\"\n", + "# casework: {path: casework}\nissuer: https://issuer.example\nproducts:\n breg: {projects: {breg: {path: breg}}}\naudiences:\n breg: \"urn:example:breg\"\njourneyFile: dev-journeys.yaml\nnotes:\n casework: {path: casework}\n", ) .unwrap(); let output = tools @@ -1114,7 +1122,7 @@ fn unreadable_plan_is_reported_by_the_first_available_host() { for plan in [ Some("products: [\n"), Some("issuer: https://issuer.example\n"), - Some("products:\n - {product: unrecognised, project: c, audience: c}\n"), + Some("products:\n unrecognised: {path: c}\naudiences: {unrecognised: c}\n"), None, ] { match plan { diff --git a/crates/registry-rstack/tests/dev_run.rs b/crates/registry-rstack/tests/dev_run.rs index 5635aba592..3efade81b6 100644 --- a/crates/registry-rstack/tests/dev_run.rs +++ b/crates/registry-rstack/tests/dev_run.rs @@ -182,7 +182,7 @@ fn launcher_selects_scheduling_for_a_scheduling_only_plan() { fs::set_permissions(&probe, fs::Permissions::from_mode(0o700)).unwrap(); fs::write( scratch.path().join("dev.yaml"), - "products: [{product: scheduling}]\n", + "products: {scheduling: {path: .}}\naudiences: {scheduling: urn:example:scheduling}\n", ) .unwrap(); let output = Command::new(env!("CARGO_BIN_EXE_rstack")) @@ -524,7 +524,7 @@ fn project(root: &std::path::Path, extra: &str) { apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1\n\ kind: RStackDev\n\ issuer: https://issuer.example.invalid\n\ -products:\n - {{product: breg, project: ., audience: registry}}\n\ +products:\n breg: {{projects: {{breg: {{path: .}}}}}}\naudiences:\n breg: registry\n\ people:\n operator:\n subject: operator\n client: operator-client\n roles: [operator]\n\ journeyFile: dev-journeys.yaml\n\ {extra}" @@ -1035,7 +1035,7 @@ fn semantic_project(root: &std::path::Path, product: &str, step_extra: &str) { "apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1\n\ kind: RStackDev\n\ issuer: https://issuer.example.invalid\n\ -products:\n - {product: breg, project: ., audience: private-audience-marker}\n\ +products:\n breg: {projects: {breg: {path: .}}}\naudiences:\n breg: private-audience-marker\n\ people:\n operator:\n subject: private-subject-marker\n client: private-client-marker\n roles: [operator]\n\ journeyFile: dev-journeys.yaml\n", ) @@ -1269,7 +1269,7 @@ fn casework_reference_project( "apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1\n\ kind: RStackDev\n\ issuer: https://issuer.example.invalid\n\ -products:\n - {{product: breg, project: ., audience: \"urn:example:registry\"}}\n - {{product: casework, project: casework, audience: \"urn:example:review\"}}\n\ +products:\n breg: {{projects: {{breg: {{path: .}}}}}}\n casework: {{path: casework}}\naudiences:\n breg: \"urn:example:registry\"\n casework: \"urn:example:review\"\n\ people:\n operator:\n subject: operator\n client: operator-client\n roles: [operator]\n reviewer:\n subject: reviewer\n client: reviewer-client\n roles: [reviewer]\n\ journeyFile: dev-journeys.yaml\n\ {bindings}" @@ -1355,7 +1355,7 @@ fn composed_project(root: &std::path::Path) -> String { fs::write(root.join("service.yaml"), DIRECT_SERVICE).unwrap(); let dev_file = root.join("dev.yaml"); let dev = fs::read_to_string(&dev_file).unwrap().replace( - "products:\n - {product: breg, project: ., audience: registry}\n", + "products:\n breg: {projects: {breg: {path: .}}}\naudiences:\n breg: registry\n", "audiences: {demo: registry}\n", ); fs::write(dev_file, &dev).unwrap(); @@ -1389,7 +1389,7 @@ fn check_assembles_products_from_service_without_writing_a_dev_plan() { fn check_rejects_competing_native_and_composed_product_lists() { let scratch = tempfile::tempdir().unwrap(); let state = scratch.path().join("state"); - project(scratch.path(), "audiences: {demo: registry}\n"); + project(scratch.path(), ""); fs::write(scratch.path().join("service.yaml"), DIRECT_SERVICE).unwrap(); let output = check(scratch.path(), &state, true); @@ -1422,7 +1422,7 @@ fn check_rejects_competing_native_and_composed_product_lists() { "{report}" ); assert!( - message.contains("The service file supplies the development products."), + message.contains("The service file already declares the development products."), "{report}" ); assert!(!state.exists()); @@ -1829,7 +1829,10 @@ fn check_and_start_refuse_a_fixture_symlink_outside_the_breg_project() { fs::write(scratch.path().join("breg/registry.yaml"), "fixture\n").unwrap(); let plan = fs::read_to_string(scratch.path().join("dev.yaml")) .unwrap() - .replace("product: breg, project: .", "product: breg, project: breg"); + .replace( + "breg: {projects: {breg: {path: .}}}", + "breg: {projects: {breg: {path: breg}}}", + ); fs::write(scratch.path().join("dev.yaml"), plan).unwrap(); fs::create_dir(scratch.path().join("breg/tests")).unwrap(); std::os::unix::fs::symlink( @@ -1843,7 +1846,7 @@ fn check_and_start_refuse_a_fixture_symlink_outside_the_breg_project() { assert_eq!(checked.status.code(), Some(1), "{checked:?}"); let report: serde_json::Value = serde_json::from_slice(&checked.stdout).unwrap(); let diagnostic = &report["diagnostics"][0]; - assert_eq!(diagnostic["path"], "/products/0/project"); + assert_eq!(diagnostic["path"], "/products/breg/projects/breg/path"); assert_eq!( diagnostic["message"], "The BReg fixture journeys file must be a readable regular file inside the BReg product project." @@ -1860,7 +1863,10 @@ fn check_and_start_refuse_a_fixture_symlink_outside_the_breg_project() { let report: serde_json::Value = serde_json::from_slice(&started.stdout).unwrap(); assert_error_envelope(&report, "domain"); let error = report["error"]["message"].as_str().unwrap(); - assert!(error.contains("/products/0/project"), "{error}"); + assert!( + error.contains("/products/breg/projects/breg/path"), + "{error}" + ); assert!(error.contains("fixture journeys file must be"), "{error}"); assert!(error.contains("without linking it outside"), "{error}"); assert!(!state.exists()); @@ -1951,8 +1957,8 @@ fn check_refuses_a_breg_project_directory_that_resolves_outside_the_project() { let plan = fs::read_to_string(scratch.path().join("dev.yaml")) .unwrap() .replace( - "product: breg, project: .", - "product: breg, project: linked-breg", + "breg: {projects: {breg: {path: .}}}", + "breg: {projects: {breg: {path: linked-breg}}}", ); fs::write(scratch.path().join("dev.yaml"), plan).unwrap(); @@ -1961,10 +1967,10 @@ fn check_refuses_a_breg_project_directory_that_resolves_outside_the_project() { assert_eq!(result.status.code(), Some(1), "{result:?}"); let report: serde_json::Value = serde_json::from_slice(&result.stdout).unwrap(); let diagnostic = &report["diagnostics"][0]; - assert_eq!(diagnostic["path"], "/products/0/project"); + assert_eq!(diagnostic["path"], "/products/breg/projects/breg/path"); assert_eq!( diagnostic["message"], - "The product project resolves outside the development project." + "This path must resolve to a directory inside the workspace." ); assert!(!state.exists()); } @@ -2038,6 +2044,36 @@ fn old_kind_is_refused_with_the_new_name() { assert!(!state.exists()); } +#[test] +fn check_refuses_the_retired_product_list_in_dev_yaml() { + let scratch = tempfile::tempdir().unwrap(); + let state = scratch.path().join("state"); + project(scratch.path(), ""); + let dev = scratch.path().join("dev.yaml"); + let mapping = "products:\n breg: {projects: {breg: {path: .}}}\n"; + let text = fs::read_to_string(&dev).unwrap(); + assert!(text.contains(mapping), "{text}"); + fs::write( + &dev, + text.replace( + mapping, + "products:\n - {product: breg, project: ., audience: registry}\n", + ), + ) + .unwrap(); + + let result = check(scratch.path(), &state, true); + + assert_eq!(result.status.code(), Some(1), "{result:?}"); + let report: serde_json::Value = serde_json::from_slice(&result.stdout).unwrap(); + let diagnostic = &report["diagnostics"][0]; + assert_eq!(diagnostic["code"], "rstack.dev.products-list", "{report}"); + assert_eq!(diagnostic["path"], "/products", "{report}"); + assert_eq!(diagnostic["source"]["file"], utf8(&dev), "{report}"); + assert!(diagnostic["source"]["line"].is_u64(), "{report}"); + assert!(!state.exists()); +} + #[test] fn check_renders_both_locations_of_a_duplicate_key() { let scratch = tempfile::tempdir().unwrap(); @@ -2050,7 +2086,7 @@ fn check_renders_both_locations_of_a_duplicate_key() { assert!(result.stdout.is_empty()); let human = String::from_utf8(result.stderr).unwrap(); assert!(human.starts_with("error[yaml.duplicate-key] "), "{human}"); - assert!(human.contains("dev.yaml:13:1 /issuer"), "{human}"); + assert!(human.contains("dev.yaml:15:1 /issuer"), "{human}"); assert!(human.contains("dev.yaml:4:1 /issuer"), "{human}"); assert!( human.contains("next: Keep one definition of the key."), @@ -2281,7 +2317,7 @@ fn start_rejects_a_role_with_no_breg_profile_facts_before_allocating_state() { "apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1\n\ kind: RStackDev\n\ issuer: https://issuer.example.invalid\n\ -products:\n - {product: breg, project: ., audience: registry}\n\ +products:\n breg: {projects: {breg: {path: .}}}\naudiences:\n breg: registry\n\ people:\n editor:\n subject: editor\n client: editor-client\n roles: [editor]\n claims: {breg: {jurisdiction: zone-a}}\n unused:\n subject: unused\n client: unused-client\n roles: [unused]\n\ journeyFile: dev-journeys.yaml\n", ) @@ -2459,9 +2495,9 @@ fn check_refuses_binding_configuration_the_products_would_refuse_at_the_plan_fie ), ( "audience", - "audience: \"urn:example:registry\"", - "audience: registry", - "/products/0/audience", + "breg: \"urn:example:registry\"", + "breg: registry", + "/audiences/breg", "Casework refuses", ), ] { @@ -2509,7 +2545,7 @@ fn check_refuses_a_context_provider_binding_with_the_rule_caseworkctl_check_name let text = fs::read_to_string(&dev).unwrap(); fs::write( &dev, - text.replace("audience: \"urn:example:registry\"", "audience: registry"), + text.replace("breg: \"urn:example:registry\"", "breg: registry"), ) .unwrap(); @@ -2519,7 +2555,7 @@ fn check_refuses_a_context_provider_binding_with_the_rule_caseworkctl_check_name let report: serde_json::Value = serde_json::from_slice(&checked.stdout).unwrap(); assert_eq!(report["status"], "domain-refusal"); let diagnostic = &report["diagnostics"][0]; - assert_eq!(diagnostic["path"], "/products/0/audience"); + assert_eq!(diagnostic["path"], "/audiences/breg"); assert_eq!( diagnostic["message"], "Casework refuses the binding configuration the run writes from this value: \ @@ -2558,7 +2594,7 @@ fragment or userinfo." let report: serde_json::Value = serde_json::from_slice(&unavailable.stdout).unwrap(); assert_eq!(report["status"], "operational-failure"); let diagnostic = &report["diagnostics"][0]; - assert_eq!(diagnostic["path"], "/products/1/project"); + assert_eq!(diagnostic["path"], "/products/casework/path"); assert_eq!( diagnostic["message"], "The selected `caseworkctl` helper could not check the Casework configuration the run writes: caseworkctl check did not report a result for the binding." @@ -2608,8 +2644,14 @@ fn check_distinguishes_an_unavailable_casework_helper_from_an_invalid_project() let report: serde_json::Value = serde_json::from_slice(&unavailable.stdout).unwrap(); assert_eq!(report["status"], "operational-failure"); let diagnostic = &report["diagnostics"][0]; - assert_eq!(diagnostic["path"], "/products/1/project"); + assert_eq!(diagnostic["path"], "/products/casework/path"); assert_eq!(diagnostic["code"], "rstack.dev.check-unavailable"); + assert_eq!( + diagnostic["source"]["file"], + utf8(&scratch.path().join("dev.yaml")), + "{report}" + ); + assert!(diagnostic["source"]["line"].is_u64(), "{report}"); assert!( diagnostic["message"] .as_str() @@ -2646,8 +2688,14 @@ fn check_distinguishes_an_unavailable_casework_helper_from_an_invalid_project() let report: serde_json::Value = serde_json::from_slice(&helper_failure.stdout).unwrap(); assert_eq!(report["status"], "operational-failure"); let diagnostic = &report["diagnostics"][0]; - assert_eq!(diagnostic["path"], "/products/1/project"); + assert_eq!(diagnostic["path"], "/products/casework/path"); assert_eq!(diagnostic["code"], "rstack.dev.check-unavailable"); + assert_eq!( + diagnostic["source"]["file"], + utf8(&scratch.path().join("dev.yaml")), + "{report}" + ); + assert!(diagnostic["source"]["line"].is_u64(), "{report}"); assert!( diagnostic["message"] .as_str() @@ -2678,7 +2726,7 @@ fn check_distinguishes_an_unavailable_casework_helper_from_an_invalid_project() let report: serde_json::Value = serde_json::from_slice(&invalid.stdout).unwrap(); assert_eq!(report["status"], "domain-refusal"); let diagnostic = &report["diagnostics"][0]; - assert_eq!(diagnostic["path"], "/products/1/project"); + assert_eq!(diagnostic["path"], "/products/casework/path"); assert_eq!( diagnostic["message"], "The owning casework tool refused this project's identity facts (casework.project.invalid)." @@ -2696,7 +2744,7 @@ fn a_malformed_plan_names_its_field_before_allocating_run_state() { let state = scratch.path().join("state"); fs::write( scratch.path().join("dev.yaml"), - "apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1\nkind: RStackDev\nissuer: https://example.test\nproducts: [{product: unrecognised, project: registry, audience: test}]\npeople: {}\njourneyFile: dev-journeys.yaml\n", + "apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1\nkind: RStackDev\nissuer: https://example.test\nproducts: {unrecognised: {path: registry}}\naudiences: {unrecognised: test}\npeople: {}\njourneyFile: dev-journeys.yaml\n", ) .unwrap(); // The plan lists no hosting product, so the first available host reports @@ -2710,7 +2758,7 @@ fn a_malformed_plan_names_its_field_before_allocating_run_state() { report["error"]["message"] .as_str() .unwrap() - .contains("/products/0/product"), + .contains("/products/unrecognised"), "{report}" ); assert!(!state.exists()); @@ -2818,7 +2866,8 @@ fn worker_restores_a_valid_plan_whose_captured_input_exceeds_512_kib() { "apiVersion": "id.registrystack.org/formats/rstack/dev/v1alpha1", "kind": "RStackDev", "issuer": "https://issuer.example.invalid", - "products": [{"product": "breg", "project": ".", "audience": "registry"}], + "products": {"breg": {"projects": {"breg": {"path": "."}}}}, + "audiences": {"breg": "registry"}, "people": {"operator": { "subject": "operator", "client": "operator-client", "roles": ["operator"] @@ -3062,7 +3111,9 @@ fn casework_only_project(root: &std::path::Path) { "kind: RStackDev\n", "issuer: https://issuer.example.invalid\n", "products:\n", - " - {product: casework, project: casework, audience: \"urn:example:review\"}\n", + " casework: {path: casework}\n", + "audiences:\n", + " casework: \"urn:example:review\"\n", "people:\n", " staff:\n", " subject: staff\n", @@ -4372,6 +4423,38 @@ fn preview_check_is_offline_and_reports_invalid_actor_and_routes() { "{diagnostic}" ); assert!(!state.exists()); + + // A preview takes its products from service.yaml, not from dev.yaml. + let products = "products:\n breg:\n projects:\n demo: {path: .}\n"; + assert!(original.contains(products), "{original}"); + fs::write(&service, original.replace(products, "")).unwrap(); + fs::write( + project.join("dev.yaml"), + format!( + "{}{preview}", + dev.replace( + "audiences: {demo: registry}\n", + &format!("{products}audiences: {{demo: registry}}\n"), + ) + ), + ) + .unwrap(); + let refused = check(project, &state, true); + assert_eq!(refused.status.code(), Some(1), "{refused:?}"); + let report: serde_json::Value = serde_json::from_slice(&refused.stdout).unwrap(); + let diagnostic = &report["diagnostics"][0]; + assert_eq!(diagnostic["path"], "/products", "{report}"); + assert_eq!( + diagnostic["source"]["file"], + utf8(&project.join("dev.yaml")), + "{report}" + ); + assert_eq!( + diagnostic["message"], + "A browser preview takes its products from the sibling service.yaml." + ); + assert!(!state.exists()); + fs::write(project.join("dev.yaml"), format!("{dev}{preview}")).unwrap(); fs::write(&service, original).unwrap(); let started = dev_json(&state, &["start", utf8(project)]); diff --git a/docs/site/scripts/generate-breg-configuration.test.mjs b/docs/site/scripts/generate-breg-configuration.test.mjs index 78143d7ec4..c321f7ff03 100644 --- a/docs/site/scripts/generate-breg-configuration.test.mjs +++ b/docs/site/scripts/generate-breg-configuration.test.mjs @@ -92,7 +92,8 @@ test('BReg tool and service references read the committed schemas they name', as const projectDev = fields('tools', 'rstack-dev'); assert.deepEqual(projectDev.get('kind').values, ['RStackDev']); - assert.ok(projectDev.has('products[].product')); + assert.ok(projectDev.has('products.breg.projects.*.path')); + assert.ok(projectDev.has('audiences.*')); assert.ok(fields('tools', 'rstack-journeys').has('journeys[].steps[].expect.status')); const savedReport = fields('tools', 'ctl-report'); diff --git a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx index 822dd5c170..e94d7d86d9 100644 --- a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx +++ b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx @@ -376,13 +376,17 @@ Stop the run with `rstack dev stop "$RUN"`. To adapt a plan to your own project, change these parts and leave the structure alone: - `issuer` names the identity issuer the local test tokens claim. Use a name that is yours. -- `products` lists each product's project directory and token audience, in any order. Name any - nonempty subset of `breg`, `casework`, `evidence`, `messaging`, `scheduling`, - `documents`, `coordinator`, `adapter`, `render` and `discovery`. The run starts - BReg before Casework. An application needs BReg. +- `products` maps each product kind to its project directory, the same shape as `service.yaml`. + BReg, Coordinator and Evidence name their projects under `projects` + (`products.breg.projects.breg.path`); `casework`, `messaging`, `scheduling`, `documents`, + `adapter`, `render` and `discovery` take one `path`. Use one project of each kind. The run + starts BReg before Casework. An application needs BReg. A directory has one inventory: when + a sibling `service.yaml` declares `products`, leave them out of `dev.yaml`. +- `audiences` gives each project its token audience, keyed by its project ID (the member name + under `projects`, or the product kind for a single `path`). - `personAudience` is optional. It names one audience, an absolute URI, that products a person - calls from a page will share. Only BReg can be a member, by setting its `audience` to the same - value. It may be a member whether or not it checks task grants, because it is the one member + calls from a page will share. Only BReg can be a member, by setting its entry in `audiences` + to the same value. It may be a member whether or not it checks task grants, because it is the one member allowed to. Casework keeps its own audience, Messaging takes no person token, and Evidence cannot join yet, so `check` and `start` refuse each of them as a member. Declaring `personAudience` alone changes nothing at run time. Every other audience must stay distinct. @@ -471,7 +475,7 @@ fields. ## Use an issuer you run Set `issuer` to the exact token issuer and `externalJwksUri` to its public key endpoint. -Use numeric loopback HTTP with an explicit port for the issuer, key endpoint and external BReg connections. Keep each product's audience in its `products` entry. +Use numeric loopback HTTP with an explicit port for the issuer, key endpoint and external BReg connections. Keep each product's audience in `audiences`. Tokens from an issuer you run carry no development mark, so use an issuer that only this run trusts. BReg expects RS256 access tokens from an external issuer. @@ -677,7 +681,7 @@ Supply person-specific claim values in the person's product-keyed `claims` mappi The run derives scopes and purposes from the product facts for the selected profiles. Each selected profile receives the test person's subject in its principal claim. The products enforce their ordinary permissions. -Every product keeps its own audience. `personAudience` records the audience that products a person calls from a page will share. Only BReg can take it, by setting its `audience` to the same value. +Every product keeps its own audience. `personAudience` records the audience that products a person calls from a page will share. Only BReg can take it, by setting its entry in `audiences` to the same value. Set `actor` on each step in the BReg project's `tests/journeys.yaml` to choose the test person by ID. When each step names its actor and the run uses its own issuer, the rehearsal obtains each bearer in memory. The run obtains the normal schema-test receipt before packaging. diff --git a/docs/site/src/content/docs/tutorials/derive-a-registry-from-publicschema.mdx b/docs/site/src/content/docs/tutorials/derive-a-registry-from-publicschema.mdx index ecb69dd237..3dcbce3163 100644 --- a/docs/site/src/content/docs/tutorials/derive-a-registry-from-publicschema.mdx +++ b/docs/site/src/content/docs/tutorials/derive-a-registry-from-publicschema.mdx @@ -227,7 +227,12 @@ apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 kind: RStackDev issuer: https://identity.household.example.test products: - - {product: breg, project: ., audience: "urn:example:household-registry"} + breg: + projects: + breg: + path: . +audiences: + breg: "urn:example:household-registry" people: operator: subject: household-registry-operator diff --git a/docs/site/src/content/docs/tutorials/first-breg.mdx b/docs/site/src/content/docs/tutorials/first-breg.mdx index 02b6617226..559455591b 100644 --- a/docs/site/src/content/docs/tutorials/first-breg.mdx +++ b/docs/site/src/content/docs/tutorials/first-breg.mdx @@ -127,7 +127,12 @@ claim `zone-b`: ```yaml title="dev.yaml" test-excerpt="dev.yaml" issuer: https://identity.directory.example.test products: - - {product: breg, project: ., audience: "urn:example:local-directory"} + breg: + projects: + breg: + path: . +audiences: + breg: "urn:example:local-directory" people: editor: subject: synthetic-directory-editor diff --git a/docs/site/src/content/docs/tutorials/first-evidence-assertion.mdx b/docs/site/src/content/docs/tutorials/first-evidence-assertion.mdx index d012a8a293..c15732928f 100644 --- a/docs/site/src/content/docs/tutorials/first-evidence-assertion.mdx +++ b/docs/site/src/content/docs/tutorials/first-evidence-assertion.mdx @@ -161,7 +161,12 @@ apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 kind: RStackDev issuer: run products: - - {product: evidence, project: ., audience: "urn:example:resource:standalone-evidence"} + evidence: + projects: + evidence: + path: . +audiences: + evidence: "urn:example:resource:standalone-evidence" people: caller: subject: "urn:registrystack:evidence:local:client:example-caller" diff --git a/docs/site/src/content/docs/tutorials/first-messaging.mdx b/docs/site/src/content/docs/tutorials/first-messaging.mdx index 73ebb066ec..8ac44663f2 100644 --- a/docs/site/src/content/docs/tutorials/first-messaging.mdx +++ b/docs/site/src/content/docs/tutorials/first-messaging.mdx @@ -81,7 +81,10 @@ reports ready. The plan holds no keys and no addresses: ```yaml title="dev.yaml" test-excerpt="tutorial-work/notices/dev.yaml" issuer: https://identity.starter.example.test products: - - {product: messaging, project: ., audience: "urn:example:messaging"} + messaging: + path: . +audiences: + messaging: "urn:example:messaging" people: case-system: subject: case-system diff --git a/products/adapter/examples/dev-starter/dev.yaml b/products/adapter/examples/dev-starter/dev.yaml index e274de8086..0765c6784c 100644 --- a/products/adapter/examples/dev-starter/dev.yaml +++ b/products/adapter/examples/dev-starter/dev.yaml @@ -3,7 +3,10 @@ apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 kind: RStackDev issuer: https://identity.starter.example.test products: - - {product: adapter, project: ., audience: "urn:example:adapter"} + adapter: + path: . +audiences: + adapter: "urn:example:adapter" people: reader: subject: starter-reader diff --git a/products/breg/acceptance/facility/dev.yaml b/products/breg/acceptance/facility/dev.yaml index c8c2911286..d86658c668 100644 --- a/products/breg/acceptance/facility/dev.yaml +++ b/products/breg/acceptance/facility/dev.yaml @@ -4,7 +4,12 @@ kind: RStackDev # BReg alone. The project-root dev-journeys.yaml holds the run's HTTP requests. issuer: https://identity.facility.example.test products: - - {product: breg, project: ., audience: "urn:example:facility-registry"} + breg: + projects: + breg: + path: . +audiences: + breg: "urn:example:facility-registry" people: facility-operator: subject: synthetic-facility-operator diff --git a/products/breg/acceptance/generated-identifiers/dev.yaml b/products/breg/acceptance/generated-identifiers/dev.yaml index 4f4f9a16ea..fc14412f2a 100644 --- a/products/breg/acceptance/generated-identifiers/dev.yaml +++ b/products/breg/acceptance/generated-identifiers/dev.yaml @@ -5,7 +5,12 @@ kind: RStackDev # key under this logical issuer. issuer: https://identity.identifiers.example.test products: - - {product: breg, project: ., audience: "urn:example:generated-identifiers"} + breg: + projects: + breg: + path: . +audiences: + breg: "urn:example:generated-identifiers" people: clerk-a: subject: synthetic-clerk-a diff --git a/products/breg/acceptance/issuer-portability/dev.yaml b/products/breg/acceptance/issuer-portability/dev.yaml index ea27d913e5..f8926cbe3a 100644 --- a/products/breg/acceptance/issuer-portability/dev.yaml +++ b/products/breg/acceptance/issuer-portability/dev.yaml @@ -6,7 +6,12 @@ kind: RStackDev # root so bregctl discovers native schema checks under tests/ independently. issuer: https://identity.portability.example.test products: - - {product: breg, project: ., audience: "urn:example:issuer-portability"} + breg: + projects: + breg: + path: . +audiences: + breg: "urn:example:issuer-portability" people: clerk-service: subject: urn:institution:service-clerk diff --git a/products/breg/acceptance/reviewed-evidence-journey/dev.yaml b/products/breg/acceptance/reviewed-evidence-journey/dev.yaml index a27097f2ee..aa3ca3e072 100644 --- a/products/breg/acceptance/reviewed-evidence-journey/dev.yaml +++ b/products/breg/acceptance/reviewed-evidence-journey/dev.yaml @@ -3,8 +3,15 @@ apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 kind: RStackDev issuer: https://issuer.example.test products: - - {product: breg, project: registry, audience: "urn:journey:breg"} - - {product: casework, project: casework, audience: "urn:journey:casework"} + breg: + projects: + breg: + path: registry + casework: + path: casework +audiences: + breg: "urn:journey:breg" + casework: "urn:journey:casework" bindings: bregReviewAuthority: {id: casework, producer: registry, identity: producer} caseworkContextProvider: {id: registry, identity: context-status, action: correct-status} diff --git a/products/breg/acceptance/spatial-service-sites/dev.yaml b/products/breg/acceptance/spatial-service-sites/dev.yaml index bca4e01c4d..7c3cf385fd 100644 --- a/products/breg/acceptance/spatial-service-sites/dev.yaml +++ b/products/breg/acceptance/spatial-service-sites/dev.yaml @@ -5,7 +5,12 @@ kind: RStackDev # at the project root and BReg's native schema checks under tests/. issuer: https://identity.service-sites.example.test products: - - {product: breg, project: ., audience: "urn:example:service-sites"} + breg: + projects: + breg: + path: . +audiences: + breg: "urn:example:service-sites" people: operator: subject: synthetic-service-site-admin diff --git a/products/breg/evidence/registry/dev.yaml b/products/breg/evidence/registry/dev.yaml index dea45ba6ac..ca1323f235 100644 --- a/products/breg/evidence/registry/dev.yaml +++ b/products/breg/evidence/registry/dev.yaml @@ -3,9 +3,12 @@ apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 kind: RStackDev issuer: https://identity.evidence.example.test products: - - product: breg - project: . - audience: urn:example:evidence-registry + breg: + projects: + breg: + path: . +audiences: + breg: urn:example:evidence-registry people: operator: subject: generic-registry-operator diff --git a/products/breg/examples/external-views/dev.yaml b/products/breg/examples/external-views/dev.yaml index 2aefa7a286..7556746dab 100644 --- a/products/breg/examples/external-views/dev.yaml +++ b/products/breg/examples/external-views/dev.yaml @@ -3,9 +3,12 @@ apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 kind: RStackDev issuer: https://fixture-issuer.example.test/licensing products: - - product: breg - project: . - audience: urn:breg:external-views-fixture + breg: + projects: + breg: + path: . +audiences: + breg: urn:breg:external-views-fixture people: officer: subject: synthetic-licensing-officer diff --git a/products/breg/examples/facility/dev.yaml b/products/breg/examples/facility/dev.yaml index a07bb123d4..56296ed27c 100644 --- a/products/breg/examples/facility/dev.yaml +++ b/products/breg/examples/facility/dev.yaml @@ -6,7 +6,12 @@ kind: RStackDev # and BReg's native schema checks under tests/. issuer: https://identity.facility.example.test products: - - {product: breg, project: ., audience: "urn:example:facility-registry"} + breg: + projects: + breg: + path: . +audiences: + breg: "urn:example:facility-registry" people: operator-editor: subject: synthetic-operator-editor diff --git a/products/breg/examples/minimal/dev.yaml b/products/breg/examples/minimal/dev.yaml index 5d1b35a6cd..be2763a58f 100644 --- a/products/breg/examples/minimal/dev.yaml +++ b/products/breg/examples/minimal/dev.yaml @@ -6,7 +6,12 @@ kind: RStackDev # holds the run's HTTP requests at the project root. issuer: https://identity.directory.example.test products: - - {product: breg, project: ., audience: "urn:example:local-directory"} + breg: + projects: + breg: + path: . +audiences: + breg: "urn:example:local-directory" people: editor: subject: synthetic-directory-editor diff --git a/products/breg/fixtures/generic-operator-workflows/dev.yaml b/products/breg/fixtures/generic-operator-workflows/dev.yaml index 28ad478abf..1e18f33aca 100644 --- a/products/breg/fixtures/generic-operator-workflows/dev.yaml +++ b/products/breg/fixtures/generic-operator-workflows/dev.yaml @@ -8,7 +8,12 @@ kind: RStackDev # dev-journeys.yaml holds the run's HTTP requests. issuer: https://identity.generic-registry.example.test products: - - {product: breg, project: ., audience: "urn:example:generic-registry"} + breg: + projects: + breg: + path: . +audiences: + breg: "urn:example:generic-registry" people: operator: subject: generic-registry-operator diff --git a/products/breg/fixtures/multi-reference-array-claim/dev.yaml b/products/breg/fixtures/multi-reference-array-claim/dev.yaml index 926b0b4819..b63b264693 100644 --- a/products/breg/fixtures/multi-reference-array-claim/dev.yaml +++ b/products/breg/fixtures/multi-reference-array-claim/dev.yaml @@ -6,7 +6,12 @@ kind: RStackDev # allowed_jurisdictions claim, so each refusal step names its person. issuer: https://identity.permits.example.test products: - - {product: breg, project: ., audience: "urn:example:permit-registry"} + breg: + projects: + breg: + path: . +audiences: + breg: "urn:example:permit-registry" people: reference-loader: subject: synthetic-reference-loader diff --git a/products/breg/loadtest/support/loadenv.py b/products/breg/loadtest/support/loadenv.py index 8d71e12beb..a304d4ee4a 100755 --- a/products/breg/loadtest/support/loadenv.py +++ b/products/breg/loadtest/support/loadenv.py @@ -32,7 +32,9 @@ kind: RStackDev issuer: https://identity.loadtest.example.test products: - - {product: breg, project: ., audience: "urn:example:business-establishments"} + breg: {projects: {breg: {path: .}}} +audiences: + breg: "urn:example:business-establishments" people: loadtest-driver: subject: synthetic-business-operator diff --git a/products/casework/examples/standalone-decision/dev.yaml b/products/casework/examples/standalone-decision/dev.yaml index 8f0ae3414c..cb5bf471d0 100644 --- a/products/casework/examples/standalone-decision/dev.yaml +++ b/products/casework/examples/standalone-decision/dev.yaml @@ -6,7 +6,10 @@ kind: RStackDev # throwaway local key under this name. issuer: https://identity.standalone.example.test products: - - {product: casework, project: ., audience: "urn:example:standalone-decision"} + casework: + path: . +audiences: + casework: "urn:example:standalone-decision" people: administrator: subject: administrator diff --git a/products/coordinator/examples/delayed-follow-up/dev.yaml b/products/coordinator/examples/delayed-follow-up/dev.yaml index 9ffb968ae2..95e331c5b5 100644 --- a/products/coordinator/examples/delayed-follow-up/dev.yaml +++ b/products/coordinator/examples/delayed-follow-up/dev.yaml @@ -3,7 +3,12 @@ apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 kind: RStackDev issuer: https://identity.starter.example.test products: - - {product: coordinator, project: ., audience: "urn:example:coordinator"} + coordinator: + projects: + coordinator: + path: . +audiences: + coordinator: "urn:example:coordinator" people: reader: subject: starter-reader diff --git a/products/coordinator/examples/earlier-appointment-alerts/source-registry/dev.yaml b/products/coordinator/examples/earlier-appointment-alerts/source-registry/dev.yaml index 7feeb74741..417f45d58f 100644 --- a/products/coordinator/examples/earlier-appointment-alerts/source-registry/dev.yaml +++ b/products/coordinator/examples/earlier-appointment-alerts/source-registry/dev.yaml @@ -3,9 +3,12 @@ apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 kind: RStackDev issuer: https://identity.alerts.example.test products: - - product: breg - project: . - audience: urn:example:earlier-appointment-alert-source + breg: + projects: + breg: + path: . +audiences: + breg: urn:example:earlier-appointment-alert-source people: alert-administrator: subject: alert-administrator diff --git a/products/coordinator/scripts/test-real-services.py b/products/coordinator/scripts/test-real-services.py index 380b0e0a8a..aab32f6bd1 100644 --- a/products/coordinator/scripts/test-real-services.py +++ b/products/coordinator/scripts/test-real-services.py @@ -698,12 +698,18 @@ def start_dev_issuer(self, breg_project, coordinator_project): "kind": "RStackDev", "issuer": "https://dev-issuer.local.test", "journeyFile": "dev-journeys.yaml", - "products": [ - {"product": "breg", "project": "breg", "audience": self.issuer_resource}, - {"product": "casework", "project": "casework", "audience": self.casework_resource}, - {"product": "messaging", "project": "messaging", "audience": "urn:example:messaging"}, - {"product": "coordinator", "project": "coordinator", "audience": COORDINATOR_RESOURCE}, - ], + "products": { + "breg": {"projects": {"breg": {"path": "breg"}}}, + "casework": {"path": "casework"}, + "messaging": {"path": "messaging"}, + "coordinator": {"projects": {"coordinator": {"path": "coordinator"}}}, + }, + "audiences": { + "breg": self.issuer_resource, + "casework": self.casework_resource, + "messaging": "urn:example:messaging", + "coordinator": COORDINATOR_RESOURCE, + }, "people": { alias: { "subject": principal, "client": alias, "roles": [alias], @@ -1000,7 +1006,8 @@ def fixture_key(client, purpose): private(project / "dev.yaml", { "apiVersion": "id.registrystack.org/formats/rstack/dev/v1alpha1", "kind": "RStackDev", "issuer": issuer, "externalJwksUri": issuer + "/oauth2/jwks", - "products": [{"product": "breg", "project": ".", "audience": resource}], + "products": {"breg": {"projects": {"breg": {"path": "."}}}}, + "audiences": {"breg": resource}, "people": people, "journeyFile": "dev-journeys.yaml", "externalBreg": external, }) private(project / "dev-journeys.yaml", { diff --git a/products/discovery/examples/starter/dev.yaml b/products/discovery/examples/starter/dev.yaml index 040fb9451a..bcaec3bce0 100644 --- a/products/discovery/examples/starter/dev.yaml +++ b/products/discovery/examples/starter/dev.yaml @@ -3,6 +3,9 @@ apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 kind: RStackDev issuer: https://identity.starter.example.test products: - - {product: discovery, project: ., audience: "urn:example:discovery"} + discovery: + path: . +audiences: + discovery: "urn:example:discovery" people: {} journeyFile: dev-journeys.yaml diff --git a/products/documents/examples/development-starter/dev.yaml b/products/documents/examples/development-starter/dev.yaml index 6abc4b0d3a..5fb52b2156 100644 --- a/products/documents/examples/development-starter/dev.yaml +++ b/products/documents/examples/development-starter/dev.yaml @@ -3,7 +3,10 @@ apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 kind: RStackDev issuer: https://identity.starter.example.test products: - - {product: documents, project: ., audience: "urn:example:documents"} + documents: + path: . +audiences: + documents: "urn:example:documents" people: reader: subject: starter-reader diff --git a/products/evidence/examples/fhir/dev.yaml b/products/evidence/examples/fhir/dev.yaml index 14176b7949..be3e0b4b6b 100644 --- a/products/evidence/examples/fhir/dev.yaml +++ b/products/evidence/examples/fhir/dev.yaml @@ -8,7 +8,12 @@ kind: RStackDev # README shows: `python3 serve-source.py`. issuer: run products: - - {product: evidence, project: ., audience: "urn:example:resource:fhir-record-evidence"} + evidence: + projects: + evidence: + path: . +audiences: + evidence: "urn:example:resource:fhir-record-evidence" people: caller: subject: "urn:registrystack:evidence:local:client:fhir-client" diff --git a/products/evidence/examples/standalone/dev.yaml b/products/evidence/examples/standalone/dev.yaml index e54d6d454a..9f31d5b15d 100644 --- a/products/evidence/examples/standalone/dev.yaml +++ b/products/evidence/examples/standalone/dev.yaml @@ -9,7 +9,12 @@ kind: RStackDev # `python3 serve-source.py --port 8081`. issuer: run products: - - {product: evidence, project: ., audience: "urn:example:resource:standalone-evidence"} + evidence: + projects: + evidence: + path: . +audiences: + evidence: "urn:example:resource:standalone-evidence" people: caller: subject: "urn:registrystack:evidence:local:client:example-caller" diff --git a/products/evidence/loadtest/support/loadenv.py b/products/evidence/loadtest/support/loadenv.py index efc71dd536..bd73ba5778 100755 --- a/products/evidence/loadtest/support/loadenv.py +++ b/products/evidence/loadtest/support/loadenv.py @@ -178,7 +178,9 @@ def dev_plan(clients: int) -> str: "kind: RStackDev", "issuer: run", "products:", - f' - {{product: evidence, project: ., audience: "{DEV_AUDIENCE}"}}', + " evidence: {projects: {evidence: {path: .}}}", + "audiences:", + f' evidence: "{DEV_AUDIENCE}"', "people:", ] for client in client_ids(clients): diff --git a/products/evidence/loadtest/support/test_harness.py b/products/evidence/loadtest/support/test_harness.py index cb31dd5b1b..6a028ae091 100644 --- a/products/evidence/loadtest/support/test_harness.py +++ b/products/evidence/loadtest/support/test_harness.py @@ -308,6 +308,11 @@ def test_local_project_adds_a_bounded_synthetic_source_and_refuses_reuse(self) - dev_plan = (project / "dev.yaml").read_text(encoding="utf-8") self.assertIn("kind: RStackDev", dev_plan) self.assertIn("issuer: run", dev_plan) + self.assertIn( + "products:\n evidence: {projects: {evidence: {path: .}}}\n" + f'audiences:\n evidence: "{loadenv.DEV_AUDIENCE}"\n', + dev_plan, + ) self.assertIn("journeyFile: dev-journeys.yaml", dev_plan) self.assertEqual(dev_plan.count("roles: [standalone-service]"), 3) self.assertEqual((project / "service.yaml").read_bytes(), (canonical / "service.yaml").read_bytes()) diff --git a/products/identifiers/generated/catalog.v1.json b/products/identifiers/generated/catalog.v1.json index a3f8dcb426..773f92b956 100644 --- a/products/identifiers/generated/catalog.v1.json +++ b/products/identifiers/generated/catalog.v1.json @@ -5267,7 +5267,7 @@ }, "artifact": { "path": "products/adapter/schemas/job-runtime.v1alpha1.schema.json", - "sha256": "867bd2e4a48ffa4e639002d8b19522804d6716903c99508c2a4d4436a3b96398", + "sha256": "fd12314109d5ecacf116c9489f928fdb22dc7a5459c79096005b0d887f34d2d2", "mediaType": "application/schema+json" } }, @@ -5447,7 +5447,7 @@ }, "artifact": { "path": "products/adapter/schemas/runtime.v1alpha1.schema.json", - "sha256": "99d3b0f61717e804fde996a4f042d375a3957e4f6e07bd9d313ef31c1310529c", + "sha256": "114aa69242ef4bda35c5ebdf71530fd9551b5b365890ef8a440d1df23db7028e", "mediaType": "application/schema+json" } }, @@ -5663,7 +5663,7 @@ }, "artifact": { "path": "products/breg/generated/mcp-runtime/mcp-runtime.schema.json", - "sha256": "a1272f3d77f9a8e27425e8613d3a2cf76cb37e60eb90c6473660b9f7e0d3da8c", + "sha256": "8b759e11301ca05eadb951aff39dfbb31b05481e68d222b4237c66661edc06f1", "mediaType": "application/schema+json" } }, @@ -5807,7 +5807,7 @@ }, "artifact": { "path": "products/breg/generated/review-runtime/review-runtime.schema.json", - "sha256": "ec5d87d3668095586a821abd7a0f8b998bdad11f10123392188de6808bd129d9", + "sha256": "7009f1c4301a93861873dd849b7abbc1193637a2ac2c84fd9b2fbfcd52378e01", "mediaType": "application/schema+json" } }, @@ -5843,7 +5843,7 @@ }, "artifact": { "path": "products/breg/generated/runtime/runtime.schema.json", - "sha256": "d04c498a9cf820332b5d8a9f09b61e215bc0c3dca6d770b49e67cf4844626d9e", + "sha256": "e99a03becdfdf693da8cbdd8e37319a4c1ce2f9c1588ec78c4813005e9f0f0c2", "mediaType": "application/schema+json" } }, @@ -5951,7 +5951,7 @@ }, "artifact": { "path": "products/casework/generated/runtime/runtime.schema.json", - "sha256": "43f97b7653608f98df7093fde327d515d76380213350af7c85d027e609c70099", + "sha256": "d7119a087c77192b099034d1304922118b9be1a9efa2e04adcab533629fa0f1f", "mediaType": "application/schema+json" } }, @@ -6005,7 +6005,7 @@ }, "artifact": { "path": "products/coordinator/generated/runtime/runtime.schema.json", - "sha256": "24839c55d2b01edab884dcc18ee1324689dbd52fe958fba51fe55cc5b15d2099", + "sha256": "e13ad43e7b12338611fc69a0e2c9c0def7dbe42ff7655cdb7180f0c4d719d3c5", "mediaType": "application/schema+json" } }, @@ -6167,7 +6167,7 @@ }, "artifact": { "path": "products/documents/generated/runtime/runtime.schema.json", - "sha256": "d076eeea14926df9c8812c5e01f1a1e6dbfb2556e490404d848203ee67492de7", + "sha256": "493af8d7b9a450903138e999f63142e128807e50cfb7a27f429269b50cc013d2", "mediaType": "application/schema+json" } }, @@ -6325,11 +6325,11 @@ "description": "Evidence OID4VCI delivery runtime configuration JSON Schema.", "source": { "path": "crates/registry-evidence-oid4vci/src/schema.rs", - "sha256": "a68d455ad4aae15031875f71af0047197cac6224aaa5f62f5c4a8cc936527224" + "sha256": "4765ede33c3ad60e6defd1fd4f7fb59180dd0f9ab04280e8d83a0e5f25081a5d" }, "artifact": { "path": "products/evidence/generated/oid4vci-runtime/oid4vci-runtime.schema.json", - "sha256": "01a20c74693699d6be5c62584edbf3137e49fbf2f3c2c4c5616004a873b5b765", + "sha256": "39cf28ae80e6eee04ace9474c6652d52659167d847073d54ff01e72a322150ab", "mediaType": "application/schema+json" } }, @@ -6347,7 +6347,7 @@ }, "artifact": { "path": "products/evidence/generated/oid4vp-runtime/oid4vp-runtime.schema.json", - "sha256": "81d70d9488a0bd7cdbaf897ad016fe9cca86b862b5ee5e6b891279b0197a52d6", + "sha256": "b228e4e511c6c6afc2b5ac12edd322a9ee1f977f59f7907586bd81fde567a01b", "mediaType": "application/schema+json" } }, @@ -6419,7 +6419,7 @@ }, "artifact": { "path": "crates/registry-evidencectl/schemas/authoring/store-provision.schema.json", - "sha256": "ad586d201fb64370c09ec18bf9c6aa57f3a8833aaecac7ba748f09dc0bc36d51", + "sha256": "c89de9234b9e92ef6c92f88a32fa3e91dfaa07dee510f7a2cb03aef1f69f917b", "mediaType": "application/schema+json" } }, @@ -6581,7 +6581,7 @@ }, "artifact": { "path": "products/messaging/generated/runtime/runtime.schema.json", - "sha256": "5f42d3706e2b6ad00a430288c7c637395bbee43b8b7635fc0ceb990bebeb788d", + "sha256": "f950af9d9b58006890d657dfd910722ec268e71b9beabc18eede9ab521d0b85a", "mediaType": "application/schema+json" } }, @@ -6653,7 +6653,7 @@ }, "artifact": { "path": "crates/registry-cli-api/schema/connections.schema.json", - "sha256": "9d757eeac7bfd9a08ac7d421d6dd4620344d924becd31a77bcf7aec87d8e6b6c", + "sha256": "d826fdedf9db4049195664fc483db6749180dcd0335863ab56d548fddfbd1a45", "mediaType": "application/schema+json" } }, @@ -6667,7 +6667,7 @@ "description": "Report of the shared `provision` command that creates a product's PostgreSQL roles, database, schemas and extensions.", "source": { "path": "crates/registry-platform-provision/src/cli.rs", - "sha256": "29625dd439514b1351a0d36cba1102895a13416aa65a5675a10435d71bb4549b" + "sha256": "d5c59e2cdb955f33a5806c825ae9be6204a11797adf0afb05865e807827293c2" }, "artifact": { "path": "crates/registry-platform-provision/schema/provision-report.schema.json", @@ -6725,7 +6725,7 @@ }, "artifact": { "path": "products/platform/generated/mcp-runtime/mcp-runtime.schema.json", - "sha256": "943bb3a53811c35e5cb9a3457a7c5225586e26dbea99b50b005825e5cd5df86a", + "sha256": "ea22c026fe461327a97b37dd2534b78255570b7df9bd75772b31f386a8e883ca", "mediaType": "application/schema+json" } }, @@ -6739,7 +6739,7 @@ "description": "rstack error report JSON Schema.", "source": { "path": "crates/registry-rstack/src/cli.rs", - "sha256": "c0fe7cb20b590714dd367fffab20a33ef4e3afb4272811d7e34b34bcb7757495" + "sha256": "0d9a9654fefbc7fb5ab8bce66129be190c984bfe31aa1e1ac550e62c96d36ffb" }, "artifact": { "path": "products/platform/schemas/rstack-dev-error.v1.schema.json", @@ -6779,7 +6779,7 @@ }, "artifact": { "path": "products/platform/generated/session-runtime/session-runtime.schema.json", - "sha256": "c80019fe44d6032107978be57e1380b2fb060b527f535a4a1705b733b2517f01", + "sha256": "3139024000f51fbd4715b1ed048775e5277a920fe026a23a5cb750ccc5ea1de3", "mediaType": "application/schema+json" } }, @@ -6797,7 +6797,7 @@ }, "artifact": { "path": "products/platform/schemas/task-connection.schema.json", - "sha256": "d1e3b34b174de0afb1cf1c87895f51273541305d451e3fcb9891393448ebd745", + "sha256": "f579e5d0289e8d7ead2b442f29c346ff7cece9bb245197cb38616c271562f484", "mediaType": "application/schema+json" } }, @@ -6869,7 +6869,7 @@ }, "artifact": { "path": "products/render/schemas/runtime.schema.json", - "sha256": "f08bea3ff05ebcae08042409cc4616834460308489c220cc06d8e729b7e02bd7", + "sha256": "f2d3e0cb18bae70a57b1d6e85b03bdbb0ed8712d06e68744747666b10fff806a", "mediaType": "application/schema+json" } }, @@ -6887,7 +6887,7 @@ }, "artifact": { "path": "products/platform/generated/dev/dev.v1alpha1.schema.json", - "sha256": "88c6a55a99fa1df179ecbf0899a62755831e2052b65ad16d53856776e80d6617", + "sha256": "f4d72b0fbb16c1f1205cca3f80ae81a6bb46da44962ec74a5872a37589c50761", "mediaType": "application/schema+json" } }, @@ -6923,7 +6923,7 @@ }, "artifact": { "path": "products/platform/generated/dev/service.v1alpha1.schema.json", - "sha256": "e410d8aec61cc9029f3a22c03e8435476870b6a4c5166b2ae2231f6bd00b4618", + "sha256": "113e37bc3da27cf106f96c8ba1d48ab00c238adf3d0eaec02c1aeb0454afb16b", "mediaType": "application/schema+json" } }, @@ -6995,7 +6995,7 @@ }, "artifact": { "path": "products/scheduling/generated/runtime/runtime.schema.json", - "sha256": "a631ed1da44c6778cc9574284c697ea60a824ebd26d338e5ec3e825262cec440", + "sha256": "cbcef9c994e7f822c5b3385ed621777cbb1dc27467852943d18ecee04f965839", "mediaType": "application/schema+json" } }, diff --git a/products/messaging/examples/starter/dev.yaml b/products/messaging/examples/starter/dev.yaml index 047a3f1059..a3eca02ce6 100644 --- a/products/messaging/examples/starter/dev.yaml +++ b/products/messaging/examples/starter/dev.yaml @@ -8,7 +8,10 @@ kind: RStackDev # carries registry_actor_kind. issuer: https://identity.starter.example.test products: - - {product: messaging, project: ., audience: "urn:example:messaging"} + messaging: + path: . +audiences: + messaging: "urn:example:messaging" people: case-system: subject: case-system diff --git a/products/platform/CHANGELOG.md b/products/platform/CHANGELOG.md index 7cbb89c3c3..1177f823e7 100644 --- a/products/platform/CHANGELOG.md +++ b/products/platform/CHANGELOG.md @@ -4,6 +4,7 @@ - `rstack dev check` refuses incompatible owner reports and mismatched identity facts. For Messaging it also checks the staged package, runtime input and tool around facts generation. +- BREAKING: `dev.yaml` declares its products with the same mapping as `service.yaml`, and `rstack dev` refuses the list form with `rstack.dev.products-list`. Migration: replace each `- {product: KIND, project: PATH, audience: AUDIENCE}` entry with `products.KIND.projects.KIND.path: PATH` for `breg`, `coordinator` and `evidence`, or `products.KIND.path: PATH` for the other products, and move the audience to `audiences.KIND: AUDIENCE`. A directory has one inventory: when its `service.yaml` declares `products`, keep only `audiences` in `dev.yaml`. `service.yaml` also accepts `adapter`, `discovery`, `documents`, `render` and `scheduling` projects. - The file secret provider accepts `mountPolicy: compose-native`, an explicit production setting that also admits a root-owned, single-link regular file with mode exactly `0444`, the Docker Compose secret mount shape, under the diff --git a/products/platform/config-formats.yaml b/products/platform/config-formats.yaml index 629c2d855d..5f97332f3a 100644 --- a/products/platform/config-formats.yaml +++ b/products/platform/config-formats.yaml @@ -850,7 +850,7 @@ formats: set: /people/operator/roles reference: none operand: none - relativePath: none + relativePath: /products/breg/projects/breg/path securityMembers: - pointer: /issuer whenOmitted: refused @@ -876,7 +876,7 @@ formats: whenOmitted: refused - pointer: /application/prepareVersion whenOmitted: refused - - pointer: /products/*/audience + - pointer: /audiences/* whenOmitted: refused - pointer: /people/*/roles whenOmitted: refused @@ -918,7 +918,7 @@ formats: whenOmitted: refused - pointer: /externalScheduling/taskGrant/statusResource whenOmitted: refused - restrictingMembers: [/issuer, /application/client, /application/callbackPath, /products/*/audience, /people/*/roles, /externalScheduling/taskGrant/assertionClient, /externalScheduling/taskGrant/sourceIssuer, /externalScheduling/taskGrant/statusUrl, /externalScheduling/taskGrant/tokenEndpoint, /externalScheduling/taskGrant/statusClient, /externalScheduling/taskGrant/statusKeyRef, /externalScheduling/taskGrant/statusResource] + restrictingMembers: [/issuer, /application/client, /application/callbackPath, /audiences/*, /people/*/roles, /externalScheduling/taskGrant/assertionClient, /externalScheduling/taskGrant/sourceIssuer, /externalScheduling/taskGrant/statusUrl, /externalScheduling/taskGrant/tokenEndpoint, /externalScheduling/taskGrant/statusClient, /externalScheduling/taskGrant/statusKeyRef, /externalScheduling/taskGrant/statusResource] - id: rstack/journeys product: rstack title: Registry Stack authored development journeys @@ -992,17 +992,17 @@ formats: function: read_service type: ServiceFile check: rstack service check {file} - example: products/platform/conformance/projects/breg-project-dev/service.yaml + example: products/platform/examples/service-previews/business-registration/service.yaml conformance: requiredText: none optionalText: none integer: none boolean: none idList: none - set: /roles/operator/accessProfiles/breg + set: /roles/registrar/accessProfiles/breg reference: none operand: none - relativePath: /products/breg/projects/records/path + relativePath: /products/breg/projects/businesses/path securityMembers: [] restrictingMembers: [] - id: breg/example-scenarios diff --git a/products/platform/conformance/projects/breg-project-dev/dev.yaml b/products/platform/conformance/projects/breg-project-dev/dev.yaml index 7d211eb13e..f89ed8a100 100644 --- a/products/platform/conformance/projects/breg-project-dev/dev.yaml +++ b/products/platform/conformance/projects/breg-project-dev/dev.yaml @@ -3,9 +3,12 @@ apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 kind: RStackDev issuer: https://issuer.example.invalid products: - - product: breg - project: registry - audience: urn:example:registry + breg: + projects: + breg: + path: registry +audiences: + breg: urn:example:registry people: operator: subject: operator diff --git a/products/platform/conformance/projects/breg-project-dev/service.yaml b/products/platform/conformance/projects/breg-project-dev/service.yaml index e3900321ec..b4128d1937 100644 --- a/products/platform/conformance/projects/breg-project-dev/service.yaml +++ b/products/platform/conformance/projects/breg-project-dev/service.yaml @@ -6,8 +6,3 @@ roles: actorKind: service accessProfiles: breg: [operator] -products: - breg: - projects: - records: - path: registry diff --git a/products/platform/examples/licensing/dev.yaml b/products/platform/examples/licensing/dev.yaml index 3047928c3b..8f945d86fc 100644 --- a/products/platform/examples/licensing/dev.yaml +++ b/products/platform/examples/licensing/dev.yaml @@ -3,8 +3,15 @@ apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 kind: RStackDev issuer: https://identity.licensing.example.test products: - - {product: breg, project: registry, audience: "urn:example:licensing:registry"} - - {product: casework, project: casework, audience: "urn:example:licensing:review"} + breg: + projects: + breg: + path: registry + casework: + path: casework +audiences: + breg: "urn:example:licensing:registry" + casework: "urn:example:licensing:review" people: applicant: subject: applicant diff --git a/products/platform/generated/dev/dev.v1alpha1.schema.json b/products/platform/generated/dev/dev.v1alpha1.schema.json index 47bb499528..49de653b2e 100644 --- a/products/platform/generated/dev/dev.v1alpha1.schema.json +++ b/products/platform/generated/dev/dev.v1alpha1.schema.json @@ -427,6 +427,26 @@ "pattern": "^[a-z][a-z0-9_-]{0,63}$", "type": "string" }, + "NamedProjects": { + "additionalProperties": false, + "properties": { + "projects": { + "additionalProperties": { + "$ref": "#/$defs/ProjectReference" + }, + "description": "Projects keyed by project ID. In a service, BReg IDs form the generated client member names.", + "minProperties": 1, + "propertyNames": { + "$ref": "#/$defs/LocalId" + }, + "type": "object" + } + }, + "required": [ + "projects" + ], + "type": "object" + }, "Preview": { "additionalProperties": false, "properties": { @@ -475,27 +495,53 @@ ], "type": "string" }, - "ProductPlan": { + "ProductReferences": { "additionalProperties": false, - "description": "One product to start and where its project lives.", + "minProperties": 1, "properties": { - "audience": { - "$ref": "#/$defs/ExternalId", - "description": "Token audience this product accepts: 1 to 256 characters without whitespace or control characters, distinct from the other products' audiences. BReg may instead equal `personAudience`." + "adapter": { + "$ref": "#/$defs/ProjectReference" + }, + "breg": { + "$ref": "#/$defs/NamedProjects" + }, + "casework": { + "$ref": "#/$defs/ProjectReference" }, - "product": { - "$ref": "#/$defs/Product", - "description": "Which product to start." + "coordinator": { + "$ref": "#/$defs/NamedProjects" }, - "project": { - "description": "Relative path from the plan's directory to the product project, or `.` for the plan's own directory. It must contain the product’s project manifest.", + "discovery": { + "$ref": "#/$defs/ProjectReference" + }, + "documents": { + "$ref": "#/$defs/ProjectReference" + }, + "evidence": { + "$ref": "#/$defs/NamedProjects" + }, + "messaging": { + "$ref": "#/$defs/ProjectReference" + }, + "render": { + "$ref": "#/$defs/ProjectReference" + }, + "scheduling": { + "$ref": "#/$defs/ProjectReference" + } + }, + "type": "object" + }, + "ProjectReference": { + "additionalProperties": false, + "properties": { + "path": { + "description": "Directory containing the product's native project file, relative to the file that declares it.", "type": "string" } }, "required": [ - "product", - "project", - "audience" + "path" ], "type": "object" }, @@ -718,34 +764,28 @@ }, "then": { "not": { - "required": [ - "application" + "anyOf": [ + { + "required": [ + "application" + ] + }, + { + "required": [ + "products" + ] + } ] }, "properties": { "issuer": { "const": "run" } - }, - "required": [ - "audiences" - ] + } } } ], "description": "The development plan: the products to start, the test people who call them, and the journeys to run.", - "oneOf": [ - { - "required": [ - "products" - ] - }, - { - "required": [ - "audiences" - ] - } - ], "properties": { "apiVersion": { "const": "id.registrystack.org/formats/rstack/dev/v1alpha1", @@ -760,7 +800,7 @@ "additionalProperties": { "$ref": "#/$defs/ExternalId" }, - "description": "Token audiences keyed by the product IDs declared in service.yaml.", + "description": "Token audiences keyed by project ID: the member name under projects, or the product kind for a single path.", "minProperties": 1, "propertyNames": { "$ref": "#/$defs/LocalId" @@ -827,11 +867,8 @@ "description": "Local browser preview for a composed service and one synthetic actor." }, "products": { - "description": "The products to start, each with its project directory and token audience. List each product at most once.", - "items": { - "$ref": "#/$defs/ProductPlan" - }, - "type": "array" + "$ref": "#/$defs/ProductReferences", + "description": "The products to start, as in service.yaml. Leave it out when a sibling service.yaml declares products." }, "schemaTestPeople": { "additionalProperties": { @@ -863,7 +900,8 @@ "kind", "issuer", "people", - "journeyFile" + "journeyFile", + "audiences" ], "title": "Registry Stack development plan", "type": "object" diff --git a/products/platform/generated/dev/service.v1alpha1.schema.json b/products/platform/generated/dev/service.v1alpha1.schema.json index 3d4879b18c..260d935d50 100644 --- a/products/platform/generated/dev/service.v1alpha1.schema.json +++ b/products/platform/generated/dev/service.v1alpha1.schema.json @@ -39,7 +39,7 @@ "additionalProperties": { "$ref": "#/$defs/ProjectReference" }, - "description": "Projects keyed by service product ID. BReg IDs form the generated client member names.", + "description": "Projects keyed by project ID. In a service, BReg IDs form the generated client member names.", "minProperties": 1, "propertyNames": { "$ref": "#/$defs/LocalId" @@ -56,6 +56,9 @@ "additionalProperties": false, "minProperties": 1, "properties": { + "adapter": { + "$ref": "#/$defs/ProjectReference" + }, "breg": { "$ref": "#/$defs/NamedProjects" }, @@ -65,11 +68,23 @@ "coordinator": { "$ref": "#/$defs/NamedProjects" }, + "discovery": { + "$ref": "#/$defs/ProjectReference" + }, + "documents": { + "$ref": "#/$defs/ProjectReference" + }, "evidence": { "$ref": "#/$defs/NamedProjects" }, "messaging": { "$ref": "#/$defs/ProjectReference" + }, + "render": { + "$ref": "#/$defs/ProjectReference" + }, + "scheduling": { + "$ref": "#/$defs/ProjectReference" } }, "type": "object" @@ -78,7 +93,7 @@ "additionalProperties": false, "properties": { "path": { - "description": "Directory containing the product's native project file, relative to this service file.", + "description": "Directory containing the product's native project file, relative to the file that declares it.", "type": "string" } }, diff --git a/products/platform/journeys/rstack-dev.sh b/products/platform/journeys/rstack-dev.sh index e72f5988e5..a9a9a8b442 100755 --- a/products/platform/journeys/rstack-dev.sh +++ b/products/platform/journeys/rstack-dev.sh @@ -216,13 +216,19 @@ init_command() { # allows, so a refusal is about the product and not about the plan's other # parts. write_probe_plan() { - local product=$1 project=$2 + local product=$1 project=$2 inventory + case "$product" in + breg | coordinator | evidence) inventory="{projects: {$product: {path: .}}}" ;; + *) inventory="{path: .}" ;; + esac journey_write_file "$project/dev.yaml" --concepts development-plan,issuer-name,audience < Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 25/55] fix(platform): publish the strict secret providers as a shared block Folds these reviewed commits: - fix(evidence): keep mountPolicy out of the wallet adapters' published schemas - docs: add the Compose mount caveat to Session and Adapter, and state where it applies - fix(platform): refuse OpenPGP private key blocks in public documents - fix(platform): fail provision when its explicit-setting notice cannot be written - refactor(platform): share the explicit-setting report line with registry-mcp and session - test: pin the mountPolicy refusal pointer and a second provision notice - chore(identifiers): regenerate the catalogue for the wallet adapter schemas - fix(platform): publish the strict secret providers as a shared block - chore(identifiers): regenerate the catalogue for the strict secret provider block - docs(platform): state the public-document rule on the strict file provider Signed-off-by: Jeremi Joslin --- .../schema/connections.schema.json | 6 +- .../tests/connection_store.rs | 10 ++ crates/registry-cli-report/src/lib.rs | 58 +-------- .../tests/provision_cli.rs | 26 ++++ .../registry-evidence-oid4vci/src/config.rs | 9 +- .../registry-evidence-oid4vci/src/schema.rs | 5 + crates/registry-evidence-oid4vp/src/config.rs | 9 +- crates/registry-evidence-oid4vp/src/schema.rs | 5 + .../authoring/store-provision.schema.json | 6 +- crates/registry-mcp/src/main.rs | 17 +-- crates/registry-platform-config/src/blocks.rs | 21 +-- crates/registry-platform-config/src/lib.rs | 4 +- .../registry-platform-config/src/posture.rs | 58 +++++++++ crates/registry-platform-config/src/schema.rs | 3 +- .../registry-platform-config/src/secrets.rs | 10 +- .../src/secrets_tests.rs | 13 +- crates/registry-platform-provision/src/cli.rs | 42 +++++- crates/registry-session/src/offline.rs | 30 +---- .../docs/operate/deployment-posture.mdx | 3 +- .../src/content/docs/security/adapter.mdx | 7 + .../src/content/docs/security/session.mdx | 7 + .../oid4vci-runtime.schema.json | 121 ++++++++---------- .../oid4vp-runtime/oid4vp-runtime.schema.json | 121 ++++++++---------- .../identifiers/generated/catalog.v1.json | 16 +-- products/platform/CHANGELOG.md | 15 ++- .../runtime-config-blocks.schema.json | 52 ++++++++ .../schemas/task-connection.schema.json | 6 +- .../scripts/check-config-conformance.py | 4 +- 28 files changed, 409 insertions(+), 275 deletions(-) diff --git a/crates/registry-cli-api/schema/connections.schema.json b/crates/registry-cli-api/schema/connections.schema.json index 436564ffb4..24879c69c2 100644 --- a/crates/registry-cli-api/schema/connections.schema.json +++ b/crates/registry-cli-api/schema/connections.schema.json @@ -183,10 +183,10 @@ }, "StrictFileSecretProviderConfig": { "additionalProperties": false, - "description": "The file secret provider of an operator-local file.", + "description": "The file secret provider without the Compose mount policy.", "properties": { "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe user running the tool with mode 0400 or 0600, or owned by root with\nno access beyond group read (0440 or 0640) when that user is not root.\nA command that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe user running the process with mode 0400 or 0600, or owned by root\nwith no access beyond group read (0440 or 0640) when that user is not\nroot. A process that declared development loads a file with looser read\nor mode bits and logs a warning. A public document, such as a static\nJWKS or a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -220,7 +220,7 @@ ] } ], - "description": "The secret providers of an operator-local file read outside any runtime,\nsuch as a saved CLI connection or a task connection. It enables the same\nproviders as a runtime's `secretProviders` without the Compose mount\npolicy: nothing reports an explicit production setting for these files,\nso the strict file rule always applies.", + "description": "The secret providers without the Compose mount policy, so the strict file\nrule always applies. An operator-local file read outside any runtime, such\nas a saved CLI connection or a task connection, uses it because nothing\nreports an explicit production setting for that file. A runtime whose keys\nkeep the strict rule publishes it as the shape of its `secretProviders`.", "properties": { "environment": { "$ref": "#/$defs/EnvironmentSecretProviderConfig", diff --git a/crates/registry-cli-api/tests/connection_store.rs b/crates/registry-cli-api/tests/connection_store.rs index 225d4e89cb..9f966552a3 100644 --- a/crates/registry-cli-api/tests/connection_store.rs +++ b/crates/registry-cli-api/tests/connection_store.rs @@ -579,4 +579,14 @@ fn a_saved_connection_file_refuses_the_compose_mount_policy() { ); let error = check(&stated).expect_err("a saved connection file has no mountPolicy"); assert_eq!(error.exit_code(), 1); + let report = registry_cli_api::inspect_connections_file(&file).unwrap(); + assert!( + report + .diagnostics() + .iter() + .any(|diagnostic| diagnostic.code == "config.unknown-key" + && diagnostic.path == "/connections/0/secretProviders/file/mountPolicy"), + "{}", + report.render_human() + ); } diff --git a/crates/registry-cli-report/src/lib.rs b/crates/registry-cli-report/src/lib.rs index 991655380e..eb1daa70e0 100644 --- a/crates/registry-cli-report/src/lib.rs +++ b/crates/registry-cli-report/src/lib.rs @@ -3,7 +3,7 @@ use std::io::{self, Write}; -use registry_platform_config::FoundExplicitSetting; +pub use registry_platform_config::ExplicitSettingLine; #[doc(hidden)] pub use registry_platform_posture::declared_from; /// The declaration used by CLI report producers. @@ -79,62 +79,6 @@ pub struct Report<'a> { explicit_settings: Option>, } -/// One explicit production setting an operator stated, as a `check` report -/// lists it: a setting valid in every posture that relaxes something and is -/// worth a reviewer's attention. It is a list of facts, not a diagnostic, so -/// `--deny-warnings` is unaffected. The summary is value-free. -/// -/// `file` names the document `pointer` refers to, such as the runtime file or -/// the package, and is left out when absent. `pointer`, `line` and `column` -/// are left out when unknown. -#[derive(Clone, Debug, Eq, PartialEq)] -pub struct ExplicitSettingLine { - pub code: String, - pub file: Option, - pub pointer: Option, - pub line: Option, - pub column: Option, - pub summary: String, -} - -impl ExplicitSettingLine { - /// The line a `check` report lists for `found`. `file` names the document - /// the pointer refers to: the runtime file, or the package for a setting - /// found there. - #[must_use] - pub fn from_found(found: &FoundExplicitSetting, file: Option<&str>) -> Self { - Self { - code: found.setting.code.to_owned(), - file: file.map(ToOwned::to_owned), - pointer: found.pointer.clone(), - line: found.position.map(|position| position.line), - column: found.position.map(|position| position.column), - summary: found.setting.summary.to_owned(), - } - } -} - -impl Serialize for ExplicitSettingLine { - fn serialize(&self, serializer: S) -> Result { - let mut map = serializer.serialize_map(None)?; - map.serialize_entry("code", &self.code)?; - if let Some(file) = &self.file { - map.serialize_entry("file", file)?; - } - if let Some(pointer) = &self.pointer { - map.serialize_entry("pointer", pointer)?; - } - if let Some(line) = self.line { - map.serialize_entry("line", &line)?; - } - if let Some(column) = self.column { - map.serialize_entry("column", &column)?; - } - map.serialize_entry("summary", &self.summary)?; - map.end() - } -} - impl<'a> Report<'a> { /// Check the product's envelope and attach the binary's build identity. /// Command-specific status words become outcomes; result classes stay fixed. diff --git a/crates/registry-documentsctl/tests/provision_cli.rs b/crates/registry-documentsctl/tests/provision_cli.rs index 0d93017c62..8fd0345eef 100644 --- a/crates/registry-documentsctl/tests/provision_cli.rs +++ b/crates/registry-documentsctl/tests/provision_cli.rs @@ -200,6 +200,32 @@ fn print_sql_writes_the_script_and_no_password() { } } +#[test] +fn print_sql_notices_the_compose_mount_policy_on_stderr() { + let directory = scratch(); + let runtime = write_runtime(directory.path()); + let text = std::fs::read_to_string(&runtime).unwrap(); + let stated = text.replacen( + "secretProviders:\n file:\n", + "secretProviders:\n file:\n mountPolicy: compose-native\n", + 1, + ); + assert_ne!(stated, text, "the member is written"); + std::fs::write(&runtime, stated).unwrap(); + + let output = ctl(&["provision", "--runtime-config", &runtime, "--print-sql"]); + let stdout = String::from_utf8(output.stdout).unwrap(); + let stderr = String::from_utf8(output.stderr).unwrap(); + assert_eq!(output.status.code(), Some(0), "{stdout}{stderr}"); + assert!( + stderr.contains( + "Explicit production setting platform.posture.compose-native-secret-mount at /secretProviders/file/mountPolicy." + ), + "{stderr}" + ); + assert!(!stdout.contains("compose-native"), "{stdout}"); +} + #[test] fn print_sql_as_json_reports_nothing_executed() { let directory = scratch(); diff --git a/crates/registry-evidence-oid4vci/src/config.rs b/crates/registry-evidence-oid4vci/src/config.rs index 0fe4f48d01..0f04400cba 100644 --- a/crates/registry-evidence-oid4vci/src/config.rs +++ b/crates/registry-evidence-oid4vci/src/config.rs @@ -709,7 +709,14 @@ pub struct DeliveryDocument { /// endpoint exists. #[serde(default)] pub metrics_listener: Option, - /// The secret providers `tokenClient.privateKeyRef` may name. + /// The secret providers `tokenClient.privateKeyRef` may name. The file provider takes no + /// `mountPolicy`: these keys keep the strict file rule. + // The schema publishes the shared strict block; the reader keeps the + // runtime block so it can refuse `mountPolicy` with a positioned finding. + #[cfg_attr( + feature = "schema", + schemars(with = "registry_platform_config::StrictSecretProvidersConfig") + )] pub secret_providers: SecretProvidersConfig, /// The required durable audit journal for offer attribution and delivery /// outcomes. `stdout` is available for a collector-managed deployment; diff --git a/crates/registry-evidence-oid4vci/src/schema.rs b/crates/registry-evidence-oid4vci/src/schema.rs index 0e6d3658ec..b2c5446c35 100644 --- a/crates/registry-evidence-oid4vci/src/schema.rs +++ b/crates/registry-evidence-oid4vci/src/schema.rs @@ -214,6 +214,11 @@ mod tests { !schema.is_valid(&document) }; assert!(refused(&|document| document["version"] = Value::from(1))); + // The Evidence key rule refuses the Compose mount policy, so the + // published contract does not offer it. + assert!(refused(&|document| { + document["secretProviders"]["file"]["mountPolicy"] = Value::from("compose-native") + })); assert!(refused(&|document| { document["tokenClient"]["privateKeyFile"] = Value::from("client.jwk") })); diff --git a/crates/registry-evidence-oid4vp/src/config.rs b/crates/registry-evidence-oid4vp/src/config.rs index c888be2f4e..fcd7006433 100644 --- a/crates/registry-evidence-oid4vp/src/config.rs +++ b/crates/registry-evidence-oid4vp/src/config.rs @@ -684,7 +684,14 @@ pub struct VerifierDocument { /// endpoint exists. #[serde(default)] pub metrics_listener: Option, - /// The secret providers the `*Ref` members may name. + /// The secret providers the `*Ref` members may name. The file provider takes no + /// `mountPolicy`: these keys keep the strict file rule. + // The schema publishes the shared strict block; the reader keeps the + // runtime block so it can refuse `mountPolicy` with a positioned finding. + #[cfg_attr( + feature = "schema", + schemars(with = "registry_platform_config::StrictSecretProvidersConfig") + )] pub secret_providers: SecretProvidersConfig, /// The required durable audit journal. pub audit: AuditDocument, diff --git a/crates/registry-evidence-oid4vp/src/schema.rs b/crates/registry-evidence-oid4vp/src/schema.rs index 0e7a29af3d..c53d5cbf00 100644 --- a/crates/registry-evidence-oid4vp/src/schema.rs +++ b/crates/registry-evidence-oid4vp/src/schema.rs @@ -213,6 +213,11 @@ mod tests { !schema.is_valid(&document) }; assert!(refused(&|document| document["version"] = Value::from(1))); + // The Evidence key rule refuses the Compose mount policy, so the + // published contract does not offer it. + assert!(refused(&|document| { + document["secretProviders"]["file"]["mountPolicy"] = Value::from("compose-native") + })); assert!(refused(&|document| document["sessions"] = Value::Null)); assert!(refused( &|document| document["policies"] = serde_json::json!([]) diff --git a/crates/registry-evidencectl/schemas/authoring/store-provision.schema.json b/crates/registry-evidencectl/schemas/authoring/store-provision.schema.json index 5fd67ff3be..ee545f8823 100644 --- a/crates/registry-evidencectl/schemas/authoring/store-provision.schema.json +++ b/crates/registry-evidencectl/schemas/authoring/store-provision.schema.json @@ -74,10 +74,10 @@ }, "StrictFileSecretProviderConfig": { "additionalProperties": false, - "description": "The file secret provider of an operator-local file.", + "description": "The file secret provider without the Compose mount policy.", "properties": { "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe user running the tool with mode 0400 or 0600, or owned by root with\nno access beyond group read (0440 or 0640) when that user is not root.\nA command that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe user running the process with mode 0400 or 0600, or owned by root\nwith no access beyond group read (0440 or 0640) when that user is not\nroot. A process that declared development loads a file with looser read\nor mode bits and logs a warning. A public document, such as a static\nJWKS or a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -111,7 +111,7 @@ ] } ], - "description": "The secret providers of an operator-local file read outside any runtime,\nsuch as a saved CLI connection or a task connection. It enables the same\nproviders as a runtime's `secretProviders` without the Compose mount\npolicy: nothing reports an explicit production setting for these files,\nso the strict file rule always applies.", + "description": "The secret providers without the Compose mount policy, so the strict file\nrule always applies. An operator-local file read outside any runtime, such\nas a saved CLI connection or a task connection, uses it because nothing\nreports an explicit production setting for that file. A runtime whose keys\nkeep the strict rule publishes it as the shape of its `secretProviders`.", "properties": { "environment": { "$ref": "#/$defs/EnvironmentSecretProviderConfig", diff --git a/crates/registry-mcp/src/main.rs b/crates/registry-mcp/src/main.rs index 5a6de47303..afa41e6b61 100644 --- a/crates/registry-mcp/src/main.rs +++ b/crates/registry-mcp/src/main.rs @@ -141,22 +141,11 @@ async fn main() -> ExitCode { }; // Each explicit production setting the file states, as every check // reports it: a fact for review, not a diagnostic. - let explicit: Vec = settings + let file = given.display().to_string(); + let explicit: Vec<_> = settings .iter() .map(|found| { - let mut line = serde_json::json!({ - "code": found.setting.code, - "file": given.display().to_string(), - "summary": found.setting.summary, - }); - if let Some(pointer) = &found.pointer { - line["pointer"] = pointer.as_str().into(); - } - if let Some(position) = found.position { - line["line"] = position.line.into(); - line["column"] = position.column.into(); - } - line + registry_platform_config::ExplicitSettingLine::from_found(found, Some(&file)) }) .collect(); let failed = unavailable diff --git a/crates/registry-platform-config/src/blocks.rs b/crates/registry-platform-config/src/blocks.rs index e4fa6641f5..5b1081935b 100644 --- a/crates/registry-platform-config/src/blocks.rs +++ b/crates/registry-platform-config/src/blocks.rs @@ -285,11 +285,11 @@ impl SecretProvidersConfig { } } -/// The secret providers of an operator-local file read outside any runtime, -/// such as a saved CLI connection or a task connection. It enables the same -/// providers as a runtime's `secretProviders` without the Compose mount -/// policy: nothing reports an explicit production setting for these files, -/// so the strict file rule always applies. +/// The secret providers without the Compose mount policy, so the strict file +/// rule always applies. An operator-local file read outside any runtime, such +/// as a saved CLI connection or a task connection, uses it because nothing +/// reports an explicit production setting for that file. A runtime whose keys +/// keep the strict rule publishes it as the shape of its `secretProviders`. #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[cfg_attr( feature = "schema", @@ -312,7 +312,7 @@ pub struct StrictSecretProvidersConfig { pub environment: Option, } -/// The file secret provider of an operator-local file. +/// The file secret provider without the Compose mount policy. #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase", deny_unknown_fields)] @@ -320,10 +320,11 @@ pub struct StrictFileSecretProviderConfig { /// Absolute directory holding one file per secret. A name may be a /// relative link that stays below this directory, through at most 8 links. /// The file it reaches must be a regular file with one hard link, owned by - /// the user running the tool with mode 0400 or 0600, or owned by root with - /// no access beyond group read (0440 or 0640) when that user is not root. - /// A command that declared development loads a file with looser read or - /// mode bits and logs a warning. + /// the user running the process with mode 0400 or 0600, or owned by root + /// with no access beyond group read (0440 or 0640) when that user is not + /// root. A process that declared development loads a file with looser read + /// or mode bits and logs a warning. A public document, such as a static + /// JWKS or a CA bundle, may also be readable by group and others. #[cfg_attr(feature = "schema", schemars(extend("pattern" = "^/")))] pub root: PathBuf, } diff --git a/crates/registry-platform-config/src/lib.rs b/crates/registry-platform-config/src/lib.rs index 1d4a4afa14..dd91290fd8 100644 --- a/crates/registry-platform-config/src/lib.rs +++ b/crates/registry-platform-config/src/lib.rs @@ -86,8 +86,8 @@ pub use posture::{ declared_from_with_production_alias, declared_with_production_alias, has_denied_warnings, CollectedSettings, DeclaredPosture, DevelopmentClass, DevelopmentOnlyRefused, DevelopmentSetting, DevelopmentWitness, ExplicitClass, ExplicitProductionSetting, - FoundExplicitSetting, FoundSetting, Gated, Posture, PostureError, PostureReport, PostureSource, - SettingOrigin, Stated, DEVELOPMENT, POSTURE_ENV, + ExplicitSettingLine, FoundExplicitSetting, FoundSetting, Gated, Posture, PostureError, + PostureReport, PostureSource, SettingOrigin, Stated, DEVELOPMENT, POSTURE_ENV, }; pub use secrets::{ validate_secret_root, ProtectedSecret, SecretError, SecretFileCheck, SecretProvider, diff --git a/crates/registry-platform-config/src/posture.rs b/crates/registry-platform-config/src/posture.rs index ba82c72fa4..d6af2beaf2 100644 --- a/crates/registry-platform-config/src/posture.rs +++ b/crates/registry-platform-config/src/posture.rs @@ -442,6 +442,64 @@ pub struct ExplicitProductionSetting { pub summary: &'static str, } +/// One explicit production setting an operator stated, as a `check` report +/// lists it: a setting valid in every posture that relaxes something and is +/// worth a reviewer's attention. It is a list of facts, not a diagnostic, so +/// `--deny-warnings` is unaffected. The summary is value-free. +/// +/// `file` names the document `pointer` refers to, such as the runtime file or +/// the package, and is left out when absent. `pointer`, `line` and `column` +/// are left out when unknown. +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct ExplicitSettingLine { + pub code: String, + pub file: Option, + pub pointer: Option, + pub line: Option, + pub column: Option, + pub summary: String, +} + +impl ExplicitSettingLine { + /// The line a `check` report lists for `found`. `file` names the document + /// the pointer refers to: the runtime file, or the package for a setting + /// found there. + #[must_use] + pub fn from_found(found: &FoundExplicitSetting, file: Option<&str>) -> Self { + Self { + code: found.setting.code.to_owned(), + file: file.map(ToOwned::to_owned), + pointer: found.pointer.clone(), + line: found.position.map(|position| position.line), + column: found.position.map(|position| position.column), + summary: found.setting.summary.to_owned(), + } + } +} + +impl Serialize for ExplicitSettingLine { + fn serialize(&self, serializer: S) -> Result { + use serde::ser::SerializeMap as _; + + let mut map = serializer.serialize_map(None)?; + map.serialize_entry("code", &self.code)?; + if let Some(file) = &self.file { + map.serialize_entry("file", file)?; + } + if let Some(pointer) = &self.pointer { + map.serialize_entry("pointer", pointer)?; + } + if let Some(line) = self.line { + map.serialize_entry("line", &line)?; + } + if let Some(column) = self.column { + map.serialize_entry("column", &column)?; + } + map.serialize_entry("summary", &self.summary)?; + map.end() + } +} + /// An [`ExplicitProductionSetting`] found in a process's configuration. #[derive(Clone, Debug)] pub struct FoundExplicitSetting { diff --git a/crates/registry-platform-config/src/schema.rs b/crates/registry-platform-config/src/schema.rs index d5bdddbe88..2bd0eb004a 100644 --- a/crates/registry-platform-config/src/schema.rs +++ b/crates/registry-platform-config/src/schema.rs @@ -6,7 +6,7 @@ use crate::blocks::{ AttachmentVerifierConfig, AuditKeyConfig, DatabaseConfig, JwksSource, ListenerConfig, MetricsListenerConfig, ObjectStorageConfig, OidcClientsConfig, OidcIssuerConfig, OidcPackageClientsConfig, PackageConfig, PrivateListenerConfig, SecretProvidersConfig, - TaskGrantStatusConfig, UrlHookDestinationConfig, + StrictSecretProvidersConfig, TaskGrantStatusConfig, UrlHookDestinationConfig, }; use crate::caller_issuers::{ AccessProfileClients, AllowedClients, CallerIssuerCore, CallerIssuers, ClientList, @@ -22,6 +22,7 @@ pub const SHARED_BLOCKS_SCHEMA_FILE: &str = "runtime-config-blocks.schema.json"; #[allow(dead_code)] struct SharedBlocks { secret_providers: SecretProvidersConfig, + strict_secret_providers: StrictSecretProvidersConfig, database: DatabaseConfig, jwks_source: JwksSource, package: PackageConfig, diff --git a/crates/registry-platform-config/src/secrets.rs b/crates/registry-platform-config/src/secrets.rs index 844e4a3831..8a8c09ec5a 100644 --- a/crates/registry-platform-config/src/secrets.rs +++ b/crates/registry-platform-config/src/secrets.rs @@ -745,12 +745,12 @@ fn public_document_error(error: SecretError) -> SecretError { } } -/// Whether `bytes` hold a PEM private key block of any kind: PKCS #8 -/// (encrypted or not), RSA, EC, DSA or OpenSSH. +/// Whether `bytes` hold an armored private key block of any kind: PKCS #8 +/// (encrypted or not), RSA, EC, DSA, OpenSSH or OpenPGP. fn holds_pem_private_key(bytes: &[u8]) -> bool { - bytes - .windows(b"PRIVATE KEY-----".len()) - .any(|window| window == b"PRIVATE KEY-----") + [&b"PRIVATE KEY-----"[..], &b"PRIVATE KEY BLOCK-----"[..]] + .iter() + .any(|label| bytes.windows(label.len()).any(|window| window == *label)) } /// Walk `name` from the root by openat steps, following only relative diff --git a/crates/registry-platform-config/src/secrets_tests.rs b/crates/registry-platform-config/src/secrets_tests.rs index cc943c4057..478956289b 100644 --- a/crates/registry-platform-config/src/secrets_tests.rs +++ b/crates/registry-platform-config/src/secrets_tests.rs @@ -390,6 +390,9 @@ mod filesystem { ("rsa.pem", "RSA PRIVATE KEY"), ("ec.pem", "EC PRIVATE KEY"), ("encrypted.pem", "ENCRYPTED PRIVATE KEY"), + ("openssh.pem", "OPENSSH PRIVATE KEY"), + ("dsa.pem", "DSA PRIVATE KEY"), + ("pgp.asc", "PGP PRIVATE KEY BLOCK"), ] { let path = root.path().join(name); fs::write( @@ -403,7 +406,15 @@ mod filesystem { fs::set_permissions(&path, fs::Permissions::from_mode(0o644)).expect("mode"); } let resolver = resolver(root.path()); - for name in ["pkcs8.pem", "rsa.pem", "ec.pem", "encrypted.pem"] { + for name in [ + "pkcs8.pem", + "rsa.pem", + "ec.pem", + "encrypted.pem", + "openssh.pem", + "dsa.pem", + "pgp.asc", + ] { assert_eq!( load_public(&resolver, name), Err(SecretError::PrivateKeyInPublicDocument), diff --git a/crates/registry-platform-provision/src/cli.rs b/crates/registry-platform-provision/src/cli.rs index c3480e7cff..15e3e3e959 100644 --- a/crates/registry-platform-provision/src/cli.rs +++ b/crates/registry-platform-provision/src/cli.rs @@ -800,10 +800,12 @@ fn run_with( return output.refusal(&report); } }; + // The notice is the only report of an explicit setting for this run, so + // a notice that cannot reach stderr is an operational failure. for notice in &input.explicit_settings { - // A notice that cannot reach stderr leaves nothing else to tell; the - // run continues and the report still carries its outcome. - let _ = writeln!(output.stderr, "{notice}"); + if writeln!(output.stderr, "{notice}").is_err() { + return output.write_failed(false); + } } report.product = Some(input.product.product.to_owned()); let dotted_section = section.replace('/', "."); @@ -1420,6 +1422,40 @@ mod tests { } } + #[test] + fn an_explicit_setting_notice_that_cannot_be_written_is_an_operational_failure() { + struct Closed; + impl Write for Closed { + fn write(&mut self, _: &[u8]) -> std::io::Result { + Err(std::io::ErrorKind::BrokenPipe.into()) + } + fn flush(&mut self) -> std::io::Result<()> { + Ok(()) + } + } + let mut input = split_input(); + input.explicit_settings = vec!["Explicit production setting".to_owned()]; + let args = parse(&["--print-sql", "--runtime-config", "runtime.yaml"]).expect("arguments"); + let mut stdout = Vec::new(); + let exit = run_with( + "casectl", + "database", + "1.2.3-test", + &args, + OutputFormat::Human, + registry_cli_report::declared_from(None, None).unwrap(), + |_| Ok(input), + &must_not_run, + &mut stdout, + &mut Closed, + ); + assert_eq!(exit, 3); + assert!( + stdout.is_empty(), + "the script must not follow a lost notice" + ); + } + #[test] fn print_mode_writes_only_the_script_to_stdout() { let run = execute_run(&["--print-sql"], None, Ok(split_input()), &must_not_run); diff --git a/crates/registry-session/src/offline.rs b/crates/registry-session/src/offline.rs index be856a0592..f17411e011 100644 --- a/crates/registry-session/src/offline.rs +++ b/crates/registry-session/src/offline.rs @@ -66,7 +66,7 @@ struct CtlReport { diagnostics: serde_json::Value, /// Each explicit production setting the file states: a fact for review, /// not a diagnostic. - explicit_production_settings: Vec, + explicit_production_settings: Vec, } /// Run `registry-session check` and report every finding (CFG-DIAG-4): exit 0 when @@ -112,7 +112,12 @@ pub fn run(request: &CheckRequest<'_>, stdout: &mut dyn Write, stderr: &mut dyn diagnostics: report.to_json_value(), explicit_production_settings: settings .iter() - .map(|found| setting_line(found, request.runtime)) + .map(|found| { + registry_platform_config::ExplicitSettingLine::from_found( + found, + Some(&request.runtime.display().to_string()), + ) + }) .collect(), }; let written = serde_json::to_writer_pretty(&mut *stdout, &document) @@ -146,27 +151,6 @@ pub fn run(request: &CheckRequest<'_>, stdout: &mut dyn Write, stderr: &mut dyn exit } -/// One explicit production setting as the JSON report lists it, with the -/// members every check report uses for it. -fn setting_line( - found: ®istry_platform_config::FoundExplicitSetting, - runtime: &Path, -) -> serde_json::Value { - let mut line = serde_json::json!({ - "code": found.setting.code, - "file": runtime.display().to_string(), - "summary": found.setting.summary, - }); - if let Some(pointer) = &found.pointer { - line["pointer"] = pointer.as_str().into(); - } - if let Some(position) = found.position { - line["line"] = position.line.into(); - line["column"] = position.column.into(); - } - line -} - /// Check the runtime file at `path` as given: the loader needs an absolute, /// lexically normal path, and every diagnostic names the file as given. /// Returns the findings, whether the file could not be read at all, and the diff --git a/docs/site/src/content/docs/operate/deployment-posture.mdx b/docs/site/src/content/docs/operate/deployment-posture.mdx index 4ffca6f2c5..4527e1587a 100644 --- a/docs/site/src/content/docs/operate/deployment-posture.mdx +++ b/docs/site/src/content/docs/operate/deployment-posture.mdx @@ -89,7 +89,8 @@ loopback HTTP issuer URLs, `private-network-plaintext` observer hook destination Document Store and Registry Scheduling, `anonymousHttps: operator-approved` in Registry Adapter, or `secretProviders.file.mountPolicy: compose-native`, which accepts root-owned Docker Compose -secret mounts at mode `0444` (Registry Evidence and both wallet adapters refuse it). +secret mounts at mode `0444`. Registry Evidence and both wallet adapters do not accept that +member, so it is never an explicit production setting there. Explicit production settings never refuse and are never diagnostics or warnings: diff --git a/docs/site/src/content/docs/security/adapter.mdx b/docs/site/src/content/docs/security/adapter.mdx index 5ff94b44b8..a8265cf611 100644 --- a/docs/site/src/content/docs/security/adapter.mdx +++ b/docs/site/src/content/docs/security/adapter.mdx @@ -90,6 +90,13 @@ Configured hook ingress increments it for credential and rate-limit refusals. Th crates/registry-adapter-job/src/hook_ingress.rs, validate_hook_runtime, refused_hook_requests_are_counted_by_reason, each_refused_credential_is_counted_under_its_check_with_an_unchanged_answer. */} +Secret files follow the [hardening checklist](../hardening-checklist/#secret-files). The +explicit `secretProviders.file.mountPolicy: compose-native` setting lets every user in the +container read root-owned `0444` secret mounts. Write it only for a container that runs this +service alone under one runtime identity. + +{/* Evidence: crates/registry-platform-config/src/blocks.rs, COMPOSE_NATIVE_SECRET_MOUNT. */} + ## Next - [Configure caller and source access](../../configure/adapter/#authorisation-and-secrets) diff --git a/docs/site/src/content/docs/security/session.mdx b/docs/site/src/content/docs/security/session.mdx index 799cad9775..9130bc5f7f 100644 --- a/docs/site/src/content/docs/security/session.mdx +++ b/docs/site/src/content/docs/security/session.mdx @@ -105,6 +105,13 @@ A module's `signIns` list routes kinds of sessions, but grants no product permis crates/registry-session/src/public.rs sign_out; crates/registry-session/README.md. */} +Secret files follow the [hardening checklist](../hardening-checklist/#secret-files). The +explicit `secretProviders.file.mountPolicy: compose-native` setting lets every user in the +container read root-owned `0444` secret mounts. Write it only for a container that runs this +service alone under one runtime identity. + +{/* Evidence: crates/registry-platform-config/src/blocks.rs, COMPOSE_NATIVE_SECRET_MOUNT. */} + ## Accepted residuals ### SESSION-RES-01: a restart loses sessions diff --git a/products/evidence/generated/oid4vci-runtime/oid4vci-runtime.schema.json b/products/evidence/generated/oid4vci-runtime/oid4vci-runtime.schema.json index 834ebdc45e..7504007b90 100644 --- a/products/evidence/generated/oid4vci-runtime/oid4vci-runtime.schema.json +++ b/products/evidence/generated/oid4vci-runtime/oid4vci-runtime.schema.json @@ -178,28 +178,6 @@ "pattern": "^[^\\u0000-\\u001F\\u007F-\\u009F]+$", "type": "string" }, - "FileSecretProviderConfig": { - "additionalProperties": false, - "description": "The file secret provider.", - "properties": { - "mountPolicy": { - "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", - "x-registry-explicit-production": [ - "platform.posture.compose-native-secret-mount" - ] - }, - "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", - "pattern": "^/", - "type": "string" - } - }, - "required": [ - "root" - ], - "type": "object" - }, "IdentifierRestriction": { "anyOf": [ { @@ -556,49 +534,6 @@ "$ref": "#/$defs/ExternalId", "description": "The name of the claim that carries scopes." }, - "SecretMountPolicy": { - "enum": [ - "compose-native" - ], - "type": "string" - }, - "SecretProvidersConfig": { - "additionalProperties": false, - "anyOf": [ - { - "properties": { - "file": { - "$ref": "#/$defs/FileSecretProviderConfig" - } - }, - "required": [ - "file" - ] - }, - { - "properties": { - "environment": { - "$ref": "#/$defs/EnvironmentSecretProviderConfig" - } - }, - "required": [ - "environment" - ] - } - ], - "description": "The secret providers a runtime enables. A reference is resolved only by a\nprovider declared here: `secret:file/name` under `file.root`, and\n`secret:env/NAME` only when `environment: {}` is present.", - "properties": { - "environment": { - "$ref": "#/$defs/EnvironmentSecretProviderConfig", - "description": "Enables `secret:env/NAME` references, read from the process\nenvironment. Declared as an empty mapping: `environment: {}`." - }, - "file": { - "$ref": "#/$defs/FileSecretProviderConfig", - "description": "Enables `secret:file/name` references, read from files under `root`." - } - }, - "type": "object" - }, "SecretReference": { "description": "An exact secret reference: secret:file/name, resolved under secretProviders.file.root, or secret:env/NAME, resolved only when secretProviders.environment is declared.", "pattern": "^(?:secret:env/[A-Z][A-Z0-9_]{0,127}|secret:file/[a-z][a-z0-9._-]{0,127})$", @@ -651,6 +586,58 @@ }, "type": "object" }, + "StrictFileSecretProviderConfig": { + "additionalProperties": false, + "description": "The file secret provider without the Compose mount policy.", + "properties": { + "root": { + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe user running the process with mode 0400 or 0600, or owned by root\nwith no access beyond group read (0440 or 0640) when that user is not\nroot. A process that declared development loads a file with looser read\nor mode bits and logs a warning. A public document, such as a static\nJWKS or a CA bundle, may also be readable by group and others.", + "pattern": "^/", + "type": "string" + } + }, + "required": [ + "root" + ], + "type": "object" + }, + "StrictSecretProvidersConfig": { + "additionalProperties": false, + "anyOf": [ + { + "properties": { + "file": { + "$ref": "#/$defs/StrictFileSecretProviderConfig" + } + }, + "required": [ + "file" + ] + }, + { + "properties": { + "environment": { + "$ref": "#/$defs/EnvironmentSecretProviderConfig" + } + }, + "required": [ + "environment" + ] + } + ], + "description": "The secret providers without the Compose mount policy, so the strict file\nrule always applies. An operator-local file read outside any runtime, such\nas a saved CLI connection or a task connection, uses it because nothing\nreports an explicit production setting for that file. A runtime whose keys\nkeep the strict rule publishes it as the shape of its `secretProviders`.", + "properties": { + "environment": { + "$ref": "#/$defs/EnvironmentSecretProviderConfig", + "description": "Enables `secret:env/NAME` references, read from the process\nenvironment. Declared as an empty mapping: `environment: {}`." + }, + "file": { + "$ref": "#/$defs/StrictFileSecretProviderConfig", + "description": "Enables `secret:file/name` references, read from files under `root`." + } + }, + "type": "object" + }, "TokenClientDocument": { "additionalProperties": false, "description": "The identity this service authenticates to its token issuer with.", @@ -765,8 +752,8 @@ "description": "Request budgets. Absent means the defaults of each member." }, "secretProviders": { - "$ref": "#/$defs/SecretProvidersConfig", - "description": "The secret providers `tokenClient.privateKeyRef` may name." + "$ref": "#/$defs/StrictSecretProvidersConfig", + "description": "The secret providers `tokenClient.privateKeyRef` may name. The file provider takes no\n`mountPolicy`: these keys keep the strict file rule." }, "store": { "$ref": "#/$defs/StoreDocument", diff --git a/products/evidence/generated/oid4vp-runtime/oid4vp-runtime.schema.json b/products/evidence/generated/oid4vp-runtime/oid4vp-runtime.schema.json index db104eb886..4d5330d100 100644 --- a/products/evidence/generated/oid4vp-runtime/oid4vp-runtime.schema.json +++ b/products/evidence/generated/oid4vp-runtime/oid4vp-runtime.schema.json @@ -305,28 +305,6 @@ "pattern": "^[^\\u0000-\\u001F\\u007F-\\u009F]+$", "type": "string" }, - "FileSecretProviderConfig": { - "additionalProperties": false, - "description": "The file secret provider.", - "properties": { - "mountPolicy": { - "$ref": "#/$defs/SecretMountPolicy", - "description": "`compose-native` also accepts a root-owned regular file with one hard\nlink and mode exactly 0444, the shape of a Docker Compose secret mount.\nEvery user in the container can read such a file. Startup and `check`\nreport this explicit production setting. Without it, only the file\nshapes `root` describes are accepted.", - "x-registry-explicit-production": [ - "platform.posture.compose-native-secret-mount" - ] - }, - "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe runtime user with mode 0400 or 0600, or owned by root with no\naccess beyond group read (0440 or 0640) when the runtime is not root.\nA process that declared development loads a file with looser read or\nmode bits and logs a warning. A public document, such as a static JWKS\nor a CA bundle, may also be readable by group and others.", - "pattern": "^/", - "type": "string" - } - }, - "required": [ - "root" - ], - "type": "object" - }, "IssuerActorKind": { "$ref": "#/$defs/DeclaredActorKind", "description": "The kind every token from one issuer is treated as." @@ -620,49 +598,6 @@ "$ref": "#/$defs/ExternalId", "description": "The name of the claim that carries scopes." }, - "SecretMountPolicy": { - "enum": [ - "compose-native" - ], - "type": "string" - }, - "SecretProvidersConfig": { - "additionalProperties": false, - "anyOf": [ - { - "properties": { - "file": { - "$ref": "#/$defs/FileSecretProviderConfig" - } - }, - "required": [ - "file" - ] - }, - { - "properties": { - "environment": { - "$ref": "#/$defs/EnvironmentSecretProviderConfig" - } - }, - "required": [ - "environment" - ] - } - ], - "description": "The secret providers a runtime enables. A reference is resolved only by a\nprovider declared here: `secret:file/name` under `file.root`, and\n`secret:env/NAME` only when `environment: {}` is present.", - "properties": { - "environment": { - "$ref": "#/$defs/EnvironmentSecretProviderConfig", - "description": "Enables `secret:env/NAME` references, read from the process\nenvironment. Declared as an empty mapping: `environment: {}`." - }, - "file": { - "$ref": "#/$defs/FileSecretProviderConfig", - "description": "Enables `secret:file/name` references, read from files under `root`." - } - }, - "type": "object" - }, "SecretReference": { "description": "An exact secret reference: secret:file/name, resolved under secretProviders.file.root, or secret:env/NAME, resolved only when secretProviders.environment is declared.", "pattern": "^(?:secret:env/[A-Z][A-Z0-9_]{0,127}|secret:file/[a-z][a-z0-9._-]{0,127})$", @@ -717,6 +652,58 @@ "type": "array", "uniqueItems": true }, + "StrictFileSecretProviderConfig": { + "additionalProperties": false, + "description": "The file secret provider without the Compose mount policy.", + "properties": { + "root": { + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe user running the process with mode 0400 or 0600, or owned by root\nwith no access beyond group read (0440 or 0640) when that user is not\nroot. A process that declared development loads a file with looser read\nor mode bits and logs a warning. A public document, such as a static\nJWKS or a CA bundle, may also be readable by group and others.", + "pattern": "^/", + "type": "string" + } + }, + "required": [ + "root" + ], + "type": "object" + }, + "StrictSecretProvidersConfig": { + "additionalProperties": false, + "anyOf": [ + { + "properties": { + "file": { + "$ref": "#/$defs/StrictFileSecretProviderConfig" + } + }, + "required": [ + "file" + ] + }, + { + "properties": { + "environment": { + "$ref": "#/$defs/EnvironmentSecretProviderConfig" + } + }, + "required": [ + "environment" + ] + } + ], + "description": "The secret providers without the Compose mount policy, so the strict file\nrule always applies. An operator-local file read outside any runtime, such\nas a saved CLI connection or a task connection, uses it because nothing\nreports an explicit production setting for that file. A runtime whose keys\nkeep the strict rule publishes it as the shape of its `secretProviders`.", + "properties": { + "environment": { + "$ref": "#/$defs/EnvironmentSecretProviderConfig", + "description": "Enables `secret:env/NAME` references, read from the process\nenvironment. Declared as an empty mapping: `environment: {}`." + }, + "file": { + "$ref": "#/$defs/StrictFileSecretProviderConfig", + "description": "Enables `secret:file/name` references, read from files under `root`." + } + }, + "type": "object" + }, "TokenIssuer": { "additionalProperties": false, "description": "One authorized token issuer entry.", @@ -1092,8 +1079,8 @@ "description": "Request-rate limits." }, "secretProviders": { - "$ref": "#/$defs/SecretProvidersConfig", - "description": "The secret providers the `*Ref` members may name." + "$ref": "#/$defs/StrictSecretProvidersConfig", + "description": "The secret providers the `*Ref` members may name. The file provider takes no\n`mountPolicy`: these keys keep the strict file rule." }, "sessions": { "$ref": "#/$defs/SessionsDocument", diff --git a/products/identifiers/generated/catalog.v1.json b/products/identifiers/generated/catalog.v1.json index 773f92b956..178ecda385 100644 --- a/products/identifiers/generated/catalog.v1.json +++ b/products/identifiers/generated/catalog.v1.json @@ -6325,11 +6325,11 @@ "description": "Evidence OID4VCI delivery runtime configuration JSON Schema.", "source": { "path": "crates/registry-evidence-oid4vci/src/schema.rs", - "sha256": "4765ede33c3ad60e6defd1fd4f7fb59180dd0f9ab04280e8d83a0e5f25081a5d" + "sha256": "c5961b898a660417c39ce3a0552c53bfc397fe269588a3971f51214264e2ff0d" }, "artifact": { "path": "products/evidence/generated/oid4vci-runtime/oid4vci-runtime.schema.json", - "sha256": "39cf28ae80e6eee04ace9474c6652d52659167d847073d54ff01e72a322150ab", + "sha256": "026c2168ecd30d5333c4d8e4fbea7831c6ea65ead80f5d95846634ee88c2a076", "mediaType": "application/schema+json" } }, @@ -6343,11 +6343,11 @@ "description": "Evidence OpenID4VP verifier runtime configuration JSON Schema.", "source": { "path": "crates/registry-evidence-oid4vp/src/schema.rs", - "sha256": "dce7ef9451a6324883cc24cab52f6107603fd4089976abe56d0952d14f0d2bf2" + "sha256": "b1129ebae14366ae175246d9da6223e957ee19a4ebb57e69706621b982378031" }, "artifact": { "path": "products/evidence/generated/oid4vp-runtime/oid4vp-runtime.schema.json", - "sha256": "b228e4e511c6c6afc2b5ac12edd322a9ee1f977f59f7907586bd81fde567a01b", + "sha256": "4a8784546a9c990eece05f794e1cfd9d87691c310c39d637a1aae9e3bddebf02", "mediaType": "application/schema+json" } }, @@ -6419,7 +6419,7 @@ }, "artifact": { "path": "crates/registry-evidencectl/schemas/authoring/store-provision.schema.json", - "sha256": "c89de9234b9e92ef6c92f88a32fa3e91dfaa07dee510f7a2cb03aef1f69f917b", + "sha256": "6421b53f8cbe33174ed88cb0daa83951754a4fc7f98385274d8782a1b960741c", "mediaType": "application/schema+json" } }, @@ -6653,7 +6653,7 @@ }, "artifact": { "path": "crates/registry-cli-api/schema/connections.schema.json", - "sha256": "d826fdedf9db4049195664fc483db6749180dcd0335863ab56d548fddfbd1a45", + "sha256": "46eedf1ea8f63a1b6397244234ea690f0ebce68d45527cb28d216db9470c819c", "mediaType": "application/schema+json" } }, @@ -6667,7 +6667,7 @@ "description": "Report of the shared `provision` command that creates a product's PostgreSQL roles, database, schemas and extensions.", "source": { "path": "crates/registry-platform-provision/src/cli.rs", - "sha256": "d5c59e2cdb955f33a5806c825ae9be6204a11797adf0afb05865e807827293c2" + "sha256": "69249d1cd4b43379aa5f4a7c15bddfe443650f49bdb7477c9f068a5468f4f22f" }, "artifact": { "path": "crates/registry-platform-provision/schema/provision-report.schema.json", @@ -6797,7 +6797,7 @@ }, "artifact": { "path": "products/platform/schemas/task-connection.schema.json", - "sha256": "f579e5d0289e8d7ead2b442f29c346ff7cece9bb245197cb38616c271562f484", + "sha256": "0d65d121798aadf8f321d2ccac71ccdd05808d269de79be5157277a56c191b25", "mediaType": "application/schema+json" } }, diff --git a/products/platform/CHANGELOG.md b/products/platform/CHANGELOG.md index 1177f823e7..2fd0e08083 100644 --- a/products/platform/CHANGELOG.md +++ b/products/platform/CHANGELOG.md @@ -20,9 +20,18 @@ `tlsTrustProfiles.*.bundleRef`) as a public document, and so do the `provision` tools for `database.caBundleRef`: group and other may read the file, with no setting. Owner, link, write and walk checks still apply, and - the document is still parsed before use. A public document that holds a PEM - private key block is refused, and a refused public document is described - with public-document wording. + the document is still parsed before use. A refused public document is + described with public-document wording. +- BREAKING: a public document (a static JWKS or a CA bundle, including + `caBundleRef` read by the `provision` tools) that holds an armored private + key block (PEM, OpenSSH or OpenPGP) is refused, even when the file is + owner-only. Migration: if `caBundleRef` named a combined certificate and + key file, split the key into its own secret file and point + `caBundleRef` at the certificates alone. +- The shared runtime blocks document publishes `StrictSecretProvidersConfig` + and `StrictFileSecretProviderConfig`, the secret providers without + `mountPolicy`. The Evidence OID4VCI and OID4VP runtime schemas embed them, + so the published contract does not offer a member those runtimes refuse. - BREAKING for Rust callers of `registry-platform-config`: `SecretError` gains `UnsafePublicDocument` and `PrivateKeyInPublicDocument`, and `ProvisionInput` gains `explicit_settings`. Migration: add arms for the two diff --git a/products/platform/generated/runtime-config-blocks.schema.json b/products/platform/generated/runtime-config-blocks.schema.json index fb523197a7..beb3dd8570 100644 --- a/products/platform/generated/runtime-config-blocks.schema.json +++ b/products/platform/generated/runtime-config-blocks.schema.json @@ -1027,6 +1027,58 @@ "pattern": "^(?:secret:env/[A-Z][A-Z0-9_]{0,127}|secret:file/[a-z][a-z0-9._-]{0,127})$", "type": "string" }, + "StrictFileSecretProviderConfig": { + "additionalProperties": false, + "description": "The file secret provider without the Compose mount policy.", + "properties": { + "root": { + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe user running the process with mode 0400 or 0600, or owned by root\nwith no access beyond group read (0440 or 0640) when that user is not\nroot. A process that declared development loads a file with looser read\nor mode bits and logs a warning. A public document, such as a static\nJWKS or a CA bundle, may also be readable by group and others.", + "pattern": "^/", + "type": "string" + } + }, + "required": [ + "root" + ], + "type": "object" + }, + "StrictSecretProvidersConfig": { + "additionalProperties": false, + "anyOf": [ + { + "properties": { + "file": { + "$ref": "#/$defs/StrictFileSecretProviderConfig" + } + }, + "required": [ + "file" + ] + }, + { + "properties": { + "environment": { + "$ref": "#/$defs/EnvironmentSecretProviderConfig" + } + }, + "required": [ + "environment" + ] + } + ], + "description": "The secret providers without the Compose mount policy, so the strict file\nrule always applies. An operator-local file read outside any runtime, such\nas a saved CLI connection or a task connection, uses it because nothing\nreports an explicit production setting for that file. A runtime whose keys\nkeep the strict rule publishes it as the shape of its `secretProviders`.", + "properties": { + "environment": { + "$ref": "#/$defs/EnvironmentSecretProviderConfig", + "description": "Enables `secret:env/NAME` references, read from the process\nenvironment. Declared as an empty mapping: `environment: {}`." + }, + "file": { + "$ref": "#/$defs/StrictFileSecretProviderConfig", + "description": "Enables `secret:file/name` references, read from files under `root`." + } + }, + "type": "object" + }, "TaskGrantStatusConfig": { "additionalProperties": false, "description": "One task authority whose grants a runtime checks for fresh status, and the\nruntime's own credentials for that check, written as one entry of\n`taskGrantStatus`. The status route and scope default to Casework's.", diff --git a/products/platform/schemas/task-connection.schema.json b/products/platform/schemas/task-connection.schema.json index 16110d47f3..256fd72a8c 100644 --- a/products/platform/schemas/task-connection.schema.json +++ b/products/platform/schemas/task-connection.schema.json @@ -19,10 +19,10 @@ }, "StrictFileSecretProviderConfig": { "additionalProperties": false, - "description": "The file secret provider of an operator-local file.", + "description": "The file secret provider without the Compose mount policy.", "properties": { "root": { - "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe user running the tool with mode 0400 or 0600, or owned by root with\nno access beyond group read (0440 or 0640) when that user is not root.\nA command that declared development loads a file with looser read or\nmode bits and logs a warning.", + "description": "Absolute directory holding one file per secret. A name may be a\nrelative link that stays below this directory, through at most 8 links.\nThe file it reaches must be a regular file with one hard link, owned by\nthe user running the process with mode 0400 or 0600, or owned by root\nwith no access beyond group read (0440 or 0640) when that user is not\nroot. A process that declared development loads a file with looser read\nor mode bits and logs a warning. A public document, such as a static\nJWKS or a CA bundle, may also be readable by group and others.", "pattern": "^/", "type": "string" } @@ -56,7 +56,7 @@ ] } ], - "description": "The secret providers of an operator-local file read outside any runtime,\nsuch as a saved CLI connection or a task connection. It enables the same\nproviders as a runtime's `secretProviders` without the Compose mount\npolicy: nothing reports an explicit production setting for these files,\nso the strict file rule always applies.", + "description": "The secret providers without the Compose mount policy, so the strict file\nrule always applies. An operator-local file read outside any runtime, such\nas a saved CLI connection or a task connection, uses it because nothing\nreports an explicit production setting for that file. A runtime whose keys\nkeep the strict rule publishes it as the shape of its `secretProviders`.", "properties": { "environment": { "$ref": "#/$defs/EnvironmentSecretProviderConfig", diff --git a/products/platform/scripts/check-config-conformance.py b/products/platform/scripts/check-config-conformance.py index e1ae75866d..7acb0d2cf4 100755 --- a/products/platform/scripts/check-config-conformance.py +++ b/products/platform/scripts/check-config-conformance.py @@ -705,13 +705,13 @@ class Row: "AccessTokenType", "DeclaredActorKind", "EnvironmentSecretProviderConfig", - "FileSecretProviderConfig", "IssuerActorKind", "ListenerBind", "MetricsListenerConfig", "ScopeClaimName", - "SecretProvidersConfig", "SecretReference", + "StrictFileSecretProviderConfig", + "StrictSecretProvidersConfig", ), reference_refusal=TestRef( "crates/registry-evidence-oid4vci/src/config.rs", From 15274b95d8a2225002962193693d05d61db7bfd9 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 26/55] feat(coordinator): call a named service function without product authority Folds these reviewed commits: - feat(coordinator): call a named service function without product authority - feat(coordinator): accept a function host key as the service function credential - fix(coordinator): refuse every declared product credential on a function host - feat(dev): bind Coordinator service functions to the preview function host - fix(client): keep the caller credential out of preview function handlers - fix(client): give preview handlers a fresh request without credentials - fix(coordinator): keep the function host key at the host and off every other key Signed-off-by: Jeremi Joslin --- clients/typescript/generate-service.ts | 9 +- clients/typescript/preview/config.mjs | 15 +- clients/typescript/preview/host.mjs | 42 +- clients/typescript/preview/run.mjs | 10 +- .../typescript/preview/tests/preview.test.mjs | 97 +- .../typescript/tests/generate-preview.test.ts | 116 ++- crates/registry-coordinator/src/adapters.rs | 115 +++ crates/registry-coordinator/src/authoring.rs | 54 +- crates/registry-coordinator/src/contracts.rs | 22 + crates/registry-coordinator/src/definition.rs | 31 +- .../registry-coordinator/src/external_http.rs | 106 +- crates/registry-coordinator/src/operations.rs | 15 +- crates/registry-coordinator/src/protocol.rs | 7 + crates/registry-coordinator/src/runtime.rs | 328 +++++- crates/registry-coordinator/src/scenarios.rs | 6 +- crates/registry-coordinator/src/worker.rs | 4 +- .../service-function/fixtures/drafted.yaml | 24 + .../fixtures/not-eligible.yaml | 24 + .../fixtures/unrecognised-answer-holds.yaml | 17 + .../fixtures/service-function/functions.rhai | 18 + .../fixtures/service-function/runtime.yaml | 26 + .../fixtures/service-function/workflow.yaml | 106 ++ .../tests/service_function.rs | 943 ++++++++++++++++++ .../tests/service_function_postgres.rs | 226 +++++ .../tests/service_function_project.rs | 391 ++++++++ crates/registry-rstack-dev/src/lib.rs | 8 + crates/registry-rstack-dev/src/products.rs | 261 ++++- .../content/docs/configure/coordinator.mdx | 28 +- .../run-a-project-with-rstack-dev.mdx | 14 + .../src/content/docs/operate/coordinator.mdx | 2 +- .../reference/coordinator-configuration.mdx | 55 +- .../docs/reference/typescript-clients.mdx | 7 +- .../src/content/docs/security/coordinator.mdx | 151 ++- products/coordinator/CHANGELOG.md | 1 + .../openapi/coordinator.openapi.json | 3 +- .../generated/operations/README.md | 68 ++ .../generated/operations/catalog.json | 86 ++ ...e-function.v1.declared-refusal.schema.json | 18 + ...rvice.invoke-function.v1.input.schema.json | 7 + ...vice.invoke-function.v1.output.schema.json | 20 + .../generated/project/project.schema.json | 11 +- .../generated/runtime/runtime.schema.json | 56 ++ products/coordinator/scripts/test-postgres.sh | 2 +- 43 files changed, 3479 insertions(+), 71 deletions(-) create mode 100644 crates/registry-coordinator/tests/fixtures/service-function/fixtures/drafted.yaml create mode 100644 crates/registry-coordinator/tests/fixtures/service-function/fixtures/not-eligible.yaml create mode 100644 crates/registry-coordinator/tests/fixtures/service-function/fixtures/unrecognised-answer-holds.yaml create mode 100644 crates/registry-coordinator/tests/fixtures/service-function/functions.rhai create mode 100644 crates/registry-coordinator/tests/fixtures/service-function/runtime.yaml create mode 100644 crates/registry-coordinator/tests/fixtures/service-function/workflow.yaml create mode 100644 crates/registry-coordinator/tests/service_function.rs create mode 100644 crates/registry-coordinator/tests/service_function_postgres.rs create mode 100644 crates/registry-coordinator/tests/service_function_project.rs create mode 100644 products/coordinator/generated/operations/service.invoke-function.v1.declared-refusal.schema.json create mode 100644 products/coordinator/generated/operations/service.invoke-function.v1.input.schema.json create mode 100644 products/coordinator/generated/operations/service.invoke-function.v1.output.schema.json diff --git a/clients/typescript/generate-service.ts b/clients/typescript/generate-service.ts index 41f7d0237f..cf17029ce2 100644 --- a/clients/typescript/generate-service.ts +++ b/clients/typescript/generate-service.ts @@ -388,7 +388,14 @@ export function generatePreviewFunctionBinding(productId: string, member: string ' })', ' }', ' const client = createRegistryServerClient({ baseUrl, token: () => credential })[' + key + ']', - ' return handle(request, client)', + ' // The client carries the caller credential, so the handler gets a copy without credentials.', + ' // A fresh native request also leaves out a host\'s own request object and its raw headers.', + ' const headers = new Headers(request.headers)', + ' for (const name of ["authorization", "cookie", "proxy-authorization"]) headers.delete(name)', + ' const copy = new Request(request.url, {', + ' method: request.method, headers, body: request.body, duplex: "half", signal: request.signal,', + ' } as RequestInit)', + ' return handle(copy, client)', ' }', '}', '', diff --git a/clients/typescript/preview/config.mjs b/clients/typescript/preview/config.mjs index 9202fe02f1..171ad39bb6 100644 --- a/clients/typescript/preview/config.mjs +++ b/clients/typescript/preview/config.mjs @@ -59,10 +59,16 @@ export async function prepareRuntimeConfig({ artifact, deployment, run }) { || run.preview.productId !== artifact.product.id || run.preview.profile !== artifact.product.profile) { throw new Error('The preview product or audience differs from the checked plan.') } - const { authorizationFile } = run.preview + const { authorizationFile, functionHost } = run.preview if (typeof authorizationFile !== 'string' || !isAbsolute(authorizationFile)) { throw new Error('The preview needs an owner-only run authorization file.') } + const functionPort = functionHost?.port + if (!Number.isInteger(functionPort) || functionPort < 1 || functionPort > 65535 || functionPort === port + || `http://127.0.0.1:${functionPort}` === run.breg.baseUrl + || typeof functionHost.keyFile !== 'string' || !isAbsolute(functionHost.keyFile)) { + throw new Error('The preview needs the reserved function host port and owner-only host key file.') + } return { schema, runId: run.runId, origin, port, breg: run.breg, preview: run.preview } } @@ -77,6 +83,7 @@ async function checkCredentialPath(path, runFile) { export async function configure({ artifact, deployment, runFile }) { const config = await prepareRuntimeConfig({ artifact, deployment, run: await readJson(runFile) }) await checkCredentialPath(config.preview.authorizationFile, runFile) + await checkCredentialPath(config.preview.functionHost.keyFile, runFile) return config } @@ -94,6 +101,12 @@ export async function checkRuntimeConfig(configFile, artifact) { return checked } +export async function readHostKey(path) { + const key = /^([A-Za-z0-9_-]{32,256})\n?$/u.exec(await readFile(path, 'utf8'))?.[1] + if (!key) throw new Error('Expected the run function host key file.') + return key +} + export async function readAuthorization(path) { const line = await readFile(path, 'utf8') const authorization = /^Authorization: (Bearer [A-Za-z0-9._-]+)\r?\n?$/u.exec(line)?.[1] diff --git a/clients/typescript/preview/host.mjs b/clients/typescript/preview/host.mjs index 1c5dc2f564..4238cdbc17 100644 --- a/clients/typescript/preview/host.mjs +++ b/clients/typescript/preview/host.mjs @@ -1,12 +1,42 @@ +import { timingSafeEqual } from 'node:crypto' import { serve } from 'srvx/node' export const maxRequestBodySize = 32_768 -export async function startFunctionHost(handlers, { authorize }) { +const hostKeyPattern = /^[A-Za-z0-9_-]{32,256}$/u + +function same(value, expected) { + const given = Buffer.from(value ?? '') + return given.length === expected.length && timingSafeEqual(given, expected) +} + +// The fixed bearer a function called by Coordinator receives in place of the +// host key. It is not a secret and no product accepts it, so the key never +// leaves the host and the function holds no record authority. +export const coordinatorBearer = 'Bearer registry-preview-coordinator-call' + +// The run's function host key admits two callers: the preview gateway, which +// relays the page's principal and names the key in its own header, and +// Coordinator, which presents the key itself as its bearer credential. The +// check answers which caller it admitted, or false. +export function functionHostAuthorizer(key) { + if (typeof key !== 'string' || !hostKeyPattern.test(key)) { + throw new TypeError('The function host needs a run host key.') + } + const relayed = Buffer.from(key) + const bearer = Buffer.from('Bearer ' + key) + return request => { + const header = request.headers.get('x-registry-preview-function') + if (header === null) return same(request.headers.get('authorization'), bearer) && 'coordinator' + return same(header, relayed) && 'gateway' + } +} + +export async function startFunctionHost(handlers, { authorize, port = 0 }) { if (typeof authorize !== 'function') throw new TypeError('The private function host requires an authorization check.') const server = serve({ hostname: '127.0.0.1', - port: 0, + port, silent: true, gracefulShutdown: false, maxRequestBodySize, @@ -20,11 +50,11 @@ export async function startFunctionHost(handlers, { authorize }) { const name = /^\/functions\/([a-z][a-z0-9_-]{0,63})$/u.exec(path)?.[1] const handler = handlers.get(name) if (request.method !== 'POST' || !handler) return new Response('Not Found', { status: 404 }) - if (!/^Bearer [A-Za-z0-9._-]+$/u.test(request.headers.get('authorization') ?? '') || - !authorize(request)) { - return new Response('Caller required', { status: 401 }) - } + const caller = /^Bearer [A-Za-z0-9._-]+$/u.test(request.headers.get('authorization') ?? '') && + authorize(request) + if (!caller) return new Response('Caller required', { status: 401 }) request.headers.delete('x-registry-preview-function') + if (caller === 'coordinator') request.headers.set('authorization', coordinatorBearer) return handler(request) }, }) diff --git a/clients/typescript/preview/run.mjs b/clients/typescript/preview/run.mjs index c7cae5771a..ed52874072 100644 --- a/clients/typescript/preview/run.mjs +++ b/clients/typescript/preview/run.mjs @@ -1,9 +1,8 @@ -import { randomBytes } from 'node:crypto' import { writeFile } from 'node:fs/promises' import { dirname, join } from 'node:path' -import { artifactDirectory, checkRuntimeConfig, configEnvironment, readArtifact, readAuthorization } from './config.mjs' +import { artifactDirectory, checkRuntimeConfig, configEnvironment, readArtifact, readAuthorization, readHostKey } from './config.mjs' import { startPreviewGateway } from './gateway.mjs' -import { startFunctionHost } from './host.mjs' +import { functionHostAuthorizer, startFunctionHost } from './host.mjs' async function run() { const configFile = process.env[configEnvironment] @@ -24,9 +23,10 @@ async function run() { } } - const functionKey = randomBytes(32).toString('base64url') + const functionKey = await readHostKey(config.preview.functionHost.keyFile) const privateHost = await startFunctionHost(handlers, { - authorize: request => request.headers.get('x-registry-preview-function') === functionKey, + authorize: functionHostAuthorizer(functionKey), + port: config.preview.functionHost.port, }) let gateway try { diff --git a/clients/typescript/preview/tests/preview.test.mjs b/clients/typescript/preview/tests/preview.test.mjs index a7d28e215c..f93c37b48c 100644 --- a/clients/typescript/preview/tests/preview.test.mjs +++ b/clients/typescript/preview/tests/preview.test.mjs @@ -1,12 +1,12 @@ import { strict as assert } from 'node:assert' -import { mkdtemp, mkdir, realpath, rm, symlink, writeFile } from 'node:fs/promises' +import { chmod, mkdir, mkdtemp, realpath, rm, symlink, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { createServer, request } from 'node:http' import { test } from 'node:test' -import { startFunctionHost } from '../host.mjs' +import { coordinatorBearer, functionHostAuthorizer, startFunctionHost } from '../host.mjs' import { collectStaticFiles, previewPolicy, startPreviewGateway } from '../gateway.mjs' -import { prepareRuntimeConfig } from '../config.mjs' +import { configure, prepareRuntimeConfig, readHostKey } from '../config.mjs' import { buildPreview } from '../build.mjs' import { createHash } from 'node:crypto' @@ -63,16 +63,21 @@ test('prepare binds the run to the declaration, product, audience and loopback a const authorizationFile = join(root, 'authorization') await writeFile(deployment, 'service declaration') await writeFile(authorizationFile, 'Authorization: Bearer synthetic.actor.token\n', { mode: 0o600 }) + const keyFile = join(root, 'function-host-key') const declarationDigest = createHash('sha256').update('service declaration').digest('hex') const artifact = { declarationDigest, product: { id: 'licenses', member: 'licenses', audience: 'urn:preview', profile: 'holder' } } const run = { schema: 'registry-stack.local-service-preview/v1', runId: 'fixture-run', origin: 'http://127.0.0.1:23456', port: 23456, insecureLocal: true, breg: { baseUrl: 'http://127.0.0.1:34567', audience: 'urn:preview' }, - preview: { productId: 'licenses', profile: 'holder', authorizationFile, declarationDigest }, + preview: { + productId: 'licenses', profile: 'holder', authorizationFile, declarationDigest, + functionHost: { port: 45678, keyFile }, + }, } const valid = await prepareRuntimeConfig({ artifact, deployment, run }) assert.equal(valid.breg.baseUrl, run.breg.baseUrl) + assert.deepEqual(valid.preview.functionHost, { port: 45678, keyFile }) for (const invalid of [ { ...run, breg: { ...run.breg, audience: 'urn:wrong' } }, { ...run, breg: { ...run.breg, baseUrl: 'http://example.test:34567' } }, @@ -80,6 +85,11 @@ test('prepare binds the run to the declaration, product, audience and loopback a { ...run, preview: { ...run.preview, profile: 'wrong' } }, { ...run, preview: { ...run.preview, declarationDigest: 'wrong' } }, { ...run, port: 34567 }, + { ...run, preview: { ...run.preview, functionHost: undefined } }, + { ...run, preview: { ...run.preview, functionHost: { port: 23456, keyFile } } }, + { ...run, preview: { ...run.preview, functionHost: { port: 34567, keyFile } } }, + { ...run, preview: { ...run.preview, functionHost: { port: 0, keyFile } } }, + { ...run, preview: { ...run.preview, functionHost: { port: 45678, keyFile: 'relative-key' } } }, ]) { await assert.rejects(prepareRuntimeConfig({ artifact, deployment, run: invalid })) } @@ -199,3 +209,82 @@ test('build refuses a changed declaration or a linked function before staging', preview: { ...plan.preview, functions: ['linked'] }, }, join(root, 'artifact')), /source resolves outside/i) }) + +test('the function host binds its reserved port and admits only the run host key', async (t) => { + const key = 'synthetic-function-host-key-0123456789abcdefghij' + const authorize = functionHostAuthorizer(key) + const call = headers => new Request('http://127.0.0.1/functions/renew', { method: 'POST', headers }) + // The gateway relays the page's principal with the host key header. + assert.equal(authorize(call({ authorization: 'Bearer page.token', 'x-registry-preview-function': key })), 'gateway') + // Coordinator presents the host key itself as its bearer credential. + assert.equal(authorize(call({ authorization: 'Bearer ' + key })), 'coordinator') + for (const headers of [ + { authorization: 'Bearer page.token' }, + { authorization: 'Bearer ' + key + 'x' }, + { authorization: 'Bearer page.token', 'x-registry-preview-function': 'wrong' }, + { authorization: 'Bearer ' + key, 'x-registry-preview-function': 'wrong' }, + ]) { + assert.equal(authorize(call(headers)), false, JSON.stringify(headers)) + } + assert.throws(() => functionHostAuthorizer('short')) + + const reservation = createServer() + await new Promise(resolve => reservation.listen(0, '127.0.0.1', resolve)) + const { port } = reservation.address() + await new Promise(resolve => reservation.close(resolve)) + let seen + const host = await startFunctionHost(new Map([ + ['renew', async request => { + seen = request.headers.get('authorization') + return new Response('renewed') + }], + ]), { authorize, port }) + t.after(() => host.close()) + assert.equal(host.origin, 'http://127.0.0.1:' + port) + const route = host.origin + '/functions/renew' + assert.equal((await fetch(route, { method: 'POST', headers: { authorization: 'Bearer other.token' } })).status, 401) + const answer = await fetch(route, { method: 'POST', headers: { authorization: 'Bearer ' + key } }) + assert.equal(await answer.text(), 'renewed') + // The function receives a fixed placeholder, never the host key. + assert.equal(seen, coordinatorBearer) +}) + +test('the run host key file must be owner-only, in the run directory, and well formed', async t => { + const root = await mkdtemp(join(tmpdir(), 'registry-preview-key-')) + t.after(() => rm(root, { recursive: true })) + const deployment = join(root, 'service.yaml') + await writeFile(deployment, 'service declaration') + const declarationDigest = createHash('sha256').update('service declaration').digest('hex') + const artifact = { declarationDigest, product: { id: 'licenses', member: 'licenses', audience: 'urn:preview', profile: 'holder' } } + const authorizationFile = join(root, 'authorization') + await writeFile(authorizationFile, 'Authorization: Bearer synthetic.actor.token\n', { mode: 0o600 }) + const keyFile = join(root, 'function-host-key') + const key = 'synthetic-function-host-key-0123456789abcdefghij' + const runFile = join(root, 'application-run.json') + await writeFile(runFile, JSON.stringify({ + schema: 'registry-stack.local-service-preview/v1', + runId: 'fixture-run', origin: 'http://127.0.0.1:23456', port: 23456, insecureLocal: true, + breg: { baseUrl: 'http://127.0.0.1:34567', audience: 'urn:preview' }, + preview: { + productId: 'licenses', profile: 'holder', authorizationFile, declarationDigest, + functionHost: { port: 45678, keyFile }, + }, + })) + await writeFile(keyFile, key + '\n', { mode: 0o600 }) + await configure({ artifact, deployment, runFile }) + assert.equal(await readHostKey(keyFile), key) + + await chmod(keyFile, 0o640) + await assert.rejects(configure({ artifact, deployment, runFile }), /owner-only/u) + await chmod(keyFile, 0o600) + await rm(keyFile) + await writeFile(join(root, 'elsewhere'), key, { mode: 0o600 }) + await symlink(join(root, 'elsewhere'), keyFile) + await assert.rejects(configure({ artifact, deployment, runFile }), /owner-only/u) + await rm(keyFile) + for (const malformed of ['short', key + ' extra', 'Bearer ' + key]) { + await writeFile(keyFile, malformed, { mode: 0o600 }) + await assert.rejects(readHostKey(keyFile), /host key/u) + await rm(keyFile) + } +}) diff --git a/clients/typescript/tests/generate-preview.test.ts b/clients/typescript/tests/generate-preview.test.ts index 69a74ca1fb..dfc1e43ffc 100644 --- a/clients/typescript/tests/generate-preview.test.ts +++ b/clients/typescript/tests/generate-preview.test.ts @@ -10,7 +10,7 @@ const root = fileURLToPath(new URL('../', import.meta.url)) const fixture = fileURLToPath(new URL('./fixtures/breg-list.openapi.json', import.meta.url)) const { name, version } = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')) as { name: string; version: string } -test('preview generation splits page and function bindings and scopes credentials to each request', t => { +test('preview generation splits page and function bindings and keeps request credentials out of handlers', t => { const dir = mkdtempSync(join(tmpdir(), 'registry-preview-generator-')) t.after(() => rmSync(dir, { recursive: true, force: true })) const compiler = join(dir, 'bregctl') @@ -66,12 +66,15 @@ test('preview generation splits page and function bindings and scopes credential '--outDir', compiled, join(generated, 'service.ts'), join(generated, 'server.ts'), join(generated, 'routes.ts')], { encoding: 'utf8' }) assert.equal(types.status, 0, types.stdout + types.stderr) - const run = spawnSync(process.execPath, ['--input-type=module', '-', compiled], { encoding: 'utf8', input: ` + const host = join(root, 'preview', 'host.mjs') + const run = spawnSync(process.execPath, ['--input-type=module', '-', compiled, host], { encoding: 'utf8', input: ` import assert from 'node:assert/strict' import { pathToFileURL } from 'node:url' const generated = pathToFileURL(process.argv[2] + '/') +const { coordinatorBearer, functionHostAuthorizer, startFunctionHost } = await import(pathToFileURL(process.argv[3])) globalThis.location = { origin: 'http://127.0.0.1:12345' } const calls = [] +const networkFetch = globalThis.fetch globalThis.fetch = async (url, init) => { calls.push([String(url), new Headers(init.headers)]) return Response.json({ items: [], pageInfo: { nextCursor: null } }) @@ -83,22 +86,46 @@ await createRegistryClient().licences.list('licence', options) assert.equal(new URL(calls[0][0]).pathname, '/registry/licence-registry/v1/records/licences') assert.equal(calls[0][1].get('authorization'), null) assert.equal(calls[0][1].get('registry-client'), 'page') +const handled = new Map() +let completeAdmission +const bothAdmitted = new Promise(resolve => { completeAdmission = resolve }) const bind = defineFunction(async (request, licences) => { const profile = new URL(request.url).searchParams.get('profile') + assert.ok(!request.headers.has('authorization'), 'function handlers receive no Authorization header') + assert.equal(request.headers.get('cookie'), null) + assert.equal(request.headers.get('proxy-authorization'), null) + assert.equal(request.method, 'POST') + assert.equal(request.headers.get('content-type'), 'application/json') + assert.deepEqual(await request.json(), { profile }) + handled.set(profile, request.signal) + if (handled.size === 2) completeAdmission() + await bothAdmitted await licences.list('licence', profile === 'licence-holder' ? options : { accessProfile: 'licence-officer' }) return new Response(null, { status: 204 }) }) assert.throws(() => bind({ products: { licences: { baseUrl: 'http://127.0.0.1:54321' } } }), /Missing prepared BReg connection/) const handler = bind({ products: { 'licence-registry': { baseUrl: 'http://127.0.0.1:54321' } } }) -const request = (profile, credential) => new Request('http://127.0.0.1:6789/?profile=' + profile, - credential ? { headers: { authorization: 'Bearer ' + credential } } : {}) +const request = (profile, credential, signal) => { + const headers = { 'content-type': 'application/json', cookie: 'session=browser', 'proxy-authorization': 'Basic cHJveHk6cHJveHk=' } + if (credential) headers.Authorization = 'Bearer ' + credential + return new Request('http://127.0.0.1:6789/?profile=' + profile, + { headers, method: 'POST', body: JSON.stringify({ profile }), signal }) +} assert.equal((await handler(request('licence-holder'))).status, 401) assert.equal((await handler(request('licence-holder', 'a,b'))).status, 401) assert.equal(calls.length, 1) +const holder = new AbortController() +const officer = new AbortController() +const holderRequest = request('licence-holder', 'synthetic-holder', holder.signal) +const officerRequest = request('licence-officer', 'synthetic-officer', officer.signal) await Promise.all([ - handler(request('licence-holder', 'synthetic-holder')), - handler(request('licence-officer', 'synthetic-officer')), + handler(holderRequest), + handler(officerRequest), ]) +assert.ok(holderRequest.headers.has('authorization') && officerRequest.headers.has('authorization')) +holder.abort() +assert.ok(handled.get('licence-holder').aborted) +assert.ok(!handled.get('licence-officer').aborted) assert.deepEqual(calls.slice(1).map(([url, headers]) => { const target = new URL(url) return [target.origin + target.pathname, target.searchParams.get('accessProfile'), headers.get('authorization')] @@ -106,6 +133,83 @@ assert.deepEqual(calls.slice(1).map(([url, headers]) => { ['http://127.0.0.1:54321/v1/records/licences', 'licence-holder', 'Bearer synthetic-holder'], ['http://127.0.0.1:54321/v1/records/licences', 'licence-officer', 'Bearer synthetic-officer'], ]) + +// The same binding behind the real private function host, as a preview runs it. +const hosted = [] +let hostedAdmission +const bothHosted = new Promise(resolve => { hostedAdmission = resolve }) +const hostedHandler = defineFunction(async (request, licences) => { + const profile = new URL(request.url).searchParams.get('profile') + hosted.push([profile, request.method, request.headers.has('authorization'), request.headers.get('cookie'), + request.headers.get('proxy-authorization'), request.runtime, request.headers.get('content-type'), + request.headers.get('idempotency-key'), await request.json()]) + if (hosted.length === 2) hostedAdmission() + await bothHosted + await licences.list('licence', profile === 'licence-holder' ? options : { accessProfile: 'licence-officer' }) + return new Response(null, { status: 204 }) +})({ products: { 'licence-registry': { baseUrl: 'http://127.0.0.1:54322' } } }) +const functionKey = 'synthetic-function-key' +const server = await startFunctionHost(new Map([['renew', hostedHandler]]), { + authorize: request => request.headers.get('x-registry-preview-function') === functionKey, +}) +try { + const post = (profile, credential) => networkFetch(server.origin + '/functions/renew?profile=' + profile, { + method: 'POST', body: JSON.stringify({ profile }), + headers: { + authorization: 'Bearer ' + credential, 'x-registry-preview-function': functionKey, + 'content-type': 'application/json', 'idempotency-key': 'key-' + profile, + cookie: 'session=browser', 'proxy-authorization': 'Basic cHJveHk6cHJveHk=', + }, + }) + const statuses = await Promise.all([post('licence-holder', 'hosted-holder'), post('licence-officer', 'hosted-officer')]) + assert.deepEqual(statuses.map(response => response.status), [204, 204]) +} finally { + await server.close() +} +assert.deepEqual(hosted.sort(), [ + ['licence-holder', 'POST', false, null, null, undefined, 'application/json', 'key-licence-holder', { profile: 'licence-holder' }], + ['licence-officer', 'POST', false, null, null, undefined, 'application/json', 'key-licence-officer', { profile: 'licence-officer' }], +]) +assert.deepEqual(calls.slice(3).map(([url, headers]) => { + const target = new URL(url) + return [target.origin + target.pathname, target.searchParams.get('accessProfile'), headers.get('authorization')] +}).sort(), [ + ['http://127.0.0.1:54322/v1/records/licences', 'licence-holder', 'Bearer hosted-holder'], + ['http://127.0.0.1:54322/v1/records/licences', 'licence-officer', 'Bearer hosted-officer'], +]) + +// A Coordinator call presents the run host key as its bearer. The host admits +// it and hands the binding a fixed non-secret placeholder instead, so the key +// never leaves the host and the registry refuses the placeholder. +const hostKey = 'synthetic-run-function-host-key-0123456789' +const coordinatorHosted = [] +const coordinatorHandler = defineFunction(async (request, licences) => { + coordinatorHosted.push([request.headers.has('authorization'), request.headers.get('cookie'), + request.headers.get('proxy-authorization'), request.headers.get('idempotency-key')]) + await licences.list('licence', { accessProfile: 'licence-officer' }) + return new Response(null, { status: 204 }) +})({ products: { 'licence-registry': { baseUrl: 'http://127.0.0.1:54323' } } }) +const coordinatorHost = await startFunctionHost(new Map([['renew', coordinatorHandler]]), { + authorize: functionHostAuthorizer(hostKey), +}) +const before = calls.length +try { + const response = await networkFetch(coordinatorHost.origin + '/functions/renew', { + method: 'POST', body: '{}', + headers: { + authorization: 'Bearer ' + hostKey, 'content-type': 'application/json', 'idempotency-key': 'frozen-key', + cookie: 'session=browser', 'proxy-authorization': 'Basic cHJveHk6cHJveHk=', + }, + }) + assert.equal(response.status, 204) +} finally { + await coordinatorHost.close() +} +assert.deepEqual(coordinatorHosted, [[false, null, null, 'frozen-key']]) +const upstream = calls.slice(before) +assert.equal(upstream.length, 1) +assert.equal(upstream[0][1].get('authorization'), coordinatorBearer) +assert.ok(!JSON.stringify(upstream.map(([url, headers]) => [url, [...headers]])).includes(hostKey)) ` }) assert.equal(run.status, 0, run.stderr) }) diff --git a/crates/registry-coordinator/src/adapters.rs b/crates/registry-coordinator/src/adapters.rs index 3c7d9aa169..c480822a6f 100644 --- a/crates/registry-coordinator/src/adapters.rs +++ b/crates/registry-coordinator/src/adapters.rs @@ -64,6 +64,8 @@ enum Connection { Payments(Box), Casework(Box), External(Box), + /// One bound service function, reached only by `service.invoke-function/v1`. + ServiceFunction(Box), Decision(Box), } @@ -190,6 +192,7 @@ impl HttpAdapters { .resolver(config.development.as_ref()) .map_err(|_| config_error())?, ); + distinct_function_keys(config, &secrets)?; let mut connections = BTreeMap::new(); for (name, configured) in &config.connections { if let Some(binding) = configured.external_http() { @@ -213,6 +216,45 @@ impl HttpAdapters { connections.insert(name.clone(), Connection::External(Box::new(connection))); continue; } + if let Some(binding) = configured.service_function() { + let provider: Arc = + match (&binding.authorization, &binding.host_key_ref) { + (Some(auth), None) => { + let key_bytes = secrets + .resolve_reference(&auth.signing_key_ref) + .map_err(|_| config_error())?; + let key_text = std::str::from_utf8(key_bytes.expose_secret()) + .map_err(|_| config_error())?; + let key = PrivateJwk::parse(key_text).map_err(|_| config_error())?; + Arc::new( + tokens(auth, key, &auth.resource, &auth.scopes) + .map_err(|_| config_error())?, + ) + } + (None, Some(reference)) => { + let key = secrets + .resolve_reference(reference) + .map_err(|_| config_error())?; + let text = std::str::from_utf8(key.expose_secret()) + .map_err(|_| config_error())?; + Arc::new( + registry_platform_httputil::client::StaticToken::new( + text.trim_end_matches('\n'), + ) + .map_err(|_| config_error())?, + ) + } + _ => return Err(config_error()), + }; + let connection = crate::external_http::ExternalHttpConnection::service_function( + binding, provider, + )?; + connections.insert( + name.clone(), + Connection::ServiceFunction(Box::new(connection)), + ); + continue; + } if let Some(binding) = configured.decision() { let connection = crate::decision::DecisionConnection::new(binding, Arc::clone(&secrets))?; @@ -423,6 +465,63 @@ impl HttpAdapters { } } +/// A service function host never holds a key this runtime file gives +/// something else, even under another secret reference: a JWK is compared by +/// its RFC 7638 thumbprint, any other key by a digest of its bytes. The +/// refusal names the two locations and no key value. +fn distinct_function_keys( + config: &RuntimeConfig, + secrets: ®istry_platform_config::SecretResolver, +) -> Result<()> { + use sha2::Digest as _; + let identity = |reference: ®istry_platform_config::SecretReference| -> Result { + let secret = secrets + .resolve_reference(reference) + .map_err(|_| config_error())?; + let bytes = secret.expose_secret(); + let jwk = std::str::from_utf8(bytes) + .ok() + .and_then(|text| PrivateJwk::parse(text).ok()) + .and_then(|key| key.public().jkt().ok()); + Ok(match jwk { + Some(thumbprint) => format!("jwk:{thumbprint}"), + None => format!("bytes:{}", hex::encode(sha2::Sha256::digest(bytes))), + }) + }; + let mut functions = Vec::new(); + for (name, configured) in &config.connections { + if let Some(function) = configured.service_function() { + for reference in function + .authorization + .as_ref() + .map(|auth| &auth.signing_key_ref) + .into_iter() + .chain(function.host_key_ref.as_ref()) + { + functions.push((name, identity(reference)?)); + } + } + } + if functions.is_empty() { + return Ok(()); + } + let mut others = Vec::new(); + for (location, reference) in config.other_key_references() { + others.push((location, identity(reference)?)); + } + for (function, key) in &functions { + if let Some((other, _)) = others.iter().find(|(_, value)| value == key) { + return Err(CoordinatorError::new( + "coordinator.runtime-config.refused", + format!("connections {function} and {other} resolve to the same key; a service function host must hold a key nothing else in this runtime uses"), + ) + .at("runtime.yaml", format!("/connections/{function}")) + .suggest(format!("Give connections.{function} its own key, distinct from {other}."))); + } + } + Ok(()) +} + pub(crate) fn refused(code: &str) -> CallOutcome { CallOutcome::Refused { code: code.to_owned(), @@ -1088,6 +1187,16 @@ impl AdapterSet for HttpAdapters { }; connection.command(&request.input, key, final_attempt).await } + ( + Some(Connection::ServiceFunction(connection)), + Operation::InvokeServiceFunction, + None, + ) => { + let Some(key) = &request.idempotency_key else { + return refused("invalid-command"); + }; + connection.command(&request.input, key, final_attempt).await + } _ => self.call_prepared(request, prepared).await, } } @@ -1103,6 +1212,12 @@ impl AdapterSet for HttpAdapters { }; connection.command(&request.input, key, false).await } + (Some(Connection::ServiceFunction(connection)), Operation::InvokeServiceFunction) => { + let Some(key) = &request.idempotency_key else { + return refused("invalid-command"); + }; + connection.command(&request.input, key, false).await + } ( Some(Connection::Breg { client, options, .. diff --git a/crates/registry-coordinator/src/authoring.rs b/crates/registry-coordinator/src/authoring.rs index 339fbcc310..05af11f6fd 100644 --- a/crates/registry-coordinator/src/authoring.rs +++ b/crates/registry-coordinator/src/authoring.rs @@ -163,13 +163,21 @@ struct AuthoredOperation { /// Fix a Messaging template version, its locales and its data schema. #[serde(default)] template: Option, + /// The one service function `service.invoke-function/v1` calls. Required + /// on, and accepted only on, that Operation. `check` matches it against + /// the function the runtime connection binds; `rstack dev` also checks it + /// against `service.yaml`. The runtime connection binds the host and + /// credential, and the workflow supplies neither. + #[serde(default)] + service_function: Option, /// An optional typed response specialization for the bounded external GET - /// or external command Operation. + /// or external command Operation, or the service function Operation. #[serde(default)] response_schema: Option, /// The typed pure Transform that interprets an external command's provider /// response into an accepted result, a declared refusal or an uncertain - /// outcome. Required on, and accepted only on, `external.command/v1`. + /// outcome. Required on, and accepted only on, `external.command/v1` and + /// `service.invoke-function/v1`. #[serde(default)] interpret: Option, /// Named bounded completion contracts; the host enforces their observation semantics. @@ -1280,31 +1288,54 @@ fn compile(project: CoordinatorProject, path: &Path) -> Result { &imported, ) .map_err(|error| error.at("workflow.yaml", contract_field))?; + match ( + uses == Operation::InvokeServiceFunction, + &operation.service_function, + ) { + (true, None) => { + return Err(schema_error( + format!("/operations/{id}/serviceFunction"), + "service.invoke-function/v1 requires serviceFunction: the one function this Operation calls, which its runtime connection must bind", + )); + } + (false, Some(_)) => { + return Err(schema_error( + format!("/operations/{id}/serviceFunction"), + "only service.invoke-function/v1 accepts a serviceFunction", + )); + } + _ => {} + } if operation.response_schema.is_some() - && !matches!(uses, Operation::ExternalGet | Operation::ExternalCommand) + && !matches!( + uses, + Operation::ExternalGet + | Operation::ExternalCommand + | Operation::InvokeServiceFunction + ) { return Err(schema_error( format!("/operations/{id}/responseSchema"), - "only the bounded external GET and external command profiles accept a response specialization", + "only the bounded external GET, external command and service function profiles accept a response specialization", )); } - match (uses, operation.interpret) { - (Operation::ExternalCommand, Some(interpret)) => { + match (uses.interprets_response(), operation.interpret) { + (true, Some(interpret)) => { command_interpreters.insert(id.clone(), interpret); } - (Operation::ExternalCommand, None) => { + (true, None) => { return Err(schema_error( format!("/operations/{id}/interpret"), - "external.command/v1 requires interpret: the Transform that turns the provider response into an accepted result, a declared refusal or an uncertain outcome", + &format!("{} requires interpret: the Transform that turns the provider response into an accepted result, a declared refusal or an uncertain outcome", uses.as_str()), )); } - (_, Some(_)) => { + (false, Some(_)) => { return Err(schema_error( format!("/operations/{id}/interpret"), - "only external.command/v1 accepts an interpretation Transform", + "only external.command/v1 and service.invoke-function/v1 accept an interpretation Transform", )); } - (_, None) => {} + (false, None) => {} } let mut completions = BTreeMap::new(); if uses == Operation::SubmitReviewRequest { @@ -1363,6 +1394,7 @@ fn compile(project: CoordinatorProject, path: &Path) -> Result { revision: String::new(), interpret: None, response: None, + service_function: operation.service_function.map(LocalId::into_string), action: contract.action, label: operation.label, description: operation.description, diff --git a/crates/registry-coordinator/src/contracts.rs b/crates/registry-coordinator/src/contracts.rs index efa16f2389..9d89435172 100644 --- a/crates/registry-coordinator/src/contracts.rs +++ b/crates/registry-coordinator/src/contracts.rs @@ -1277,6 +1277,28 @@ mod derived { ) } + /// The function body is a JSON object a pinned pure Transform builds; the + /// output is the bounded function host response the pinned interpretation + /// Transform receives, as for an external command. + pub(super) fn invoke_service_function() -> (Value, Value) { + let mut response = output::(); + response["description"] = json!( + "The bounded function host response. The operation's interpret \ + Transform receives it with the request body and returns the step \ + result, a declared refusal, or an uncertain outcome." + ); + ( + json!({ + "$schema":"https://json-schema.org/draft/2020-12/schema", + "type":"object", + "description":"The request body, sent as the exact JSON object to the \ + one service function the connection binds.", + "additionalProperties":true + }), + response, + ) + } + pub(super) fn evaluate() -> (Value, Value) { (evaluation_input(), output::()) } diff --git a/crates/registry-coordinator/src/definition.rs b/crates/registry-coordinator/src/definition.rs index 2b3d45be7c..3f25cf7abf 100644 --- a/crates/registry-coordinator/src/definition.rs +++ b/crates/registry-coordinator/src/definition.rs @@ -392,6 +392,10 @@ pub struct ResolvedOperation { /// interpreted accepted result. #[serde(default, skip_serializing_if = "Option::is_none")] pub response: Option, + /// The one service function `service.invoke-function/v1` calls. Present only on that operation; the + /// runtime connection must bind the same function. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub service_function: Option, /// Exact imported specialization, when the owning product exports one. #[serde(default, skip_serializing_if = "Option::is_none")] pub action: Option, @@ -1402,16 +1406,20 @@ fn seal_revisions(workflow: &mut Workflow, sources: &BTreeMap) - if let Some(response) = &operation.response { identity["response"] = semantic_schema(response); } + if let Some(function) = &operation.service_function { + identity["serviceFunction"] = serde_json::json!(function); + } operation.revision = semantic_hash(&identity)?; } Ok(()) } -/// An external command pins one interpretation Transform over its exact -/// command and response schemas, and its output and refusal are exactly what -/// that Transform declares. No other operation carries an interpretation. +/// An external command or service function call pins one interpretation +/// Transform over its exact command and response schemas, and its output and +/// refusal are exactly what that Transform declares. No other operation +/// carries an interpretation. fn command_interpretation_valid(flow: &Workflow, operation: &ResolvedOperation) -> bool { - if operation.uses != Operation::ExternalCommand { + if !operation.uses.interprets_response() { return operation.interpret.is_none() && operation.response.is_none(); } let (Some(interpret), Some(response)) = (&operation.interpret, &operation.response) else { @@ -1813,6 +1821,21 @@ fn workflow_findings(flow: &Workflow) -> Vec { findings.push(authored("definition.abi", &format!("/operations/{alias}/interpret"), "the command interpretation does not match its host-enforced Operation contract", "Recompile the canonical project; local metadata cannot change how a provider response is interpreted.")); } + let names_function = operation + .service_function + .as_deref() + .is_some_and(|name| registry_platform_yaml::LocalId::new(name).is_ok()); + if (operation.uses == Operation::InvokeServiceFunction) != names_function + || (operation.uses != Operation::InvokeServiceFunction + && operation.service_function.is_some()) + { + findings.push(authored( + "definition.abi", + &format!("/operations/{alias}/serviceFunction"), + "the operation does not name exactly one valid service function", + "Recompile the canonical project with its checked service function name.", + )); + } } for (name, step) in &flow.steps { if let Step::Call { call, .. } = step { diff --git a/crates/registry-coordinator/src/external_http.rs b/crates/registry-coordinator/src/external_http.rs index c6fa2cb42a..b4dc1d4339 100644 --- a/crates/registry-coordinator/src/external_http.rs +++ b/crates/registry-coordinator/src/external_http.rs @@ -1,7 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -//! Configured, bounded external JSON reads and one configured external command. -//! A read never sends a mutation. A command sends one JSON object by POST to -//! the operator's configured command path and nowhere else. +//! Configured, bounded external JSON reads, one configured external command, +//! and one bound service function. A read never sends a mutation. A command +//! sends one JSON object by POST to the operator's configured command path and +//! nowhere else; a service function call sends one to the function host's +//! route for the one function the connection binds. use std::{collections::BTreeMap, sync::Arc, time::Duration}; @@ -11,12 +13,13 @@ use registry_platform_httputil::{ client::{RetryAfter, TokenProvider}, read_bounded, BoundedReadError, FetchUrlError, FetchUrlPolicy, ServiceBaseUrl, }; -use registry_platform_yaml::{BoundedU64, ExternalId, ForeignValue, UniqueList}; +use registry_platform_yaml::{BoundedU64, ExternalId, ForeignValue, LocalId, UniqueList}; use serde::{Deserialize, Deserializer, Serialize}; use serde_json::Value; use url::{Host, Url}; use crate::{protocol::CallOutcome, runtime::AuthorizationConfig, CoordinatorError, Result}; +use registry_platform_config::SecretReference; /// The reviewed directory contract and environment-specific destination. #[derive(Clone, Serialize, Deserialize)] @@ -51,6 +54,84 @@ pub struct ExternalHttpConfig { pub maximum_response_bytes: BoundedU64<1, { crate::operations::MAXIMUM_HTTP_RESPONSE_BYTES }>, } +/// One service function, bound by the deployment to its function host and to a +/// credential for that host alone. `rstack dev` checks the name against the +/// service's `service.yaml`; an operator recipe binds a name it has checked. +/// The workflow names the function; it never supplies the destination or the +/// credential. The function host serves the function at `functions/` +/// under the base URL. +#[derive(Clone, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct ServiceFunctionConfig { + #[serde(deserialize_with = "endpoint")] + #[cfg_attr(feature = "schema", schemars(with = "registry_platform_yaml::Url"))] + #[cfg_attr(feature = "schema", schemars(extend("pattern" = "^[^\\s\\\\]+$")))] + pub base_url: Url, + /// The one function this connection binds. + pub function: LocalId, + /// An OAuth client credential for the function host. Its client, key and + /// resource must differ from every product, external and evaluation + /// credential this runtime file declares. Exactly one of `authorization` + /// and `hostKeyRef` is required. + #[serde(default, skip_serializing_if = "Option::is_none")] + #[cfg_attr(feature = "schema", schemars(extend("not" = serde_json::json!({"required":["taskAuthority"]}))))] + pub authorization: Option, + /// A static key only the function host accepts, sent as the bearer token. + /// `rstack dev` generates one for each run; an operator recipe supplies + /// its own. Exactly one of `authorization` and `hostKeyRef` is required. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub host_key_ref: Option, + /// Local JSON Schema for the complete {status, body} response. + #[cfg_attr(feature = "schema", schemars(extend("x-registry-foreign" = "json-schema-2020-12")))] + pub response_schema: ForeignValue, + #[serde(default = "default_timeout")] + pub attempt_timeout_milliseconds: + BoundedU64<1, { crate::operations::HTTP_REQUEST_TIMEOUT_MILLISECONDS }>, + #[serde(default = "default_response_bytes")] + pub maximum_response_bytes: BoundedU64<1, { crate::operations::MAXIMUM_HTTP_RESPONSE_BYTES }>, +} + +impl ServiceFunctionConfig { + /// The bounded HTTP transport for the one function route: its only path + /// is the command path, and the credential is always present. + pub(crate) fn transport(&self) -> ExternalHttpConfig { + let route = ExternalId::new(format!("functions/{}", self.function.as_str())) + .expect("a local identifier yields a bounded relative path"); + ExternalHttpConfig { + base_url: self.base_url.clone(), + paths: UniqueList::new(vec![route.clone()]).expect("one path is unique"), + query_parameters: None, + authorization: self.authorization.clone(), + command_path: Some(route), + response_schema: self.response_schema.clone(), + attempt_timeout_milliseconds: self.attempt_timeout_milliseconds, + maximum_response_bytes: self.maximum_response_bytes, + } + } + + pub fn findings(&self, prefix: &str) -> Vec { + let mut transport = self.transport(); + let task_authority = transport + .authorization + .as_mut() + .and_then(|authorization| authorization.task_authority.take()) + .is_some(); + let mut errors = transport.findings(prefix); + if task_authority { + errors.push( + CoordinatorError::new( + "coordinator.external-http.configuration", + "the service function credential was refused", + ) + .at("runtime.yaml", format!("{prefix}.authorization.taskAuthority")) + .suggest("Remove taskAuthority; a service function call runs under the function host credential alone and never under task authority."), + ); + } + errors + } +} + fn endpoint<'de, D: Deserializer<'de>>(d: D) -> std::result::Result { let written = registry_platform_yaml::Url::deserialize(d)?; if written.as_str().contains('\\') || written.as_str().chars().any(char::is_whitespace) { @@ -221,6 +302,23 @@ impl ExternalHttpConnection { }) } + /// The connection to one bound service function. Calls reach it only + /// through [`Self::command`], under the function host credential: the + /// OAuth client's tokens or the static host key. + pub fn service_function( + config: &ServiceFunctionConfig, + tokens: Arc, + ) -> Result { + let transport = config.transport(); + let oauth = transport + .authorization + .is_some() + .then(|| Arc::clone(&tokens)); + let mut connection = Self::new(&transport, oauth)?; + connection.tokens = Some(tokens); + Ok(connection) + } + /// One attempt at the configured read. Before the final attempt, a busy or /// failing gateway (429, 502, 503 or 504) is retryable with the wait its /// `Retry-After` names; on the final attempt the workflow receives it as diff --git a/crates/registry-coordinator/src/operations.rs b/crates/registry-coordinator/src/operations.rs index d671f9d3f1..8618487451 100644 --- a/crates/registry-coordinator/src/operations.rs +++ b/crates/registry-coordinator/src/operations.rs @@ -150,12 +150,17 @@ impl OperationDescriptor { "connectTimeoutMilliseconds":HTTP_CONNECT_TIMEOUT_MILLISECONDS, "maximumMutationRetries":HTTP_MUTATION_RETRIES }); - if matches!(self.product, "external-http" | "evaluation") { + if matches!( + self.product, + "external-http" | "service-function" | "evaluation" + ) { let fields = http.as_object_mut().expect("HTTP contract is an object"); fields.remove("connectTimeoutMilliseconds"); fields.insert("connectionMayLowerLimits".into(), json!(true)); fields.insert("redirects".into(), json!("refused")); - if self.id == Operation::ExternalCommand.as_str() { + if self.id == Operation::ExternalCommand.as_str() + || self.id == Operation::InvokeServiceFunction.as_str() + { fields.insert( "maximumRequestBytes".into(), json!(MAXIMUM_HTTP_RESPONSE_BYTES), @@ -358,6 +363,7 @@ macro_rules! operation_catalog { RequestDisbursement => "payments.request-disbursement/v1", receipt_reconciled_mutation("payments"), request_disbursement; ReadDisbursement => "payments.read-disbursement/v1", read("payments"), read_disbursement; RecordProviderConfirmation => "payments.record-provider-confirmation/v1", mutation("payments", false, false), record_provider_confirmation; + InvokeServiceFunction => "service.invoke-function/v1", declared_mutation("service-function", false, false), invoke_service_function; } }; } @@ -494,6 +500,10 @@ mod tests { Operation::RecordProviderConfirmation, "payments.record-provider-confirmation/v1", ), + ( + Operation::InvokeServiceFunction, + "service.invoke-function/v1", + ), ]; assert_eq!( descriptors() @@ -647,6 +657,7 @@ mod tests { Operation::RecordReceipt, Operation::RequestDisbursement, Operation::RecordProviderConfirmation, + Operation::InvokeServiceFunction, ]; let allowed_mutations = [ Operation::SubmitMessage, diff --git a/crates/registry-coordinator/src/protocol.rs b/crates/registry-coordinator/src/protocol.rs index 49e2f14030..95c308bae0 100644 --- a/crates/registry-coordinator/src/protocol.rs +++ b/crates/registry-coordinator/src/protocol.rs @@ -71,6 +71,7 @@ impl Operation { | Self::StartProposal | Self::SubmitProposal | Self::ExternalCommand + | Self::InvokeServiceFunction | Self::RequestCollection | Self::RecordReceipt | Self::RequestDisbursement @@ -78,6 +79,12 @@ impl Operation { ) } + /// Calls whose bounded provider response becomes a step result only + /// through the operation's pinned interpretation Transform. + pub fn interprets_response(self) -> bool { + matches!(self, Self::ExternalCommand | Self::InvokeServiceFunction) + } + pub fn is_read(self) -> bool { self.descriptor().effect == crate::operations::EffectKind::Read } diff --git a/crates/registry-coordinator/src/runtime.rs b/crates/registry-coordinator/src/runtime.rs index 20084f7317..13f6c8c10d 100644 --- a/crates/registry-coordinator/src/runtime.rs +++ b/crates/registry-coordinator/src/runtime.rs @@ -237,6 +237,7 @@ pub enum ConnectionConfig { Payments(PaymentConnectionConfig), Scheduling(Box), ExternalHttp(crate::external_http::ExternalHttpConfig), + ServiceFunction(crate::external_http::ServiceFunctionConfig), Evaluation(crate::decision::DecisionConfig), } registry_platform_yaml::tagged_union!(ConnectionConfig); @@ -423,7 +424,7 @@ impl ConnectionConfig { None, c.result_check_seconds, ), - Self::ExternalHttp(_) | Self::Evaluation(_) => return None, + Self::ExternalHttp(_) | Self::ServiceFunction(_) | Self::Evaluation(_) => return None, }; Some(ProductBinding { product, @@ -445,6 +446,13 @@ impl ConnectionConfig { } } + pub fn service_function(&self) -> Option<&crate::external_http::ServiceFunctionConfig> { + match self { + Self::ServiceFunction(config) => Some(config), + _ => None, + } + } + pub fn decision(&self) -> Option<&crate::decision::DecisionConfig> { match self { Self::Evaluation(config) => Some(config), @@ -463,7 +471,7 @@ impl ConnectionConfig { Self::Payments(c) => Some(&mut c.authorization), Self::Scheduling(c) => Some(&mut c.authorization), Self::CaseworkReviewProducer(c) => Some(&mut c.authorization), - Self::ExternalHttp(_) | Self::Evaluation(_) => None, + Self::ExternalHttp(_) | Self::ServiceFunction(_) | Self::Evaluation(_) => None, } } @@ -496,6 +504,7 @@ impl ConnectionConfig { Self::Payments(_) => "payments", Self::Scheduling(_) => "scheduling", Self::ExternalHttp(_) => "external-http", + Self::ServiceFunction(_) => "service-function", Self::Evaluation(_) => "evaluation", } } @@ -515,6 +524,7 @@ impl Serialize for ConnectionConfig { Self::Payments(c) => ("payments", serde_json::to_value(c)), Self::Scheduling(c) => ("scheduling", serde_json::to_value(c)), Self::ExternalHttp(c) => ("external-http", serde_json::to_value(c)), + Self::ServiceFunction(c) => ("service-function", serde_json::to_value(c)), Self::Evaluation(c) => ("evaluation", serde_json::to_value(c)), }; let mut value = value.map_err(serde::ser::Error::custom)?; @@ -720,6 +730,29 @@ impl RuntimeConfig { ); } } + // A credential collision also points at the member it matches. + for (name, binding) in &loaded.config.connections { + let Some(function) = binding.service_function() else { + continue; + }; + let field = format!("connections.{name}"); + for (member, other, _) in loaded + .config + .function_credential_collisions(&field, function) + { + let member = pointer(&member); + if let Some(diagnostic) = diagnostics + .iter_mut() + .find(|diagnostic| diagnostic.path == member) + { + checked.add_related_key( + diagnostic, + &other, + "the member this credential matches", + ); + } + } + } if let Some(deployment) = &loaded.config.deployment { diagnostics.extend( deployment @@ -837,6 +870,38 @@ impl RuntimeConfig { &self.secret_providers, )); } + } else if let Some(function) = binding.service_function() { + errors.extend(function.findings(&field)); + match (&function.authorization, &function.host_key_ref) { + (Some(authorization), None) => { + errors.extend(authorization.secret_reference_finding( + &format!("{field}.authorization"), + &self.secret_providers, + )); + } + (None, Some(reference)) => { + let member = format!("{field}.hostKeyRef"); + if self + .secret_providers + .check_reference(&member, reference.as_str()) + .is_err() + { + errors.push(config_error( + &member, + "enable the secret provider named by the function host key reference", + )); + } + } + _ => errors.push(config_error( + &field, + "give the service function connection exactly one credential: authorization for an OAuth client, or hostKeyRef for a key only the function host accepts", + )), + } + errors.extend( + self.function_credential_collisions(&field, function) + .into_iter() + .map(|(_, _, error)| error), + ); } else if let Some(binding) = binding.decision() { errors.extend(binding.findings(&field)); if let Some(reference) = binding.token_ref() { @@ -1034,6 +1099,176 @@ impl RuntimeConfig { self.validate_workflow_effect_bindings(workflow) } + /// Every key reference this runtime file gives something other than a + /// service function host, with the JSON pointer of the member that holds + /// it: product, external and evaluation credentials, review completion + /// keys, event source keys, and the deployment's own keys. + pub(crate) fn other_key_references(&self) -> Vec<(String, &SecretReference)> { + let mut keys = Vec::new(); + for (name, binding) in &self.connections { + let at = |member: &str| pointer(&format!("connections.{name}.{member}")); + if let Some(product) = binding.product_binding() { + keys.push(( + at("authorization.signingKeyRef"), + &product.authorization.signing_key_ref, + )); + if let Some(observation) = product.observation_authorization { + keys.push(( + at("observationAuthorization.signingKeyRef"), + &observation.signing_key_ref, + )); + } + if let Some(completion) = product.completion { + keys.push(( + at("completion.hmacSha256KeyRef"), + &completion.hmac_sha256_key_ref, + )); + if let Some(previous) = &completion.previous_hmac_sha256_key_ref { + keys.push((at("completion.previousHmacSha256KeyRef"), previous)); + } + } + } else if let Some(external) = binding.external_http() { + if let Some(authorization) = &external.authorization { + keys.push(( + at("authorization.signingKeyRef"), + &authorization.signing_key_ref, + )); + } + } else if let Some(reference) = binding.decision().and_then(|d| d.token_ref()) { + keys.push((at("authorization.bearer.tokenRef"), reference)); + } + } + for (source, config) in &self.event_sources { + for (workflow, triggers) in &config.triggers { + for (trigger, key) in &triggers.0 { + let at = |member: &str| { + format!( + "/eventSources/{}/triggers/{}/{}/{member}", + registry_platform_yaml::escape_pointer_segment(source), + registry_platform_yaml::escape_pointer_segment(workflow.as_str()), + registry_platform_yaml::escape_pointer_segment(trigger.as_str()), + ) + }; + keys.push((at("hmacSha256KeyRef"), &key.hmac_sha256_key_ref)); + if let Some(previous) = &key.previous_hmac_sha256_key_ref { + keys.push((at("previousHmacSha256KeyRef"), previous)); + } + } + } + } + if let Some(deployment) = &self.deployment { + keys.push(( + "/deployment/auditKeyRef".to_owned(), + &deployment.audit_key_ref, + )); + for (version, reference) in &deployment.state_keys { + keys.push(( + format!( + "/deployment/stateKeys/{}/keyRef", + registry_platform_yaml::escape_pointer_segment(version) + ), + reference, + )); + } + keys.push(( + "/deployment/admissionKeyRef".to_owned(), + &deployment.admission_key_ref, + )); + } + keys + } + + /// Each member of a service function credential that collides with a + /// credential, product audience or key this runtime file gives something + /// else, as the dotted field of the colliding member, the JSON pointer of + /// the member it matches, and the refusal. A resource is compared after + /// normalisation against product, external and task authority resources + /// and the Coordinator's own audience. Startup also compares the resolved + /// key material. Other service function connections are not compared. + fn function_credential_collisions( + &self, + field: &str, + function: &crate::external_http::ServiceFunctionConfig, + ) -> Vec<(String, String, CoordinatorError)> { + let mut resources: Vec<(String, String)> = Vec::new(); + let mut clients: Vec<(&str, String)> = Vec::new(); + for (name, binding) in &self.connections { + let mut credentials: Vec<(&str, &AuthorizationConfig)> = Vec::new(); + if let Some(product) = binding.product_binding() { + credentials.push(("authorization", product.authorization)); + credentials.extend( + product + .observation_authorization + .map(|auth| ("observationAuthorization", auth)), + ); + } else if let Some(external) = binding.external_http() { + credentials.extend( + external + .authorization + .as_ref() + .map(|auth| ("authorization", auth)), + ); + } + for (member, credential) in credentials { + let at = |rest: &str| pointer(&format!("connections.{name}.{member}.{rest}")); + resources.push((normalised_resource(&credential.resource), at("resource"))); + if let Some(task) = &credential.task_authority { + resources.push(( + normalised_resource(&task.bootstrap_resource), + at("taskAuthority.bootstrapResource"), + )); + resources.push(( + normalised_resource(&task.exchange_audience), + at("taskAuthority.exchangeAudience"), + )); + } + clients.push((&credential.client_id, at("clientId"))); + } + } + if let Some(deployment) = &self.deployment { + for (id, issuer) in deployment.authentication.issuers.iter() { + resources.push(( + normalised_resource(&issuer.core.provider.audience), + format!( + "/deployment/authentication/issuers/{}/audience", + registry_platform_yaml::escape_pointer_segment(id.as_str()) + ), + )); + } + } + let keys = self.other_key_references(); + let refusal = |member: &str, other: &str| { + let member = format!("{field}.{member}"); + let error = config_error( + &member, + &format!("give the service function host its own resource, client and key; the value matches {other}, which would let the function act with that authority"), + ); + (member, other.to_owned(), error) + }; + let mut collisions = Vec::new(); + if let Some(own) = &function.authorization { + let resource = normalised_resource(&own.resource); + if let Some((_, other)) = resources.iter().find(|(value, _)| *value == resource) { + collisions.push(refusal("authorization.resource", other)); + } + if let Some((_, other)) = clients.iter().find(|(value, _)| *value == own.client_id) { + collisions.push(refusal("authorization.clientId", other)); + } + if let Some((other, _)) = keys + .iter() + .find(|(_, reference)| **reference == own.signing_key_ref) + { + collisions.push(refusal("authorization.signingKeyRef", other)); + } + } + if let Some(reference) = &function.host_key_ref { + if let Some((other, _)) = keys.iter().find(|(_, value)| *value == reference) { + collisions.push(refusal("hostKeyRef", other)); + } + } + collisions + } + /// Retained Runs require their effect bindings, independently of whether /// the event source that admitted them is still enabled for new starts. fn validate_workflow_effect_bindings( @@ -1091,6 +1326,34 @@ impl RuntimeConfig { call.connection, ))); } + if call.operation == crate::protocol::Operation::InvokeServiceFunction { + let named = workflow + .operations + .get(&call.alias) + .and_then(|operation| operation.service_function.as_deref()); + let bound = self + .connections + .get(&call.connection) + .and_then(ConnectionConfig::service_function) + .map(|binding| binding.function.as_str()); + if bound.is_some() && named != bound { + return Err(CoordinatorError::new( + "workflow-binding", + format!( + "the connection does not bind the service function {}", + named.unwrap_or("the operation names") + ), + ) + .at( + "workflow.yaml", + format!("/operations/{}/serviceFunction", call.alias), + ) + .suggest(format!( + "Name the function bound as connections.{}.function in runtime.yaml, or add one service-function connection for this function.", + call.connection + ))); + } + } if call.operation == crate::protocol::Operation::ExternalCommand && self .connections @@ -1181,6 +1444,38 @@ impl RuntimeConfig { identities.insert(name, identity); continue; } + if let Some(binding) = self + .connections + .get(name) + .and_then(ConnectionConfig::service_function) + { + let mut identity = serde_json::to_value(binding).map_err(|_| { + config_error("connections", "correct the service function binding model") + })?; + if let Some(auth) = identity + .get_mut("authorization") + .and_then(serde_json::Value::as_object_mut) + { + auth.remove("signingKeyRef"); + if let Some(scopes) = auth + .get_mut("scopes") + .and_then(serde_json::Value::as_array_mut) + { + scopes.sort_by(|a, b| a.as_str().cmp(&b.as_str())); + } + } + // Rotating the host key changes no binding, as rotating a + // signing key does not. + if let Some(binding) = identity.as_object_mut() { + if binding.remove("hostKeyRef").is_some() { + binding.insert("credential".into(), json!("host-key")); + } + } + identity["product"] = json!("service-function"); + identity["abi"] = json!("coordinator-service-function/v1"); + identities.insert(name, identity); + continue; + } let binding = self.connections[name] .product_binding() .expect("validated product binding"); @@ -1287,6 +1582,35 @@ fn runtime_id_collision_diagnostics( diagnostics } +/// The form a resource indicator is compared in: a URL with its scheme and +/// host in lower case, its default port dropped and one trailing `/` removed +/// from its path, or a URN with its `urn:` scheme and namespace identifier in +/// lower case. Any other identifier is compared exactly. +fn normalised_resource(resource: &str) -> String { + match Url::parse(resource) { + Ok(url) if url.has_host() => { + let text = url.to_string(); + match text.strip_suffix('/') { + Some(trimmed) if url.query().is_none() && url.fragment().is_none() => { + trimmed.to_owned() + } + _ => text, + } + } + _ => { + let mut parts = resource.splitn(3, ':'); + match (parts.next(), parts.next(), parts.next()) { + (Some(scheme), Some(namespace), Some(rest)) + if scheme.eq_ignore_ascii_case("urn") => + { + format!("urn:{}:{rest}", namespace.to_ascii_lowercase()) + } + _ => resource.to_owned(), + } + } + } +} + fn config_error(field: &str, action: &str) -> CoordinatorError { CoordinatorError::new( "coordinator.runtime-config.refused", diff --git a/crates/registry-coordinator/src/scenarios.rs b/crates/registry-coordinator/src/scenarios.rs index 28b6c9405d..360b6a0be1 100644 --- a/crates/registry-coordinator/src/scenarios.rs +++ b/crates/registry-coordinator/src/scenarios.rs @@ -941,7 +941,7 @@ fn execute(definition: &Definition, scenario: &Scenario) -> Result Result { - if call.operation != crate::protocol::Operation::ExternalCommand { + if !call.operation.interprets_response() { return Err(error( "scenario.reply", format!("/replies/{step}/{index}"), format!("step {step} calls {operation}, which takes no provider response reply"), - "Use response only for external.command/v1; use success for this operation's output.", + "Use response only for external.command/v1 or service.invoke-function/v1; use success for this operation's output.", )); } definition.operation_contract(call)? diff --git a/crates/registry-coordinator/src/worker.rs b/crates/registry-coordinator/src/worker.rs index e55e8f1fda..6b11b8b0a3 100644 --- a/crates/registry-coordinator/src/worker.rs +++ b/crates/registry-coordinator/src/worker.rs @@ -735,9 +735,7 @@ impl Worker { // A command's provider response becomes its step result only // through the project's pinned interpretation Transform. let result = match result { - CallOutcome::Success(response) - if request.operation == crate::protocol::Operation::ExternalCommand => - { + CallOutcome::Success(response) if request.operation.interprets_response() => { crate::external_http::interpret_command( &definition, call, diff --git a/crates/registry-coordinator/tests/fixtures/service-function/fixtures/drafted.yaml b/crates/registry-coordinator/tests/fixtures/service-function/fixtures/drafted.yaml new file mode 100644 index 0000000000..bfed482cd8 --- /dev/null +++ b/crates/registry-coordinator/tests/fixtures/service-function/fixtures/drafted.yaml @@ -0,0 +1,24 @@ +# yaml-language-server: $schema=https://id.registrystack.org/schemas/coordinator/fixture/fixture.v1alpha1.schema.json +apiVersion: id.registrystack.org/formats/coordinator/fixture/v1alpha1 +kind: CoordinatorFixture +id: drafted +admittedAt: '2026-12-01T00:00:00Z' +input: + reference: application-001 +replies: + draft: + - type: response + value: + status: 200 + body: + draftId: draft-001 +expect: + path: + - draft + - drafted + state: completed + outcome: + type: named + value: drafted + output: + draftId: draft-001 diff --git a/crates/registry-coordinator/tests/fixtures/service-function/fixtures/not-eligible.yaml b/crates/registry-coordinator/tests/fixtures/service-function/fixtures/not-eligible.yaml new file mode 100644 index 0000000000..da5ba94519 --- /dev/null +++ b/crates/registry-coordinator/tests/fixtures/service-function/fixtures/not-eligible.yaml @@ -0,0 +1,24 @@ +# yaml-language-server: $schema=https://id.registrystack.org/schemas/coordinator/fixture/fixture.v1alpha1.schema.json +apiVersion: id.registrystack.org/formats/coordinator/fixture/v1alpha1 +kind: CoordinatorFixture +id: not-eligible +admittedAt: '2026-12-01T00:00:00Z' +input: + reference: application-002 +replies: + draft: + - type: response + value: + status: 422 + body: + reason: not-eligible +expect: + path: + - draft + - not-drafted + state: completed + outcome: + type: named + value: not-drafted + output: + refusalCode: not-eligible diff --git a/crates/registry-coordinator/tests/fixtures/service-function/fixtures/unrecognised-answer-holds.yaml b/crates/registry-coordinator/tests/fixtures/service-function/fixtures/unrecognised-answer-holds.yaml new file mode 100644 index 0000000000..13b5d006da --- /dev/null +++ b/crates/registry-coordinator/tests/fixtures/service-function/fixtures/unrecognised-answer-holds.yaml @@ -0,0 +1,17 @@ +# yaml-language-server: $schema=https://id.registrystack.org/schemas/coordinator/fixture/fixture.v1alpha1.schema.json +apiVersion: id.registrystack.org/formats/coordinator/fixture/v1alpha1 +kind: CoordinatorFixture +id: unrecognised-answer-holds +admittedAt: '2026-12-01T00:00:00Z' +input: + reference: application-003 +replies: + draft: + - type: response + value: + status: 403 + body: {} +expect: + path: + - draft + state: uncertain diff --git a/crates/registry-coordinator/tests/fixtures/service-function/functions.rhai b/crates/registry-coordinator/tests/fixtures/service-function/functions.rhai new file mode 100644 index 0000000000..edda0e484b --- /dev/null +++ b/crates/registry-coordinator/tests/fixtures/service-function/functions.rhai @@ -0,0 +1,18 @@ +// Pure Function ABI: one typed object of named inputs, one typed output. +fn draft_request(args) { + #{reference: args.request.reference} +} + +// Only a recognised answer settles the call. Anything else is uncertain, so +// the run holds for same-command recovery instead of guessing. +fn draft_outcome(args) { + let status = args.response.status; + let body = args.response.body; + if status == 200 && "draftId" in body { + return #{state: "accepted", result: #{draftId: body.draftId}}; + } + if status == 422 && "reason" in body && body.reason == "not-eligible" { + return #{state: "refused", code: "not-eligible"}; + } + #{state: "uncertain"} +} diff --git a/crates/registry-coordinator/tests/fixtures/service-function/runtime.yaml b/crates/registry-coordinator/tests/fixtures/service-function/runtime.yaml new file mode 100644 index 0000000000..4122e81e01 --- /dev/null +++ b/crates/registry-coordinator/tests/fixtures/service-function/runtime.yaml @@ -0,0 +1,26 @@ +apiVersion: id.registrystack.org/formats/coordinator/runtime/v1alpha1 +kind: CoordinatorRuntimeConfig +secretProviders: + environment: {} + file: {root: /run/secrets/coordinator} +database: + runtimeUrlRef: secret:env/COORDINATOR_TEST_DATABASE_URL + migrationUrlRef: secret:env/COORDINATOR_TEST_DATABASE_URL +namespace: coordinator_notices +connections: + notices: + type: service-function + baseUrl: http://127.0.0.1:9020/ + function: draft-notice + authorization: + tokenEndpoint: http://127.0.0.1:8090/token + clientAssertionAudience: http://127.0.0.1:8090 + clientId: coordinator-functions + signingKeyRef: secret:file/function-client-key + resource: urn:example:notice-functions + scopes: [functions:invoke] + responseSchema: + type: object + required: [status, body] + properties: + status: {type: integer} diff --git a/crates/registry-coordinator/tests/fixtures/service-function/workflow.yaml b/crates/registry-coordinator/tests/fixtures/service-function/workflow.yaml new file mode 100644 index 0000000000..6527be60c3 --- /dev/null +++ b/crates/registry-coordinator/tests/fixtures/service-function/workflow.yaml @@ -0,0 +1,106 @@ +apiVersion: id.registrystack.org/formats/coordinator/project/v1alpha1 +kind: CoordinatorProject +project: + id: notice-draft + version: "1" + +types: + notice-input: + type: object + additionalProperties: false + required: [reference] + properties: + reference: {type: string, minLength: 1, maxLength: 64} + draft-response: + type: object + additionalProperties: false + required: [status, body] + properties: + status: {type: integer, minimum: 200, maximum: 499} + body: + type: object + additionalProperties: false + properties: + draftId: {type: string, minLength: 1, maxLength: 64} + reason: {type: string, minLength: 1, maxLength: 64} + draft: + type: object + additionalProperties: false + required: [draftId] + properties: + draftId: {type: string, minLength: 1, maxLength: 64} + draft-outcome: + oneOf: + - type: object + additionalProperties: false + required: [state, result] + properties: + state: {type: string, const: accepted} + result: {typeRef: draft} + - type: object + additionalProperties: false + required: [state, code] + properties: + state: {type: string, const: refused} + code: {type: string, enum: [not-eligible]} + - type: object + additionalProperties: false + required: [state] + properties: + state: {type: string, const: uncertain} + +transforms: + draft-request: + runtime: rhai + source: functions.rhai + entrypoint: draft_request + inputs: + request: {typeRef: notice-input} + output: {operationInput: draft-notice} + draft-outcome: + runtime: rhai + source: functions.rhai + entrypoint: draft_outcome + inputs: + command: {operationInput: draft-notice} + response: {operationOutput: draft-notice} + output: {typeRef: draft-outcome} + +operations: + draft-notice: + uses: service.invoke-function/v1 + connection: notices + serviceFunction: draft-notice + responseSchema: {typeRef: draft-response} + interpret: draft-outcome + +workflow: + input: {typeRef: notice-input} + deadlineSeconds: 900 + start: draft + steps: + draft: + label: Draft the notice + type: call + operation: draft-notice + input: + type: transform + transform: draft-request + inputs: + request: {type: input} + next: drafted + onDeclaredRefusal: not-drafted + drafted: + type: finish + outcome: drafted + output: + type: fields + fields: + draftId: {type: step, step: draft, path: /draftId} + not-drafted: + type: finish + outcome: not-drafted + output: {type: step, step: draft} + outcomes: + drafted: {typeRef: draft} + not-drafted: {operationRefusal: draft-notice} diff --git a/crates/registry-coordinator/tests/service_function.rs b/crates/registry-coordinator/tests/service_function.rs new file mode 100644 index 0000000000..d512776a92 --- /dev/null +++ b/crates/registry-coordinator/tests/service_function.rs @@ -0,0 +1,943 @@ +// SPDX-License-Identifier: Apache-2.0 +//! `service.invoke-function/v1` over a loopback function host: one POST to the +//! one function the deployment binds, under the connection's own function-host +//! credential. That credential is never a product's, so the function holds no +//! record authority of its own. +use std::sync::Arc; + +use registry_coordinator::{ + contracts::contract, + external_http::{ExternalHttpConnection, ServiceFunctionConfig}, + protocol::{CallOutcome, Operation}, + runtime::{RuntimeConfig, API_VERSION, KIND}, +}; +use registry_platform_httputil::client::StaticToken; +use serde_json::{json, Value}; +use wiremock::{ + matchers::{body_json, header, method, path}, + Mock, MockServer, ResponseTemplate, +}; + +const REQUEST_ID: &str = "synthetic-function-request-id"; +const TOKEN: &str = "synthetic-function-host-token-canary"; + +fn response_schema() -> Value { + json!({ + "type":"object", "required":["status","body"], "additionalProperties":false, + "properties":{ + "status":{"type":"integer","minimum":100,"maximum":599}, + "body":{"anyOf":[{"type":"null"},{"type":"object","maxProperties":8}]} + } + }) +} + +fn function_authorization() -> Value { + json!({ + "tokenEndpoint":"http://127.0.0.1:9999/token", "clientId":"coordinator-functions", + "clientAssertionAudience":"http://127.0.0.1:9999", + "signingKeyRef":"secret:file/function-client-key", + "resource":"urn:example:notice-functions", + "scopes":["functions:invoke"] + }) +} + +fn binding(base: &str) -> Value { + json!({ + "baseUrl":base, "function":"draft-notice", + "authorization":function_authorization(), + "responseSchema":response_schema() + }) +} + +fn connection(base: &str) -> ExternalHttpConnection { + let config: ServiceFunctionConfig = serde_json::from_value(binding(base)).unwrap(); + let tokens = Arc::new(StaticToken::new(TOKEN).unwrap()); + ExternalHttpConnection::service_function(&config, tokens).unwrap() +} + +fn describe(outcome: &CallOutcome) -> String { + match outcome { + CallOutcome::Success(reply) => format!("success:{}", reply["status"]), + CallOutcome::Uncertain { code } => format!("uncertain:{code}"), + CallOutcome::Refused { code } => format!("refused:{code}"), + CallOutcome::Retryable { code, .. } => format!("retryable:{code}"), + CallOutcome::UncertainRetryable { code, .. } => format!("uncertain-retryable:{code}"), + _ => "other".into(), + } +} + +fn body() -> Value { + json!({"reference":"application-body-canary"}) +} + +#[tokio::test] +async fn a_call_posts_to_the_bound_function_with_the_function_host_credential() { + let server = MockServer::start().await; + Mock::given(method("POST")) + .and(path("/service/functions/draft-notice")) + .and(header("idempotency-key", REQUEST_ID)) + .and(header("content-type", "application/json")) + .and(header("authorization", format!("Bearer {TOKEN}").as_str())) + .and(body_json(body())) + .respond_with(ResponseTemplate::new(200).set_body_json(json!({"draftId":"draft-001"}))) + .expect(1) + .mount(&server) + .await; + let connection = connection(&format!("{}/service/", server.uri())); + match connection.command(&body(), REQUEST_ID, false).await { + CallOutcome::Success(reply) => { + assert_eq!(reply, json!({"status":200,"body":{"draftId":"draft-001"}})); + assert_eq!( + contract(Operation::InvokeServiceFunction).check_output(&reply), + Ok(()) + ); + } + _ => panic!("the bound function answers"), + } + server.verify().await; +} + +#[tokio::test] +async fn a_refusal_is_handed_to_the_interpretation_and_a_redirect_is_not_followed() { + let server = MockServer::start().await; + Mock::given(method("POST")) + .and(path("/functions/draft-notice")) + .respond_with(ResponseTemplate::new(403).set_body_json(json!({}))) + .expect(1) + .mount(&server) + .await; + let refused = connection(&server.uri()) + .command(&body(), REQUEST_ID, false) + .await; + // The status reaches the pinned interpretation; the host claims no failure. + assert!( + matches!(&refused, CallOutcome::Success(reply) if reply["status"] == 403), + "{}", + describe(&refused) + ); + + let redirecting = MockServer::start().await; + Mock::given(method("POST")) + .and(path("/functions/draft-notice")) + .respond_with( + ResponseTemplate::new(307).insert_header("location", "/functions/publish-notice"), + ) + .expect(1) + .mount(&redirecting) + .await; + let redirected = connection(&redirecting.uri()) + .command(&body(), REQUEST_ID, false) + .await; + assert!( + matches!(&redirected, CallOutcome::Uncertain { code } if code == "external-redirect"), + "{}", + describe(&redirected) + ); + assert_eq!(redirecting.received_requests().await.unwrap().len(), 1); +} + +#[test] +fn the_function_name_is_one_local_identifier() { + for invalid in ["../admin", "draft/notice", "Draft", "", "a?b"] { + let mut document = binding("https://functions.example.test/"); + document["function"] = json!(invalid); + assert!( + serde_json::from_value::(document).is_err(), + "{invalid}" + ); + } +} + +fn breg_connection() -> Value { + json!({ + "type":"breg", "baseUrl":"http://127.0.0.1:9021", "profile":"coordinator", + "authorization":{ + "tokenEndpoint":"http://127.0.0.1:9999/token", + "clientAssertionAudience":"http://127.0.0.1:9999", + "clientId":"coordinator-registry", + "signingKeyRef":"secret:file/registry-client-key", + "resource":"urn:example:registry", + "scopes":["records:write"] + } + }) +} + +fn runtime_document() -> Value { + let mut function = binding("http://127.0.0.1:9020/"); + function["type"] = json!("service-function"); + json!({ + "apiVersion":API_VERSION,"kind":KIND, + "secretProviders":{"environment":{}}, + "database":{ + "runtimeUrlRef":"secret:env/COORDINATOR_FUNCTION_TEST_UNRESOLVED_DATABASE", + "migrationUrlRef":"secret:env/COORDINATOR_FUNCTION_TEST_UNRESOLVED_DATABASE" + }, + "namespace":"coordinator_function_test", + "connections":{"notices":function, "registry":breg_connection()} + }) +} + +fn load(document: &Value) -> registry_coordinator::Result { + let root = tempfile::tempdir().unwrap(); + let directory = root.path().canonicalize().unwrap(); + let mut document = document.clone(); + document["secretProviders"]["file"] = json!({"root":directory}); + let path = directory.join("runtime.yaml"); + std::fs::write(&path, serde_json::to_vec(&document).unwrap()).unwrap(); + RuntimeConfig::load(&path) +} + +#[test] +fn the_bound_function_is_part_of_the_binding_digest() { + let accepted = load(&runtime_document()).unwrap(); + let digest = accepted.binding_digest().unwrap(); + let mut changed = runtime_document(); + changed["connections"]["notices"]["function"] = json!("publish-notice"); + assert_ne!(load(&changed).unwrap().binding_digest().unwrap(), digest); +} + +#[test] +fn a_service_function_connection_requires_its_own_credential() { + let mut anonymous = runtime_document(); + anonymous["connections"]["notices"] + .as_object_mut() + .unwrap() + .remove("authorization"); + assert!(load(&anonymous).is_err()); + + let mut task = runtime_document(); + task["connections"]["notices"]["authorization"]["taskAuthority"] = json!({ + "baseUrl":"http://127.0.0.1:9022", "issuer":"https://identity.example.test", + "subject":"coordinator", "exchangeAudience":"urn:example:tasks", + "bootstrapResource":"urn:example:tasks" + }); + let error = load(&task) + .err() + .expect("a function call cannot acquire task authority"); + assert!( + error.field.as_deref().unwrap().contains("taskAuthority"), + "{error:?}" + ); +} + +#[test] +fn a_service_function_credential_is_never_a_product_credential() { + // The function host token must not be one a product accepts, and the + // connection must not reuse a product connection's client identity or key. + for (member, value) in [ + ("resource", "urn:example:registry"), + ("clientId", "coordinator-registry"), + ("signingKeyRef", "secret:file/registry-client-key"), + ] { + let mut document = runtime_document(); + document["connections"]["notices"]["authorization"][member] = json!(value); + let error = load(&document) + .err() + .unwrap_or_else(|| panic!("a reused product {member} is refused")); + assert!( + error + .field + .as_deref() + .unwrap_or_default() + .contains(&format!("/connections/notices/authorization/{member}")), + "{member}: {error:?}" + ); + assert!( + error + .suggested_action + .as_deref() + .is_some_and(|action| action.contains("registry")), + "{member}: {error:?}" + ); + } +} + +/// A runtime whose function connection carries a static host key instead of +/// an OAuth client, the way `rstack dev` and an operator recipe supply one. +fn host_key_document(base: &str) -> Value { + let mut document = runtime_document(); + let notices = &mut document["connections"]["notices"]; + notices["baseUrl"] = json!(base); + notices.as_object_mut().unwrap().remove("authorization"); + notices["hostKeyRef"] = json!("secret:file/function-host-key"); + document +} + +#[tokio::test] +async fn a_host_key_credential_is_sent_as_the_bearer_to_the_bound_function() { + const HOST_KEY: &str = "synthetic-function-host-key-canary"; + let server = MockServer::start().await; + Mock::given(method("POST")) + .and(path("/functions/draft-notice")) + .and(header( + "authorization", + format!("Bearer {HOST_KEY}").as_str(), + )) + .and(header("idempotency-key", REQUEST_ID)) + .and(body_json(body())) + .respond_with(ResponseTemplate::new(200).set_body_json(json!({"draftId":"draft-001"}))) + .expect(1) + .mount(&server) + .await; + let root = tempfile::tempdir().unwrap(); + let directory = root.path().canonicalize().unwrap(); + let key = directory.join("function-host-key"); + std::fs::write(&key, HOST_KEY).unwrap(); + std::fs::set_permissions(&key, std::os::unix::fs::PermissionsExt::from_mode(0o600)).unwrap(); + let mut document = host_key_document(&format!("{}/", server.uri())); + document["connections"] + .as_object_mut() + .unwrap() + .remove("registry"); + document["secretProviders"]["file"] = json!({"root":directory}); + let path = directory.join("runtime.yaml"); + std::fs::write(&path, serde_json::to_vec(&document).unwrap()).unwrap(); + let config = RuntimeConfig::load(&path).unwrap(); + let adapters = registry_coordinator::adapters::HttpAdapters::new(&config).unwrap(); + let request = registry_coordinator::protocol::CallRequest { + connection: "notices".into(), + operation: Operation::InvokeServiceFunction, + input: body(), + idempotency_key: Some(REQUEST_ID.into()), + operation_contract: None, + }; + let outcome = + registry_coordinator::protocol::AdapterSet::call_attempt(&adapters, &request, None, false) + .await; + assert!( + matches!(&outcome, CallOutcome::Success(reply) if reply["status"] == 200), + "{}", + describe(&outcome) + ); + server.verify().await; +} + +#[test] +fn a_function_connection_names_exactly_one_credential() { + assert!(load(&host_key_document("http://127.0.0.1:9020/")).is_ok()); + + let mut both = host_key_document("http://127.0.0.1:9020/"); + both["connections"]["notices"]["authorization"] = function_authorization(); + let error = load(&both).err().expect("two credentials are refused"); + assert!( + error + .field + .as_deref() + .unwrap_or_default() + .contains("/connections/notices"), + "{error:?}" + ); + + let mut neither = host_key_document("http://127.0.0.1:9020/"); + neither["connections"]["notices"] + .as_object_mut() + .unwrap() + .remove("hostKeyRef"); + assert!( + load(&neither).is_err(), + "an anonymous function connection is refused" + ); +} + +#[test] +fn a_host_key_is_never_a_product_signing_key() { + let mut document = host_key_document("http://127.0.0.1:9020/"); + document["connections"]["notices"]["hostKeyRef"] = json!("secret:file/registry-client-key"); + let error = load(&document) + .err() + .expect("a product signing key reused as a host key is refused"); + assert!( + error + .field + .as_deref() + .unwrap_or_default() + .contains("/connections/notices/hostKeyRef"), + "{error:?}" + ); +} + +/// The refusal for one function resource, against the given runtime. +fn resource_refusal(mut document: Value, resource: &str) -> registry_coordinator::CoordinatorError { + document["connections"]["notices"]["authorization"]["resource"] = json!(resource); + load(&document) + .err() + .unwrap_or_else(|| panic!("the function resource {resource} is refused")) +} + +#[test] +fn a_function_resource_is_compared_after_normalisation() { + let mut document = runtime_document(); + document["connections"]["registry"]["authorization"]["resource"] = + json!("https://breg.example.org"); + for spelling in [ + "https://breg.example.org/", + "https://BREG.example.org", + "HTTPS://breg.example.org", + "https://breg.example.org:443/", + ] { + let error = resource_refusal(document.clone(), spelling); + assert!( + error + .field + .as_deref() + .unwrap_or_default() + .contains("/connections/notices/authorization/resource"), + "{spelling}: {error:?}" + ); + // The remedy names the colliding connection, never a value. + let action = error.suggested_action.as_deref().unwrap_or_default(); + assert!(action.contains("registry"), "{spelling}: {action}"); + assert!(!action.contains("breg.example.org"), "{spelling}: {action}"); + } + // Another path on the same origin is another resource. + document["connections"]["notices"]["authorization"]["resource"] = + json!("https://breg.example.org/functions"); + load(&document).unwrap(); +} + +#[test] +fn a_function_resource_is_never_a_casework_or_exchange_audience() { + let mut document = runtime_document(); + document["connections"]["registry"]["authorization"]["taskAuthority"] = json!({ + "baseUrl":"https://casework.example.org", "issuer":"https://casework.example.org", + "subject":"coordinator", "exchangeAudience":"https://issuer.example.org/oauth/token", + "bootstrapResource":"urn:example:casework" + }); + for audience in [ + "urn:example:casework", + "https://issuer.example.org/oauth/token", + ] { + resource_refusal(document.clone(), audience); + } +} + +#[test] +fn a_function_resource_is_never_a_scheduling_messaging_or_external_audience() { + let mut document = runtime_document(); + let connections = document["connections"].as_object_mut().unwrap(); + connections.insert( + "bookings".into(), + json!({ + "type":"scheduling", "baseUrl":"http://127.0.0.1:9022", + "authorization":{ + "tokenEndpoint":"http://127.0.0.1:9999/token", + "clientAssertionAudience":"http://127.0.0.1:9999", + "clientId":"coordinator-bookings", + "signingKeyRef":"secret:file/bookings-client-key", + "resource":"urn:example:scheduling", "scopes":["scheduling:book"], + "taskAuthority":{ + "baseUrl":"https://casework.example.org", "issuer":"https://casework.example.org", + "subject":"coordinator", "exchangeAudience":"urn:example:exchange", + "bootstrapResource":"urn:example:casework" + } + }, + "observationAuthorization":{ + "tokenEndpoint":"http://127.0.0.1:9999/token", + "clientAssertionAudience":"http://127.0.0.1:9999", + "clientId":"coordinator-bookings", + "signingKeyRef":"secret:file/bookings-client-key", + "resource":"urn:example:scheduling", "scopes":["scheduling:read"] + } + }), + ); + connections.insert( + "letters".into(), + json!({ + "type":"messaging", "baseUrl":"http://127.0.0.1:9023", + "authorization":{ + "tokenEndpoint":"http://127.0.0.1:9999/token", + "clientAssertionAudience":"http://127.0.0.1:9999", + "clientId":"coordinator-letters", + "signingKeyRef":"secret:file/letters-client-key", + "resource":"urn:example:messaging", "scopes":["messaging:send"] + } + }), + ); + connections.insert( + "legacy".into(), + json!({ + "type":"external-http", "baseUrl":"https://legacy.example.org/", + "paths":["requests/status"], "commandPath":"requests", + "authorization":{ + "tokenEndpoint":"http://127.0.0.1:9999/token", + "clientAssertionAudience":"http://127.0.0.1:9999", + "clientId":"coordinator-legacy", + "signingKeyRef":"secret:file/legacy-client-key", + "resource":"https://legacy.example.org", "scopes":["requests:create"] + }, + "responseSchema":{"type":"object"} + }), + ); + load(&document).unwrap(); + for (audience, connection) in [ + // An observation credential shares its primary resource by rule. + ("urn:example:scheduling", "bookings"), + ("urn:example:messaging", "letters"), + ("https://legacy.example.org/", "legacy"), + ] { + let error = resource_refusal(document.clone(), audience); + let action = error.suggested_action.as_deref().unwrap_or_default(); + assert!(action.contains(connection), "{audience}: {action}"); + } + let mut document = document.clone(); + document["connections"]["notices"]["authorization"]["clientId"] = json!("coordinator-letters"); + assert!(load(&document).is_err(), "a messaging client is refused"); +} + +#[test] +fn a_function_resource_is_never_the_coordinator_audience() { + let example = + include_str!("../../../products/coordinator/examples/delayed-follow-up/runtime.yaml"); + let function = " drafts:\n type: service-function\n baseUrl: http://127.0.0.1:9020/\n function: draft-notice\n authorization:\n tokenEndpoint: http://127.0.0.1:8090/token\n clientAssertionAudience: http://127.0.0.1:8090\n clientId: coordinator-functions\n signingKeyRef: secret:file/function-key\n resource: RESOURCE\n scopes: [functions:invoke]\n responseSchema: {type: object}\n"; + let write = |resource: &str| { + let root = tempfile::tempdir().unwrap(); + let path = root.path().canonicalize().unwrap().join("runtime.yaml"); + let text = example.replacen( + "connections:\n", + &format!("connections:\n{}", function.replace("RESOURCE", resource)), + 1, + ); + std::fs::write(&path, text).unwrap(); + RuntimeConfig::load(&path) + }; + write("urn:example:notice-functions").unwrap(); + let error = write("urn:example:coordinator") + .err() + .expect("the Coordinator's own audience is refused"); + assert!( + error + .field + .as_deref() + .unwrap_or_default() + .contains("/connections/drafts/authorization/resource"), + "{error:?}" + ); +} + +#[test] +fn a_taskauthority_refusal_names_the_service_function_remedy() { + let mut document = runtime_document(); + document["connections"]["notices"]["authorization"]["taskAuthority"] = json!({ + "baseUrl":"http://127.0.0.1:9022", "issuer":"https://identity.example.test", + "subject":"coordinator", "exchangeAudience":"urn:example:tasks", + "bootstrapResource":"urn:example:tasks" + }); + let error = load(&document).err().unwrap(); + let action = error.suggested_action.as_deref().unwrap_or_default(); + assert!(action.contains("service function"), "{action}"); + assert!(!action.contains("external GET"), "{action}"); +} + +/// Two distinct private signing keys. +const KEY: &str = registry_platform_testing::fixtures::ED25519_PRIVATE_JWK; +const OTHER_KEY: &str = registry_platform_testing::fixtures::ED25519_ROTATED_PRIVATE_JWK; + +/// A runtime file in a private secret directory holding the named secrets. +fn with_secrets(document: &Value, secrets: &[(&str, &str)]) -> (tempfile::TempDir, RuntimeConfig) { + use std::os::unix::fs::PermissionsExt; + let root = tempfile::tempdir().unwrap(); + let directory = root.path().canonicalize().unwrap(); + for (name, value) in secrets { + let path = directory.join(name); + std::fs::write(&path, value).unwrap(); + std::fs::set_permissions(&path, std::fs::Permissions::from_mode(0o600)).unwrap(); + } + let mut document = document.clone(); + document["secretProviders"]["file"] = json!({"root":directory}); + let path = directory.join("runtime.yaml"); + std::fs::write(&path, serde_json::to_vec(&document).unwrap()).unwrap(); + let config = RuntimeConfig::load(&path).unwrap(); + (root, config) +} + +#[test] +fn the_same_signing_key_under_another_reference_is_refused_at_startup() { + let shared = KEY; + let (_root, config) = with_secrets( + &runtime_document(), + &[ + ("function-client-key", shared), + ("registry-client-key", shared), + ], + ); + let error = registry_coordinator::adapters::HttpAdapters::new(&config) + .err() + .expect("one key behind two references is refused"); + assert!(error.message.contains("notices"), "{error:?}"); + assert!(error.message.contains("registry"), "{error:?}"); + assert!(!error.message.contains(shared)); + + let (_root, config) = with_secrets( + &runtime_document(), + &[ + ("function-client-key", OTHER_KEY), + ("registry-client-key", shared), + ], + ); + registry_coordinator::adapters::HttpAdapters::new(&config).unwrap(); +} + +fn call(operation: Operation, key: Option<&str>) -> registry_coordinator::protocol::CallRequest { + registry_coordinator::protocol::CallRequest { + connection: "notices".into(), + operation, + input: body(), + idempotency_key: key.map(str::to_owned), + operation_contract: None, + } +} + +#[tokio::test] +async fn the_runtime_routes_a_function_call_with_its_oauth_token_and_frozen_request_id() { + use registry_coordinator::protocol::AdapterSet; + let token = MockServer::start().await; + Mock::given(method("POST")) + .and(path("/token")) + .respond_with(ResponseTemplate::new(200).set_body_json(json!({ + "access_token":"fixture-function-token", "token_type":"Bearer", "expires_in":60, + "issued_token_type":"urn:ietf:params:oauth:token-type:access_token" + }))) + .mount(&token) + .await; + let host = MockServer::start().await; + Mock::given(method("POST")) + .and(path("/functions/draft-notice")) + .and(header("authorization", "Bearer fixture-function-token")) + .and(header("idempotency-key", REQUEST_ID)) + .and(body_json(body())) + .respond_with(ResponseTemplate::new(200).set_body_json(json!({"draftId":"draft-001"}))) + .expect(1) + .mount(&host) + .await; + let mut document = runtime_document(); + document["connections"]["notices"]["baseUrl"] = json!(format!("{}/", host.uri())); + document["connections"]["notices"]["authorization"]["tokenEndpoint"] = + json!(format!("{}/token", token.uri())); + let (_root, config) = with_secrets( + &document, + &[ + ("function-client-key", OTHER_KEY), + ("registry-client-key", KEY), + ], + ); + let adapters = registry_coordinator::adapters::HttpAdapters::new(&config).unwrap(); + let outcome = adapters + .call_attempt( + &call(Operation::InvokeServiceFunction, Some(REQUEST_ID)), + None, + false, + ) + .await; + assert!( + matches!(&outcome, CallOutcome::Success(reply) if reply["status"] == 200), + "{}", + describe(&outcome) + ); + // A call without its frozen request id, and any other operation on the + // function connection, is refused before anything is sent. + for (operation, key) in [ + (Operation::InvokeServiceFunction, None), + (Operation::ExternalCommand, Some(REQUEST_ID)), + (Operation::ExternalGet, None), + ] { + let refused = adapters.call(&call(operation, key)).await; + assert!( + matches!(&refused, CallOutcome::Refused { .. }), + "{}: {}", + operation.as_str(), + describe(&refused) + ); + } + host.verify().await; +} + +#[tokio::test] +async fn a_lost_acknowledgement_is_uncertain_and_the_same_request_id_is_sent_again() { + use registry_coordinator::protocol::AdapterSet; + use tokio::io::{AsyncReadExt, AsyncWriteExt}; + const HOST_KEY: &str = "synthetic-function-host-key-canary"; + let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap(); + let address = listener.local_addr().unwrap(); + let server = tokio::spawn(async move { + let mut seen = Vec::new(); + for attempt in 0..2 { + let (mut socket, _) = listener.accept().await.unwrap(); + let mut buffer = Vec::new(); + let mut chunk = [0_u8; 4096]; + while !buffer.windows(4).any(|window| window == b"\r\n\r\n") { + let read = socket.read(&mut chunk).await.unwrap(); + assert!(read > 0); + buffer.extend_from_slice(&chunk[..read]); + } + let head = String::from_utf8_lossy(&buffer).to_string(); + assert!( + head.starts_with("POST /functions/draft-notice HTTP/1.1\r\n"), + "{head}" + ); + let key = head + .lines() + .find_map(|line| { + let (name, value) = line.split_once(':')?; + name.eq_ignore_ascii_case("idempotency-key") + .then(|| value.trim().to_owned()) + }) + .unwrap(); + seen.push(key); + if attempt == 0 { + drop(socket); + continue; + } + let reply = br#"{"draftId":"draft-001"}"#; + let response = format!( + "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\nContent-Length: {}\r\nConnection: close\r\n\r\n", + reply.len() + ); + socket.write_all(response.as_bytes()).await.unwrap(); + socket.write_all(reply).await.unwrap(); + socket.shutdown().await.unwrap(); + } + seen + }); + let document = host_key_document(&format!("http://{address}/")); + let (_root, config) = with_secrets( + &document, + &[ + ("function-host-key", HOST_KEY), + ("registry-client-key", KEY), + ], + ); + let adapters = registry_coordinator::adapters::HttpAdapters::new(&config).unwrap(); + let request = call(Operation::InvokeServiceFunction, Some(REQUEST_ID)); + let first = adapters.call_attempt(&request, None, false).await; + assert!( + matches!(&first, CallOutcome::Uncertain { code } if code == "transport-uncertain"), + "{}", + describe(&first) + ); + let second = adapters.call_attempt(&request, None, true).await; + assert!( + matches!(&second, CallOutcome::Success(reply) if reply["status"] == 200), + "{}", + describe(&second) + ); + let seen = tokio::time::timeout(std::time::Duration::from_secs(10), server) + .await + .unwrap() + .unwrap(); + assert_eq!(seen, [REQUEST_ID, REQUEST_ID]); +} + +#[tokio::test] +async fn a_busy_answer_on_the_final_attempt_holds_instead_of_retrying() { + use registry_coordinator::protocol::AdapterSet; + const HOST_KEY: &str = "synthetic-function-host-key-canary"; + let host = MockServer::start().await; + Mock::given(method("POST")) + .and(path("/functions/draft-notice")) + .respond_with(ResponseTemplate::new(503)) + .expect(2) + .mount(&host) + .await; + let (_root, config) = with_secrets( + &host_key_document(&format!("{}/", host.uri())), + &[ + ("function-host-key", HOST_KEY), + ("registry-client-key", KEY), + ], + ); + let adapters = registry_coordinator::adapters::HttpAdapters::new(&config).unwrap(); + let request = call(Operation::InvokeServiceFunction, Some(REQUEST_ID)); + let early = adapters.call_attempt(&request, None, false).await; + assert!( + matches!(&early, CallOutcome::UncertainRetryable { code, .. } if code == "external-unavailable"), + "{}", + describe(&early) + ); + let last = adapters.call_attempt(&request, None, true).await; + assert!( + matches!(&last, CallOutcome::Uncertain { code } if code == "external-uncertain"), + "{}", + describe(&last) + ); + host.verify().await; +} + +/// The diagnostics `check` reports for a runtime document, with their +/// related locations. +fn checked(document: &Value) -> Vec { + let root = tempfile::tempdir().unwrap(); + let directory = root.path().canonicalize().unwrap(); + let mut document = document.clone(); + document["secretProviders"]["file"] = json!({"root":directory}); + let path = directory.join("runtime.yaml"); + std::fs::write(&path, serde_json::to_vec(&document).unwrap()).unwrap(); + RuntimeConfig::check_file(&path, true).diagnostics +} + +/// The one diagnostic at `path`, which must name `related` as the colliding +/// location. +fn collision(document: &Value, path: &str, related: &str) { + let diagnostics = checked(document); + let found = diagnostics + .iter() + .find(|diagnostic| diagnostic.path == path) + .unwrap_or_else(|| panic!("no diagnostic at {path}: {diagnostics:#?}")); + assert!( + found.related.iter().any(|other| other.path == related), + "{path} names {related}: {found:#?}" + ); +} + +#[test] +fn a_credential_collision_names_the_colliding_member_as_related() { + let mut document = runtime_document(); + document["connections"]["notices"]["authorization"]["resource"] = json!("urn:example:registry"); + collision( + &document, + "/connections/notices/authorization/resource", + "/connections/registry/authorization/resource", + ); +} + +#[test] +fn a_function_resource_is_compared_with_any_trailing_slash_and_urn_case() { + let mut document = runtime_document(); + document["connections"]["registry"]["authorization"]["resource"] = + json!("https://breg.example.org/v1"); + resource_refusal(document.clone(), "https://breg.example.org/v1/"); + document["connections"]["registry"]["authorization"]["resource"] = + json!("urn:example:registry"); + resource_refusal(document.clone(), "URN:Example:registry"); + // The namespace-specific part of a URN keeps its case. + document["connections"]["notices"]["authorization"]["resource"] = json!("urn:example:REGISTRY"); + load(&document).unwrap(); +} + +fn evaluation_connection(token: &str) -> Value { + json!({ + "type":"evaluation", "protocol":"system-one", "baseUrl":"http://127.0.0.1:9024/", + "model":"synthetic-model", + "authorization":{"bearer":{"tokenRef":token, "principal":"coordinator"}} + }) +} + +#[test] +fn a_host_key_is_never_an_evaluation_completion_or_event_key() { + let mut document = host_key_document("http://127.0.0.1:9020/"); + document["connections"]["decide"] = evaluation_connection("secret:file/function-host-key"); + collision( + &document, + "/connections/notices/hostKeyRef", + "/connections/decide/authorization/bearer/tokenRef", + ); + + let mut document = host_key_document("http://127.0.0.1:9020/"); + document["connections"]["review"] = json!({ + "type":"casework-review-producer", "baseUrl":"http://127.0.0.1:9025", + "profile":"producer", "producer":"coordinator", + "authorization":{ + "tokenEndpoint":"http://127.0.0.1:9999/token", + "clientAssertionAudience":"http://127.0.0.1:9999", + "clientId":"coordinator-review", "signingKeyRef":"secret:file/review-client-key", + "resource":"urn:example:casework", "scopes":["casework:review"] + }, + "completion":{"recipientBinding":"coordinator-v1", "hmacSha256KeyRef":"secret:file/function-host-key"} + }); + collision( + &document, + "/connections/notices/hostKeyRef", + "/connections/review/completion/hmacSha256KeyRef", + ); + + let mut document = host_key_document("http://127.0.0.1:9020/"); + document["eventSources"] = json!({"registry-events": { + "source":"https://events.example.org", + "triggers":{"notice-draft":{"on-change":{"hmacSha256KeyRef":"secret:file/function-host-key"}}} + }}); + collision( + &document, + "/connections/notices/hostKeyRef", + "/eventSources/registry-events/triggers/notice-draft/on-change/hmacSha256KeyRef", + ); +} + +#[test] +fn a_host_key_is_never_a_deployment_key() { + let example = + include_str!("../../../products/coordinator/examples/delayed-follow-up/runtime.yaml"); + let function = " drafts:\n type: service-function\n baseUrl: http://127.0.0.1:9020/\n function: draft-notice\n hostKeyRef: KEY\n responseSchema: {type: object}\n"; + for (key, related) in [ + ("secret:file/audit-key", "/deployment/auditKeyRef"), + ("secret:file/state-key-1", "/deployment/stateKeys/1/keyRef"), + ("secret:file/admission-key", "/deployment/admissionKeyRef"), + ] { + let root = tempfile::tempdir().unwrap(); + let path = root.path().canonicalize().unwrap().join("runtime.yaml"); + std::fs::write( + &path, + example.replacen( + "connections:\n", + &format!("connections:\n{}", function.replace("KEY", key)), + 1, + ), + ) + .unwrap(); + let diagnostics = RuntimeConfig::check_file(&path, true).diagnostics; + let found = diagnostics + .iter() + .find(|diagnostic| diagnostic.path == "/connections/drafts/hostKeyRef") + .unwrap_or_else(|| panic!("{key}: {diagnostics:#?}")); + assert!( + found.related.iter().any(|other| other.path == related), + "{key}: {found:#?}" + ); + } +} + +#[test] +fn rotating_the_host_key_keeps_the_binding_and_changing_the_credential_kind_does_not() { + let document = host_key_document("http://127.0.0.1:9020/"); + let digest = load(&document).unwrap().binding_digest().unwrap(); + let mut rotated = document.clone(); + rotated["connections"]["notices"]["hostKeyRef"] = json!("secret:file/function-host-key-2"); + assert_eq!(load(&rotated).unwrap().binding_digest().unwrap(), digest); + assert_ne!( + load(&runtime_document()).unwrap().binding_digest().unwrap(), + digest + ); +} + +#[test] +fn the_same_host_key_or_jwk_under_another_form_is_refused_at_startup() { + const HOST_KEY: &str = "synthetic-function-host-key-canary"; + let mut document = host_key_document("http://127.0.0.1:9020/"); + document["connections"]["decide"] = evaluation_connection("secret:file/decision-token"); + let (_root, config) = with_secrets( + &document, + &[ + ("function-host-key", HOST_KEY), + ("decision-token", HOST_KEY), + ("registry-client-key", KEY), + ], + ); + let error = registry_coordinator::adapters::HttpAdapters::new(&config) + .err() + .expect("one host key behind two references is refused"); + assert!(error.message.contains("decide"), "{error:?}"); + + // The same JWK written again with its members in another order and + // spacing is the same key. + let parsed: serde_json::Map = serde_json::from_str(KEY).unwrap(); + let reordered = + serde_json::to_string_pretty(&parsed.into_iter().rev().collect::>()) + .unwrap(); + assert_ne!(reordered, KEY); + let (_root, config) = with_secrets( + &runtime_document(), + &[ + ("function-client-key", &reordered), + ("registry-client-key", KEY), + ], + ); + assert!(registry_coordinator::adapters::HttpAdapters::new(&config).is_err()); +} diff --git a/crates/registry-coordinator/tests/service_function_postgres.rs b/crates/registry-coordinator/tests/service_function_postgres.rs new file mode 100644 index 0000000000..bd6304ee9b --- /dev/null +++ b/crates/registry-coordinator/tests/service_function_postgres.rs @@ -0,0 +1,226 @@ +// SPDX-License-Identifier: Apache-2.0 +//! `service.invoke-function/v1` over real HTTP and durable PostgreSQL: the +//! run records the step and its typed result, the function host receives the +//! frozen request id and the function host credential, and nothing an operator +//! reads carries the request body, request id or credential. +#![cfg(feature = "postgres-test")] + +use std::sync::{Arc, Mutex}; + +use async_trait::async_trait; +use registry_coordinator::{ + definition::Definition, + external_http::{ExternalHttpConnection, ServiceFunctionConfig}, + protocol::{AdapterSet, CallOutcome, CallRequest, Operation}, + store::Store, + worker::Worker, +}; +use registry_platform_httputil::client::StaticToken; +use serde_json::{json, Value}; +use uuid::Uuid; +use wiremock::{ + matchers::{body_json, header, header_exists, method, path}, + Mock, MockServer, ResponseTemplate, +}; + +const REFERENCE: &str = "application-body-canary"; +const TOKEN: &str = "synthetic-function-host-token-canary"; +const BINDING: &str = "service-function-binding"; + +/// The runtime's service function adapter, recording each frozen request id. +struct FunctionAdapter { + connection: ExternalHttpConnection, + keys: Arc>>, +} + +#[async_trait] +impl AdapterSet for FunctionAdapter { + fn binding_digest(&self) -> &str { + BINDING + } + + async fn call(&self, request: &CallRequest) -> CallOutcome { + self.call_attempt(request, None, false).await + } + + async fn call_attempt( + &self, + request: &CallRequest, + prepared: Option<&[u8]>, + final_attempt: bool, + ) -> CallOutcome { + assert_eq!(request.operation, Operation::InvokeServiceFunction); + assert_eq!(request.connection, "notices"); + assert!( + prepared.is_none(), + "a function call has no prepared evidence" + ); + let key = request + .idempotency_key + .clone() + .expect("a function call carries its frozen request id"); + self.keys.lock().unwrap().push(key.clone()); + self.connection + .command(&request.input, &key, final_attempt) + .await + } +} + +struct Harness { + _project: tempfile::TempDir, + definition: Definition, + store: Arc, + keys: Arc>>, +} + +impl Harness { + async fn new() -> Self { + let project = tempfile::tempdir().unwrap(); + let source = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) + .join("tests/fixtures/service-function"); + for name in ["workflow.yaml", "functions.rhai"] { + std::fs::copy(source.join(name), project.path().join(name)).unwrap(); + } + let definition = Definition::load(project.path()).expect("the function fixture compiles"); + let url = std::env::var("COORDINATOR_TEST_DATABASE_URL") + .expect("disposable PostgreSQL is required"); + let namespace = format!("coordinator_{}", Uuid::new_v4().simple()); + let store = Arc::new(Store::connect(&url, &namespace).await.unwrap()); + store.migrate().await.unwrap(); + Self { + _project: project, + definition, + store, + keys: Arc::default(), + } + } + + /// The operator's binding: the host, function and credential come only + /// from here. + fn worker(&self, base: &str) -> Worker { + let config: ServiceFunctionConfig = serde_json::from_value(json!({ + "baseUrl":base, "function":"draft-notice", + "responseSchema":{"type":"object"}, + "authorization":{ + "tokenEndpoint":"http://127.0.0.1:9999/token", + "clientId":"coordinator-functions", + "clientAssertionAudience":"http://127.0.0.1:9999", + "signingKeyRef":"secret:file/function-client-key", + "resource":"urn:example:notice-functions", "scopes":["functions:invoke"] + } + })) + .unwrap(); + let tokens = Arc::new(StaticToken::new(TOKEN).unwrap()); + let adapters = Arc::new(FunctionAdapter { + connection: ExternalHttpConnection::service_function(&config, tokens).unwrap(), + keys: self.keys.clone(), + }); + Worker::new(self.store.clone(), adapters) + } + + async fn run(&self, base: &str) -> Value { + let run = self + .store + .admit( + &self.definition, + json!({"reference":REFERENCE}), + "service-function-producer", + &Uuid::new_v4().to_string(), + BINDING, + ) + .await + .unwrap(); + let worker = self.worker(base); + let mut quiet = false; + for _ in 0..8 { + if !worker.tick().await.unwrap() { + quiet = true; + break; + } + } + assert!(quiet, "bounded workflow did not quiesce"); + let inspection = + serde_json::to_value(self.store.inspect(run, BINDING).await.unwrap()).unwrap(); + let status = serde_json::to_string(&self.store.status(run).await.unwrap()).unwrap(); + let keys = self.keys.lock().unwrap().clone(); + assert_eq!(keys.len(), 1, "one frozen request is sent once"); + for text in [inspection.to_string(), status] { + assert!(!text.contains(REFERENCE)); + assert!(!text.contains(TOKEN)); + assert!(!text.contains(keys[0].as_str())); + } + inspection + } +} + +#[tokio::test] +async fn an_accepted_function_call_records_the_step_and_its_typed_result() { + let h = Harness::new().await; + let server = MockServer::start().await; + Mock::given(method("POST")) + .and(path("/functions/draft-notice")) + .and(header_exists("idempotency-key")) + .and(header("authorization", format!("Bearer {TOKEN}").as_str())) + .and(body_json(json!({"reference":REFERENCE}))) + .respond_with(ResponseTemplate::new(200).set_body_json(json!({"draftId":"draft-001"}))) + .expect(1) + .mount(&server) + .await; + let inspection = h.run(&server.uri()).await; + assert_eq!(inspection["run"]["state"], "finished"); + assert_eq!(inspection["run"]["outcome"], "drafted"); + assert_eq!(inspection["run"]["output"], json!({"draftId":"draft-001"})); + let effect = &inspection["effects"][0]; + assert_eq!(effect["state"], "accepted"); + assert_eq!(effect["step"], "draft"); + assert_eq!(effect["operation"]["id"], "service.invoke-function/v1"); + assert_eq!(effect["operation"]["product"], "service-function"); + let received = server.received_requests().await.unwrap(); + assert_eq!( + received[0].headers["idempotency-key"].to_str().unwrap(), + h.keys.lock().unwrap()[0], + "the function host receives the frozen request id" + ); +} + +#[tokio::test] +async fn a_declared_refusal_takes_the_workflow_refusal_route() { + let h = Harness::new().await; + let server = MockServer::start().await; + Mock::given(method("POST")) + .and(path("/functions/draft-notice")) + .respond_with(ResponseTemplate::new(422).set_body_json(json!({"reason":"not-eligible"}))) + .expect(1) + .mount(&server) + .await; + let inspection = h.run(&server.uri()).await; + assert_eq!(inspection["run"]["outcome"], "not-drafted"); + assert_eq!( + inspection["run"]["output"], + json!({"refusalCode":"not-eligible"}) + ); + assert_eq!( + inspection["effects"], + json!([]), + "a refusal claims no effect" + ); +} + +#[tokio::test] +async fn an_authority_refusal_the_interpretation_does_not_recognise_holds_the_run() { + let h = Harness::new().await; + let server = MockServer::start().await; + Mock::given(method("POST")) + .and(path("/functions/draft-notice")) + .respond_with(ResponseTemplate::new(403).set_body_json(json!({}))) + .expect(1) + .mount(&server) + .await; + let inspection = h.run(&server.uri()).await; + assert_eq!(inspection["run"]["state"], "attention", "{inspection}"); + assert_eq!(inspection["run"]["uncertain"], true); + assert_eq!(inspection["run"]["failureCode"], "external-uncertain"); + assert_eq!(inspection["effects"][0]["step"], "draft"); + assert_eq!(inspection["effects"][0]["state"], "unknown"); + assert_eq!(inspection["recovery"]["retryAllowed"], true); +} diff --git a/crates/registry-coordinator/tests/service_function_project.rs b/crates/registry-coordinator/tests/service_function_project.rs new file mode 100644 index 0000000000..909eac0195 --- /dev/null +++ b/crates/registry-coordinator/tests/service_function_project.rs @@ -0,0 +1,391 @@ +// SPDX-License-Identifier: Apache-2.0 +//! Authoring, checking and synthetic scenarios for +//! `service.invoke-function/v1`. A project names one service function, a pure +//! Transform that builds its body, and a +//! pure Transform that interprets the answer. The runtime file alone binds the +//! function host, the function and the credential. +use registry_coordinator::{ + definition::{Definition, Step}, + protocol::Operation, + scenarios, +}; +use serde_json::{json, Value}; +use std::{fs, path::Path, process::Command}; + +const WORKFLOW: &str = include_str!("fixtures/service-function/workflow.yaml"); +const FUNCTIONS: &str = include_str!("fixtures/service-function/functions.rhai"); +const RUNTIME: &str = include_str!("fixtures/service-function/runtime.yaml"); +const FIXTURE_DRAFTED: &str = include_str!("fixtures/service-function/fixtures/drafted.yaml"); +const FIXTURE_NOT_ELIGIBLE: &str = + include_str!("fixtures/service-function/fixtures/not-eligible.yaml"); +const FIXTURE_HOLDS: &str = + include_str!("fixtures/service-function/fixtures/unrecognised-answer-holds.yaml"); + +fn replaced(text: &str, replacements: &[(&str, &str)]) -> String { + let mut text = text.to_owned(); + for (from, to) in replacements { + assert!(text.contains(from), "{from}"); + text = text.replacen(from, to, 1); + } + text +} + +fn project(root: &Path, replacements: &[(&str, &str)]) { + fs::write(root.join("workflow.yaml"), replaced(WORKFLOW, replacements)).unwrap(); + fs::write(root.join("functions.rhai"), FUNCTIONS).unwrap(); +} + +fn cli(arguments: &[&str]) -> std::process::Output { + Command::new(env!("CARGO_BIN_EXE_coordinatorctl")) + .args(arguments) + .env_remove("COORDINATOR_TEST_DATABASE_URL") + .output() + .unwrap() +} + +fn check(root: &Path) -> (i32, Value) { + let output = cli(&[ + "--format", + "json", + "check", + "--project", + root.to_str().unwrap(), + ]); + let report = serde_json::from_slice(&output.stdout).unwrap_or_else(|_| { + panic!( + "a JSON check report: {}", + String::from_utf8_lossy(&output.stdout) + ) + }); + (output.status.code().unwrap(), report) +} + +/// The findings `check` reports for a project that must be refused. +fn refused(replacements: &[(&str, &str)]) -> Vec { + let root = tempfile::tempdir().unwrap(); + project(root.path(), replacements); + let (exit, report) = check(root.path()); + assert_eq!(exit, 1, "{report}"); + report["diagnostics"].as_array().unwrap().clone() +} + +fn finding<'a>(findings: &'a [Value], path: &str, expected: &[&str]) -> &'a Value { + let found = findings + .iter() + .find(|finding| finding["path"] == path) + .unwrap_or_else(|| panic!("no finding at {path}: {findings:#?}")); + let message = found["message"].as_str().unwrap(); + for text in expected { + assert!(message.contains(text), "{text}: {message}"); + } + found +} + +/// The project checked against one runtime file. +fn check_with_runtime(runtime: &str) -> (i32, Value) { + let root = tempfile::tempdir().unwrap(); + project(root.path(), &[]); + fs::write(root.path().join("runtime.yaml"), runtime).unwrap(); + check(root.path()) +} + +fn binding_finding(runtime: &str) -> Value { + let (exit, report) = check_with_runtime(runtime); + assert_eq!(exit, 1, "{report}"); + report["diagnostics"] + .as_array() + .unwrap() + .iter() + .find(|finding| finding["code"] == "coordinator.runtime.workflow-binding") + .unwrap_or_else(|| panic!("no workflow binding finding: {report}")) + .clone() +} + +#[test] +fn a_named_service_function_checks_and_explains_without_its_destination() { + let (exit, report) = check_with_runtime(RUNTIME); + assert_eq!(exit, 0, "{report}"); + let rendered = report.to_string(); + assert!(!rendered.contains("FUNCTION_CLIENT_KEY"), "{rendered}"); + + let root = tempfile::tempdir().unwrap(); + project(root.path(), &[]); + let output = cli(&[ + "--format", + "json", + "explain", + "--project", + root.path().to_str().unwrap(), + ]); + assert!(output.status.success()); + let text = String::from_utf8(output.stdout).unwrap(); + assert!(!text.contains("127.0.0.1"), "{text}"); + let explained: Value = serde_json::from_str(&text).unwrap(); + let draft = explained["steps"] + .as_array() + .unwrap() + .iter() + .find(|step| step["id"] == "draft") + .unwrap(); + assert_eq!(draft["uses"], "service.invoke-function/v1"); + assert_eq!(draft["product"], "service-function"); + assert_eq!(draft["mutating"], true); + assert_eq!(draft["recovery"], "same-command"); + assert_eq!(draft["onDeclaredRefusal"], "not-drafted"); + assert_eq!( + explained["operations"]["draft-notice"]["serviceFunction"], + "draft-notice" + ); + let http = &explained["operationContracts"]["service.invoke-function/v1"]["limits"]["http"]; + assert_eq!(http["maximumRequestBytes"], 65_536); + assert_eq!(http["redirects"], "refused"); +} + +#[test] +fn the_named_function_is_part_of_the_operation_revision() { + let root = tempfile::tempdir().unwrap(); + project(root.path(), &[]); + let definition = Definition::load(root.path()).unwrap(); + let operation = &definition.workflow.operations["draft-notice"]; + assert_eq!(operation.uses, Operation::InvokeServiceFunction); + assert_eq!(operation.service_function.as_deref(), Some("draft-notice")); + + let other = tempfile::tempdir().unwrap(); + project( + other.path(), + &[( + "serviceFunction: draft-notice", + "serviceFunction: publish-notice", + )], + ); + let renamed = Definition::load(other.path()).unwrap(); + assert_ne!( + renamed.workflow.operations["draft-notice"].revision, + operation.revision + ); + + // A restored snapshot cannot swap the named function. + let snapshot = definition.snapshot().unwrap(); + let swapped = snapshot.replacen( + "\"serviceFunction\":\"draft-notice\"", + "\"serviceFunction\":\"publish-notice\"", + 1, + ); + assert_ne!(swapped, snapshot); + assert!(Definition::from_snapshot(&swapped).is_err()); +} + +#[test] +fn a_missing_function_name_is_refused_at_the_operation() { + let findings = refused(&[(" serviceFunction: draft-notice\n", "")]); + finding( + &findings, + "/operations/draft-notice/serviceFunction", + &["service.invoke-function/v1", "serviceFunction"], + ); +} + +#[test] +fn a_function_name_must_be_a_local_identifier() { + let findings = refused(&[("serviceFunction: draft-notice", "serviceFunction: ../admin")]); + assert!( + findings.iter().any(|finding| finding["path"] + .as_str() + .unwrap_or_default() + .starts_with("/operations/draft-notice/serviceFunction")), + "{findings:#?}" + ); +} + +#[test] +fn only_the_service_function_operation_names_a_function() { + let findings = refused(&[( + "uses: service.invoke-function/v1", + "uses: external.command/v1", + )]); + finding( + &findings, + "/operations/draft-notice/serviceFunction", + &["only service.invoke-function/v1"], + ); +} + +#[test] +fn the_interpretation_is_required_on_the_service_function() { + let findings = refused(&[(" interpret: draft-outcome\n", "")]); + finding( + &findings, + "/operations/draft-notice/interpret", + &["service.invoke-function/v1", "interpret"], + ); +} + +#[test] +fn an_unbound_function_name_is_refused_against_the_runtime_binding() { + let unbound = + binding_finding(&RUNTIME.replace("function: draft-notice", "function: publish-notice")); + assert_eq!(unbound["path"], "/operations/draft-notice/serviceFunction"); + assert!( + unbound["message"] + .as_str() + .unwrap() + .contains("draft-notice"), + "{unbound}" + ); + + // No connection of the workflow's logical name. + let missing = binding_finding(&RUNTIME.replace(" notices:", " other-notices:")); + assert_eq!(missing["path"], "/connections/notices"); + + // An external HTTP connection cannot carry a service function call. + let external = binding_finding(&replaced( + RUNTIME, + &[ + ("type: service-function", "type: external-http"), + ( + " function: draft-notice\n", + " paths: [drafts]\n commandPath: drafts\n", + ), + ], + )); + assert_eq!(external["path"], "/connections/notices"); +} + +#[test] +fn the_workflow_cannot_name_a_destination_or_credential() { + for member in [ + " baseUrl: http://127.0.0.1:9030/\n", + " function: publish-notice\n", + " headers: {Authorization: Bearer x}\n", + " authorization: {token: x}\n", + ] { + let findings = refused(&[( + " interpret: draft-outcome\n", + &format!(" interpret: draft-outcome\n{member}"), + )]); + assert!( + findings.iter().any(|finding| finding["path"] + .as_str() + .unwrap_or_default() + .starts_with("/operations/draft-notice")), + "{member}: {findings:#?}" + ); + } +} + +fn scenario_reports(fixture: &str) -> Vec { + let root = tempfile::tempdir().unwrap(); + project(root.path(), &[]); + let definition = Definition::load(root.path()).unwrap(); + let document = scenarios::decode(fixture, "fixture.yaml").unwrap(); + scenarios::check(&definition, &document).unwrap() +} + +#[test] +fn scenarios_record_the_step_through_the_pinned_interpretation() { + let drafted = scenario_reports(FIXTURE_DRAFTED).remove(0); + assert_eq!(drafted.state, "completed"); + assert_eq!(drafted.output, Some(json!({"draftId":"draft-001"}))); + assert_eq!(drafted.call_attempts["draft"], 1); + assert_eq!(drafted.frozen_commands, 1); + + let refused = scenario_reports(FIXTURE_NOT_ELIGIBLE).remove(0); + assert_eq!(refused.outcome.as_deref(), Some("not-drafted")); + assert_eq!(refused.output, Some(json!({"refusalCode":"not-eligible"}))); + + // An authority refusal the interpretation does not recognise holds the + // run instead of reading as a settled answer. + let held = scenario_reports(FIXTURE_HOLDS).remove(0); + assert_eq!(held.state, "uncertain"); + assert_eq!(held.path, ["draft"]); +} + +#[test] +fn a_function_reply_reaches_its_result_only_through_the_interpret_transform() { + let root = tempfile::tempdir().unwrap(); + project(root.path(), &[]); + let definition = Definition::load(root.path()).unwrap(); + let source = replaced( + FIXTURE_DRAFTED, + &[( + " - type: response\n value:\n status: 200\n body:\n draftId: draft-001\n", + " - type: success\n value: {draftId: draft-001}\n", + )], + ); + let document = scenarios::decode(&source, "fixture.yaml").unwrap(); + let error = scenarios::check(&definition, &document) + .err() + .expect("a synthetic result skips the interpretation"); + assert_eq!(error.code, "scenario.reply"); + assert!( + error.message.contains("service.invoke-function/v1"), + "{}", + error.message + ); +} + +#[test] +fn the_step_output_is_the_accepted_result() { + let root = tempfile::tempdir().unwrap(); + project(root.path(), &[]); + let definition = Definition::load(root.path()).unwrap(); + let Some(Step::Call { call, .. }) = definition.workflow.steps.get("draft") else { + panic!("draft is a call"); + }; + let contract = definition.operation_contract(call).unwrap(); + assert!(contract + .check_output(&json!({"draftId":"draft-001"})) + .is_ok()); + assert!(contract + .check_output(&json!({"status":200,"body":{"draftId":"draft-001"}})) + .is_err()); + assert!(contract + .check_refusal(&json!({"refusalCode":"not-eligible"})) + .is_ok()); +} + +#[test] +fn unresolved_routed_straight_to_a_service_function_is_refused() { + // The function's effect is unknown to Coordinator, so "not found, so call + // the function" is refused as "not found, so create" is. + let findings = refused(&[ + ( + "operations:\n", + "operations:\n find:\n uses: breg.lookup-record/v1\n connection: register\n", + ), + (" start: draft\n", " start: lookup\n"), + ( + " steps:\n", + concat!( + " steps:\n", + " lookup:\n", + " type: call\n", + " operation: find\n", + " input:\n", + " type: fields\n", + " fields:\n", + " entity: {type: literal, value: notices}\n", + " selector: {type: literal, value: by-reference}\n", + " values:\n", + " type: fields\n", + " fields:\n", + " reference: {type: input, path: /reference}\n", + " next: known\n", + " onDeclaredRefusal: draft\n", + " known:\n", + " type: finish\n", + " outcome: known\n", + ), + ), + ( + " outcomes:\n", + " outcomes:\n known: {type: \"null\"}\n", + ), + ]); + assert!( + findings + .iter() + .any(|finding| finding["code"] == "coordinator.definition.unresolved-route"), + "{findings:#?}" + ); +} diff --git a/crates/registry-rstack-dev/src/lib.rs b/crates/registry-rstack-dev/src/lib.rs index f8299600cd..71167ad06b 100644 --- a/crates/registry-rstack-dev/src/lib.rs +++ b/crates/registry-rstack-dev/src/lib.rs @@ -2780,6 +2780,12 @@ fn remove_run_dir(root: &Path) -> Result<()> { } _ => {} } + match fs::remove_file(root.join(products::FUNCTION_HOST_KEY)) { + Err(error) if error.kind() != std::io::ErrorKind::NotFound => { + return Err(error).context("cannot remove the run's preview function host key"); + } + _ => {} + } fs::rename(root, &doomed).context("cannot remove run scratch files")?; fs::remove_dir_all(&doomed) .with_context(|| format!("cannot remove run scratch files at {}", doomed.display())) @@ -3925,6 +3931,7 @@ mod tests { let root = base.join(RUN_ID); private_directory(&root).unwrap(); fs::write(root.join(products::FIELD_KEY), "key").unwrap(); + fs::write(root.join(products::FUNCTION_HOST_KEY), "host-key").unwrap(); fs::write(root.join(REPORT), "{}").unwrap(); // A non-empty directory at the removal name makes the rename fail, as // an interrupted deletion would leave the run behind. @@ -3934,6 +3941,7 @@ mod tests { assert!(remove_run_dir(&root).is_err()); assert!(!root.join(products::FIELD_KEY).exists()); + assert!(!root.join(products::FUNCTION_HOST_KEY).exists()); assert!(root.join(REPORT).exists()); } diff --git a/crates/registry-rstack-dev/src/products.rs b/crates/registry-rstack-dev/src/products.rs index 6c8ab2d20f..830fa063e4 100644 --- a/crates/registry-rstack-dev/src/products.rs +++ b/crates/registry-rstack-dev/src/products.rs @@ -120,9 +120,22 @@ pub(super) struct ApplicationLaunch { pub(super) workdir: PathBuf, pub(super) environment: BTreeMap, pub(super) reservation: TcpListener, + /// The preview's private function host port, held until the host starts. + pub(super) function_host: Option, pub(super) health_path: String, } +/// The preview's private function host: a loopback port reserved before any +/// product starts, so Coordinator can name it, and a per-run key that only +/// the function host accepts. Coordinator presents the key as the bearer of +/// its service function calls; no product accepts it. +struct FunctionHost { + listener: RefCell>, + port: u16, + key_ref: String, + key_file: PathBuf, +} + pub(super) struct PreparedApplication { pub(super) launch: ApplicationLaunch, pub(super) client: Option, @@ -346,6 +359,7 @@ pub(super) struct ProductRunner<'a> { /// The loopback key set server Evidence's target names, stopped with the run. jwks: Option, coordinator_issuer: Option, + function_host: Option, /// The mock gateway Messaging's `http` providers send to, stopped with the /// run. gateway: Option, @@ -388,6 +402,7 @@ impl<'a> ProductRunner<'a> { issuer_listener: None, jwks: None, coordinator_issuer: None, + function_host: None, gateway: None, hook_sink: None, signed_hook_sinks: BTreeMap::new(), @@ -557,6 +572,7 @@ impl<'a> ProductRunner<'a> { &issuer.public_jwks(), )?); } + self.reserve_function_host()?; // Keep the reservations for later products until each is ready to bind. let ports: Vec<_> = self .input @@ -687,6 +703,7 @@ impl<'a> ProductRunner<'a> { let log = open_log(self.root, "application-runtime")?; command.stdout(log.try_clone()?).stderr(log); drop(launch.reservation); + drop(launch.function_host); let child = command .spawn() .context("cannot start application") @@ -792,6 +809,7 @@ impl<'a> ProductRunner<'a> { "profile": build.product.profile, "declarationDigest": build.declaration_digest, "authorizationFile": authorization_file, + "functionHost": self.function_host_input()?, }, }), None, @@ -870,6 +888,11 @@ impl<'a> ProductRunner<'a> { workdir: root.to_owned(), environment, reservation, + function_host: preview_artifact.and_then(|_| { + self.function_host + .as_ref() + .and_then(|host| host.listener.borrow_mut().take()) + }), health_path: plan.health_path.clone(), }, client, @@ -1628,6 +1651,7 @@ impl<'a> ProductRunner<'a> { authentication["accessProfiles"] = json!(profiles); let key = |file| self.retained_secret(name, file, random_key_bytes()?.as_slice()); let mut connections = runtime["connections"].clone(); + self.bind_service_functions(&mut connections)?; if let Some(connections) = connections.as_object_mut() { for (id, connection) in connections { registry_platform_yaml::LocalId::new(id.as_str()) @@ -1901,6 +1925,86 @@ impl<'a> ProductRunner<'a> { Ok(path) } + /// Reserve the preview function host before products start. The port is + /// kept with the Coordinator state, like its issuer, because a live + /// workflow binds the function host address. + fn reserve_function_host(&mut self) -> Result<()> { + if self.input.plan.preview.is_none() || self.function_host.is_some() { + return Ok(()); + } + let state = self + .input + .plan + .products + .iter() + .any(|entry| entry.product == Product::Coordinator) + .then(|| self.product_state("coordinator")) + .flatten(); + let listener = retained_loopback_listener( + state.as_deref(), + "preview-function-host-port", + "the preview function host", + )?; + let port = listener.local_addr()?.port(); + let key_ref = self.secret(FUNCTION_HOST_KEY, random_secret()?.as_bytes())?; + self.function_host = Some(FunctionHost { + listener: RefCell::new(Some(listener)), + port, + key_ref, + key_file: self.root.join(FUNCTION_HOST_KEY), + }); + Ok(()) + } + + /// Bind each `service-function` connection to the preview function host + /// and its per-run key. The function must be one the preview serves, + /// which `service.yaml` declares. + fn bind_service_functions(&self, connections: &mut Value) -> Result<()> { + let Some(connections) = connections.as_object_mut() else { + return Ok(()); + }; + for (id, connection) in connections { + if connection["type"] != "service-function" { + continue; + } + let host = self.function_host.as_ref().with_context(|| { + format!("Coordinator connection {id} calls a service function, which needs the preview function host. Declare preview.functions in dev.yaml.") + })?; + let function = connection["function"] + .as_str() + .with_context(|| format!("Coordinator connection {id} names no function"))?; + let served = self.input.plan.preview.as_ref().is_some_and(|preview| { + preview + .functions + .iter() + .any(|name| name.as_str() == function) + }); + ensure!( + served, + "Coordinator connection {id} binds function {function}, which the preview does not serve. Declare it in service.yaml functions and dev.yaml preview.functions." + ); + let object = connection + .as_object_mut() + .context("a Coordinator connection must be a mapping")?; + object.remove("authorization"); + object.insert( + "baseUrl".into(), + json!(format!("http://127.0.0.1:{}/", host.port)), + ); + object.insert("hostKeyRef".into(), json!(host.key_ref)); + } + Ok(()) + } + + /// The preview run input's function host member. + fn function_host_input(&self) -> Result { + let host = self + .function_host + .as_ref() + .context("missing preview function host reservation")?; + Ok(json!({"port": host.port, "keyFile": host.key_file})) + } + fn product_state(&self, name: &str) -> Option { self.input .project_state(self.root) @@ -2094,19 +2198,32 @@ fn needs_stable_issuer(runtime: &Value, external_jwks: Option<&str>) -> bool { } fn coordinator_issuer_listener(state: Option<&Path>) -> Result { + retained_loopback_listener( + state, + "coordinator-issuer-port", + "the Coordinator development issuer", + ) +} + +/// The run file holding the preview function host key. +pub(super) const FUNCTION_HOST_KEY: &str = "preview-function-host-key"; + +/// A loopback listener whose port is kept in the project state, so a resumed +/// run binds the same address its live workflows name. +fn retained_loopback_listener(state: Option<&Path>, name: &str, what: &str) -> Result { let Some(state) = state else { return Ok(TcpListener::bind((Ipv4Addr::LOCALHOST, 0))?); }; - let file = state.join("coordinator-issuer-port"); + let file = state.join(name); let port = match super::read_private(&file)? { Some(saved) => std::str::from_utf8(&saved)? .parse::() - .context("the retained Coordinator issuer port is invalid")? + .with_context(|| format!("the retained port of {what} is invalid"))? .get(), None => 0, }; let listener = TcpListener::bind((Ipv4Addr::LOCALHOST, port)).with_context(|| { - format!("cannot bind the Coordinator development issuer on loopback port {port}, which is kept for resumable workflow connections. Start with --clean") + format!("cannot bind {what} on loopback port {port}, which is kept for resumable workflow connections. Start with --clean") })?; if port == 0 { write_private(&file, listener.local_addr()?.port().to_string().as_bytes())?; @@ -5353,6 +5470,7 @@ mod tests { workdir: root.to_path_buf(), environment, reservation, + function_host: None, health_path: "/health".to_owned(), }, port, @@ -5505,6 +5623,143 @@ mod tests { assert_eq!(restarted.local_addr().unwrap(), address); } + /// A Coordinator project whose runtime declares one service function + /// connection, run with a preview serving `served`. + fn function_runner_input(served: Option<&[&str]>) -> RunInput { + let mut input = breg_input(false); + input.plan.products = serde_json::from_value(json!([ + {"product": "breg", "project": ".", "audience": "registry"}, + {"product": "coordinator", "project": ".", "audience": "urn:example:local"} + ])) + .unwrap(); + input.plan.people.clear(); + input.plan.people.insert( + "tester".to_owned(), + serde_json::from_value(json!({ + "subject": "tester", "client": "console", + "grants": {"coordinator": {"profile": "local-console", "scopes": ["read"]}} + })) + .unwrap(), + ); + input.plan.preview = served.map(|functions| { + serde_json::from_value(json!({ + "actor": "tester", "page": "/", "breg": {}, "functions": functions + })) + .unwrap() + }); + input + } + + fn function_project(root: &Path) -> PathBuf { + let package = root.join("package"); + fs::create_dir(&package).unwrap(); + fs::write(package.join("SHA256SUMS"), b"test checksum file").unwrap(); + fs::write(root.join("workflow.yaml"), "project: {id: notices}").unwrap(); + fs::write( + root.join("runtime.yaml"), + "connections:\n drafts:\n type: service-function\n baseUrl: http://127.0.0.1:1/\n function: draft-notice\n authorization: {tokenEndpoint: 'http://127.0.0.1:1/token', clientAssertionAudience: 'http://127.0.0.1:1', clientId: authored, signingKeyRef: 'secret:file/authored-key', resource: 'urn:example:authored', scopes: [x]}\n responseSchema: {type: object}\n", + ) + .unwrap(); + package + } + + fn coordinator_config(runner: &ProductRunner, root: &Path, package: &Path) -> Result { + let database = DatabaseUrls { + runtime: "postgresql://runtime@localhost/database".to_owned(), + migration: "postgresql://migration@localhost/database".to_owned(), + transport: DatabaseTransport::VerifiedTls, + }; + runner.additional_config( + Product::Coordinator, + root, + "127.0.0.1:34567", + package, + Some(&database), + ) + } + + #[test] + fn a_service_function_connection_names_the_preview_host_and_its_run_key() { + use std::os::unix::fs::PermissionsExt; + let root = tempfile::tempdir().unwrap(); + let package = function_project(root.path()); + let terminate = AtomicBool::new(false); + let mut runner = ProductRunner::new( + Arc::new(function_runner_input(Some(&[ + "draft-notice", + "publish-notice", + ]))), + root.path(), + &terminate, + ) + .unwrap(); + runner.reserve_function_host().unwrap(); + let host = runner.function_host.as_ref().unwrap(); + let port = host.port; + let config = coordinator_config(&runner, root.path(), &package).unwrap(); + let drafts = &config["connections"]["drafts"]; + assert_eq!(drafts["baseUrl"], format!("http://127.0.0.1:{port}/")); + assert_eq!(drafts["hostKeyRef"], secret_ref(FUNCTION_HOST_KEY)); + assert!(drafts.get("authorization").is_none(), "{drafts}"); + + // The key is an owner-only bearer-safe secret in the run directory, + // the same file the preview host reads. + let key_file = root.path().join(FUNCTION_HOST_KEY); + let key = fs::read_to_string(&key_file).unwrap(); + assert!( + key.len() >= 32 + && key + .bytes() + .all(|b| b.is_ascii_alphanumeric() || b == b'-' || b == b'_') + ); + assert_eq!( + fs::metadata(&key_file).unwrap().permissions().mode() & 0o777, + 0o600 + ); + assert_eq!( + runner.function_host_input().unwrap(), + json!({"port": port, "keyFile": key_file}) + ); + // The port stays reserved until the preview host starts. + assert!(TcpListener::bind((Ipv4Addr::LOCALHOST, port)).is_err()); + } + + #[test] + fn a_service_function_the_preview_does_not_serve_is_refused() { + let root = tempfile::tempdir().unwrap(); + let package = function_project(root.path()); + let terminate = AtomicBool::new(false); + let mut runner = ProductRunner::new( + Arc::new(function_runner_input(Some(&["publish-notice"]))), + root.path(), + &terminate, + ) + .unwrap(); + runner.reserve_function_host().unwrap(); + let error = coordinator_config(&runner, root.path(), &package) + .unwrap_err() + .to_string(); + assert!( + error.contains("draft-notice") && error.contains("service.yaml"), + "{error}" + ); + + let root = tempfile::tempdir().unwrap(); + let package = function_project(root.path()); + let mut runner = ProductRunner::new( + Arc::new(function_runner_input(None)), + root.path(), + &terminate, + ) + .unwrap(); + runner.reserve_function_host().unwrap(); + assert!(runner.function_host.is_none()); + let error = coordinator_config(&runner, root.path(), &package) + .unwrap_err() + .to_string(); + assert!(error.contains("preview.functions"), "{error}"); + } + #[test] fn additional_runtime_configuration_uses_run_authority_and_loopback() { let root = tempfile::tempdir().unwrap(); diff --git a/docs/site/src/content/docs/configure/coordinator.mdx b/docs/site/src/content/docs/configure/coordinator.mdx index 976f784ddf..8e70c900a8 100644 --- a/docs/site/src/content/docs/configure/coordinator.mdx +++ b/docs/site/src/content/docs/configure/coordinator.mdx @@ -743,7 +743,7 @@ A selector that needs a verified claim and no field values cannot be reached by | 401, 403, or 404 other than `lookup.unresolved` | A failure of the lookup through the ordinary error path, never `unresolved`. | BReg answers one value-free `lookup.unresolved` whether no record matched, two matched, the row is hidden from the profile, or a claim was missing, so neither Coordinator nor the workflow can tell those apart. -For that reason `check` refuses an `onDeclaredRefusal` that routes `unresolved` straight to a step that creates or changes a record, with `definition.unresolved-route`: `breg.invoke-action/v1`, `breg.start-proposal/v1`, `breg.submit-proposal/v1`, and `external.command/v1`, whose effect Coordinator cannot see. +For that reason `check` refuses an `onDeclaredRefusal` that routes `unresolved` straight to a step that creates or changes a record, with `definition.unresolved-route`: `breg.invoke-action/v1`, `breg.start-proposal/v1`, `breg.submit-proposal/v1`, `external.command/v1`, and `service.invoke-function/v1`, whose effect Coordinator cannot see. "Not found, so create" makes a duplicate when two records match or one is hidden. Route to a finish, another read, or a Casework review request, and change data from a later step once a person or that read has decided. Only the direct route is refused: a step that cannot write a record (a Casework review request, a message, a scheduling call, a proposal cancellation) is allowed, and so is a mutation later on the path. @@ -942,6 +942,32 @@ The operation has no original-result receipt, so `reconcile` cannot settle it. crates/registry-coordinator/tests/external_command_project.rs scenario.reply; crates/registry-coordinator/tests/external_command_postgres.rs. */} +## Call a service function + +`service.invoke-function/v1` calls one service function. +The alias names it with `serviceFunction`. +The runtime connection binds the function host, the same function, and a credential for that host alone. +The call is an external command in every other respect: a pure Transform builds the JSON body, a required `interpret` Transform reads the `{status, body}` answer, and recovery, retries and fixtures follow [Call an external provider](#call-an-external-provider). + +```yaml +operations: + draft-notice: + uses: service.invoke-function/v1 + connection: notice-drafts + serviceFunction: draft-notice + responseSchema: {typeRef: draft-response} + interpret: draft-outcome +``` + +`check` refuses an alias without `serviceFunction`, a `serviceFunction` on any other operation, and an alias whose connection binds another function. +It checks the name against the runtime connection only, and `rstack dev` also refuses a name the service's `service.yaml` does not declare. +The function host credential is distinct from every product credential and audience the runtime file declares, so the call gives the function none of them. +Write any record change as its own step, such as a `breg.invoke-action/v1` call, under the run's BReg connection. +The reference page covers the [connection](../../reference/coordinator-configuration/#service-function-connections). + +{/* Evidence: crates/registry-coordinator/tests/service_function_project.rs; + crates/registry-coordinator/tests/service_function_postgres.rs. */} + ## Import record and template contracts Import a BReg record schema when you want fixtures to reject field names the record type does not serve. diff --git a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx index e94d7d86d9..d75ffdc588 100644 --- a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx +++ b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx @@ -68,12 +68,26 @@ origin policy and provide no authentication of local processes. The separate function listener requires a private handoff from the gateway and returns 401 to an anonymous function request. +A Coordinator `service-function` connection calls a preview function directly. The run +reserves the function listener's loopback port before products start and writes one +owner-only host key for the run, which the Coordinator presents as its bearer. The function +listener then hands the function a fixed placeholder bearer instead of the key, so the key +never leaves the listener and no product accepts what the function receives. +The same function stays callable from the page through the gateway, with the page actor's +authority, so write a Coordinator-bound function for both callers. +One run key admits the gateway and the Coordinator to every preview function, not only the +one a connection binds. The reserved port is released a moment before the function listener +binds it, as the other reserved ports are, so another local process could take it in that +window and receive the key. + {/* Evidence: crates/registry-rstack/src/cli.rs; crates/registry-rstack-dev/src/preview.rs; crates/registry-platform-config/src/service_roles.rs, roles_from_document(); crates/registry-rstack-dev/src/products.rs; clients/typescript/preview/build.mjs; clients/typescript/preview/gateway.mjs; + clients/typescript/preview/host.mjs, functionHostAuthorizer, coordinatorBearer; + clients/typescript/tests/generate-preview.test.ts; products/platform/examples/service-previews/README.md; products/platform/scripts/test-service-previews.mjs. */} diff --git a/docs/site/src/content/docs/operate/coordinator.mdx b/docs/site/src/content/docs/operate/coordinator.mdx index 1f49c16706..11b173bb17 100644 --- a/docs/site/src/content/docs/operate/coordinator.mdx +++ b/docs/site/src/content/docs/operate/coordinator.mdx @@ -1057,7 +1057,7 @@ Before the final attempt, these external replies must carry at most one `Retry-A A date, duplicate field, malformed value, or longer wait stops the call with `external-unusable-retry-after`. Zero still follows the normal backoff schedule. -An `external.command/v1` call has no read-only receipt, so `reconcile` reports `reconciliation-unavailable`. +An `external.command/v1` or `service.invoke-function/v1` call has no read-only receipt, so `reconcile` reports `reconciliation-unavailable`. `retry-same` resends the frozen body with its original `Idempotency-Key`; before retrying, confirm with the provider that it still deduplicates that key. - Status 429 before the tenth attempt is a definite busy answer retried on the retry schedule; on the tenth attempt it ends the call with `external-rate-limited`. diff --git a/docs/site/src/content/docs/reference/coordinator-configuration.mdx b/docs/site/src/content/docs/reference/coordinator-configuration.mdx index 7157bba68b..88d54acdd5 100644 --- a/docs/site/src/content/docs/reference/coordinator-configuration.mdx +++ b/docs/site/src/content/docs/reference/coordinator-configuration.mdx @@ -105,7 +105,7 @@ at most {reference.operations[0].maximum_call_attempts} attempts of ## Connections `runtime.yaml` declares every logical connection in one `connections` map, at most sixteen names. -Each entry selects its complete contract with `type`: `breg`, `casework-review-producer`, `messaging`, `payments`, `scheduling`, `external-http`, or `evaluation`. +Each entry selects its complete contract with `type`: `breg`, `casework-review-producer`, `messaging`, `payments`, `scheduling`, `external-http`, `service-function`, or `evaluation`. The [deployment runbook](../../operate/coordinator/) covers the rest of the `deployment` block. {/* Evidence: crates/registry-coordinator/src/runtime.rs ConnectionConfig. */} @@ -202,6 +202,59 @@ Coordinator trusts a 429 to mean the provider did not process the command, so th crates/registry-coordinator/src/runtime.rs command_path; crates/registry-coordinator/tests/external_command.rs. */} +### Service function connections + +A `service-function` connection serves `service.invoke-function/v1` and binds exactly one service function. +`rstack dev` checks the name against the service's `service.yaml`, and an operator recipe binds a name it has checked. +Set `baseUrl` to the function host, `function` to the function's identifier, exactly one credential, and the required `responseSchema` for `{status, body}`. +The credential is either `authorization`, an OAuth client for the function host, or `hostKeyRef`, a secret reference to a key only the function host accepts, sent as the bearer token. +`rstack dev` supplies `baseUrl` and a per-run `hostKeyRef` for the preview function host. +Coordinator sends each call as one POST to `functions/` under `baseUrl`. +The attempt timeout, response size and request body bounds are those of an external command. +Use HTTPS for institutional endpoints. +HTTP requires numeric loopback. +`authorization.taskAuthority` is refused. + +Add one connection for each function a workflow calls. +The credential is for the function host alone. +The runtime refuses a `resource` equal to a product or external connection's resource, a task authority `bootstrapResource` or `exchangeAudience`, or the Coordinator's own issuer audience, comparing URLs with the scheme and host in lower case, no default port and no trailing `/`, and URNs with the `urn:` scheme and namespace identifier in lower case. +It also refuses a `clientId` or key reference that a product, external or evaluation connection, a review completion, an event source or the deployment's own keys use. +At startup it refuses a key whose material one of those holds under another reference. +Other `service-function` connections are not compared, so two function connections may share a function host credential. +Each refusal names the colliding connection. +Bind every function host as `service-function`: an `external-http` connection gets none of these checks. +A record change stays a separate BReg step in the workflow. + +```yaml +connections: + notice-drafts: + type: service-function + baseUrl: https://functions.example.org/ + function: draft-notice + authorization: + tokenEndpoint: https://issuer.example.org/oauth/token + clientAssertionAudience: https://issuer.example.org + clientId: coordinator-notice-functions + signingKeyRef: secret:file/notice-functions-jwk + resource: https://functions.example.org + scopes: + - functions:draft-notice + responseSchema: + type: object + required: + - status + - body + properties: + status: + type: integer +``` + +The function host must pass the `Idempotency-Key` it receives to any effect the function makes, as an external provider must deduplicate on it. + +{/* Evidence: crates/registry-coordinator/src/external_http.rs ServiceFunctionConfig; + crates/registry-coordinator/src/runtime.rs function_credential_collisions, other_key_references; + crates/registry-coordinator/tests/service_function.rs. */} + ### Payment connections A `payments` connection serves the native payment operations over the Registry Adapter payment host. diff --git a/docs/site/src/content/docs/reference/typescript-clients.mdx b/docs/site/src/content/docs/reference/typescript-clients.mdx index 49713da5ad..d60160093f 100644 --- a/docs/site/src/content/docs/reference/typescript-clients.mdx +++ b/docs/site/src/content/docs/reference/typescript-clients.mdx @@ -156,12 +156,15 @@ generates three entry points in the owned build directory. Import `createRegistr from `generated/service.ts` and `functionPaths` from `generated/routes.ts` in your page. Function paths are relative to the preview origin. A function entry imports `defineFunction` from `generated/server.ts`. Its callback receives the request and a typed -client bound to that request's caller and the private BReg address. Keep the server entry in -the function's import graph. +client bound to that request's caller and the private BReg address. The callback receives a +copy of the request without the `Authorization`, `Cookie` and `Proxy-Authorization` headers; +the typed client carries the caller's credential. Keep the server entry in the function's +import graph. {/* Evidence: crates/registry-rstack/src/cli.rs; clients/typescript/generate-project.ts; clients/typescript/generate-service.ts; + clients/typescript/preview/host.mjs; clients/typescript/tests/generate-preview.test.ts. */} ## Match the generator and runtime versions diff --git a/docs/site/src/content/docs/security/coordinator.mdx b/docs/site/src/content/docs/security/coordinator.mdx index f8d21c5075..ce2eef1109 100644 --- a/docs/site/src/content/docs/security/coordinator.mdx +++ b/docs/site/src/content/docs/security/coordinator.mdx @@ -13,15 +13,15 @@ standards_referenced: [] This page states what Registry Coordinator holds, what it does not hold, and what you must do for its guarantees to hold. -Each guarantee carries a stable identifier from `COORDINATOR-INV-01` to `COORDINATOR-INV-15`, and -each accepted residual risk one from `COORDINATOR-RES-01` to `COORDINATOR-RES-27`. +Each guarantee carries a stable identifier from `COORDINATOR-INV-01` to `COORDINATOR-INV-17`, and +each accepted residual risk one from `COORDINATOR-RES-01` to `COORDINATOR-RES-29`. Terms follow [Author a Coordinator workflow](../../configure/coordinator/). Deployment steps are in [Deploy Registry Coordinator](../../operate/coordinator/). ## Scope and trust boundaries - The operator owns the runtime configuration: connection base URLs, the external command path, - credentials, issuer settings, the Base Registry Engine (BReg) connection profile and the Registry + the service function each `service-function` connection binds, credentials, issuer settings, the Base Registry Engine (BReg) connection profile and the Registry Adapter payment connection. Operator configuration is trusted; workflow data is not. - A workflow author writes a project that Coordinator freezes into a definition. @@ -30,6 +30,9 @@ Deployment steps are in [Deploy Registry Coordinator](../../operate/coordinator/ operation catalogue does. - Providers decide every effect a run requests: Registry Casework, Registry Scheduling, BReg, the Registry Adapter payment host and external HTTP providers. + A service function is not a provider of record authority. + Coordinator calls it with a credential distinct from every product credential the runtime file + declares, so a record change stays a separate step to the owning product. Coordinator holds workload identity, not decision authority, and each receiving product still authorises the call. - Coordinator verifies the access token against the matching entry in @@ -860,6 +863,104 @@ unknown, a timeout or a missing receipt authorises release or replacement. provider_confirmation_report_is_one_exact_keyed_command, disbursement_completion_settles_only_terminal_exactly_bound_state. */} +### COORDINATOR-INV-17: a service function call holds no credential the runtime file gives a product + +Threat: `service.invoke-function/v1` calls code a service declares, outside every product's +authorization. +A workflow could steer the call to another function, host or credential. +A deployment could hand the function host a token a product accepts, such as the BReg connection's +credential, so a function that forwards its incoming bearer would change records under the +Coordinator's product authority without a product step in the workflow. + +Enforcement: + +- The workflow names the function (`serviceFunction`) and supplies only the JSON body a pure + Transform builds. + The runtime connection (`type: service-function`) fixes the function host `baseUrl`, the one + bound `function`, and the credential. + Coordinator sends one POST to `functions/` under `baseUrl` and nowhere else. + The function name is a local identifier, so it cannot add a path segment. +- `coordinatorctl check` refuses an alias without `serviceFunction`, a `serviceFunction` on any + other operation, and an alias whose function is not the one its connection binds + (`workflow-binding`). + It checks the name against the runtime connection only. + `rstack dev` also refuses a name the service's `service.yaml` does not declare. + A connection of another type cannot carry the call. + The function name is part of the Operation revision and the connection's binding digest, so a + live Run cannot be moved to another function. +- The connection holds exactly one credential: an OAuth `authorization` without `taskAuthority`, + or a `hostKeyRef` key only the function host accepts. + `rstack dev` generates a per-run host key for the preview function host, and that host hands + a Coordinator-called function a fixed placeholder bearer, never the key. +- The credential is distinct from every credential and product audience the runtime file declares. + The runtime refuses a function `resource` equal to a product or external connection's + `resource`, a task authority `bootstrapResource` or `exchangeAudience`, or the Coordinator's own + `deployment.authentication.issuers.*.audience`. + URL resources are compared with the scheme and host in lower case, the default port dropped and a + trailing `/` removed, and URNs with the scheme and namespace identifier in lower case. + It refuses a `clientId` such a connection uses, and a `signingKeyRef` or `hostKeyRef` equal to + any product, external or evaluation credential, review completion key, event source key, or the + deployment's audit, state or admission key. + Each refusal names the colliding member as its related location, and no value. + At startup the resolved keys are compared too, a JWK by its RFC 7638 thumbprint and any other key + by its bytes, so the same key under another reference is refused. + Other `service-function` connections are not compared. +- The call is an external command in every other respect (COORDINATOR-INV-03). + The request id is frozen before the first send and sent as `Idempotency-Key`, redirects are never + followed, bodies and responses are bounded, an ambiguous exchange holds the run, and only the + pinned interpretation Transform turns the response into an accepted result or a declared refusal. + Nothing an operator reads carries the body, request id or credential. + +These checks prove only that the credential differs from the ones this file declares. +Whether a product elsewhere accepts the function host token is RES-28, and a function host bound as +`external-http` is not checked at all (RES-29). + +Refused: a workflow-chosen function, host, header or credential. +Also refused: a function the connection does not bind, a function connection with no credential or +two, a function credential matching a product, external or task authority credential or the +Coordinator's audience, and task authority on a function connection. + +{/* Evidence: crates/registry-coordinator/src/runtime.rs function_credential_collisions, other_key_references, + normalised_resource, validate_workflow_effect_bindings; + crates/registry-coordinator/src/adapters.rs distinct_function_keys; + crates/registry-coordinator/src/external_http.rs ServiceFunctionConfig; + crates/registry-coordinator/tests/service_function.rs + a_call_posts_to_the_bound_function_with_the_function_host_credential, + a_refusal_is_handed_to_the_interpretation_and_a_redirect_is_not_followed, + the_function_name_is_one_local_identifier, + the_bound_function_is_part_of_the_binding_digest, + a_service_function_connection_requires_its_own_credential, + a_service_function_credential_is_never_a_product_credential, + a_host_key_credential_is_sent_as_the_bearer_to_the_bound_function, + a_function_connection_names_exactly_one_credential, + a_host_key_is_never_a_product_signing_key, + a_function_resource_is_compared_after_normalisation, + a_function_resource_is_never_a_casework_or_exchange_audience, + a_function_resource_is_never_a_scheduling_messaging_or_external_audience, + a_function_resource_is_never_the_coordinator_audience, + a_taskauthority_refusal_names_the_service_function_remedy, + the_same_signing_key_under_another_reference_is_refused_at_startup, + the_runtime_routes_a_function_call_with_its_oauth_token_and_frozen_request_id, + a_lost_acknowledgement_is_uncertain_and_the_same_request_id_is_sent_again, + a_credential_collision_names_the_colliding_member_as_related, + a_function_resource_is_compared_with_any_trailing_slash_and_urn_case, + a_host_key_is_never_an_evaluation_completion_or_event_key, + a_host_key_is_never_a_deployment_key, + rotating_the_host_key_keeps_the_binding_and_changing_the_credential_kind_does_not, + the_same_host_key_or_jwk_under_another_form_is_refused_at_startup. + crates/registry-coordinator/tests/service_function_project.rs + a_missing_function_name_is_refused_at_the_operation, + only_the_service_function_operation_names_a_function, + an_unbound_function_name_is_refused_against_the_runtime_binding, + the_workflow_cannot_name_a_destination_or_credential, + the_named_function_is_part_of_the_operation_revision, + a_function_reply_reaches_its_result_only_through_the_interpret_transform, + unresolved_routed_straight_to_a_service_function_is_refused. + crates/registry-coordinator/tests/service_function_postgres.rs + an_accepted_function_call_records_the_step_and_its_typed_result, + a_declared_refusal_takes_the_workflow_refusal_route, + an_authority_refusal_the_interpretation_does_not_recognise_holds_the_run. */} + ## Operator obligations The guarantees hold only when you meet these obligations. @@ -914,6 +1015,13 @@ The residuals refer to them by number. identities. Investigate an unresolved original-request receipt before any same-command recovery or cancellation decision (COORDINATOR-INV-16). +15. Bind every function host as `type: service-function`, never as `external-http`, so the + credential checks of COORDINATOR-INV-17 apply (RES-29). + Give each `service-function` connection a client, key and resource that only its function host + accepts, scoped to the one function it binds, and add one connection per bound function. + Register the function host resource only for the function host at the authorization server. + Run the function host so that the function forwards the `Idempotency-Key` it receives to any + effect it makes, as obligation 1 asks of an external provider (COORDINATOR-INV-17). {/* Evidence: crates/registry-coordinator/tests/external_command_postgres.rs a_lost_acknowledgement_holds_and_retry_same_sends_the_same_command; @@ -990,13 +1098,15 @@ Each residual names the condition under which it applies, its consequence, and t ### COORDINATOR-RES-07: no receipt settles an uncertain external command -- Condition: `external.command/v1` has no original-result receipt. -- Consequence: `reconcile` cannot settle an uncertain command. +- Condition: `external.command/v1` and `service.invoke-function/v1` have no original-result + receipt. +- Consequence: `reconcile` cannot settle an uncertain command or function call. - Mitigation: check the provider's records, then retry or cancel the held run. ### COORDINATOR-RES-08: an accepted result is the Transform's reading -- Condition: Coordinator does not independently verify the provider's effect. +- Condition: Coordinator does not independently verify the effect of an external command or a + service function call. - Consequence: a Transform that maps an ambiguous answer to `accepted` records an effect that may not have happened. - Mitigation: cover ambiguous answers in scenarios and review. @@ -1214,6 +1324,35 @@ Each residual names the condition under which it applies, its consequence, and t a_run_whose_retained_definition_does_not_restore_is_held_alone, an_unreadable_snapshot_or_store_outage_fails_the_check_and_holds_nothing. */} +### COORDINATOR-RES-28: a function credential is distinct, not proven unusable at a product + +- Condition: a `service-function` connection names a resource, client and key that no product, + external or task authority credential in the same runtime file uses. +- Consequence: Coordinator cannot see the authorization server or the products of other + deployments, so it cannot prove that the function host token is refused everywhere else. + An authorization server that mints a product audience for the function host resource, or a + product that accepts the function host resource, would give a function product authority. +- Mitigation: obligation 15. + Register the function host resource only for the function host, and never list it as a product + audience. + +{/* Evidence: crates/registry-coordinator/src/runtime.rs function_credential_collisions, other_key_references; + crates/registry-coordinator/tests/service_function.rs + a_service_function_credential_is_never_a_product_credential. */} + +### COORDINATOR-RES-29: a function host bound as `external-http` is not checked + +- Condition: an operator binds a function host as `type: external-http` with a `commandPath` such + as `functions/`, and calls it with `external.command/v1`. +- Consequence: `external-http` credentials are never compared with product credentials, so that + connection can carry the BReg connection's resource, client and key, and a function that + forwards its bearer would act with product authority. +- Mitigation: obligation 15. + Bind function hosts as `service-function`. + A later release is planned to refuse product credentials on `external-http` connections too. + +{/* Evidence: crates/registry-coordinator/src/runtime.rs function_credential_collisions, other_key_references. */} + ## Report a vulnerability Report a suspected vulnerability through the process in diff --git a/products/coordinator/CHANGELOG.md b/products/coordinator/CHANGELOG.md index 6f74ab51fe..6a68751c72 100644 --- a/products/coordinator/CHANGELOG.md +++ b/products/coordinator/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - BREAKING: Name the bounded Rhai computations in a Coordinator workflow Transforms. Rename `functions` to `transforms` and use `type: transform` with a `transform` member in mappings. Use `coordinatorctl explain transforms` for the interpreter helpers and update diagnostic consumers from `coordinator.function.*` to `coordinator.transform.*`. Retained definition snapshots keep their reader and revision format. +- Add `service.invoke-function/v1`, which calls one service function. The workflow names it with `serviceFunction`. A `type: service-function` runtime connection binds the function host, that one function and one credential for the host alone: an OAuth `authorization` or a `hostKeyRef` key. `check` refuses a missing name and a name the connection does not bind. The runtime refuses a function credential whose resource, client or key matches a product, external or task authority credential or the Coordinator's own audience, and compares resolved key material at startup. Calls follow external command recovery and require an `interpret` Transform. ## 0.49.0 - 2026-12-01 diff --git a/products/coordinator/generated/openapi/coordinator.openapi.json b/products/coordinator/generated/openapi/coordinator.openapi.json index fc6128e58a..6b24e69000 100644 --- a/products/coordinator/generated/openapi/coordinator.openapi.json +++ b/products/coordinator/generated/openapi/coordinator.openapi.json @@ -491,7 +491,8 @@ "payments.record-receipt/v1", "payments.request-disbursement/v1", "payments.read-disbursement/v1", - "payments.record-provider-confirmation/v1" + "payments.record-provider-confirmation/v1", + "service.invoke-function/v1" ], "type": "string" }, diff --git a/products/coordinator/generated/operations/README.md b/products/coordinator/generated/operations/README.md index 57754e4b99..d958a37aa5 100644 --- a/products/coordinator/generated/operations/README.md +++ b/products/coordinator/generated/operations/README.md @@ -36,6 +36,7 @@ Each catalog operation has an input contract, the type its adapter decodes, and | [`payments.request-disbursement/v1`](#payments.request-disbursement/v1) | 1 | `payments` | mutation | required | none | hold-after-dispatch | read | none | | [`payments.read-disbursement/v1`](#payments.read-disbursement/v1) | 1 | `payments` | read | none | none | read-again | none | none | | [`payments.record-provider-confirmation/v1`](#payments.record-provider-confirmation/v1) | 1 | `payments` | mutation | required | none | same-command | none | none | +| [`service.invoke-function/v1`](#service.invoke-function/v1) | 1 | `service-function` | mutation | required | none | same-command | none | [`onDeclaredRefusal`](service.invoke-function.v1.declared-refusal.schema.json) | ## breg.read-record/v1 @@ -2352,6 +2353,73 @@ Output ([`payments.record-provider-confirmation.v1.output.schema.json`](payments No other members are accepted. +## service.invoke-function/v1 + +Host execution and completion contract: + +```json +{ + "authority": "current-bound-connection-authority", + "completionObservation": null, + "connectionInterface": "service-function", + "identity": { + "effect": "mutation", + "id": "service.invoke-function/v1", + "keyRequirement": "required", + "product": "service-function", + "readReceipt": false, + "recovery": "same-command", + "requiresPreparation": false, + "version": 1 + }, + "limits": { + "attemptTimeoutSeconds": 10, + "http": { + "attemptTimeoutMilliseconds": 2000, + "connectionMayLowerLimits": true, + "maximumMutationRetries": 0, + "maximumRequestBytes": 65536, + "maximumResponseBytes": 65536, + "redirects": "refused" + }, + "maximumCallAttempts": 10, + "maximumCallRetryDelaySeconds": 300, + "maximumConcurrentAttemptsPerRun": 1, + "maximumPreparationBytes": 65536, + "maximumRunDurationSeconds": 31536000, + "value": { + "maximumArrayItems": 256, + "maximumBytes": 131072, + "maximumDepth": 32, + "maximumNodes": 4096, + "maximumObjectMembers": 256, + "maximumStringBytes": 16384 + } + } +} +``` + +Input ([`service.invoke-function.v1.input.schema.json`](service.invoke-function.v1.input.schema.json)): + +Any JSON value. + +Output ([`service.invoke-function.v1.output.schema.json`](service.invoke-function.v1.output.schema.json)): + +| Member | Type | Required | +|---|---|---| +| `body` | any | yes | +| `status` | integer | yes | + +Other members are tolerated. + +Declared-refusal output ([`service.invoke-function.v1.declared-refusal.schema.json`](service.invoke-function.v1.declared-refusal.schema.json)): + +| Member | Type | Required | +|---|---|---| +| `refusalCode` | string | yes | + +No other members are accepted. + ## Completions A `wait-for` step observes a named completion on an accepted Operation. The host reads the authoritative result under current connection authority, using the saved command and exact correlation. A terminal result continues through `next` as the step output. A step reached by `onTimeout` has no completion output. Authenticated signals only wake an eligible read and never carry the result. Durable read spacing, the observation budget and the original deadline survive retries and restarts. diff --git a/products/coordinator/generated/operations/catalog.json b/products/coordinator/generated/operations/catalog.json index d152b1b43c..78079b1767 100644 --- a/products/coordinator/generated/operations/catalog.json +++ b/products/coordinator/generated/operations/catalog.json @@ -7712,5 +7712,91 @@ "title": "scheduling.reschedule-appointment/v1 output", "type": "object" } + }, + "service.invoke-function/v1": { + "declaredRefusal": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "One package-declared business refusal from a validated product response.\n\nThe code is deliberately absent from `Debug`; callers must opt in to reading\nor serializing it for an authored refusal branch.", + "properties": { + "refusalCode": { + "maxLength": 128, + "minLength": 1, + "pattern": "^[^\\u0000-\\u001F\\u007F-\\u009F]+$", + "type": "string" + } + }, + "required": [ + "refusalCode" + ], + "title": "service.invoke-function/v1 declared-refusal output", + "type": "object" + }, + "host": { + "authority": "current-bound-connection-authority", + "completionObservation": null, + "connectionInterface": "service-function", + "identity": { + "effect": "mutation", + "id": "service.invoke-function/v1", + "keyRequirement": "required", + "product": "service-function", + "readReceipt": false, + "recovery": "same-command", + "requiresPreparation": false, + "version": 1 + }, + "limits": { + "attemptTimeoutSeconds": 10, + "http": { + "attemptTimeoutMilliseconds": 2000, + "connectionMayLowerLimits": true, + "maximumMutationRetries": 0, + "maximumRequestBytes": 65536, + "maximumResponseBytes": 65536, + "redirects": "refused" + }, + "maximumCallAttempts": 10, + "maximumCallRetryDelaySeconds": 300, + "maximumConcurrentAttemptsPerRun": 1, + "maximumPreparationBytes": 65536, + "maximumRunDurationSeconds": 31536000, + "value": { + "maximumArrayItems": 256, + "maximumBytes": 131072, + "maximumDepth": 32, + "maximumNodes": 4096, + "maximumObjectMembers": 256, + "maximumStringBytes": 16384 + } + } + }, + "input": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": true, + "description": "The request body, sent as the exact JSON object to the one service function the connection binds.", + "title": "service.invoke-function/v1 input", + "type": "object" + }, + "output": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "description": "The bounded function host response. The operation's interpret Transform receives it with the request body and returns the step result, a declared refusal, or an uncertain outcome.", + "properties": { + "body": { + "description": "The parsed JSON response body, or null for an empty body." + }, + "status": { + "maximum": 65535, + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "status", + "body" + ], + "title": "service.invoke-function/v1 output", + "type": "object" + } } } diff --git a/products/coordinator/generated/operations/service.invoke-function.v1.declared-refusal.schema.json b/products/coordinator/generated/operations/service.invoke-function.v1.declared-refusal.schema.json new file mode 100644 index 0000000000..9db6c263f8 --- /dev/null +++ b/products/coordinator/generated/operations/service.invoke-function.v1.declared-refusal.schema.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "One package-declared business refusal from a validated product response.\n\nThe code is deliberately absent from `Debug`; callers must opt in to reading\nor serializing it for an authored refusal branch.", + "properties": { + "refusalCode": { + "maxLength": 128, + "minLength": 1, + "pattern": "^[^\\u0000-\\u001F\\u007F-\\u009F]+$", + "type": "string" + } + }, + "required": [ + "refusalCode" + ], + "title": "service.invoke-function/v1 declared-refusal output", + "type": "object" +} diff --git a/products/coordinator/generated/operations/service.invoke-function.v1.input.schema.json b/products/coordinator/generated/operations/service.invoke-function.v1.input.schema.json new file mode 100644 index 0000000000..f430a06dd7 --- /dev/null +++ b/products/coordinator/generated/operations/service.invoke-function.v1.input.schema.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": true, + "description": "The request body, sent as the exact JSON object to the one service function the connection binds.", + "title": "service.invoke-function/v1 input", + "type": "object" +} diff --git a/products/coordinator/generated/operations/service.invoke-function.v1.output.schema.json b/products/coordinator/generated/operations/service.invoke-function.v1.output.schema.json new file mode 100644 index 0000000000..f8f5edb3e6 --- /dev/null +++ b/products/coordinator/generated/operations/service.invoke-function.v1.output.schema.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "description": "The bounded function host response. The operation's interpret Transform receives it with the request body and returns the step result, a declared refusal, or an uncertain outcome.", + "properties": { + "body": { + "description": "The parsed JSON response body, or null for an empty body." + }, + "status": { + "maximum": 65535, + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "status", + "body" + ], + "title": "service.invoke-function/v1 output", + "type": "object" +} diff --git a/products/coordinator/generated/project/project.schema.json b/products/coordinator/generated/project/project.schema.json index 533b3328f0..ba614a461a 100644 --- a/products/coordinator/generated/project/project.schema.json +++ b/products/coordinator/generated/project/project.schema.json @@ -347,7 +347,7 @@ }, "interpret": { "$ref": "#/$defs/LocalId", - "description": "The typed pure Transform that interprets an external command's provider\nresponse into an accepted result, a declared refusal or an uncertain\noutcome. Required on, and accepted only on, `external.command/v1`." + "description": "The typed pure Transform that interprets an external command's provider\nresponse into an accepted result, a declared refusal or an uncertain\noutcome. Required on, and accepted only on, `external.command/v1` and\n`service.invoke-function/v1`." }, "label": { "$ref": "#/$defs/DisplayText", @@ -359,7 +359,11 @@ }, "responseSchema": { "$ref": "#/$defs/Schema", - "description": "An optional typed response specialization for the bounded external GET\nor external command Operation." + "description": "An optional typed response specialization for the bounded external GET\nor external command Operation, or the service function Operation." + }, + "serviceFunction": { + "$ref": "#/$defs/LocalId", + "description": "The one service function `service.invoke-function/v1` calls. Required\non, and accepted only on, that Operation. `check` matches it against\nthe function the runtime connection binds; `rstack dev` also checks it\nagainst `service.yaml`. The runtime connection binds the host and\ncredential, and the workflow supplies neither." }, "template": { "$ref": "#/$defs/TemplateReference", @@ -961,7 +965,8 @@ "payments.record-receipt/v1", "payments.request-disbursement/v1", "payments.read-disbursement/v1", - "payments.record-provider-confirmation/v1" + "payments.record-provider-confirmation/v1", + "service.invoke-function/v1" ], "type": "string" }, diff --git a/products/coordinator/generated/runtime/runtime.schema.json b/products/coordinator/generated/runtime/runtime.schema.json index 26f0669f7e..3b96285a14 100644 --- a/products/coordinator/generated/runtime/runtime.schema.json +++ b/products/coordinator/generated/runtime/runtime.schema.json @@ -471,6 +471,62 @@ ], "type": "object" }, + { + "additionalProperties": false, + "description": "One service function, bound by the deployment to its function host and to a\ncredential for that host alone. `rstack dev` checks the name against the\nservice's `service.yaml`; an operator recipe binds a name it has checked.\nThe workflow names the function; it never supplies the destination or the\ncredential. The function host serves the function at `functions/`\nunder the base URL.", + "properties": { + "attemptTimeoutMilliseconds": { + "default": 2000, + "format": "uint64", + "maximum": 2000, + "minimum": 1, + "type": "integer" + }, + "authorization": { + "$ref": "#/$defs/AuthorizationConfig", + "description": "An OAuth client credential for the function host. Its client, key and\nresource must differ from every product, external and evaluation\ncredential this runtime file declares. Exactly one of `authorization`\nand `hostKeyRef` is required.", + "not": { + "required": [ + "taskAuthority" + ] + } + }, + "baseUrl": { + "$ref": "#/$defs/Url", + "pattern": "^[^\\s\\\\]+$" + }, + "function": { + "$ref": "#/$defs/LocalId", + "description": "The one function this connection binds." + }, + "hostKeyRef": { + "$ref": "#/$defs/SecretReference", + "description": "A static key only the function host accepts, sent as the bearer token.\n`rstack dev` generates one for each run; an operator recipe supplies\nits own. Exactly one of `authorization` and `hostKeyRef` is required." + }, + "maximumResponseBytes": { + "default": 65536, + "format": "uint64", + "maximum": 65536, + "minimum": 1, + "type": "integer" + }, + "responseSchema": { + "description": "Local JSON Schema for the complete {status, body} response.", + "x-registry-foreign": "json-schema-2020-12" + }, + "type": { + "const": "service-function", + "type": "string" + } + }, + "required": [ + "type", + "baseUrl", + "function", + "responseSchema" + ], + "type": "object" + }, { "additionalProperties": false, "properties": { diff --git a/products/coordinator/scripts/test-postgres.sh b/products/coordinator/scripts/test-postgres.sh index 85f5595ff3..517301e015 100755 --- a/products/coordinator/scripts/test-postgres.sh +++ b/products/coordinator/scripts/test-postgres.sh @@ -33,7 +33,7 @@ cargo test --locked -p registry-coordinator --features postgres-test --lib \ --test postgres_state --test service_deadline --test recovery_audit --test read_lease_recovery \ --test messaging_integration --test process_restart \ --test deployment_postgres --test refusal_golden --test review_wait_postgres \ - --test external_wait_postgres --test external_command_postgres \ + --test external_wait_postgres --test external_command_postgres --test service_function_postgres \ --test standalone_review_postgres --test compare_worker_postgres \ --test read_in_force_postgres --test breg_proposal_wait_postgres \ --test calendar_trigger_authoring From b4d9e38d5e595472ce91cd5f3222a3a40f864f37 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 27/55] feat(dev): add the permit-review service preview Folds these reviewed commits: - feat(dev): bind the Coordinator as one Casework review producer - fix(dev): close the Coordinator review producer binding's widening paths - feat(dev): give one Coordinator BReg connection a development identity - fix(dev): keep the Coordinator BReg identity dedicated to the Coordinator - feat(dev): serve one preview page to several actors - fix(dev): pin the Coordinator BReg client's whole replacement and recheck - fix(dev): pin each preview actor's isolation and report its origins - fix(dev): configure the review producer's completion destination for identity facts - feat(dev): add the permit-review service preview - fix(coordinator): compare function host keys as bytes - fix(dev): review and decide only the permit application the Coordinator reads - docs(dev): state the permit-review decision guard invariant and test identities - fix(coordinator): compare a function host key without its trailing newlines - test(dev): drive the permit-review preview in two browser contexts Signed-off-by: Jeremi Joslin --- clients/typescript/preview/build.mjs | 43 +- clients/typescript/preview/config.mjs | 63 +- clients/typescript/preview/gateway.mjs | 165 ++- clients/typescript/preview/run.mjs | 44 +- .../typescript/preview/tests/preview.test.mjs | 297 +++++- .../typescript/tests/generate-preview.test.ts | 3 + crates/registry-coordinator/src/adapters.rs | 13 +- crates/registry-coordinator/src/error.rs | 82 +- .../registry-coordinator/src/project_check.rs | 10 + crates/registry-coordinator/src/runtime.rs | 7 +- .../tests/service_function.rs | 55 + .../tests/service_function_project.rs | 6 + crates/registry-rstack-dev/src/bindings.rs | 880 +++++++++++++++- crates/registry-rstack-dev/src/dev_facts.rs | 60 +- crates/registry-rstack-dev/src/lib.rs | 118 ++- crates/registry-rstack-dev/src/plan.rs | 36 +- crates/registry-rstack-dev/src/preview.rs | 712 ++++++++++++- crates/registry-rstack-dev/src/products.rs | 946 ++++++++++++++++-- crates/registry-rstack-dev/src/roles.rs | 4 + crates/registry-rstack/tests/dev_run.rs | 140 +++ .../run-a-project-with-rstack-dev.mdx | 134 +++ .../src/content/docs/security/casework.mdx | 3 + .../src/content/docs/security/coordinator.mdx | 4 + products/platform/config-formats.yaml | 10 + .../examples/service-previews/README.md | 39 +- .../service-previews/permit-review/README.md | 81 ++ .../permit-review/casework/casework.yaml | 78 ++ .../permit-review/coordinator/README.md | 23 + .../already-decided-is-not-reviewed.yaml | 28 + .../approved-assessed-and-recorded.yaml | 89 ++ .../rejected-recorded-without-assessment.yaml | 82 ++ .../permit-review/coordinator/functions.rhai | 59 ++ .../generated/permits.contract.json | 1 + .../permit-review/coordinator/runtime.yaml | 82 ++ .../permit-review/coordinator/workflow.yaml | 293 ++++++ .../permit-review/dev-journeys.yaml | 31 + .../service-previews/permit-review/dev.yaml | 90 ++ .../functions/assess-permit/assess.ts | 32 + .../functions/assess-permit/index.ts | 8 + .../functions/digest-application/digest.ts | 33 + .../functions/digest-application/index.ts | 7 + .../permit-review/manifest.yaml | 3 + .../permit-review/package-lock.json | 528 ++++++++++ .../permit-review/package.json | 8 + .../permit-review/project/registry.yaml | 182 ++++ .../permit-review/project/tests/journeys.yaml | 115 +++ .../permit-review/service.yaml | 40 + .../permit-review/web/public/index.html | 73 ++ .../permit-review/web/public/service.css | 29 + .../permit-review/web/src/page.ts | 210 ++++ .../permit-review/web/tsconfig.json | 11 + .../generated/dev/dev.v1alpha1.schema.json | 108 +- .../scripts/prepare-service-preview-locks.mjs | 2 +- .../scripts/test-service-previews.mjs | 230 ++++- 54 files changed, 6182 insertions(+), 248 deletions(-) create mode 100644 products/platform/examples/service-previews/permit-review/README.md create mode 100644 products/platform/examples/service-previews/permit-review/casework/casework.yaml create mode 100644 products/platform/examples/service-previews/permit-review/coordinator/README.md create mode 100644 products/platform/examples/service-previews/permit-review/coordinator/fixtures/already-decided-is-not-reviewed.yaml create mode 100644 products/platform/examples/service-previews/permit-review/coordinator/fixtures/approved-assessed-and-recorded.yaml create mode 100644 products/platform/examples/service-previews/permit-review/coordinator/fixtures/rejected-recorded-without-assessment.yaml create mode 100644 products/platform/examples/service-previews/permit-review/coordinator/functions.rhai create mode 100644 products/platform/examples/service-previews/permit-review/coordinator/generated/permits.contract.json create mode 100644 products/platform/examples/service-previews/permit-review/coordinator/runtime.yaml create mode 100644 products/platform/examples/service-previews/permit-review/coordinator/workflow.yaml create mode 100644 products/platform/examples/service-previews/permit-review/dev-journeys.yaml create mode 100644 products/platform/examples/service-previews/permit-review/dev.yaml create mode 100644 products/platform/examples/service-previews/permit-review/functions/assess-permit/assess.ts create mode 100644 products/platform/examples/service-previews/permit-review/functions/assess-permit/index.ts create mode 100644 products/platform/examples/service-previews/permit-review/functions/digest-application/digest.ts create mode 100644 products/platform/examples/service-previews/permit-review/functions/digest-application/index.ts create mode 100644 products/platform/examples/service-previews/permit-review/manifest.yaml create mode 100644 products/platform/examples/service-previews/permit-review/package-lock.json create mode 100644 products/platform/examples/service-previews/permit-review/package.json create mode 100644 products/platform/examples/service-previews/permit-review/project/registry.yaml create mode 100644 products/platform/examples/service-previews/permit-review/project/tests/journeys.yaml create mode 100644 products/platform/examples/service-previews/permit-review/service.yaml create mode 100644 products/platform/examples/service-previews/permit-review/web/public/index.html create mode 100644 products/platform/examples/service-previews/permit-review/web/public/service.css create mode 100644 products/platform/examples/service-previews/permit-review/web/src/page.ts create mode 100644 products/platform/examples/service-previews/permit-review/web/tsconfig.json diff --git a/clients/typescript/preview/build.mjs b/clients/typescript/preview/build.mjs index e90f877dfd..3cda37aab9 100644 --- a/clients/typescript/preview/build.mjs +++ b/clients/typescript/preview/build.mjs @@ -40,24 +40,38 @@ async function copySource(path, target, exclude) { }) } -async function runGenerator(plan, staged) { +// An actors preview names no Proposal author: each actor's gateway pins its own +// BReg profile, so no single author profile fits every actor's page. +export function generatorArguments(plan, staged) { const { id, member, profile } = plan.product const project = plan.sourceProject ?? plan.product.project + return [ + join(clientPackage, 'registry-generate.js'), + '--register', member + '=' + project, + '--route-prefix', member + '=/registry/' + id, + ...(plan.preview.actors === undefined ? ['--author-profile', member + '=' + profile] : []), + '--preview', ...plan.preview.functions.flatMap(name => ['--preview-function', name]), + '--output', join(staged, 'generated', 'service.ts'), + ] +} + +export function generationError(stderr, actors) { + const diagnostic = stderr.trim() + if (actors && /has Proposals, so the service description needs authorProfiles/u.test(diagnostic)) { + return new Error(diagnostic + '\nAn actors preview cannot start Proposals: no single actor profile authors them. Use the single-actor form for a register with Proposals.') + } + if (/cannot start Proposals/u.test(diagnostic)) { + return new Error(diagnostic + '\nSelect a preview actor whose BReg profile can start Proposals.') + } + return new Error(diagnostic || 'Preview client generation failed. Check the native project and install matching BReg tools.') +} + +async function runGenerator(plan, staged) { try { - await runFile(process.execPath, [ - join(clientPackage, 'registry-generate.js'), - '--register', member + '=' + project, - '--route-prefix', member + '=/registry/' + id, - '--author-profile', member + '=' + profile, - '--preview', ...plan.preview.functions.flatMap(name => ['--preview-function', name]), - '--output', join(staged, 'generated', 'service.ts'), - ], { cwd: staged, timeout: 90_000, maxBuffer: 1024 * 1024 }) + await runFile(process.execPath, generatorArguments(plan, staged), + { cwd: staged, timeout: 90_000, maxBuffer: 1024 * 1024 }) } catch (error) { - const diagnostic = String(error.stderr ?? '').trim() - if (/cannot start Proposals/u.test(diagnostic)) { - throw new Error(diagnostic + '\nSelect a preview actor whose BReg profile can start Proposals.') - } - throw new Error(diagnostic || 'Preview client generation failed. Check the native project and install matching BReg tools.') + throw generationError(String(error.stderr ?? ''), plan.preview.actors !== undefined) } } @@ -197,6 +211,7 @@ export async function buildPreview(plan, directory) { version: versionLine, declarationDigest: plan.declarationDigest, product: plan.product, + routeProducts: plan.routeProducts ?? [], preview: plan.preview, functions: entries.map(([name]) => name), staticOutput: relative(directory, staticOutput), diff --git a/clients/typescript/preview/config.mjs b/clients/typescript/preview/config.mjs index 171ad39bb6..3b04538b4a 100644 --- a/clients/typescript/preview/config.mjs +++ b/clients/typescript/preview/config.mjs @@ -59,9 +59,14 @@ export async function prepareRuntimeConfig({ artifact, deployment, run }) { || run.preview.productId !== artifact.product.id || run.preview.profile !== artifact.product.profile) { throw new Error('The preview product or audience differs from the checked plan.') } - const { authorizationFile, functionHost } = run.preview - if (typeof authorizationFile !== 'string' || !isAbsolute(authorizationFile)) { - throw new Error('The preview needs an owner-only run authorization file.') + const { authorizationFile, functionHost, actors } = run.preview + if (artifact.preview?.actors === undefined) { + if (actors !== undefined) throw new Error('A single-actor preview takes no actors.') + if (typeof authorizationFile !== 'string' || !isAbsolute(authorizationFile)) { + throw new Error('The preview needs an owner-only run authorization file.') + } + } else { + checkActors(artifact, run, actors) } const functionPort = functionHost?.port if (!Number.isInteger(functionPort) || functionPort < 1 || functionPort > 65535 || functionPort === port @@ -72,6 +77,50 @@ export async function prepareRuntimeConfig({ artifact, deployment, run }) { return { schema, runId: run.runId, origin, port, breg: run.breg, preview: run.preview } } +// Each actor has its own loopback origin, and for each product it may reach +// the product's origin and audience as checked, the access profile the +// gateway pins (none for the Coordinator), and its own credential file. +function checkActors(artifact, run, actors) { + const names = Object.keys(artifact.preview.actors) + const products = new Map((artifact.routeProducts ?? []).map(product => [product.id, product])) + products.set(artifact.product.id, { id: artifact.product.id, kind: 'breg', audience: artifact.product.audience }) + if (run.preview.authorizationFile !== undefined) { + throw new Error('An actors preview takes no single authorization file.') + } + if (!Array.isArray(actors) || actors.map(actor => actor?.name).join() !== names.join()) { + throw new Error('The preview actors differ from the checked plan.') + } + const ports = new Set([run.preview.functionHost?.port, URL.parse(run.breg.baseUrl)?.port]) + actors.forEach((actor, index) => { + if (index === 0 && (actor.origin !== run.origin || actor.port !== run.port)) { + throw new Error('The first preview actor must serve the run origin.') + } + if (loopbackOrigin(actor.origin) !== `http://127.0.0.1:${actor.port}` || !Number.isInteger(actor.port) + || ports.has(actor.port) || ports.has(String(actor.port))) { + throw new Error('Each preview actor needs its own reserved loopback address.') + } + ports.add(actor.port) + const routes = artifact.preview.actors[actor.name] + const entries = typeof actor.products === 'object' && actor.products !== null ? Object.entries(actor.products) : [] + const kinds = entries.map(([id]) => products.get(id)?.kind) + if (Object.keys(routes).some(kind => !kinds.includes(kind))) { + throw new Error('A preview actor reaches a product it has no credential for.') + } + for (const [id, product] of entries) { + const checked = Object.hasOwn(Object.fromEntries(products), id) ? products.get(id) : undefined + if (!checked) throw new Error('A preview actor has a credential for a product the plan does not route.') + if (loopbackOrigin(product.baseUrl) === actor.origin) { + throw new Error("A preview actor reaches a product on the actor's own origin.") + } + if (product.audience !== checked.audience + || (checked.kind === 'coordinator' ? product.profile !== null : typeof product.profile !== 'string') + || typeof product.authorizationFile !== 'string' || !isAbsolute(product.authorizationFile)) { + throw new Error('A preview actor product differs from the checked plan.') + } + } + }) +} + async function checkCredentialPath(path, runFile) { const file = await lstat(path) if (dirname(path) !== dirname(runFile) || !file.isFile() || file.isSymbolicLink() @@ -82,7 +131,13 @@ async function checkCredentialPath(path, runFile) { export async function configure({ artifact, deployment, runFile }) { const config = await prepareRuntimeConfig({ artifact, deployment, run: await readJson(runFile) }) - await checkCredentialPath(config.preview.authorizationFile, runFile) + if (config.preview.actors === undefined) { + await checkCredentialPath(config.preview.authorizationFile, runFile) + } else { + for (const actor of config.preview.actors) { + for (const product of Object.values(actor.products)) await checkCredentialPath(product.authorizationFile, runFile) + } + } await checkCredentialPath(config.preview.functionHost.keyFile, runFile) return config } diff --git a/clients/typescript/preview/gateway.mjs b/clients/typescript/preview/gateway.mjs index 81cbecb9e8..51a40ebeda 100644 --- a/clients/typescript/preview/gateway.mjs +++ b/clients/typescript/preview/gateway.mjs @@ -2,7 +2,7 @@ import { constants } from 'node:fs' import { lstat, open, readdir } from 'node:fs/promises' import { createServer } from 'node:http' import { extname, join } from 'node:path' -import { healthPath, localId, loopbackOrigin } from './config.mjs' +import { healthPath, localId, loopbackOrigin, readAuthorization } from './config.mjs' import { maxRequestBodySize } from './host.mjs' const maxResponseSize = 4 * 1024 * 1024 @@ -12,7 +12,6 @@ const segment = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u const uuid = /^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/iu const revision = /^[1-9][0-9]{0,18}$/u const maximumRevision = '9223372036854775807' -const recordParameter = part => part === '{recordId}' || part === '{record_id}' const contentTypes = new Map([ ['.css', 'text/css; charset=utf-8'], ['.html', 'text/html; charset=utf-8'], @@ -31,18 +30,70 @@ class RequestError extends Error { } } +// A route segment that stands for one product-assigned UUID. `{revision}` +// stands for one Record revision number. +const placeholders = new Set(['{recordId}', '{record_id}', '{taskId}', '{runId}']) + function compilePaths(paths = []) { if (!Array.isArray(paths)) throw new Error('Expected a list of preview routes per method.') return paths.map((path) => { const parts = typeof path === 'string' && path.length <= 256 && path.startsWith('/v1/') ? path.slice(1).split('/') : [] - if (parts.length < 2 || parts.filter(recordParameter).length > 1 || parts.filter(part => part === '{revision}').length > 1 - || !parts.every(part => segment.test(part) || recordParameter(part) || part === '{revision}')) { - throw new Error('Expected an exact /v1/ preview route with distinct Record ID and revision parameters.') + if (parts.length < 2 || parts.filter(part => placeholders.has(part)).length > 1 + || parts.filter(part => part === '{revision}').length > 1 + || !parts.every(part => segment.test(part) || placeholders.has(part) || part === '{revision}')) { + throw new Error('Expected an exact /v1/ preview route with at most one {recordId}, {taskId} or {runId} and at most one {revision}.') } return parts }) } +// The exact GET and POST routes one actor may reach on one product. +export function compileRoutes(routes = {}) { + const compiled = new Map([['GET', compilePaths(routes.get)], ['POST', compilePaths(routes.post)]]) + return (method, path) => { + const parts = path.slice(1).split('/') + return Boolean(compiled.get(method)?.some(route => + route.length === parts.length && route.every((part, index) => { + const value = parts[index] + if (placeholders.has(part)) return uuid.test(value) + if (part === '{revision}') return revision.test(value) && (value.length < maximumRevision.length || value <= maximumRevision) + return part === value + }), + )) + } +} + +// The gateway options for each actor, in plan order. An actor's gateway gets +// only that actor's credential files, and for each product only the routes the +// actor declares for its kind. Functions run under the actor's own BReg +// credential, and an actor without one serves no function route. +export function actorGatewayOptions(artifact, actors) { + const policy = previewPolicy(artifact.preview) + const kinds = new Map((artifact.routeProducts ?? []).map(product => [product.id, product.kind])) + kinds.set(artifact.product.id, 'breg') + const none = compileRoutes({}) + return actors.map(actor => { + const routes = policy.actors.get(actor.name) + const products = Object.fromEntries(Object.entries(actor.products).map(([id, product]) => { + const kind = kinds.get(id) + return [id, { + origin: product.baseUrl, + profile: product.profile, + authorization: () => readAuthorization(product.authorizationFile), + allows: kind !== undefined && Object.hasOwn(routes, kind) ? routes[kind] : none, + }] + })) + const breg = Object.hasOwn(actor.products, artifact.product.id) ? actor.products[artifact.product.id] : undefined + return { + origin: actor.origin, + port: actor.port, + actor: actor.name, + products, + functionAuthorization: breg ? () => readAuthorization(breg.authorizationFile) : null, + } + }) +} + export function previewPolicy(preview) { const page = preview.page === '/' ? '/index.html' : preview.page if (typeof page !== 'string' || !/^\/(?:[A-Za-z0-9][A-Za-z0-9_-]*\/)*[A-Za-z0-9][A-Za-z0-9_-]*\.html$/u.test(page)) { @@ -52,24 +103,27 @@ export function previewPolicy(preview) { || new Set(preview.functions).size !== preview.functions.length) { throw new Error('Expected distinct preview function IDs.') } - const routes = new Map([ - ['GET', compilePaths(preview.breg.get)], - ['POST', compilePaths(preview.breg.post)], - ]) + if ((preview.actors === undefined) === (preview.breg === undefined)) { + throw new Error('Expected either one actor with BReg routes or an actors map.') + } + const actors = new Map() + if (preview.actors !== undefined) { + const entries = typeof preview.actors === 'object' && preview.actors !== null ? Object.entries(preview.actors) : [] + if (entries.length < 1 || entries.length > 8 || entries.some(([name, routes]) => !localId.test(name) + || typeof routes !== 'object' || routes === null + || Object.keys(routes).some(kind => !['breg', 'casework', 'coordinator'].includes(kind)))) { + throw new Error('Expected one to eight preview actors with breg, casework or coordinator routes.') + } + for (const [name, routes] of entries) { + actors.set(name, Object.fromEntries(Object.entries(routes).map(([kind, set]) => [kind, compileRoutes(set)]))) + } + } + const allowsBreg = preview.breg === undefined ? () => false : compileRoutes(preview.breg) return { page, functions: new Set(preview.functions), - allowsBreg(method, path) { - const parts = path.slice(1).split('/') - return routes.get(method)?.some(route => - route.length === parts.length && route.every((part, index) => { - const value = parts[index] - if (recordParameter(part)) return uuid.test(value) - if (part === '{revision}') return revision.test(value) && (value.length < maximumRevision.length || value <= maximumRevision) - return part === value - }), - ) - }, + actors, + allowsBreg, } } @@ -142,28 +196,52 @@ function sendError(response, status, message) { response.end(JSON.stringify({ message })) } +// The products one gateway reaches, keyed by service product ID. Each carries +// its loopback origin, the access profile the gateway pins (or null for a +// product that selects no profile by query), the routes the actor may use, +// and the actor's own credential for that product. +function gatewayProducts({ productId, profile, breg, authorization, preview, products }) { + if (products !== undefined) { + const entries = Object.entries(products) + if (!entries.length || entries.some(([id, product]) => !localId.test(id) + || typeof product.allows !== 'function' || typeof product.authorization !== 'function' + || !(product.profile === null || typeof product.profile === 'string'))) { + throw new Error('Expected preview products with routes, a profile and a credential.') + } + return new Map(entries.map(([id, product]) => [id, { ...product, origin: loopbackOrigin(product.origin) }])) + } + if (!localId.test(productId)) throw new Error('The preview needs a local product ID.') + return new Map([[productId, { + origin: loopbackOrigin(breg), profile, authorization, allows: compileRoutes(preview.breg), + }]]) +} + export async function startPreviewGateway({ origin: initialOrigin, port, productId, profile, breg, + products: declaredProducts, + actor = null, application, authorization, + functionAuthorization = authorization, publicDirectory, preview, functionKey, }) { - if (!localId.test(productId)) throw new Error('The preview needs a local product ID.') - const bregOrigin = loopbackOrigin(breg) + const products = gatewayProducts({ productId, profile, breg, authorization, preview, products: declaredProducts }) const applicationOrigin = loopbackOrigin(application) const policy = previewPolicy(preview) + if (typeof functionAuthorization !== 'function' && functionAuthorization !== null) { + throw new Error('The preview needs the actor credential for its functions, or null to serve none.') + } const files = await collectStaticFiles(publicDirectory) if (!files.has(policy.page)) throw new Error('The preview output is missing the configured HTML page.') - const registryPrefix = '/registry/' + productId let origin = initialOrigin - async function relay(request, response, target, privateFunction = false) { + async function relay(request, response, target, authorization, privateFunction = false) { const headers = new Headers({ authorization: await authorization() }) if (privateFunction && functionKey) headers.set('x-registry-preview-function', functionKey) for (const name of ['accept', 'content-type', 'if-match', 'idempotency-key']) { @@ -196,6 +274,17 @@ export async function startPreviewGateway({ response.writeHead(204, responseSecurity).end() return } + // The actor this origin serves, so one built page can show its controls. + // It carries no credential and answers only the page. + if (actor !== null && method === 'GET' && rawTarget === '/_rstack/actor') { + if (headers['registry-client'] !== 'page' || (headers.origin !== undefined && headers.origin !== origin) + || (headers['sec-fetch-site'] !== undefined && headers['sec-fetch-site'] !== 'same-origin')) { + throw new RequestError(403, 'Open the service page to make this request') + } + response.writeHead(200, { ...responseSecurity, 'content-type': 'application/json' }) + .end(JSON.stringify({ actor })) + return + } if (!rawPath.startsWith('/') || rawTarget.length > 8192 || rawTarget.includes('#') || (rawPath !== '/' && !rawPath.slice(1).split('/').every(part => segment.test(part)))) { throw new RequestError(404, 'Unknown preview route') @@ -224,23 +313,29 @@ export async function startPreviewGateway({ || (method === 'POST' && headers.origin !== origin)) { throw new RequestError(403, 'Open the service page to make this request') } - if (method === 'POST' && rawPath.startsWith('/api/functions/') && !url.search) { + if (functionAuthorization && method === 'POST' && rawPath.startsWith('/api/functions/') && !url.search) { const name = rawPath.slice('/api/functions/'.length) if (policy.functions.has(name)) { - await relay(request, response, applicationOrigin + '/functions/' + name, true) + await relay(request, response, applicationOrigin + '/functions/' + name, functionAuthorization, true) return } } - if (rawPath.startsWith(registryPrefix + '/')) { - const bregPath = rawPath.slice(registryPrefix.length) - if (policy.allowsBreg(method, bregPath)) { - const requestedProfiles = url.searchParams.getAll('accessProfile') - if (requestedProfiles.length > 1 || requestedProfiles.some(value => value !== profile)) { - throw new RequestError(403, 'The request selects another access profile') - + const [, prefix, id, ...rest] = rawPath.split('/') + const product = prefix === 'registry' ? products.get(id) : undefined + if (product && rest.length) { + const productPath = '/' + rest.join('/') + if (product.allows(method, productPath)) { + if (product.profile === null) { + // A product that selects no profile by query takes no query at all. + if (url.search) throw new RequestError(404, 'Unknown preview route') + } else { + const requestedProfiles = url.searchParams.getAll('accessProfile') + if (requestedProfiles.length > 1 || requestedProfiles.some(value => value !== product.profile)) { + throw new RequestError(403, 'The request selects another access profile') + } + url.searchParams.set('accessProfile', product.profile) } - url.searchParams.set('accessProfile', profile) - await relay(request, response, bregOrigin + bregPath + url.search) + await relay(request, response, product.origin + productPath + url.search, product.authorization) return } } diff --git a/clients/typescript/preview/run.mjs b/clients/typescript/preview/run.mjs index ed52874072..1087cb883f 100644 --- a/clients/typescript/preview/run.mjs +++ b/clients/typescript/preview/run.mjs @@ -1,14 +1,19 @@ import { writeFile } from 'node:fs/promises' import { dirname, join } from 'node:path' import { artifactDirectory, checkRuntimeConfig, configEnvironment, readArtifact, readAuthorization, readHostKey } from './config.mjs' -import { startPreviewGateway } from './gateway.mjs' +import { actorGatewayOptions, startPreviewGateway } from './gateway.mjs' import { functionHostAuthorizer, startFunctionHost } from './host.mjs' async function run() { const configFile = process.env[configEnvironment] const artifact = await readArtifact() const config = await checkRuntimeConfig(configFile, artifact) - await readAuthorization(config.preview.authorizationFile) + const actors = config.preview.actors + for (const file of actors === undefined + ? [config.preview.authorizationFile] + : actors.flatMap(actor => Object.values(actor.products).map(product => product.authorizationFile))) { + await readAuthorization(file) + } const connection = Object.freeze({ ...config.breg }) const products = Object.freeze({ [artifact.product.id]: connection }) const handlers = new Map() @@ -28,30 +33,43 @@ async function run() { authorize: functionHostAuthorizer(functionKey), port: config.preview.functionHost.port, }) - let gateway + const gateways = [] try { await writeFile(join(dirname(configFile), 'application-preview-function-origin'), privateHost.origin + '\n', { flag: 'wx', mode: 0o600 }) - gateway = await startPreviewGateway({ - origin: config.origin, - port: config.port, - productId: artifact.product.id, - profile: artifact.product.profile, - breg: config.breg.baseUrl, + const shared = { application: privateHost.origin, - authorization: () => readAuthorization(config.preview.authorizationFile), publicDirectory: join(artifactDirectory, artifact.staticOutput), preview: artifact.preview, functionKey, - }) + } + if (actors === undefined) { + gateways.push(await startPreviewGateway({ + ...shared, + origin: config.origin, + port: config.port, + productId: artifact.product.id, + profile: artifact.product.profile, + breg: config.breg.baseUrl, + authorization: () => readAuthorization(config.preview.authorizationFile), + })) + } else { + // One gateway per actor, each on its own origin over the same static + // bytes, carrying only that actor's credentials and routes. + // The run checks readiness on the first actor's origin, so that + // gateway starts last, once every other actor's gateway listens. + for (const options of actorGatewayOptions(artifact, actors).reverse()) { + gateways.push(await startPreviewGateway({ ...shared, ...options })) + } + } } catch (error) { - await privateHost.close() + await Promise.all([...gateways.map(gateway => gateway.close()), privateHost.close()]) throw error } let closing function close() { - closing ??= Promise.all([gateway.close(), privateHost.close()]).catch(() => { + closing ??= Promise.all([...gateways.map(gateway => gateway.close()), privateHost.close()]).catch(() => { console.error('Cannot close the preview listeners cleanly.') process.exitCode = 1 }) diff --git a/clients/typescript/preview/tests/preview.test.mjs b/clients/typescript/preview/tests/preview.test.mjs index f93c37b48c..31bdb81919 100644 --- a/clients/typescript/preview/tests/preview.test.mjs +++ b/clients/typescript/preview/tests/preview.test.mjs @@ -5,9 +5,9 @@ import { join } from 'node:path' import { createServer, request } from 'node:http' import { test } from 'node:test' import { coordinatorBearer, functionHostAuthorizer, startFunctionHost } from '../host.mjs' -import { collectStaticFiles, previewPolicy, startPreviewGateway } from '../gateway.mjs' +import { actorGatewayOptions, collectStaticFiles, compileRoutes, previewPolicy, startPreviewGateway } from '../gateway.mjs' import { configure, prepareRuntimeConfig, readHostKey } from '../config.mjs' -import { buildPreview } from '../build.mjs' +import { buildPreview, generationError, generatorArguments } from '../build.mjs' import { createHash } from 'node:crypto' test('preview policy matches both Record revision parameters without expanding methods or routes', () => { @@ -288,3 +288,296 @@ test('the run host key file must be owner-only, in the run directory, and well f await rm(keyFile) } }) + +test('an actors policy compiles per-product routes and is exclusive with the single-actor form', () => { + const actors = { + applicant: { breg: { post: ['/v1/actions/submit-application'] }, coordinator: { get: ['/v1/runs/{runId}'], post: ['/v1/runs'] } }, + officer: { casework: { get: ['/v1/review-tasks'], post: ['/v1/review-tasks/{taskId}/decisions'] } }, + } + const policy = previewPolicy({ page: '/', functions: ['assess-permit'], actors }) + assert.deepEqual([...policy.actors.keys()], ['applicant', 'officer']) + const run = '00000000-0000-4000-8000-000000000001' + assert.equal(policy.actors.get('applicant').coordinator('GET', '/v1/runs/' + run), true) + assert.equal(policy.actors.get('applicant').coordinator('GET', '/v1/runs/not-a-uuid'), false) + assert.equal(policy.actors.get('officer').casework('POST', '/v1/review-tasks/' + run + '/decisions'), true) + assert.equal(policy.actors.get('officer').breg, undefined) + assert.equal(policy.allowsBreg('GET', '/v1/records/licenses'), false) + for (const invalid of [ + { page: '/', functions: [], actors, breg: {} }, + { page: '/', functions: [] }, + { page: '/', functions: [], actors: {} }, + { page: '/', functions: [], actors: { Applicant: {} } }, + { page: '/', functions: [], actors: { applicant: { messaging: {} } } }, + { page: '/', functions: [], actors: { applicant: { coordinator: { get: ['/v1/runs/{runId}/{taskId}'] } } } }, + ]) { + assert.throws(() => previewPolicy(invalid), JSON.stringify(invalid)) + } + assert.equal(compileRoutes({ get: ['/v1/review-tasks/{taskId}'] })('GET', '/v1/review-tasks/' + run), true) +}) + +test('a gateway relays each product with its own credential, profile and routes', async (t) => { + const root = await mkdtemp(join(tmpdir(), 'registry-preview-products-')) + t.after(() => rm(root, { recursive: true })) + await writeFile(join(root, 'index.html'), '

Page

') + const seen = [] + const upstream = createServer((request, response) => { + seen.push([request.headers.host.split(':')[1], request.url, request.headers.authorization]) + response.writeHead(200, { 'content-type': 'application/json' }).end('{}') + }) + await new Promise(resolve => upstream.listen(0, '127.0.0.1', resolve)) + t.after(() => new Promise(resolve => upstream.close(resolve))) + const other = createServer((request, response) => { + seen.push(['other', request.url, request.headers.authorization]) + response.writeHead(403, { 'content-type': 'application/json' }).end('{"code":"profile.not-authorized"}') + }) + await new Promise(resolve => other.listen(0, '127.0.0.1', resolve)) + t.after(() => new Promise(resolve => other.close(resolve))) + const origin = server => 'http://127.0.0.1:' + server.address().port + const gateway = await startPreviewGateway({ + origin: null, port: 0, application: 'http://127.0.0.1:1', publicDirectory: root, + preview: { page: '/', functions: ['assess-permit'], actors: { applicant: {} } }, + actor: 'applicant', + functionAuthorization: () => 'Bearer applicant.breg', + products: { + 'permit-flow': { origin: origin(upstream), profile: null, authorization: () => 'Bearer applicant.coordinator', + allows: compileRoutes({ post: ['/v1/runs'] }) }, + 'permit-review': { origin: origin(other), profile: 'permit-requester', authorization: () => 'Bearer applicant.casework', + allows: compileRoutes({ post: ['/v1/review-tasks/{taskId}/decisions'] }) }, + }, + }) + t.after(() => gateway.close()) + const headers = { origin: gateway.origin, 'registry-client': 'page', 'content-type': 'application/json' } + const post = path => fetch(gateway.origin + path, { method: 'POST', headers, body: '{}' }) + assert.equal((await post('/registry/permit-flow/v1/runs')).status, 200) + assert.equal((await post('/registry/permit-flow/v1/runs?accessProfile=x')).status, 404) + assert.equal((await post('/registry/permit-flow/v1/other')).status, 404) + const task = '00000000-0000-4000-8000-000000000002' + const refused = await post('/registry/permit-review/v1/review-tasks/' + task + '/decisions') + // The owning product's own refusal reaches the page unchanged. + assert.equal(refused.status, 403) + assert.equal((await refused.json()).code, 'profile.not-authorized') + assert.equal((await post('/registry/permit-review/v1/review-tasks/' + task + '/decisions?accessProfile=permit-officer')).status, 403) + assert.equal((await post('/registry/unknown/v1/runs')).status, 404) + // The page learns which actor this origin serves, and nothing else. + const actor = await fetch(gateway.origin + '/_rstack/actor', { headers: { 'registry-client': 'page' } }) + assert.equal(actor.status, 200) + assert.deepEqual(await actor.json(), { actor: 'applicant' }) + assert.equal((await fetch(gateway.origin + '/_rstack/actor')).status, 403) + for (const foreign of [{ origin: 'http://127.0.0.1:1' }, { 'sec-fetch-site': 'cross-site' }]) { + const answer = await fetch(gateway.origin + '/_rstack/actor', { headers: { 'registry-client': 'page', ...foreign } }) + assert.equal(answer.status, 403, JSON.stringify(foreign)) + } + assert.deepEqual(seen.map(([, url, authorization]) => [url, authorization]), [ + ['/v1/runs', 'Bearer applicant.coordinator'], + ['/v1/review-tasks/' + task + '/decisions?accessProfile=permit-requester', 'Bearer applicant.casework'], + ]) +}) + +test('prepare checks each actor origin, product, profile and credential against the plan', async (t) => { + const root = await mkdtemp(join(tmpdir(), 'registry-preview-actors-')) + t.after(() => rm(root, { recursive: true })) + const deployment = join(root, 'service.yaml') + await writeFile(deployment, 'service declaration') + const declarationDigest = createHash('sha256').update('service declaration').digest('hex') + const artifact = { + declarationDigest, + product: { id: 'permits', member: 'permits', audience: 'urn:permits', profile: 'permit-applicant' }, + routeProducts: [ + { id: 'casework', kind: 'casework', audience: 'urn:review' }, + { id: 'permit-flow', kind: 'coordinator', audience: 'urn:flow' }, + ], + preview: { page: '/', functions: ['assess-permit'], actors: { + applicant: { breg: { post: ['/v1/actions/submit-application'] }, coordinator: { post: ['/v1/runs'] } }, + officer: { casework: { get: ['/v1/review-tasks'] } }, + } }, + } + const file = name => join(root, name) + const run = { + schema: 'registry-stack.local-service-preview/v1', + runId: 'fixture-run', origin: 'http://127.0.0.1:23456', port: 23456, insecureLocal: true, + breg: { baseUrl: 'http://127.0.0.1:34567', audience: 'urn:permits' }, + preview: { + productId: 'permits', profile: 'permit-applicant', declarationDigest, + functionHost: { port: 45678, keyFile: file('key') }, + actors: [ + { name: 'applicant', origin: 'http://127.0.0.1:23456', port: 23456, products: { + permits: { baseUrl: 'http://127.0.0.1:34567', audience: 'urn:permits', profile: 'permit-applicant', authorizationFile: file('a-breg') }, + 'permit-flow': { baseUrl: 'http://127.0.0.1:34568', audience: 'urn:flow', profile: null, authorizationFile: file('a-flow') }, + } }, + { name: 'officer', origin: 'http://127.0.0.1:23457', port: 23457, products: { + permits: { baseUrl: 'http://127.0.0.1:34567', audience: 'urn:permits', profile: 'permit-reader', authorizationFile: file('o-breg') }, + casework: { baseUrl: 'http://127.0.0.1:34569', audience: 'urn:review', profile: 'permit-officer', authorizationFile: file('o-casework') }, + } }, + ], + }, + } + const valid = await prepareRuntimeConfig({ artifact, deployment, run }) + assert.equal(valid.preview.actors.length, 2) + const changed = change => { + const copy = structuredClone(run) + change(copy.preview.actors) + return copy + } + for (const [invalid, message] of [ + [changed(actors => actors.reverse()), /actors differ from the checked plan/u], + [changed(actors => { actors[0].port = 23458; actors[0].origin = 'http://127.0.0.1:23458' }), /first preview actor must serve the run origin/u], + [changed(actors => { actors[1].port = 23456; actors[1].origin = 'http://127.0.0.1:23456' }), /own reserved loopback address/u], + [changed(actors => { actors[1].port = 45678; actors[1].origin = 'http://127.0.0.1:45678' }), /own reserved loopback address/u], + [changed(actors => { delete actors[1].products.casework }), /reaches a product it has no credential for/u], + [changed(actors => { actors[0].products['permit-flow'].profile = 'permit-starter' }), /actor product differs from the checked plan/u], + [changed(actors => { actors[1].products.casework.profile = null }), /actor product differs from the checked plan/u], + [changed(actors => { actors[1].products.casework.audience = 'urn:other' }), /actor product differs from the checked plan/u], + [changed(actors => { actors[1].products.casework.authorizationFile = 'relative' }), /actor product differs from the checked plan/u], + [changed(actors => { actors[1].products.casework.baseUrl = 'http://127.0.0.1:23457' }), /product on the actor's own origin/u], + [changed(actors => { actors[1].products.unknown = actors[1].products.casework }), /product the plan does not route/u], + [{ ...run, preview: { ...run.preview, authorizationFile: file('single') } }, /takes no single authorization file/u], + ]) { + await assert.rejects(prepareRuntimeConfig({ artifact, deployment, run: invalid }), message) + } + // The single-actor form takes no actors list. + const single = { ...artifact, preview: { page: '/', functions: [], breg: {} } } + await assert.rejects(prepareRuntimeConfig({ artifact: single, deployment, run }), /single-actor preview takes no actors/u) +}) + +test('configure refuses an actor credential file that is not owner-only or is a link', async t => { + const root = await mkdtemp(join(tmpdir(), 'registry-preview-actor-files-')) + t.after(() => rm(root, { recursive: true })) + const deployment = join(root, 'service.yaml') + await writeFile(deployment, 'service declaration') + const declarationDigest = createHash('sha256').update('service declaration').digest('hex') + const artifact = { + declarationDigest, + product: { id: 'permits', member: 'permits', audience: 'urn:permits', profile: 'permit-applicant' }, + routeProducts: [], + preview: { page: '/', functions: [], actors: { applicant: { breg: { get: ['/v1/records/permits'] } } } }, + } + const file = name => join(root, name) + const runFile = file('application-run.json') + await writeFile(runFile, JSON.stringify({ + schema: 'registry-stack.local-service-preview/v1', + runId: 'fixture-run', origin: 'http://127.0.0.1:23456', port: 23456, insecureLocal: true, + breg: { baseUrl: 'http://127.0.0.1:34567', audience: 'urn:permits' }, + preview: { + productId: 'permits', profile: 'permit-applicant', declarationDigest, + functionHost: { port: 45678, keyFile: file('key') }, + actors: [{ name: 'applicant', origin: 'http://127.0.0.1:23456', port: 23456, products: { + permits: { baseUrl: 'http://127.0.0.1:34567', audience: 'urn:permits', profile: 'permit-applicant', authorizationFile: file('a-breg') }, + } }], + }, + })) + await writeFile(file('key'), 'synthetic-function-host-key-0123456789abcdefghij\n', { mode: 0o600 }) + await writeFile(file('a-breg'), 'Authorization: Bearer applicant.permits\n', { mode: 0o600 }) + await configure({ artifact, deployment, runFile }) + await chmod(file('a-breg'), 0o640) + await assert.rejects(configure({ artifact, deployment, runFile }), /owner-only/u) + await rm(file('a-breg')) + await writeFile(file('elsewhere'), 'Authorization: Bearer applicant.permits\n', { mode: 0o600 }) + await symlink(file('elsewhere'), file('a-breg')) + await assert.rejects(configure({ artifact, deployment, runFile }), /owner-only/u) +}) + +test('each actor gateway carries only its own credentials and routes', async t => { + const root = await mkdtemp(join(tmpdir(), 'registry-preview-isolation-')) + t.after(() => rm(root, { recursive: true })) + await writeFile(join(root, 'index.html'), '

Page

') + const seen = [] + const upstream = createServer((request, response) => { + seen.push([request.url, request.headers.authorization]) + response.writeHead(200, { 'content-type': 'application/json' }).end('{}') + }) + await new Promise(resolve => upstream.listen(0, '127.0.0.1', resolve)) + t.after(() => new Promise(resolve => upstream.close(resolve))) + const base = 'http://127.0.0.1:' + upstream.address().port + const artifact = { + product: { id: 'permits', audience: 'urn:permits', profile: 'permit-applicant' }, + routeProducts: [ + { id: 'casework', kind: 'casework', audience: 'urn:review' }, + { id: 'permit-flow', kind: 'coordinator', audience: 'urn:flow' }, + ], + preview: { page: '/', functions: ['assess-permit'], actors: { + applicant: { breg: { post: ['/v1/actions/submit-application'] }, coordinator: { post: ['/v1/runs'] } }, + officer: { casework: { get: ['/v1/review-tasks'] } }, + } }, + } + const credential = async (name, id) => { + const path = join(root, name + '-' + id) + await writeFile(path, 'Authorization: Bearer ' + name + '.' + id + '\n', { mode: 0o600 }) + return path + } + const product = async (name, id, profile) => ({ baseUrl: base, audience: 'urn:' + id, profile, authorizationFile: await credential(name, id) }) + const actors = [ + { name: 'applicant', origin: null, port: 0, products: { + permits: await product('applicant', 'permits', 'permit-applicant'), + 'permit-flow': await product('applicant', 'permit-flow', null), + } }, + { name: 'officer', origin: null, port: 0, products: { + permits: await product('officer', 'permits', 'permit-reader'), + casework: await product('officer', 'casework', 'permit-officer'), + } }, + ] + const options = actorGatewayOptions(artifact, actors) + assert.deepEqual(options.map(option => option.actor), ['applicant', 'officer']) + const gateways = {} + for (const option of options) { + gateways[option.actor] = await startPreviewGateway({ + ...option, application: base, publicDirectory: root, preview: artifact.preview, functionKey: 'k'.repeat(32), + }) + t.after(() => gateways[option.actor].close()) + } + const call = async (name, method, path) => { + const gateway = gateways[name] + const response = await fetch(gateway.origin + path, { + method, headers: { origin: gateway.origin, 'registry-client': 'page', 'content-type': 'application/json' }, + body: method === 'POST' ? '{}' : undefined, + }) + return response.status + } + assert.equal(await call('applicant', 'POST', '/registry/permits/v1/actions/submit-application'), 200) + assert.equal(await call('applicant', 'POST', '/registry/permit-flow/v1/runs'), 200) + assert.equal(await call('applicant', 'GET', '/registry/casework/v1/review-tasks'), 404) + assert.equal(await call('applicant', 'POST', '/api/functions/assess-permit'), 200) + assert.equal(await call('officer', 'GET', '/registry/casework/v1/review-tasks'), 200) + assert.equal(await call('officer', 'POST', '/registry/permit-flow/v1/runs'), 404) + assert.equal(await call('officer', 'POST', '/registry/permits/v1/actions/submit-application'), 404) + assert.equal(await call('officer', 'POST', '/api/functions/assess-permit'), 200) + assert.deepEqual(seen, [ + ['/v1/actions/submit-application?accessProfile=permit-applicant', 'Bearer applicant.permits'], + ['/v1/runs', 'Bearer applicant.permit-flow'], + ['/functions/assess-permit', 'Bearer applicant.permits'], + ['/v1/review-tasks?accessProfile=permit-officer', 'Bearer officer.casework'], + ['/functions/assess-permit', 'Bearer officer.permits'], + ]) +}) + +test('a gateway without a function credential serves no function route', async t => { + const root = await mkdtemp(join(tmpdir(), 'registry-preview-nofunction-')) + t.after(() => rm(root, { recursive: true })) + await writeFile(join(root, 'index.html'), '

Page

') + const gateway = await startPreviewGateway({ + origin: null, port: 0, application: 'http://127.0.0.1:1', publicDirectory: root, + preview: { page: '/', functions: ['assess-permit'], actors: { officer: {} } }, + actor: 'officer', functionAuthorization: null, + products: { casework: { origin: 'http://127.0.0.1:2', profile: 'permit-officer', + authorization: () => 'Bearer officer.casework', allows: compileRoutes({}) } }, + }) + t.after(() => gateway.close()) + const answer = await fetch(gateway.origin + '/api/functions/assess-permit', { + method: 'POST', headers: { origin: gateway.origin, 'registry-client': 'page', 'content-type': 'application/json' }, body: '{}', + }) + assert.equal(answer.status, 404) +}) + +test('an actors preview names no Proposal author and refuses a register with Proposals', () => { + const product = { id: 'permits', member: 'permits', project: '/project', profile: 'permit-applicant' } + const single = generatorArguments({ product, preview: { functions: ['assess-permit'] } }, '/staged') + assert.deepEqual(single.slice(single.indexOf('--author-profile'), single.indexOf('--author-profile') + 2), + ['--author-profile', 'permits=permit-applicant']) + const actors = generatorArguments({ product, preview: { functions: ['assess-permit'], actors: { applicant: {} } } }, '/staged') + assert.equal(actors.includes('--author-profile'), false) + assert.match(generationError('The register permits has Proposals, so the service description needs authorProfiles.', true).message, + /actors preview cannot start Proposals/u) + assert.match(generationError('The authorProfile "x" cannot start Proposals in permits.', false).message, + /Select a preview actor whose BReg profile can start Proposals/u) + assert.equal(generationError('generator diagnostic', true).message, 'generator diagnostic') + assert.match(generationError('', true).message, /Preview client generation failed/u) +}) diff --git a/clients/typescript/tests/generate-preview.test.ts b/clients/typescript/tests/generate-preview.test.ts index dfc1e43ffc..e9c19f0cc0 100644 --- a/clients/typescript/tests/generate-preview.test.ts +++ b/clients/typescript/tests/generate-preview.test.ts @@ -43,6 +43,9 @@ test('preview generation splits page and function bindings and keeps request cre const refused = generateFrom(facility, '--author-profile', 'licences=facility-reader') assert.equal(refused.status, 1) assert.match(refused.stderr, /cannot start Proposals/u) + const unnamed = generateFrom(facility) + assert.equal(unnamed.status, 1) + assert.match(unnamed.stderr, /has Proposals, so the service description needs authorProfiles/u) const duplicate = generate('--preview-function', 'renew', '--preview-function', 'renew') assert.equal(duplicate.status, 1) assert.match(duplicate.stderr, /duplicate preview function/iu) diff --git a/crates/registry-coordinator/src/adapters.rs b/crates/registry-coordinator/src/adapters.rs index c480822a6f..ae7a1901c8 100644 --- a/crates/registry-coordinator/src/adapters.rs +++ b/crates/registry-coordinator/src/adapters.rs @@ -474,18 +474,25 @@ fn distinct_function_keys( secrets: ®istry_platform_config::SecretResolver, ) -> Result<()> { use sha2::Digest as _; + // Key files may hold binary material with NUL bytes, so compare bytes. let identity = |reference: ®istry_platform_config::SecretReference| -> Result { let secret = secrets - .resolve_reference(reference) + .resolve_binary_reference(reference) .map_err(|_| config_error())?; let bytes = secret.expose_secret(); let jwk = std::str::from_utf8(bytes) .ok() .and_then(|text| PrivateJwk::parse(text).ok()) .and_then(|key| key.public().jkt().ok()); + // A host key is sent without its trailing newlines, so bytes compare + // in that form: a file differing only by them holds the same key. + let trimmed = bytes + .iter() + .rposition(|byte| *byte != b'\n') + .map_or(&bytes[..0], |last| &bytes[..=last]); Ok(match jwk { Some(thumbprint) => format!("jwk:{thumbprint}"), - None => format!("bytes:{}", hex::encode(sha2::Sha256::digest(bytes))), + None => format!("bytes:{}", hex::encode(sha2::Sha256::digest(trimmed))), }) }; let mut functions = Vec::new(); @@ -513,7 +520,7 @@ fn distinct_function_keys( if let Some((other, _)) = others.iter().find(|(_, value)| value == key) { return Err(CoordinatorError::new( "coordinator.runtime-config.refused", - format!("connections {function} and {other} resolve to the same key; a service function host must hold a key nothing else in this runtime uses"), + format!("connection {function} and {other} resolve to the same key; a service function host must hold a key nothing else in this runtime uses"), ) .at("runtime.yaml", format!("/connections/{function}")) .suggest(format!("Give connections.{function} its own key, distinct from {other}."))); diff --git a/crates/registry-coordinator/src/error.rs b/crates/registry-coordinator/src/error.rs index a7fcd29a1a..e9c774accd 100644 --- a/crates/registry-coordinator/src/error.rs +++ b/crates/registry-coordinator/src/error.rs @@ -24,6 +24,10 @@ pub struct CoordinatorError { pub(crate) refusal_detail: Option>, /// Whether this refusal rejected a development-marked token in production. pub(crate) development_assertion: bool, + /// Whether `diagnostics` is this error's own diagnostic, built only to + /// carry related locations, and so rebuilt when its position or remedy + /// changes. + pub(crate) related_only: bool, } #[derive(Debug)] @@ -48,6 +52,7 @@ impl CoordinatorError { check: None, refusal_detail: None, development_assertion: false, + related_only: false, } } /// Preserve all shared-reader findings and their authored positions. @@ -83,6 +88,7 @@ impl CoordinatorError { check: None, refusal_detail: None, development_assertion: false, + related_only: false, } } /// Name the check that refused the caller. @@ -166,13 +172,54 @@ impl CoordinatorError { } Report::new(vec![diagnostic]) } - pub fn at(mut self, file: impl Into, field: impl Into) -> Self { - self.file = Some(Box::new(file.into())); - self.field = Some(field.into().into_boxed_str()); - self + pub fn at(self, file: impl Into, field: impl Into) -> Self { + self.keeping_related(|error| { + error.file = Some(Box::new(file.into())); + error.field = Some(field.into().into_boxed_str()); + }) + } + pub fn suggest(self, action: impl Into) -> Self { + self.keeping_related(|error| { + error.suggested_action = Some(action.into().into_boxed_str()); + }) } - pub fn suggest(mut self, action: impl Into) -> Self { - self.suggested_action = Some(action.into().into_boxed_str()); + /// Apply `change` and keep any related locations already named. + fn keeping_related(mut self, change: impl FnOnce(&mut Self)) -> Self { + let related = if self.related_only { + self.related_only = false; + let diagnostics = std::mem::take(&mut self.diagnostics); + diagnostics + .into_vec() + .into_iter() + .next() + .map(|diagnostic| diagnostic.related) + } else { + None + }; + change(&mut self); + related.into_iter().flatten().fold(self, |error, related| { + error.related(&related.file, &related.path, related.message) + }) + } + /// Name another location that takes part in this refusal. It is reported + /// with the refusal whatever position or remedy is set before or after. + #[must_use] + pub(crate) fn related(mut self, file: &str, pointer: &str, message: impl Into) -> Self { + if self.diagnostics.is_empty() { + self.diagnostics = self.report().diagnostics().to_vec().into(); + self.related_only = true; + } + let mut diagnostics = std::mem::take(&mut self.diagnostics).into_vec(); + if let Some(first) = diagnostics.first_mut() { + first.related.push(registry_platform_yaml::Related { + file: file.to_owned(), + line: None, + column: None, + path: pointer.to_owned(), + message: message.into(), + }); + } + self.diagnostics = diagnostics.into(); self } fn render(&self) -> String { @@ -197,3 +244,26 @@ impl CoordinatorError { } pub type Result = std::result::Result; + +#[cfg(test)] +mod related_tests { + use super::*; + + #[test] + fn a_related_location_survives_any_later_position_or_remedy() { + let error = CoordinatorError::new("workflow-binding", "the function is not bound") + .related( + "runtime.yaml", + "/connections/notices/function", + "the bound function", + ) + .at("workflow.yaml", "/operations/draft/serviceFunction") + .suggest("Bind the function."); + let report = error.report(); + let diagnostic = &report.diagnostics()[0]; + assert_eq!(diagnostic.path, "/operations/draft/serviceFunction"); + assert_eq!(diagnostic.suggested_action, "Bind the function."); + assert_eq!(diagnostic.related.len(), 1); + assert_eq!(diagnostic.related[0].path, "/connections/notices/function"); + } +} diff --git a/crates/registry-coordinator/src/project_check.rs b/crates/registry-coordinator/src/project_check.rs index 3d525d6182..f6ac57909a 100644 --- a/crates/registry-coordinator/src/project_check.rs +++ b/crates/registry-coordinator/src/project_check.rs @@ -126,6 +126,13 @@ fn workflow_binding_diagnostics( format!("/{}", field.replace('.', "/")) } }); + // A related runtime location the refusal names keeps its position here. + let related: Vec<(String, String)> = error + .diagnostics + .iter() + .flat_map(|diagnostic| diagnostic.related.iter()) + .map(|related| (related.path.clone(), related.message.clone())) + .collect(); let mut diagnostic = checked.error_at( runtime::KIND, "coordinator.runtime.workflow-binding", @@ -135,6 +142,9 @@ fn workflow_binding_diagnostics( "Use the same logical connection name in the project and runtime.".into() }), ); + for (path, message) in related { + checked.add_related_key(&mut diagnostic, &path, message); + } // A missing member has no span. Anchor it to its nearest existing runtime // container while retaining the missing path. if diagnostic diff --git a/crates/registry-coordinator/src/runtime.rs b/crates/registry-coordinator/src/runtime.rs index 13f6c8c10d..b0dff6dff4 100644 --- a/crates/registry-coordinator/src/runtime.rs +++ b/crates/registry-coordinator/src/runtime.rs @@ -1351,7 +1351,12 @@ impl RuntimeConfig { .suggest(format!( "Name the function bound as connections.{}.function in runtime.yaml, or add one service-function connection for this function.", call.connection - ))); + )) + .related( + "runtime.yaml", + &pointer(&format!("connections.{}.function", call.connection)), + "the function the connection binds", + )); } } if call.operation == crate::protocol::Operation::ExternalCommand diff --git a/crates/registry-coordinator/tests/service_function.rs b/crates/registry-coordinator/tests/service_function.rs index d512776a92..4b7b2ad10b 100644 --- a/crates/registry-coordinator/tests/service_function.rs +++ b/crates/registry-coordinator/tests/service_function.rs @@ -907,6 +907,45 @@ fn rotating_the_host_key_keeps_the_binding_and_changing_the_credential_kind_does ); } +#[test] +fn a_binary_key_elsewhere_in_the_runtime_does_not_stop_a_function_host_from_starting() { + // Binary key files hold random bytes, NUL included. Comparing the + // function host key with them must read them as bytes, not as text. + let mut document = host_key_document("http://127.0.0.1:9020/"); + document["connections"] + .as_object_mut() + .unwrap() + .remove("registry"); + document["connections"]["review"] = json!({ + "type":"casework-review-producer", "baseUrl":"http://127.0.0.1:9022", + "profile":"coordinator-producer", "producer":"coordinator", + "authorization":{ + "tokenEndpoint":"http://127.0.0.1:9999/token", + "clientAssertionAudience":"http://127.0.0.1:9999", + "clientId":"coordinator-producer", + "signingKeyRef":"secret:file/review-client-key", + "resource":"urn:example:review", + "scopes":["casework:review"] + }, + "completion":{ + "recipientBinding":"coordinator-v1", + "hmacSha256KeyRef":"secret:file/review-completion-key" + } + }); + let (_root, config) = with_secrets( + &document, + &[ + ("function-host-key", "synthetic-function-host-key-canary"), + ("review-client-key", KEY), + ( + "review-completion-key", + "binary\0completion-key-0123456789abcdef", + ), + ], + ); + registry_coordinator::adapters::HttpAdapters::new(&config).unwrap(); +} + #[test] fn the_same_host_key_or_jwk_under_another_form_is_refused_at_startup() { const HOST_KEY: &str = "synthetic-function-host-key-canary"; @@ -925,6 +964,22 @@ fn the_same_host_key_or_jwk_under_another_form_is_refused_at_startup() { .expect("one host key behind two references is refused"); assert!(error.message.contains("decide"), "{error:?}"); + // The host key is sent without its trailing newline, so a file that + // differs only by that newline holds the same key. + let host_key_line = format!("{HOST_KEY}\n"); + let (_root, config) = with_secrets( + &document, + &[ + ("function-host-key", &host_key_line), + ("decision-token", HOST_KEY), + ("registry-client-key", KEY), + ], + ); + let error = registry_coordinator::adapters::HttpAdapters::new(&config) + .err() + .expect("a host key and the same key without its newline are refused"); + assert!(error.message.contains("decide"), "{error:?}"); + // The same JWK written again with its members in another order and // spacing is the same key. let parsed: serde_json::Map = serde_json::from_str(KEY).unwrap(); diff --git a/crates/registry-coordinator/tests/service_function_project.rs b/crates/registry-coordinator/tests/service_function_project.rs index 909eac0195..f6d76b4f9e 100644 --- a/crates/registry-coordinator/tests/service_function_project.rs +++ b/crates/registry-coordinator/tests/service_function_project.rs @@ -225,6 +225,12 @@ fn an_unbound_function_name_is_refused_against_the_runtime_binding() { let unbound = binding_finding(&RUNTIME.replace("function: draft-notice", "function: publish-notice")); assert_eq!(unbound["path"], "/operations/draft-notice/serviceFunction"); + assert!( + unbound["related"].as_array().is_some_and(|related| related + .iter() + .any(|other| other["path"] == "/connections/notices/function")), + "{unbound}" + ); assert!( unbound["message"] .as_str() diff --git a/crates/registry-rstack-dev/src/bindings.rs b/crates/registry-rstack-dev/src/bindings.rs index cf07d0a5d3..3a2bef870a 100644 --- a/crates/registry-rstack-dev/src/bindings.rs +++ b/crates/registry-rstack-dev/src/bindings.rs @@ -1,7 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -//! Run-local bindings between BReg and Casework. +//! Run-local bindings between the products of one development run: BReg and +//! Casework, and the Coordinator's Casework review producer and BReg client. //! -//! The token endpoint exists only for one development run. It accepts the two +//! The token endpoint exists only for one development run. It accepts the //! machine identities the plan explicitly binds, verifies their private-key //! JWT assertions, and mints the same bounded product token a named test person //! would receive. Keys, tokens, and assertion identifiers never enter reports @@ -60,7 +61,7 @@ const TOKEN_LIFETIME_SECONDS: u64 = 300; const TOKEN_SERVER_SHUTDOWN_GRACE: Duration = Duration::from_secs(2); const CLOCK_LEEWAY_SECONDS: u64 = 5; -/// Run-local connections between BReg and Casework. Configuring either one requires both products. +/// Run-local connections between products. The BReg and Casework bindings require both products; the Coordinator review producer requires Coordinator and Casework. #[derive(Default, Deserialize, Serialize)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[serde(rename_all = "camelCase", deny_unknown_fields)] @@ -71,6 +72,51 @@ pub(super) struct Bindings { /// Connects Casework to BReg as a context provider. Casework authenticates to BReg as a machine identity. #[serde(default, skip_serializing_if = "Option::is_none")] pub(super) casework_context_provider: Option, + /// Connects the Coordinator to Casework as one trusted review producer. The Coordinator authenticates to Casework as a machine identity, and Casework wakes its waiting run through a completion hook. Development runs only. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub(super) coordinator_review_producer: Option, + /// Gives one Coordinator BReg connection a machine identity on the run's token endpoint, with exactly one test person's BReg grant. BReg's own access profile and Action rules decide every call. Development runs only. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub(super) coordinator_breg_client: Option, +} + +/// One Coordinator `breg` connection the run authenticates as one test +/// person. The person's BReg grant is the only source of the connection's +/// profile and scopes; nothing in dev.yaml adds to them. +#[derive(Deserialize, Serialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub(super) struct CoordinatorBregClient { + /// The Coordinator `runtime.yaml` connection of type `breg`, without task authority. + #[cfg_attr(feature = "schema", schemars(with = "registry_platform_yaml::LocalId"))] + pub(super) connection: String, + /// Name of the test person, in `people`, whose BReg grant the Coordinator uses. + #[cfg_attr(feature = "schema", schemars(with = "registry_platform_yaml::LocalId"))] + pub(super) identity: String, +} + +/// The Coordinator's Casework review producer connection that the run binds +/// to Casework. Casework trusts exactly the producer the connection names, for +/// the run issuer, only when its pinned issuer, profile and subject match the +/// guards; nothing here widens what Casework trusts. +#[derive(Deserialize, Serialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub(super) struct CoordinatorReviewProducer { + /// The Coordinator `runtime.yaml` connection of type `casework-review-producer`. Its `producer` names the Casework trusted producer. + #[cfg_attr(feature = "schema", schemars(with = "registry_platform_yaml::LocalId"))] + pub(super) connection: String, + /// The Casework trusted producer in `casework.yaml`. It must be the producer the connection names. + #[cfg_attr(feature = "schema", schemars(with = "registry_platform_yaml::LocalId"))] + pub(super) producer: String, + /// Name of the test person, in `people`, whose Casework grant the Coordinator uses to authenticate. Its profile and subject are the producer's. + #[cfg_attr(feature = "schema", schemars(with = "registry_platform_yaml::LocalId"))] + pub(super) identity: String, + /// The completion `destinationId` the producer names in `casework.yaml`. The run binds it to the Coordinator's completion endpoint with a per-run key. + #[cfg_attr(feature = "schema", schemars(with = "registry_platform_yaml::LocalId"))] + pub(super) completion_destination: String, + /// The exact source guards for binding this producer to the synthetic run issuer. It has no initiator guard. + pub(super) run_issuer_binding: ProducerIssuerBinding, } /// A BReg review authority that the run connects to Casework. @@ -104,6 +150,15 @@ pub(super) struct RunIssuerBinding { #[serde(default, skip_serializing_if = "Option::is_none")] pub initiator: Option, } +/// The run issuer guards of a binding that rebinds a producer only, never an +/// initiator. +#[derive(Deserialize, Serialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub(super) struct ProducerIssuerBinding { + pub producer: RunProducer, +} + #[derive(Deserialize, Serialize)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[serde(rename_all = "camelCase", deny_unknown_fields)] @@ -149,9 +204,16 @@ impl Bindings { self.breg_review_authority .as_ref() .is_some_and(|binding| binding.run_issuer_binding.is_some()) + || self.coordinator_review_producer.is_some() } pub(super) fn validate(&self, plan: &Plan) -> plan::SemanticResult<()> { + if let Some(binding) = &self.coordinator_review_producer { + validate_coordinator_review_producer(plan, binding)?; + } + if let Some(binding) = &self.coordinator_breg_client { + validate_coordinator_breg_client(plan, binding)?; + } if self.breg_review_authority.is_none() && self.casework_context_provider.is_none() { return Ok(()); } @@ -207,6 +269,115 @@ impl Bindings { } } +const COORDINATOR_BREG_CLIENT: &str = "/bindings/coordinatorBregClient"; + +fn validate_coordinator_breg_client( + plan: &Plan, + binding: &CoordinatorBregClient, +) -> plan::SemanticResult<()> { + plan::require( + product_position(plan, Product::Coordinator).is_some() + && product_position(plan, Product::Breg).is_some(), + "/bindings", + "The Coordinator BReg client binding requires the Coordinator and BReg products.", + "Add both products to products, or remove bindings.coordinatorBregClient.", + )?; + plan::require( + plan::identifier(&binding.connection), + &format!("{COORDINATOR_BREG_CLIENT}/connection"), + "The value must be a local identifier.", + "Set it to a lowercase local identifier of at most 64 characters.", + )?; + require_machine_person( + plan, + &binding.identity, + Product::Breg, + &format!("{COORDINATOR_BREG_CLIENT}/identity"), + )?; + // BReg attributes every Coordinator call to this person, so no other + // binding or preview actor may act as it. + let shared = [ + plan.bindings + .breg_review_authority + .as_ref() + .map(|other| other.identity.as_str()), + plan.bindings + .casework_context_provider + .as_ref() + .map(|other| other.identity.as_str()), + plan.bindings + .coordinator_review_producer + .as_ref() + .map(|other| other.identity.as_str()), + ] + .into_iter() + .flatten() + .chain( + plan.preview + .iter() + .flat_map(|preview| preview.actor_names()), + ) + .any(|other| other == binding.identity); + plan::require( + !shared, + &format!("{COORDINATOR_BREG_CLIENT}/identity"), + "The Coordinator's BReg identity must be a dedicated machine person that no other binding or preview actor uses.", + "Declare a separate test person for the Coordinator's BReg grant.", + )?; + // The run-local token endpoint signs with the run's key, which BReg + // trusts only through the run's own key set. + plan::require( + plan.jwks_uri().is_none(), + COORDINATOR_BREG_CLIENT, + "The Coordinator BReg client binding needs the run's own key set, so it cannot use externalJwksUri.", + "Remove externalJwksUri, or remove bindings.coordinatorBregClient.", + ) +} + +const COORDINATOR_PRODUCER: &str = "/bindings/coordinatorReviewProducer"; + +fn validate_coordinator_review_producer( + plan: &Plan, + binding: &CoordinatorReviewProducer, +) -> plan::SemanticResult<()> { + plan::require( + product_position(plan, Product::Coordinator).is_some() + && product_position(plan, Product::Casework).is_some(), + "/bindings", + "The Coordinator review producer binding requires the Coordinator and Casework products.", + "Add both products to products, or remove bindings.coordinatorReviewProducer.", + )?; + // Two machine identities never act as one Casework producer. + plan::require( + plan.bindings + .breg_review_authority + .as_ref() + .is_none_or(|other| other.producer != binding.producer), + &format!("{COORDINATOR_PRODUCER}/producer"), + "The BReg review authority binding already binds this Casework producer.", + "Bind a separate trusted producer for the Coordinator.", + )?; + for (member, value) in [ + ("connection", &binding.connection), + ("producer", &binding.producer), + ("completionDestination", &binding.completion_destination), + ] { + plan::require( + plan::identifier(value), + &format!("{COORDINATOR_PRODUCER}/{member}"), + "The value must be a local identifier.", + "Set it to a lowercase local identifier of at most 64 characters.", + )?; + } + require_machine_person( + plan, + &binding.identity, + Product::Casework, + &format!("{COORDINATOR_PRODUCER}/identity"), + ) + .map(|_| ()) +} + fn product_position(plan: &Plan, product: Product) -> Option { plan.products .iter() @@ -415,6 +586,14 @@ struct TokenServer { } const BREG_REVIEW_CLIENT: &str = "breg-review-client"; +const COORDINATOR_REVIEW_CLIENT: &str = "coordinator-review-client"; +const COORDINATOR_BREG_CLIENT_FILE: &str = "coordinator-breg-client"; +/// The run file holding the HMAC key Casework signs a Coordinator review +/// completion with and the Coordinator verifies it with. +pub(super) const COORDINATOR_COMPLETION_KEY: &str = "coordinator-review-completion-key"; +/// The Coordinator's review completion route, as `registry-review-protocol` +/// declares it. rstack dev depends on no product protocol crate. +pub(super) const REVIEW_COMPLETIONS_PATH: &str = "/v1/review-completions"; const CASEWORK_CONTEXT_CLIENT: &str = "casework-context-client"; #[derive(Default)] @@ -435,15 +614,33 @@ impl RuntimeBindings { origins: &BTreeMap, ) -> Result { let bindings = &input.plan.bindings; - if bindings.breg_review_authority.is_none() && bindings.casework_context_provider.is_none() + if bindings.breg_review_authority.is_none() + && bindings.casework_context_provider.is_none() + && bindings.coordinator_review_producer.is_none() + && bindings.coordinator_breg_client.is_none() { return Ok(Self::default()); } bindings.validate(&input.plan)?; ensure!( - origins.contains_key(&Product::Breg) && origins.contains_key(&Product::Casework), + bindings.coordinator_breg_client.is_none() + || (origins.contains_key(&Product::Coordinator) + && origins.contains_key(&Product::Breg)), + "the Coordinator BReg client binding requires reserved Coordinator and BReg origins" + ); + ensure!( + (bindings.breg_review_authority.is_none() + && bindings.casework_context_provider.is_none()) + || (origins.contains_key(&Product::Breg) + && origins.contains_key(&Product::Casework)), "run-local bindings require reserved BReg and Casework origins" ); + ensure!( + bindings.coordinator_review_producer.is_none() + || (origins.contains_key(&Product::Coordinator) + && origins.contains_key(&Product::Casework)), + "the Coordinator review producer binding requires reserved Coordinator and Casework origins" + ); let mut clients = Vec::new(); if let Some(binding) = &bindings.breg_review_authority { @@ -466,6 +663,32 @@ impl RuntimeBindings { &mut clients, )?; } + if let Some(binding) = &bindings.coordinator_review_producer { + prepare_binding( + root, + &input, + &binding.identity, + Product::Casework, + COORDINATOR_REVIEW_CLIENT, + &mut clients, + )?; + // Casework signs each completion with this key and the + // Coordinator verifies it: exact random bytes, owner-only, per run. + let mut key = Zeroizing::new([0_u8; 32]); + getrandom::fill(key.as_mut()) + .map_err(|_| anyhow::anyhow!("cannot generate the review completion key"))?; + write_private(&root.join(COORDINATOR_COMPLETION_KEY), key.as_ref())?; + } + if let Some(binding) = &bindings.coordinator_breg_client { + prepare_binding( + root, + &input, + &binding.identity, + Product::Breg, + COORDINATOR_BREG_CLIENT_FILE, + &mut clients, + )?; + } let server = start_token_server(input.clone(), issuer.clone(), clients)?; Ok(Self { server: Some(server), @@ -529,6 +752,12 @@ fn render( }); } Product::Casework => { + if let Some(binding) = plan.bindings.coordinator_review_producer.as_ref() { + config["destinations"]["hooks"][binding.completion_destination.as_str()] = json!({ + "url": format!("{}{REVIEW_COMPLETIONS_PATH}", origins[&Product::Coordinator]), + "hmacSha256KeyRef": format!("secret:file/{COORDINATOR_COMPLETION_KEY}"), + }); + } let Some(binding) = plan.bindings.casework_context_provider.as_ref() else { return; }; @@ -548,6 +777,69 @@ fn render( "clientAssertionKeyRef": client_assertion_key_ref, }); } + Product::Coordinator => { + if let Some(binding) = plan.bindings.coordinator_breg_client.as_ref() { + if let Some(connection) = config["connections"] + .get_mut(binding.connection.as_str()) + .and_then(Value::as_object_mut) + { + // The grant alone supplies the profile and scopes, and the + // authorization is replaced whole, so no authored member + // such as task authority survives. + let person = &plan.people[&binding.identity]; + let grant = &person.grants[&Product::Breg]; + let (_, signing_key_ref) = client_refs(COORDINATOR_BREG_CLIENT_FILE); + connection.insert("baseUrl".into(), json!(origins[&Product::Breg])); + connection.insert("profile".into(), json!(grant.profile)); + connection.insert( + "authorization".into(), + json!({ + "tokenEndpoint": token_endpoint, + "clientAssertionAudience": issuer, + "clientId": person.client, + "signingKeyRef": signing_key_ref, + "resource": plan.product(Product::Breg).audience, + "scopes": grant.scopes, + }), + ); + } + } + let Some(binding) = plan.bindings.coordinator_review_producer.as_ref() else { + return; + }; + let Some(connection) = config["connections"] + .get_mut(binding.connection.as_str()) + .and_then(Value::as_object_mut) + else { + return; + }; + let person = &plan.people[&binding.identity]; + let grant = &person.grants[&Product::Casework]; + let (_, signing_key_ref) = client_refs(COORDINATOR_REVIEW_CLIENT); + connection.insert("baseUrl".into(), json!(origins[&Product::Casework])); + connection.insert("profile".into(), json!(grant.profile)); + connection.insert( + "authorization".into(), + json!({ + "tokenEndpoint": token_endpoint, + "clientAssertionAudience": issuer, + "clientId": person.client, + "signingKeyRef": signing_key_ref, + "resource": plan.product(Product::Casework).audience, + "scopes": grant.scopes, + }), + ); + if let Some(completion) = connection + .get_mut("completion") + .and_then(Value::as_object_mut) + { + completion.remove("previousHmacSha256KeyRef"); + completion.insert( + "hmacSha256KeyRef".into(), + json!(format!("secret:file/{COORDINATOR_COMPLETION_KEY}")), + ); + } + } // Evidence has no bindings: a caller reaches it with a test token. // Messaging has no bindings: a caller reaches it with a test token. _ => {} @@ -584,6 +876,7 @@ pub(super) fn render_for_check(plan: &Plan, product: Product, config: &mut Value let origins = BTreeMap::from([ (Product::Breg, CHECK_ORIGIN.to_owned()), (Product::Casework, CHECK_ORIGIN.to_owned()), + (Product::Coordinator, CHECK_ORIGIN.to_owned()), ]); render( plan, @@ -1516,6 +1809,8 @@ mod tests { identity: "context-reader".to_owned(), action: "reviewed-change".to_owned(), }), + coordinator_review_producer: None, + coordinator_breg_client: None, }, journey_file: PathBuf::from("dev-journeys.yaml"), schema_test_people: BTreeMap::new(), @@ -2981,4 +3276,579 @@ mod tests { "{error}" ); } + + /// Casework and the Coordinator, with the Coordinator's `review` + /// connection bound as the `coordinator` producer. + fn coordinator_plan() -> Plan { + let mut value = plan(); + value.products = vec![ + ProductPlan { + product: Product::Casework, + project: PathBuf::from("casework"), + audience: "urn:dev:casework".to_owned(), + }, + ProductPlan { + product: Product::Coordinator, + project: PathBuf::from("coordinator"), + audience: "urn:dev:coordinator".to_owned(), + }, + ]; + value.people = BTreeMap::from([( + "coordinator-producer".to_owned(), + TestPerson { + subject: "coordinator-producer".to_owned(), + display_name: None, + client: "coordinator-review-client".to_owned(), + grants: BTreeMap::from([( + Product::Casework, + grant("coordinator-producer", "casework:review"), + )]), + }, + )]); + value.bindings = serde_json::from_value(json!({"coordinatorReviewProducer": { + "connection": "review", "producer": "coordinator", "identity": "coordinator-producer", + "completionDestination": "coordinator-wake", + "runIssuerBinding": {"producer": { + "expectedIssuer": "https://identity.example.test/producer", + "expectedProfile": "coordinator-producer", + "expectedSubject": "coordinator-producer" + }} + }})) + .unwrap(); + value + } + + fn coordinator_origins() -> BTreeMap { + BTreeMap::from([ + (Product::Casework, "http://127.0.0.1:31002".to_owned()), + (Product::Coordinator, "http://127.0.0.1:31003".to_owned()), + ]) + } + + #[test] + fn a_coordinator_review_producer_needs_its_products_identity_and_a_closed_guard() { + let value = coordinator_plan(); + value.bindings.validate(&value).unwrap(); + // The bound Coordinator and Casework pair may use the run issuer. + assert!(value.paired_run_binding()); + let refused = |change: fn(&mut Plan)| { + let mut value = coordinator_plan(); + change(&mut value); + value.bindings.validate(&value).unwrap_err().to_string() + }; + let error = refused(|plan| { + plan.products + .retain(|entry| entry.product != Product::Coordinator) + }); + assert!(error.contains("/bindings"), "{error}"); + let error = refused(|plan| { + plan.people + .get_mut("coordinator-producer") + .unwrap() + .grants + .clear(); + }); + assert!( + error.contains("/bindings/coordinatorReviewProducer/identity"), + "{error}" + ); + // The schema has no initiator member for this binding. + let widened = serde_json::from_value::(json!({"coordinatorReviewProducer": { + "connection": "review", "producer": "coordinator", "identity": "coordinator-producer", + "completionDestination": "coordinator-wake", + "runIssuerBinding": { + "producer": { + "expectedIssuer": "https://identity.example.test/producer", + "expectedProfile": "coordinator-producer", + "expectedSubject": "coordinator-producer" + }, + "initiator": {"expectedIssuer": "https://identity.example.test/people", "trust": "run-test-people"} + } + }})); + assert!(widened.is_err()); + } + + #[test] + fn the_coordinator_review_producer_renders_both_sides_with_one_run_key() { + use std::os::unix::fs::PermissionsExt; + let root = tempfile::tempdir().unwrap(); + let run = Arc::new(input(coordinator_plan())); + let issuer = Arc::new(Issuer::create(root.path()).unwrap()); + let runtime = + RuntimeBindings::prepare(root.path(), run.clone(), issuer, &coordinator_origins()) + .unwrap(); + let endpoint = runtime.server.as_ref().unwrap().endpoint.clone(); + + let mut casework = json!({}); + runtime.configure(Product::Casework, &mut casework); + assert_eq!( + casework["destinations"]["hooks"]["coordinator-wake"], + json!({ + "url": "http://127.0.0.1:31003/v1/review-completions", + "hmacSha256KeyRef": "secret:file/coordinator-review-completion-key" + }) + ); + + let mut coordinator = json!({"connections": { + "review": { + "type": "casework-review-producer", "baseUrl": "http://127.0.0.1:1", + "profile": "coordinator-producer", "producer": "coordinator", + "authorization": {"tokenEndpoint": "http://127.0.0.1:1/token", "clientId": "authored"}, + "completion": {"recipientBinding": "coordinator-v1", "hmacSha256KeyRef": "secret:file/authored"} + }, + "other": {"type": "breg", "baseUrl": "http://127.0.0.1:2"} + }}); + runtime.configure(Product::Coordinator, &mut coordinator); + assert_eq!( + coordinator["connections"]["review"], + json!({ + "type": "casework-review-producer", "baseUrl": "http://127.0.0.1:31002", + "profile": "coordinator-producer", "producer": "coordinator", + "authorization": { + "tokenEndpoint": endpoint, + "clientAssertionAudience": run.plan.issuer, + "clientId": "coordinator-review-client", + "signingKeyRef": "secret:file/coordinator-review-client-key", + "resource": "urn:dev:casework", + "scopes": ["casework:review"] + }, + "completion": { + "recipientBinding": "coordinator-v1", + "hmacSha256KeyRef": "secret:file/coordinator-review-completion-key" + } + }) + ); + assert_eq!( + coordinator["connections"]["other"], + json!({"type": "breg", "baseUrl": "http://127.0.0.1:2"}) + ); + + // One owner-only key of exact random bytes signs and verifies the wake-up. + let key = root.path().join("coordinator-review-completion-key"); + assert_eq!(std::fs::read(&key).unwrap().len(), 32); + assert_eq!( + std::fs::metadata(&key).unwrap().permissions().mode() & 0o777, + 0o600 + ); + + // Without the binding, nothing is rendered for either side. + let mut plain = coordinator_plan(); + plain.bindings = Bindings::default(); + let unbound = RuntimeBindings::prepare( + root.path(), + Arc::new(input(plain)), + Arc::new(Issuer::create(root.path()).unwrap()), + &coordinator_origins(), + ) + .unwrap(); + let mut untouched = json!({"connections": {"review": {"baseUrl": "http://127.0.0.1:1"}}}); + unbound.configure(Product::Coordinator, &mut untouched); + assert_eq!( + untouched, + json!({"connections": {"review": {"baseUrl": "http://127.0.0.1:1"}}}) + ); + } + + #[test] + fn the_coordinator_obtains_a_producer_token_from_the_run_token_server() { + use base64::Engine as _; + let root = tempfile::tempdir().unwrap(); + let mut run = input(coordinator_plan()); + // Casework names the subject claim for each profile it serves. + run.casework_principals + .insert("coordinator-producer".to_owned(), "sub".to_owned()); + let input = Arc::new(run); + let issuer = Arc::new(Issuer::create(root.path()).unwrap()); + let runtime = + RuntimeBindings::prepare(root.path(), input.clone(), issuer, &coordinator_origins()) + .unwrap(); + let mut coordinator = json!({"connections": {"review": { + "type": "casework-review-producer", "producer": "coordinator", + "completion": {"recipientBinding": "coordinator-v1", "hmacSha256KeyRef": "secret:file/authored"} + }}}); + runtime.configure(Product::Coordinator, &mut coordinator); + let authorization = &coordinator["connections"]["review"]["authorization"]; + let encoded = Zeroizing::new( + std::fs::read(root.path().join("coordinator-review-client-key")).unwrap(), + ); + let key = PrivateJwk::parse(std::str::from_utf8(&encoded).unwrap()).unwrap(); + // The client the Coordinator builds from its rendered authorization. + let provider = PrivateKeyJwt::new( + PrivateKeyJwtConfig::new( + authorization["tokenEndpoint"] + .as_str() + .unwrap() + .parse() + .unwrap(), + authorization["clientId"].as_str().unwrap(), + key, + ) + .with_audience(authorization["clientAssertionAudience"].as_str().unwrap()) + .with_resource(authorization["resource"].as_str().unwrap()) + .with_scopes(vec!["casework:review".to_owned()]), + ) + .unwrap(); + let token = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap() + .block_on(provider.bearer_token()) + .expect("the Coordinator obtains a producer token"); + let header = token.authorization_header_value(); + let compact = header.to_str().unwrap().trim_start_matches("Bearer "); + let claims: Value = serde_json::from_slice( + &base64::engine::general_purpose::URL_SAFE_NO_PAD + .decode(compact.split('.').nth(1).unwrap()) + .unwrap(), + ) + .unwrap(); + assert_eq!(claims["sub"], "coordinator-producer"); + assert_eq!(claims["aud"], "urn:dev:casework"); + assert_eq!(claims["iss"], input.plan.issuer); + } + + #[test] + fn one_casework_producer_is_bound_by_at_most_one_binding() { + let mut value = coordinator_plan(); + value.products.push(ProductPlan { + product: Product::Breg, + project: PathBuf::from("registry"), + audience: "urn:dev:breg".to_owned(), + }); + value.bindings.breg_review_authority = Some(BregReviewAuthority { + id: "casework".to_owned(), + producer: "coordinator".to_owned(), + identity: "coordinator-producer".to_owned(), + run_issuer_binding: None, + }); + let error = value.bindings.validate(&value).unwrap_err().to_string(); + assert!( + error.contains("/bindings/coordinatorReviewProducer/producer"), + "{error}" + ); + } + + #[test] + fn each_start_writes_a_fresh_completion_key_that_nothing_else_carries() { + let read = || { + let root = tempfile::tempdir().unwrap(); + let runtime = RuntimeBindings::prepare( + root.path(), + Arc::new(input(coordinator_plan())), + Arc::new(Issuer::create(root.path()).unwrap()), + &coordinator_origins(), + ) + .unwrap(); + let mut casework = json!({}); + runtime.configure(Product::Casework, &mut casework); + let mut coordinator = json!({"connections": {"review": { + "type": "casework-review-producer", "producer": "coordinator", + "completion": {"recipientBinding": "coordinator-v1", "hmacSha256KeyRef": "secret:file/authored"} + }}}); + runtime.configure(Product::Coordinator, &mut coordinator); + let key = std::fs::read(root.path().join(COORDINATOR_COMPLETION_KEY)).unwrap(); + // Only the key file holds the key: no other run file and no rendered + // configuration carries its bytes in any common encoding. + use base64::Engine as _; + let encodings = [ + key.iter() + .map(|byte| format!("{byte:02x}")) + .collect::(), + base64::engine::general_purpose::STANDARD.encode(&key), + base64::engine::general_purpose::URL_SAFE_NO_PAD.encode(&key), + ]; + for rendered in [casework.to_string(), coordinator.to_string()] { + for encoded in &encodings { + assert!(!rendered.contains(encoded.as_str())); + } + } + for entry in std::fs::read_dir(root.path()).unwrap() { + let path = entry.unwrap().path(); + if path.file_name().unwrap() == COORDINATOR_COMPLETION_KEY || !path.is_file() { + continue; + } + let bytes = std::fs::read(&path).unwrap(); + assert!( + !bytes + .windows(key.len()) + .any(|window| window == key.as_slice()), + "{}", + path.display() + ); + let text = String::from_utf8_lossy(&bytes); + for encoded in &encodings { + assert!(!text.contains(encoded.as_str()), "{}", path.display()); + } + } + key + }; + assert_ne!(read(), read()); + } + + #[test] + fn the_completion_route_matches_the_review_protocol() { + let protocol = include_str!("../../registry-review-protocol/src/lib.rs"); + assert!( + protocol.contains(&format!( + "pub const REVIEW_COMPLETIONS_PATH: &str = \"{REVIEW_COMPLETIONS_PATH}\";" + )), + "the review protocol moved its completion route" + ); + } + + /// BReg and the Coordinator, with the Coordinator's `registry` BReg + /// connection bound to the `coordinator-service` test person. + fn coordinator_breg_plan() -> Plan { + let mut value = plan(); + value.products = vec![ + ProductPlan { + product: Product::Breg, + project: PathBuf::from("registry"), + audience: "urn:dev:breg".to_owned(), + }, + ProductPlan { + product: Product::Coordinator, + project: PathBuf::from("coordinator"), + audience: "urn:dev:coordinator".to_owned(), + }, + ]; + value.people = BTreeMap::from([( + "coordinator-service".to_owned(), + TestPerson { + subject: "coordinator-service".to_owned(), + display_name: None, + client: "coordinator-breg-client".to_owned(), + grants: BTreeMap::from([( + Product::Breg, + grant("permit-coordinator", "registry:actions:invoke"), + )]), + }, + )]); + value.bindings = serde_json::from_value(json!({"coordinatorBregClient": { + "connection": "registry", "identity": "coordinator-service" + }})) + .unwrap(); + value + } + + fn coordinator_breg_origins() -> BTreeMap { + BTreeMap::from([ + (Product::Breg, "http://127.0.0.1:31001".to_owned()), + (Product::Coordinator, "http://127.0.0.1:31003".to_owned()), + ]) + } + + #[test] + fn a_coordinator_breg_client_needs_its_products_and_a_breg_identity() { + let value = coordinator_breg_plan(); + value.bindings.validate(&value).unwrap(); + let refused = |change: fn(&mut Plan)| { + let mut value = coordinator_breg_plan(); + change(&mut value); + value.bindings.validate(&value).unwrap_err().to_string() + }; + let error = refused(|plan| plan.products.retain(|entry| entry.product != Product::Breg)); + assert!(error.contains("/bindings"), "{error}"); + let error = refused(|plan| { + plan.people + .get_mut("coordinator-service") + .unwrap() + .grants + .clear(); + }); + assert!( + error.contains("/bindings/coordinatorBregClient/identity"), + "{error}" + ); + let error = refused(|plan| { + plan.bindings + .coordinator_breg_client + .as_mut() + .unwrap() + .connection = "Registry".to_owned(); + }); + assert!( + error.contains("/bindings/coordinatorBregClient/connection"), + "{error}" + ); + // dev.yaml has no member that adds a profile or scope. + let widened = serde_json::from_value::(json!({"coordinatorBregClient": { + "connection": "registry", "identity": "coordinator-service", + "scopes": ["registry:records:write"] + }})); + assert!(widened.is_err()); + } + + #[test] + fn the_coordinator_breg_client_takes_profile_and_scopes_from_the_grant_only() { + let root = tempfile::tempdir().unwrap(); + let run = Arc::new(input(coordinator_breg_plan())); + let issuer = Arc::new(Issuer::create(root.path()).unwrap()); + let runtime = RuntimeBindings::prepare( + root.path(), + run.clone(), + issuer, + &coordinator_breg_origins(), + ) + .unwrap(); + let endpoint = runtime.server.as_ref().unwrap().endpoint.clone(); + let mut coordinator = json!({"connections": { + "registry": { + "type": "breg", "baseUrl": "http://127.0.0.1:1", "profile": "authored-profile", + "authorization": {"tokenEndpoint": "http://127.0.0.1:1/token", "clientId": "authored", + "scopes": ["registry:records:write"], "resource": "urn:elsewhere", + // Members the binding never writes must not survive either. + "taskAuthority": {"issuer": "https://casework.example"}, + "authoredOnly": "authored-value"} + }, + "notices": {"type": "messaging", "baseUrl": "http://127.0.0.1:2"} + }}); + runtime.configure(Product::Coordinator, &mut coordinator); + assert_eq!( + coordinator["connections"]["registry"], + json!({ + "type": "breg", "baseUrl": "http://127.0.0.1:31001", + "profile": "permit-coordinator", + "authorization": { + "tokenEndpoint": endpoint, + "clientAssertionAudience": run.plan.issuer, + "clientId": "coordinator-breg-client", + "signingKeyRef": "secret:file/coordinator-breg-client-key", + "resource": "urn:dev:breg", + "scopes": ["registry:actions:invoke"] + } + }) + ); + assert_eq!( + coordinator["connections"]["notices"], + json!({"type": "messaging", "baseUrl": "http://127.0.0.1:2"}) + ); + } + + #[test] + fn the_coordinator_obtains_a_breg_token_for_its_bound_identity() { + use base64::Engine as _; + let root = tempfile::tempdir().unwrap(); + let run = Arc::new(input(coordinator_breg_plan())); + let issuer = Arc::new(Issuer::create(root.path()).unwrap()); + let runtime = RuntimeBindings::prepare( + root.path(), + run.clone(), + issuer, + &coordinator_breg_origins(), + ) + .unwrap(); + let mut coordinator = json!({"connections": {"registry": {"type": "breg"}}}); + runtime.configure(Product::Coordinator, &mut coordinator); + let authorization = &coordinator["connections"]["registry"]["authorization"]; + let encoded = + Zeroizing::new(std::fs::read(root.path().join("coordinator-breg-client-key")).unwrap()); + let key = PrivateJwk::parse(std::str::from_utf8(&encoded).unwrap()).unwrap(); + let provider = PrivateKeyJwt::new( + PrivateKeyJwtConfig::new( + authorization["tokenEndpoint"] + .as_str() + .unwrap() + .parse() + .unwrap(), + authorization["clientId"].as_str().unwrap(), + key, + ) + .with_audience(authorization["clientAssertionAudience"].as_str().unwrap()) + .with_resource(authorization["resource"].as_str().unwrap()) + .with_scopes(vec!["registry:actions:invoke".to_owned()]), + ) + .unwrap(); + let runtime_tokens = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap(); + let token = runtime_tokens + .block_on(provider.bearer_token()) + .expect("the Coordinator obtains a BReg token"); + let header = token.authorization_header_value(); + let compact = header.to_str().unwrap().trim_start_matches("Bearer "); + let claims: Value = serde_json::from_slice( + &base64::engine::general_purpose::URL_SAFE_NO_PAD + .decode(compact.split('.').nth(1).unwrap()) + .unwrap(), + ) + .unwrap(); + assert_eq!(claims["sub"], "coordinator-service"); + assert_eq!(claims["aud"], "urn:dev:breg"); + // A scope the grant does not hold is refused. + let encoded = + Zeroizing::new(std::fs::read(root.path().join("coordinator-breg-client-key")).unwrap()); + let key = PrivateJwk::parse(std::str::from_utf8(&encoded).unwrap()).unwrap(); + let wider = PrivateKeyJwt::new( + PrivateKeyJwtConfig::new( + authorization["tokenEndpoint"] + .as_str() + .unwrap() + .parse() + .unwrap(), + authorization["clientId"].as_str().unwrap(), + key, + ) + .with_audience(authorization["clientAssertionAudience"].as_str().unwrap()) + .with_resource(authorization["resource"].as_str().unwrap()) + .with_scopes(vec!["registry:records:write".to_owned()]), + ) + .unwrap(); + assert!(runtime_tokens.block_on(wider.bearer_token()).is_err()); + } + + #[test] + fn the_coordinator_breg_identity_is_a_dedicated_machine_person() { + // Shared with the Casework context provider. + let mut shared = coordinator_breg_plan(); + shared.products.push(ProductPlan { + product: Product::Casework, + project: PathBuf::from("casework"), + audience: "urn:dev:casework".to_owned(), + }); + shared.bindings.casework_context_provider = Some(CaseworkContextProvider { + id: "registry".to_owned(), + identity: "coordinator-service".to_owned(), + action: "reviewed-change".to_owned(), + }); + let error = shared.bindings.validate(&shared).unwrap_err().to_string(); + assert!( + error.contains("/bindings/coordinatorBregClient/identity"), + "{error}" + ); + assert!(error.contains("dedicated"), "{error}"); + + // Shared with the preview actor. + let mut previewed = coordinator_breg_plan(); + previewed.preview = Some( + serde_json::from_value(json!({ + "actor": "coordinator-service", "page": "/", "breg": {}, "functions": ["renew"] + })) + .unwrap(), + ); + let error = previewed + .bindings + .validate(&previewed) + .unwrap_err() + .to_string(); + assert!( + error.contains("/bindings/coordinatorBregClient/identity"), + "{error}" + ); + } + + #[test] + fn the_coordinator_breg_client_needs_the_run_key_set() { + let mut external = coordinator_breg_plan(); + external.issuer = "http://127.0.0.1:41000".to_owned(); + external.external_jwks_uri = Some("http://127.0.0.1:41000/keys".to_owned()); + let error = external + .bindings + .validate(&external) + .unwrap_err() + .to_string(); + assert!(error.contains("/bindings/coordinatorBregClient"), "{error}"); + assert!(error.contains("externalJwksUri"), "{error}"); + } } diff --git a/crates/registry-rstack-dev/src/dev_facts.rs b/crates/registry-rstack-dev/src/dev_facts.rs index 233ce5de95..3a16ec90c3 100644 --- a/crates/registry-rstack-dev/src/dev_facts.rs +++ b/crates/registry-rstack-dev/src/dev_facts.rs @@ -48,6 +48,7 @@ pub(super) fn load( external_jwks_uri: Option<&str>, products: &[ProductPlan], clients: &BTreeSet, + completion_destination: Option<&str>, offline_check: bool, ) -> Result> { let scratch = tempfile::tempdir()?; @@ -81,6 +82,7 @@ pub(super) fn load( issuer, external_jwks_uri, clients, + completion_destination, &terminate, offline_check, ) @@ -115,6 +117,7 @@ fn load_product_facts( issuer: &str, external_jwks_uri: Option<&str>, clients: &BTreeSet, + completion_destination: Option<&str>, terminate: &AtomicBool, offline_check: bool, ) -> Result { @@ -139,6 +142,7 @@ fn load_product_facts( issuer, external_jwks_uri, clients, + completion_destination, &file, terminate, offline_check, @@ -234,6 +238,7 @@ fn native_facts( issuer: &str, external_jwks_uri: Option<&str>, clients: &BTreeSet, + completion_destination: Option<&str>, output: &Path, terminate: &AtomicBool, offline_check: bool, @@ -276,7 +281,15 @@ fn native_facts( None, ) } else { - let config = runtime_for_facts(plan, project, scratch, &package, issuer, clients)?; + let config = runtime_for_facts( + plan, + project, + scratch, + &package, + issuer, + clients, + completion_destination, + )?; let bytes = serde_json::to_vec(&config)?; write_private(&runtime, &bytes)?; let pins = if let Some(tool) = messaging_tool { @@ -574,6 +587,7 @@ fn runtime_for_facts( package: &Path, issuer: &str, clients: &BTreeSet, + completion_destination: Option<&str>, ) -> Result { let product = plan.product; let version = format!( @@ -624,6 +638,14 @@ fn runtime_for_facts( json!(clients); } } + // The run binds this destination to the Coordinator's completion + // endpoint, so the facts runtime declares it as the run will. + if let Some(destination) = completion_destination { + config["destinations"]["hooks"][destination] = json!({ + "url": format!("http://127.0.0.1:1{}", super::bindings::REVIEW_COMPLETIONS_PATH), + "hmacSha256KeyRef": "secret:file/coordinator-completion-key", + }); + } config["audit"] .as_object_mut() .expect("audit mapping") @@ -1189,6 +1211,42 @@ mod tests { assert!(coordinator_profiles_for_run(&runtime, &plan).is_err()); } + #[test] + fn casework_facts_configure_the_bound_completion_destination() { + let root = tempfile::tempdir().unwrap(); + let plan: ProductPlan = serde_json::from_value(json!({ + "product": "casework", "project": ".", "audience": "urn:casework", + })) + .unwrap(); + for destination in [None, Some("coordinator-wake")] { + let config = runtime_for_facts( + &plan, + root.path(), + root.path(), + &root.path().join("package"), + "https://issuer.example.test", + &BTreeSet::new(), + destination, + ) + .unwrap(); + let hooks = &config["destinations"]["hooks"]; + match destination { + None => assert!(config.get("destinations").is_none(), "{config}"), + Some(id) => { + assert_eq!(hooks.as_object().unwrap().len(), 1, "{config}"); + assert!(hooks[id]["url"] + .as_str() + .unwrap() + .ends_with(super::super::bindings::REVIEW_COMPLETIONS_PATH)); + assert!(hooks[id]["hmacSha256KeyRef"] + .as_str() + .unwrap() + .starts_with("secret:file/")); + } + } + } + } + #[test] fn evidence_facts_projection_uses_the_run_issuer_and_matching_claim_names() { let root = tempfile::tempdir().unwrap(); diff --git a/crates/registry-rstack-dev/src/lib.rs b/crates/registry-rstack-dev/src/lib.rs index 71167ad06b..4b350848a6 100644 --- a/crates/registry-rstack-dev/src/lib.rs +++ b/crates/registry-rstack-dev/src/lib.rs @@ -755,6 +755,20 @@ fn error_report(error: &anyhow::Error) -> (Value, u8) { (report, code) } +/// The substitution a multi-actor preview makes for development. +const PREVIEW_ACTOR_SUBSTITUTION: &str = "per-actor gateway origin (development)"; + +/// Report each actor's origin and append the development substitution: one +/// gateway origin per actor, over the same page bytes, stands in for one +/// origin with sign-in. +fn add_preview_actors(report: &mut Value, actors: &BTreeMap) { + report["previewActors"] = json!(actors); + match report["substitutions"].as_array_mut() { + Some(substitutions) => substitutions.push(json!(PREVIEW_ACTOR_SUBSTITUTION)), + None => report["substitutions"] = json!([PREVIEW_ACTOR_SUBSTITUTION]), + } +} + fn emit(output: &mut dyn Write, report: &Value, machine: bool) -> std::io::Result<()> { if machine { return writeln!(output, "{report}"); @@ -862,6 +876,20 @@ fn emit(output: &mut dyn Write, report: &Value, machine: bool) -> std::io::Resul if let Some(application) = report["application"].as_str() { writeln!(output, " Application {application}")?; } + for (name, origin) in report["previewActors"].as_object().into_iter().flatten() { + writeln!( + output, + " Actor {name} {}", + origin.as_str().unwrap_or_default() + )?; + } + for substitution in report["substitutions"].as_array().into_iter().flatten() { + writeln!( + output, + " Substitution {}", + substitution.as_str().unwrap_or_default() + )?; + } for journey in report["scenarios"].as_array().into_iter().flatten() { let Some(result) = journey["result"].as_str() else { continue; @@ -1541,6 +1569,7 @@ fn worker(root: &Path, output: &mut dyn Write) -> Result<()> { .as_ref() .map(|_| root.join("application-preview")); let mut preview_signer = None; + let mut preview_actors = None; let prepared = catch_startup(|| { products.capture_preview_project()?; products.check()?; @@ -1718,6 +1747,7 @@ fn worker(root: &Path, output: &mut dyn Write) -> Result<()> { preview::authorization(root, &input, &issuer, clock()? + input.ttl_seconds)?; let prepared = products.prepare_application(&urls, Some((artifact, &authorization_file)))?; + let actors = prepared.actors.clone(); let origin = products.start_application(prepared.launch)?; let page = &input .plan @@ -1726,6 +1756,12 @@ fn worker(root: &Path, output: &mut dyn Write) -> Result<()> { .context("missing preview page")? .page; application_url = Some(format!("{origin}{page}")); + preview_actors = (!actors.is_empty()).then(|| { + actors + .iter() + .map(|(name, origin)| (name.clone(), format!("{origin}{page}"))) + .collect::>() + }); preview_signer = Some(issuer); } let expires_at = clock()? + input.ttl_seconds; @@ -1780,6 +1816,9 @@ fn worker(root: &Path, output: &mut dyn Write) -> Result<()> { (url, issuer) }); add_run_addresses(&mut report, &input.plan, application); + if let Some(actors) = &preview_actors { + add_preview_actors(&mut report, actors); + } if let (Some(state), Some(key)) = (&project_state, &input.project_key) { write_private(&state.join(format!("run-{}", input.run_id)), key.as_bytes())?; @@ -2774,11 +2813,20 @@ fn remove_run_dir(root: &Path) -> Result<()> { } _ => {} } - match fs::remove_file(root.join(preview::AUTHORIZATION_FILE)) { - Err(error) if error.kind() != std::io::ErrorKind::NotFound => { - return Err(error).context("cannot remove the run's preview authorization"); + for entry in fs::read_dir(root).context("cannot read the run directory")? { + let entry = entry.context("cannot read the run directory")?; + if entry + .file_name() + .to_str() + .is_some_and(|name| name.starts_with(preview::AUTHORIZATION_FILE)) + { + match fs::remove_file(entry.path()) { + Err(error) if error.kind() != std::io::ErrorKind::NotFound => { + return Err(error).context("cannot remove the run's preview authorization"); + } + _ => {} + } } - _ => {} } match fs::remove_file(root.join(products::FUNCTION_HOST_KEY)) { Err(error) if error.kind() != std::io::ErrorKind::NotFound => { @@ -2786,6 +2834,12 @@ fn remove_run_dir(root: &Path) -> Result<()> { } _ => {} } + match fs::remove_file(root.join(bindings::COORDINATOR_COMPLETION_KEY)) { + Err(error) if error.kind() != std::io::ErrorKind::NotFound => { + return Err(error).context("cannot remove the run's review completion key"); + } + _ => {} + } fs::rename(root, &doomed).context("cannot remove run scratch files")?; fs::remove_dir_all(&doomed) .with_context(|| format!("cannot remove run scratch files at {}", doomed.display())) @@ -3158,6 +3212,46 @@ mod tests { assert!(text.contains("Application http://127.0.0.1:4201"), "{text}"); } + #[test] + fn preview_actors_append_the_development_substitution_and_print_each_origin() { + let mut report = json!({ + "run_id": RUN_ID, "status": "ready", + "application": "http://127.0.0.1:4201/", + "substitutions": ["earlier substitution"], + }); + add_preview_actors( + &mut report, + &BTreeMap::from([ + ("applicant".to_owned(), "http://127.0.0.1:4201/".to_owned()), + ("officer".to_owned(), "http://127.0.0.1:4202/".to_owned()), + ]), + ); + assert_eq!( + report["substitutions"], + json!(["earlier substitution", PREVIEW_ACTOR_SUBSTITUTION]) + ); + assert_eq!( + report["previewActors"], + json!({"applicant": "http://127.0.0.1:4201/", "officer": "http://127.0.0.1:4202/"}) + ); + let mut output = Vec::new(); + emit(&mut output, &report, false).unwrap(); + let text = String::from_utf8(output).unwrap(); + assert!( + text.contains(" Actor applicant http://127.0.0.1:4201/\n"), + "{text}" + ); + assert!( + text.contains(" Actor officer http://127.0.0.1:4202/\n"), + "{text}" + ); + assert!( + text.contains(" Substitution earlier substitution\n") + && text.contains(" Substitution per-actor gateway origin (development)\n"), + "{text}" + ); + } + #[test] fn human_run_report_gives_each_product_one_line_that_starts_with_its_name() { // The tutorials read a product's address with @@ -3932,6 +4026,18 @@ mod tests { private_directory(&root).unwrap(); fs::write(root.join(products::FIELD_KEY), "key").unwrap(); fs::write(root.join(products::FUNCTION_HOST_KEY), "host-key").unwrap(); + fs::write( + root.join(bindings::COORDINATOR_COMPLETION_KEY), + "completion-key", + ) + .unwrap(); + let actor_files = [ + format!("{}-applicant-breg", preview::AUTHORIZATION_FILE), + format!("{}-officer-casework", preview::AUTHORIZATION_FILE), + ]; + for file in &actor_files { + fs::write(root.join(file), "Authorization: Bearer token\n").unwrap(); + } fs::write(root.join(REPORT), "{}").unwrap(); // A non-empty directory at the removal name makes the rename fail, as // an interrupted deletion would leave the run behind. @@ -3942,6 +4048,10 @@ mod tests { assert!(remove_run_dir(&root).is_err()); assert!(!root.join(products::FIELD_KEY).exists()); assert!(!root.join(products::FUNCTION_HOST_KEY).exists()); + assert!(!root.join(bindings::COORDINATOR_COMPLETION_KEY).exists()); + for file in &actor_files { + assert!(!root.join(file).exists(), "{file}"); + } assert!(root.join(REPORT).exists()); } diff --git a/crates/registry-rstack-dev/src/plan.rs b/crates/registry-rstack-dev/src/plan.rs index e97d9ab655..bb51dd1ba9 100644 --- a/crates/registry-rstack-dev/src/plan.rs +++ b/crates/registry-rstack-dev/src/plan.rs @@ -1357,9 +1357,12 @@ fn preview_plan( impl Plan { pub(super) fn paired_run_binding(&self) -> bool { + let has = |product| self.products.iter().any(|p| p.product == product); self.bindings.binds_run_issuer() - && self.products.iter().any(|p| p.product == Product::Breg) - && self.products.iter().any(|p| p.product == Product::Casework) + && has(Product::Casework) + && (has(Product::Breg) + || (self.bindings.coordinator_review_producer.is_some() + && has(Product::Coordinator))) } pub(super) fn runs_evidence(&self) -> bool { @@ -1465,7 +1468,7 @@ impl Plan { || self.runs_evidence()) && ((self.application.is_none() && !self.bindings.binds_run_issuer()) || self.issuer == "run"), "/issuer", - "The run issuer requires a preview, an application, an explicitly bound BReg and Casework pair, or Evidence. Applications and run issuer bindings require issuer run.", + "The run issuer requires a preview, an application, an explicitly bound BReg or Coordinator review producer paired with Casework, or Evidence. Applications and run issuer bindings require issuer run.", "Use issuer `run` with a preview, an application, the exact paired runIssuerBinding, or Evidence. Other plans use a configured issuer.", )?; require( @@ -1851,6 +1854,17 @@ impl Journey { "The step must name a test person with a grant for its product.", "Set as to a test person that has a grant for this step's product.", )?; + require( + plan.bindings + .coordinator_breg_client + .as_ref() + .is_none_or(|binding| { + step.person.as_deref() != Some(binding.identity.as_str()) + }), + &format!("{field}/as"), + "A journey step cannot act as the Coordinator's dedicated BReg identity.", + "Set as to another test person.", + )?; require( valid_path(&step.path) && (step.path != ADAPTER_CONTRACT_PATH || step.product == Product::Adapter), &format!("{field}/path"), @@ -2391,6 +2405,22 @@ mod tests { (root, plan) } + #[test] + fn a_journey_cannot_act_as_the_coordinator_breg_identity() { + let (root, mut plan) = plan(json!({"id": "read", "product": "breg", + "as": "operator", "method": "GET", "path": "/v1/records", "expect": {"status": 200}})); + plan.bindings = serde_json::from_value(json!({"coordinatorBregClient": { + "connection": "registry", "identity": "operator" + }})) + .unwrap(); + let error = journey_file(root.path(), &plan) + .validate(&plan) + .unwrap_err() + .to_string(); + assert!(error.contains("/steps/0/as"), "{error}"); + assert!(error.contains("Coordinator"), "{error}"); + } + #[test] fn an_external_issuer_accepts_loopback_keys_and_requires_an_empty_journey_pack() { let (root, mut plan) = plan(json!({"id": "read", "product": "breg", diff --git a/crates/registry-rstack-dev/src/preview.rs b/crates/registry-rstack-dev/src/preview.rs index 5299724d69..ef563ec312 100644 --- a/crates/registry-rstack-dev/src/preview.rs +++ b/crates/registry-rstack-dev/src/preview.rs @@ -23,17 +23,26 @@ pub(super) const HEALTH: &str = "/_rstack/ready"; #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[serde(deny_unknown_fields)] pub(super) struct Preview { - /// Synthetic development identity whose checked BReg grant is used on the server. - pub actor: LocalId, + /// Synthetic development identity whose checked BReg grant is used on the server. Use with `breg`, or use `actors` instead. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub actor: Option, /// Initial page on the loopback preview origin. pub page: String, - /// BReg paths exposed to the page, grouped by method. - pub breg: Routes, + /// BReg paths exposed to the page of the single `actor`, grouped by method. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub breg: Option, /// Declared functions to expose on the loopback preview origin. pub functions: UniqueList, + /// One to eight synthetic identities, each served on its own loopback gateway origin over the same page, with the product paths it may reach. Use instead of `actor` and `breg`. Every actor needs a BReg grant, and a grant for each other product it reaches. + #[serde(default, skip_serializing_if = "Option::is_none")] + #[cfg_attr( + feature = "schema", + schemars(schema_with = "super::plan::keyed_schema::") + )] + pub actors: Option>, } -#[derive(Deserialize, Serialize)] +#[derive(Default, Deserialize, Serialize)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[serde(deny_unknown_fields)] pub(super) struct Routes { @@ -43,6 +52,46 @@ pub(super) struct Routes { post: UniqueList, } +impl Routes { + fn is_empty(&self) -> bool { + self.get.is_empty() && self.post.is_empty() + } +} + +/// The product paths one preview actor may reach, grouped by product and +/// method. +#[derive(Default, Deserialize, Serialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(deny_unknown_fields)] +pub(super) struct ActorRoutes { + #[serde(default, skip_serializing_if = "Routes::is_empty")] + breg: Routes, + #[serde(default, skip_serializing_if = "Routes::is_empty")] + casework: Routes, + #[serde(default, skip_serializing_if = "Routes::is_empty")] + coordinator: Routes, +} + +impl ActorRoutes { + fn by_product(&self) -> [(Product, &Routes); 3] { + [ + (Product::Breg, &self.breg), + (Product::Casework, &self.casework), + (Product::Coordinator, &self.coordinator), + ] + } +} + +/// A product the page reaches only through the gateway, without a +/// generated client. +#[derive(Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub(super) struct RouteProduct { + pub id: LocalId, + pub kind: String, + pub audience: String, +} + #[derive(Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub(super) struct BuildPlan { @@ -52,6 +101,8 @@ pub(super) struct BuildPlan { functions: BTreeMap, pub product: PreviewProduct, pub declaration_digest: String, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub route_products: Vec, } #[derive(Deserialize, Serialize)] @@ -64,6 +115,15 @@ pub(super) struct PreviewProduct { } impl Preview { + /// The synthetic identities the preview serves. + pub(super) fn actor_names(&self) -> Vec<&str> { + self.actor + .iter() + .chain(self.actors.iter().flat_map(BTreeMap::keys)) + .map(LocalId::as_str) + .collect() + } + pub(super) fn build_plan(&self, root: &Path, native: &plan::Plan) -> Result { let refusal = || { plan::refuse( @@ -72,10 +132,32 @@ impl Preview { "Declare the one BReg project under products in service.yaml, set its audience in dev.yaml, and remove any explicit application or external issuer from this preview.", ) }; + let multi = self.actors.is_some(); + if (self.actor.is_some() || self.breg.is_some()) == multi + || self.actor.is_some() != self.breg.is_some() + { + return plan::refuse( + "/preview", + "A browser preview names either one actor with BReg routes or an actors map.", + "Use actor and breg for one identity, or actors for several.", + ) + .map_err(Into::into); + } + // Casework and the Coordinator are reachable only through actors. + let route_kinds = + |product: Product| multi && matches!(product, Product::Casework | Product::Coordinator); if native.application.is_some() || native.issuer != "run" - || native.products.len() != 1 - || native.products[0].product != Product::Breg + || native + .products + .iter() + .filter(|entry| entry.product == Product::Breg) + .count() + != 1 + || native + .products + .iter() + .any(|entry| entry.product != Product::Breg && !route_kinds(entry.product)) { return refusal().map_err(Into::into); } @@ -109,10 +191,27 @@ impl Preview { let Some(ui) = service.ui else { return refusal().map_err(Into::into); }; + let kind = |product: &service::Product| match product.product { + "breg" => Some(Product::Breg), + "casework" => Some(Product::Casework), + "coordinator" => Some(Product::Coordinator), + _ => None, + }; if service.file != service_file || service.functions.is_empty() - || service.products.len() != 1 - || service.products[0].product != "breg" + || service + .products + .iter() + .filter(|product| product.product == "breg") + .count() + != 1 + || service.products.iter().any(|product| { + kind(product).is_none_or(|product| { + product != Product::Breg + && (!route_kinds(product) + || !native.products.iter().any(|entry| entry.product == product)) + }) + }) { return refusal().map_err(Into::into); } @@ -146,11 +245,24 @@ impl Preview { ) .map_err(Into::into); } - let Some(grant) = native - .people - .get(self.actor.as_str()) - .and_then(|actor| actor.grants.get(&Product::Breg)) - else { + let profile = match (&self.actor, &self.actors) { + (Some(actor), None) => native + .people + .get(actor.as_str()) + .and_then(|actor| actor.grants.get(&Product::Breg)) + .map(|grant| grant.profile.clone()), + (None, Some(actors)) => { + check_actors(native, actors)?; + actors + .keys() + .next() + .and_then(|actor| native.people.get(actor.as_str())) + .and_then(|actor| actor.grants.get(&Product::Breg)) + .map(|grant| grant.profile.clone()) + } + _ => None, + }; + let Some(profile) = profile else { return plan::refuse( "/preview/actor", "The preview actor needs a BReg grant.", @@ -166,18 +278,8 @@ impl Preview { ) .map_err(Into::into); } - for (method, routes) in [("get", &self.breg.get), ("post", &self.breg.post)] { - if routes.len() > 64 - || routes - .iter() - .any(|route| !route.starts_with("/v1/") || !valid_path(route, true)) - { - return plan::refuse( - &format!("/preview/breg/{method}"), - "Preview routes need bounded literal BReg paths.", - "Use /v1/ paths with distinct Record ID and revision segments ({recordId}, {record_id}, {revision}), without query strings.", - ).map_err(Into::into); - } + if let Some(routes) = &self.breg { + check_routes(routes, "/preview/breg")?; } let selected = &self.functions; if selected.is_empty() @@ -193,10 +295,36 @@ impl Preview { ) .map_err(Into::into); } + let mut route_products: Vec = service + .products + .iter() + .filter_map(|product| { + let kind = kind(product).filter(|kind| *kind != Product::Breg)?; + Some(RouteProduct { + id: product.id.clone(), + kind: kind.name().to_owned(), + audience: native.product(kind).audience.clone(), + }) + }) + .collect(); + route_products.sort_by(|a, b| a.kind.cmp(&b.kind)); + // Each actor holds one credential per product kind, so a second + // project of a routed kind would have no credential to reach it. + if route_products + .windows(2) + .any(|pair| pair[0].kind == pair[1].kind) + { + return plan::refuse( + "/preview/actors", + "An actors preview reaches one project of each routed product.", + "Keep one Casework project and one Coordinator project in service.yaml.", + ) + .map_err(Into::into); + } let product = service .products .into_iter() - .next() + .find(|product| product.product == "breg") .context("missing preview product")?; ensure!( product.project @@ -219,16 +347,86 @@ impl Preview { member: product.member.context("missing preview client member")?, project: product.project, audience: native.product(Product::Breg).audience.clone(), - profile: grant.profile.clone(), + profile, }, declaration_digest: Sha256::digest(&declaration) .iter() .map(|byte| format!("{byte:02x}")) .collect(), + route_products, }) } } +/// Bounded literal /v1/ paths with at most one product ID placeholder. +fn check_routes(routes: &Routes, field: &str) -> plan::SemanticResult<()> { + for (method, routes) in [("get", &routes.get), ("post", &routes.post)] { + if routes.len() > 64 + || routes + .iter() + .any(|route| !route.starts_with("/v1/") || !valid_path(route, true)) + { + return plan::refuse( + &format!("{field}/{method}"), + "Preview routes need bounded literal product paths.", + "Use /v1/ paths with at most one {recordId}, {record_id}, {taskId} or {runId} segment and at most one {revision} segment, without query strings.", + ); + } + } + Ok(()) +} + +/// Each actor is a declared synthetic identity with a BReg grant, and a grant +/// for every other product it reaches through bounded literal paths. +fn check_actors( + native: &plan::Plan, + actors: &BTreeMap, +) -> plan::SemanticResult<()> { + if actors.is_empty() || actors.len() > 8 { + return plan::refuse( + "/preview/actors", + "A preview has one to eight actors.", + "Declare between one and eight actors.", + ); + } + for (name, routes) in actors { + let field = format!("/preview/actors/{}", name.as_str()); + let Some(person) = native.people.get(name.as_str()) else { + return plan::refuse( + &field, + "The preview actor is not a declared synthetic identity.", + "Name a person declared in people.", + ); + }; + if !person.grants.contains_key(&Product::Breg) { + return plan::refuse( + &field, + "Each preview actor needs a BReg grant.", + "Give the person a BReg role.", + ); + } + for (product, routes) in routes.by_product() { + let field = format!("{field}/{}", product.name()); + if !routes.is_empty() && !person.grants.contains_key(&product) { + return plan::refuse( + &field, + "The preview actor has no grant for this product.", + "Give the person a role for this product, or remove its paths.", + ); + } + check_routes(routes, &field)?; + } + } + Ok(()) +} + +/// The authorization files a preview run writes: one for the single actor's +/// BReg grant, or one per actor and product it reaches. +pub(super) struct PreviewAuthorization { + pub single: Option, + pub actors: BTreeMap>, +} + fn valid_page(path: &str) -> bool { if path == "/" { return true; @@ -247,17 +445,18 @@ pub(super) fn valid_path(path: &str, parameter: bool) -> bool { let Some(rest) = path.strip_prefix('/') else { return false; }; - let mut record_id = false; + let placeholder = + |part: &str| matches!(part, "{recordId}" | "{record_id}" | "{taskId}" | "{runId}"); + let mut identifier = false; let mut revision = false; path.len() <= 256 && rest.split('/').all(|part| { if parameter { - match part { - "{recordId}" | "{record_id}" => { - return !std::mem::replace(&mut record_id, true) - } - "{revision}" => return !std::mem::replace(&mut revision, true), - _ => {} + if placeholder(part) { + return !std::mem::replace(&mut identifier, true); + } + if part == "{revision}" { + return !std::mem::replace(&mut revision, true); } } part.len() <= 128 @@ -276,21 +475,45 @@ pub(super) fn authorization( input: &RunInput, signer: &Issuer, run_expires: u64, -) -> Result { +) -> Result { let preview = input.plan.preview.as_ref().context("missing preview")?; - let person = input - .plan - .people - .get(preview.actor.as_str()) - .context("missing preview actor")?; let expires = issuer::token_expiry(run_expires, clock()?); - let bearer = signer.token(input, person, Product::Breg, expires)?; - let path = root.join(AUTHORIZATION_FILE); - write_private( - &path, - Zeroizing::new(format!("Authorization: Bearer {}\n", &*bearer)).as_bytes(), - )?; - Ok(path) + let write = |path: PathBuf, person, product| -> Result { + let bearer = signer.token(input, person, product, expires)?; + write_private( + &path, + Zeroizing::new(format!("Authorization: Bearer {}\n", &*bearer)).as_bytes(), + )?; + Ok(path) + }; + let mut written = PreviewAuthorization { + single: None, + actors: BTreeMap::new(), + }; + if let Some(actor) = &preview.actor { + let person = input + .plan + .people + .get(actor.as_str()) + .context("missing preview actor")?; + written.single = Some(write(root.join(AUTHORIZATION_FILE), person, Product::Breg)?); + } + for (name, routes) in preview.actors.iter().flatten() { + let person = input + .plan + .people + .get(name.as_str()) + .context("missing preview actor")?; + let mut files = BTreeMap::new(); + for (product, routes) in routes.by_product() { + if product == Product::Breg || !routes.is_empty() { + let file = format!("{AUTHORIZATION_FILE}-{}-{}", name.as_str(), product.name()); + files.insert(product, write(root.join(file), person, product)?); + } + } + written.actors.insert(name.as_str().to_owned(), files); + } + Ok(written) } pub(super) fn helper(root: &Path) -> Result { @@ -465,3 +688,396 @@ mod snapshot_tests { ); } } + +#[cfg(test)] +mod tests { + use super::*; + use serde_json::{json, Value}; + + const SERVICE: &str = "\ +apiVersion: id.registrystack.org/formats/rstack/service/v1alpha1 +kind: RStackService +products: + breg: + projects: + permits: {path: project} + casework: {path: casework} + coordinator: + projects: + permit-flow: {path: coordinator} +ui: {project: web, output: dist} +functions: [assess-permit] +"; + + /// A service with BReg, Casework and the Coordinator, a UI and one + /// function, with stub native manifests. + fn project(root: &Path) { + for (directory, file) in [ + ("project", "registry.yaml"), + ("casework", "casework.yaml"), + ("coordinator", "workflow.yaml"), + ("web/src", "page.ts"), + ("functions/assess-permit", "index.ts"), + ] { + fs::create_dir_all(root.join(directory)).unwrap(); + fs::write(root.join(directory).join(file), "{}\n").unwrap(); + } + fs::create_dir_all(root.join("web/public")).unwrap(); + fs::write(root.join("service.yaml"), SERVICE).unwrap(); + } + + fn grant(profile: &str) -> Value { + json!({"profile": profile, "scopes": ["read"]}) + } + + /// An applicant and an officer, each on its own origin. + fn native(preview: Value) -> plan::Plan { + serde_json::from_value(json!({ + "issuer": "run", + "products": [ + {"product": "breg", "project": "project", "audience": "urn:permits"}, + {"product": "casework", "project": "casework", "audience": "urn:review"}, + {"product": "coordinator", "project": "coordinator", "audience": "urn:flow"} + ], + "people": { + "applicant": {"subject": "applicant", "client": "applicant-client", "grants": { + "breg": grant("permit-applicant"), "casework": grant("permit-requester"), + "coordinator": grant("permit-starter") + }}, + "officer": {"subject": "officer", "client": "officer-client", "grants": { + "breg": grant("permit-reader"), "casework": grant("permit-officer") + }} + }, + "journeyFile": "dev-journeys.yaml", + "preview": preview + })) + .unwrap() + } + + fn actors() -> Value { + json!({ + "page": "/", + "functions": ["assess-permit"], + "actors": { + "applicant": { + "breg": {"post": ["/v1/actions/submit-application"]}, + "casework": {"post": ["/v1/review-tasks/{taskId}/decisions"]}, + "coordinator": {"get": ["/v1/workflows/permit-flow", "/v1/runs/{runId}"], "post": ["/v1/runs"]} + }, + "officer": { + "breg": {"get": ["/v1/records/permits/{recordId}"]}, + "casework": {"get": ["/v1/review-tasks"], "post": ["/v1/review-tasks/{taskId}/claim", "/v1/review-tasks/{taskId}/decisions"]} + } + } + }) + } + + fn build(preview: Value) -> Result { + build_with(preview, |_| {}) + } + + fn build_with(preview: Value, edit: impl FnOnce(&Path)) -> Result { + let root = tempfile::tempdir().unwrap(); + project(root.path()); + edit(root.path()); + let plan = native(preview); + plan.preview + .as_ref() + .unwrap() + .build_plan(root.path(), &plan) + } + + fn pointer(preview: Value) -> String { + refusal(build(preview)) + } + + fn refusal(built: Result) -> String { + let Err(error) = built else { + panic!("the preview plan was accepted"); + }; + error + .downcast_ref::() + .unwrap_or_else(|| panic!("not a semantic refusal: {error:#}")) + .to_string() + } + + #[test] + fn an_actors_preview_reaches_casework_and_the_coordinator_as_route_products() { + let build = build(actors()).unwrap(); + assert_eq!(build.product.id.as_str(), "permits"); + // Each actor carries its own BReg grant, and the build takes the + // first actor's as the generated client's profile. + assert_eq!(build.product.profile, "permit-applicant"); + assert_eq!( + serde_json::to_value(&build.route_products).unwrap(), + json!([ + {"id": "casework", "kind": "casework", "audience": "urn:review"}, + {"id": "permit-flow", "kind": "coordinator", "audience": "urn:flow"} + ]) + ); + } + + #[test] + fn an_actors_preview_refuses_each_mismatch_at_its_pointer() { + let mut both = actors(); + both["actor"] = json!("applicant"); + assert!(pointer(both).starts_with("dev.yaml /preview: ")); + + let mut stranger = actors(); + stranger["actors"]["stranger"] = json!({"breg": {"get": ["/v1/records/permits"]}}); + assert!(pointer(stranger).starts_with("dev.yaml /preview/actors/stranger: ")); + + // The officer has no Coordinator grant, so it cannot reach the Coordinator. + let mut ungranted = actors(); + ungranted["actors"]["officer"]["coordinator"] = json!({"get": ["/v1/runs/{runId}"]}); + assert!(pointer(ungranted).starts_with("dev.yaml /preview/actors/officer/coordinator: ")); + + let mut route = actors(); + route["actors"]["officer"]["casework"]["get"] = json!(["/v1/review-tasks/../admin"]); + assert!(pointer(route).starts_with("dev.yaml /preview/actors/officer/casework/get: ")); + + let mut two = actors(); + two["actors"]["officer"]["casework"]["get"] = json!(["/v1/review-tasks/{taskId}/{runId}"]); + assert!(pointer(two).starts_with("dev.yaml /preview/actors/officer/casework/get: ")); + } + + #[test] + fn an_actors_preview_refuses_an_empty_or_oversized_map_and_a_later_actor_without_breg() { + let mut empty = actors(); + empty["actors"] = json!({}); + assert_eq!( + pointer(empty), + "dev.yaml /preview/actors: A preview has one to eight actors. Next: Declare between one and eight actors." + ); + + // Two declared actors and seven more make nine. + let mut nine = actors(); + for index in 0..7 { + nine["actors"][format!("extra{index}")] = json!({}); + } + assert_eq!( + pointer(nine), + "dev.yaml /preview/actors: A preview has one to eight actors. Next: Declare between one and eight actors." + ); + + // The officer is not first in name order, and has only a Casework grant. + let mut plan = native(actors()); + plan.people + .get_mut("officer") + .unwrap() + .grants + .remove(&Product::Breg); + let root = tempfile::tempdir().unwrap(); + project(root.path()); + assert_eq!( + refusal(plan.preview.as_ref().unwrap().build_plan(root.path(), &plan)), + "dev.yaml /preview/actors/officer: Each preview actor needs a BReg grant. Next: Give the person a BReg role." + ); + } + + #[test] + fn an_actors_preview_refuses_a_product_it_cannot_route() { + let messaging = build_with(actors(), |root| { + fs::create_dir_all(root.join("messaging")).unwrap(); + fs::write(root.join("messaging/messaging.yaml"), "{}\n").unwrap(); + fs::write( + root.join("service.yaml"), + SERVICE.replace("ui: {", " messaging: {path: messaging}\nui: {"), + ) + .unwrap(); + }); + assert!(refusal(messaging).starts_with("dev.yaml /preview: ")); + } + + #[test] + fn an_actors_preview_refuses_two_projects_of_one_routed_product() { + let two = build_with(actors(), |root| { + fs::create_dir_all(root.join("second")).unwrap(); + fs::write(root.join("second/workflow.yaml"), "{}\n").unwrap(); + fs::write( + root.join("service.yaml"), + SERVICE.replace( + " permit-flow: {path: coordinator}\n", + " permit-flow: {path: coordinator}\n second-flow: {path: second}\n", + ), + ) + .unwrap(); + }); + assert_eq!( + refusal(two), + "dev.yaml /preview/actors: An actors preview reaches one project of each routed product. Next: Keep one Casework project and one Coordinator project in service.yaml." + ); + } + + fn run_input() -> RunInput { + let mut plan = serde_json::to_value(native(actors())).unwrap(); + plan["issuer"] = json!("http://127.0.0.1:45678"); + serde_json::from_value(json!({ + "run_id": "0123456789abcdef0123456789abcdef", + "project": "/project", + "ttl_seconds": 1800, + "plan": plan, + "schema_people": [], + "breg_authority": {"principal": "sub", "purpose": false, + "requires_postgis": false, "encrypts_fields": false, "named_clients": []}, + "casework_principals": {"permit-requester": "sub", "permit-officer": "sub"}, + "binaries": {} + })) + .unwrap() + } + + fn claims(file: &Path) -> Value { + use base64::Engine as _; + let line = fs::read_to_string(file).unwrap(); + let token = line + .strip_prefix("Authorization: Bearer ") + .unwrap() + .trim_end(); + let payload = token.split('.').nth(1).unwrap(); + serde_json::from_slice( + &base64::engine::general_purpose::URL_SAFE_NO_PAD + .decode(payload) + .unwrap(), + ) + .unwrap() + } + + #[test] + fn authorization_writes_one_owner_only_file_per_actor_and_reached_product() { + use std::os::unix::fs::PermissionsExt; + let root = tempfile::tempdir().unwrap(); + let signer = Issuer::create(root.path()).unwrap(); + let mut input = run_input(); + // The officer reaches BReg only through its always-present grant. + input + .plan + .preview + .as_mut() + .unwrap() + .actors + .as_mut() + .unwrap() + .get_mut(&LocalId::new("officer").unwrap()) + .unwrap() + .breg = Routes::default(); + let written = authorization(root.path(), &input, &signer, clock().unwrap() + 1800).unwrap(); + assert!(written.single.is_none()); + let expected = [ + ("applicant", Product::Breg, "urn:permits", "applicant"), + ("applicant", Product::Casework, "urn:review", "applicant"), + ("applicant", Product::Coordinator, "urn:flow", "applicant"), + ("officer", Product::Breg, "urn:permits", "officer"), + ("officer", Product::Casework, "urn:review", "officer"), + ]; + let listed: Vec<(&str, Product)> = written + .actors + .iter() + .flat_map(|(name, files)| files.keys().map(move |product| (name.as_str(), *product))) + .collect(); + assert_eq!( + listed, + expected + .iter() + .map(|(name, product, ..)| (*name, *product)) + .collect::>() + ); + for (name, product, audience, subject) in expected { + let file = &written.actors[name][&product]; + assert_eq!( + file, + &root + .path() + .join(format!("{AUTHORIZATION_FILE}-{name}-{}", product.name())) + ); + assert_eq!( + fs::metadata(file).unwrap().permissions().mode() & 0o777, + 0o600 + ); + let claims = claims(file); + assert_eq!(claims["aud"], audience, "{name} {product:?}"); + assert_eq!(claims["sub"], subject, "{name} {product:?}"); + } + } + + #[test] + fn each_actor_run_input_carries_its_own_origin_products_and_profiles() { + let build = build(actors()).unwrap(); + let plan = native(actors()); + let file = |name: &str| PathBuf::from(format!("/run/{name}")); + let authorization = PreviewAuthorization { + single: None, + actors: BTreeMap::from([ + ( + "applicant".to_owned(), + BTreeMap::from([ + (Product::Breg, file("a-breg")), + (Product::Coordinator, file("a-flow")), + ]), + ), + ( + "officer".to_owned(), + BTreeMap::from([ + (Product::Breg, file("o-breg")), + (Product::Casework, file("o-casework")), + ]), + ), + ]), + }; + let urls = BTreeMap::from([ + (Product::Breg, "http://127.0.0.1:34567".to_owned()), + (Product::Casework, "http://127.0.0.1:34568".to_owned()), + (Product::Coordinator, "http://127.0.0.1:34569".to_owned()), + ]); + let super::super::products::PreviewActorInputs { + actors, + origins, + held, + } = super::super::products::preview_actor_inputs( + &plan, + &build, + &authorization, + &urls, + ("http://127.0.0.1:23456", 23456), + ) + .unwrap(); + assert_eq!(held.len(), 1); + let officer = format!("http://{}", held[0].local_addr().unwrap()); + assert_eq!( + origins, + [ + ("applicant".to_owned(), "http://127.0.0.1:23456".to_owned()), + ("officer".to_owned(), officer.clone()), + ] + ); + assert_eq!( + Value::from(actors), + json!([ + {"name": "applicant", "origin": "http://127.0.0.1:23456", "port": 23456, "products": { + "permits": {"baseUrl": "http://127.0.0.1:34567", "audience": "urn:permits", + "profile": "permit-applicant", "authorizationFile": "/run/a-breg"}, + "permit-flow": {"baseUrl": "http://127.0.0.1:34569", "audience": "urn:flow", + "profile": null, "authorizationFile": "/run/a-flow"}, + }}, + {"name": "officer", "origin": officer, "port": held[0].local_addr().unwrap().port(), "products": { + "permits": {"baseUrl": "http://127.0.0.1:34567", "audience": "urn:permits", + "profile": "permit-reader", "authorizationFile": "/run/o-breg"}, + "casework": {"baseUrl": "http://127.0.0.1:34568", "audience": "urn:review", + "profile": "permit-officer", "authorizationFile": "/run/o-casework"}, + }}, + ]) + ); + } + + #[test] + fn a_single_actor_preview_keeps_one_breg_product() { + let mut single = json!({ + "actor": "applicant", "page": "/", "functions": ["assess-permit"], + "breg": {"get": ["/v1/records/permits"]} + }); + // Casework and the Coordinator are reachable only through actors. + assert!(pointer(single.clone()).starts_with("dev.yaml /preview: ")); + single["breg"] = json!({}); + single.as_object_mut().unwrap().remove("actor"); + assert!(pointer(single).starts_with("dev.yaml /preview")); + } +} diff --git a/crates/registry-rstack-dev/src/products.rs b/crates/registry-rstack-dev/src/products.rs index 830fa063e4..caf5cdbd65 100644 --- a/crates/registry-rstack-dev/src/products.rs +++ b/crates/registry-rstack-dev/src/products.rs @@ -27,7 +27,7 @@ use std::{ }; use super::{ - bindings::{Bindings, BregReviewAuthority, RunIssuerBinding, RuntimeBindings}, + bindings::{Bindings, RunInitiator, RunProducer, RuntimeBindings}, browser::BrowserClient, clock, database::{Database, DatabaseUrls}, @@ -120,8 +120,10 @@ pub(super) struct ApplicationLaunch { pub(super) workdir: PathBuf, pub(super) environment: BTreeMap, pub(super) reservation: TcpListener, - /// The preview's private function host port, held until the host starts. - pub(super) function_host: Option, + /// Further loopback ports the application binds, such as the preview's + /// private function host and each further actor's gateway, held until + /// it starts. + pub(super) held: Vec, pub(super) health_path: String, } @@ -138,6 +140,8 @@ struct FunctionHost { pub(super) struct PreparedApplication { pub(super) launch: ApplicationLaunch, + /// Each preview actor and the loopback origin its gateway serves. + pub(super) actors: Vec<(String, String)>, pub(super) client: Option, } @@ -703,7 +707,7 @@ impl<'a> ProductRunner<'a> { let log = open_log(self.root, "application-runtime")?; command.stdout(log.try_clone()?).stderr(log); drop(launch.reservation); - drop(launch.function_host); + drop(launch.held); let child = command .spawn() .context("cannot start application") @@ -751,7 +755,7 @@ impl<'a> ProductRunner<'a> { pub(super) fn prepare_application( &self, urls: &BTreeMap, - preview_artifact: Option<(&Path, &Path)>, + preview_artifact: Option<(&Path, &super::preview::PreviewAuthorization)>, ) -> Result { self.ensure_active()?; let preview = self.input.preview.as_ref(); @@ -787,12 +791,38 @@ impl<'a> ProductRunner<'a> { .map_err(operational)?; let address = reservation.local_addr()?; let origin = format!("http://{address}"); - let (run, client) = if let Some((_, authorization_file)) = preview_artifact { + let mut held = Vec::new(); + let mut actor_origins = Vec::new(); + let (run, client) = if let Some((_, authorization)) = preview_artifact { let build = &preview.context("missing captured preview build")?.plan; ensure!( bounded_version(node, Some(&prepare))? == super::preview::VERSION, "The built preview helper version does not match this Stack version." ); + let mut run_preview = json!({ + "productId": build.product.id, + "profile": build.product.profile, + "declarationDigest": build.declaration_digest, + "functionHost": self.function_host_input()?, + }); + if let Some(file) = &authorization.single { + run_preview["authorizationFile"] = json!(file); + } else { + let PreviewActorInputs { + actors, + origins, + held: listeners, + } = preview_actor_inputs( + &self.input.plan, + build, + authorization, + urls, + (&origin, address.port()), + )?; + held.extend(listeners); + actor_origins.extend(origins); + run_preview["actors"] = json!(actors); + } ( json!({ "schema": plan.config_schema, @@ -804,13 +834,7 @@ impl<'a> ProductRunner<'a> { "baseUrl": urls[&Product::Breg], "audience": self.input.plan.product(Product::Breg).audience, }, - "preview": { - "productId": build.product.id, - "profile": build.product.profile, - "declarationDigest": build.declaration_digest, - "authorizationFile": authorization_file, - "functionHost": self.function_host_input()?, - }, + "preview": run_preview, }), None, ) @@ -888,14 +912,19 @@ impl<'a> ProductRunner<'a> { workdir: root.to_owned(), environment, reservation, - function_host: preview_artifact.and_then(|_| { - self.function_host - .as_ref() - .and_then(|host| host.listener.borrow_mut().take()) - }), + held: preview_artifact + .and_then(|_| { + self.function_host + .as_ref() + .and_then(|host| host.listener.borrow_mut().take()) + }) + .into_iter() + .chain(held) + .collect(), health_path: plan.health_path.clone(), }, client, + actors: actor_origins, }) } @@ -1687,7 +1716,13 @@ impl<'a> ProductRunner<'a> { } } } - return Ok(json!({ + if let Some(casework) = + product_root(&self.input.project, &self.input.plan, Product::Casework)? + { + checked_coordinator_review_runtime(&self.input.plan, &casework.root, &runtime)?; + } + checked_coordinator_breg_runtime(&self.input.plan, &runtime)?; + let mut coordinator = json!({ "apiVersion": config["apiVersion"], "kind": "CoordinatorRuntimeConfig", "secretProviders": config["secretProviders"], @@ -1706,7 +1741,11 @@ impl<'a> ProductRunner<'a> { "stateKeys": {"1": {"keyRef": key("coordinator-state-key")?}}, "admissionKeyRef": key("coordinator-admission-key")?, } - })); + }); + if let Some(bindings) = &self.bindings { + bindings.configure(Product::Coordinator, &mut coordinator); + } + return Ok(coordinator); } Product::Adapter => { let template = authored_document(&project.join("runtime.example.yaml"))?; @@ -2830,6 +2869,9 @@ pub(super) fn inspect_with( let breg_authority = breg_authority(root, plan, terminate, &tool)?; let casework_principals = casework_principals(root, plan, breg_authority.as_ref(), terminate, &tool)?; + if let Some(coordinator) = product_root(root, plan, Product::Coordinator)? { + checked_coordinator_breg_client(plan, &coordinator.root)?; + } Ok(ProductInspection { breg_authority, casework_principals, @@ -3097,6 +3139,9 @@ fn casework_principals( if has_run_source(plan) { checked_casework_run_issuer(plan, &project.root)?; } + if let Some(coordinator) = product_root(root, plan, Product::Coordinator)? { + checked_coordinator_review_producer(plan, &project.root, &coordinator.root)?; + } if let Some(binding) = &plan.bindings.casework_context_provider { check_casework_binding(&tool, &project, plan, binding, terminate)?; } @@ -3943,26 +3988,61 @@ pub(super) fn schema_people( Ok(bindings) } -/// The dev.yaml member that carries the run issuer binding. -const RUN_ISSUER_BINDING: &str = "/bindings/bregReviewAuthority/runIssuerBinding"; +/// One Casework producer a run binds to its issuer: the dev.yaml binding +/// that names it, the producer, the test person whose grant and subject it +/// uses, and the exact guards. +struct GuardedProducer<'a> { + binding: &'static str, + producer: &'a str, + identity: &'a str, + guard: &'a RunProducer, + initiator: Option<&'a RunInitiator>, +} + +/// Every producer the plan binds to the run issuer. +fn guarded_producers(plan: &Plan) -> Vec> { + let mut producers = Vec::new(); + if let Some(binding) = &plan.bindings.breg_review_authority { + if let Some(guard) = &binding.run_issuer_binding { + producers.push(GuardedProducer { + binding: "/bindings/bregReviewAuthority", + producer: &binding.producer, + identity: &binding.identity, + guard: &guard.producer, + initiator: guard.initiator.as_ref(), + }); + } + } + if let Some(binding) = &plan.bindings.coordinator_review_producer { + producers.push(GuardedProducer { + binding: "/bindings/coordinatorReviewProducer", + producer: &binding.producer, + identity: &binding.identity, + guard: &binding.run_issuer_binding.producer, + initiator: None, + }); + } + producers +} /// Writes the run's loopback issuer into a copy of the Casework project at -/// `bound`. The source project is never edited. The copy changes only the -/// selected producer's `issuer`, and its `trustedInitiatorIssuer` when the +/// `bound`. The source project is never edited. The copy changes only each +/// bound producer's `issuer`, and its `trustedInitiatorIssuer` when the /// binding names an initiator. The caller then runs the public `caseworkctl /// check` and `package` on the copy, which refuse every other policy error. fn bind_casework_run_issuer(plan: &Plan, project: &Path, bound: &Path) -> Result<()> { let mut document = checked_casework_run_issuer(plan, project)?; - let (binding, guard) = run_issuer_binding(plan)?; ensure!( is_loopback_run_issuer(&plan.issuer), "the run issuer {} is not a loopback URL of the form http://127.0.0.1:", plan.issuer ); - let entry = &mut document["trustedProducers"][&binding.producer]; - entry["issuer"] = json!(plan.issuer); - if guard.initiator.is_some() { - entry["trustedInitiatorIssuer"] = json!(plan.issuer); + for bound_producer in guarded_producers(plan) { + let entry = &mut document["trustedProducers"][bound_producer.producer]; + entry["issuer"] = json!(plan.issuer); + if bound_producer.initiator.is_some() { + entry["trustedInitiatorIssuer"] = json!(plan.issuer); + } } copy_project(project, bound)?; write_private( @@ -3971,35 +4051,19 @@ fn bind_casework_run_issuer(plan: &Plan, project: &Path, bound: &Path) -> Result ) } -fn run_issuer_binding(plan: &Plan) -> Result<(&BregReviewAuthority, &RunIssuerBinding)> { - let binding = plan - .bindings - .breg_review_authority - .as_ref() - .context("the run issuer binding needs a review authority binding")?; - let guard = binding - .run_issuer_binding - .as_ref() - .context("the review authority binding has no run issuer binding")?; - Ok((binding, guard)) -} - /// Reads the Casework project's `casework.yaml` and refuses, at the dev.yaml /// pointer, a run issuer binding that does not match the trusted producer it /// names. `check` runs this before any product starts; `start` runs it again /// before binding the run issuer. fn checked_casework_run_issuer(plan: &Plan, project: &Path) -> Result { - let (binding, guard) = run_issuer_binding(plan)?; let refuse = |pointer: String, message: &str, action: &str| { anyhow::Error::from(plan::SemanticRefusal::new(&pointer, message, action)) }; - let identity = &plan.people[&binding.identity]; - let grant = &identity.grants[&Product::Casework]; - let person = format!( - "/people/{}", - registry_platform_yaml::escape_pointer_segment(&binding.identity) + let producers = guarded_producers(plan); + ensure!( + !producers.is_empty(), + "the plan binds no producer to the run issuer" ); - let source = project.join("casework.yaml"); let bytes = fs::read(&source).with_context(|| format!("cannot read {}", source.display()))?; let document = registry_platform_yaml::Reader::new(source.display().to_string()) @@ -4007,63 +4071,320 @@ fn checked_casework_run_issuer(plan: &Plan, project: &Path) -> Result { .map_err(|_| anyhow::anyhow!("{} is not valid YAML", source.display()))? .with_context(|| format!("{} is empty", source.display()))? .to_json_value(); - let producer = document["trustedProducers"][&binding.producer].clone(); - if !producer.is_object() { + for GuardedProducer { + binding, + producer: id, + identity: alias, + guard: expected, + initiator, + } in producers + { + let run_issuer_binding = format!("{binding}/runIssuerBinding"); + let identity = &plan.people[alias]; + let grant = &identity.grants[&Product::Casework]; + let person = format!( + "/people/{}", + registry_platform_yaml::escape_pointer_segment(alias) + ); + let producer = document["trustedProducers"][id].clone(); + if !producer.is_object() { + return Err(refuse( + format!("{binding}/producer"), + "The Casework project has no trusted producer with this ID.", + "Set producer to a trustedProducers entry in casework.yaml.", + )); + } + let text = |member: &str| producer[member].as_str().unwrap_or_default(); + if text("issuer") != expected.expected_issuer { + return Err(refuse( + format!("{run_issuer_binding}/producer/expectedIssuer"), + "The producer's issuer in casework.yaml is not the issuer the binding expects.", + "Set expectedIssuer to the issuer the Casework project pins for this producer.", + )); + } + if text("profile") != expected.expected_profile + || grant.profile != expected.expected_profile + { + return Err(refuse( + format!("{run_issuer_binding}/producer/expectedProfile"), + "The producer's profile in casework.yaml, the binding and the identity's Casework grant must be the same profile.", + "Set expectedProfile and the identity's Casework grant profile to the producer's profile.", + )); + } + if text("subject") != expected.expected_subject + || identity.subject != expected.expected_subject + { + return Err(refuse( + format!("{run_issuer_binding}/producer/expectedSubject"), + "The producer's subject in casework.yaml, the binding and the identity's subject must be the same subject.", + "Set expectedSubject and the identity's subject to the producer's subject.", + )); + } + let required = document["accessProfiles"][&expected.expected_profile]["requiredScopes"] + .as_array() + .cloned() + .unwrap_or_default(); + if let Some(missing) = required + .iter() + .filter_map(Value::as_str) + .find(|scope| !grant.scopes.iter().any(|granted| granted == scope)) + { + return Err(refuse( + format!("{person}/roles"), + &format!("The identity's Casework grant lacks the scope {missing} that the producer's profile requires."), + "Assign a role whose Casework profile supplies the required scope.", + )); + } + if let Some(initiator) = initiator { + if producer["trustedInitiatorIssuer"].as_str() + != Some(initiator.expected_issuer.as_str()) + { + return Err(refuse( + format!("{run_issuer_binding}/initiator/expectedIssuer"), + "The producer's trustedInitiatorIssuer in casework.yaml is not the issuer the binding expects.", + "Set expectedIssuer to the trustedInitiatorIssuer the Casework project pins for this producer.", + )); + } + } + } + Ok(document) +} + +/// Refuses, at the dev.yaml pointer, a Coordinator review producer the run +/// cannot bind exactly: a `casework-review-producer` connection without the +/// binding, a binding whose connection, producer, profile or completion does +/// not match the Coordinator runtime and `casework.yaml`, or a producer whose +/// guards do not match. `check` runs this before any product starts and +/// `start` again before rendering the Coordinator. +fn checked_coordinator_review_producer( + plan: &Plan, + casework: &Path, + coordinator: &Path, +) -> Result<()> { + let runtime = authored_document(&coordinator.join("runtime.yaml"))?; + checked_coordinator_review_runtime(plan, casework, &runtime) +} + +/// The same check over a Coordinator runtime document already read, so +/// `start` checks exactly the document it renders. +fn checked_coordinator_review_runtime(plan: &Plan, casework: &Path, runtime: &Value) -> Result<()> { + const BINDING: &str = "/bindings/coordinatorReviewProducer"; + let refuse = |pointer: String, message: &str, action: &str| { + anyhow::Error::from(plan::SemanticRefusal::new(&pointer, message, action)) + }; + let Some(binding) = &plan.bindings.coordinator_review_producer else { + let producers = runtime["connections"] + .as_object() + .is_some_and(|connections| { + connections + .values() + .any(|connection| connection["type"] == "casework-review-producer") + }); + if producers + && plan + .products + .iter() + .any(|entry| entry.product == Product::Casework) + { + return Err(refuse( + "/bindings".to_owned(), + "A Coordinator casework-review-producer connection needs bindings.coordinatorReviewProducer before Casework trusts it in this run.", + "Add bindings.coordinatorReviewProducer naming the connection, producer, identity, completion destination and run issuer guards.", + )); + } + return Ok(()); + }; + let unbound = runtime["connections"] + .as_object() + .is_some_and(|connections| { + connections.iter().any(|(name, connection)| { + name != &binding.connection && connection["type"] == "casework-review-producer" + }) + }); + if unbound { return Err(refuse( - "/bindings/bregReviewAuthority/producer".to_owned(), - "The Casework project has no trusted producer with this ID.", - "Set producer to a trustedProducers entry in casework.yaml.", + format!("{BINDING}/connection"), + "Another Coordinator casework-review-producer connection has no binding, so Casework would not trust it in this run.", + "Keep one casework-review-producer connection, the one this binding names.", )); } - let text = |member: &str| producer[member].as_str().unwrap_or_default(); - let expected = &guard.producer; - if text("issuer") != expected.expected_issuer { + let connection = &runtime["connections"][&binding.connection]; + if connection["type"] != "casework-review-producer" { return Err(refuse( - format!("{RUN_ISSUER_BINDING}/producer/expectedIssuer"), - "The producer's issuer in casework.yaml is not the issuer the binding expects.", - "Set expectedIssuer to the issuer the Casework project pins for this producer.", + format!("{BINDING}/connection"), + "The Coordinator runtime.yaml has no casework-review-producer connection with this name.", + "Set connection to the Coordinator connection that submits review requests to Casework.", )); } - if text("profile") != expected.expected_profile || grant.profile != expected.expected_profile { + if connection["producer"].as_str() != Some(binding.producer.as_str()) { return Err(refuse( - format!("{RUN_ISSUER_BINDING}/producer/expectedProfile"), - "The producer's profile in casework.yaml, the binding and the identity's Casework grant must be the same profile.", - "Set expectedProfile and the identity's Casework grant profile to the producer's profile.", + format!("{BINDING}/producer"), + "The Coordinator connection names another Casework producer.", + "Set producer to the producer the Coordinator connection names.", )); } - if text("subject") != expected.expected_subject || identity.subject != expected.expected_subject - { + let grant = &plan.people[&binding.identity].grants[&Product::Casework]; + if connection["profile"].as_str() != Some(grant.profile.as_str()) { return Err(refuse( - format!("{RUN_ISSUER_BINDING}/producer/expectedSubject"), - "The producer's subject in casework.yaml, the binding and the identity's subject must be the same subject.", - "Set expectedSubject and the identity's subject to the producer's subject.", + format!("{BINDING}/connection"), + "The Coordinator connection's profile is not the identity's Casework grant profile.", + "Set the connection's profile to the producer's Casework profile.", )); } - let required = document["accessProfiles"][&expected.expected_profile]["requiredScopes"] - .as_array() - .cloned() - .unwrap_or_default(); - if let Some(missing) = required - .iter() - .filter_map(Value::as_str) - .find(|scope| !grant.scopes.iter().any(|granted| granted == scope)) - { + let Some(recipient) = connection["completion"]["recipientBinding"].as_str() else { + return Err(refuse( + format!("{BINDING}/connection"), + "The Coordinator connection has no completion, so Casework could not wake the waiting run.", + "Add completion with the recipientBinding casework.yaml names; the run supplies its key.", + )); + }; + let document = checked_casework_run_issuer(plan, casework)?; + let completion = &document["trustedProducers"][&binding.producer]["completion"]; + if completion["destinationId"].as_str() != Some(binding.completion_destination.as_str()) { return Err(refuse( - format!("{person}/roles"), - &format!("The identity's Casework grant lacks the scope {missing} that the producer's profile requires."), - "Assign a role whose Casework profile supplies the required scope.", + format!("{BINDING}/completionDestination"), + "The producer's completion destination in casework.yaml is not the binding's.", + "Set completionDestination to the producer's completion destinationId in casework.yaml.", )); } - if let Some(initiator) = &guard.initiator { - if producer["trustedInitiatorIssuer"].as_str() != Some(initiator.expected_issuer.as_str()) { - return Err(refuse( - format!("{RUN_ISSUER_BINDING}/initiator/expectedIssuer"), - "The producer's trustedInitiatorIssuer in casework.yaml is not the issuer the binding expects.", - "Set expectedIssuer to the trustedInitiatorIssuer the Casework project pins for this producer.", - )); + if completion["recipientBinding"].as_str() != Some(recipient) { + return Err(refuse( + format!("{BINDING}/connection"), + "The Coordinator connection's completion recipientBinding is not the one casework.yaml names for this producer.", + "Use the same recipientBinding in the Coordinator connection and the producer's completion.", + )); + } + Ok(()) +} + +/// The run input for each preview actor, in name order: one gateway origin +/// per actor, the first on the run's reserved address and every further actor +/// on its own reserved listener, with a credential file, audience and pinned +/// profile (none for the Coordinator) for each product the actor reaches. +pub(super) struct PreviewActorInputs { + /// The `preview.actors` run input. + pub actors: Vec, + /// Each actor's name and gateway origin. + pub origins: Vec<(String, String)>, + /// The further actors' reserved listeners, held until their gateways bind. + pub held: Vec, +} + +pub(super) fn preview_actor_inputs( + plan: &Plan, + build: &super::preview::BuildPlan, + authorization: &super::preview::PreviewAuthorization, + urls: &BTreeMap, + first: (&str, u16), +) -> Result { + let mut actors = Vec::new(); + let mut origins = Vec::new(); + let mut held = Vec::new(); + for (index, (name, files)) in authorization.actors.iter().enumerate() { + let (actor_origin, port) = if index == 0 { + (first.0.to_owned(), first.1) + } else { + let listener = TcpListener::bind((Ipv4Addr::LOCALHOST, 0)) + .context("reserve preview actor loopback listener") + .map_err(operational)?; + let address = listener.local_addr()?; + held.push(listener); + (format!("http://{address}"), address.port()) + }; + let person = plan.people.get(name).context("missing preview actor")?; + let mut products = serde_json::Map::new(); + for (product, file) in files { + let id = if *product == Product::Breg { + build.product.id.as_str().to_owned() + } else { + build + .route_products + .iter() + .find(|route| route.kind == product.name()) + .context("missing preview route product")? + .id + .as_str() + .to_owned() + }; + let profile = if *product == Product::Coordinator { + None + } else { + Some( + person + .grants + .get(product) + .context("missing preview actor grant")? + .profile + .clone(), + ) + }; + products.insert( + id, + json!({ + "baseUrl": urls.get(product).context("missing preview product origin")?, + "audience": plan.product(*product).audience, + "profile": profile, + "authorizationFile": file, + }), + ); } + origins.push((name.clone(), actor_origin.clone())); + actors.push(json!({ + "name": name, "origin": actor_origin, "port": port, "products": products, + })); } - Ok(document) + Ok(PreviewActorInputs { + actors, + origins, + held, + }) +} + +/// Refuses, at the dev.yaml pointer, a Coordinator BReg client binding whose +/// connection is not a `breg` connection without task authority, using the +/// identity's BReg grant profile. `check` runs this before any product starts +/// and `start` again before rendering the Coordinator. +fn checked_coordinator_breg_client(plan: &Plan, coordinator: &Path) -> Result<()> { + if plan.bindings.coordinator_breg_client.is_none() { + return Ok(()); + } + let runtime = authored_document(&coordinator.join("runtime.yaml"))?; + checked_coordinator_breg_runtime(plan, &runtime) +} + +/// The same check over a Coordinator runtime document already read, so +/// `start` checks exactly the document it renders. +fn checked_coordinator_breg_runtime(plan: &Plan, runtime: &Value) -> Result<()> { + const CONNECTION: &str = "/bindings/coordinatorBregClient/connection"; + let Some(binding) = &plan.bindings.coordinator_breg_client else { + return Ok(()); + }; + let refuse = |message: &str, action: &str| { + Err(anyhow::Error::from(plan::SemanticRefusal::new( + CONNECTION, message, action, + ))) + }; + let connection = &runtime["connections"][&binding.connection]; + if connection["type"] != "breg" { + return refuse( + "The Coordinator runtime.yaml has no breg connection with this name.", + "Set connection to the Coordinator connection that invokes BReg Actions.", + ); + } + if !connection["authorization"]["taskAuthority"].is_null() { + return refuse( + "The connection delegates to task authority, which this binding never supplies.", + "Remove taskAuthority from the bound connection.", + ); + } + let grant = &plan.people[&binding.identity].grants[&Product::Breg]; + if connection["profile"].as_str() != Some(grant.profile.as_str()) { + return refuse( + "The connection's profile is not the identity's BReg grant profile.", + "Set the connection's profile to the identity's BReg grant profile.", + ); + } + Ok(()) } /// Only a reserved loopback run URL is bound, never a remote issuer. @@ -4412,7 +4733,391 @@ mod tests { identity: "context-reader".to_owned(), action: "review-action".to_owned(), }), + coordinator_review_producer: None, + coordinator_breg_client: None, + } + } + + /// A Casework and Coordinator plan whose Coordinator `review` connection is + /// bound as the `coordinator` producer, with its casework.yaml and the + /// Coordinator runtime.yaml. + fn coordinator_producer_fixture() -> (Value, Value, Value) { + let plan = json!({ + "issuer": "http://127.0.0.1:41000/", + "products": [ + {"product": "casework", "project": "casework", "audience": "review"}, + {"product": "coordinator", "project": "coordinator", "audience": "urn:coordinator"} + ], + "people": {"coordinator": { + "subject": "coordinator-producer", "client": "coordinator-client", + "grants": {"casework": {"profile": "coordinator-producer", "scopes": ["review.write"]}} + }}, + "journeyFile": "dev-journeys.yaml", + "bindings": {"coordinatorReviewProducer": { + "connection": "review", "producer": "coordinator", "identity": "coordinator", + "completionDestination": "coordinator-wake", + "runIssuerBinding": {"producer": { + "expectedIssuer": PRODUCER_ISSUER, + "expectedProfile": "coordinator-producer", + "expectedSubject": "coordinator-producer" + }} + }} + }); + let casework = json!({ + "name": "synthetic-project", + "accessProfiles": {"coordinator-producer": {"requiredScopes": ["review.write"]}}, + "trustedProducers": { + "coordinator": { + "issuer": PRODUCER_ISSUER, "profile": "coordinator-producer", + "subject": "coordinator-producer", + "completion": {"destinationId": "coordinator-wake", "recipientBinding": "coordinator-v1"} + }, + "other-producer": {"issuer": "https://other.example.invalid/"} + } + }); + let coordinator = json!({"connections": {"review": { + "type": "casework-review-producer", "baseUrl": "http://127.0.0.1:1", + "profile": "coordinator-producer", "producer": "coordinator", + "completion": {"recipientBinding": "coordinator-v1", "hmacSha256KeyRef": "secret:file/authored"} + }}}); + (plan, casework, coordinator) + } + + fn coordinator_producer_projects( + root: &Path, + casework: &Value, + coordinator: &Value, + ) -> (PathBuf, PathBuf) { + let casework = write_casework_project(root, casework); + let project = root.join("coordinator"); + fs::create_dir(&project).unwrap(); + fs::write( + project.join("runtime.yaml"), + serde_norway::to_string(coordinator).unwrap(), + ) + .unwrap(); + (casework, project) + } + + #[test] + fn a_coordinator_review_producer_refuses_each_mismatch_at_its_pointer() { + type Break = fn(&mut Value, &mut Value, &mut Value); + // Each case names its pointer and a fragment of its own refusal, so + // two refusals at one pointer cannot stand in for each other. + const BINDING: &str = "/bindings/coordinatorReviewProducer"; + let cases: [(&str, String, &str, Break); 13] = [ + ( + "the producer issuer differs from the binding", + format!("{BINDING}/runIssuerBinding/producer/expectedIssuer"), + "issuer in casework.yaml", + |_, casework, _| { + casework["trustedProducers"]["coordinator"]["issuer"] = + json!("https://elsewhere.example.invalid/") + }, + ), + ( + "casework.yaml profile differs from the binding", + format!("{BINDING}/runIssuerBinding/producer/expectedProfile"), + "profile in casework.yaml", + |_, casework, _| { + casework["trustedProducers"]["coordinator"]["profile"] = json!("other-profile") + }, + ), + ( + "the identity subject differs from the binding", + format!("{BINDING}/runIssuerBinding/producer/expectedSubject"), + "subject in casework.yaml", + |plan, _, _| plan["people"]["coordinator"]["subject"] = json!("someone-else"), + ), + ( + "the producer is not in casework.yaml", + format!("{BINDING}/producer"), + "no trusted producer", + |_, casework, _| { + casework["trustedProducers"] + .as_object_mut() + .unwrap() + .remove("coordinator"); + }, + ), + ( + "the connection is missing", + format!("{BINDING}/connection"), + "no casework-review-producer connection", + |_, _, coordinator| { + coordinator["connections"] + .as_object_mut() + .unwrap() + .remove("review"); + }, + ), + ( + "the connection is of another type", + format!("{BINDING}/connection"), + "no casework-review-producer connection", + |_, _, coordinator| coordinator["connections"]["review"]["type"] = json!("breg"), + ), + ( + "the connection names another producer", + format!("{BINDING}/producer"), + "names another Casework producer", + |_, _, coordinator| { + coordinator["connections"]["review"]["producer"] = json!("other-producer") + }, + ), + ( + "the connection profile differs from the grant", + format!("{BINDING}/connection"), + "profile is not the identity", + |_, _, coordinator| { + coordinator["connections"]["review"]["profile"] = json!("other-profile") + }, + ), + ( + "the producer has no completion destination", + format!("{BINDING}/completionDestination"), + "completion destination in casework.yaml", + |_, casework, _| { + casework["trustedProducers"]["coordinator"] + .as_object_mut() + .unwrap() + .remove("completion"); + }, + ), + ( + "the completion destination differs", + format!("{BINDING}/completionDestination"), + "completion destination in casework.yaml", + |_, casework, _| { + casework["trustedProducers"]["coordinator"]["completion"]["destinationId"] = + json!("elsewhere") + }, + ), + ( + "the recipient binding differs", + format!("{BINDING}/connection"), + "recipientBinding is not", + |_, _, coordinator| { + coordinator["connections"]["review"]["completion"]["recipientBinding"] = + json!("other-v1") + }, + ), + ( + "the connection has no completion key", + format!("{BINDING}/connection"), + "has no completion", + |_, _, coordinator| { + coordinator["connections"]["review"] + .as_object_mut() + .unwrap() + .remove("completion"); + }, + ), + ( + "a second casework-review-producer connection is unbound", + format!("{BINDING}/connection"), + "Another Coordinator", + |_, _, coordinator| { + let second = coordinator["connections"]["review"].clone(); + coordinator["connections"]["second-review"] = second; + }, + ), + ]; + let root = tempfile::tempdir().unwrap(); + for (index, (name, pointer, fragment, break_it)) in cases.into_iter().enumerate() { + let (mut plan, mut casework, mut coordinator) = coordinator_producer_fixture(); + break_it(&mut plan, &mut casework, &mut coordinator); + let case_root = root.path().join(index.to_string()); + fs::create_dir(&case_root).unwrap(); + let (casework, coordinator) = + coordinator_producer_projects(&case_root, &casework, &coordinator); + let plan: Plan = serde_json::from_value(plan).unwrap(); + let error = + checked_coordinator_review_producer(&plan, &casework, &coordinator).unwrap_err(); + let refusal = error + .downcast_ref::() + .unwrap_or_else(|| panic!("{name}: not a semantic refusal: {error}")); + assert!( + refusal + .to_string() + .starts_with(&format!("dev.yaml {pointer}: ")) + && refusal.to_string().contains(fragment), + "{name}: {refusal}" + ); + } + } + + #[test] + fn a_coordinator_casework_producer_without_its_binding_is_refused() { + let root = tempfile::tempdir().unwrap(); + let (mut plan, casework, coordinator) = coordinator_producer_fixture(); + plan.as_object_mut().unwrap().remove("bindings"); + let (casework, coordinator) = + coordinator_producer_projects(root.path(), &casework, &coordinator); + let plan: Plan = serde_json::from_value(plan).unwrap(); + let error = + checked_coordinator_review_producer(&plan, &casework, &coordinator).unwrap_err(); + let refusal = error.downcast_ref::().unwrap(); + assert!( + refusal.to_string().starts_with("dev.yaml /bindings: "), + "{refusal}" + ); + assert!( + refusal.to_string().contains("coordinatorReviewProducer"), + "{refusal}" + ); + } + + #[test] + fn a_bound_coordinator_producer_trusts_only_the_run_issuer_for_that_producer() { + let root = tempfile::tempdir().unwrap(); + let (plan, casework, coordinator) = coordinator_producer_fixture(); + let (project, coordinator_project) = + coordinator_producer_projects(root.path(), &casework, &coordinator); + let plan: Plan = serde_json::from_value(plan).unwrap(); + checked_coordinator_review_producer(&plan, &project, &coordinator_project).unwrap(); + assert!(has_run_source(&plan)); + let bound = root.path().join("bound"); + bind_casework_run_issuer(&plan, &project, &bound).unwrap(); + // Only the bound producer's issuer changes; every other member of the + // document stays exactly as written. + let mut expected = casework.clone(); + expected["trustedProducers"]["coordinator"]["issuer"] = json!(plan.issuer); + let document = authored_document(&bound.join("casework.yaml")).unwrap(); + assert_eq!(document, expected); + } + + #[test] + fn both_bound_producers_are_checked_and_rebound() { + let (breg_plan, breg_casework) = run_issuer_fixture(false); + let (mut plan, mut casework, _) = coordinator_producer_fixture(); + plan["products"] + .as_array_mut() + .unwrap() + .push(json!({"product": "breg", "project": "breg", "audience": "registry"})); + plan["people"]["authority"] = breg_plan["people"]["authority"].clone(); + plan["bindings"]["bregReviewAuthority"] = + breg_plan["bindings"]["bregReviewAuthority"].clone(); + casework["accessProfiles"]["review-producer"] = + breg_casework["accessProfiles"]["review-producer"].clone(); + casework["trustedProducers"]["producer"] = + breg_casework["trustedProducers"]["producer"].clone(); + let root = tempfile::tempdir().unwrap(); + let project = write_casework_project(root.path(), &casework); + let checked: Plan = serde_json::from_value(plan.clone()).unwrap(); + let bound = root.path().join("bound"); + bind_casework_run_issuer(&checked, &project, &bound).unwrap(); + let mut expected = casework.clone(); + expected["trustedProducers"]["producer"]["issuer"] = json!(checked.issuer); + expected["trustedProducers"]["coordinator"]["issuer"] = json!(checked.issuer); + assert_eq!( + authored_document(&bound.join("casework.yaml")).unwrap(), + expected + ); + + // The second producer's guards are checked as well as the first's. + let mut broken = casework.clone(); + broken["trustedProducers"]["coordinator"]["issuer"] = + json!("https://elsewhere.example.invalid/"); + let other = root.path().join("broken"); + fs::create_dir(&other).unwrap(); + let project = write_casework_project(&other, &broken); + let error = checked_casework_run_issuer(&checked, &project).unwrap_err(); + assert!( + error.to_string().contains( + "/bindings/coordinatorReviewProducer/runIssuerBinding/producer/expectedIssuer" + ), + "{error}" + ); + } + + #[test] + fn a_coordinator_breg_client_refuses_each_mismatch_at_its_connection() { + const CONNECTION: &str = "/bindings/coordinatorBregClient/connection"; + let plan: Plan = serde_json::from_value(json!({ + "issuer": "http://127.0.0.1:41000/", + "products": [ + {"product": "breg", "project": "breg", "audience": "registry"}, + {"product": "coordinator", "project": "coordinator", "audience": "urn:coordinator"} + ], + "people": {"coordinator": { + "subject": "coordinator-service", "client": "coordinator-client", + "grants": {"breg": {"profile": "permit-coordinator", "scopes": ["registry:actions:invoke"]}} + }}, + "journeyFile": "dev-journeys.yaml", + "bindings": {"coordinatorBregClient": {"connection": "registry", "identity": "coordinator"}} + })) + .unwrap(); + let connection = json!({ + "type": "breg", "baseUrl": "http://127.0.0.1:1", "profile": "permit-coordinator" + }); + type Break = fn(&mut Value); + // Each case names a fragment of its own refusal. + let cases: [(&str, &str, Break); 4] = [ + ( + "the connection is missing", + "no breg connection", + |runtime| { + runtime["connections"] + .as_object_mut() + .unwrap() + .remove("registry"); + }, + ), + ( + "the connection is of another type", + "no breg connection", + |runtime| { + runtime["connections"]["registry"]["type"] = json!("messaging"); + }, + ), + ( + "the connection names another profile", + "grant profile", + |runtime| { + runtime["connections"]["registry"]["profile"] = json!("permit-reader"); + }, + ), + ( + "the connection delegates to task authority", + "task authority", + |runtime| { + runtime["connections"]["registry"]["authorization"] = + json!({"taskAuthority": {"issuer": "https://casework.example"}}); + }, + ), + ]; + let root = tempfile::tempdir().unwrap(); + for (index, (name, fragment, break_it)) in cases.into_iter().enumerate() { + let mut runtime = json!({"connections": {"registry": connection.clone()}}); + break_it(&mut runtime); + let project = root.path().join(index.to_string()); + fs::create_dir(&project).unwrap(); + fs::write( + project.join("runtime.yaml"), + serde_norway::to_string(&runtime).unwrap(), + ) + .unwrap(); + let error = checked_coordinator_breg_client(&plan, &project).unwrap_err(); + let refusal = error + .downcast_ref::() + .unwrap_or_else(|| panic!("{name}: not a semantic refusal: {error}")); + assert!( + refusal + .to_string() + .starts_with(&format!("dev.yaml {CONNECTION}: ")) + && refusal.to_string().contains(fragment), + "{name}: {refusal}" + ); } + let project = root.path().join("accepted"); + fs::create_dir(&project).unwrap(); + fs::write( + project.join("runtime.yaml"), + serde_norway::to_string(&json!({"connections": {"registry": connection}})).unwrap(), + ) + .unwrap(); + checked_coordinator_breg_client(&plan, &project).unwrap(); } #[test] @@ -5470,7 +6175,7 @@ mod tests { workdir: root.to_path_buf(), environment, reservation, - function_host: None, + held: Vec::new(), health_path: "/health".to_owned(), }, port, @@ -5678,6 +6383,67 @@ mod tests { ) } + #[test] + fn start_rechecks_the_bound_breg_connection_it_renders() { + // check passed earlier; the runtime.yaml start renders has since + // changed the bound connection's profile. + let root = tempfile::tempdir().unwrap(); + let package = root.path().join("package"); + fs::create_dir(&package).unwrap(); + fs::write(package.join("SHA256SUMS"), b"test checksum file").unwrap(); + fs::write(root.path().join("workflow.yaml"), "project: {id: permits}").unwrap(); + fs::write( + root.path().join("runtime.yaml"), + "connections:\n registry:\n type: breg\n baseUrl: http://127.0.0.1:1\n profile: changed-profile\n", + ) + .unwrap(); + let mut input = breg_input(false); + input.plan.products = serde_json::from_value(json!([ + {"product": "breg", "project": ".", "audience": "registry"}, + {"product": "coordinator", "project": ".", "audience": "urn:example:local"} + ])) + .unwrap(); + input.plan.people.clear(); + input.plan.people.insert( + "coordinator".to_owned(), + serde_json::from_value(json!({ + "subject": "coordinator-service", "client": "coordinator-client", + "grants": {"breg": {"profile": "permit-coordinator", "scopes": ["registry:actions:invoke"]}} + })) + .unwrap(), + ); + input.plan.bindings = serde_json::from_value(json!({"coordinatorBregClient": { + "connection": "registry", "identity": "coordinator" + }})) + .unwrap(); + let terminate = AtomicBool::new(false); + let runner = ProductRunner::new(Arc::new(input), root.path(), &terminate).unwrap(); + let database = DatabaseUrls { + runtime: "postgresql://runtime@localhost/database".to_owned(), + migration: "postgresql://migration@localhost/database".to_owned(), + transport: DatabaseTransport::VerifiedTls, + }; + let error = runner + .additional_config( + Product::Coordinator, + root.path(), + "127.0.0.1:34567", + &package, + Some(&database), + ) + .unwrap_err(); + let refusal = error + .downcast_ref::() + .unwrap_or_else(|| panic!("not a semantic refusal: {error:#}")); + assert!( + refusal + .to_string() + .starts_with("dev.yaml /bindings/coordinatorBregClient/connection: ") + && refusal.to_string().contains("grant profile"), + "{refusal}" + ); + } + #[test] fn a_service_function_connection_names_the_preview_host_and_its_run_key() { use std::os::unix::fs::PermissionsExt; diff --git a/crates/registry-rstack-dev/src/roles.rs b/crates/registry-rstack-dev/src/roles.rs index fb9b5c0245..40e4df2679 100644 --- a/crates/registry-rstack-dev/src/roles.rs +++ b/crates/registry-rstack-dev/src/roles.rs @@ -231,6 +231,10 @@ pub(super) fn resolve( .values() .map(|person| person.client.clone()) .collect(), + bindings + .coordinator_review_producer + .as_ref() + .map(|binding| binding.completion_destination.as_str()), offline_check, )? }; diff --git a/crates/registry-rstack/tests/dev_run.rs b/crates/registry-rstack/tests/dev_run.rs index 3efade81b6..74a21f1fbc 100644 --- a/crates/registry-rstack/tests/dev_run.rs +++ b/crates/registry-rstack/tests/dev_run.rs @@ -2532,6 +2532,146 @@ fn check_refuses_binding_configuration_the_products_would_refuse_at_the_plan_fie } } +/// `rstack dev check` over the permit-review preview, with the real BReg, +/// Casework and Coordinator tools, before any product starts. +fn check_permit_review(root: &std::path::Path, state: &std::path::Path) -> std::process::Output { + rstack_dev(state, true) + .args(["check", utf8(root), "--deny-warnings"]) + .env("RSTACK_CASEWORKCTL_BIN", host("caseworkctl")) + .env("RSTACK_COORDINATORCTL_BIN", host("coordinatorctl")) + .env("RSTACK_COORDINATOR_BIN", system_binary("false")) + .output() + .unwrap() +} + +#[test] +fn permit_review_check_refuses_each_widened_coordinator_binding_at_its_dev_yaml_field() { + let source = example_project("platform/examples/service-previews/permit-review"); + let copy = |root: &std::path::Path| { + fs::create_dir_all(root).unwrap(); + for entry in fs::read_dir(&source).unwrap() { + let entry = entry.unwrap(); + if entry.file_name() == "node_modules" { + continue; + } + let target = root.join(entry.file_name()); + if entry.file_type().unwrap().is_dir() { + copy_tree(&entry.path(), &target); + } else { + fs::copy(entry.path(), target).unwrap(); + } + } + }; + + let scratch = tempfile::tempdir().unwrap(); + let state = scratch.path().join("state"); + let root = scratch.path().join("permit-review"); + copy(&root); + let checked = check_permit_review(&root, &state); + assert!( + checked.status.success(), + "{} {}", + String::from_utf8_lossy(&checked.stdout), + String::from_utf8_lossy(&checked.stderr) + ); + assert!(!state.exists()); + + let unbound_review = concat!( + " review-copy:\n", + " type: casework-review-producer\n", + " baseUrl: https://casework.example.org\n", + " profile: coordinator-producer\n", + " producer: coordinator\n", + " authorization:\n", + " tokenEndpoint: https://identity.permit-review.example.test/oauth/token\n", + " clientAssertionAudience: https://identity.permit-review.example.test\n", + " clientId: coordinator-producer\n", + " signingKeyRef: secret:file/review-client-key\n", + " resource: urn:example:permit-review\n", + " scopes: [casework:permit:review]\n", + " completion:\n", + " recipientBinding: coordinator-copy\n", + " hmacSha256KeyRef: secret:file/review-completion-key\n", + " permits:\n", + ); + for (case, edits, path, message) in [ + ( + // Casework refuses first: its producer names a completion + // destination that only the binding configures. + "producer binding removed", + vec![("dev.yaml", " coordinatorReviewProducer:\n connection: review\n producer: coordinator\n identity: coordinator-producer\n completionDestination: coordinator-wake\n runIssuerBinding:\n producer:\n expectedIssuer: https://identity.permit-review.example.test\n expectedProfile: coordinator-producer\n expectedSubject: coordinator-producer\n", "")], + "/products/casework/path", + "The owning casework tool refused this project's identity facts (casework.runtime.unconfigured-review-completion-destination).", + ), + ( + "producer binding and completion removed", + vec![ + ("dev.yaml", " coordinatorReviewProducer:\n connection: review\n producer: coordinator\n identity: coordinator-producer\n completionDestination: coordinator-wake\n runIssuerBinding:\n producer:\n expectedIssuer: https://identity.permit-review.example.test\n expectedProfile: coordinator-producer\n expectedSubject: coordinator-producer\n", ""), + ( + "casework/casework.yaml", + " completion:\n destinationId: coordinator-wake\n recipientBinding: coordinator-v1\n", + "", + ), + ], + "/bindings", + "A Coordinator casework-review-producer connection needs bindings.coordinatorReviewProducer before Casework trusts it in this run.", + ), + ( + "second producer connection", + vec![("coordinator/runtime.yaml", " permits:\n", unbound_review)], + "/bindings/coordinatorReviewProducer/connection", + "Another Coordinator casework-review-producer connection has no binding, so Casework would not trust it in this run.", + ), + ( + // The facts runtime configures the binding's destination, so + // Casework refuses the producer's unconfigured one first. + "completion destination", + vec![("dev.yaml", "completionDestination: coordinator-wake", "completionDestination: another-wake")], + "/products/casework/path", + "The owning casework tool refused this project's identity facts (casework.runtime.unconfigured-review-completion-destination).", + ), + ( + "BReg profile", + vec![("coordinator/runtime.yaml", " profile: permit-coordinator\n", " profile: permit-reader\n")], + "/bindings/coordinatorBregClient/connection", + "The connection's profile is not the identity's BReg grant profile.", + ), + ( + "BReg connection", + vec![("dev.yaml", " connection: permits\n", " connection: review\n")], + "/bindings/coordinatorBregClient/connection", + "The Coordinator runtime.yaml has no breg connection with this name.", + ), + ( + "BReg identity shared with a preview actor", + vec![("dev.yaml", " connection: permits\n identity: coordinator-service\n", " connection: permits\n identity: applicant\n")], + "/bindings/coordinatorBregClient/identity", + "The Coordinator's BReg identity must be a dedicated machine person that no other binding or preview actor uses.", + ), + ] { + let scratch = tempfile::tempdir().unwrap(); + let state = scratch.path().join("state"); + let root = scratch.path().join("permit-review"); + copy(&root); + for (file, from, to) in edits { + let edited = root.join(file); + let text = fs::read_to_string(&edited).unwrap(); + assert_eq!(text.matches(from).count(), 1, "{case}: {file}"); + fs::write(&edited, text.replace(from, to)).unwrap(); + } + + let checked = check_permit_review(&root, &state); + + assert_eq!(checked.status.code(), Some(1), "{case}: {checked:?}"); + let report: serde_json::Value = serde_json::from_slice(&checked.stdout).unwrap(); + assert_eq!(report["status"], "domain-refusal", "{case}: {report}"); + let diagnostic = &report["diagnostics"][0]; + assert_eq!(diagnostic["path"], path, "{case}: {diagnostic}"); + assert_eq!(diagnostic["message"], message, "{case}: {diagnostic}"); + assert!(!state.exists(), "{case}"); + } +} + #[test] fn check_refuses_a_context_provider_binding_with_the_rule_caseworkctl_check_names() { let scratch = tempfile::tempdir().unwrap(); diff --git a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx index d75ffdc588..78b3361b4b 100644 --- a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx +++ b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx @@ -68,11 +68,50 @@ origin policy and provide no authentication of local processes. The separate function listener requires a private handoff from the gateway and returns 401 to an anonymous function request. +To show several identities at once, replace `actor` and `breg` with `actors`. Each actor is a +declared person with a BReg grant, and lists the BReg, Casework and Coordinator paths it may +reach, with a grant for each of those products. The run serves the same built page to each +actor on its own loopback gateway origin, with that actor's own credential and profile for each +product. The terminal prints one `Actor NAME URL` line for each actor, and the JSON report +lists the same origins under `previewActors`. The `application` URL is the first actor's, in +name order. One origin per actor is a development substitution for one origin with real +sign-in: the terminal prints it on a `Substitution` line, and the JSON report lists it under +`substitutions`. +Casework and the Coordinator are reachable only through `actors`, by their service product ID +under `/registry/`, and the Coordinator path takes no query. An actors preview reaches one +Casework project and one Coordinator project at most. +Every actor has a BReg grant, so every preview function is callable from every actor's origin, +and runs under that actor's own BReg credential. +One built page serves every actor, so it asks its own origin which actor it serves: +`GET /_rstack/actor` answers `{"actor": NAME}`. It carries no credential and selects nothing, +and it answers only the page: a request without `Registry-Client: page`, or with a foreign +`Origin` or a cross-site `Sec-Fetch-Site`, gets 403. +The generated client names no Proposal author in an actors preview, because each actor's +origin pins its own BReg profile. A register with Proposals therefore needs the single-actor +form, and the build refuses it in an actors preview. +A path may hold one `{recordId}`, `{taskId}` or `{runId}` segment, each matching only a UUID, +for any product. The name documents the path and does not restrict where it may appear. + +```yaml +preview: + page: / + functions: [assess-permit] + actors: + applicant: + breg: {post: [/v1/actions/submit-application]} + coordinator: {get: [/v1/workflows/permit-flow, "/v1/runs/{runId}"], post: [/v1/runs]} + officer: + casework: {get: [/v1/review-tasks], post: ["/v1/review-tasks/{taskId}/decisions"]} +``` + A Coordinator `service-function` connection calls a preview function directly. The run reserves the function listener's loopback port before products start and writes one owner-only host key for the run, which the Coordinator presents as its bearer. The function listener then hands the function a fixed placeholder bearer instead of the key, so the key never leaves the listener and no product accepts what the function receives. +Only the generated server binding hides the caller's headers from the handler. A function +runs inside the function listener's process, at its trust level, so a function that does not +export the generated binding reads the raw request, which by then carries the placeholder. The same function stays callable from the page through the gateway, with the page actor's authority, so write a Coordinator-bound function for both callers. One run key admits the gateway and the Coordinator to every preview function, not only the @@ -1044,6 +1083,101 @@ The worker holds the reservation until cleanup. crates/registry-rstack-dev/src/lib.rs casework-bound; crates/registry-rstack/tests/dev_run.rs casework_run_issuer_mismatch_names_the_dev_yaml_pointer. */} +### Bind the Coordinator as a Casework review producer + +A development plan with the Coordinator and Casework may bind one Coordinator +`casework-review-producer` connection to one existing Casework trusted producer. +Use `issuer: run`. A plan with such a connection and no binding is refused. + +```yaml +bindings: + coordinatorReviewProducer: + connection: review + producer: coordinator + identity: coordinator-producer + completionDestination: coordinator-wake + runIssuerBinding: + producer: + expectedIssuer: https://issuer.example.test + expectedProfile: coordinator-producer + expectedSubject: coordinator-producer +``` + +`check` refuses, at the `dev.yaml` pointer, a binding that does not match exactly: + +- the Coordinator `runtime.yaml` must name `connection` with type `casework-review-producer`, + the same `producer`, the identity's Casework grant profile, and a `completion`; +- `casework.yaml` must trust `producer` with exactly the expected issuer, profile and subject, + the identity's subject and profile must match, and its Casework grant must include the + profile's required scopes; +- the producer's `completion` must name `completionDestination` and the connection's + `recipientBinding`. + +`check` reads each product's identity facts with the binding's completion destination +configured, as the run configures it. So when the binding is missing, or its +`completionDestination` differs from the producer's, Casework refuses the project first, at the +Casework project path, with `casework.runtime.unconfigured-review-completion-destination`. The +binding's own diagnostic at the `dev.yaml` pointer follows once Casework accepts the project. + +An `initiator` guard is refused, as is a producer the BReg review authority binding already +binds and a second `casework-review-producer` connection. The binding creates no producer, +person, profile, client, scope or grant: it registers the existing test person's `client` on +the run-local token endpoint with a per-run key. Like the BReg binding, the producer token carries +the identity's whole Casework grant, which may include scopes beyond the required ones. +`start` writes the run issuer into that one producer in a private copy of the Casework +project, as the BReg binding does. It gives the Coordinator connection the Casework origin, +the identity's Casework profile and a machine client on the run-local token endpoint, so its +token carries the identity's subject and Casework audience. It binds Casework's completion +destination to the Coordinator's review completion route. Both sides use one owner-only key +of random bytes written for the run, so Casework wakes the waiting run. The permit-review service +preview's browser journey runs this binding with the real Casework and Coordinator: the +Coordinator refuses, with 401, a completion that the run key did not sign, and the run keeps +waiting until Casework sends the officer's decision. +A live Coordinator run binds the connection's address, and the Casework origin changes with +each start. Let a waiting Coordinator run finish, or start with `--clean`, before you start again. + +{/* Evidence: crates/registry-rstack-dev/src/bindings.rs coordinatorReviewProducer, + the_coordinator_review_producer_renders_both_sides_with_one_run_key, + the_coordinator_obtains_a_producer_token_from_the_run_token_server; + crates/registry-rstack-dev/src/products.rs checked_coordinator_review_producer, + a_coordinator_review_producer_refuses_each_mismatch_at_its_pointer, + a_coordinator_casework_producer_without_its_binding_is_refused. */} + +### Give the Coordinator a BReg identity + +A development plan with the Coordinator and BReg may give one Coordinator `breg` connection +a machine identity on the run-local token endpoint: + +```yaml +bindings: + coordinatorBregClient: + connection: registry + identity: coordinator-service +``` + +The identity's BReg grant is the only source of the connection's profile and scopes, and the +Coordinator's token carries that whole grant. +Use a dedicated machine person: BReg attributes every Coordinator call to it, so `check` +refuses an identity that another binding, a preview actor or a journey step uses, and a plan +with `externalJwksUri`, whose products would not trust the run-local endpoint's tokens. +`start` replaces the connection's `baseUrl` with the run's BReg origin and its whole +`authorization` with the run-local client, so no authored scope, resource or task authority +remains. BReg's own access profile and Action rules decide every call. +`check` refuses, at `/bindings/coordinatorBregClient/connection`, a connection that is not a +`breg` connection, delegates to task authority, or names a profile other than the identity's +BReg grant profile, and `start` checks the runtime document it renders again. Like every +`rstack dev` binding, it exists only in development: `rstack dev check` and `start` refuse any +other declared posture before reading the plan. + +{/* Evidence: crates/registry-rstack-dev/src/bindings.rs coordinatorBregClient, + the_coordinator_breg_client_takes_profile_and_scopes_from_the_grant_only, + the_coordinator_obtains_a_breg_token_for_its_bound_identity, + crates/registry-rstack-dev/src/lib.rs require_development; + crates/registry-rstack/tests/dev_run.rs start_and_check_refuse_explicit_production_and_invalid_postures; + crates/registry-rstack-dev/src/products.rs checked_coordinator_breg_client, + a_coordinator_breg_client_refuses_each_mismatch_at_its_connection, + start_rechecks_the_bound_breg_connection_it_renders. */} + ### Explicit browser roles with separate human source credentials A paired BReg and Casework built application may declare `application.caseworkSourceCredentialRoles` as 1 through 32 distinct existing role identifiers. diff --git a/docs/site/src/content/docs/security/casework.mdx b/docs/site/src/content/docs/security/casework.mdx index 22ec3378a0..812aa5c5b7 100644 --- a/docs/site/src/content/docs/security/casework.mdx +++ b/docs/site/src/content/docs/security/casework.mdx @@ -145,6 +145,9 @@ grants in [Registry Casework task grants](../../reference/casework-task-grants/) alongside the `casework` header file. Casework applies its usual client, profile, and human-identity checks ([run isolation](../../configure/run-a-project-with-rstack-dev/#run-isolation)). + A development binding may rewrite one named trusted producer's issuer to the run issuer, in a + private copy of the project and only when its pinned issuer, profile and subject match exact + guards. The source project and production Casework are unchanged. {/* Evidence: crates/registry-cli-api/README.md, Security boundary. */} - Separate credentials for the same human: every current-source provider binding requires `humanSourceAuthentication.audience`, distinct from every Casework issuer entry's audience, and diff --git a/docs/site/src/content/docs/security/coordinator.mdx b/docs/site/src/content/docs/security/coordinator.mdx index ce2eef1109..07c4ac4ee2 100644 --- a/docs/site/src/content/docs/security/coordinator.mdx +++ b/docs/site/src/content/docs/security/coordinator.mdx @@ -892,6 +892,10 @@ Enforcement: or a `hostKeyRef` key only the function host accepts. `rstack dev` generates a per-run host key for the preview function host, and that host hands a Coordinator-called function a fixed placeholder bearer, never the key. + It also generates a separate per-run review completion key, shared only by the run's Casework + completion hook and Coordinator connection, and removes both keys first when the run stops. + Its Coordinator bindings also register per-run machine client signing keys for the review + producer and BReg connections, on the run-local token endpoint only. - The credential is distinct from every credential and product audience the runtime file declares. The runtime refuses a function `resource` equal to a product or external connection's `resource`, a task authority `bootstrapResource` or `exchangeAudience`, or the Coordinator's own diff --git a/products/platform/config-formats.yaml b/products/platform/config-formats.yaml index 5f97332f3a..d97c85b1f9 100644 --- a/products/platform/config-formats.yaml +++ b/products/platform/config-formats.yaml @@ -892,6 +892,16 @@ formats: whenOmitted: refused - pointer: /bindings/bregReviewAuthority/runIssuerBinding/initiator whenOmitted: closed + - pointer: /bindings/coordinatorReviewProducer + whenOmitted: closed + - pointer: /bindings/coordinatorReviewProducer/runIssuerBinding + whenOmitted: refused + - pointer: /bindings/coordinatorReviewProducer/runIssuerBinding/producer + whenOmitted: refused + - pointer: /bindings/coordinatorReviewProducer/completionDestination + whenOmitted: refused + - pointer: /bindings/coordinatorBregClient + whenOmitted: closed - pointer: /preview whenOmitted: closed - pointer: /preview/actor diff --git a/products/platform/examples/service-previews/README.md b/products/platform/examples/service-previews/README.md index 76c8f02840..03fb2d3ba9 100644 --- a/products/platform/examples/service-previews/README.md +++ b/products/platform/examples/service-previews/README.md @@ -1,9 +1,12 @@ # Local service previews -These two synthetic services run independently. Each uses a real BReg and a -managed development PostgreSQL database. +These three synthetic services run independently. Each uses a real BReg and a +managed development PostgreSQL database. The permit-review service also runs +a real Casework and Coordinator. Install `rstack`, `breg`, and `bregctl` from the same Registry Stack release. +The permit-review service also needs `casework`, `caseworkctl`, `coordinator` +and `coordinatorctl` from that release. Use Node 24 and a local Docker engine. Each starter has an exact npm lock. Place the matching release's `@registrystack/client` tarball beside that starter's lockfile as `registry-preview-client.tgz`, then install: @@ -11,19 +14,21 @@ starter's lockfile as `registry-preview-client.tgz`, then install: ```sh npm ci --prefix ./medical-renewal npm ci --prefix ./business-registration +npm ci --prefix ./permit-review ``` The lock matches the tarball by version and SHA-512. The client package supplies -the preview helper and build tools for both examples. +the preview helper and build tools for every example. -From a directory containing clean copies of the examples, start either preview. +From a directory containing clean copies of the examples, start any preview. ```sh rstack dev start ./medical-renewal rstack dev start ./business-registration +rstack dev start ./permit-review ``` -Open the URL each command prints. Use its run ID to check or stop the preview. +Open the URL each command prints. The permit-review start prints one `Actor` URL per synthetic person. Use its run ID to check or stop the preview. ```sh rstack dev status RUN_ID @@ -33,11 +38,13 @@ rstack dev stop RUN_ID --clean A clean stop removes the run's managed data. After editing a function or page, start the example again to build from the updated source. -Both services declare `ui.project: web` and `ui.output: dist`. Preview start +Every service declares `ui.project: web` and `ui.output: dist`. Preview start bundles `web/src/page.ts` into `app.js` and copies `web/public` into the run's owned output. It generates `generated/service.ts`, `generated/routes.ts` and the server binding inside the run's copy. The page imports the generated browser client and same-origin function paths. The gateway authorizes browser-origin requests for one synthetic actor. +The permit-review service runs one gateway per actor, each on its own origin over +the same built page, as a development substitution for one origin with sign-in. It keeps that actor's credential on the server. Use a trusted workstation or an isolated runner, trusted project code, and synthetic data. The numeric loopback listeners are local to the host and reachable by @@ -62,7 +69,25 @@ absolute examples directory. Set `RSTACK_PREVIEW_INSTALL_ROOT` and `RSTACK_PREVIEW_BIN_DIR` to the managed candidate installation's absolute roots. The driver uses those roots and checks that `npm ci` preserves the delivered files. Both modes check the browser reads and mutations and managed -database cleanup. +database cleanup. For permit-review, the driver opens the applicant and officer +origins in two browser contexts and checks that every actor origin serves the +same page bytes. It also checks that: + +- Casework refuses the applicant's decision with 403. +- the Coordinator refuses a completion Casework did not sign with 401. +- the neighbour's origin cannot read the applicant's run. +- the officer's approval finishes the run with the decision recorded in BReg. +- a start the browser rewrites to name the neighbour's application reviews and + decides only that stored application. It leaves the applicant's own + application submitted. + +The driver takes the Casework and Coordinator binaries from `RSTACK_CASEWORK_BIN`, +`RSTACK_CASEWORKCTL_BIN`, `RSTACK_COORDINATOR_BIN` and `RSTACK_COORDINATORCTL_BIN`, +or from the managed installation. A managed candidate whose release ships no +Coordinator sets `RSTACK_PREVIEW_SKIP_PERMIT_REVIEW=no-coordinator-in-release`. +The driver then reports permit-review as skipped. Any other run fails when +those components are missing. - [Renew a medical licence](medical-renewal/README.md) - [Register a business](business-registration/README.md) +- [Apply for a reviewed permit](permit-review/README.md) diff --git a/products/platform/examples/service-previews/permit-review/README.md b/products/platform/examples/service-previews/permit-review/README.md new file mode 100644 index 0000000000..05c54e72a3 --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/README.md @@ -0,0 +1,81 @@ +# Apply for a reviewed permit + +This preview runs one permit application through four products. The applicant +submits it to BReg and starts a Coordinator run that names only the +application. The Coordinator reads the application under its own BReg +profile, asks Casework to review the content it read, and waits. An officer +reads that content in Casework, claims the task and approves it. The run then +asks the `assess-permit` service function for an assessment and records the +decision in BReg. + +Start it using the [preview instructions](../README.md). It also needs +`casework`, `caseworkctl`, `coordinator` and `coordinatorctl` from the same +release. `rstack dev start` prints one URL per actor. Every URL serves the same +built page, and each origin acts for one synthetic person: + +- the applicant's origin submits an application, starts the run and follows it. +- the officer's origin lists the queue with the content under review, claims a + task, approves it, and reads an application from the register. +- the neighbour's origin is a second applicant, whose application the startup + journey submits. It cannot follow the applicant's run. + +From the applicant's origin, enter a task ID in **Decide a review task**. +Casework refuses that decision with 403, because the applicant's Casework +profile may ask for a review but never decide one. + +Serving each actor from its own origin is a development substitution for a +real sign-in. A deployment serves one origin and signs each person in. + +## What the applicant controls + +The applicant chooses which application a run names, and nothing else. The +Coordinator reads that application itself. The review subject, the content the +officer sees, the assessment input and the decision all come from that read. +A run that names another applicant's application reviews and decides that +application as stored, never content the applicant supplied. A deployment's +starting service also checks that the applicant owns the application it names +before it starts the run. This preview leaves that check out. + +The decision Actions take the activity and site the Coordinator read and guard +them, with the submitted status, in the same write. A BReg target-condition +token would pin the exact revision, but the token is opaque and only BReg can +issue it, so the Coordinator cannot derive one from its read. The content guard +binds the decision to the reviewed content instead: no profile can change an +application's activity or site, and a decided application is no longer +submitted. + +Casework requires a sha256 digest of the review subject, and Coordinator +Transforms cannot hash. The `digest-application` service function hashes the +content the Coordinator read, and the Coordinator calls it before it asks for +the review. + +## Files + +- [service.yaml](service.yaml) names the products, the page, the two functions + and each role's access profiles. +- [The BReg project](project/registry.yaml) defines the application Record, + the applicant's submission Action and the two decision Actions that only the + Coordinator's profile may invoke. The applicant reads no application. Its + [native journeys](project/tests/journeys.yaml) show a decision refused for + other content and refused once decided. +- [The Casework project](casework/casework.yaml) defines the review policy, + the officers' queue and the Coordinator as its one trusted producer. Casework + requires a profile that acts as supervisor, so `permit-supervisor` exists + although no person in this preview holds it. +- [The Coordinator project](coordinator/workflow.yaml) reads the application, + digests it, asks for the review, waits for its result, assesses the approved + content and records the decision. Its [fixtures](coordinator/fixtures) cover + the approved and refused paths and an application already decided. +- [The assessment function](functions/assess-permit/index.ts) and [the digest + function](functions/digest-application/index.ts) hold no registry + credential. Each answers only from the content the Coordinator sends. +- [dev.yaml](dev.yaml) declares the synthetic people, binds the Coordinator's + Casework and BReg connections to run-local machine identities and lists each + actor's preview routes. +- [The startup journeys](dev-journeys.yaml) staff the officers' queue and submit + the neighbour's application. +- [The page code](web/src/page.ts) asks its origin which actor it serves and + shows that actor's controls. + +A waiting run does not survive a restart of `rstack dev`, because the restarted +Casework has a new origin. Stop the preview with `--clean` and start again. diff --git a/products/platform/examples/service-previews/permit-review/casework/casework.yaml b/products/platform/examples/service-previews/permit-review/casework/casework.yaml new file mode 100644 index 0000000000..7440ab9026 --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/casework/casework.yaml @@ -0,0 +1,78 @@ +# Casework owns the permit review: who may decide, the queue officers work, +# and the one producer it trusts to ask for a review. The Coordinator is that +# producer. Its issuer below is the logical name `rstack dev` rebinds to the +# run issuer under the exact guards in dev.yaml. +apiVersion: id.registrystack.org/formats/casework/project/v1alpha1 +kind: CaseworkProject +project: + id: permit-review + version: "1" +accessProfiles: + permit-officer: + principalClaim: sub + requiredScopes: [casework:permit:decide] + actsAs: staff + permit-supervisor: + principalClaim: sub + requiredScopes: [casework:permit:supervise] + actsAs: supervisor + permit-administrator: + principalClaim: sub + requiredScopes: [casework:permit:admin] + actsAs: administrator + # The applicant may ask for a review but never decide one. The preview keeps + # this profile so the applicant's decision attempt reaches Casework and is + # refused there with 403. + permit-applicant: + principalClaim: sub + requiredScopes: [casework:permit:apply] + actsAs: requester + coordinator-producer: + principalClaim: sub + requiredScopes: [casework:permit:review] + actsAs: requester +queues: + permit-officers: + label: Permit applications awaiting review +reviewPolicies: + permit-review: + version: "1" + purpose: approval + context: {mode: submitted} + stages: + - id: decide + queue: permit-officers + decidingProfiles: [permit-officer] + requiredApprovals: 1 + retention: + terminalRetentionDays: 90 + accountabilityRetentionDays: 365 + displaySchema: + type: object + additionalProperties: false + required: [activity, site] + properties: + activity: {type: string, maxLength: 160} + site: {type: string, maxLength: 160} + outcomes: + approved: + label: Approve the permit + settlement: approved + reasonRequired: false + publicReason: optional + rejected: + label: Refuse the permit + settlement: rejected + reasonRequired: true + publicReason: required +trustedProducers: + coordinator: + profile: coordinator-producer + issuer: https://identity.permit-review.example.test + subject: coordinator-producer + sourceNamespaces: [permits] + reviewPolicies: [permit-review] + retention: {receiptRetentionDays: 30} + completion: + destinationId: coordinator-wake + recipientBinding: coordinator-v1 diff --git a/products/platform/examples/service-previews/permit-review/coordinator/README.md b/products/platform/examples/service-previews/permit-review/coordinator/README.md new file mode 100644 index 0000000000..31870da2d3 --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/coordinator/README.md @@ -0,0 +1,23 @@ +# Permit review workflow + +The Coordinator project for the [permit review preview](../README.md). + +`generated/permits.contract.json` is the BReg-generated Action export for +[the permit register](../project/registry.yaml). From the repository root, +regenerate it into a new directory and copy the export over the committed file: + +```sh +bregctl generate actions products/platform/examples/service-previews/permit-review/project --output /tmp/permits-actions +cp /tmp/permits-actions/generated/action-contracts.json \ + products/platform/examples/service-previews/permit-review/coordinator/generated/permits.contract.json +``` + +The runtime template names HTTPS reference endpoints and secret references. +Under `rstack dev`, the bindings in `dev.yaml` replace the review and permits +connections, and the preview function host replaces the digester's and the +assessor's. + +The run input is only the application ID. Every later step uses the +Coordinator's own read of the application, and the decision Actions guard the +read content, as [the preview README](../README.md#what-the-applicant-controls) +explains. diff --git a/products/platform/examples/service-previews/permit-review/coordinator/fixtures/already-decided-is-not-reviewed.yaml b/products/platform/examples/service-previews/permit-review/coordinator/fixtures/already-decided-is-not-reviewed.yaml new file mode 100644 index 0000000000..af66282339 --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/coordinator/fixtures/already-decided-is-not-reviewed.yaml @@ -0,0 +1,28 @@ +# yaml-language-server: $schema=https://id.registrystack.org/schemas/coordinator/fixture/fixture.v1alpha1.schema.json +apiVersion: id.registrystack.org/formats/coordinator/fixture/v1alpha1 +kind: CoordinatorFixture +id: already-decided-is-not-reviewed +admittedAt: '2026-12-01T09:00:00Z' +input: + applicationId: 00000000-0000-4000-8000-000000000001 +replies: + read-application: + - type: success + value: + '@context': https://id.registrystack.org/contexts/registry-record/v1 + data: + recordId: 00000000-0000-4000-8000-000000000001 + revisionId: '1' + domainData: + activity: Night resurfacing + site: North road + office: central + status: approved + meta: + registryId: permit-register + datasetId: applications + recordTypeId: permit-application +expect: + path: [read-application, check-submitted, not-submitted] + state: completed + outcome: {type: named, value: not-submitted} diff --git a/products/platform/examples/service-previews/permit-review/coordinator/fixtures/approved-assessed-and-recorded.yaml b/products/platform/examples/service-previews/permit-review/coordinator/fixtures/approved-assessed-and-recorded.yaml new file mode 100644 index 0000000000..deb180b442 --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/coordinator/fixtures/approved-assessed-and-recorded.yaml @@ -0,0 +1,89 @@ +# yaml-language-server: $schema=https://id.registrystack.org/schemas/coordinator/fixture/fixture.v1alpha1.schema.json +apiVersion: id.registrystack.org/formats/coordinator/fixture/v1alpha1 +kind: CoordinatorFixture +id: approved-assessed-and-recorded +admittedAt: '2026-12-01T09:00:00Z' +input: + applicationId: 00000000-0000-4000-8000-000000000001 +replies: + read-application: + - type: success + value: + '@context': https://id.registrystack.org/contexts/registry-record/v1 + data: + recordId: 00000000-0000-4000-8000-000000000001 + revisionId: '1' + domainData: + activity: Night resurfacing + site: North road + office: central + status: submitted + meta: + registryId: permit-register + datasetId: applications + recordTypeId: permit-application + digest: + - type: response + value: + status: 200 + body: + digest: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + request-review: + - type: success + value: + requestId: 00000000-0000-4000-8000-000000000010 + subject: + source: permits + type: permit-application + id: 00000000-0000-4000-8000-000000000001 + version: '1' + digest: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + policy: + id: permit-review + version: '1' + digest: sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + submissionDigest: sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc + assess: + - type: response + value: + status: 200 + body: + assessment: conditions + approve: + - type: success + value: + action: approve-application + applicationId: 00000000-0000-4000-8000-000000000002 + results: + decided-application: + recordType: permit-application + recordId: 00000000-0000-4000-8000-000000000001 + revision: 2 +waits: + await-review: + type: event + value: + resultId: 00000000-0000-4000-8000-000000000011 + requestId: 00000000-0000-4000-8000-000000000010 + subject: + source: permits + type: permit-application + id: 00000000-0000-4000-8000-000000000001 + version: '1' + digest: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + policy: + id: permit-review + version: '1' + digest: sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + submissionDigest: sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc + status: approved + outcome: approved + completedAt: '2026-12-02T09:00:00Z' + availableUntil: '2027-01-02T09:00:00Z' +expect: + path: [read-application, check-submitted, digest, request-review, await-review, decide, assess, approve, approved] + state: completed + outcome: {type: named, value: approved} + output: + assessment: conditions + resultId: 00000000-0000-4000-8000-000000000011 diff --git a/products/platform/examples/service-previews/permit-review/coordinator/fixtures/rejected-recorded-without-assessment.yaml b/products/platform/examples/service-previews/permit-review/coordinator/fixtures/rejected-recorded-without-assessment.yaml new file mode 100644 index 0000000000..a98c48b465 --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/coordinator/fixtures/rejected-recorded-without-assessment.yaml @@ -0,0 +1,82 @@ +# yaml-language-server: $schema=https://id.registrystack.org/schemas/coordinator/fixture/fixture.v1alpha1.schema.json +apiVersion: id.registrystack.org/formats/coordinator/fixture/v1alpha1 +kind: CoordinatorFixture +id: rejected-recorded-without-assessment +admittedAt: '2026-12-01T09:00:00Z' +input: + applicationId: 00000000-0000-4000-8000-000000000001 +replies: + read-application: + - type: success + value: + '@context': https://id.registrystack.org/contexts/registry-record/v1 + data: + recordId: 00000000-0000-4000-8000-000000000001 + revisionId: '1' + domainData: + activity: Night resurfacing + site: North road + office: central + status: submitted + meta: + registryId: permit-register + datasetId: applications + recordTypeId: permit-application + digest: + - type: response + value: + status: 200 + body: + digest: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + request-review: + - type: success + value: + requestId: 00000000-0000-4000-8000-000000000010 + subject: + source: permits + type: permit-application + id: 00000000-0000-4000-8000-000000000001 + version: '1' + digest: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + policy: + id: permit-review + version: '1' + digest: sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + submissionDigest: sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc + refuse: + - type: success + value: + action: refuse-application + applicationId: 00000000-0000-4000-8000-000000000002 + results: + decided-application: + recordType: permit-application + recordId: 00000000-0000-4000-8000-000000000001 + revision: 2 +waits: + await-review: + type: event + value: + resultId: 00000000-0000-4000-8000-000000000011 + requestId: 00000000-0000-4000-8000-000000000010 + subject: + source: permits + type: permit-application + id: 00000000-0000-4000-8000-000000000001 + version: '1' + digest: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + policy: + id: permit-review + version: '1' + digest: sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + submissionDigest: sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc + status: rejected + outcome: rejected + completedAt: '2026-12-02T09:00:00Z' + availableUntil: '2027-01-02T09:00:00Z' +expect: + path: [read-application, check-submitted, digest, request-review, await-review, decide, refuse, refused] + state: completed + outcome: {type: named, value: refused} + output: + resultId: 00000000-0000-4000-8000-000000000011 diff --git a/products/platform/examples/service-previews/permit-review/coordinator/functions.rhai b/products/platform/examples/service-previews/permit-review/coordinator/functions.rhai new file mode 100644 index 0000000000..6c5ead56bd --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/coordinator/functions.rhai @@ -0,0 +1,59 @@ +// Pure Function ABI: one typed object of named inputs, one typed output. +// Every value below comes from the Coordinator's own read of the +// application, never from the starter's input. + +fn submitted_route(args) { + if args.record.data.domainData.status == "submitted" { "submitted" } else { "not-submitted" } +} + +fn digest_request(args) { + let data = args.record.data; + #{ + applicationId: data.recordId, + revisionId: data.revisionId, + activity: data.domainData.activity, + site: data.domainData.site + } +} + +// Only a well-formed digest settles the call. Anything else is uncertain, +// so the run holds for same-command recovery instead of guessing. +fn digest_outcome(args) { + let response = args.response; + if response.status == 200 && "digest" in response.body { + return #{state: "accepted", result: #{digest: response.body.digest}}; + } + #{state: "uncertain"} +} + +fn review_request(args) { + let data = args.record.data; + #{ + policy: #{id: "permit-review"}, + subject: #{ + source: "permits", + type: "permit-application", + id: data.recordId, + version: data.revisionId, + digest: args.digest.digest + }, + requesterReference: data.recordId, + context: #{ + mode: "submitted", + snapshot: #{activity: data.domainData.activity, site: data.domainData.site} + } + } +} + +fn assess_request(args) { + let data = args.record.data; + #{applicationId: data.recordId, activity: data.domainData.activity, site: data.domainData.site} +} + +fn assess_outcome(args) { + let response = args.response; + if response.status == 200 && "assessment" in response.body { + return #{state: "accepted", result: #{assessment: response.body.assessment}}; + } + #{state: "uncertain"} +} diff --git a/products/platform/examples/service-previews/permit-review/coordinator/generated/permits.contract.json b/products/platform/examples/service-previews/permit-review/coordinator/generated/permits.contract.json new file mode 100644 index 0000000000..ff00577e62 --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/coordinator/generated/permits.contract.json @@ -0,0 +1 @@ +{"actions":[{"display":{"description":"Record an approved review decision on one submitted application.","label":"Approve application"},"id":"approve-application","input":{"$id":"urn:breg:action:approve-application:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"activity":{"maxLength":160,"minLength":1,"type":"string"},"applicationId":{"format":"uuid","type":"string"},"site":{"maxLength":160,"minLength":1,"type":"string"}},"required":["applicationId","activity","site"],"type":"object"},"preconditions":{"additionalProperties":false,"properties":{"applicationId":{"additionalProperties":false,"properties":{"ifMatch":{"maxLength":256,"minLength":3,"pattern":"^\\\"[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"required":["ifMatch"],"type":"object"}},"required":["applicationId"],"type":"object"}},"required":["input","preconditions"],"type":"object","x-registry-action":"approve-application","x-registry-requiredConditionKeys":["applicationId"]},"mode":"immediate","output":{"$id":"urn:breg:action:approve-application:invoke-response","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"action":{"const":"approve-application"},"applicationId":{"format":"uuid","type":"string"},"results":{"additionalProperties":false,"properties":{"decided-application":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"const":"permit-application"},"revision":{"format":"int64","minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"}},"required":["decided-application"],"type":"object"}},"required":["action","applicationId","results"],"type":"object"},"revision":"sha256:12b02ec4592deda7491b223ae8863241ad3523f244db25f890c300ef74c1eb54"},{"display":{"description":"Record a refused review decision on one submitted application.","label":"Refuse application"},"id":"refuse-application","input":{"$id":"urn:breg:action:refuse-application:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"activity":{"maxLength":160,"minLength":1,"type":"string"},"applicationId":{"format":"uuid","type":"string"},"site":{"maxLength":160,"minLength":1,"type":"string"}},"required":["applicationId","activity","site"],"type":"object"},"preconditions":{"additionalProperties":false,"properties":{"applicationId":{"additionalProperties":false,"properties":{"ifMatch":{"maxLength":256,"minLength":3,"pattern":"^\\\"[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"required":["ifMatch"],"type":"object"}},"required":["applicationId"],"type":"object"}},"required":["input","preconditions"],"type":"object","x-registry-action":"refuse-application","x-registry-requiredConditionKeys":["applicationId"]},"mode":"immediate","output":{"$id":"urn:breg:action:refuse-application:invoke-response","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"action":{"const":"refuse-application"},"applicationId":{"format":"uuid","type":"string"},"results":{"additionalProperties":false,"properties":{"decided-application":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"const":"permit-application"},"revision":{"format":"int64","minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"}},"required":["decided-application"],"type":"object"}},"required":["action","applicationId","results"],"type":"object"},"revision":"sha256:4acdc3bb77437045b615a2db97b63b31cc75369d72a7603de7f4cfebbdb9d72b"},{"display":{"description":"Create a submitted permit application from bounded applicant input.","label":"Submit application"},"id":"submit-application","input":{"$id":"urn:breg:action:submit-application:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"activity":{"maxLength":160,"minLength":1,"type":"string"},"site":{"maxLength":160,"minLength":1,"type":"string"}},"required":["activity","site"],"type":"object"},"preconditions":{"additionalProperties":false,"properties":{},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"submit-application","x-registry-requiredConditionKeys":[]},"mode":"immediate","output":{"$id":"urn:breg:action:submit-application:invoke-response","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"action":{"const":"submit-application"},"applicationId":{"format":"uuid","type":"string"},"results":{"additionalProperties":false,"properties":{"application":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"const":"permit-application"},"revision":{"format":"int64","minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"}},"required":["application"],"type":"object"}},"required":["action","applicationId","results"],"type":"object"},"revision":"sha256:cc7a9aa7902efd4871eb5f1b391d153b4194d57634157307cbafcdc5d4c306ce"}],"apiVersion":"id.registrystack.org/formats/breg/action-contracts/v1","kind":"BRegActionContracts"} \ No newline at end of file diff --git a/products/platform/examples/service-previews/permit-review/coordinator/runtime.yaml b/products/platform/examples/service-previews/permit-review/coordinator/runtime.yaml new file mode 100644 index 0000000000..83ded97e6a --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/coordinator/runtime.yaml @@ -0,0 +1,82 @@ +# yaml-language-server: $schema=https://id.registrystack.org/schemas/coordinator/runtime/runtime.v1alpha1.schema.json +apiVersion: id.registrystack.org/formats/coordinator/runtime/v1alpha1 +kind: CoordinatorRuntimeConfig +# Deployment references. Under `rstack dev` the bindings in dev.yaml replace +# each connection's address and credential with run-local ones, and the +# preview function host replaces each service function's. +secretProviders: + environment: {} + file: + root: /run/registry-coordinator/secrets +database: + runtimeUrlRef: secret:env/COORDINATOR_DATABASE_URL + migrationUrlRef: secret:env/COORDINATOR_MIGRATION_URL +namespace: coordinator_permits +connections: + review: + type: casework-review-producer + baseUrl: https://casework.example.org + profile: coordinator-producer + producer: coordinator + authorization: + tokenEndpoint: https://identity.permit-review.example.test/oauth/token + clientAssertionAudience: https://identity.permit-review.example.test + clientId: coordinator-producer + signingKeyRef: secret:file/review-client-key + resource: urn:example:permit-review + scopes: [casework:permit:review] + completion: + recipientBinding: coordinator-v1 + hmacSha256KeyRef: secret:file/review-completion-key + permits: + type: breg + baseUrl: https://permits.example.org + profile: permit-coordinator + authorization: + tokenEndpoint: https://identity.permit-review.example.test/oauth/token + clientAssertionAudience: https://identity.permit-review.example.test + clientId: permit-coordinator + signingKeyRef: secret:file/permits-client-key + resource: urn:example:permits + scopes: [registry:permit:decide] + digester: + type: service-function + baseUrl: https://functions.example.org/ + function: digest-application + hostKeyRef: secret:file/function-host-key + responseSchema: {type: object} + assessor: + type: service-function + baseUrl: https://functions.example.org/ + function: assess-permit + hostKeyRef: secret:file/function-host-key + responseSchema: {type: object} +deployment: + databaseId: permit-flow + runtimeRole: coordinator_runtime + packages: + - root: /opt/registry-coordinator/package + expectedDigest: sha256:0000000000000000000000000000000000000000000000000000000000000000 + listener: + bind: 127.0.0.1:8108 + tlsTermination: operator-controlled-upstream + authentication: + issuers: + main: + issuer: https://identity.permit-review.example.test + audience: urn:example:permit-flow + allowedClients: from-access-profiles + accessProfiles: + permit-starter: + requesterClients: [permit-applicant] + subjects: [applicant, neighbour] + requiredScopes: [coordinator:permit:start] + workflows: [permit-flow] + actions: [status, start] + auditFile: /var/lib/registry-coordinator/audit.jsonl + auditKeyRef: secret:file/audit-key + activeStateKey: 1 + stateKeys: + "1": + keyRef: secret:file/state-key-1 + admissionKeyRef: secret:file/admission-key diff --git a/products/platform/examples/service-previews/permit-review/coordinator/workflow.yaml b/products/platform/examples/service-previews/permit-review/coordinator/workflow.yaml new file mode 100644 index 0000000000..7fb5b2b46d --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/coordinator/workflow.yaml @@ -0,0 +1,293 @@ +# yaml-language-server: $schema=https://id.registrystack.org/schemas/coordinator/project/project.v1alpha1.schema.json +# One permit application. The starter names only the application; the +# Coordinator reads it under its own BReg profile, and everything it asks +# Casework to review, assesses and decides comes from that read. Casework +# decides, the assess-permit function advises, and BReg records the decision +# only while the stored application still holds the content that was read. +apiVersion: id.registrystack.org/formats/coordinator/project/v1alpha1 +kind: CoordinatorProject +project: + id: permit-flow + version: '1' +contracts: + permits: + type: breg + source: generated/permits.contract.json +types: + workflow-input: + type: object + additionalProperties: false + required: [applicationId] + properties: + applicationId: {type: string, format: uuid} + function-response: + type: object + additionalProperties: false + required: [status, body] + properties: + status: {type: integer, minimum: 200, maximum: 499} + body: {type: object} + digest: + type: object + additionalProperties: false + required: [digest] + properties: + digest: {type: string, pattern: '^sha256:[0-9a-f]{64}$'} + assessment: + type: object + additionalProperties: false + required: [assessment] + properties: + assessment: {type: string, enum: [standard, conditions]} + digest-outcome: + oneOf: + - type: object + additionalProperties: false + required: [state, result] + properties: + state: {type: string, const: accepted} + result: {typeRef: digest} + - type: object + additionalProperties: false + required: [state] + properties: + state: {type: string, const: uncertain} + assess-outcome: + oneOf: + - type: object + additionalProperties: false + required: [state, result] + properties: + state: {type: string, const: accepted} + result: {typeRef: assessment} + - type: object + additionalProperties: false + required: [state] + properties: + state: {type: string, const: uncertain} +transforms: + submitted-route: + runtime: rhai + source: functions.rhai + entrypoint: submitted_route + inputs: + record: {operationOutput: read-application} + output: {type: string, enum: [submitted, not-submitted]} + digest-request: + runtime: rhai + source: functions.rhai + entrypoint: digest_request + inputs: + record: {operationOutput: read-application} + output: {operationInput: digest-application} + digest-outcome: + runtime: rhai + source: functions.rhai + entrypoint: digest_outcome + inputs: + command: {operationInput: digest-application} + response: {operationOutput: digest-application} + output: {typeRef: digest-outcome} + review-request: + runtime: rhai + source: functions.rhai + entrypoint: review_request + inputs: + record: {operationOutput: read-application} + digest: {typeRef: digest} + output: {operationInput: request-review} + assess-request: + runtime: rhai + source: functions.rhai + entrypoint: assess_request + inputs: + record: {operationOutput: read-application} + output: {operationInput: assess-permit} + assess-outcome: + runtime: rhai + source: functions.rhai + entrypoint: assess_outcome + inputs: + command: {operationInput: assess-permit} + response: {operationOutput: assess-permit} + output: {typeRef: assess-outcome} +operations: + read-application: + uses: breg.read-record/v1 + connection: permits + digest-application: + uses: service.invoke-function/v1 + connection: digester + serviceFunction: digest-application + responseSchema: {typeRef: function-response} + interpret: digest-outcome + request-review: + uses: casework.submit-review-request/v1 + connection: review + assess-permit: + uses: service.invoke-function/v1 + connection: assessor + serviceFunction: assess-permit + responseSchema: {typeRef: function-response} + interpret: assess-outcome + approve-application: + uses: breg.invoke-action/v1 + connection: permits + action: {contract: permits, id: approve-application} + refuse-application: + uses: breg.invoke-action/v1 + connection: permits + action: {contract: permits, id: refuse-application} +workflow: + input: {typeRef: workflow-input} + deadlineSeconds: 2592000 + start: read-application + steps: + read-application: + label: Read the application under the Coordinator's profile + type: call + operation: read-application + input: + type: fields + fields: + collection: {type: literal, value: permit-applications} + recordId: {type: input, path: /applicationId} + next: check-submitted + check-submitted: + type: choose + choose: + type: transform + transform: submitted-route + inputs: + record: {type: step, step: read-application} + cases: + submitted: digest + not-submitted: not-submitted + digest: + label: Digest the content read + type: call + operation: digest-application + input: + type: transform + transform: digest-request + inputs: + record: {type: step, step: read-application} + next: request-review + request-review: + label: Ask Casework for a review + type: call + operation: request-review + input: + type: transform + transform: review-request + inputs: + record: {type: step, step: read-application} + digest: {type: step, step: digest} + next: await-review + await-review: + label: Wait for the officer's decision + type: wait-for + timeoutSeconds: 1209600 + next: decide + onTimeout: review-timed-out + completion: {step: request-review, name: result} + decide: + type: choose + choose: {type: step, step: await-review, path: /status} + cases: + approved: assess + rejected: refuse + changes-requested: not-decided + answered: not-decided + cancelled: not-decided + superseded: not-decided + assess: + label: Assess the approved permit + type: call + operation: assess-permit + input: + type: transform + transform: assess-request + inputs: + record: {type: step, step: read-application} + next: approve + approve: + label: Record the approval in the register + type: call + operation: approve-application + input: + type: fields + fields: + input: + type: fields + fields: + applicationId: {type: step, step: read-application, path: /data/recordId} + activity: {type: step, step: read-application, path: /data/domainData/activity} + site: {type: step, step: read-application, path: /data/domainData/site} + next: approved + refuse: + label: Record the refusal in the register + type: call + operation: refuse-application + input: + type: fields + fields: + input: + type: fields + fields: + applicationId: {type: step, step: read-application, path: /data/recordId} + activity: {type: step, step: read-application, path: /data/domainData/activity} + site: {type: step, step: read-application, path: /data/domainData/site} + next: refused + approved: + type: finish + outcome: approved + output: + type: fields + fields: + assessment: {type: step, step: assess, path: /assessment} + resultId: {type: step, step: await-review, path: /resultId} + refused: + type: finish + outcome: refused + output: + type: fields + fields: + resultId: {type: step, step: await-review, path: /resultId} + not-submitted: + type: finish + outcome: not-submitted + not-decided: + type: finish + outcome: not-decided + output: + type: fields + fields: + status: {type: step, step: await-review, path: /status} + review-timed-out: + type: finish + outcome: review-timed-out + outcomes: + approved: + type: object + additionalProperties: false + required: [assessment, resultId] + properties: + assessment: {type: string, enum: [standard, conditions]} + resultId: {type: string, format: uuid} + refused: + type: object + additionalProperties: false + required: [resultId] + properties: + resultId: {type: string, format: uuid} + not-submitted: + type: 'null' + not-decided: + type: object + additionalProperties: false + required: [status] + properties: + status: {type: string} + review-timed-out: + type: 'null' diff --git a/products/platform/examples/service-previews/permit-review/dev-journeys.yaml b/products/platform/examples/service-previews/permit-review/dev-journeys.yaml new file mode 100644 index 0000000000..a176eeae9d --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/dev-journeys.yaml @@ -0,0 +1,31 @@ +# yaml-language-server: $schema=https://id.registrystack.org/schemas/rstack/journeys/journeys.v1alpha1.schema.json +apiVersion: id.registrystack.org/formats/rstack/journeys/v1alpha1 +kind: RStackJourneys +journeys: + - id: staff-permit-officers + steps: + # The officer decides only once Casework staffs the queue with that + # person under the run's issuer. + - id: staff-the-queue + product: casework + as: administrator + method: POST + path: /v1/directory/bootstrap + headers: {If-Match: '"0"', Idempotency-Key: staff-permit-officers} + body: + teamId: permit-officers-team + staff: [{issuer: "{{run.issuer}}", subject: officer}] + supervisors: [] + queueId: permit-officers + expect: {status: 200} + - id: neighbour-application + steps: + # Another applicant's application, so the preview has a second record. + - id: neighbour-submits + product: breg + as: neighbour + method: POST + path: /v1/actions/submit-application + headers: {Idempotency-Key: neighbour-application} + body: {input: {activity: Daytime survey, site: Market square}} + expect: {status: 200} diff --git a/products/platform/examples/service-previews/permit-review/dev.yaml b/products/platform/examples/service-previews/permit-review/dev.yaml new file mode 100644 index 0000000000..b8f5e43b3d --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/dev.yaml @@ -0,0 +1,90 @@ +# yaml-language-server: $schema=https://id.registrystack.org/schemas/rstack/dev/dev.v1alpha1.schema.json +apiVersion: id.registrystack.org/formats/rstack/dev/v1alpha1 +kind: RStackDev +issuer: run +audiences: + permits: "urn:example:permits" + casework: "urn:example:permit-review" + permit-flow: "urn:example:permit-flow" +people: + applicant: + subject: applicant + client: permit-applicant + roles: [applicant] + claims: + breg: {registry_office: central} + officer: + subject: officer + client: permit-officer + roles: [officer] + claims: + breg: {registry_office: central} + administrator: + subject: administrator + client: permit-administrator + roles: [administrator] + coordinator-producer: + subject: coordinator-producer + client: coordinator-producer + roles: [coordinator-producer] + neighbour: + subject: neighbour + client: permit-applicant + roles: [applicant] + claims: + breg: {registry_office: central} + coordinator-service: + subject: coordinator-service + client: permit-coordinator + roles: [coordinator-service] + claims: + breg: {registry_office: central} + # The BReg schema tests decide as this person, so the Coordinator's own + # BReg identity stays dedicated to the Coordinator. In development it holds + # the Coordinator's decide authority for those journeys, and a decision it + # makes bypasses review. + register-tester: + subject: register-tester + client: permit-coordinator + roles: [coordinator-service] + claims: + breg: {registry_office: central} +journeyFile: dev-journeys.yaml +bindings: + coordinatorReviewProducer: + connection: review + producer: coordinator + identity: coordinator-producer + completionDestination: coordinator-wake + runIssuerBinding: + producer: + expectedIssuer: https://identity.permit-review.example.test + expectedProfile: coordinator-producer + expectedSubject: coordinator-producer + coordinatorBregClient: + connection: permits + identity: coordinator-service +preview: + page: / + functions: [assess-permit, digest-application] + actors: + # The applicant submits and follows its own run. It reads no + # application from BReg, and Casework refuses its decisions. + applicant: + breg: + post: [/v1/actions/submit-application] + casework: + post: ["/v1/review-tasks/{taskId}/decisions"] + coordinator: + get: [/v1/workflows/permit-flow, "/v1/runs/{runId}"] + post: [/v1/runs] + # A second applicant, to show one applicant cannot follow another's run. + neighbour: + coordinator: + get: ["/v1/runs/{runId}"] + officer: + breg: + get: [/v1/records/permit-applications, "/v1/records/permit-applications/{recordId}"] + casework: + get: [/v1/review-tasks, "/v1/review-tasks/{taskId}/context"] + post: ["/v1/review-tasks/{taskId}/claim", "/v1/review-tasks/{taskId}/decisions"] diff --git a/products/platform/examples/service-previews/permit-review/functions/assess-permit/assess.ts b/products/platform/examples/service-previews/permit-review/functions/assess-permit/assess.ts new file mode 100644 index 0000000000..87494b623d --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/functions/assess-permit/assess.ts @@ -0,0 +1,32 @@ +export type Assessment = 'standard' | 'conditions' + +// Night work or work on a public road carries standard conditions. The +// assessment is advice the Coordinator records; it decides nothing. +export function assess(activity: string, site: string): Assessment { + const text = (activity + ' ' + site).toLowerCase() + return /\bnight\b|\broad\b/u.test(text) ? 'conditions' : 'standard' +} + +function bounded(value: unknown, maximumLength: number) { + if (typeof value !== 'string') return undefined + const text = value.trim() + return text.length > 0 && text.length <= maximumLength ? text : undefined +} + +function answer(body: object, status: number) { + return Response.json(body, { status, headers: { 'Cache-Control': 'no-store' } }) +} + +export async function handleAssessment(request: Request) { + if (request.method !== 'POST') return answer({ message: 'Send a POST request.' }, 405) + let submitted: { activity?: unknown; site?: unknown } | null + try { + submitted = await request.json() + } catch { + return answer({ message: 'Send the application details as JSON.' }, 400) + } + const activity = bounded(submitted?.activity, 160) + const site = bounded(submitted?.site, 160) + if (!activity || !site) return answer({ message: 'Send an activity and a site.' }, 400) + return answer({ assessment: assess(activity, site) }, 200) +} diff --git a/products/platform/examples/service-previews/permit-review/functions/assess-permit/index.ts b/products/platform/examples/service-previews/permit-review/functions/assess-permit/index.ts new file mode 100644 index 0000000000..69bcc49cf5 --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/functions/assess-permit/index.ts @@ -0,0 +1,8 @@ +import { defineFunction } from '../../generated/server.js' +import { handleAssessment } from './assess.js' + +// The Coordinator calls this function with the run host key, which the +// function host replaces with a placeholder. It holds no registry credential: +// it returns an assessment of the content the Coordinator read and records +// nothing itself. +export default defineFunction(async (request) => handleAssessment(request)) diff --git a/products/platform/examples/service-previews/permit-review/functions/digest-application/digest.ts b/products/platform/examples/service-previews/permit-review/functions/digest-application/digest.ts new file mode 100644 index 0000000000..82024cc1cc --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/functions/digest-application/digest.ts @@ -0,0 +1,33 @@ +function bounded(value: unknown, maximumLength: number) { + return typeof value === 'string' && value.length > 0 && value.length <= maximumLength ? value : undefined +} + +function answer(body: object, status: number) { + return Response.json(body, { status, headers: { 'Cache-Control': 'no-store' } }) +} + +// The digest of the exact application content the Coordinator read, as one +// JSON array, so Casework's review subject names that content. +export async function digestApplication(applicationId: string, revisionId: string, activity: string, site: string) { + const canonical = new TextEncoder().encode(JSON.stringify([applicationId, revisionId, activity, site])) + const bytes = new Uint8Array(await crypto.subtle.digest('SHA-256', canonical)) + return 'sha256:' + Array.from(bytes, byte => byte.toString(16).padStart(2, '0')).join('') +} + +export async function handleDigest(request: Request) { + if (request.method !== 'POST') return answer({ message: 'Send a POST request.' }, 405) + let submitted: Record | null + try { + submitted = await request.json() + } catch { + return answer({ message: 'Send the application content as JSON.' }, 400) + } + const applicationId = bounded(submitted?.applicationId, 64) + const revisionId = bounded(submitted?.revisionId, 64) + const activity = bounded(submitted?.activity, 160) + const site = bounded(submitted?.site, 160) + if (!applicationId || !revisionId || !activity || !site) { + return answer({ message: 'Send the application ID, revision, activity and site.' }, 400) + } + return answer({ digest: await digestApplication(applicationId, revisionId, activity, site) }, 200) +} diff --git a/products/platform/examples/service-previews/permit-review/functions/digest-application/index.ts b/products/platform/examples/service-previews/permit-review/functions/digest-application/index.ts new file mode 100644 index 0000000000..e227053bba --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/functions/digest-application/index.ts @@ -0,0 +1,7 @@ +import { defineFunction } from '../../generated/server.js' +import { handleDigest } from './digest.js' + +// The Coordinator calls this function with the run host key, which the +// function host replaces with a placeholder. It holds no registry credential: +// it hashes the content the Coordinator read and returns the digest. +export default defineFunction(async (request) => handleDigest(request)) diff --git a/products/platform/examples/service-previews/permit-review/manifest.yaml b/products/platform/examples/service-previews/permit-review/manifest.yaml new file mode 100644 index 0000000000..ef5633aacc --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/manifest.yaml @@ -0,0 +1,3 @@ +public_services: + - id: review-a-permit + title: Apply for a reviewed permit diff --git a/products/platform/examples/service-previews/permit-review/package-lock.json b/products/platform/examples/service-previews/permit-review/package-lock.json new file mode 100644 index 0000000000..3283b9bd6a --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/package-lock.json @@ -0,0 +1,528 @@ +{ + "name": "permit-review", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "@registrystack/client": "file:registry-preview-client.tgz" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", + "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", + "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", + "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", + "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", + "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", + "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", + "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", + "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", + "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", + "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", + "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", + "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", + "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", + "cpu": [ + "mips64el" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", + "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", + "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", + "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", + "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", + "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", + "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", + "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", + "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", + "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", + "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", + "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", + "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", + "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@registrystack/client": { + "version": "0.50.0", + "resolved": "file:registry-preview-client.tgz", + "integrity": "sha512-NPAHDsmoc12s97/ar9raWVPrmh5BsBsfo1frQSMPFxCKc+6RgPSvhTAs5Pxwk4RCr1GJm0vqzbOfc13UHDQxXA==", + "license": "Apache-2.0", + "dependencies": { + "esbuild": "0.25.12", + "srvx": "1.0.8", + "typescript": "5.9.3", + "yaml": "2.9.1" + }, + "bin": { + "registry-generate": "registry-generate.js", + "registry-preview": "preview/cli.mjs" + }, + "engines": { + "node": ">=24" + } + }, + "node_modules/esbuild": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", + "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.12", + "@esbuild/android-arm": "0.25.12", + "@esbuild/android-arm64": "0.25.12", + "@esbuild/android-x64": "0.25.12", + "@esbuild/darwin-arm64": "0.25.12", + "@esbuild/darwin-x64": "0.25.12", + "@esbuild/freebsd-arm64": "0.25.12", + "@esbuild/freebsd-x64": "0.25.12", + "@esbuild/linux-arm": "0.25.12", + "@esbuild/linux-arm64": "0.25.12", + "@esbuild/linux-ia32": "0.25.12", + "@esbuild/linux-loong64": "0.25.12", + "@esbuild/linux-mips64el": "0.25.12", + "@esbuild/linux-ppc64": "0.25.12", + "@esbuild/linux-riscv64": "0.25.12", + "@esbuild/linux-s390x": "0.25.12", + "@esbuild/linux-x64": "0.25.12", + "@esbuild/netbsd-arm64": "0.25.12", + "@esbuild/netbsd-x64": "0.25.12", + "@esbuild/openbsd-arm64": "0.25.12", + "@esbuild/openbsd-x64": "0.25.12", + "@esbuild/openharmony-arm64": "0.25.12", + "@esbuild/sunos-x64": "0.25.12", + "@esbuild/win32-arm64": "0.25.12", + "@esbuild/win32-ia32": "0.25.12", + "@esbuild/win32-x64": "0.25.12" + } + }, + "node_modules/srvx": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/srvx/-/srvx-1.0.8.tgz", + "integrity": "sha512-ngFS/J6St4PJfHRHGjr78xkPPtbyXtdMOLNE4x/XZunEK3OhV7aGUWMHf9WTUEy6wm1U0W4okkd82ZFFWRVQTw==", + "license": "MIT", + "bin": { + "srvx": "bin/srvx.mjs" + }, + "engines": { + "node": ">=20.16.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/yaml": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz", + "integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + } + } +} diff --git a/products/platform/examples/service-previews/permit-review/package.json b/products/platform/examples/service-previews/permit-review/package.json new file mode 100644 index 0000000000..d40b7b9739 --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/package.json @@ -0,0 +1,8 @@ +{ + "name": "permit-review", + "private": true, + "type": "module", + "dependencies": { + "@registrystack/client": "file:registry-preview-client.tgz" + } +} diff --git a/products/platform/examples/service-previews/permit-review/project/registry.yaml b/products/platform/examples/service-previews/permit-review/project/registry.yaml new file mode 100644 index 0000000000..a53055da3d --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/project/registry.yaml @@ -0,0 +1,182 @@ +# The permit register owns the authoritative application Record, the +# applicant's submission Action and the decision Action. Only the +# Coordinator's service profile may record a decision. +apiVersion: id.registrystack.org/formats/breg/project/v1alpha1 +kind: BRegProject +project: + id: permit-register + canonicalBaseIri: https://permit-register.example.gov + version: 0.1.0 + defaultLanguage: en + display: + label: Permit register + description: Authoritative permit application Records. + +package: + sourceRevision: permit-register-0.1.0 + +datasets: + applications: + display: + label: Permit applications + description: Applications submitted for a permit. + +recordTypes: + permit-application: + route: permit-applications + primaryDataset: applications + mutationMode: mutable + display: + label: Permit application + titleField: activity + description: One application for a permit. + fields: + - {id: activity, type: string, required: true, minimumLength: 1, maximumLength: 160, classification: internal} + - {id: site, type: string, required: true, minimumLength: 1, maximumLength: 160, classification: internal} + - {id: office, type: string, required: true, minimumLength: 1, maximumLength: 40, classification: internal} + - {id: status, type: vocabulary-code, vocabulary: application-status, required: true, classification: internal} + +actions: + submit-application: + display: + label: Submit application + description: Create a submitted permit application from bounded applicant input. + execution: {mode: immediate} + inputs: + - {id: activity, type: string, required: true, minimumLength: 1, maximumLength: 160, classification: internal} + - {id: site, type: string, required: true, minimumLength: 1, maximumLength: 160, classification: internal} + plan: + type: fixed + effects: + - id: application + target: {recordType: permit-application} + operation: create + set: + activity: {fromInput: activity} + site: {fromInput: site} + office: {value: central} + status: {value: submitted} + approve-application: + display: + label: Approve application + description: Record an approved review decision on one submitted application. + execution: {mode: immediate} + inputs: + - {id: application, apiName: applicationId, type: reference, target: permit-application, required: true, classification: internal} + - {id: activity, type: string, required: true, minimumLength: 1, maximumLength: 160, classification: internal} + - {id: site, type: string, required: true, minimumLength: 1, maximumLength: 160, classification: internal} + # The caller names the content it read and had reviewed. The write + # applies only while the stored application still holds exactly that + # content and has not been decided. This binds the decision to the review + # only while every field in the review snapshot is guarded here and no + # Action can change a guarded field: add a guard with any new snapshot + # field, and add no Action that edits activity or site. + commitGuards: + targets: + - {input: application, field: status, equals: submitted, reason: not-submitted} + - {input: application, field: activity, equalsFromInput: activity, reason: content-changed} + - {input: application, field: site, equalsFromInput: site, reason: content-changed} + plan: + type: fixed + effects: + - id: decided-application + target: {fromInput: application} + operation: patch + set: + status: {value: approved} + refuse-application: + display: + label: Refuse application + description: Record a refused review decision on one submitted application. + execution: {mode: immediate} + inputs: + - {id: application, apiName: applicationId, type: reference, target: permit-application, required: true, classification: internal} + - {id: activity, type: string, required: true, minimumLength: 1, maximumLength: 160, classification: internal} + - {id: site, type: string, required: true, minimumLength: 1, maximumLength: 160, classification: internal} + # The caller names the content it read and had reviewed. The write + # applies only while the stored application still holds exactly that + # content and has not been decided. This binds the decision to the review + # only while every field in the review snapshot is guarded here and no + # Action can change a guarded field: add a guard with any new snapshot + # field, and add no Action that edits activity or site. + commitGuards: + targets: + - {input: application, field: status, equals: submitted, reason: not-submitted} + - {input: application, field: activity, equalsFromInput: activity, reason: content-changed} + - {input: application, field: site, equalsFromInput: site, reason: content-changed} + plan: + type: fixed + effects: + - id: decided-application + target: {fromInput: application} + operation: patch + set: + status: {value: refused} + +accessProfiles: + permit-applicant: + actorKind: human + requesterClients: [permit-applicant] + display: + label: Permit applicant + description: Submits permit applications. Reads none; the applicant follows its review run. + principalClaim: sub + requiredScopes: ["registry:permit:apply"] + permissions: + actions: + - action: submit-application + operations: [invoke] + targets: + - recordType: permit-application + rowBoundaries: + - {field: office, claim: registry_office, operator: equals} + results: [application] + permit-reader: + actorKind: human + requesterClients: [permit-officer] + display: + label: Permit reader + description: Reads permit applications in the office. + principalClaim: sub + requiredScopes: ["registry:permit:read"] + permissions: + records: + - recordType: permit-application + operations: [get, list] + readableFields: [activity, site, office, status] + rowBoundaries: + - {field: office, claim: registry_office, operator: equals} + permit-coordinator: + actorKind: service + requesterClients: [permit-coordinator] + display: + label: Permit Coordinator + description: Records reviewed decisions on submitted applications. + principalClaim: sub + requiredScopes: ["registry:permit:decide"] + permissions: + records: + - recordType: permit-application + operations: [get] + readableFields: [activity, site, office, status] + rowBoundaries: + - {field: office, claim: registry_office, operator: equals} + actions: + - action: approve-application + operations: [invoke] + targets: + - recordType: permit-application + rowBoundaries: + - {field: office, claim: registry_office, operator: equals} + results: [decided-application] + - action: refuse-application + operations: [invoke] + targets: + - recordType: permit-application + rowBoundaries: + - {field: office, claim: registry_office, operator: equals} + results: [decided-application] + +vocabularies: + application-status: + values: [submitted, approved, refused] diff --git a/products/platform/examples/service-previews/permit-review/project/tests/journeys.yaml b/products/platform/examples/service-previews/permit-review/project/tests/journeys.yaml new file mode 100644 index 0000000000..9af2db4729 --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/project/tests/journeys.yaml @@ -0,0 +1,115 @@ +# yaml-language-server: $schema=https://id.registrystack.org/schemas/breg/journeys/journeys.v1.schema.json +apiVersion: id.registrystack.org/formats/breg/journeys/v1 +kind: BRegJourneys +journeys: + - id: permit-decision + steps: + - id: applicant-submits + actor: applicant + action: submit-application + accessProfile: permit-applicant + claims: + principal: applicant + scopes: [registry:permit:apply] + actorKind: human + requesterClient: permit-applicant + directClaims: {registry_office: central} + request: + type: invoke + idempotencyKey: native-permit-application-2026-001 + input: {activity: Night resurfacing, site: North road} + expect: {outcome: success, status: 200} + captureResults: {application: application} + - id: register-tester-reads-approval-conditions + actor: register-tester + action: approve-application + accessProfile: permit-coordinator + claims: + principal: register-tester + scopes: [registry:permit:decide] + actorKind: service + requesterClient: permit-coordinator + directClaims: {registry_office: central} + request: + type: target-conditions + input: {applicationId: {recordCapture: application}} + expect: {outcome: success, status: 200} + capture: approval-condition + - id: register-tester-refused-for-other-content + actor: register-tester + action: approve-application + accessProfile: permit-coordinator + claims: + principal: register-tester + scopes: [registry:permit:decide] + actorKind: service + requesterClient: permit-coordinator + directClaims: {registry_office: central} + request: + type: invoke + idempotencyKey: native-permit-approve-other-content + input: {applicationId: {recordCapture: application}, activity: Daytime survey, site: North road} + preconditions: + applicationId: {conditionCapture: approval-condition} + expect: {outcome: refusal, status: 412, problemCode: action.guard-failed} + - id: register-tester-approves-the-content-read + actor: register-tester + action: approve-application + accessProfile: permit-coordinator + claims: + principal: register-tester + scopes: [registry:permit:decide] + actorKind: service + requesterClient: permit-coordinator + directClaims: {registry_office: central} + request: + type: invoke + idempotencyKey: native-permit-approve + input: {applicationId: {recordCapture: application}, activity: Night resurfacing, site: North road} + preconditions: + applicationId: {conditionCapture: approval-condition} + expect: {outcome: success, status: 200} + - id: register-tester-reads-refusal-conditions + actor: register-tester + action: refuse-application + accessProfile: permit-coordinator + claims: + principal: register-tester + scopes: [registry:permit:decide] + actorKind: service + requesterClient: permit-coordinator + directClaims: {registry_office: central} + request: + type: target-conditions + input: {applicationId: {recordCapture: application}} + expect: {outcome: success, status: 200} + capture: refusal-condition + - id: register-tester-cannot-decide-twice + actor: register-tester + action: refuse-application + accessProfile: permit-coordinator + claims: + principal: register-tester + scopes: [registry:permit:decide] + actorKind: service + requesterClient: permit-coordinator + directClaims: {registry_office: central} + request: + type: invoke + idempotencyKey: native-permit-refuse-after-approval + input: {applicationId: {recordCapture: application}, activity: Night resurfacing, site: North road} + preconditions: + applicationId: {conditionCapture: refusal-condition} + expect: {outcome: refusal, status: 412, problemCode: action.guard-failed} + - id: register-tester-reads-the-decision + actor: register-tester + recordType: permit-application + accessProfile: permit-coordinator + claims: + principal: register-tester + scopes: [registry:permit:decide] + actorKind: service + requesterClient: permit-coordinator + directClaims: {registry_office: central} + request: {type: get, recordCapture: application} + expect: {outcome: success, status: 200, fields: {status: approved, activity: Night resurfacing}} diff --git a/products/platform/examples/service-previews/permit-review/service.yaml b/products/platform/examples/service-previews/permit-review/service.yaml new file mode 100644 index 0000000000..9e363a44b2 --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/service.yaml @@ -0,0 +1,40 @@ +apiVersion: id.registrystack.org/formats/rstack/service/v1alpha1 +kind: RStackService +service: {manifest: manifest.yaml, publicService: review-a-permit} +products: + breg: + projects: + permits: {path: project} + casework: {path: casework} + coordinator: + projects: + permit-flow: {path: coordinator} +ui: {project: web, output: dist} +functions: [assess-permit, digest-application] +roles: + applicant: + actorKind: human + claims: [registry_office] + accessProfiles: + breg: [permit-applicant] + casework: [permit-applicant] + coordinator: [permit-starter] + officer: + actorKind: human + claims: [registry_office] + accessProfiles: + breg: [permit-reader] + casework: [permit-officer] + administrator: + actorKind: human + accessProfiles: + casework: [permit-administrator] + coordinator-producer: + actorKind: service + accessProfiles: + casework: [coordinator-producer] + coordinator-service: + actorKind: service + claims: [registry_office] + accessProfiles: + breg: [permit-coordinator] diff --git a/products/platform/examples/service-previews/permit-review/web/public/index.html b/products/platform/examples/service-previews/permit-review/web/public/index.html new file mode 100644 index 0000000000..b1f0960431 --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/web/public/index.html @@ -0,0 +1,73 @@ + + + + + + Apply for a reviewed permit + + + + + +
Registry Stack demonstration
+
Permit review
+
+

Apply for a reviewed permit

+ +

+ + +
+ + diff --git a/products/platform/examples/service-previews/permit-review/web/public/service.css b/products/platform/examples/service-previews/permit-review/web/public/service.css new file mode 100644 index 0000000000..4f0edde4f0 --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/web/public/service.css @@ -0,0 +1,29 @@ +* { box-sizing: border-box; } +body { + margin: 0; + background: #f7f3f3; + color: #2c2c2c; + font: 18px/1.5 system-ui, sans-serif; +} +.skip-link { position: absolute; left: -9999px; } +.skip-link:focus { left: 1rem; top: 1rem; background: white; padding: 0.75rem; } +.official-banner { background: #2c2c2c; color: white; padding: 0.5rem 1.5rem; text-align: center; font-size: 0.8rem; } +header { background: #ffc726; border-bottom: 3px solid #2c2c2c; padding: 1rem 1.5rem; font-size: 1.35rem; font-weight: 700; } +main { max-width: 46rem; margin: 2rem auto; padding: 0 1.5rem; } +h1 { font-size: 2.25rem; line-height: 1.2; } +.field { margin: 1.75rem 0; } +label { display: block; font-size: 1.15rem; font-weight: 700; } +.hint { display: block; color: #595959; font-size: 1rem; margin-bottom: 0.5rem; } +input { width: 100%; max-width: 32rem; border: 2px solid #2c2c2c; padding: 0.65rem; font: inherit; } +input:focus, button:focus, a:focus { outline: 4px solid #ffc726; outline-offset: 2px; } +button { border: 0; background: #00703c; color: white; padding: 0.75rem 1.5rem; font: inherit; font-weight: 700; cursor: pointer; } +button:disabled { opacity: 0.7; cursor: default; } +.error:not(:empty) { border: 4px solid #b71c1c; padding: 1rem; } +.confirmation { margin-top: 2rem; background: #e8f5e9; border-left: 6px solid #00703c; padding: 1rem 1.25rem; } +.confirmation h2 { margin-top: 0; } +dl { background: white; margin-bottom: 0; } +dl div { display: grid; grid-template-columns: minmax(9rem, 1fr) 2fr; gap: 1rem; border-bottom: 1px solid #ddd; padding: 0.75rem; } +dl div:last-child { border-bottom: 0; } +dt { font-weight: 700; } +dd { margin: 0; overflow-wrap: anywhere; } +[hidden], #error:empty, #status:empty { display: none; } diff --git a/products/platform/examples/service-previews/permit-review/web/src/page.ts b/products/platform/examples/service-previews/permit-review/web/src/page.ts new file mode 100644 index 0000000000..69647d6e17 --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/web/src/page.ts @@ -0,0 +1,210 @@ +// One built page serves every actor. Each actor's gateway origin answers +// /_rstack/actor and relays only that actor's paths with that actor's own +// credential, so the page never holds a credential or chooses a profile. + +type Json = Record + +function element(id: string): T { + const node = document.getElementById(id) + if (!node) throw new Error('The page needs #' + id) + return node as T +} + +function text(value: FormDataEntryValue | null, maximumLength: number) { + if (typeof value !== 'string') return undefined + const bounded = value.trim() + return bounded.length > 0 && bounded.length <= maximumLength ? bounded : undefined +} + +function field(value: unknown, ...path: string[]): unknown { + return path.reduce((node, key) => + typeof node === 'object' && node !== null ? (node as Json)[key] : undefined, value) +} + +async function call(path: string, init: { method?: string; body?: unknown; headers?: Record } = {}) { + const response = await fetch(path, { + method: init.method ?? 'GET', + credentials: 'same-origin', + headers: { + Accept: 'application/json', + 'Registry-Client': 'page', + ...(init.body === undefined ? {} : { 'Content-Type': 'application/json' }), + ...init.headers, + }, + body: init.body === undefined ? undefined : JSON.stringify(init.body), + }) + const body: unknown = response.status === 204 ? null : await response.json().catch(() => null) + return { status: response.status, body } +} + +const alert = element('error') +const status = element('status') + +async function applicant() { + element('applicant').hidden = false + const form = element('application') + form.addEventListener('submit', async (event) => { + event.preventDefault() + alert.textContent = '' + const data = new FormData(form) + const activity = text(data.get('activity'), 160) + const site = text(data.get('site'), 160) + if (!activity || !site) { + alert.textContent = 'Enter an activity and a site within the stated limits.' + return + } + element('submit').disabled = true + status.textContent = 'Submitting the application.' + try { + const submitted = await call('/registry/permits/v1/actions/submit-application', { + method: 'POST', headers: { 'Idempotency-Key': crypto.randomUUID() }, + body: { input: { activity, site } }, + }) + const recordId = field(submitted.body, 'results', 'application', 'recordId') + if (submitted.status !== 200 || typeof recordId !== 'string') throw new Error('submit') + element('application-id').textContent = recordId + + const contract = await call('/registry/permit-flow/v1/workflows/permit-flow') + const workflowRevision = field(contract.body, 'workflowRevision') + if (contract.status !== 200 || typeof workflowRevision !== 'string') throw new Error('workflow') + // The run names only the application. The Coordinator reads it under + // its own profile and reviews and decides only what it read. + const started = await call('/registry/permit-flow/v1/runs', { + method: 'POST', headers: { 'Idempotency-Key': crypto.randomUUID() }, + body: { workflow: 'permit-flow', workflowRevision, input: { applicationId: recordId } }, + }) + const runId = field(started.body, 'runId') + if (started.status !== 200 || typeof runId !== 'string') throw new Error('start') + element('run-id').textContent = runId + element('submitted').hidden = false + form.hidden = true + status.textContent = '' + await follow(runId) + } catch { + alert.textContent = 'We could not submit the application and start its review.' + status.textContent = '' + element('submit').disabled = false + } + }) + + // The applicant's own attempt to decide: Casework, not the page, refuses it. + const attempt = element('decision-attempt') + attempt.addEventListener('submit', async (event) => { + event.preventDefault() + const taskId = text(new FormData(attempt).get('taskId'), 64) + if (!taskId) return + const decided = await call('/registry/casework/v1/review-tasks/' + taskId + '/decisions', { + method: 'POST', headers: { 'If-Match': '"1"', 'Idempotency-Key': crypto.randomUUID() }, + body: { decision: { type: 'approve', outcome: 'approved' } }, + }) + element('decision-attempt-result').textContent = decided.status === 403 + ? 'Casework refused the decision (403).' + : 'Casework answered ' + decided.status + '.' + }) +} + +async function follow(runId: string) { + for (;;) { + const run = await call('/registry/permit-flow/v1/runs/' + runId) + const state = field(run.body, 'state') + element('run-step').textContent = String(field(run.body, 'step') ?? '') + element('run-state').textContent = String(state ?? '') + // Every state but these two is terminal or needs an operator. + if (typeof state === 'string' && state !== 'running' && state !== 'cancel-requested') { + element('run-outcome').textContent = String(field(run.body, 'outcome') ?? '') + element('run-assessment').textContent = String(field(run.body, 'output', 'assessment') ?? '') + return + } + await new Promise(resolve => setTimeout(resolve, 1000)) + } +} + +function line(label: string, value: unknown) { + const item = document.createElement('div') + const term = document.createElement('dt') + term.textContent = label + const detail = document.createElement('dd') + detail.textContent = String(value ?? '') + item.append(term, detail) + return item +} + +// The officer sees the content under review before claiming, and claims and +// approves in two separate steps. +async function officer() { + element('officer').hidden = false + const list = element('tasks') + element('refresh').addEventListener('click', async () => { + const tasks = await call('/registry/casework/v1/review-tasks?queue=permit-officers') + const items = field(tasks.body, 'items') + list.replaceChildren() + for (const task of Array.isArray(items) ? items : []) { + const taskId = field(task, 'taskId') + if (typeof taskId !== 'string') continue + const context = await call('/registry/casework/v1/review-tasks/' + taskId + '/context') + const snapshot = field(context.body, 'context', 'snapshot') + const item = document.createElement('li') + item.dataset.taskId = taskId + item.dataset.applicationId = String(field(context.body, 'subject', 'id') ?? '') + const details = document.createElement('dl') + details.append( + line('Activity', field(snapshot, 'activity')), + line('Site', field(snapshot, 'site')), + line('Application', field(context.body, 'subject', 'id')), + ) + let revision = field(task, 'revision') + const claim = document.createElement('button') + claim.textContent = 'Claim' + const approve = document.createElement('button') + approve.textContent = 'Approve' + approve.disabled = true + claim.addEventListener('click', async () => { + claim.disabled = true + const claimed = await call('/registry/casework/v1/review-tasks/' + taskId + '/claim', { + method: 'POST', headers: { 'If-Match': '"' + String(revision) + '"', 'Idempotency-Key': crypto.randomUUID() }, + }) + revision = field(claimed.body, 'revision') + item.dataset.claimed = String(claimed.status) + claim.textContent = claimed.status === 200 ? 'Claimed' : 'Casework answered ' + claimed.status + approve.disabled = claimed.status !== 200 + }) + approve.addEventListener('click', async () => { + approve.disabled = true + const decided = await call('/registry/casework/v1/review-tasks/' + taskId + '/decisions', { + method: 'POST', headers: { 'If-Match': '"' + String(revision) + '"', 'Idempotency-Key': crypto.randomUUID() }, + body: { decision: { type: 'approve', outcome: 'approved' } }, + }) + item.dataset.decided = String(decided.status) + approve.textContent = decided.status === 204 ? 'Approved' : 'Casework answered ' + decided.status + }) + item.append(details, claim, ' ', approve) + list.append(item) + } + }) + + const lookup = element('application-lookup') + lookup.addEventListener('submit', async (event) => { + event.preventDefault() + const recordId = text(new FormData(lookup).get('applicationId'), 64) + if (!recordId) return + const record = await call('/registry/permits/v1/records/permit-applications/' + recordId) + const data = field(record.body, 'data', 'domainData') + element('register-activity').textContent = String(field(data, 'activity') ?? '') + element('register-site').textContent = String(field(data, 'site') ?? '') + element('register-status').textContent = String(field(data, 'status') ?? record.status) + }) +} + +// The page bundles as a classic script, so it starts from one async call. +async function start() { + const whoami = await call('/_rstack/actor') + const actor = field(whoami.body, 'actor') + element('actor').textContent = String(actor ?? '') + if (actor === 'applicant') await applicant() + else if (actor === 'officer') await officer() + else alert.textContent = 'This page has no controls for this person.' +} + +start().catch(() => { + alert.textContent = 'This page could not start.' +}) diff --git a/products/platform/examples/service-previews/permit-review/web/tsconfig.json b/products/platform/examples/service-previews/permit-review/web/tsconfig.json new file mode 100644 index 0000000000..9d2bcc4a8a --- /dev/null +++ b/products/platform/examples/service-previews/permit-review/web/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "lib": ["DOM", "ES2023"], + "module": "NodeNext", + "moduleResolution": "NodeNext", + "noEmit": true, + "strict": true, + "target": "ES2023" + }, + "include": ["src/**/*.ts"] +} diff --git a/products/platform/generated/dev/dev.v1alpha1.schema.json b/products/platform/generated/dev/dev.v1alpha1.schema.json index 49de653b2e..9ce15fb8db 100644 --- a/products/platform/generated/dev/dev.v1alpha1.schema.json +++ b/products/platform/generated/dev/dev.v1alpha1.schema.json @@ -1,5 +1,21 @@ { "$defs": { + "ActorRoutes": { + "additionalProperties": false, + "description": "The product paths one preview actor may reach, grouped by product and\nmethod.", + "properties": { + "breg": { + "$ref": "#/$defs/Routes" + }, + "casework": { + "$ref": "#/$defs/Routes" + }, + "coordinator": { + "$ref": "#/$defs/Routes" + } + }, + "type": "object" + }, "ApplicationPlan": { "additionalProperties": false, "description": "A generic Node application and its configuration command. All artifact paths are relative to the supplied built root.", @@ -274,7 +290,7 @@ }, "Bindings": { "additionalProperties": false, - "description": "Run-local connections between BReg and Casework. Configuring either one requires both products.", + "description": "Run-local connections between products. The BReg and Casework bindings require both products; the Coordinator review producer requires Coordinator and Casework.", "properties": { "bregReviewAuthority": { "$ref": "#/$defs/BregReviewAuthority", @@ -283,6 +299,14 @@ "caseworkContextProvider": { "$ref": "#/$defs/CaseworkContextProvider", "description": "Connects Casework to BReg as a context provider. Casework authenticates to BReg as a machine identity." + }, + "coordinatorBregClient": { + "$ref": "#/$defs/CoordinatorBregClient", + "description": "Gives one Coordinator BReg connection a machine identity on the run's token endpoint, with exactly one test person's BReg grant. BReg's own access profile and Action rules decide every call. Development runs only." + }, + "coordinatorReviewProducer": { + "$ref": "#/$defs/CoordinatorReviewProducer", + "description": "Connects the Coordinator to Casework as one trusted review producer. The Coordinator authenticates to Casework as a machine identity, and Casework wakes its waiting run through a completion hook. Development runs only." } }, "type": "object" @@ -339,6 +363,59 @@ ], "type": "object" }, + "CoordinatorBregClient": { + "additionalProperties": false, + "description": "One Coordinator `breg` connection the run authenticates as one test\nperson. The person's BReg grant is the only source of the connection's\nprofile and scopes; nothing in dev.yaml adds to them.", + "properties": { + "connection": { + "$ref": "#/$defs/LocalId", + "description": "The Coordinator `runtime.yaml` connection of type `breg`, without task authority." + }, + "identity": { + "$ref": "#/$defs/LocalId", + "description": "Name of the test person, in `people`, whose BReg grant the Coordinator uses." + } + }, + "required": [ + "connection", + "identity" + ], + "type": "object" + }, + "CoordinatorReviewProducer": { + "additionalProperties": false, + "description": "The Coordinator's Casework review producer connection that the run binds\nto Casework. Casework trusts exactly the producer the connection names, for\nthe run issuer, only when its pinned issuer, profile and subject match the\nguards; nothing here widens what Casework trusts.", + "properties": { + "completionDestination": { + "$ref": "#/$defs/LocalId", + "description": "The completion `destinationId` the producer names in `casework.yaml`. The run binds it to the Coordinator's completion endpoint with a per-run key." + }, + "connection": { + "$ref": "#/$defs/LocalId", + "description": "The Coordinator `runtime.yaml` connection of type `casework-review-producer`. Its `producer` names the Casework trusted producer." + }, + "identity": { + "$ref": "#/$defs/LocalId", + "description": "Name of the test person, in `people`, whose Casework grant the Coordinator uses to authenticate. Its profile and subject are the producer's." + }, + "producer": { + "$ref": "#/$defs/LocalId", + "description": "The Casework trusted producer in `casework.yaml`. It must be the producer the connection names." + }, + "runIssuerBinding": { + "$ref": "#/$defs/ProducerIssuerBinding", + "description": "The exact source guards for binding this producer to the synthetic run issuer. It has no initiator guard." + } + }, + "required": [ + "connection", + "producer", + "identity", + "completionDestination", + "runIssuerBinding" + ], + "type": "object" + }, "DerivedId": { "description": "A dotted development journey step identifier whose segments are local identifiers.", "maxLength": 64, @@ -452,11 +529,21 @@ "properties": { "actor": { "$ref": "#/$defs/LocalId", - "description": "Synthetic development identity whose checked BReg grant is used on the server." + "description": "Synthetic development identity whose checked BReg grant is used on the server. Use with `breg`, or use `actors` instead." + }, + "actors": { + "additionalProperties": { + "$ref": "#/$defs/ActorRoutes" + }, + "description": "One to eight synthetic identities, each served on its own loopback gateway origin over the same page, with the product paths it may reach. Use instead of `actor` and `breg`. Every actor needs a BReg grant, and a grant for each other product it reaches.", + "propertyNames": { + "$ref": "#/$defs/LocalId" + }, + "type": "object" }, "breg": { "$ref": "#/$defs/Routes", - "description": "BReg paths exposed to the page, grouped by method." + "description": "BReg paths exposed to the page of the single `actor`, grouped by method." }, "functions": { "description": "Declared functions to expose on the loopback preview origin.", @@ -472,13 +559,24 @@ } }, "required": [ - "actor", "page", - "breg", "functions" ], "type": "object" }, + "ProducerIssuerBinding": { + "additionalProperties": false, + "description": "The run issuer guards of a binding that rebinds a producer only, never an\ninitiator.", + "properties": { + "producer": { + "$ref": "#/$defs/RunProducer" + } + }, + "required": [ + "producer" + ], + "type": "object" + }, "Product": { "description": "A product the development run can start.", "enum": [ diff --git a/products/platform/scripts/prepare-service-preview-locks.mjs b/products/platform/scripts/prepare-service-preview-locks.mjs index 482a22c651..a857930729 100644 --- a/products/platform/scripts/prepare-service-preview-locks.mjs +++ b/products/platform/scripts/prepare-service-preview-locks.mjs @@ -59,7 +59,7 @@ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) assert.ok(archive && directory && extra.length === 0 && [archive, directory].every(isAbsolute), 'Usage: node prepare-service-preview-locks.mjs /absolute/client.tgz /absolute/service-previews') const client = await previewClientArchive(archive) - for (const name of ['medical-renewal', 'business-registration']) { + for (const name of ['medical-renewal', 'business-registration', 'permit-review']) { await stagePreviewClient(join(directory, name), client, { pin: true }) } } diff --git a/products/platform/scripts/test-service-previews.mjs b/products/platform/scripts/test-service-previews.mjs index d940014ffe..9d4e2ce9ae 100644 --- a/products/platform/scripts/test-service-previews.mjs +++ b/products/platform/scripts/test-service-previews.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { execFile } from 'node:child_process' -import { createHash } from 'node:crypto' +import { createHash, createHmac, randomBytes, randomUUID } from 'node:crypto' import { constants } from 'node:fs' import { cp, mkdtemp, mkdir, open, readdir, readFile, rm, stat, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' @@ -200,6 +200,208 @@ async function business(page, url, expectedName = 'Harbour Bicycle Cooperative') return { matchingRecords: records.length, revision: Number(record.revisionId) } } +// Same-origin gateway call as that actor's page would make it. +async function actorCall(origin, path, init = {}) { + const response = await fetch(new URL(path, origin), { + ...init, + headers: { Accept: 'application/json', 'Registry-Client': 'page', Origin: origin.origin, ...init.headers }, + signal: AbortSignal.timeout(8_000), + redirect: 'error', + }) + return { status: response.status, body: await response.json().catch(() => null) } +} + +// The applicant and the officer on two browser contexts, each on its own +// actor origin over the same built page. The applicant starts a Coordinator +// run that names only its application; the Coordinator reads it, Casework +// refuses the applicant's own decision, a forged completion cannot wake the +// run, another applicant cannot follow it, and the officer's approval lets +// the run record the assessment and the decision in BReg. A second run whose +// start the browser tampers with reviews and decides only the record the +// Coordinator read. +async function permitReview(browser, url, report) { + const actors = report.previewActors + assert.deepEqual(Object.keys(actors ?? {}), ['applicant', 'neighbour', 'officer']) + const [applicantUrl, neighbourUrl, officerUrl] = ['applicant', 'neighbour', 'officer'].map(name => loopback(actors[name])) + assert.equal(applicantUrl.href, url.href) + assert.equal(new Set([applicantUrl.origin, neighbourUrl.origin, officerUrl.origin]).size, 3) + assert.ok(report.substitutions.includes('per-actor gateway origin (development)')) + for (const path of ['/', '/app.js', '/service.css']) { + const bodies = await Promise.all([applicantUrl, neighbourUrl, officerUrl].map(async origin => { + const response = await fetch(new URL(path, origin), { signal: AbortSignal.timeout(8_000), redirect: 'error' }) + assert.equal(response.status, 200, path) + return Buffer.from(await response.arrayBuffer()) + })) + assert.ok(bodies.every(body => body.equals(bodies[0])), `The actor origins served different bytes for ${path}.`) + } + // The neighbour's application, seeded by the startup journey. + const listed = await actorCall(officerUrl, '/registry/permits/v1/records/permit-applications') + assert.equal(listed.status, 200) + const neighbourApplication = listed.body.items.find(record => record.domainData.activity === 'Daytime survey') + assert.equal(neighbourApplication?.domainData.status, 'submitted') + + const errors = [] + const requests = [] + const open = async () => { + const context = await browser.newContext({ viewport: { width: 390, height: 900 } }) + const page = await context.newPage() + page.setDefaultTimeout(8_000) + page.on('pageerror', () => errors.push('uncaught page error')) + page.on('request', request => { + const path = new URL(request.url()).pathname + if (path.startsWith('/registry/') || path.startsWith('/_rstack/actor')) requests.push(request) + }) + return { context, page } + } + const applicant = await open() + const officer = await open() + const submit = async (activity, site) => { + const page = applicant.page + await page.goto(applicantUrl.href) + await page.locator('#actor').getByText('applicant', { exact: true }).waitFor() + await page.getByLabel('Activity').fill(activity) + await page.getByLabel('Site').fill(site) + await page.getByRole('button', { name: 'Submit application' }).click() + await page.getByRole('heading', { name: 'Application under review' }).waitFor() + const applicationId = (await page.locator('#application-id').textContent())?.trim() + const runId = (await page.locator('#run-id').textContent())?.trim() + assert.match(applicationId ?? '', uuid) + assert.match(runId ?? '', uuid) + await page.locator('#run-step').getByText('await-review', { exact: true }).waitFor({ timeout: 60_000 }) + return { applicationId, runId } + } + // The officer's task for one application, with the content under review. + const task = async applicationId => { + await officer.page.getByRole('button', { name: 'Show tasks' }).click() + const item = officer.page.locator(`#tasks li[data-application-id="${applicationId}"]`) + await item.waitFor() + return item + } + const approve = async item => { + await item.getByRole('button', { name: 'Claim', exact: true }).click() + await item.getByRole('button', { name: 'Claimed' }).waitFor() + assert.equal(await item.getAttribute('data-claimed'), '200') + await item.getByRole('button', { name: 'Approve', exact: true }).click() + await item.getByRole('button', { name: 'Approved' }).waitFor() + assert.equal(await item.getAttribute('data-decided'), '204') + } + const registered = async applicationId => { + const read = await actorCall(officerUrl, '/registry/permits/v1/records/permit-applications/' + applicationId) + assert.equal(read.status, 200) + return read.body.data.domainData + } + try { + const page = applicant.page + const first = await submit('Night resurfacing', 'North road') + + // A well-formed completion for the configured recipient binding, signed + // with a key Casework does not hold, cannot wake the waiting run: only + // the signature check refuses it. + const coordinator = loopback(report.products.coordinator) + const eventId = randomUUID() + const timestamp = String(Math.floor(Date.now() / 1000)) + const event = JSON.stringify({ + type: 'review.completed', eventId, requestId: randomUUID(), resultId: randomUUID(), + completedAt: new Date().toISOString(), + }) + const forgedSignature = createHmac('sha256', randomBytes(32)).update(`${eventId}.${timestamp}.${event}`).digest('base64') + const forged = await fetch(new URL('/v1/review-completions', coordinator), { + method: 'POST', + headers: { + 'content-type': 'application/json', + 'registry-recipient-binding': 'coordinator-v1', + 'webhook-id': eventId, + 'webhook-timestamp': timestamp, + 'webhook-signature': 'v1,' + forgedSignature, + }, + body: event, + signal: AbortSignal.timeout(8_000), + redirect: 'error', + }) + assert.equal(forged.status, 401, 'The Coordinator accepted a completion Casework did not sign.') + assert.equal((await forged.json()).code, 'authentication.refused') + + // The applicant follows its own run, and another applicant cannot: the + // Coordinator itself answers that the run is not visible. + assert.equal((await actorCall(applicantUrl, '/registry/permit-flow/v1/runs/' + first.runId)).status, 200) + const foreign = await actorCall(neighbourUrl, '/registry/permit-flow/v1/runs/' + first.runId) + assert.equal(foreign.status, 404, 'Another applicant could read the run.') + assert.equal(foreign.body?.code, 'run.not-visible') + + // The run input names only the application, so content is refused. + const workflow = await actorCall(applicantUrl, '/registry/permit-flow/v1/workflows/permit-flow') + const withContent = await actorCall(applicantUrl, '/registry/permit-flow/v1/runs', { + method: 'POST', + headers: { 'Content-Type': 'application/json', 'Idempotency-Key': randomUUID() }, + body: JSON.stringify({ + workflow: 'permit-flow', workflowRevision: workflow.body.workflowRevision, + input: { applicationId: first.applicationId, activity: 'Harmless survey' }, + }), + }) + assert.equal(withContent.status, 400, `A start carrying content answered ${withContent.status}.`) + assert.equal(withContent.body?.code, 'input.invalid') + + await officer.page.goto(officerUrl.href) + await officer.page.locator('#actor').getByText('officer', { exact: true }).waitFor() + const firstTask = await task(first.applicationId) + await firstTask.getByText('Night resurfacing', { exact: true }).waitFor() + await firstTask.getByText('North road', { exact: true }).waitFor() + const taskId = await firstTask.getAttribute('data-task-id') + assert.match(taskId ?? '', uuid) + + // The applicant's own decision reaches Casework, which refuses it. + await page.getByLabel('Task', { exact: true }).fill(taskId) + await page.getByRole('button', { name: 'Approve', exact: true }).click() + await page.getByText('Casework refused the decision (403).').waitFor() + assert.equal(await page.locator('#run-step').textContent(), 'await-review') + assert.equal((await actorCall(applicantUrl, '/registry/permit-flow/v1/runs/' + first.runId)).body.step, 'await-review') + + await approve(firstTask) + await page.locator('#run-outcome').getByText('approved', { exact: true }).waitFor({ timeout: 90_000 }) + assert.equal(await page.locator('#run-state').textContent(), 'finished') + assert.equal(await page.locator('#run-assessment').textContent(), 'conditions') + assert.equal((await registered(first.applicationId)).status, 'approved') + + // The browser rewrites its start to name the neighbour's application. + await page.route('**/registry/permit-flow/v1/runs', async route => { + const body = route.request().postDataJSON() + body.input.applicationId = neighbourApplication.recordId + await route.continue({ postData: JSON.stringify(body) }) + }) + const tampered = await submit('Night works', 'Harbour road') + await page.unroute('**/registry/permit-flow/v1/runs') + const tamperedTask = await task(neighbourApplication.recordId) + await tamperedTask.getByText('Daytime survey', { exact: true }).waitFor() + await tamperedTask.getByText('Market square', { exact: true }).waitFor() + assert.equal(await officer.page.locator(`#tasks li[data-application-id="${tampered.applicationId}"]`).count(), 0) + await approve(tamperedTask) + await page.locator('#run-outcome').getByText('approved', { exact: true }).waitFor({ timeout: 90_000 }) + assert.equal(await page.locator('#run-assessment').textContent(), 'standard') + const decided = await registered(neighbourApplication.recordId) + assert.deepEqual([decided.activity, decided.site, decided.status], ['Daytime survey', 'Market square', 'approved']) + const untouched = await registered(tampered.applicationId) + assert.deepEqual([untouched.activity, untouched.status], ['Night works', 'submitted']) + + assert.deepEqual(errors, []) + assert.ok(requests.some(request => new URL(request.url()).pathname.startsWith('/registry/casework/'))) + assert.ok(requests.some(request => new URL(request.url()).pathname.startsWith('/registry/permit-flow/'))) + for (const request of requests) { + const headers = await request.allHeaders() + assert.equal(Boolean(headers.authorization), false, 'The browser sent an Authorization header.') + assert.equal(headers['registry-client'], 'page') + } + return { + actors: 3, identicalPages: true, applicantDecisionStatus: 403, forgedCompletionStatus: 401, + foreignRunStatus: 404, contentStartRefused: true, outcome: 'approved', assessment: 'conditions', registerStatus: 'approved', + tamperedStart: { reviewed: 'neighbour application', assessment: 'standard', ownApplication: 'submitted' }, + browserBearer: false, + } + } finally { + await applicant.context.close() + await officer.context.close() + } +} + async function exercise(browser, url, journey) { const page = await browser.newPage({ viewport: { width: 390, height: 900 } }) page.setDefaultTimeout(8_000) @@ -253,8 +455,9 @@ async function main() { delete env.RSTACK_DEV_DATABASE_URL delete env.RSTACK_DEV_DATABASE_CA if (managed) { - delete env.RSTACK_BREG_BIN - delete env.RSTACK_BREGCTL_BIN + for (const name of ['BREG', 'BREGCTL', 'CASEWORK', 'CASEWORKCTL', 'COORDINATOR', 'COORDINATORCTL']) { + delete env[`RSTACK_${name}_BIN`] + } } const devArgs = (...args) => [...globalFlags, 'dev', ...args, '--format', 'json'] const dev = async (...args) => JSON.parse(await command(rstack, devArgs(...args), env)) @@ -268,7 +471,7 @@ async function main() { assert.equal(await treeDigest(project), before, 'npm ci modified the delivered example.') return project } - async function runProject(project, functionName, journey, onReady) { + async function runProject(project, functionName, journey, onReady, drive = exercise) { const before = await treeDigest(project) // Keep recovery state if startup times out and the driver never sees a run ID. keepScratch = true @@ -302,7 +505,7 @@ async function main() { }) assert.equal(wrongOrigin.status, 403, 'The preview gateway allowed a different browser origin.') await wrongOrigin.body?.cancel() - result = await exercise(browser, url, journey) + result = await drive(browser, url, journey, report) } finally { const stopped = await dev('stop', report.run_id, '--clean') assert.equal(stopped.cleaned, true) @@ -312,7 +515,8 @@ async function main() { assert.equal(containers.trim(), '', 'The managed PostgreSQL container survived clean stop.') keepScratch = false } - for (const address of [url, privateOrigin]) { + const actorOrigins = Object.values(report.previewActors ?? {}).map(loopback) + for (const address of [url, privateOrigin, ...actorOrigins]) { await assert.rejects(fetch(address, { signal: AbortSignal.timeout(2_000) }), { name: 'TypeError' }) } assert.equal(await treeDigest(project), before, 'Preview modified the authored project.') @@ -326,10 +530,24 @@ async function main() { const medical = await runProject(medicalProject, 'renew', renewal) const registered = await runProject(businessProject, 'register-business', business) assert.notEqual(medical.volume, registered.volume) + // Every run proves permit-review, unless a managed candidate whose release + // ships no Coordinator says so explicitly; a missing install then fails. + const skipPermit = process.env.RSTACK_PREVIEW_SKIP_PERMIT_REVIEW === 'no-coordinator-in-release' + assert.ok(!skipPermit || managed, 'Only a managed candidate may skip permit-review.') + let permit + if (!skipPermit) { + const permitProject = await installProject('permit-review') + permit = await runProject(permitProject, 'assess-permit', null, undefined, + (browser, url, _journey, report) => permitReview(browser, url, report)) + assert.equal(new Set([medical.volume, registered.volume, permit.volume]).size, 3) + } const results = [ { name: 'medical-renewal', ...medical.result, directAnonymousStatus: 401, wrongOriginStatus: 403 }, { name: 'business-registration', ...registered.result, directAnonymousStatus: 401, wrongOriginStatus: 403 }, + permit + ? { name: 'permit-review', ...permit.result, directAnonymousStatus: 401, wrongOriginStatus: 403 } + : { name: 'permit-review', skipped: 'This release ships no Coordinator.' }, ] if (!managed) { From a198f43028d913afdd2430964a60a70a9f5d285c Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 28/55] ci: build and run Casework and the Coordinator for the service previews The permit-review preview starts Casework and the Coordinator. CI now routes the browser previews on changes to those crates, builds their binaries beside BReg, and passes their paths to the driver, with five more minutes for the third preview. The release-candidate install smoke installs Casework and the Coordinator whenever the roster ships the Coordinator binaries, so such a candidate must pass permit-review; only a release without them sets RSTACK_PREVIEW_SKIP_PERMIT_REVIEW. The routing test pins both roster gates. Signed-off-by: Jeremi Joslin --- .github/scripts/ci_changes.py | 11 ++++++++- .github/scripts/test_ci_changes.py | 30 +++++++++++++++++++++++++ .github/workflows/ci.yml | 13 ++++++++--- .github/workflows/release-candidate.yml | 28 +++++++++++++++++++++-- 4 files changed, 76 insertions(+), 6 deletions(-) diff --git a/.github/scripts/ci_changes.py b/.github/scripts/ci_changes.py index 3eb7b16a70..7f563e63af 100644 --- a/.github/scripts/ci_changes.py +++ b/.github/scripts/ci_changes.py @@ -218,6 +218,15 @@ def literal(node: ast.expr | None) -> Any: return values +# The service previews start these products: BReg in every example, and +# Casework and the Coordinator in permit-review. +SERVICE_PREVIEW_PRODUCT_PACKAGES = frozenset({ + "registry-breg", + "registry-bregctl", + "registry-casework", + "registry-caseworkctl", + "registry-coordinator", +}) # The shared dependency gate owns the list of development runner hosts; it # is read as data, and test_ci_changes.py holds it equal to the gate's own. _dev_runner_gate = literal_assignments( @@ -1876,7 +1885,7 @@ def classify( service_previews = ( complete - or bool(affected & (RSTACK_DEV_HARNESS_PACKAGES | {"registry-breg", "registry-bregctl"})) + or bool(affected & (RSTACK_DEV_HARNESS_PACKAGES | SERVICE_PREVIEW_PRODUCT_PACKAGES)) or any(matches(path, *SERVICE_PREVIEW_INPUTS) for path in paths) ) diff --git a/.github/scripts/test_ci_changes.py b/.github/scripts/test_ci_changes.py index 109af02517..f256c27db0 100644 --- a/.github/scripts/test_ci_changes.py +++ b/.github/scripts/test_ci_changes.py @@ -3942,6 +3942,10 @@ def test_service_preview_inputs_select_installed_browser_proof(self) -> None: "clients/typescript/preview/host.mjs", "products/platform/examples/service-previews/medical-renewal/dev.yaml", "products/platform/scripts/test-service-previews.mjs", + # permit-review starts Casework and the Coordinator. + "crates/registry-casework/src/lib.rs", + "crates/registry-caseworkctl/src/main.rs", + "crates/registry-coordinator/src/lib.rs", ): with self.subTest(path=path): outputs = classify(self.workspace, (path,)) @@ -3952,6 +3956,32 @@ def test_service_preview_inputs_select_installed_browser_proof(self) -> None: browser = next(step for step in steps if step.get("name") == "Run installed service previews in Chromium") self.assertIn("needs.changes.outputs.service_previews", browser["if"]) self.assertIn("test-service-previews.mjs", browser["run"]) + build = next(step for step in steps if step.get("name") == "Build the preview launcher and product tools") + for package in ("registry-casework", "registry-caseworkctl", "registry-coordinator"): + self.assertIn(f"-p {package}", build["run"]) + for name in ("CASEWORK", "CASEWORKCTL", "COORDINATOR", "COORDINATORCTL"): + self.assertIn(f"RSTACK_{name}_BIN", browser["env"]) + # A candidate whose release ships the Coordinator installs it and must + # pass permit-review; only one without it may skip, through the roster. + candidate = yaml.safe_load(Path(".github/workflows/release-candidate.yml").read_text()) + runs = [ + step.get("run", "") + for job in candidate["jobs"].values() + for step in job.get("steps", []) + ] + install = next(run for run in runs if "rstack-${tag}-install.sh" in run) + self.assertIn("coordinator-binaries-in-release", install) + self.assertIn("components+=(casework coordinator)", install) + smoke = next(run for run in runs if "test-service-previews.mjs" in run) + self.assertIn("coordinator-binaries-in-release", smoke) + self.assertIn("RSTACK_PREVIEW_SKIP_PERMIT_REVIEW=no-coordinator-in-release", smoke) + # A roster failure fails the step: its output is assigned first, never + # read inside [[ ]], where set -e does not stop a failed substitution. + for run in (install, smoke): + self.assertIn('coordinator_in_release="$(python3 release/scripts/release_roster.py', run) + self.assertNotRegex(run, r'\$\(python3 release/scripts/release_roster\.py\s*\\?\s*coordinator-binaries-in-release[^)]*\)"\s*[!=]=') + self.assertIn('for component in casework coordinator; do', install) + self.assertIn('"${component}ctl ${version}"', install) def test_development_schema_drift_runs_in_the_conformance_job(self) -> None: for path in ( diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c78f17c682..edd74b876c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4308,9 +4308,12 @@ jobs: - name: Build run: npm --prefix clients/typescript run build - - name: Build the preview launcher and BReg tools + - name: Build the preview launcher and product tools if: needs.changes.outputs.service_previews == 'true' - run: cargo build --locked --bins --features registry-breg/runtime -p registry-rstack -p registry-breg -p registry-bregctl + run: >- + cargo build --locked --bins --features registry-breg/runtime + -p registry-rstack -p registry-breg -p registry-bregctl + -p registry-casework -p registry-caseworkctl -p registry-coordinator - name: Install Chromium for previews if: needs.changes.outputs.service_previews == 'true' @@ -4318,10 +4321,14 @@ jobs: - name: Run installed service previews in Chromium if: needs.changes.outputs.service_previews == 'true' - timeout-minutes: 15 + timeout-minutes: 20 env: RSTACK_BREG_BIN: ${{ github.workspace }}/target/debug/breg RSTACK_BREGCTL_BIN: ${{ github.workspace }}/target/debug/bregctl + RSTACK_CASEWORK_BIN: ${{ github.workspace }}/target/debug/casework + RSTACK_CASEWORKCTL_BIN: ${{ github.workspace }}/target/debug/caseworkctl + RSTACK_COORDINATOR_BIN: ${{ github.workspace }}/target/debug/coordinator + RSTACK_COORDINATORCTL_BIN: ${{ github.workspace }}/target/debug/coordinatorctl run: | set -euo pipefail client_dir="${GITHUB_WORKSPACE}/clients/typescript" diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml index 1969730087..9a630d4226 100644 --- a/.github/workflows/release-candidate.yml +++ b/.github/workflows/release-candidate.yml @@ -2559,11 +2559,21 @@ jobs: sha256sum -- * > SHA256SUMS ) destination="${RUNNER_TEMP}/rstack-install-smoke" + components=(breg evidence) + # The permit-review preview also needs Casework and the Coordinator. + # A release that ships them must install and pass it; the preview + # smoke skips it only for a release without the Coordinator. The + # assignment fails the step when the roster itself fails. + coordinator_in_release="$(python3 release/scripts/release_roster.py \ + coordinator-binaries-in-release "${version}")" + if [[ "${coordinator_in_release}" == true ]]; then + components+=(casework coordinator) + fi bash "${assets}/rstack-${tag}-install.sh" \ --asset-dir "${assets}" \ --bin-dir "${destination}/bin" \ --install-root "${destination}/lib" \ - breg evidence + "${components[@]}" test -L "${destination}/bin/rstack" test "$(find "${destination}/bin" -mindepth 1 -maxdepth 1 | wc -l)" -eq 1 rstack=("${destination}/bin/rstack" @@ -2578,6 +2588,15 @@ jobs: >/dev/null test "$("${rstack[@]}" breg --version)" = "bregctl ${version}" test "$("${rstack[@]}" evidence --version)" = "evidencectl ${version}" + if [[ "${coordinator_in_release}" == true ]]; then + for component in casework coordinator; do + "${rstack[@]}" components list --format json \ + | jq -e --arg name "${component}" \ + '.components | any(.name == $name and .installed == true)' \ + >/dev/null + test "$("${rstack[@]}" "${component}" --version)" = "${component}ctl ${version}" + done + fi - name: Install Node for the installed service preview smoke if: needs.validate.outputs.unit == 'stack' @@ -2585,7 +2604,7 @@ jobs: with: node-version: 24.11.0 - - name: Smoke both role-backed previews with installed candidate artifacts + - name: Smoke the role-backed previews with installed candidate artifacts if: needs.validate.outputs.unit == 'stack' shell: bash env: @@ -2603,6 +2622,11 @@ jobs: export RSTACK_PREVIEW_INSTALL_ROOT="${destination}/lib" export RSTACK_PREVIEW_BIN_DIR="${destination}/bin" export RSTACK_PREVIEW_EXAMPLES_DIR="${RUNNER_TEMP}/candidate-service-previews" + coordinator_in_release="$(python3 release/scripts/release_roster.py \ + coordinator-binaries-in-release "${CANDIDATE_PREVIEW_VERSION}")" + if [[ "${coordinator_in_release}" != true ]]; then + export RSTACK_PREVIEW_SKIP_PERMIT_REVIEW=no-coordinator-in-release + fi cp -R products/platform/examples/service-previews "${RSTACK_PREVIEW_EXAMPLES_DIR}" node "${GITHUB_WORKSPACE}/products/platform/scripts/prepare-service-preview-locks.mjs" \ "${assets}/${web_package}" "${RSTACK_PREVIEW_EXAMPLES_DIR}" From 099a9f67a3448d45f526e15ee31812df1c860bcd Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 29/55] ci: run the Evidence store provisioning journey and fail on roster errors The Evidence store provisioning test reads the shared provisioning environment, so the TLS PostgreSQL lane now runs it and checks its own journey line, because those stores provision and serve nothing. Release candidate steps assign each roster answer before testing it, so a roster error fails the step instead of reading as not in release. Signed-off-by: Jeremi Joslin --- .github/scripts/ci_changes.py | 12 ++++++-- .github/scripts/test_ci_changes.py | 40 +++++++++++++++++++++++-- .github/workflows/ci.yml | 14 +++++++-- .github/workflows/release-candidate.yml | 19 +++++++----- 4 files changed, 70 insertions(+), 15 deletions(-) diff --git a/.github/scripts/ci_changes.py b/.github/scripts/ci_changes.py index 7f563e63af..07f7d8797b 100644 --- a/.github/scripts/ci_changes.py +++ b/.github/scripts/ci_changes.py @@ -721,17 +721,25 @@ def literal(node: ast.expr | None) -> Any: "registry-caseworkctl", "registry-coordinator", "registry-documentsctl", + "registry-evidencectl", "registry-messagingctl", "registry-schedulingctl", ) PROVISION_JOURNEY_INPUTS = ( - *(f"crates/{package}/src/provision.rs" for package in PROVISION_JOURNEY_PACKAGES), + *( + f"crates/{package}/src/provision.rs" + for package in PROVISION_JOURNEY_PACKAGES + if package != "registry-evidencectl" + ), # Each journey's test file. The database-free `provision_cli.rs` stays out. *( f"crates/{package}/tests/provision_postgres.rs" for package in PROVISION_JOURNEY_PACKAGES - if package != "registry-caseworkctl" + if package not in ("registry-caseworkctl", "registry-evidencectl") ), + # Evidence provisions its held stores and serves nothing. + "crates/registry-evidencectl/src/store_provision.rs", + "crates/registry-evidencectl/tests/store_provision.rs", "crates/registry-adapterctl/src/job_provision.rs", "crates/registry-adapterctl/tests/job_provision_postgres.rs", "crates/registry-adapter-job/src/main.rs", diff --git a/.github/scripts/test_ci_changes.py b/.github/scripts/test_ci_changes.py index f256c27db0..289f628297 100644 --- a/.github/scripts/test_ci_changes.py +++ b/.github/scripts/test_ci_changes.py @@ -4826,7 +4826,13 @@ def test_product_provisioning_changes_select_the_tls_postgres_lane(self) -> None self.assertEqual(set(PROVISION_JOURNEY_PACKAGES), set(journeys)) edgeless = Workspace(without_dependency_edges(self.metadata)) paths = [ - *(f"crates/{package}/src/provision.rs" for package in journeys), + # A journey test target names its source: `provision_postgres.rs` + # and `provision.rs` test `provision.rs`, `store_provision.rs` + # tests `store_provision.rs`. + *( + f"crates/{package}/src/{target.removesuffix('_postgres')}.rs" + for package, (target, _) in journeys.items() + ), *(f"crates/{package}/tests/{target}.rs" for package, (target, _) in journeys.items()), "crates/registry-adapterctl/src/job_provision.rs", "crates/registry-adapterctl/tests/job_provision_postgres.rs", @@ -4938,11 +4944,39 @@ def test_contracts_journeys_lane_runs_each_product_provisioning_journey( '"${log}"', command, ) + # Each log needs its journey's own line. A journey that serves + # matches the shared serve pattern, and one that only provisions, + # such as the Evidence stores, names its exact test. + serve = re.compile(r"provision_then_(apply_then_)?serve_with_[a-z_]+") self.assertIn( - "grep -Eq '^test ([a-z_]+::)?provision_then_(apply_then_)?serve_with_[a-z_]+ " - "\\.\\.\\. ok$' \"${log}\"", + "*) journey='^test ([a-z_]+::)?provision_then_(apply_then_)?serve_with_[a-z_]+ " + "\\.\\.\\. ok$' ;;", command, ) + for package, (_, tests) in journeys.items(): + if any(serve.fullmatch(test) for test in tests): + continue + with self.subTest(package=package): + self.assertEqual(1, len(tests), "a provision-only journey names one test") + self.assertIn( + f"{package}) journey='^test {tests[0]} \\.\\.\\. ok$' ;;", + command, + ) + self.assertIn('grep -Eq "${journey}" "${log}"', command) + + def test_no_workflow_reads_a_roster_answer_inside_a_conditional(self) -> None: + # Inside [[ ]], set -e does not stop a failed command substitution, so + # a roster error would read as "not in release". Assign the answer to + # a variable first, so the failure stops the step. + inline = re.compile( + r'\[\[[^\]]*?"\$\(python3 release/scripts/release_roster\.py', re.S + ) + for workflow in sorted(Path(".github/workflows").glob("*.yml")): + jobs = yaml.safe_load(workflow.read_text(encoding="utf-8"))["jobs"] + for job_name, job in jobs.items(): + for step in job.get("steps", []): + with self.subTest(workflow=workflow.name, job=job_name, step=step.get("name")): + self.assertIsNone(inline.search(step.get("run", ""))) def test_other_postgres_steps_leave_the_provisioning_journeys_to_the_tls_lane( self, diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index edd74b876c..9b6e565f93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2276,6 +2276,8 @@ jobs: | tee "${RUNNER_TEMP}/provision-journey-registry-coordinator.log" cargo test --locked -p registry-documentsctl --features postgres-test --test provision_postgres \ | tee "${RUNNER_TEMP}/provision-journey-registry-documentsctl.log" + cargo test --locked -p registry-evidencectl --features postgres-test --test store_provision \ + | tee "${RUNNER_TEMP}/provision-journey-registry-evidencectl.log" cargo test --locked -p registry-messagingctl --features postgres-test --test provision_postgres \ | tee "${RUNNER_TEMP}/provision-journey-registry-messagingctl.log" cargo test --locked -p registry-schedulingctl --features postgres-test --test provision_postgres \ @@ -2288,11 +2290,17 @@ jobs: grep -Eq '^test result: ok\. 1 passed; 0 failed; 0 ignored' "${job_log}" || { echo "::error::expected one passing Adapter job provisioning journey"; exit 1; } grep -Fxq 'test provision_then_initialize_and_run_with_split_roles ... ok' "${job_log}" || { echo "::error::expected the Adapter job provisioning journey to run and pass"; exit 1; } # A run that selected no test still exits 0, so every log needs a - # pass count, no ignored test, and the journey's own line. - for package in registry-adapterctl registry-bregctl registry-caseworkctl registry-coordinator registry-documentsctl registry-messagingctl registry-schedulingctl; do + # pass count, no ignored test, and the journey's own line. The + # Evidence stores provision and serve nothing, so their journey + # names its exact test. + for package in registry-adapterctl registry-bregctl registry-caseworkctl registry-coordinator registry-documentsctl registry-evidencectl registry-messagingctl registry-schedulingctl; do log="${RUNNER_TEMP}/provision-journey-${package}.log" grep -Eq '^test result: ok\. [1-9][0-9]* passed; 0 failed; 0 ignored' "${log}" || { echo "::error::expected the ${package} provisioning journey tests to pass with no test ignored"; exit 1; } - grep -Eq '^test ([a-z_]+::)?provision_then_(apply_then_)?serve_with_[a-z_]+ \.\.\. ok$' "${log}" || { echo "::error::expected the ${package} provisioning journey to run and pass"; exit 1; } + case "${package}" in + registry-evidencectl) journey='^test both_stores_provision_idempotently_without_migrating \.\.\. ok$' ;; + *) journey='^test ([a-z_]+::)?provision_then_(apply_then_)?serve_with_[a-z_]+ \.\.\. ok$' ;; + esac + grep -Eq "${journey}" "${log}" || { echo "::error::expected the ${package} provisioning journey to run and pass"; exit 1; } done - name: Stop PostgreSQL 16 for the provisioning floor test diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml index 9a630d4226..f065943eab 100644 --- a/.github/workflows/release-candidate.yml +++ b/.github/workflows/release-candidate.yml @@ -546,7 +546,9 @@ jobs: "coordinator ${{ needs.validate.outputs.version }}" test "$("dist/bin/coordinatorctl-${{ needs.validate.outputs.tag }}-linux-amd64" --version)" = \ "coordinatorctl ${{ needs.validate.outputs.version }}" - if [[ "$(python3 release/scripts/release_roster.py coordinator-in-release "${{ needs.validate.outputs.version }}")" == true ]]; then + coordinator_image_in_release="$(python3 release/scripts/release_roster.py \ + coordinator-in-release "${{ needs.validate.outputs.version }}")" + if [[ "${coordinator_image_in_release}" == true ]]; then test "$(dist/image-bin/coordinator --version)" = \ "coordinator ${{ needs.validate.outputs.version }}" test "$(dist/image-bin/coordinatorctl --version)" = \ @@ -2314,8 +2316,9 @@ jobs: "${binary} ${{ needs.validate.outputs.version }}" done rm candidate/bundle-root/SHA256SUMS - if [[ "$(python3 release/scripts/release_roster.py \ - rstack-in-release "${version}")" == true ]]; then + rstack_in_release="$(python3 release/scripts/release_roster.py \ + rstack-in-release "${version}")" + if [[ "${rstack_in_release}" == true ]]; then rstack_installer="rstack-${{ needs.validate.outputs.tag }}-install.sh" awk -v version="${{ needs.validate.outputs.tag }}" ' $0 == "default_version=\"\"" { @@ -2428,9 +2431,10 @@ jobs: done | jq -s . )" rstack_components=null + rstack_in_release="$(python3 release/scripts/release_roster.py \ + rstack-in-release "${version}")" if [[ "${{ needs.validate.outputs.unit }}" == stack && - "$(python3 release/scripts/release_roster.py \ - rstack-in-release "${version}")" == true ]]; then + "${rstack_in_release}" == true ]]; then rstack_components="$(printf '%s' "${payloads}" \ | python3 release/scripts/rstack_components.py --version "${version}")" fi @@ -2546,8 +2550,9 @@ jobs: run: | set -euo pipefail version="${{ needs.validate.outputs.version }}" - if [[ "$(python3 release/scripts/release_roster.py \ - rstack-in-release "${version}")" != true ]]; then + rstack_in_release="$(python3 release/scripts/release_roster.py \ + rstack-in-release "${version}")" + if [[ "${rstack_in_release}" != true ]]; then exit 0 fi tag="${{ needs.validate.outputs.tag }}" From 7a3edbd7a2ff2be1c1619a48c1f6423a44138cd8 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 30/55] refactor(coordinator): select outbound transport through the shared selector Folds these reviewed commits: - test(dev): pin every preview route parameter and the generator diagnostic order - test(coordinator): pin the external, decision and token transport rules - refactor(coordinator): select outbound transport through the shared selector Signed-off-by: Jeremi Joslin --- clients/typescript/preview/gateway.mjs | 2 +- .../typescript/preview/tests/preview.test.mjs | 13 +- crates/registry-coordinator/src/adapters.rs | 35 ++++-- crates/registry-coordinator/src/decision.rs | 33 ++---- .../registry-coordinator/src/external_http.rs | 30 +---- crates/registry-coordinator/src/lib.rs | 1 + crates/registry-coordinator/src/outbound.rs | 112 ++++++++++++++++++ crates/registry-coordinator/src/runtime.rs | 21 +--- .../tests/decision_runtime.rs | 102 ++++++++++++++++ .../tests/external_http.rs | 53 +++++++++ crates/registry-rstack-dev/src/plan.rs | 8 +- .../run-a-project-with-rstack-dev.mdx | 5 +- 12 files changed, 331 insertions(+), 84 deletions(-) create mode 100644 crates/registry-coordinator/src/outbound.rs diff --git a/clients/typescript/preview/gateway.mjs b/clients/typescript/preview/gateway.mjs index 51a40ebeda..068fe6f799 100644 --- a/clients/typescript/preview/gateway.mjs +++ b/clients/typescript/preview/gateway.mjs @@ -41,7 +41,7 @@ function compilePaths(paths = []) { if (parts.length < 2 || parts.filter(part => placeholders.has(part)).length > 1 || parts.filter(part => part === '{revision}').length > 1 || !parts.every(part => segment.test(part) || placeholders.has(part) || part === '{revision}')) { - throw new Error('Expected an exact /v1/ preview route with at most one {recordId}, {taskId} or {runId} and at most one {revision}.') + throw new Error('Expected an exact /v1/ preview route with at most one {recordId}, {record_id}, {taskId} or {runId} and at most one {revision}.') } return parts }) diff --git a/clients/typescript/preview/tests/preview.test.mjs b/clients/typescript/preview/tests/preview.test.mjs index 31bdb81919..b8463d59ce 100644 --- a/clients/typescript/preview/tests/preview.test.mjs +++ b/clients/typescript/preview/tests/preview.test.mjs @@ -309,10 +309,17 @@ test('an actors policy compiles per-product routes and is exclusive with the sin { page: '/', functions: [], actors: { Applicant: {} } }, { page: '/', functions: [], actors: { applicant: { messaging: {} } } }, { page: '/', functions: [], actors: { applicant: { coordinator: { get: ['/v1/runs/{runId}/{taskId}'] } } } }, + { page: '/', functions: [], actors: { officer: { casework: { get: ['/v1/review-tasks/{record_id}/{taskId}'] } } } }, + { page: '/', functions: [], actors: { officer: { casework: { get: ['/v1/review-tasks/{taskId}/{revision}/{revision}'] } } } }, ]) { assert.throws(() => previewPolicy(invalid), JSON.stringify(invalid)) } assert.equal(compileRoutes({ get: ['/v1/review-tasks/{taskId}'] })('GET', '/v1/review-tasks/' + run), true) + // {revision} matches one bounded revision number on any product's route. + const revisions = compileRoutes({ get: ['/v1/runs/{runId}/revisions/{revision}'] }) + assert.equal(revisions('GET', '/v1/runs/' + run + '/revisions/7'), true) + assert.equal(revisions('GET', '/v1/runs/' + run + '/revisions/0'), false) + assert.equal(revisions('GET', '/v1/runs/' + run + '/revisions/9223372036854775808'), false) }) test('a gateway relays each product with its own credential, profile and routes', async (t) => { @@ -574,8 +581,10 @@ test('an actors preview names no Proposal author and refuses a register with Pro ['--author-profile', 'permits=permit-applicant']) const actors = generatorArguments({ product, preview: { functions: ['assess-permit'], actors: { applicant: {} } } }, '/staged') assert.equal(actors.includes('--author-profile'), false) - assert.match(generationError('The register permits has Proposals, so the service description needs authorProfiles.', true).message, - /actors preview cannot start Proposals/u) + const proposals = generationError('The register permits has Proposals, so the service description needs authorProfiles.', true).message + // The generator's own diagnostic comes first, then the preview's hint. + assert.ok(proposals.startsWith('The register permits has Proposals'), proposals) + assert.match(proposals, /\nAn actors preview cannot start Proposals/u) assert.match(generationError('The authorProfile "x" cannot start Proposals in permits.', false).message, /Select a preview actor whose BReg profile can start Proposals/u) assert.equal(generationError('generator diagnostic', true).message, 'generator diagnostic') diff --git a/crates/registry-coordinator/src/adapters.rs b/crates/registry-coordinator/src/adapters.rs index ae7a1901c8..b49efd6559 100644 --- a/crates/registry-coordinator/src/adapters.rs +++ b/crates/registry-coordinator/src/adapters.rs @@ -111,20 +111,13 @@ fn config_error() -> CoordinatorError { // Destinations are explicit, reviewed deployment bindings. Institutional peers // may use private HTTPS networks; all token requests remain DNS-pinned and -// reject metadata addresses. Cleartext remains numeric loopback only. +// reject metadata addresses. Cleartext remains numeric loopback only. An +// endpoint the Coordinator would not admit gets the strict policy, which +// refuses it again at request time. fn configured_endpoint_policy(endpoint: &Url) -> FetchUrlPolicy { - if endpoint.scheme() == "http" { - FetchUrlPolicy::https_or_loopback() - } else { - FetchUrlPolicy { - allowed_schemes: vec!["https".into()], - allow_localhost: true, - allow_http_private_network: false, - allow_http_non_loopback: false, - deny_private_ranges: false, - deny_cloud_metadata: true, - } - } + crate::outbound::select_endpoint(endpoint).map_or_else(FetchUrlPolicy::strict, |selected| { + crate::outbound::fetch_policy(&selected) + }) } fn tokens( @@ -2132,5 +2125,21 @@ mod tests { assert!(configured_endpoint_policy(&cleartext) .validate_dns_pinned_for_immediate_fetch(&cleartext) .is_err()); + for loopback in ["http://127.0.0.1:9999/token", "http://[::1]:9999/token"] { + let loopback: Url = loopback.parse().unwrap(); + assert!(configured_endpoint_policy(&loopback) + .validate_dns_pinned_for_immediate_fetch(&loopback) + .is_ok()); + } + for refused in [ + "https://[::ffff:169.254.169.254]/token", + "https://169.254.1.1/token", + "http://localhost:9999/token", + ] { + let refused: Url = refused.parse().unwrap(); + assert!(configured_endpoint_policy(&refused) + .validate_dns_pinned_for_immediate_fetch(&refused) + .is_err()); + } } } diff --git a/crates/registry-coordinator/src/decision.rs b/crates/registry-coordinator/src/decision.rs index b097f20325..6295d850a2 100644 --- a/crates/registry-coordinator/src/decision.rs +++ b/crates/registry-coordinator/src/decision.rs @@ -10,12 +10,12 @@ use std::{collections::BTreeMap, sync::Arc, time::Duration}; use registry_platform_canonical_json::{canonicalize_json, parse_json_strict}; use registry_platform_config::{SecretReference, SecretResolver}; use registry_platform_httputil::{ - client::BearerToken, read_bounded, FetchUrlError, FetchUrlPolicy, ServiceBaseUrl, + client::BearerToken, read_bounded, FetchUrlError, ServiceBaseUrl, }; use registry_platform_yaml::{BoundedU64, ExternalId, LocalId}; use serde::{Deserialize, Deserializer, Serialize}; use serde_json::{json, Value}; -use url::{Host, Url}; +use url::Url; use crate::{protocol::CallOutcome, CoordinatorError, Result}; @@ -91,15 +91,7 @@ impl DecisionConfig { } pub fn findings(&self, prefix: &str) -> Vec { - let loopback = match self.base_url.host() { - Some(Host::Ipv4(ip)) => { - registry_platform_httputil::loopback::loopback_address(ip.into()) - } - Some(Host::Ipv6(ip)) => { - registry_platform_httputil::loopback::loopback_address(ip.into()) - } - _ => false, - }; + let loopback = crate::outbound::numeric_loopback(&self.base_url); let mut errors = Vec::new(); let mut refuse = |field: &str, repair: &str| { let field = if prefix.is_empty() { @@ -117,8 +109,7 @@ impl DecisionConfig { ); }; if ServiceBaseUrl::new(self.base_url.clone()).is_err() - || !matches!(self.base_url.scheme(), "https" | "http") - || (self.base_url.scheme() == "http" && !loopback) + || crate::outbound::select_endpoint(&self.base_url).is_none() { refuse("baseUrl", "Use HTTPS or explicit numeric loopback HTTP, without credentials, query, fragment or empty interior path segments."); } @@ -314,19 +305,9 @@ impl DecisionConnection { &self, timeout: Duration, ) -> std::result::Result { - let policy = if self.endpoint.scheme() == "http" { - FetchUrlPolicy::https_or_loopback() - } else { - FetchUrlPolicy { - allowed_schemes: vec!["https".into()], - allow_localhost: true, - allow_http_private_network: false, - allow_http_non_loopback: false, - deny_private_ranges: false, - deny_cloud_metadata: true, - } - }; - let validated = policy + let selected = crate::outbound::select_endpoint(&self.endpoint) + .ok_or_else(|| refused("decision-invalid-command"))?; + let validated = crate::outbound::fetch_policy(&selected) .validate_dns_pinned_for_immediate_fetch_with_timeout(&self.endpoint, timeout) .await .map_err(|error| match error { diff --git a/crates/registry-coordinator/src/external_http.rs b/crates/registry-coordinator/src/external_http.rs index b4dc1d4339..b9a9305be1 100644 --- a/crates/registry-coordinator/src/external_http.rs +++ b/crates/registry-coordinator/src/external_http.rs @@ -11,12 +11,12 @@ use jsonschema::JSONSchema; use registry_platform_canonical_json::parse_json_strict; use registry_platform_httputil::{ client::{RetryAfter, TokenProvider}, - read_bounded, BoundedReadError, FetchUrlError, FetchUrlPolicy, ServiceBaseUrl, + read_bounded, BoundedReadError, FetchUrlError, ServiceBaseUrl, }; use registry_platform_yaml::{BoundedU64, ExternalId, ForeignValue, LocalId, UniqueList}; use serde::{Deserialize, Deserializer, Serialize}; use serde_json::Value; -use url::{Host, Url}; +use url::Url; use crate::{protocol::CallOutcome, runtime::AuthorizationConfig, CoordinatorError, Result}; use registry_platform_config::SecretReference; @@ -182,16 +182,7 @@ impl ExternalHttpConfig { ); }; let base = ServiceBaseUrl::new(self.base_url.clone()); - let numeric_loopback = match self.base_url.host() { - Some(Host::Ipv4(ip)) => { - registry_platform_httputil::loopback::loopback_address(ip.into()) - } - Some(Host::Ipv6(ip)) => { - registry_platform_httputil::loopback::loopback_address(ip.into()) - } - _ => false, - }; - if base.is_err() || (self.base_url.scheme() == "http" && !numeric_loopback) { + if base.is_err() || crate::outbound::select_endpoint(&self.base_url).is_none() { refuse("baseUrl", "Use HTTPS or explicit numeric loopback HTTP, without credentials, query, fragment or empty interior path segments."); } if self.paths.is_empty() @@ -515,19 +506,10 @@ impl ExternalHttpConnection { // The destination was reviewed by the operator. Institutional HTTPS // peers may be private, but metadata and non-loopback cleartext remain // denied. Each request connects to only the addresses validated here. - let policy = if url.scheme() == "http" { - FetchUrlPolicy::https_or_loopback() - } else { - FetchUrlPolicy { - allowed_schemes: vec!["https".into()], - allow_localhost: true, - allow_http_private_network: false, - allow_http_non_loopback: false, - deny_private_ranges: false, - deny_cloud_metadata: true, - } + let Some(selected) = crate::outbound::select_endpoint(&url) else { + return Err(refused("external-destination-refused")); }; - let validated = match policy + let validated = match crate::outbound::fetch_policy(&selected) .validate_dns_pinned_for_immediate_fetch_with_timeout(&url, timeout) .await { diff --git a/crates/registry-coordinator/src/lib.rs b/crates/registry-coordinator/src/lib.rs index c71da85b3c..db2452333c 100644 --- a/crates/registry-coordinator/src/lib.rs +++ b/crates/registry-coordinator/src/lib.rs @@ -18,6 +18,7 @@ mod follow_check; mod functions; mod mapping_check; pub mod operations; +mod outbound; pub mod problem; pub mod project; mod project_check; diff --git a/crates/registry-coordinator/src/outbound.rs b/crates/registry-coordinator/src/outbound.rs new file mode 100644 index 0000000000..0b3ddad2ed --- /dev/null +++ b/crates/registry-coordinator/src/outbound.rs @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: Apache-2.0 +//! The transport of every configured outbound destination: external reads and +//! commands, decision services and product token endpoints. +//! +//! Each carries a credential, so the shared credential selector decides the +//! transport. The Coordinator narrows it once more: plain HTTP reaches only a +//! numeric loopback address, never the name `localhost`. The DNS-pinned fetch +//! policy then follows the selected transport, never the URL's scheme. + +use registry_platform_httputil::{ + loopback::loopback_address, + select::{select_credential_destination, SelectedDestination, TransportClass}, + FetchUrlPolicy, +}; +use url::{Host, Url}; + +/// `url` selected as a credential-bearing destination the Coordinator admits: +/// https, or plain HTTP to a numeric loopback address. +pub(crate) fn select_endpoint(url: &Url) -> Option { + let selected = select_credential_destination(url, None, &[]).ok()?; + (selected.transport() == TransportClass::VerifiedTls || numeric_loopback(url)) + .then_some(selected) +} + +/// Whether `url`'s host is a loopback address literal, mapped forms included. +pub(crate) fn numeric_loopback(url: &Url) -> bool { + match url.host() { + Some(Host::Ipv4(ip)) => loopback_address(ip.into()), + Some(Host::Ipv6(ip)) => loopback_address(ip.into()), + _ => false, + } +} + +/// The DNS-pinned policy a request to `selected` validates against. The +/// destinations are reviewed deployment bindings, so an institutional https +/// peer may be private; cloud metadata stays denied, and plain HTTP stays on +/// loopback. +pub(crate) fn fetch_policy(selected: &SelectedDestination) -> FetchUrlPolicy { + match selected.transport() { + TransportClass::VerifiedTls => FetchUrlPolicy { + allowed_schemes: vec!["https".into()], + allow_localhost: true, + allow_http_private_network: false, + allow_http_non_loopback: false, + deny_private_ranges: false, + deny_cloud_metadata: true, + }, + // `select_endpoint` never selects private plain text; both plain-text + // classes get the loopback-only policy. + TransportClass::LoopbackPlaintext | TransportClass::PrivateNetworkPlaintext => { + FetchUrlPolicy::https_or_loopback() + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn endpoints_are_https_or_numeric_loopback_http() { + for admitted in [ + "https://directory.example.test/", + "https://10.0.0.8/", + "https://localhost/", + "HTTPS://DIRECTORY.EXAMPLE.TEST/", + // Link-local https is selected; the request-time policy refuses it. + "https://169.254.1.1/", + "http://127.0.0.1:8080/", + "http://[::1]:8080/", + "http://[::ffff:127.0.0.1]:8080/", + ] { + assert!( + select_endpoint(&admitted.parse().unwrap()).is_some(), + "{admitted}" + ); + } + for refused in [ + "http://localhost:8080/", + "http://LOCALHOST:8080/", + "http://x.localhost/", + "http://localhost./", + "http://10.0.0.1/", + "http://directory.example.test/", + "https://user@directory.example.test/", + "ftp://directory.example.test/", + ] { + assert!( + select_endpoint(&refused.parse().unwrap()).is_none(), + "{refused}" + ); + } + } + + #[test] + fn the_policy_follows_the_selected_transport() { + let https = select_endpoint(&"https://10.0.0.8/".parse().unwrap()).unwrap(); + assert_eq!( + fetch_policy(&https), + FetchUrlPolicy { + allowed_schemes: vec!["https".into()], + allow_localhost: true, + allow_http_private_network: false, + allow_http_non_loopback: false, + deny_private_ranges: false, + deny_cloud_metadata: true, + } + ); + let loopback = select_endpoint(&"http://127.0.0.1:8080/".parse().unwrap()).unwrap(); + assert_eq!(fetch_policy(&loopback), FetchUrlPolicy::https_or_loopback()); + } +} diff --git a/crates/registry-coordinator/src/runtime.rs b/crates/registry-coordinator/src/runtime.rs index b0dff6dff4..d633c8616f 100644 --- a/crates/registry-coordinator/src/runtime.rs +++ b/crates/registry-coordinator/src/runtime.rs @@ -14,7 +14,7 @@ use registry_platform_httputil::{ use serde::{Deserialize, Deserializer, Serialize}; use serde_json::json; use std::{collections::BTreeMap, path::Path}; -use url::{Host, Url}; +use url::Url; use zeroize::Zeroizing; pub const API_VERSION: &str = "id.registrystack.org/formats/coordinator/runtime/v1alpha1"; @@ -1624,17 +1624,8 @@ fn config_error(field: &str, action: &str) -> CoordinatorError { .at("runtime.yaml", pointer(field)) .suggest(action) } -fn is_loopback(url: &Url) -> bool { - match url.host() { - Some(Host::Ipv4(ip)) => registry_platform_httputil::loopback::loopback_address(ip.into()), - Some(Host::Ipv6(ip)) => registry_platform_httputil::loopback::loopback_address(ip.into()), - _ => false, - } -} - fn check_endpoint(url: &Url) -> Result<()> { - let loopback = is_loopback(url); - if !(url.scheme() == "https" || (loopback && url.scheme() == "http")) + if crate::outbound::select_endpoint(url).is_none() || !url.username().is_empty() || url.password().is_some() || url.query().is_some() @@ -1780,7 +1771,7 @@ fn request_link<'de, D: Deserializer<'de>>(d: D) -> std::result::Result Value { + let mut d = document(); + d["connections"]["assessor"]["baseUrl"] = json!(base); + d["connections"]["assessor"]["authorization"] = authorization; + d +} + +fn bearer() -> Value { + json!({"bearer":{"tokenRef":"secret:env/UNRESOLVED_DECISION_TEST_TOKEN","principal":"fixture-account"}}) +} + +#[test] +fn decision_destinations_admit_https_and_numeric_loopback_http_only() { + for base in [ + "https://decision.example.test/tenant", + "https://10.0.0.8/tenant", + "http://127.0.0.1:8080/tenant", + "http://127.1.2.3/tenant", + "http://[::1]:8080/tenant", + "http://[::ffff:127.0.0.1]:8080/tenant", + ] { + load(&with_base(base, bearer())).unwrap_or_else(|_| panic!("{base} is admitted")); + } + for base in [ + "http://localhost:8080/tenant", + "http://decision.example.test/tenant", + "http://10.0.0.1/tenant", + "http://user@127.0.0.1/tenant", + "ftp://decision.example.test/tenant", + ] { + assert!( + load(&with_base(base, bearer())).is_err(), + "{base} is refused" + ); + } +} + +#[test] +fn local_decision_authorization_stays_on_numeric_loopback() { + load(&with_base( + "http://127.0.0.1:8080/tenant", + json!({"local":{}}), + )) + .unwrap(); + load(&with_base("http://[::1]:8080/tenant", json!({"local":{}}))).unwrap(); + for base in [ + "https://decision.example.test/tenant", + "https://localhost/tenant", + "http://localhost:8080/tenant", + ] { + assert!( + load(&with_base(base, json!({"local":{}}))).is_err(), + "local authorization is refused at {base}" + ); + } +} + +/// Evaluate once against `base` with a bearer credential that never resolves, +/// so a destination checked before credentials answers its own outcome. +async fn evaluate_unresolved_credential(base: &str) -> CallOutcome { + let adapters = HttpAdapters::new(&load(&with_base(base, bearer())).unwrap()).unwrap(); + let request = CallRequest { + operation_contract: None, + connection: "assessor".into(), + operation: Operation::EvaluateDecision, + input: json!({"state":{"summary":"synthetic"},"questions":{"ready":{"type":"predicate","instructions":"Ready?"}}}), + idempotency_key: None, + }; + let Ok(Some(prepared)) = adapters.prepare(&request).await else { + panic!("inert preparation must succeed") + }; + adapters.call_prepared(&request, Some(&prepared)).await +} + +#[tokio::test] +async fn a_metadata_decision_destination_is_refused_before_acquiring_credentials() { + for base in [ + "https://169.254.169.254/tenant", + "https://[::ffff:169.254.169.254]/tenant", + ] { + let outcome = evaluate_unresolved_credential(base).await; + assert!( + matches!(&outcome, CallOutcome::Refused { code } if code == "decision-invalid-command"), + "{base} is refused before credentials" + ); + } +} + +#[tokio::test] +async fn an_unresolvable_decision_destination_is_unavailable_before_credentials() { + let outcome = + evaluate_unresolved_credential("https://coordinator-transport.invalid/tenant").await; + assert!( + matches!(&outcome, CallOutcome::Retryable { code, .. } if code == "decision-unavailable"), + "an unresolvable destination is unavailable" + ); +} diff --git a/crates/registry-coordinator/tests/external_http.rs b/crates/registry-coordinator/tests/external_http.rs index 5108fef85a..f6671d8131 100644 --- a/crates/registry-coordinator/tests/external_http.rs +++ b/crates/registry-coordinator/tests/external_http.rs @@ -518,3 +518,56 @@ fn offline_contract_refuses_unsafe_urls_paths_and_external_schema_fetches() { .to_string() .contains("sensitive-invalid-resource-canary")); } + +// Transport selection. These pin the destinations a reviewed external +// connection admits and how a refused or unreachable one is answered, whatever +// selects the transport. + +#[test] +fn external_destinations_admit_https_and_numeric_loopback_http_only() { + for base in [ + "https://directory.example.test/", + "https://10.0.0.8/", + "https://[fd00::8]/", + "http://127.0.0.1:8080/", + "http://127.1.2.3/", + "http://[::1]:8080/", + "http://[::ffff:127.0.0.1]:8080/", + ] { + config(base) + .validate() + .unwrap_or_else(|_| panic!("{base} is admitted")); + } + for base in [ + "http://localhost:8080/", + "http://directory.example.test/", + "http://10.0.0.1/", + "http://192.168.1.4/", + "http://user@127.0.0.1/", + "ftp://directory.example.test/", + ] { + let mut admitted = config("https://directory.example.test/"); + admitted.base_url = base.parse().unwrap(); + assert!(admitted.validate().is_err(), "{base} is refused"); + } +} + +#[tokio::test] +async fn a_mapped_metadata_address_is_refused_before_acquiring_credentials() { + let mut config = config("https://[::ffff:169.254.169.254]"); + config.authorization = Some(authorization()); + let connection = ExternalHttpConnection::new(&config, Some(Arc::new(SlowTokens))).unwrap(); + assert!( + matches!(connection.get(&json!({"path":"offices"}), false).await, + CallOutcome::Refused { code } if code == "external-destination-refused") + ); +} + +#[tokio::test] +async fn an_unresolvable_destination_is_unavailable_not_refused() { + let connection = connection(&config("https://coordinator-transport.invalid")); + assert!(matches!( + connection.get(&json!({"path":"offices"}), false).await, + CallOutcome::Retryable { code, .. } if code == "external-unavailable" + )); +} diff --git a/crates/registry-rstack-dev/src/plan.rs b/crates/registry-rstack-dev/src/plan.rs index bb51dd1ba9..445baa3598 100644 --- a/crates/registry-rstack-dev/src/plan.rs +++ b/crates/registry-rstack-dev/src/plan.rs @@ -4036,10 +4036,14 @@ mod preview_tests { "/v1/records/licences/{recordId}", true )); - for id in ["{recordId}", "{record_id}"] { + for id in ["{recordId}", "{record_id}", "{taskId}", "{runId}"] { let path = format!("/v1/records/applications/{id}/revisions/{{revision}}"); assert!(super::super::preview::valid_path(&path, true), "{path}"); } + assert!(super::super::preview::valid_path( + "/v1/runs/{runId}/revisions/{revision}", + true + )); assert!(super::super::preview::valid_path("/check.html", false)); for path in [ "//elsewhere", @@ -4050,6 +4054,8 @@ mod preview_tests { "/v1/records/{anything}", "/v1/records/{recordId}/{recordId}", "/v1/records/{recordId}/{record_id}", + "/v1/review-tasks/{record_id}/{taskId}", + "/v1/runs/{runId}/{revision}/{revision}", "/v1/records/{recordId}/revisions/{revision}/{revision}", "/v1/records/#fragment", ] { diff --git a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx index 78b3361b4b..f6d8f93ba7 100644 --- a/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx +++ b/docs/site/src/content/docs/configure/run-a-project-with-rstack-dev.mdx @@ -89,8 +89,9 @@ and it answers only the page: a request without `Registry-Client: page`, or with The generated client names no Proposal author in an actors preview, because each actor's origin pins its own BReg profile. A register with Proposals therefore needs the single-actor form, and the build refuses it in an actors preview. -A path may hold one `{recordId}`, `{taskId}` or `{runId}` segment, each matching only a UUID, -for any product. The name documents the path and does not restrict where it may appear. +A path may hold one `{recordId}`, `{record_id}`, `{taskId}` or `{runId}` segment, each +matching only a UUID, and one `{revision}` segment, matching only a Record revision number, for +any product. The name documents the path and does not restrict where it may appear. ```yaml preview: From 39b8e9178ad4961daa02bc630e4acbb6c7a53c74 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 31/55] ci: pin the provisioning journey arms and every roster call as an assignment The journey check refuses a case arm that would override a serving journey, and every workflow roster call must assign its answer to a variable, whatever test construct or script spelling it sits in. The provisioning step's comment states that the Evidence stores only provision. Signed-off-by: Jeremi Joslin --- .github/scripts/test_ci_changes.py | 35 +++++++++++++++++++++++------- .github/workflows/ci.yml | 5 +++-- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/.github/scripts/test_ci_changes.py b/.github/scripts/test_ci_changes.py index 289f628297..2a3f632bf8 100644 --- a/.github/scripts/test_ci_changes.py +++ b/.github/scripts/test_ci_changes.py @@ -4963,20 +4963,39 @@ def test_contracts_journeys_lane_runs_each_product_provisioning_journey( command, ) self.assertIn('grep -Eq "${journey}" "${log}"', command) + # The case holds exactly one arm per provision-only journey and the + # shared default, so no arm can override a serving journey's check. + case = re.search(r'case "\$\{package\}" in (.*?) esac', command) + self.assertIsNotNone(case) + arms = re.findall(r"(?:^|;;)\s*([^\s;)]+)\) journey=", case.group(1)) + provision_only = { + package + for package, (_, tests) in journeys.items() + if not any(serve.fullmatch(test) for test in tests) + } + self.assertEqual(sorted(provision_only | {"*"}), sorted(arms)) - def test_no_workflow_reads_a_roster_answer_inside_a_conditional(self) -> None: - # Inside [[ ]], set -e does not stop a failed command substitution, so - # a roster error would read as "not in release". Assign the answer to - # a variable first, so the failure stops the step. - inline = re.compile( - r'\[\[[^\]]*?"\$\(python3 release/scripts/release_roster\.py', re.S + def test_every_workflow_roster_call_is_a_plain_assignment(self) -> None: + # Inside [[ ]], [ ] or test, set -e does not stop a failed command + # substitution, so a roster error would read as "not in release". + # Every roster call assigns its answer to a variable first, so the + # failure stops the step. + assignment = re.compile( + r'^\s*[A-Za-z_][A-Za-z0-9_]*="\$\((?:python3 )?\S*release_roster\.py [^()]*\)"\s*$' ) + checked = 0 for workflow in sorted(Path(".github/workflows").glob("*.yml")): jobs = yaml.safe_load(workflow.read_text(encoding="utf-8"))["jobs"] for job_name, job in jobs.items(): for step in job.get("steps", []): - with self.subTest(workflow=workflow.name, job=job_name, step=step.get("name")): - self.assertIsNone(inline.search(step.get("run", ""))) + logical = re.sub(r"\\\n\s*", " ", step.get("run", "")) + for line in logical.splitlines(): + if not re.search(r"(? Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 32/55] fix(platform): refuse a CA bundle that is not text and build explicit-setting notices in one place Folds these reviewed commits: - fix(platform): refuse a CA bundle that is not text at provision - chore(client): regenerate the Coordinator client for service.invoke-function/v1 - fix(platform): build every explicit-setting notice in one place, as a sentence - test(bregctl): expect the explicit-setting notice provision prints - fix(platform): name a CA bundle that is not text in every provision refusal - test(evidence): expect the store provisioning option in check help - chore(identifiers): regenerate the catalogue for the #2882 follow-up schemas - docs(coordinator): cite the shared numeric loopback check for request links - fix(coordinator): word unreadable database URL secrets with the shared reason Signed-off-by: Jeremi Joslin --- clients/typescript/generated/coordinator.ts | 6 +- crates/registry-adapter-engine/src/load.rs | 4 +- .../registry-adapter-job/src/hook_ingress.rs | 4 +- crates/registry-adapterctl/src/provision.rs | 2 +- crates/registry-breg-review/src/check.rs | 8 +- crates/registry-bregctl/src/check.rs | 10 ++- crates/registry-bregctl/src/provision.rs | 10 ++- .../registry-bregctl/tests/provision_cli.rs | 13 ++- crates/registry-caseworkctl/src/provision.rs | 6 +- .../registry-caseworkctl/tests/provision.rs | 24 ++++++ crates/registry-coordinator/src/cli.rs | 7 +- crates/registry-coordinator/src/provision.rs | 26 ++++-- .../tests/caller_contract.rs | 2 +- .../tests/provision_cli.rs | 19 ++++ crates/registry-documentsctl/src/provision.rs | 2 +- crates/registry-evidence-oid4vci/src/main.rs | 8 +- crates/registry-evidence-oid4vp/src/main.rs | 8 +- .../tests/check_command.rs | 2 +- crates/registry-evidence/src/main.rs | 7 +- crates/registry-evidencectl/src/check.rs | 8 +- .../registry-evidencectl/tests/file_check.rs | 2 +- crates/registry-messagingctl/src/lib.rs | 8 +- crates/registry-messagingctl/src/provision.rs | 2 +- .../tests/provision_cli.rs | 28 ++++++ crates/registry-platform-config/README.md | 3 +- crates/registry-platform-config/src/blocks.rs | 20 ++++- .../src/blocks_tests.rs | 86 +++++++++++++++++++ crates/registry-platform-config/src/lib.rs | 11 +-- .../registry-platform-config/src/posture.rs | 32 ++++++- .../src/posture_tests.rs | 19 ++++ .../registry-platform-config/src/secrets.rs | 7 ++ crates/registry-render/src/check.rs | 10 ++- crates/registry-schedulingctl/src/lib.rs | 3 +- .../registry-schedulingctl/src/provision.rs | 2 +- .../docs/configure/enable-sd-jwt-vc.mdx | 2 +- .../src/content/docs/security/coordinator.mdx | 3 +- .../build-and-deploy-evidence-project.mdx | 4 +- .../tutorials/connect-a-sqlite-extract.mdx | 4 +- .../connect-an-institution-source.mdx | 2 +- .../tutorials/first-evidence-assertion.mdx | 2 +- .../identifiers/generated/catalog.v1.json | 22 ++--- products/platform/CHANGELOG.md | 13 ++- 42 files changed, 341 insertions(+), 120 deletions(-) diff --git a/clients/typescript/generated/coordinator.ts b/clients/typescript/generated/coordinator.ts index 56e5c25f4e..09874f473c 100644 --- a/clients/typescript/generated/coordinator.ts +++ b/clients/typescript/generated/coordinator.ts @@ -1,5 +1,5 @@ // Generated for Stack version 0.50.0, client version 0.50.0. -// Source SHA-256 bfc1de8b64985751de37a6f66efbca724d2878101aa47b15cb40a4192e76ffc2 +// Source SHA-256 2e480154f09b6a6df9cba0be8e049690f37e69003b55000c30295540fc7eba28 // Unconstrained JSON /components/schemas/HookEnvelope/properties/data // Unconstrained JSON /components/schemas/RunStatus/properties/output // Unconstrained JSON /components/schemas/Start/properties/input @@ -20,7 +20,7 @@ export type Schema_HeldRun = ({ "advice": (string); "findingCode": (string); "re export type Schema_HeldRuns = (Array) export type Schema_Hold = ({ "restoreHold": (boolean) }) export type Schema_HookEnvelope = ({ "causation": ({ "hop": (number); "parent"?: (string); "root": (string) }); "data": JsonValue; "dataschema": (string); "id": (string); "source": (string); "subject": (({ "recordReference": (string); "recordRevision": (number) }) | ({ "proposalReference": (string); "proposalRevision": (number) })); "time": (string); "type": (string) }) -export type Schema_OperationIdentity = ({ "effect": ("read" | "mutation" | "evaluation") & (string); "id": ("breg.read-record/v1" | "messaging.submit-message/v1" | "scheduling.read-service/v1" | "scheduling.read-availability/v1" | "scheduling.create-appointment/v1" | "scheduling.read-appointment/v1" | "scheduling.create-hold/v1" | "scheduling.release-hold/v1" | "scheduling.confirm-hold/v1" | "scheduling.reschedule-appointment/v1" | "scheduling.cancel-appointment/v1" | "breg.invoke-action/v1" | "external.get/v1" | "evaluation.evaluate/v1" | "casework.submit-review-request/v1" | "casework.cancel-review-request/v1" | "scheduling.preview-availability/v1" | "external.command/v1" | "breg.read-in-force/v1" | "breg.read-proposal/v1" | "breg.start-proposal/v1" | "breg.submit-proposal/v1" | "breg.cancel-proposal/v1" | "breg.lookup-record/v1" | "breg.read-record/v2" | "payments.request-collection/v1" | "payments.read-collection/v1" | "payments.record-receipt/v1" | "payments.request-disbursement/v1" | "payments.read-disbursement/v1" | "payments.record-provider-confirmation/v1") & (string); "keyRequirement": ("none" | "required") & (string); "product": (string); "readReceipt": (boolean); "recovery": ("read-again" | "same-command-and-receipt" | "same-command" | "hold-after-dispatch") & (string); "requiresPreparation": (boolean); "version": (number) }) +export type Schema_OperationIdentity = ({ "effect": ("read" | "mutation" | "evaluation") & (string); "id": ("breg.read-record/v1" | "messaging.submit-message/v1" | "scheduling.read-service/v1" | "scheduling.read-availability/v1" | "scheduling.create-appointment/v1" | "scheduling.read-appointment/v1" | "scheduling.create-hold/v1" | "scheduling.release-hold/v1" | "scheduling.confirm-hold/v1" | "scheduling.reschedule-appointment/v1" | "scheduling.cancel-appointment/v1" | "breg.invoke-action/v1" | "external.get/v1" | "evaluation.evaluate/v1" | "casework.submit-review-request/v1" | "casework.cancel-review-request/v1" | "scheduling.preview-availability/v1" | "external.command/v1" | "breg.read-in-force/v1" | "breg.read-proposal/v1" | "breg.start-proposal/v1" | "breg.submit-proposal/v1" | "breg.cancel-proposal/v1" | "breg.lookup-record/v1" | "breg.read-record/v2" | "payments.request-collection/v1" | "payments.read-collection/v1" | "payments.record-receipt/v1" | "payments.request-disbursement/v1" | "payments.read-disbursement/v1" | "payments.record-provider-confirmation/v1" | "service.invoke-function/v1") & (string); "keyRequirement": ("none" | "required") & (string); "product": (string); "readReceipt": (boolean); "recovery": ("read-again" | "same-command-and-receipt" | "same-command" | "hold-after-dispatch") & (string); "requiresPreparation": (boolean); "version": (number) }) export type Schema_Problem = ({ "code": ("admission.held" | "admission.recovery-only" | "audit.response-unavailable" | "authentication.refused" | "binding.conflict" | "binding.live-conflict" | "check.not-waiting" | "definition.refused" | "deployment.activation-changed" | "deployment.refused" | "evaluation.uncertain" | "event.invalid" | "event.too-large" | "event.unauthenticated" | "execution.held" | "idempotency.key-invalid" | "idempotency.key-reused" | "input.invalid" | "mutation.uncertain" | "operation.not-authorized" | "receipt.expired" | "reconcile.raced" | "reconcile.refused" | "reconcile.unsupported" | "request.body-too-large" | "request.invalid" | "request.limit-out-of-range" | "request.method-not-allowed" | "request.not-found" | "request.reason-invalid" | "request.retention-invalid" | "request.unprocessable" | "request.unsupported-media-type" | "restore.hold-required" | "restore.lease-incompatible" | "restore.review-required" | "restore.unresolved" | "retry.refused" | "run.definition-incompatible" | "run.not-visible" | "run.payload-erased" | "runtime.failure" | "service.unavailable" | "workflow.not-served" | "workflow.revision-mismatch") & (string); "detail": (string); "pointer"?: (string); "status": (number); "title": (string); "traceId": (string); "type": ("https://id.registrystack.org/problems/registry-coordinator/admission/held" | "https://id.registrystack.org/problems/registry-coordinator/admission/recovery-only" | "https://id.registrystack.org/problems/registry-coordinator/audit/response-unavailable" | "https://id.registrystack.org/problems/registry-coordinator/authentication/refused" | "https://id.registrystack.org/problems/registry-coordinator/binding/conflict" | "https://id.registrystack.org/problems/registry-coordinator/binding/live-conflict" | "https://id.registrystack.org/problems/registry-coordinator/check/not-waiting" | "https://id.registrystack.org/problems/registry-coordinator/definition/refused" | "https://id.registrystack.org/problems/registry-coordinator/deployment/activation-changed" | "https://id.registrystack.org/problems/registry-coordinator/deployment/refused" | "https://id.registrystack.org/problems/registry-coordinator/evaluation/uncertain" | "https://id.registrystack.org/problems/registry-coordinator/event/invalid" | "https://id.registrystack.org/problems/registry-coordinator/event/too-large" | "https://id.registrystack.org/problems/registry-coordinator/event/unauthenticated" | "https://id.registrystack.org/problems/registry-coordinator/execution/held" | "https://id.registrystack.org/problems/registry-coordinator/idempotency/key-invalid" | "https://id.registrystack.org/problems/registry-coordinator/idempotency/key-reused" | "https://id.registrystack.org/problems/registry-coordinator/input/invalid" | "https://id.registrystack.org/problems/registry-coordinator/mutation/uncertain" | "https://id.registrystack.org/problems/registry-coordinator/operation/not-authorized" | "https://id.registrystack.org/problems/registry-coordinator/receipt/expired" | "https://id.registrystack.org/problems/registry-coordinator/reconcile/raced" | "https://id.registrystack.org/problems/registry-coordinator/reconcile/refused" | "https://id.registrystack.org/problems/registry-coordinator/reconcile/unsupported" | "https://id.registrystack.org/problems/registry-coordinator/request/body-too-large" | "https://id.registrystack.org/problems/registry-coordinator/request/invalid" | "https://id.registrystack.org/problems/registry-coordinator/request/limit-out-of-range" | "https://id.registrystack.org/problems/registry-coordinator/request/method-not-allowed" | "https://id.registrystack.org/problems/registry-coordinator/request/not-found" | "https://id.registrystack.org/problems/registry-coordinator/request/reason-invalid" | "https://id.registrystack.org/problems/registry-coordinator/request/retention-invalid" | "https://id.registrystack.org/problems/registry-coordinator/request/unprocessable" | "https://id.registrystack.org/problems/registry-coordinator/request/unsupported-media-type" | "https://id.registrystack.org/problems/registry-coordinator/restore/hold-required" | "https://id.registrystack.org/problems/registry-coordinator/restore/lease-incompatible" | "https://id.registrystack.org/problems/registry-coordinator/restore/review-required" | "https://id.registrystack.org/problems/registry-coordinator/restore/unresolved" | "https://id.registrystack.org/problems/registry-coordinator/retry/refused" | "https://id.registrystack.org/problems/registry-coordinator/run/definition-incompatible" | "https://id.registrystack.org/problems/registry-coordinator/run/not-visible" | "https://id.registrystack.org/problems/registry-coordinator/run/payload-erased" | "https://id.registrystack.org/problems/registry-coordinator/runtime/failure" | "https://id.registrystack.org/problems/registry-coordinator/service/unavailable" | "https://id.registrystack.org/problems/registry-coordinator/workflow/not-served" | "https://id.registrystack.org/problems/registry-coordinator/workflow/revision-mismatch") & (string) }) export type Schema_ProposalWaitsByTurn = ({ "nobody": (number); "official": (number); "party": (number); "unobserved": (number) }) export type Schema_Reason = ({ "reason": (string) }) @@ -73,7 +73,7 @@ const rules: Record = Object.fromEntries([ ["/components/schemas/HookEnvelope", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"causation\":{\"$ref\":\"/components/schemas/HookEnvelope/$defs/Causation\"},\"data\":true,\"dataschema\":{\"type\":\"string\"},\"id\":{\"type\":\"string\"},\"source\":{\"type\":\"string\"},\"subject\":{\"$ref\":\"/components/schemas/HookEnvelope/$defs/EventSubject\"},\"time\":{\"type\":\"string\"},\"type\":{\"type\":\"string\"}},\"required\":[\"id\",\"type\",\"source\",\"time\",\"subject\",\"dataschema\",\"data\",\"causation\"],\"type\":\"object\"}")], ["/components/schemas/HookEnvelope/$defs/Causation", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"hop\":{\"maximum\":8,\"minimum\":0,\"type\":\"integer\"},\"parent\":{\"type\":\"string\"},\"root\":{\"type\":\"string\"}},\"required\":[\"root\",\"hop\"],\"type\":\"object\"}")], ["/components/schemas/HookEnvelope/$defs/EventSubject", JSON.parse("{\"anyOf\":[{\"additionalProperties\":false,\"properties\":{\"recordReference\":{\"type\":\"string\"},\"recordRevision\":{\"maximum\":9007199254740991,\"minimum\":1,\"type\":\"integer\"}},\"required\":[\"recordReference\",\"recordRevision\"],\"type\":\"object\"},{\"additionalProperties\":false,\"properties\":{\"proposalReference\":{\"type\":\"string\"},\"proposalRevision\":{\"maximum\":9007199254740991,\"minimum\":1,\"type\":\"integer\"}},\"required\":[\"proposalReference\",\"proposalRevision\"],\"type\":\"object\"}]}")], - ["/components/schemas/OperationIdentity", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"effect\":{\"enum\":[\"read\",\"mutation\",\"evaluation\"],\"type\":\"string\"},\"id\":{\"enum\":[\"breg.read-record/v1\",\"messaging.submit-message/v1\",\"scheduling.read-service/v1\",\"scheduling.read-availability/v1\",\"scheduling.create-appointment/v1\",\"scheduling.read-appointment/v1\",\"scheduling.create-hold/v1\",\"scheduling.release-hold/v1\",\"scheduling.confirm-hold/v1\",\"scheduling.reschedule-appointment/v1\",\"scheduling.cancel-appointment/v1\",\"breg.invoke-action/v1\",\"external.get/v1\",\"evaluation.evaluate/v1\",\"casework.submit-review-request/v1\",\"casework.cancel-review-request/v1\",\"scheduling.preview-availability/v1\",\"external.command/v1\",\"breg.read-in-force/v1\",\"breg.read-proposal/v1\",\"breg.start-proposal/v1\",\"breg.submit-proposal/v1\",\"breg.cancel-proposal/v1\",\"breg.lookup-record/v1\",\"breg.read-record/v2\",\"payments.request-collection/v1\",\"payments.read-collection/v1\",\"payments.record-receipt/v1\",\"payments.request-disbursement/v1\",\"payments.read-disbursement/v1\",\"payments.record-provider-confirmation/v1\"],\"type\":\"string\"},\"keyRequirement\":{\"enum\":[\"none\",\"required\"],\"type\":\"string\"},\"product\":{\"type\":\"string\"},\"readReceipt\":{\"type\":\"boolean\"},\"recovery\":{\"enum\":[\"read-again\",\"same-command-and-receipt\",\"same-command\",\"hold-after-dispatch\"],\"type\":\"string\"},\"requiresPreparation\":{\"type\":\"boolean\"},\"version\":{\"minimum\":1,\"type\":\"integer\"}},\"required\":[\"id\",\"version\",\"product\",\"effect\",\"keyRequirement\",\"requiresPreparation\",\"recovery\",\"readReceipt\"],\"type\":\"object\"}")], + ["/components/schemas/OperationIdentity", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"effect\":{\"enum\":[\"read\",\"mutation\",\"evaluation\"],\"type\":\"string\"},\"id\":{\"enum\":[\"breg.read-record/v1\",\"messaging.submit-message/v1\",\"scheduling.read-service/v1\",\"scheduling.read-availability/v1\",\"scheduling.create-appointment/v1\",\"scheduling.read-appointment/v1\",\"scheduling.create-hold/v1\",\"scheduling.release-hold/v1\",\"scheduling.confirm-hold/v1\",\"scheduling.reschedule-appointment/v1\",\"scheduling.cancel-appointment/v1\",\"breg.invoke-action/v1\",\"external.get/v1\",\"evaluation.evaluate/v1\",\"casework.submit-review-request/v1\",\"casework.cancel-review-request/v1\",\"scheduling.preview-availability/v1\",\"external.command/v1\",\"breg.read-in-force/v1\",\"breg.read-proposal/v1\",\"breg.start-proposal/v1\",\"breg.submit-proposal/v1\",\"breg.cancel-proposal/v1\",\"breg.lookup-record/v1\",\"breg.read-record/v2\",\"payments.request-collection/v1\",\"payments.read-collection/v1\",\"payments.record-receipt/v1\",\"payments.request-disbursement/v1\",\"payments.read-disbursement/v1\",\"payments.record-provider-confirmation/v1\",\"service.invoke-function/v1\"],\"type\":\"string\"},\"keyRequirement\":{\"enum\":[\"none\",\"required\"],\"type\":\"string\"},\"product\":{\"type\":\"string\"},\"readReceipt\":{\"type\":\"boolean\"},\"recovery\":{\"enum\":[\"read-again\",\"same-command-and-receipt\",\"same-command\",\"hold-after-dispatch\"],\"type\":\"string\"},\"requiresPreparation\":{\"type\":\"boolean\"},\"version\":{\"minimum\":1,\"type\":\"integer\"}},\"required\":[\"id\",\"version\",\"product\",\"effect\",\"keyRequirement\",\"requiresPreparation\",\"recovery\",\"readReceipt\"],\"type\":\"object\"}")], ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"code\":{\"enum\":[\"admission.held\",\"admission.recovery-only\",\"audit.response-unavailable\",\"authentication.refused\",\"binding.conflict\",\"binding.live-conflict\",\"check.not-waiting\",\"definition.refused\",\"deployment.activation-changed\",\"deployment.refused\",\"evaluation.uncertain\",\"event.invalid\",\"event.too-large\",\"event.unauthenticated\",\"execution.held\",\"idempotency.key-invalid\",\"idempotency.key-reused\",\"input.invalid\",\"mutation.uncertain\",\"operation.not-authorized\",\"receipt.expired\",\"reconcile.raced\",\"reconcile.refused\",\"reconcile.unsupported\",\"request.body-too-large\",\"request.invalid\",\"request.limit-out-of-range\",\"request.method-not-allowed\",\"request.not-found\",\"request.reason-invalid\",\"request.retention-invalid\",\"request.unprocessable\",\"request.unsupported-media-type\",\"restore.hold-required\",\"restore.lease-incompatible\",\"restore.review-required\",\"restore.unresolved\",\"retry.refused\",\"run.definition-incompatible\",\"run.not-visible\",\"run.payload-erased\",\"runtime.failure\",\"service.unavailable\",\"workflow.not-served\",\"workflow.revision-mismatch\"],\"type\":\"string\"},\"detail\":{\"type\":\"string\"},\"pointer\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"title\":{\"type\":\"string\"},\"traceId\":{\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-coordinator/admission/held\",\"https://id.registrystack.org/problems/registry-coordinator/admission/recovery-only\",\"https://id.registrystack.org/problems/registry-coordinator/audit/response-unavailable\",\"https://id.registrystack.org/problems/registry-coordinator/authentication/refused\",\"https://id.registrystack.org/problems/registry-coordinator/binding/conflict\",\"https://id.registrystack.org/problems/registry-coordinator/binding/live-conflict\",\"https://id.registrystack.org/problems/registry-coordinator/check/not-waiting\",\"https://id.registrystack.org/problems/registry-coordinator/definition/refused\",\"https://id.registrystack.org/problems/registry-coordinator/deployment/activation-changed\",\"https://id.registrystack.org/problems/registry-coordinator/deployment/refused\",\"https://id.registrystack.org/problems/registry-coordinator/evaluation/uncertain\",\"https://id.registrystack.org/problems/registry-coordinator/event/invalid\",\"https://id.registrystack.org/problems/registry-coordinator/event/too-large\",\"https://id.registrystack.org/problems/registry-coordinator/event/unauthenticated\",\"https://id.registrystack.org/problems/registry-coordinator/execution/held\",\"https://id.registrystack.org/problems/registry-coordinator/idempotency/key-invalid\",\"https://id.registrystack.org/problems/registry-coordinator/idempotency/key-reused\",\"https://id.registrystack.org/problems/registry-coordinator/input/invalid\",\"https://id.registrystack.org/problems/registry-coordinator/mutation/uncertain\",\"https://id.registrystack.org/problems/registry-coordinator/operation/not-authorized\",\"https://id.registrystack.org/problems/registry-coordinator/receipt/expired\",\"https://id.registrystack.org/problems/registry-coordinator/reconcile/raced\",\"https://id.registrystack.org/problems/registry-coordinator/reconcile/refused\",\"https://id.registrystack.org/problems/registry-coordinator/reconcile/unsupported\",\"https://id.registrystack.org/problems/registry-coordinator/request/body-too-large\",\"https://id.registrystack.org/problems/registry-coordinator/request/invalid\",\"https://id.registrystack.org/problems/registry-coordinator/request/limit-out-of-range\",\"https://id.registrystack.org/problems/registry-coordinator/request/method-not-allowed\",\"https://id.registrystack.org/problems/registry-coordinator/request/not-found\",\"https://id.registrystack.org/problems/registry-coordinator/request/reason-invalid\",\"https://id.registrystack.org/problems/registry-coordinator/request/retention-invalid\",\"https://id.registrystack.org/problems/registry-coordinator/request/unprocessable\",\"https://id.registrystack.org/problems/registry-coordinator/request/unsupported-media-type\",\"https://id.registrystack.org/problems/registry-coordinator/restore/hold-required\",\"https://id.registrystack.org/problems/registry-coordinator/restore/lease-incompatible\",\"https://id.registrystack.org/problems/registry-coordinator/restore/review-required\",\"https://id.registrystack.org/problems/registry-coordinator/restore/unresolved\",\"https://id.registrystack.org/problems/registry-coordinator/retry/refused\",\"https://id.registrystack.org/problems/registry-coordinator/run/definition-incompatible\",\"https://id.registrystack.org/problems/registry-coordinator/run/not-visible\",\"https://id.registrystack.org/problems/registry-coordinator/run/payload-erased\",\"https://id.registrystack.org/problems/registry-coordinator/runtime/failure\",\"https://id.registrystack.org/problems/registry-coordinator/service/unavailable\",\"https://id.registrystack.org/problems/registry-coordinator/workflow/not-served\",\"https://id.registrystack.org/problems/registry-coordinator/workflow/revision-mismatch\"],\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], ["/components/schemas/ProposalWaitsByTurn", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"nobody\":{\"minimum\":0,\"type\":\"integer\"},\"official\":{\"minimum\":0,\"type\":\"integer\"},\"party\":{\"minimum\":0,\"type\":\"integer\"},\"unobserved\":{\"minimum\":0,\"type\":\"integer\"}},\"required\":[\"party\",\"official\",\"nobody\",\"unobserved\"],\"type\":\"object\"}")], ["/components/schemas/Reason", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"reason\":{\"maxLength\":256,\"minLength\":1,\"type\":\"string\"}},\"required\":[\"reason\"],\"type\":\"object\"}")], diff --git a/crates/registry-adapter-engine/src/load.rs b/crates/registry-adapter-engine/src/load.rs index cb725c69b6..1cee780125 100644 --- a/crates/registry-adapter-engine/src/load.rs +++ b/crates/registry-adapter-engine/src/load.rs @@ -518,7 +518,9 @@ fn secret_refusal_fix(error: &SecretError) -> &'static str { } SecretError::UnsafeFile(check) => check.suggested_action(), SecretError::UnsafePublicDocument(check) => check.public_suggested_action(), - SecretError::PrivateKeyInPublicDocument => error.suggested_action(), + SecretError::PrivateKeyInPublicDocument | SecretError::PublicDocumentNotText => { + error.suggested_action() + } SecretError::Read => "check that the service user can read the secret file", SecretError::InvalidValue => { "store a non-empty value with no NUL byte, within the secret size limit" diff --git a/crates/registry-adapter-job/src/hook_ingress.rs b/crates/registry-adapter-job/src/hook_ingress.rs index 22b6849e76..009394178a 100644 --- a/crates/registry-adapter-job/src/hook_ingress.rs +++ b/crates/registry-adapter-job/src/hook_ingress.rs @@ -437,7 +437,9 @@ fn resolve_member( SecretError::Unavailable => "the secret file is missing", SecretError::UnsafeFile(check) => check.suggested_action(), SecretError::UnsafePublicDocument(check) => check.public_suggested_action(), - SecretError::PrivateKeyInPublicDocument => error.suggested_action(), + SecretError::PrivateKeyInPublicDocument | SecretError::PublicDocumentNotText => { + error.suggested_action() + } SecretError::Read => "the secret file could not be read", SecretError::InvalidValue => "the secret is empty or contains a NUL byte", SecretError::ProviderDisabled => { diff --git a/crates/registry-adapterctl/src/provision.rs b/crates/registry-adapterctl/src/provision.rs index 449dc3b821..3ba29612c9 100644 --- a/crates/registry-adapterctl/src/provision.rs +++ b/crates/registry-adapterctl/src/provision.rs @@ -85,7 +85,7 @@ pub(crate) fn load( "config.refused", &format!("/database/{member}"), describe_secret_failure(&format!("database.{member}"), reference, &error), - "Check the secret provider and that the secret exists, then run provision again.", + error.suggested_action(), ) }) }; diff --git a/crates/registry-breg-review/src/check.rs b/crates/registry-breg-review/src/check.rs index 25d27363bb..ec5f2fa56f 100644 --- a/crates/registry-breg-review/src/check.rs +++ b/crates/registry-breg-review/src/check.rs @@ -154,13 +154,7 @@ fn write_explicit_settings( settings: &[registry_platform_config::FoundExplicitSetting], ) -> std::io::Result<()> { for found in settings { - writeln!( - output, - "Explicit production setting {} at {}. {}.", - found.setting.code, - found.pointer.as_deref().unwrap_or_default(), - found.setting.summary - )?; + writeln!(output, "{}", found.notice())?; } Ok(()) } diff --git a/crates/registry-bregctl/src/check.rs b/crates/registry-bregctl/src/check.rs index b7802f0f00..4de44caf4d 100644 --- a/crates/registry-bregctl/src/check.rs +++ b/crates/registry-bregctl/src/check.rs @@ -1302,10 +1302,12 @@ fn explicit_setting_notes(settings: Option<&[registry_cli_report::ExplicitSettin location.push(' '); } format!( - "Explicit production setting {} at {location}{}. {}.\n", - setting.code, - setting.pointer.as_deref().unwrap_or(""), - setting.summary.trim_end_matches('.') + "{}\n", + registry_platform_config::explicit_setting_notice( + &setting.code, + &format!("{location}{}", setting.pointer.as_deref().unwrap_or("")), + setting.summary.trim_end_matches('.'), + ) ) }) .collect() diff --git a/crates/registry-bregctl/src/provision.rs b/crates/registry-bregctl/src/provision.rs index 03f4e1c559..a92bdb44e5 100644 --- a/crates/registry-bregctl/src/provision.rs +++ b/crates/registry-bregctl/src/provision.rs @@ -95,12 +95,16 @@ pub(crate) fn load( .map_err(|error| runtime_file_refused(&absolute, &error))?; let resolve = |member: DatabaseMember, reference| { let read = member.read_reference(&secrets, reference); - read.map_err(|_| { + read.map_err(|error| { refused( "config.refused", &format!("/database/{member}"), - format!("database.{member} could not be read from its secret provider"), - "Check the secret provider and that the secret exists, then run provision again.", + registry_platform_config::describe_secret_failure( + &format!("database.{member}"), + reference.as_str(), + &error, + ), + error.suggested_action(), ) }) }; diff --git a/crates/registry-bregctl/tests/provision_cli.rs b/crates/registry-bregctl/tests/provision_cli.rs index 1e6b5d67aa..2ae650c75d 100644 --- a/crates/registry-bregctl/tests/provision_cli.rs +++ b/crates/registry-bregctl/tests/provision_cli.rs @@ -11,6 +11,15 @@ use std::process::{Command, Output}; const MIGRATION_PASSWORD: &str = "migration-password-for-print-mode"; const RUNTIME_PASSWORD: &str = "runtime-password-for-print-mode"; +/// The runtime file states `accessTokenType: JWT`, an explicit production +/// setting, so `provision` reports it on stderr and nothing else. +fn assert_only_the_jwt_notice(stderr: &str) { + assert_eq!( + stderr, + "Explicit production setting platform.posture.jwt-access-token at /authentication/oidc/issuers/primary/accessTokenType. Admits access tokens typed JWT. ID tokens stay refused.\n" + ); +} + /// A runtime file whose secret files name a migration and a runtime login on /// one server that does not exist, so a connection attempt could only fail. fn write_runtime(directory: &Path) -> String { @@ -117,7 +126,7 @@ fn print_sql_writes_the_script_and_no_password() { let stdout = String::from_utf8(output.stdout).unwrap(); let stderr = String::from_utf8(output.stderr).unwrap(); assert_eq!(output.status.code(), Some(0), "{stdout}{stderr}"); - assert!(stderr.is_empty(), "{stderr}"); + assert_only_the_jwt_notice(&stderr); for name in [ "breg_migration", "breg_runtime", @@ -151,7 +160,7 @@ fn print_sql_succeeds_before_the_package_root_exists() { let stdout = String::from_utf8(output.stdout).unwrap(); let stderr = String::from_utf8(output.stderr).unwrap(); assert_eq!(output.status.code(), Some(0), "{stdout}{stderr}"); - assert!(stderr.is_empty(), "{stderr}"); + assert_only_the_jwt_notice(&stderr); assert!(stdout.contains("CREATE ROLE"), "{stdout}"); } diff --git a/crates/registry-caseworkctl/src/provision.rs b/crates/registry-caseworkctl/src/provision.rs index bf8b0e0f88..d73cef84b7 100644 --- a/crates/registry-caseworkctl/src/provision.rs +++ b/crates/registry-caseworkctl/src/provision.rs @@ -78,8 +78,8 @@ fn load(path: &Path, declared: DeclaredPosture) -> Result Value { fn print_explicit_settings(settings: &[registry_cli_report::ExplicitSettingLine]) { for setting in settings { - println!( - "Explicit production setting {} at {}. {}.", - setting.code, - setting.pointer.as_deref().unwrap_or_default(), - setting.summary - ); + println!("{}", setting.notice()); } } diff --git a/crates/registry-coordinator/src/provision.rs b/crates/registry-coordinator/src/provision.rs index ac393b8acb..43124f7285 100644 --- a/crates/registry-coordinator/src/provision.rs +++ b/crates/registry-coordinator/src/provision.rs @@ -94,13 +94,17 @@ fn load(path: &Path, declared: DeclaredPosture) -> Result Some( - resolver - .resolve_public_document(reference) - .map_err(|_| { + registry_platform_config::DatabaseMember::CaBundle + .read(&resolver, reference) + .map_err(|error| { vec![*refusal( "/database/caBundleRef", - "the referenced CA bundle could not be read", - "Make the CA bundle the runtime file names available to this command.", + ®istry_platform_config::describe_secret_failure( + "database.caBundleRef", + reference, + &error, + ), + error.suggested_action(), )] })? .expose_secret() @@ -164,18 +168,22 @@ fn secret_text( reference: &str, pointer: &str, ) -> Result, Box> { - let secret = resolver.resolve(reference).map_err(|_| { + let secret = resolver.resolve(reference).map_err(|error| { refusal( pointer, - "the referenced secret could not be read", - "Make the secret the runtime file names available to this command.", + ®istry_platform_config::describe_secret_failure( + &pointer.trim_start_matches('/').replace('/', "."), + reference, + &error, + ), + error.suggested_action(), ) })?; let text = std::str::from_utf8(secret.expose_secret()).map_err(|_| { refusal( pointer, "the referenced secret is not UTF-8 text", - "Supply a UTF-8 PostgreSQL URL or PEM file.", + "Supply a UTF-8 PostgreSQL URL.", ) })?; Ok(Zeroizing::new(text.to_owned())) diff --git a/crates/registry-coordinator/tests/caller_contract.rs b/crates/registry-coordinator/tests/caller_contract.rs index ed8fe5e54f..ab1e632305 100644 --- a/crates/registry-coordinator/tests/caller_contract.rs +++ b/crates/registry-coordinator/tests/caller_contract.rs @@ -651,7 +651,7 @@ fn human_check_prints_the_explicit_setting_with_its_pointer() { assert!(output.status.success()); let stdout = String::from_utf8(output.stdout).unwrap(); assert!(stdout.lines().any(|line| line == format!( - "Explicit production setting platform.posture.jwt-access-token at {ISSUERS}/main/accessTokenType. admits access tokens typed JWT. ID tokens stay refused." + "Explicit production setting platform.posture.jwt-access-token at {ISSUERS}/main/accessTokenType. Admits access tokens typed JWT. ID tokens stay refused." )), "{stdout}"); } diff --git a/crates/registry-coordinator/tests/provision_cli.rs b/crates/registry-coordinator/tests/provision_cli.rs index f2637fa03d..a19b55ff2a 100644 --- a/crates/registry-coordinator/tests/provision_cli.rs +++ b/crates/registry-coordinator/tests/provision_cli.rs @@ -344,6 +344,20 @@ fn the_runtime_file_may_be_given_before_the_verb() { ); } +/// An unset URL secret is refused with the shared reason and the fix the +/// secret error names, as every provision tool words it. +fn assert_unavailable_reason_and_fix(output: &std::process::Output) { + let stderr = String::from_utf8_lossy(&output.stderr); + assert!( + stderr.contains("no readable secret of that name exists under the configured provider"), + "{stderr}" + ); + assert!( + stderr.contains("Create the secret under the configured provider, or correct the name."), + "{stderr}" + ); +} + #[test] fn an_unreadable_runtime_url_secret_is_refused_without_a_password() { let directory = tempfile::tempdir().unwrap(); @@ -359,6 +373,7 @@ fn an_unreadable_runtime_url_secret_is_refused_without_a_password() { "coordinator.runtime-config.refused", "/database/runtimeUrlRef", ); + assert_unavailable_reason_and_fix(&output); } #[test] @@ -376,6 +391,7 @@ fn an_unreadable_migration_url_secret_is_refused_without_a_password() { "coordinator.runtime-config.refused", "/database/migrationUrlRef", ); + assert_unavailable_reason_and_fix(&output); } #[test] @@ -384,12 +400,15 @@ fn a_certificate_authority_file_that_is_not_text_is_refused() { let runtime = runtime_file(directory.path()); let root_pem = directory.path().join("secrets/postgres-root.pem"); fs::write(&root_pem, [0xff, 0xfe, 0xfd]).unwrap(); + fs::set_permissions(&root_pem, fs::Permissions::from_mode(0o600)).unwrap(); let output = provision(&runtime, &["--print-sql"]); assert_refused( &output, "coordinator.runtime-config.refused", "/database/caBundleRef", ); + let stderr = String::from_utf8_lossy(&output.stderr); + assert!(stderr.contains("not UTF-8 text"), "{stderr}"); } #[test] diff --git a/crates/registry-documentsctl/src/provision.rs b/crates/registry-documentsctl/src/provision.rs index 3b6312dfad..c95751348d 100644 --- a/crates/registry-documentsctl/src/provision.rs +++ b/crates/registry-documentsctl/src/provision.rs @@ -77,7 +77,7 @@ pub(crate) fn load( "config.refused", &format!("/database/{member}"), describe_secret_failure(&format!("database.{member}"), reference, &error), - "Check the secret provider and that the secret exists, then run provision again.", + error.suggested_action(), ) }) }; diff --git a/crates/registry-evidence-oid4vci/src/main.rs b/crates/registry-evidence-oid4vci/src/main.rs index 5601e618da..23af19a3da 100644 --- a/crates/registry-evidence-oid4vci/src/main.rs +++ b/crates/registry-evidence-oid4vci/src/main.rs @@ -329,13 +329,7 @@ fn check( OutputFormat::Human => { let mut output = std::io::stderr().lock(); for found in &explicit_settings { - writeln!( - output, - "Explicit production setting {} at {}. {}.", - found.code, - found.pointer.as_deref().unwrap_or_default(), - found.summary - )?; + writeln!(output, "{}", found.notice())?; } write!(output, "{}", report.render_human())?; } diff --git a/crates/registry-evidence-oid4vp/src/main.rs b/crates/registry-evidence-oid4vp/src/main.rs index 0f576013ce..8bae4229bf 100644 --- a/crates/registry-evidence-oid4vp/src/main.rs +++ b/crates/registry-evidence-oid4vp/src/main.rs @@ -293,13 +293,7 @@ fn check( OutputFormat::Human => { let mut output = std::io::stderr().lock(); for found in &explicit_settings { - writeln!( - output, - "Explicit production setting {} at {}. {}.", - found.code, - found.pointer.as_deref().unwrap_or_default(), - found.summary - )?; + writeln!(output, "{}", found.notice())?; } write!(output, "{}", report.render_human())?; } diff --git a/crates/registry-evidence-oid4vp/tests/check_command.rs b/crates/registry-evidence-oid4vp/tests/check_command.rs index b956f5960c..33dbbeadaf 100644 --- a/crates/registry-evidence-oid4vp/tests/check_command.rs +++ b/crates/registry-evidence-oid4vp/tests/check_command.rs @@ -85,7 +85,7 @@ fn the_committed_example_passes_in_both_formats() { assert!(output.stdout.is_empty()); assert_eq!( String::from_utf8(output.stderr).unwrap(), - "Explicit production setting platform.posture.unrestricted-clients at /applicantTokens/issuers/primary/allowedClients. admits a token from every client this issuer signs for.\n0 errors, 0 warnings in 1 file\n" + "Explicit production setting platform.posture.unrestricted-clients at /applicantTokens/issuers/primary/allowedClients. Admits a token from every client this issuer signs for.\n0 errors, 0 warnings in 1 file\n" ); } diff --git a/crates/registry-evidence/src/main.rs b/crates/registry-evidence/src/main.rs index b990c00060..1c8c0ad079 100644 --- a/crates/registry-evidence/src/main.rs +++ b/crates/registry-evidence/src/main.rs @@ -1133,12 +1133,7 @@ async fn run_check(request: CheckRequest) -> ExitCode { } if !check.is_unavailable() { for found in check.explicit_settings() { - eprintln!( - "Explicit production setting {} at {}. {}.", - found.code, - found.pointer.as_deref().unwrap_or_default(), - found.summary - ); + eprintln!("{}", found.notice()); } } eprint!("{}", report.render_human()); diff --git a/crates/registry-evidencectl/src/check.rs b/crates/registry-evidencectl/src/check.rs index 0b86b42eef..3343f72b6e 100644 --- a/crates/registry-evidencectl/src/check.rs +++ b/crates/registry-evidencectl/src/check.rs @@ -562,13 +562,7 @@ pub(crate) fn render_human_with_settings( } } for found in explicit_settings { - writeln!( - out, - "Explicit production setting {} at {}. {}.", - found.code, - found.pointer.as_deref().unwrap_or_default(), - found.summary - )?; + writeln!(out, "{}", found.notice())?; } write!(out, "{}", diagnostics.render_human()) } diff --git a/crates/registry-evidencectl/tests/file_check.rs b/crates/registry-evidencectl/tests/file_check.rs index 7d9f6bfc71..46165a0c79 100644 --- a/crates/registry-evidencectl/tests/file_check.rs +++ b/crates/registry-evidencectl/tests/file_check.rs @@ -393,7 +393,7 @@ fn check_help_says_the_project_is_required_unless_a_file_is_given() { .expect("run evidencectl"); let help = String::from_utf8_lossy(&output.stdout); assert!( - help.contains("Required unless --file is given"), + help.contains("Required unless --file or --store-provision-config is given"), "check --help must say when PROJECT is required: {help}" ); } diff --git a/crates/registry-messagingctl/src/lib.rs b/crates/registry-messagingctl/src/lib.rs index 64bcd67ab0..6d243afba5 100644 --- a/crates/registry-messagingctl/src/lib.rs +++ b/crates/registry-messagingctl/src/lib.rs @@ -2476,13 +2476,7 @@ fn render_check( )?; } for setting in settings { - writeln!( - stdout, - "Explicit production setting {} at {}. {}.", - setting.code, - setting.pointer.as_deref().unwrap_or_default(), - setting.summary - )?; + writeln!(stdout, "{}", setting.notice())?; } Ok(()) } diff --git a/crates/registry-messagingctl/src/provision.rs b/crates/registry-messagingctl/src/provision.rs index 157fe168f8..a488c5867d 100644 --- a/crates/registry-messagingctl/src/provision.rs +++ b/crates/registry-messagingctl/src/provision.rs @@ -81,7 +81,7 @@ pub(crate) fn load( "config.refused", &format!("/database/{member}"), describe_secret_failure(&format!("database.{member}"), reference, &error), - "Check the secret provider and that the secret exists, then run provision again.", + error.suggested_action(), ) }) }; diff --git a/crates/registry-messagingctl/tests/provision_cli.rs b/crates/registry-messagingctl/tests/provision_cli.rs index 31e6a1aeab..df6f80f1af 100644 --- a/crates/registry-messagingctl/tests/provision_cli.rs +++ b/crates/registry-messagingctl/tests/provision_cli.rs @@ -359,6 +359,34 @@ fn a_missing_runtime_url_secret_is_refused_at_its_member() { assert_eq!(diagnostic["path"], "/database/runtimeUrlRef", "{report:#}"); } +#[test] +fn a_ca_bundle_that_is_not_text_is_refused_at_its_member() { + let directory = scratch(); + let runtime = write_runtime(directory.path()); + let ca = directory.path().join("secrets").join("database-ca.pem"); + std::fs::write(&ca, [0xff, 0xfe, 0xfd]).unwrap(); + std::fs::set_permissions(&ca, std::fs::Permissions::from_mode(0o644)).unwrap(); + let text = std::fs::read_to_string(&runtime).unwrap(); + let stated = text.replace( + " migrationUrlRef: secret:file/migration-database-url\n", + " migrationUrlRef: secret:file/migration-database-url\n caBundleRef: secret:file/database-ca.pem\n", + ); + assert_eq!(stated.matches("caBundleRef").count(), 1, "{stated}"); + std::fs::write(&runtime, stated).unwrap(); + let (code, report) = refusal(&runtime); + assert_eq!(code, Some(1), "{report:#}"); + let diagnostic = first_diagnostic(&report); + assert_eq!(diagnostic["code"], "config.refused", "{report:#}"); + assert_eq!(diagnostic["path"], "/database/caBundleRef", "{report:#}"); + assert!( + diagnostic["message"] + .as_str() + .unwrap() + .contains("not UTF-8 text"), + "{report:#}" + ); +} + #[test] fn a_migration_url_secret_that_is_not_text_is_refused_at_its_member() { let directory = scratch(); diff --git a/crates/registry-platform-config/README.md b/crates/registry-platform-config/README.md index 900eb4f813..d7bdb252a5 100644 --- a/crates/registry-platform-config/README.md +++ b/crates/registry-platform-config/README.md @@ -131,7 +131,8 @@ accepted reference through the explicitly enabled environment or file provider. connections and task connections. - `DatabaseConfig`: `runtimeUrlRef`, `migrationUrlRef`, and an optional `caBundleRef`. `DatabaseMember` names each of them and reads it with the - rule it takes: the CA bundle as a public document, each URL as a secret. + rule it takes: the CA bundle as a public document that must be UTF-8 text, + each URL as a secret. - `DestinationTransport`: `verified-tls`, `loopback-plaintext` or `private-network-plaintext`. Only the last is an explicit production setting. - `PrivateRanges`: the `allowedPrivateCidrs` list of `PrivateRange` values from diff --git a/crates/registry-platform-config/src/blocks.rs b/crates/registry-platform-config/src/blocks.rs index 5b1081935b..9444678671 100644 --- a/crates/registry-platform-config/src/blocks.rs +++ b/crates/registry-platform-config/src/blocks.rs @@ -397,6 +397,10 @@ pub fn describe_secret_failure(field: &str, _reference: &str, error: &SecretErro "the public document holds a PEM private key block. {}", error.suggested_action() ), + SecretError::PublicDocumentNotText => format!( + "the public document is not UTF-8 text. {}", + error.suggested_action() + ), SecretError::Read => "the secret could not be read".to_owned(), SecretError::InvalidValue => format!( "the secret value must be non-empty text of at most {MAX_SECRET_BYTES} bytes \ @@ -456,14 +460,17 @@ impl DatabaseMember { } } - /// Read the member's reference with the rule the member takes. + /// Read the member's reference with the rule the member takes. A CA + /// bundle is a public document read as text, so bytes that are not UTF-8 + /// are [`SecretError::PublicDocumentNotText`]. Its certificates are + /// parsed where the connection is configured, not here. pub fn read( self, resolver: &SecretResolver, reference: &str, ) -> Result { match self { - Self::CaBundle => resolver.resolve_public_document(reference), + Self::CaBundle => utf8_text(resolver.resolve_public_document(reference)?), Self::RuntimeUrl | Self::MigrationUrl => resolver.resolve(reference), } } @@ -475,12 +482,19 @@ impl DatabaseMember { reference: &SecretReference, ) -> Result { match self { - Self::CaBundle => resolver.resolve_public_document_reference(reference), + Self::CaBundle => utf8_text(resolver.resolve_public_document_reference(reference)?), Self::RuntimeUrl | Self::MigrationUrl => resolver.resolve_reference(reference), } } } +fn utf8_text(document: ProtectedSecret) -> Result { + if std::str::from_utf8(document.expose_secret()).is_err() { + return Err(SecretError::PublicDocumentNotText); + } + Ok(document) +} + impl fmt::Display for DatabaseMember { fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { formatter.write_str(self.key()) diff --git a/crates/registry-platform-config/src/blocks_tests.rs b/crates/registry-platform-config/src/blocks_tests.rs index bc28f71074..472d72c968 100644 --- a/crates/registry-platform-config/src/blocks_tests.rs +++ b/crates/registry-platform-config/src/blocks_tests.rs @@ -116,6 +116,92 @@ fn a_database_ca_bundle_reads_as_a_public_document_and_a_url_as_a_secret() { } } +/// A resolver over a fresh root holding each `(name, bytes)` as a 0644 file, +/// the mode a public document may have whatever the process umask. +#[cfg(unix)] +fn public_documents(files: &[(&str, &[u8])]) -> (tempfile::TempDir, SecretResolver) { + use std::os::unix::fs::PermissionsExt as _; + + let root = tempfile::tempdir().expect("tempdir"); + let canonical = std::fs::canonicalize(root.path()).expect("canonical root"); + for (name, bytes) in files { + let path = canonical.join(name); + std::fs::write(&path, bytes).expect("write file"); + std::fs::set_permissions(&path, std::fs::Permissions::from_mode(0o644)).expect("0644"); + } + let resolver = SecretProvidersConfig { + file: Some(FileSecretProviderConfig::new(canonical)), + environment: None, + } + .resolver(None) + .expect("production resolver"); + (root, resolver) +} + +#[cfg(unix)] +#[test] +fn a_database_ca_bundle_that_is_not_text_is_refused_as_not_text() { + let (_root, resolver) = public_documents(&[("binary", &[0xff, 0xfe, 0xfd])]); + let reference = SecretReference::parse("secret:file/binary").unwrap(); + assert_eq!( + DatabaseMember::CaBundle + .read(&resolver, "secret:file/binary") + .unwrap_err(), + SecretError::PublicDocumentNotText + ); + assert_eq!( + DatabaseMember::CaBundle + .read_reference(&resolver, &reference) + .unwrap_err(), + SecretError::PublicDocumentNotText + ); + let described = describe_secret_failure( + "database.caBundleRef", + "secret:file/binary", + &SecretError::PublicDocumentNotText, + ); + assert!(described.contains("not UTF-8 text"), "{described}"); +} + +#[cfg(unix)] +#[test] +fn a_database_ca_bundle_accepts_every_text_shape_of_pem() { + let certificate = "-----BEGIN CERTIFICATE-----\nMIIB\n-----END CERTIFICATE-----\n"; + let bom = [b"\xEF\xBB\xBF".as_slice(), certificate.as_bytes()].concat(); + let crlf = certificate.replace('\n', "\r\n"); + let several = format!("issuer comment\n{certificate}{certificate} \n"); + let (_root, resolver) = public_documents(&[ + ("bom", &bom), + ("crlf", crlf.as_bytes()), + ("several", several.as_bytes()), + ]); + for name in ["bom", "crlf", "several"] { + assert!( + DatabaseMember::CaBundle + .read(&resolver, &format!("secret:file/{name}")) + .is_ok(), + "{name}" + ); + } +} + +#[cfg(unix)] +#[test] +fn a_private_key_is_refused_before_the_text_rule() { + let key = [ + &[0xff, 0xfe][..], + b"\n-----BEGIN PRIVATE KEY-----\nMII\n-----END PRIVATE KEY-----\n", + ] + .concat(); + let (_root, resolver) = public_documents(&[("key", &key)]); + assert_eq!( + DatabaseMember::CaBundle + .read(&resolver, "secret:file/key") + .unwrap_err(), + SecretError::PrivateKeyInPublicDocument + ); +} + #[cfg(unix)] #[test] fn secret_providers_resolver_relaxes_secret_file_permissions_only_with_a_development_witness() { diff --git a/crates/registry-platform-config/src/lib.rs b/crates/registry-platform-config/src/lib.rs index dd91290fd8..a2704968ff 100644 --- a/crates/registry-platform-config/src/lib.rs +++ b/crates/registry-platform-config/src/lib.rs @@ -83,11 +83,12 @@ pub use package::{ }; pub use posture::{ collect_development_settings, collect_posture_settings, declared, declared_from, - declared_from_with_production_alias, declared_with_production_alias, has_denied_warnings, - CollectedSettings, DeclaredPosture, DevelopmentClass, DevelopmentOnlyRefused, - DevelopmentSetting, DevelopmentWitness, ExplicitClass, ExplicitProductionSetting, - ExplicitSettingLine, FoundExplicitSetting, FoundSetting, Gated, Posture, PostureError, - PostureReport, PostureSource, SettingOrigin, Stated, DEVELOPMENT, POSTURE_ENV, + declared_from_with_production_alias, declared_with_production_alias, explicit_setting_notice, + has_denied_warnings, CollectedSettings, DeclaredPosture, DevelopmentClass, + DevelopmentOnlyRefused, DevelopmentSetting, DevelopmentWitness, ExplicitClass, + ExplicitProductionSetting, ExplicitSettingLine, FoundExplicitSetting, FoundSetting, Gated, + Posture, PostureError, PostureReport, PostureSource, SettingOrigin, Stated, DEVELOPMENT, + POSTURE_ENV, }; pub use secrets::{ validate_secret_root, ProtectedSecret, SecretError, SecretFileCheck, SecretProvider, diff --git a/crates/registry-platform-config/src/posture.rs b/crates/registry-platform-config/src/posture.rs index d6af2beaf2..9b5ab0dcd3 100644 --- a/crates/registry-platform-config/src/posture.rs +++ b/crates/registry-platform-config/src/posture.rs @@ -475,6 +475,17 @@ impl ExplicitSettingLine { summary: found.setting.summary.to_owned(), } } + + /// The one line a command prints for this setting: see + /// [`explicit_setting_notice`]. + #[must_use] + pub fn notice(&self) -> String { + explicit_setting_notice( + &self.code, + self.pointer.as_deref().unwrap_or_default(), + &self.summary, + ) + } } impl Serialize for ExplicitSettingLine { @@ -500,6 +511,20 @@ impl Serialize for ExplicitSettingLine { } } +/// The one line every command prints for an explicit production setting: +/// the code, where it is stated and what it relaxes. The summary starts a +/// sentence here, so its first letter is capitalised whatever its authored +/// case. +#[must_use] +pub fn explicit_setting_notice(code: &str, location: &str, summary: &str) -> String { + let mut rest = summary.chars(); + let summary: String = rest + .next() + .map(|first| first.to_uppercase().chain(rest).collect()) + .unwrap_or_default(); + format!("Explicit production setting {code} at {location}. {summary}.") +} + /// An [`ExplicitProductionSetting`] found in a process's configuration. #[derive(Clone, Debug)] pub struct FoundExplicitSetting { @@ -511,14 +536,13 @@ pub struct FoundExplicitSetting { impl FoundExplicitSetting { /// The one line a command prints for this setting, as the check commands - /// print it: the code, the member and what the setting relaxes. + /// print it: see [`explicit_setting_notice`]. #[must_use] pub fn notice(&self) -> String { - format!( - "Explicit production setting {} at {}. {}.", + explicit_setting_notice( self.setting.code, self.pointer.as_deref().unwrap_or_default(), - self.setting.summary + self.setting.summary, ) } } diff --git a/crates/registry-platform-config/src/posture_tests.rs b/crates/registry-platform-config/src/posture_tests.rs index 8f9e097012..61139e852e 100644 --- a/crates/registry-platform-config/src/posture_tests.rs +++ b/crates/registry-platform-config/src/posture_tests.rs @@ -790,3 +790,22 @@ fn deny_warnings_refuses_only_unaccepted_warnings_outside_posture() { assert!(!has_denied_warnings(&[platform, product, accepted])); assert!(has_denied_warnings(&[ordinary])); } + +#[test] +fn a_notice_starts_its_summary_as_a_sentence() { + static LOWERCASE: ExplicitProductionSetting = ExplicitProductionSetting { + code: "platform.posture.example", + key: "example", + summary: "admits an example. Other values stay refused", + }; + let found = FoundExplicitSetting { + setting: &LOWERCASE, + pointer: Some("/example".to_owned()), + position: None, + origin: SettingOrigin::RuntimeFile, + }; + assert_eq!( + found.notice(), + "Explicit production setting platform.posture.example at /example. Admits an example. Other values stay refused." + ); +} diff --git a/crates/registry-platform-config/src/secrets.rs b/crates/registry-platform-config/src/secrets.rs index 8a8c09ec5a..08a3475e4d 100644 --- a/crates/registry-platform-config/src/secrets.rs +++ b/crates/registry-platform-config/src/secrets.rs @@ -200,6 +200,10 @@ pub enum SecretError { /// A public document holds a PEM private key block. #[error("the referenced public document holds a private key")] PrivateKeyInPublicDocument, + /// A public document read as text, such as a CA bundle of PEM + /// certificates, holds bytes that are not UTF-8. + #[error("the referenced public document is not UTF-8 text")] + PublicDocumentNotText, #[error("the referenced secret could not be read")] Read, #[error("the referenced secret value is invalid")] @@ -229,6 +233,9 @@ impl SecretError { Self::PrivateKeyInPublicDocument => { "Put only certificates or public keys in the document, and keep the private key in its own secret file." } + Self::PublicDocumentNotText => { + "Store the document as UTF-8 text, such as PEM certificates." + } Self::Read => "Check that the secret can be read by the runtime user.", Self::InvalidValue => { "Store a non-empty value of at most 64 KiB, without NUL bytes unless the secret is a binary key." diff --git a/crates/registry-render/src/check.rs b/crates/registry-render/src/check.rs index e8dfdf83ff..9f575b6808 100644 --- a/crates/registry-render/src/check.rs +++ b/crates/registry-render/src/check.rs @@ -295,10 +295,12 @@ pub fn run(request: &CheckRequest<'_>, stdout: &mut dyn Write, stderr: &mut dyn .iter() .map(|setting| { format!( - "Explicit production setting {} at {}. {}.\n", - setting.code, - setting.pointer.as_deref().unwrap_or(""), - setting.summary + "{}\n", + registry_platform_config::explicit_setting_notice( + setting.code, + setting.pointer.as_deref().unwrap_or(""), + setting.summary, + ) ) }) .collect::() diff --git a/crates/registry-schedulingctl/src/lib.rs b/crates/registry-schedulingctl/src/lib.rs index ae7ec5e094..d45787e680 100644 --- a/crates/registry-schedulingctl/src/lib.rs +++ b/crates/registry-schedulingctl/src/lib.rs @@ -973,7 +973,8 @@ fn write_explicit_setting( ) -> io::Result<()> { writeln!( out, - "Explicit production setting {code} at {pointer}. {summary}." + "{}", + registry_platform_config::explicit_setting_notice(code, pointer, summary) ) } diff --git a/crates/registry-schedulingctl/src/provision.rs b/crates/registry-schedulingctl/src/provision.rs index d123514d9d..7190cef0ab 100644 --- a/crates/registry-schedulingctl/src/provision.rs +++ b/crates/registry-schedulingctl/src/provision.rs @@ -81,7 +81,7 @@ pub(crate) fn load( "config.refused", &format!("/database/{member}"), describe_secret_failure(&format!("database.{member}"), reference, &error), - "Check the secret provider and that the secret exists, then run provision again.", + error.suggested_action(), ) }) }; diff --git a/docs/site/src/content/docs/configure/enable-sd-jwt-vc.mdx b/docs/site/src/content/docs/configure/enable-sd-jwt-vc.mdx index 2d8a448e88..8f760f3734 100644 --- a/docs/site/src/content/docs/configure/enable-sd-jwt-vc.mdx +++ b/docs/site/src/content/docs/configure/enable-sd-jwt-vc.mdx @@ -130,7 +130,7 @@ Project: . Target: local-target.yaml Explicit production setting platform.posture.issuer-loopback-plaintext at /authentication/oidc/issuers/primary/issuer. An issuer endpoint uses plain HTTP on loopback. Explicit production setting platform.posture.issuer-loopback-plaintext at /authentication/oidc/issuers/primary/jwksSource/uri. An issuer endpoint uses plain HTTP on loopback. -Explicit production setting platform.posture.unrestricted-clients at /authentication/oidc/issuers/primary/allowedClients. admits a token from every client this issuer signs for. +Explicit production setting platform.posture.unrestricted-clients at /authentication/oidc/issuers/primary/allowedClients. Admits a token from every client this issuer signs for. warning[evidence.posture.local-assurance] local-target.yaml:1:1 /assuranceProfile local assurance permits locally held signing keys; production refuses it next: Build a production or evidence-grade package with a Transit signer. diff --git a/docs/site/src/content/docs/security/coordinator.mdx b/docs/site/src/content/docs/security/coordinator.mdx index 07c4ac4ee2..f2bd83f3c3 100644 --- a/docs/site/src/content/docs/security/coordinator.mdx +++ b/docs/site/src/content/docs/security/coordinator.mdx @@ -461,7 +461,8 @@ start or submit on retry; settlement from an event. doctor_counts_proposal_waits_by_their_last_turn_without_reading_breg; crates/registry-coordinator/tests/runtime_config.rs breg_proposal_follow_settings_are_bounded_and_outside_the_binding_digest; - crates/registry-coordinator/src/runtime.rs request_link, is_loopback. */} + crates/registry-coordinator/src/runtime.rs request_link; + crates/registry-coordinator/src/outbound.rs numeric_loopback. */} ### COORDINATOR-INV-08: BReg control metadata has its own response ceiling diff --git a/docs/site/src/content/docs/tutorials/build-and-deploy-evidence-project.mdx b/docs/site/src/content/docs/tutorials/build-and-deploy-evidence-project.mdx index e3e8cbe096..cd739f3656 100644 --- a/docs/site/src/content/docs/tutorials/build-and-deploy-evidence-project.mdx +++ b/docs/site/src/content/docs/tutorials/build-and-deploy-evidence-project.mdx @@ -166,7 +166,7 @@ Project: adult-status Target: deploy-target/target.yaml Explicit production setting platform.posture.issuer-loopback-plaintext at /authentication/oidc/issuers/primary/issuer. An issuer endpoint uses plain HTTP on loopback. Explicit production setting platform.posture.issuer-loopback-plaintext at /authentication/oidc/issuers/primary/jwksSource/uri. An issuer endpoint uses plain HTTP on loopback. -Explicit production setting platform.posture.unrestricted-clients at /authentication/oidc/issuers/primary/allowedClients. admits a token from every client this issuer signs for. +Explicit production setting platform.posture.unrestricted-clients at /authentication/oidc/issuers/primary/allowedClients. Admits a token from every client this issuer signs for. error[evidence.target.production-assurance-required] deploy-target/target.yaml:/assuranceProfile --production requires production or evidence-grade target assurance next: Correct the selected project or target artifact and rerun check. @@ -266,7 +266,7 @@ rstack evidence runtime check --runtime-config candidate/runtime.yaml Evidence package sha256: passed check (4 requirements) Explicit production setting platform.posture.issuer-loopback-plaintext at /authentication/oidc/issuers/primary/issuer. An issuer endpoint uses plain HTTP on loopback. Explicit production setting platform.posture.issuer-loopback-plaintext at /authentication/oidc/issuers/primary/jwksSource/uri. An issuer endpoint uses plain HTTP on loopback. -Explicit production setting platform.posture.unrestricted-clients at /authentication/oidc/issuers/primary/allowedClients. admits a token from every client this issuer signs for. +Explicit production setting platform.posture.unrestricted-clients at /authentication/oidc/issuers/primary/allowedClients. Admits a token from every client this issuer signs for. warning[evidence.posture.local-assurance] /assuranceProfile local assurance permits locally held signing keys; production refuses it next: Build a production or evidence-grade package with a Transit signer. diff --git a/docs/site/src/content/docs/tutorials/connect-a-sqlite-extract.mdx b/docs/site/src/content/docs/tutorials/connect-a-sqlite-extract.mdx index 9cc5c75d62..1bc4d47e44 100644 --- a/docs/site/src/content/docs/tutorials/connect-a-sqlite-extract.mdx +++ b/docs/site/src/content/docs/tutorials/connect-a-sqlite-extract.mdx @@ -149,7 +149,7 @@ Project: . Target: local-target.yaml Explicit production setting platform.posture.issuer-loopback-plaintext at /authentication/oidc/issuers/primary/issuer. An issuer endpoint uses plain HTTP on loopback. Explicit production setting platform.posture.issuer-loopback-plaintext at /authentication/oidc/issuers/primary/jwksSource/uri. An issuer endpoint uses plain HTTP on loopback. -Explicit production setting platform.posture.unrestricted-clients at /authentication/oidc/issuers/primary/allowedClients. admits a token from every client this issuer signs for. +Explicit production setting platform.posture.unrestricted-clients at /authentication/oidc/issuers/primary/allowedClients. Admits a token from every client this issuer signs for. warning[evidence.posture.local-assurance] local-target.yaml:1:1 /assuranceProfile local assurance permits locally held signing keys; production refuses it next: Build a production or evidence-grade package with a Transit signer. @@ -206,7 +206,7 @@ Project: . Target: local-target.yaml Explicit production setting platform.posture.issuer-loopback-plaintext at /authentication/oidc/issuers/primary/issuer. An issuer endpoint uses plain HTTP on loopback. Explicit production setting platform.posture.issuer-loopback-plaintext at /authentication/oidc/issuers/primary/jwksSource/uri. An issuer endpoint uses plain HTTP on loopback. -Explicit production setting platform.posture.unrestricted-clients at /authentication/oidc/issuers/primary/allowedClients. admits a token from every client this issuer signs for. +Explicit production setting platform.posture.unrestricted-clients at /authentication/oidc/issuers/primary/allowedClients. Admits a token from every client this issuer signs for. warning[evidence.posture.local-assurance] local-target.yaml:1:1 /assuranceProfile local assurance permits locally held signing keys; production refuses it next: Build a production or evidence-grade package with a Transit signer. diff --git a/docs/site/src/content/docs/tutorials/connect-an-institution-source.mdx b/docs/site/src/content/docs/tutorials/connect-an-institution-source.mdx index 1ae3afe88c..c7f54aa775 100644 --- a/docs/site/src/content/docs/tutorials/connect-an-institution-source.mdx +++ b/docs/site/src/content/docs/tutorials/connect-an-institution-source.mdx @@ -93,7 +93,7 @@ Target: local-target.yaml Deployment inputs missing: signer.publicJwkFile; the compiled-target bundle check was skipped. Supply them and rerun check to prove the target. Explicit production setting platform.posture.issuer-loopback-plaintext at /authentication/oidc/issuers/primary/issuer. An issuer endpoint uses plain HTTP on loopback. Explicit production setting platform.posture.issuer-loopback-plaintext at /authentication/oidc/issuers/primary/jwksSource/uri. An issuer endpoint uses plain HTTP on loopback. -Explicit production setting platform.posture.unrestricted-clients at /authentication/oidc/issuers/primary/allowedClients. admits a token from every client this issuer signs for. +Explicit production setting platform.posture.unrestricted-clients at /authentication/oidc/issuers/primary/allowedClients. Admits a token from every client this issuer signs for. warning[evidence.posture.local-assurance] local-target.yaml /assuranceProfile local assurance permits locally held signing keys; production refuses it next: Build a production or evidence-grade package with a Transit signer. diff --git a/docs/site/src/content/docs/tutorials/first-evidence-assertion.mdx b/docs/site/src/content/docs/tutorials/first-evidence-assertion.mdx index c15732928f..301f13da4a 100644 --- a/docs/site/src/content/docs/tutorials/first-evidence-assertion.mdx +++ b/docs/site/src/content/docs/tutorials/first-evidence-assertion.mdx @@ -87,7 +87,7 @@ Target: local-target.yaml Deployment inputs missing: signer.publicJwkFile; the compiled-target bundle check was skipped. Supply them and rerun check to prove the target. Explicit production setting platform.posture.issuer-loopback-plaintext at /authentication/oidc/issuers/primary/issuer. An issuer endpoint uses plain HTTP on loopback. Explicit production setting platform.posture.issuer-loopback-plaintext at /authentication/oidc/issuers/primary/jwksSource/uri. An issuer endpoint uses plain HTTP on loopback. -Explicit production setting platform.posture.unrestricted-clients at /authentication/oidc/issuers/primary/allowedClients. admits a token from every client this issuer signs for. +Explicit production setting platform.posture.unrestricted-clients at /authentication/oidc/issuers/primary/allowedClients. Admits a token from every client this issuer signs for. warning[evidence.posture.local-assurance] local-target.yaml /assuranceProfile local assurance permits locally held signing keys; production refuses it next: Build a production or evidence-grade package with a Transit signer. diff --git a/products/identifiers/generated/catalog.v1.json b/products/identifiers/generated/catalog.v1.json index 178ecda385..df60197720 100644 --- a/products/identifiers/generated/catalog.v1.json +++ b/products/identifiers/generated/catalog.v1.json @@ -5965,7 +5965,7 @@ "description": "Registry Coordinator deterministic fixture authoring JSON Schema.", "source": { "path": "crates/registry-coordinator/src/scenarios.rs", - "sha256": "8ef5c37541be5c83c60fa82c20d615b79287df941b33c34b8d6a12ed83d562d9" + "sha256": "fb76ce54849cf3beff2614c77dc222d541de45c0d1137339eeacc214ab1729b7" }, "artifact": { "path": "products/coordinator/generated/fixture/fixture.schema.json", @@ -5983,11 +5983,11 @@ "description": "Registry Coordinator portable project authoring JSON Schema.", "source": { "path": "crates/registry-coordinator/src/authoring.rs", - "sha256": "5a69b78d0bd226766a8acaa1d25620309f3294b05aeef34250ea2cea6c6db267" + "sha256": "7861faa7e6967c1780fea4fc224578c9410f58d5ba9038ee38d8fc2e9dc51355" }, "artifact": { "path": "products/coordinator/generated/project/project.schema.json", - "sha256": "4e6aec4ae96ea5a85738802f64e30cb7a4af439ec43fdf0c5b9d8cbe6d96e7ad", + "sha256": "de2670ab3661e52afdb9bfb9be0c491ebb60cf9cc2725c15428f225cd10d9b70", "mediaType": "application/schema+json" } }, @@ -6001,11 +6001,11 @@ "description": "Registry Coordinator runtime configuration JSON Schema.", "source": { "path": "crates/registry-coordinator/src/runtime.rs", - "sha256": "c0d0267ec81eac40b0f73dcc331f174d526ae32658a2be1609682f1d136e30cf" + "sha256": "083365a7bbb3eeb12293cd7c665e52d5bef7444d54e4a5eca9e2ea378c5884c3" }, "artifact": { "path": "products/coordinator/generated/runtime/runtime.schema.json", - "sha256": "e13ad43e7b12338611fc69a0e2c9c0def7dbe42ff7655cdb7180f0c4d719d3c5", + "sha256": "874e8f61db468dc1bcbed3d5ca363f8f4c2cac8eef31a2038a4cb7248610e0d3", "mediaType": "application/schema+json" } }, @@ -6329,7 +6329,7 @@ }, "artifact": { "path": "products/evidence/generated/oid4vci-runtime/oid4vci-runtime.schema.json", - "sha256": "026c2168ecd30d5333c4d8e4fbea7831c6ea65ead80f5d95846634ee88c2a076", + "sha256": "9648aced227106dbfddecbc2acf7fc43d538948f4a9c002b72840cf284f33b43", "mediaType": "application/schema+json" } }, @@ -6347,7 +6347,7 @@ }, "artifact": { "path": "products/evidence/generated/oid4vp-runtime/oid4vp-runtime.schema.json", - "sha256": "4a8784546a9c990eece05f794e1cfd9d87691c310c39d637a1aae9e3bddebf02", + "sha256": "bdb0e2b0ab0b4a23b7df12d643da1d7269049076c01986b317639f92b8be78eb", "mediaType": "application/schema+json" } }, @@ -6419,7 +6419,7 @@ }, "artifact": { "path": "crates/registry-evidencectl/schemas/authoring/store-provision.schema.json", - "sha256": "6421b53f8cbe33174ed88cb0daa83951754a4fc7f98385274d8782a1b960741c", + "sha256": "961639d976875967842004e6e98a0b3e41a7ebd4612f4f7b55aed602ba2a4fe7", "mediaType": "application/schema+json" } }, @@ -6653,7 +6653,7 @@ }, "artifact": { "path": "crates/registry-cli-api/schema/connections.schema.json", - "sha256": "46eedf1ea8f63a1b6397244234ea690f0ebce68d45527cb28d216db9470c819c", + "sha256": "35c0369ec35cf11b3cab6a861b60eb59cff838e328098497f47f627aaadd22cc", "mediaType": "application/schema+json" } }, @@ -6797,7 +6797,7 @@ }, "artifact": { "path": "products/platform/schemas/task-connection.schema.json", - "sha256": "0d65d121798aadf8f321d2ccac71ccdd05808d269de79be5157277a56c191b25", + "sha256": "cc596239277be2a97b9027e6cd3b4501c8e6e2759a67cd34dad4931c0d2997d0", "mediaType": "application/schema+json" } }, @@ -6887,7 +6887,7 @@ }, "artifact": { "path": "products/platform/generated/dev/dev.v1alpha1.schema.json", - "sha256": "f4d72b0fbb16c1f1205cca3f80ae81a6bb46da44962ec74a5872a37589c50761", + "sha256": "a7d8da1e475b8e5ef80e4879a4144bb5b247912ec5315d475d80c3b726953114", "mediaType": "application/schema+json" } }, diff --git a/products/platform/CHANGELOG.md b/products/platform/CHANGELOG.md index 2fd0e08083..3e69b876ca 100644 --- a/products/platform/CHANGELOG.md +++ b/products/platform/CHANGELOG.md @@ -28,14 +28,21 @@ owner-only. Migration: if `caBundleRef` named a combined certificate and key file, split the key into its own secret file and point `caBundleRef` at the certificates alone. +- Every provision tool refuses a CA bundle that is not UTF-8 text at its + `caBundleRef` member (`/database/caBundleRef`, or `/store/caBundleRef` for + `adapterctl job-provision`) when it reads the runtime file, so + `--print-sql` no longer prints a plan for a binary bundle. Apply still + parses the PEM and refuses a bundle without a certificate. Every provision + tool now words a secret or public-document refusal with its reason and the + fix the error names. - The shared runtime blocks document publishes `StrictSecretProvidersConfig` and `StrictFileSecretProviderConfig`, the secret providers without `mountPolicy`. The Evidence OID4VCI and OID4VP runtime schemas embed them, so the published contract does not offer a member those runtimes refuse. - BREAKING for Rust callers of `registry-platform-config`: `SecretError` gains - `UnsafePublicDocument` and `PrivateKeyInPublicDocument`, and - `ProvisionInput` gains `explicit_settings`. Migration: add arms for the two - variants to exhaustive matches (`SecretFileCheck::public_message` and + `UnsafePublicDocument`, `PrivateKeyInPublicDocument` and + `PublicDocumentNotText`, and `ProvisionInput` gains `explicit_settings`. + Migration: add arms for the three variants to exhaustive matches (`SecretFileCheck::public_message` and `public_suggested_action` give their text), and fill `explicit_settings` from `PostureReport::explicit_setting_notices`. - Numbered releases ship `registry-session` for Linux amd64, Linux arm64 and From 057dbda5436748e874f080c4ee7f913101930462 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 33/55] feat(client): export the holder binding for trusted hosts Folds these reviewed commits: - fix(rstack): bound holder preparation and preserve unresolved attempts - test(rstack): gate hard-coded holder applicant identity - feat(rstack): bind holder preparation to one BReg create Action - test(rstack): model register-business's planned office in the create binding proof - test(rstack): answer a north create with the native 412 precondition.failed - fix(rstack): fold the holder binding high review - feat(client): export the holder binding for trusted hosts - fix(client): fold the holder binding re-review - docs(client): state the holder owner rule's parser condition - test(client): name holder test attempt keys attemptId - test(client): pin the holder outcome guard and fold the binding review - docs(client): say how BReg answers a create bound to a patch Signed-off-by: Jeremi Joslin --- clients/typescript/README.md | 41 ++ clients/typescript/holder-function.ts | 187 ++++++- clients/typescript/package.json | 4 + .../tests/holder-function-create.test.ts | 519 ++++++++++++++++++ .../typescript/tests/holder-function.test.ts | 235 ++++++-- clients/typescript/tests/package.test.ts | 11 + clients/typescript/tsconfig.browser.json | 2 +- products/platform/CHANGELOG.md | 1 + 8 files changed, 943 insertions(+), 57 deletions(-) create mode 100644 clients/typescript/tests/holder-function-create.test.ts diff --git a/clients/typescript/README.md b/clients/typescript/README.md index 50d531777a..9bae833896 100644 --- a/clients/typescript/README.md +++ b/clients/typescript/README.md @@ -344,6 +344,47 @@ with the service before trying it again. The client provides explicit JSON calls for initialization, listing and invocation. Streaming, server-initiated requests, automatic retries and running tool sequences are outside this API. +## Invoke a holder-authorized Action from a trusted host + +Use `@registrystack/client/holder-function` on a trusted host that receives a +signed-in person's bearer on one private, gateway-only route. This entry point +is pre-1.0 and may change. + +`createHolderActionHandler(binding, prepare)` returns a Fetch handler for one +declared function path. The host owns the binding: its `kind`, the exact path, +a preparation deadline, the submission and preparation parsers, and `invoke`, +which calls one generated BReg Action with one fixed access profile and the +caller's bearer. A `target` binding acts on one existing Record and needs its +reviewed condition. A `create` binding makes one new Record and takes no +target. `prepare` is the declared function. It receives only the projected +value the submission parser returns and a signal, never the Request, a +header, the bearer or a product client. Its result passes the preparation +parser, so it cannot select another product, Action, access profile, target, +owner or attempt key. + +The binding minimises arguments. It does not isolate the function: `prepare` +runs in the host's process and can reach whatever that process can, including +the next caller's request. Use it only for trusted, reviewed function code, +and run unreviewed functions outside the host's process. Who owns a created +Record comes from the host's preparation parser, which admits only the +Action's inputs, and the BReg Action's own plan and row boundaries, not from +this handler. BReg scopes attempt keys per issuer, subject and key. Bind +`create` only to an Action that inserts a Record. Bound to one that patches, +BReg refuses the unconditioned patch under the default `condition-required` +concurrency, and the handler relays that refusal. Under `current-revision` the +patch commits with no condition and every answer is unresolved. + +The handler checks only the bearer's shape. BReg verifies the bearer when the +Action is called, after `prepare` has run, so serve the handler only behind the +Session gateway, on a listener nothing else can reach. The binding's path is +the browser-facing `/api/functions/`. If your gateway relays to +`/functions/`, hand the handler a request with the browser-facing path. + +An answer with code `holder-action.outcome-unresolved` means BReg may have +acted. Keep the original attempt key and body until a matching receipt +arrives, including through an ordinary refusal of a retry such as an expired +sign-in. A new key can create a second Record. + ## Generate a service Install the package in your application with Node 24. diff --git a/clients/typescript/holder-function.ts b/clients/typescript/holder-function.ts index eb69f84a5a..b7ed745014 100644 --- a/clients/typescript/holder-function.ts +++ b/clients/typescript/holder-function.ts @@ -5,13 +5,13 @@ const strongTag = /^"[\x21\x23-\x7e]{1,254}"$/u const maximumRequestBytes = 32_768 const bodyTooLarge = Symbol('body too large') -interface HolderSubmission { +export interface HolderSubmission { recordId: string ifMatch: string preparation: Preparation } -interface HolderCommand { +export interface HolderCommand { recordId: string ifMatch: string idempotencyKey: string @@ -19,18 +19,59 @@ interface HolderCommand { signal: AbortSignal } -/** Host-owned parsing and invocation for one generated BReg Action and its fixed access profile. */ -interface HolderActionBinding { +/** Host-owned parsing and invocation for one generated BReg Action on one existing Record and its fixed access profile. */ +export interface HolderTargetBinding { + kind: 'target' path: string + preparationTimeoutMs: number parseSubmission: (body: unknown) => HolderSubmission | undefined parsePreparation: (body: unknown) => Input | undefined invoke: (credential: string, command: HolderCommand) => Promise<{ recordId: string }> } +export interface HolderCreateSubmission { + preparation: Preparation +} + +export interface HolderCreateCommand { + idempotencyKey: string + input: Input + signal: AbortSignal +} + +/** + * Host-owned parsing and invocation for one generated BReg Action that creates one new Record. + * The submission names no target and no condition. Neither the page nor the function can name + * the new Record's owner, as long as the host's preparation parser admits only the Action's + * inputs: the Action's own plan and row boundaries then decide it. Bind it only to an Action that + * inserts a Record. Bound to one that patches, BReg refuses the unconditioned patch under the + * default `condition-required` concurrency, and the handler relays that refusal. Under + * `current-revision` the patch commits with no condition and every answer is unresolved. + */ +export interface HolderCreateBinding { + kind: 'create' + path: string + preparationTimeoutMs: number + parseSubmission: (body: unknown) => HolderCreateSubmission | undefined + parsePreparation: (body: unknown) => Input | undefined + /** Returns the Record the Action created and its revision, from the generated receipt. */ + invoke: (credential: string, command: HolderCreateCommand) => Promise<{ recordId: string; revision: number }> +} + +export type HolderActionBinding = + HolderTargetBinding | HolderCreateBinding + function reply(body: object, status: number): Response { return Response.json(body, { status, headers: { 'Cache-Control': 'no-store' } }) } +function unresolvedOutcome(status = 502): Response { + return reply({ + code: 'holder-action.outcome-unresolved', + message: 'The Action outcome is unconfirmed. Keep the original attempt.', + }, status) +} + function parseJson(source: string): unknown { const value: unknown = JSON.parse(source, (_key, member: unknown) => { if (typeof member === 'number' && @@ -76,12 +117,80 @@ async function readSubmission(request: Request): Promise { } } -/** Use on the trusted invoker's gateway-only listener. Preparation must reproduce the same input on retry. */ +async function prepareInTime(run: (signal: AbortSignal) => unknown, signal: AbortSignal, timeoutMs: number): Promise { + signal.throwIfAborted() + const deadlineAt = performance.now() + timeoutMs + const expired = new Error('The preparation deadline expired.') + let stop!: (reason: unknown) => void + const stopped = new Promise((_resolve, reject) => { stop = reject }) + const abort = () => stop(signal.reason) + signal.addEventListener('abort', abort, { once: true }) + // One timer ends the race and aborts the preparation's own signal together. + const deadline = new AbortController() + const timer = setTimeout(() => { + deadline.abort(expired) + stop(expired) + }, timeoutMs) + try { + // The preparation's own signal follows the caller and the deadline, so cooperative code + // can stop early; the race below does not depend on it. + const preparationSignal = AbortSignal.any([signal, deadline.signal]) + const result = await Promise.race([stopped, Promise.resolve().then(() => { + signal.throwIfAborted() + return run(preparationSignal) + })]) + signal.throwIfAborted() + if (performance.now() >= deadlineAt) throw expired + return result + } finally { + clearTimeout(timer) + signal.removeEventListener('abort', abort) + } +} + +/** A product's own refusal, or an unresolved answer for a spent key; undefined for anything else. */ +function productRefusal(error: unknown): Response | undefined { + if (error instanceof RegistryError && error.kind === 'refused' && !error.outcomeUnknown && + error.status !== undefined && error.status >= 400 && error.status < 500) { + if (error.status === 409 && error.code === 'idempotency.key-reused' || + error.status === 410 && error.code === 'idempotency.expired') return unresolvedOutcome(error.status) + return reply({ message: 'BReg refused the request.' }, error.status) + } + return undefined +} + +/** + * Use on the trusted invoker's gateway-only listener. Preparation must reproduce the same input on retry. + * + * The handler checks only the bearer's shape. BReg verifies it at dispatch, after `prepare` has run, so + * serve the handler only behind the Session gateway, on a listener nothing else can reach. The binding's + * path is the browser-facing `/api/functions/`: a gateway that relays to `/functions/` + * needs the host to hand the handler a request with the browser-facing path. + * + * The binding minimises the arguments `prepare` receives: one projected value and a signal, never the + * Request, a header, the caller's credential or a product client. It does not isolate `prepare`. The + * callback runs in the invoker's process, so code there can reach whatever that process can, including + * the next caller's request. Use it only for trusted, reviewed function code, and run unreviewed + * functions outside the invoker's process. + * + * An unresolved answer (`holder-action.outcome-unresolved`) means the product may have acted. The page + * must keep the original attempt key and body until a matching receipt arrives, even through an + * ordinary refusal of a retry such as an expired sign-in: the handler is stateless and cannot tell + * such a refusal apart from one on a fresh attempt, and a new key can create a second Record. + */ export function createHolderActionHandler( - { path, parseSubmission, parsePreparation, invoke }: HolderActionBinding, - prepare: (input: Preparation) => unknown | Promise, + binding: HolderActionBinding, + prepare: (input: Preparation, options: { signal: AbortSignal }) => unknown | Promise, ): (request: Request) => Promise { + // Read the binding once: later changes to the object it came from have no effect. + const { kind, path, preparationTimeoutMs, parsePreparation } = binding + if (kind !== 'target' && kind !== 'create') throw new TypeError('Expected a target or create holder binding.') + const target = kind === 'target' ? { parseSubmission: binding.parseSubmission, invoke: binding.invoke } : undefined + const create = kind === 'create' && binding.kind === 'create' ? { parseSubmission: binding.parseSubmission, invoke: binding.invoke } : undefined if (!/^\/api\/functions\/[a-z][a-z0-9_-]{0,63}$/u.test(path)) throw new TypeError('Expected a declared function path.') + if (!Number.isSafeInteger(preparationTimeoutMs) || preparationTimeoutMs < 1 || preparationTimeoutMs > 2_147_483_647) { + throw new TypeError('Expected a bounded preparation deadline.') + } return async request => { const url = new URL(request.url) @@ -91,42 +200,78 @@ export function createHolderActionHandler | undefined + try { + if (body !== undefined) created = create.parseSubmission(body) + } catch { + return reply({ message: 'Send a valid JSON request.' }, 400) + } + if (!created) return reply({ message: 'Send the declared request.' }, 400) + let input: Input | undefined + try { + input = parsePreparation(await prepareInTime( + signal => prepare(created.preparation, { signal }), request.signal, preparationTimeoutMs)) + } catch { + return reply({ message: 'The function could not prepare the request.' }, 502) + } + if (!input || request.signal.aborted) return reply({ message: 'The function could not prepare the request.' }, 502) + try { + const result = await create.invoke(credential, { idempotencyKey, input, signal: request.signal }) + // A receipt at revision 1 names a Record this attempt key inserted: BReg writes revision 1 + // on insert, and a same-key replay returns the stored receipt, revision 1 included, even + // after later changes. BReg's idempotency per issuer, subject and key gives the single effect. + if (typeof result.recordId === 'string' && uuid.test(result.recordId) && result.revision === 1) { + return reply({ recordId: result.recordId }, 200) + } + } catch (error) { + const refusal = productRefusal(error) + if (refusal) return refusal + } + return unresolvedOutcome() + } + let submission: HolderSubmission | undefined try { - const body = await readSubmission(request) - if (body === bodyTooLarge) return reply({ message: 'The request is too large.' }, 413) - if (body !== undefined) submission = parseSubmission(body) + if (body !== undefined) submission = target!.parseSubmission(body) } catch { return reply({ message: 'Send a valid JSON request.' }, 400) } - if (!submission || !uuid.test(submission.recordId) || !strongTag.test(submission.ifMatch)) { + if (typeof submission?.recordId !== 'string' || typeof submission.ifMatch !== 'string' || + !uuid.test(submission.recordId) || !strongTag.test(submission.ifMatch)) { return reply({ message: 'Send a record and its reviewed condition.' }, 400) } const { recordId, ifMatch, preparation } = submission let input: Input | undefined try { - request.signal.throwIfAborted() - input = parsePreparation(await prepare(preparation)) + input = parsePreparation(await prepareInTime( + signal => prepare(preparation, { signal }), request.signal, preparationTimeoutMs)) } catch { return reply({ message: 'The function could not prepare the request.' }, 502) } if (!input || request.signal.aborted) return reply({ message: 'The function could not prepare the request.' }, 502) try { - const result = await invoke(credential, { recordId, ifMatch, idempotencyKey, input, signal: request.signal }) + const result = await target!.invoke(credential, { recordId, ifMatch, idempotencyKey, input, signal: request.signal }) if (result.recordId === recordId) return reply({ recordId }, 200) } catch (error) { - if (error instanceof RegistryError && error.kind === 'refused' && !error.outcomeUnknown && - error.status !== undefined && error.status >= 400 && error.status < 500) { - return reply({ message: 'BReg refused the request.' }, error.status) - } + const refusal = productRefusal(error) + if (refusal) return refusal } - return reply({ message: 'The Action outcome is unavailable. Retry the same attempt.' }, 502) + return unresolvedOutcome() } } diff --git a/clients/typescript/package.json b/clients/typescript/package.json index 9e9eeffb64..f5f91250d9 100644 --- a/clients/typescript/package.json +++ b/clients/typescript/package.json @@ -34,6 +34,10 @@ "types": "./dist/mcp.d.ts", "default": "./dist/mcp.js" }, + "./holder-function": { + "types": "./dist/holder-function.d.ts", + "default": "./dist/holder-function.js" + }, "./products/*": { "types": "./dist/generated/*.d.ts", "default": "./dist/generated/*.js" diff --git a/clients/typescript/tests/holder-function-create.test.ts b/clients/typescript/tests/holder-function-create.test.ts new file mode 100644 index 0000000000..e081728f36 --- /dev/null +++ b/clients/typescript/tests/holder-function-create.test.ts @@ -0,0 +1,519 @@ +import assert from 'node:assert/strict' +import test from 'node:test' +import { RegistryError, Transport, type CallOptions, type Operation } from '../core.ts' +import { createHolderActionHandler } from '../holder-function.ts' + +// A create-shaped holder binding: the Action makes one new Record, so the +// submission names no target and no condition. Neither the page nor the +// function can name the new Record's owner. As in the real register-business +// plan, BReg plans the owning office itself and refuses a create outside the +// caller's office through the Action target's row boundary. +const route = '/api/functions/register-business' +const attemptId = '6c0e4c3d-1d0b-4c55-9d43-4ad2a3b3a1f7' +const registrarAuthorization = 'Bearer synthetic-registrar' +const traceId = '33333333333333333333333333333333' +const traceparent = `00-${traceId}-4444444444444444-01` +const submission = { legalName: ' Harbour Bicycle Cooperative ', registrationNumber: 'br-2026-001' } +const prepared = { legalName: 'Harbour Bicycle Cooperative', registrationNumber: 'BR-2026-001' } +const registrar = { subject: 'registrar-a', office: 'central', actor: 'human', client: 'business-registrar', + profile: 'business-registrar', audience: 'businesses' } +const identities = new Map([ + [registrarAuthorization, registrar], + ['Bearer synthetic-registrar-renewed', registrar], + ['Bearer synthetic-reader', { ...registrar, profile: 'business-status' }], + ['Bearer synthetic-other-audience', { ...registrar, audience: 'other' }], + ['Bearer synthetic-north-registrar', { ...registrar, subject: 'registrar-north', office: 'north' }], +]) +// The office register-business plans for every new business Record. +const plannedOffice = 'central' + +const registration: Operation = { + method: 'POST', path: '/v1/actions/register-business', product: 'breg', + accessProfileParameter: true, accessProfileRequired: true, + keyed: true, mutating: true, requestMediaType: 'application/json', + problemValidators: { default: value => exactObject(value, ['code', 'detail', 'status', 'title', 'traceId', 'type']) }, + responses: { 200: [{ mode: 'json', mediaType: 'application/json' }] }, +} + +type RegistrationInput = { legalName: string; registrationNumber: string } +type RegistrationReceipt = { results: { business?: { recordId: string; revision: number } } } + +function exactObject(value: unknown, keys: readonly string[]): value is Record { + return value !== null && typeof value === 'object' && !Array.isArray(value) + && Object.keys(value).length === keys.length && keys.every(key => Object.hasOwn(value, key)) +} + +// Host-owned: the page sends only the two business fields. +function parseSubmission(value: unknown) { + if (!exactObject(value, ['legalName', 'registrationNumber']) || + typeof value.legalName !== 'string' || typeof value.registrationNumber !== 'string') return undefined + return { preparation: { legalName: value.legalName, registrationNumber: value.registrationNumber } } +} + +// Host-owned: the function may return only the Action's two inputs. +function parsePreparation(value: unknown) { + if (!exactObject(value, ['legalName', 'registrationNumber']) || + typeof value.legalName !== 'string' || typeof value.registrationNumber !== 'string') return undefined + return { legalName: value.legalName, registrationNumber: value.registrationNumber } +} + +// The declared function: a pure normalisation of what the page submitted. +function prepareRegistration({ legalName, registrationNumber }: RegistrationInput) { + return { legalName: legalName.trim(), registrationNumber: registrationNumber.trim().toUpperCase() } +} + +function request(options: { path?: string; method?: string; authorization?: string | null; body?: unknown; key?: string; signal?: AbortSignal } = {}) { + const { path = route, method = 'POST', authorization = registrarAuthorization, body = submission, key = attemptId, signal } = options + const headers = new Headers({ + 'Content-Type': 'application/json', 'Idempotency-Key': key, + 'Registry-Client': 'page', Cookie: 'synthetic-cookie', 'X-Actor': 'synthetic-spoofed-actor', + }) + if (authorization !== null) headers.set('Authorization', authorization) + return new Request('https://service.test' + path, { + method, headers, body: method === 'GET' ? undefined : JSON.stringify(body), signal, + }) +} + +function setup(prepare: (input: RegistrationInput) => unknown = prepareRegistration, + { loseFirstReceipt = false, receiptRevision = 1, omitReceipt = false, replayProblem, preparationTimeoutMs = 1000, + receiptRecordId, parse = parseSubmission, answer }: { + answer?: (signal: AbortSignal | null | undefined) => Response | Promise + loseFirstReceipt?: boolean; receiptRevision?: number; omitReceipt?: boolean; preparationTimeoutMs?: number + replayProblem?: 'idempotency.key-reused' | 'idempotency.expired'; receiptRecordId?: string + parse?: (value: unknown) => { preparation: RegistrationInput } | undefined + } = {}, +) { + const preparations: unknown[][] = [] + const preparationSignals: AbortSignal[] = [] + const invokeSignals: AbortSignal[] = [] + const calls: { url: string; headers: Record; body: unknown }[] = [] + // Each new Record and the owner BReg derived for it from the verified caller. + const records = new Map() + const committed = new Map() + let next = 0 + + const fetchProduct: typeof fetch = async (target, options) => { + const url = new URL(String(target)) + const headers = new Headers(options?.headers) + const body = JSON.parse(String(options?.body)) + calls.push({ url: url.href, headers: Object.fromEntries(headers), body }) + if (answer) return answer(options?.signal) + if (url.pathname !== registration.path || options?.method !== 'POST' || + url.searchParams.get('accessProfile') !== 'business-registrar') { + throw new Error('The caller changed the checked Action contract.') + } + const refuse = (status: number, code: string) => Response.json({ + status, code, detail: 'product-only detail', title: 'BReg refused the request.', traceId, + type: 'https://id.registrystack.org/problems/registry-breg/' + code.replaceAll('.', '/'), + }, { status, headers: { 'Content-Type': 'application/problem+json', 'Cache-Control': 'no-store', traceparent } }) + const receipt = (recordId: string) => Response.json({ action: 'register-business', applicationId: attemptId, + results: omitReceipt ? {} : { business: { recordId: receiptRecordId ?? recordId, recordType: 'business', revision: receiptRevision } }, + }, { headers: { 'Cache-Control': 'no-store', traceparent } }) + const identity = identities.get(headers.get('authorization') ?? '') + if (!identity || identity.audience !== 'businesses') return refuse(401, 'authentication.refused') + if (identity.profile !== 'business-registrar') return refuse(403, 'profile.not-authorized') + if (!exactObject(body, ['input']) || !exactObject(body.input, ['legalName', 'registrationNumber'])) { + return refuse(400, 'request.invalid') + } + const receiptKey = identity.subject + ':' + headers.get('idempotency-key') + const command = JSON.stringify(body) + const earlier = committed.get(receiptKey) + if (earlier) { + if (replayProblem) return refuse(replayProblem === 'idempotency.expired' ? 410 : 409, replayProblem) + if (earlier.command !== command) return refuse(409, 'idempotency.key-reused') + return receipt(earlier.recordId) + } + // The plan fixes the office. Natively, the row policy's check on the Action target's row + // boundary refuses the insert for a caller from another office with 412 precondition.failed. + if (identity.office !== plannedOffice) return refuse(412, 'precondition.failed') + const recordId = `00000000-0000-4000-8000-${String(++next).padStart(12, '0')}` + committed.set(receiptKey, { command, recordId }) + records.set(recordId, { + owner: plannedOffice, + input: { legalName: String(body.input.legalName), registrationNumber: String(body.input.registrationNumber) }, + }) + if (loseFirstReceipt && calls.length === 1) { + throw new Error('Simulated lost product receipt') + } + return receipt(recordId) + } + + const handle = createHolderActionHandler({ + kind: 'create', + path: route, + preparationTimeoutMs, + parseSubmission: parse, + parsePreparation, + async invoke(credential, { input, idempotencyKey, signal }) { + invokeSignals.push(signal) + const transport = new Transport({ baseUrl: 'https://businesses.test', token: () => credential, fetch: fetchProduct }) + const { data } = await transport.call(registration, { + idempotencyKey, signal, query: { accessProfile: 'business-registrar' }, body: { input }, + } as CallOptions & { query: Record; body: unknown }) + const business = data.results.business + if (!business) throw new Error('BReg returned no business receipt.') + return { recordId: business.recordId, revision: business.revision } + }, + }, (value, options) => { + preparations.push([value]) + preparationSignals.push(options.signal) + return prepare(value) + }) + return { handle, preparations, preparationSignals, invokeSignals, calls, records } +} + +test('a create binding prepares the projected value and invokes the Action with no target or condition', async () => { + const { handle, preparations, calls, records } = setup() + const result = await handle(request()) + assert.equal(result.status, 200) + const { recordId } = await result.json() as { recordId: string } + assert.deepEqual(preparations, [[submission]]) + assert.equal(calls.length, 1) + const call = calls[0]! + assert.equal(call.url, 'https://businesses.test/v1/actions/register-business?accessProfile=business-registrar') + assert.equal(call.headers.authorization, registrarAuthorization) + assert.equal(call.headers['idempotency-key'], attemptId) + for (const header of ['cookie', 'registry-client', 'x-actor']) assert.equal(call.headers[header], undefined) + assert.deepEqual(call.body, { input: prepared }) + assert.deepEqual([...records], [[recordId, { owner: 'central', input: prepared }]]) +}) + +test('neither the page nor the function can name the owner of a created Record', async () => { + // A page that names an owner is refused before preparation. + const named = setup() + const refused = await named.handle(request({ body: { ...submission, registeringOffice: 'north' } })) + assert.equal(refused.status, 400) + assert.equal(named.preparations.length, 0) + assert.equal(named.calls.length, 0) + + // A function that hard-codes an owner or a record ID cannot reach BReg. + for (const extra of [{ registeringOffice: 'north' }, { recordId: '00000000-0000-4000-8000-000000000999' }]) { + const hardCoded = setup(input => ({ ...prepareRegistration(input), ...extra })) + const answer = await hardCoded.handle(request()) + assert.equal(answer.status, 502, JSON.stringify(extra)) + assert.equal(hardCoded.calls.length, 0, JSON.stringify(extra)) + assert.equal(hardCoded.records.size, 0, JSON.stringify(extra)) + } +}) + +test('a create binding refuses a request outside the declared binding before preparation or BReg', async () => { + for (const options of [ + { path: '/api/functions/other' }, { path: route + '?accessProfile=admin' }, { method: 'PUT' }, + { authorization: null }, { authorization: 'Basic synthetic' }, { key: 'not-a-key' }, + { body: { legalName: 'Only a name' } }, { body: [submission] }, + ]) { + const { handle, preparations, calls } = setup() + const answer = await handle(request(options)) + assert.ok(answer.status >= 400 && answer.status < 500, `${JSON.stringify(options)}: ${answer.status}`) + assert.equal(preparations.length, 0, JSON.stringify(options)) + assert.equal(calls.length, 0, JSON.stringify(options)) + } +}) + +test('a create binding answers only for one new Record', async () => { + // An existing Record's revision, or no Record, leaves the attempt unresolved. + for (const options of [{ receiptRevision: 2 }, { omitReceipt: true }]) { + const { handle } = setup(prepareRegistration, options) + const answer = await handle(request()) + assert.equal(answer.status, 502, JSON.stringify(options)) + assert.equal((await answer.json() as { code: string }).code, 'holder-action.outcome-unresolved') + } +}) + +test('a create binding retry after a lost receipt returns the same new Record once', async () => { + const { handle, calls, records } = setup(prepareRegistration, { loseFirstReceipt: true }) + const first = await handle(request()) + assert.equal(first.status, 502) + assert.equal((await first.json() as { code: string }).code, 'holder-action.outcome-unresolved') + const retried = await handle(request({ authorization: 'Bearer synthetic-registrar-renewed' })) + assert.equal(retried.status, 200) + const { recordId } = await retried.json() as { recordId: string } + assert.deepEqual([...records.keys()], [recordId]) + assert.equal(calls.length, 2) + assert.deepEqual(calls[1]!.body, calls[0]!.body) + assert.equal(calls[1]!.headers['idempotency-key'], calls[0]!.headers['idempotency-key']) +}) + +test('a create binding keeps a spent key unresolved', async () => { + for (const replayProblem of ['idempotency.key-reused', 'idempotency.expired'] as const) { + const { handle, records } = setup(prepareRegistration, { replayProblem }) + assert.equal((await handle(request())).status, 200) + const replay = await handle(request()) + assert.equal(replay.status, replayProblem === 'idempotency.expired' ? 410 : 409) + assert.equal((await replay.json() as { code: string }).code, 'holder-action.outcome-unresolved') + assert.equal(records.size, 1) + } +}) + +test('a create binding product refusal stays a refusal', async () => { + for (const [authorization, status] of [ + ['Bearer synthetic-reader', 403], ['Bearer synthetic-other-audience', 401], + // A registrar outside the planned office: the Action target's row boundary refuses it. + ['Bearer synthetic-north-registrar', 412], + ] as const) { + const { handle, records } = setup() + const answer = await handle(request({ authorization })) + assert.equal(answer.status, status) + assert.equal(records.size, 0) + } +}) + +test('cancellation before or during a create preparation makes no Action call', { timeout: 3000 }, async () => { + const early = setup() + const aborted = new AbortController() + aborted.abort() + assert.equal((await early.handle(request({ signal: aborted.signal }))).status, 502) + assert.equal(early.preparations.length, 0) + assert.equal(early.calls.length, 0) + + let release!: (value: unknown) => void + const pending = setup(() => new Promise(resolve => { release = resolve })) + const during = new AbortController() + const answer = pending.handle(request({ signal: during.signal })) + while (pending.preparations.length === 0) await new Promise(resolve => setImmediate(resolve)) + during.abort() + assert.equal((await answer).status, 502) + release(prepared) + await new Promise(resolve => setImmediate(resolve)) + assert.equal(pending.calls.length, 0) + assert.equal(pending.records.size, 0) +}) + +test('a binding names its kind, and a target binding still needs its target and condition', () => { + const common = { + path: route, preparationTimeoutMs: 1000, parseSubmission, parsePreparation, + async invoke() { return { recordId: '00000000-0000-4000-8000-000000000001', revision: 1 } }, + } + for (const kind of [undefined, 'update', 'Create']) { + assert.throws(() => createHolderActionHandler({ ...common, kind } as never, prepareRegistration), + /Expected a target or create holder binding/u, String(kind)) + } +}) + +test('a target binding refuses a submission without its target and condition', async () => { + let invoked = 0 + const handle = createHolderActionHandler({ + kind: 'target', path: route, preparationTimeoutMs: 1000, parsePreparation, + // A target parser that drops the target: the handler must still refuse. + parseSubmission: value => parseSubmission(value) as never, + async invoke() { + invoked += 1 + return { recordId: '00000000-0000-4000-8000-000000000001' } + }, + }, prepareRegistration) + const answer = await handle(request()) + assert.equal(answer.status, 400) + assert.equal(invoked, 0) +}) + +test('keeping the attempt key through a refused retry leaves one Record', async () => { + // A lost receipt leaves the attempt unresolved. A retry with an expired credential is an + // ordinary refusal, which the handler cannot tell apart statelessly. A page that keeps the + // original key and body, as the binding documents, still ends with one Record. + const { handle, records } = setup(prepareRegistration, { loseFirstReceipt: true }) + assert.equal((await handle(request())).status, 502) + assert.equal((await handle(request({ authorization: 'Bearer synthetic-expired' }))).status, 401) + const retried = await handle(request({ authorization: 'Bearer synthetic-registrar-renewed' })) + assert.equal(retried.status, 200) + assert.deepEqual([...records.keys()], [(await retried.json() as { recordId: string }).recordId]) +}) + +test('a create receipt naming a record that is not a UUID leaves the attempt unresolved', async () => { + const { handle } = setup(prepareRegistration, { receiptRecordId: 'not-a-record' }) + const answer = await handle(request()) + assert.equal(answer.status, 502) + assert.equal((await answer.json() as { code: string }).code, 'holder-action.outcome-unresolved') +}) + +test('a synchronous preparation that overruns its deadline makes no Action call', async () => { + const { handle, calls } = setup(input => { + const until = performance.now() + 40 + while (performance.now() < until) { /* busy */ } + return prepareRegistration(input) + }, { preparationTimeoutMs: 10 }) + assert.equal((await handle(request())).status, 502) + assert.equal(calls.length, 0) +}) + +test('the preparation signal aborts at the deadline', { timeout: 3000 }, async () => { + let observed: AbortSignal | undefined + let invoked = 0 + const slow = createHolderActionHandler({ + kind: 'create', path: route, preparationTimeoutMs: 20, parseSubmission, parsePreparation, + async invoke() { + invoked += 1 + return { recordId: '00000000-0000-4000-8000-000000000001', revision: 1 } + }, + }, async (value, { signal }) => { + observed = signal + await new Promise(resolve => setTimeout(resolve, 80)) + return prepareRegistration(value) + }) + assert.equal((await slow(request())).status, 502) + assert.equal(observed?.aborted, true) + assert.equal(invoked, 0) +}) + +test('the preparation deadline removes its timer and abort listener', async () => { + const controller = new AbortController() + const signal = controller.signal + let added = 0 + let removed = 0 + const addEventListener = signal.addEventListener.bind(signal) + const removeEventListener = signal.removeEventListener.bind(signal) + signal.addEventListener = ((...args: Parameters) => { + if (args[0] === 'abort') added += 1 + return addEventListener(...args) + }) as typeof signal.addEventListener + signal.removeEventListener = ((...args: Parameters) => { + if (args[0] === 'abort') removed += 1 + return removeEventListener(...args) + }) as typeof signal.removeEventListener + const { handle } = setup(prepareRegistration, { preparationTimeoutMs: 600_000 }) + // Count the timers the handler starts and clears, so a leaked timer fails here. + const started = new Set() + const realSetTimeout = globalThis.setTimeout + const realClearTimeout = globalThis.clearTimeout + globalThis.setTimeout = ((...args: Parameters) => { + const timer = realSetTimeout(...args) + if (args[1] === 600_000) started.add(timer) + return timer + }) as typeof setTimeout + globalThis.clearTimeout = ((timer?: Parameters[0]) => { + started.delete(timer) + return realClearTimeout(timer) + }) as typeof clearTimeout + // The handler reads the caller's signal from the Request; hand it the spied one. + class SpiedRequest extends Request { + override get signal() { return signal } + } + let answer: Response + try { + answer = await handle(new SpiedRequest(request())) + } finally { + globalThis.setTimeout = realSetTimeout + globalThis.clearTimeout = realClearTimeout + } + // Clear any leaked timer before asserting, so a leak fails the test instead of hanging it. + const leaked = started.size + for (const timer of started) realClearTimeout(timer as Parameters[0]) + assert.equal(answer.status, 200) + assert.ok(added >= 1) + assert.equal(removed, added) + assert.equal(leaked, 0, 'a deadline timer was left running') +}) + +test('a create preparation receives the host projection, not the raw body', async () => { + // A host parser that admits a note the function does not need, and drops it. + const parse = (value: unknown) => { + if (!exactObject(value, ['legalName', 'registrationNumber', 'note']) || + typeof value.legalName !== 'string' || typeof value.registrationNumber !== 'string') return undefined + return { preparation: { legalName: value.legalName, registrationNumber: value.registrationNumber } } + } + const { handle, preparations } = setup(prepareRegistration, { parse }) + assert.equal((await handle(request({ body: { ...submission, note: 'not for the function' } }))).status, 200) + assert.deepEqual(preparations, [[submission]]) +}) + +test('the caller signal reaches the Action call and the preparation', async () => { + const controller = new AbortController() + const { handle, invokeSignals, preparationSignals } = setup() + assert.equal((await handle(request({ signal: controller.signal }))).status, 200) + assert.equal(invokeSignals.length, 1) + assert.equal(preparationSignals.length, 1) + controller.abort() + assert.equal(invokeSignals[0]!.aborted, true) + assert.equal(preparationSignals[0]!.aborted, true) +}) + +test('the attempt key is forwarded in lower case', async () => { + const { handle, calls } = setup() + assert.equal((await handle(request({ key: attemptId.toUpperCase() }))).status, 200) + assert.equal(calls[0]!.headers['idempotency-key'], attemptId) +}) + +test('a binding kind changed after construction has no effect', async () => { + const binding = { + kind: 'create' as 'create' | 'target', path: route, preparationTimeoutMs: 1000, parseSubmission, parsePreparation, + async invoke() { return { recordId: '00000000-0000-4000-8000-000000000001', revision: 1 } }, + } + const handle = createHolderActionHandler(binding as never, prepareRegistration) + binding.kind = 'target' + const answer = await handle(request()) + assert.equal(answer.status, 200) +}) + +test('an answer that is not a product refusal leaves the attempt unresolved', async () => { + // A 5xx may follow a commit, and a 2xx the client cannot read may carry one: neither is a refusal. + for (const [name, answer] of [ + ['5xx problem', () => Response.json({ status: 503, code: 'service.unavailable', detail: 'd', title: 't', traceId, + type: 'https://id.registrystack.org/problems/registry-breg/service/unavailable' }, + { status: 503, headers: { 'Content-Type': 'application/problem+json', traceparent } })], + ['unreadable 2xx', () => new Response('not json', { status: 200, headers: { 'Content-Type': 'application/json' } })], + // A 4xx with no problem body may come from a proxy, not from BReg's decision. + ['4xx without a problem', () => new Response('denied', { status: 403, headers: { 'Content-Type': 'text/plain' } })], + ] as const) { + const { handle, calls } = setup(prepareRegistration, { answer }) + const result = await handle(request()) + assert.equal(result.status, 502, name) + assert.equal((await result.json() as { code: string }).code, 'holder-action.outcome-unresolved', name) + assert.equal(calls.length, 1, name) + } +}) + +test('a caller abort after dispatch leaves the attempt unresolved', { timeout: 3000 }, async () => { + const controller = new AbortController() + const { handle, calls } = setup(prepareRegistration, { + answer: signal => new Promise((_resolve, reject) => { + signal?.addEventListener('abort', () => reject(signal.reason), { once: true }) + controller.abort() + }), + }) + const result = await handle(request({ signal: controller.signal })) + assert.equal(result.status, 502) + assert.equal((await result.json() as { code: string }).code, 'holder-action.outcome-unresolved') + assert.equal(calls.length, 1) +}) + +test('a create request that is not JSON is refused before preparation', async () => { + // A cross-site form cannot send application/json without a preflight. + for (const type of ['text/plain', 'application/x-www-form-urlencoded', 'multipart/form-data']) { + const { handle, preparations, calls } = setup() + const forged = new Request('https://service.test' + route, { + method: 'POST', body: JSON.stringify(submission), + headers: { 'Content-Type': type, 'Idempotency-Key': attemptId, Authorization: registrarAuthorization }, + }) + assert.equal((await handle(forged)).status, 400, type) + assert.deepEqual([preparations.length, calls.length], [0, 0], type) + } +}) + +test('every handler answer is marked no-store', async () => { + const { handle } = setup() + for (const answer of [await handle(request()), await handle(request({ authorization: null })), + await handle(request({ path: '/api/functions/other' }))]) { + assert.equal(answer.headers.get('cache-control'), 'no-store') + } +}) + +test('a host invoke error is a refusal only when refused, settled and 4xx', async () => { + // Each error fails exactly one of the three conditions, so each condition is needed on its own. + const refusal = (kind: 'refused' | 'unexpected', status: number, outcomeUnknown: boolean) => + new RegistryError({ kind, reason: 'status', status, outcomeUnknown }) + for (const [name, error, expected] of [ + ['settled 4xx refusal', refusal('refused', 403, false), 403], + ['4xx refusal with an unknown outcome', refusal('refused', 403, true), 502], + ['5xx marked refused', refusal('refused', 503, false), 502], + ['unexpected 4xx', refusal('unexpected', 403, false), 502], + ] as const) { + const handle = createHolderActionHandler({ + kind: 'create', path: route, preparationTimeoutMs: 1000, parseSubmission, parsePreparation, + async invoke() { throw error }, + }, prepareRegistration) + const result = await handle(request()) + assert.equal(result.status, expected, name) + if (expected === 502) { + assert.equal((await result.json() as { code: string }).code, 'holder-action.outcome-unresolved', name) + } + } +}) diff --git a/clients/typescript/tests/holder-function.test.ts b/clients/typescript/tests/holder-function.test.ts index ca598b6139..64badc47a2 100644 --- a/clients/typescript/tests/holder-function.test.ts +++ b/clients/typescript/tests/holder-function.test.ts @@ -1,6 +1,11 @@ import assert from 'node:assert/strict' -import test from 'node:test' -import { Transport, type Operation } from '../core.ts' +import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import test, { after } from 'node:test' +import { pathToFileURL } from 'node:url' +import { Transport, type CallOptions, type Operation } from '../core.ts' +import { generateFile } from '../generate.ts' import { createHolderActionHandler } from '../holder-function.ts' const route = '/api/functions/renew' @@ -12,11 +17,14 @@ const ifMatch = '"reviewed-revision"' const otherIfMatch = '"other-reviewed-revision"' const attemptId = '08114403-75d2-48d3-961a-5d4fb8b19687' const holderAuthorization = 'Bearer synthetic-holder' +const traceId = '11111111111111111111111111111111' +const traceparent = `00-${traceId}-2222222222222222-01` const submission = { licenceId, reviewedExpiresOn, preconditions: { licenceId: { ifMatch } } } const holder = { subject: 'person-a', holderRef: 'holder-a', actor: 'human', client: 'licence-holder', profile: 'licence-holder', audience: 'licences' } const identities = new Map([ [holderAuthorization, holder], + ['Bearer synthetic-holder-renewed', holder], ['Bearer synthetic-other-subject', { ...holder, subject: 'person-b', holderRef: 'holder-b' }], ['Bearer synthetic-agent', { ...holder, actor: 'agent' }], ['Bearer synthetic-officer', { ...holder, profile: 'licence-officer' }], @@ -31,10 +39,35 @@ const renewal: Operation = { method: 'POST', path: '/v1/actions/renew', product: 'breg', accessProfileParameter: true, accessProfileRequired: true, keyed: true, mutating: true, requestMediaType: 'application/json', - problemValidators: { default: value => exactObject(value, ['code', 'detail', 'status']) }, + problemValidators: { default: value => exactObject(value, ['code', 'detail', 'status', 'title', 'traceId', 'type']) }, responses: { 200: [{ mode: 'json', mediaType: 'application/json' }] }, } +type RenewalInput = { licenceId: string; newExpiresOn: string } +type RenewalOptions = CallOptions & { accessProfile: 'licence-holder'; preconditions: { licenceId: { ifMatch: string } } } +type RenewalReceipt = { results: { licence?: { recordId: string } } } +type RenewalClient = { + invoke(action: 'renew', input: RenewalInput, options: RenewalOptions): Promise<{ data: RenewalReceipt }> +} + +let renewalClient = (transport: Transport): RenewalClient => ({ + invoke(_action, input, { accessProfile, preconditions, ...options }) { + return transport.call(renewal, { ...options, query: { accessProfile }, body: { input, preconditions } }) + }, +}) + +// Re-run the same synthetic transport cases using a client generated from the medical project's OpenAPI. +const medicalOpenApi = process.env.REGISTRY_HOLDER_TEST_OPENAPI +if (medicalOpenApi) { + const scratch = mkdtempSync(join(tmpdir(), 'registry-holder-openapi-')) + after(() => rmSync(scratch, { recursive: true })) + writeFileSync(join(scratch, 'package.json'), '{"type":"module"}\n') + const output = join(scratch, 'medical-renewal.ts') + generateFile(medicalOpenApi, output, false, true, [], true) + const { Client } = await import(pathToFileURL(output).href) as { Client: new (transport: Transport) => RenewalClient } + renewalClient = transport => new Client(transport) +} + function exactObject(value: unknown, keys: readonly string[]): value is Record { return value !== null && typeof value === 'object' && !Array.isArray(value) && Object.keys(value).length === keys.length && keys.every(key => Object.hasOwn(value, key)) @@ -56,14 +89,14 @@ function parsePreparation(value: unknown) { return { newExpiresOn: value.newExpiresOn } } -function request(options: { path?: string; authorization?: string | null; body?: unknown; key?: string } = {}) { - const { path = route, authorization = holderAuthorization, body = submission, key = attemptId } = options +function request(options: { path?: string; authorization?: string | null; body?: unknown; key?: string; signal?: AbortSignal } = {}) { + const { path = route, authorization = holderAuthorization, body = submission, key = attemptId, signal } = options const headers = new Headers({ 'Content-Type': 'application/json', 'Idempotency-Key': key, 'Registry-Client': 'page', Cookie: 'synthetic-cookie', 'X-Actor': 'synthetic-spoofed-actor', }) if (authorization !== null) headers.set('Authorization', authorization) - return new Request('https://service.test' + path, { method: 'POST', headers, body: JSON.stringify(body) }) + return new Request('https://service.test' + path, { method: 'POST', headers, body: JSON.stringify(body), signal }) } function prepareRenewal({ reviewedExpiresOn }: { reviewedExpiresOn: string }) { @@ -72,11 +105,16 @@ function prepareRenewal({ reviewedExpiresOn }: { reviewedExpiresOn: string }) { } function setup(prepare: (input: { reviewedExpiresOn: string }) => unknown = prepareRenewal, - { loseFirstReceipt = false, parse = parseSubmission, receiptRecordId = '' } = {}, + { loseFirstReceipt = false, parse = parseSubmission, receiptRecordId = '', preparationTimeoutMs = 1000, + replayProblem, omitReceiptRevision = false }: { loseFirstReceipt?: boolean; parse?: typeof parseSubmission; + receiptRecordId?: string | null; preparationTimeoutMs?: number; omitReceiptRevision?: boolean; + replayProblem?: 'idempotency.key-reused' | 'idempotency.expired' | 'mutation.conflict' } = {}, ) { const preparations: unknown[][] = [] + const preparationSignals: AbortSignal[] = [] const calls: { url: string; method: string | undefined; headers: Record; body: unknown }[] = [] const writes: string[] = [] + const verifiedApplicantIds: string[] = [] const committed = new Map() const fetchProduct: typeof fetch = async (target, options) => { @@ -87,46 +125,62 @@ function setup(prepare: (input: { reviewedExpiresOn: string }) => unknown = prep if (url.pathname !== renewal.path || options?.method !== 'POST' || url.searchParams.get('accessProfile') !== 'licence-holder') { throw new Error('The caller changed the checked Action contract.') } - const refuse = (status: number, code = 'synthetic.refusal') => Response.json({ status, code, detail: 'product-only detail' }, - { status, headers: { 'Content-Type': 'application/problem+json' } }) + const refuse = (status: number, code: string) => Response.json({ + status, code, detail: 'product-only detail', title: 'BReg refused the request.', traceId, + type: 'https://id.registrystack.org/problems/registry-breg/' + code.replaceAll('.', '/'), + }, { status, headers: { 'Content-Type': 'application/problem+json', 'Cache-Control': 'no-store', traceparent } }) + const receipt = () => Response.json({ action: 'renew', applicationId: attemptId, + results: receiptRecordId === null ? {} : { licence: { recordId: receiptRecordId || body.input.licenceId, + recordType: 'licence', revision: omitReceiptRevision ? undefined : 2 } }, + }, { headers: { 'Cache-Control': 'no-store', traceparent } }) const identity = identities.get(headers.get('authorization') ?? '') - if (!identity || identity.audience !== 'licences') return refuse(401) - if (identity.actor !== 'human' || identity.client !== 'licence-holder' || identity.profile !== 'licence-holder') return refuse(403) + if (!identity || identity.audience !== 'licences') return refuse(401, 'authentication.refused') + if (identity.actor !== 'human' || identity.client !== 'licence-holder' || identity.profile !== 'licence-holder') { + return refuse(403, 'profile.not-authorized') + } const record = records.get(body.input.licenceId) - if (record?.holderRef !== identity.holderRef || body.preconditions.licenceId.ifMatch !== record.ifMatch) return refuse(412) - if (body.input.newExpiresOn !== newExpiresOn) return refuse(412, 'synthetic.guard') + if (record?.holderRef !== identity.holderRef || body.preconditions.licenceId.ifMatch !== record.ifMatch) { + return refuse(412, 'precondition.failed') + } + if (body.input.newExpiresOn !== newExpiresOn) return refuse(412, 'action.guard-failed') const receiptKey = identity.subject + ':' + headers.get('idempotency-key') const command = JSON.stringify(body) if (committed.has(receiptKey)) { - if (committed.get(receiptKey) !== command) return refuse(409) - return Response.json({ recordId: body.input.licenceId }) + if (replayProblem) return refuse(replayProblem === 'idempotency.expired' ? 410 : 409, replayProblem) + if (committed.get(receiptKey) !== command) return refuse(409, 'idempotency.key-reused') + return receipt() } committed.set(receiptKey, command) writes.push(body.input.licenceId) + verifiedApplicantIds.push(identity.holderRef) if (loseFirstReceipt && writes.length === 1) throw new Error('Simulated lost product receipt') - return Response.json({ recordId: receiptRecordId || body.input.licenceId, detail: 'product-only detail' }) + return receipt() } const handle = createHolderActionHandler({ + kind: 'target', path: route, + preparationTimeoutMs, parseSubmission: parse, parsePreparation, async invoke(credential, command) { const { recordId, ifMatch, input, idempotencyKey, signal } = command - const client = new Transport({ baseUrl: 'https://licences.test', token: () => credential, fetch: fetchProduct }) - const { data } = await client.call<{ recordId: string }>(renewal, { - query: { accessProfile: 'licence-holder' }, - body: { input: { licenceId: recordId, newExpiresOn: input.newExpiresOn }, preconditions: { licenceId: { ifMatch } } }, + const client = renewalClient(new Transport({ baseUrl: 'https://licences.test', token: () => credential, fetch: fetchProduct })) + const { data } = await client.invoke('renew', { licenceId: recordId, newExpiresOn: input.newExpiresOn }, { + accessProfile: 'licence-holder', preconditions: { licenceId: { ifMatch } }, idempotencyKey, signal, }) - return data + const receivedRecordId = data.results.licence?.recordId + if (!receivedRecordId) throw new Error('BReg returned no licence receipt.') + return { recordId: receivedRecordId } }, - }, (...args) => { - preparations.push(args) - return prepare(...args) + }, (value, options) => { + preparations.push([value]) + preparationSignals.push(options.signal) + return prepare(value) }) - return { handle, preparations, calls, writes } + return { handle, preparations, preparationSignals, calls, writes, verifiedApplicantIds } } test('preparation receives one projected value and the checked Action receives the holder command', async () => { @@ -157,6 +211,7 @@ test('a missing caller or request outside the declared binding never reaches pre [request({ body: { ...submission, product: 'other' } }), 400], [request({ body: { ...submission, accessProfile: 'licence-officer' } }), 400], [request({ body: { ...submission, subject: 'other' } }), 400], + [request({ body: { ...submission, applicantId: 'holder-b' } }), 400], [request({ body: { ...submission, licenceId: licenceId.toUpperCase() } }), 400], [request({ key: 'wrong' }), 400], ] as const @@ -172,6 +227,52 @@ test('a preparation result outside its projection cannot substitute the target o assert.deepEqual(calls, []) }) +test('a preparation result naming an applicant is refused before BReg', async () => { + // The function cannot choose the person: an applicant ID it hard-codes fails the + // strict projection, so no Action is dispatched and BReg keeps the holder's authority. + const { handle, preparations, calls, writes } = setup(() => ({ newExpiresOn, applicantId: 'holder-b' })) + const result = await handle(request()) + assert.equal(result.status, 502) + assert.deepEqual(preparations, [[{ reviewedExpiresOn }]]) + assert.deepEqual(calls, []) + assert.deepEqual(writes, []) +}) + +test('cancellation before preparation admits no preparation or Action dispatch', async () => { + const { handle, preparations, calls } = setup() + const response = await handle(request({ signal: AbortSignal.abort() })) + assert.equal(response.status, 502) + assert.deepEqual(preparations, []) + assert.deepEqual(calls, []) +}) + +test('cancellation during preparation returns without waiting for the result or dispatching an Action', { timeout: 3000 }, async t => { + const caller = new AbortController() + let finish: ((result: unknown) => void) | undefined + t.after(() => finish?.({ newExpiresOn })) + const { handle, preparations, calls } = setup(() => new Promise(resolve => { + finish = resolve + caller.abort() + }), { preparationTimeoutMs: 10_000 }) + assert.equal((await handle(request({ signal: caller.signal }))).status, 502) + assert.deepEqual(preparations, [[{ reviewedExpiresOn }]]) + finish?.({ newExpiresOn }) + await new Promise(resolve => setImmediate(resolve)) + assert.deepEqual(calls, []) +}) + +test('a late preparation result cannot dispatch an Action after the deadline', { timeout: 3000 }, async () => { + let finish: ((result: unknown) => void) | undefined + const { handle, preparations, calls } = setup(() => new Promise(resolve => { finish = resolve }), { + preparationTimeoutMs: 20, + }) + assert.equal((await handle(request())).status, 502) + assert.deepEqual(preparations, [[{ reviewedExpiresOn }]]) + finish?.({ newExpiresOn }) + await new Promise(resolve => setImmediate(resolve)) + assert.deepEqual(calls, []) +}) + test('a throwing submission parser returns a fixed refusal before preparation or BReg', async () => { const { handle, preparations, calls } = setup(prepareRenewal, { parse() { throw new Error('submitted values excluded from the reply') }, @@ -212,7 +313,7 @@ test('ambiguous request JSON is refused before the submission parser', async () assert.deepEqual(calls, []) }) -test('the owning product refuses a wrong subject, actor, role, client, audience, target, or condition', async () => { +test('synthetic product refusals for subject, actor, role, client, audience, target, or condition stay refusals', async () => { const { handle, calls, writes } = setup() const refusals = [ [request({ authorization: 'Bearer synthetic-other-subject' }), 412], @@ -256,24 +357,88 @@ test('a product refusal of the prepared value stays a refusal', async () => { assert.deepEqual(writes, []) }) -test('a product receipt for a different record leaves the original attempt unconfirmed', async () => { - const { handle, calls } = setup(prepareRenewal, { receiptRecordId: otherLicenceId }) - const response = await handle(request()) - assert.equal(response.status, 502) - assert.doesNotMatch(await response.text(), new RegExp(otherLicenceId, 'u')) - assert.equal(calls.length, 1) +test('a product receipt missing the exact record leaves the original attempt unresolved', async () => { + for (const receiptRecordId of [otherLicenceId, null]) { + const { handle, calls } = setup(prepareRenewal, { receiptRecordId }) + const response = await handle(request()) + assert.equal(response.status, 502) + assert.deepEqual(await response.json(), { + code: 'holder-action.outcome-unresolved', message: 'The Action outcome is unconfirmed. Keep the original attempt.', + }) + assert.equal(calls.length, 1) + assert.equal(calls[0]?.headers['idempotency-key'], attemptId) + } }) -test('after a lost product receipt the same renewal prepares the same command and reads back one effect', async () => { +if (medicalOpenApi) { + test('the generated client refuses a receipt that names the exact record without the required revision', async () => { + const { handle, calls } = setup(prepareRenewal, { omitReceiptRevision: true }) + const response = await handle(request()) + assert.equal(response.status, 502) + assert.deepEqual(await response.json(), { + code: 'holder-action.outcome-unresolved', message: 'The Action outcome is unconfirmed. Keep the original attempt.', + }) + assert.equal(calls.length, 1) + }) +} + +test('after a lost product receipt the renewed holder credential reuses the same command and reads back one effect', async () => { const { handle, calls, preparations, writes } = setup(prepareRenewal, { loseFirstReceipt: true }) const first = await handle(request()) assert.equal(first.status, 502) assert.doesNotMatch(await first.text(), /Simulated/u) - const retry = await handle(request()) + const retry = await handle(request({ authorization: 'Bearer synthetic-holder-renewed' })) assert.equal(retry.status, 200) assert.deepEqual(await retry.json(), { recordId: licenceId }) assert.equal(calls.length, 2) - assert.deepEqual(calls[0], calls[1]) + const [firstCall, secondCall] = calls + assert.ok(firstCall && secondCall) + assert.equal(firstCall.headers.authorization, holderAuthorization) + assert.deepEqual(secondCall, { ...firstCall, headers: { ...firstCall.headers, authorization: 'Bearer synthetic-holder-renewed' } }) assert.deepEqual(preparations, [[{ reviewedExpiresOn }], [{ reviewedExpiresOn }]]) assert.deepEqual(writes, [licenceId]) }) + +test('a spent key leaves the original attempt unresolved without dispatching with a new key', async () => { + for (const [status, replayProblem] of [[409, 'idempotency.key-reused'], [410, 'idempotency.expired']] as const) { + const { handle, calls, writes } = setup(prepareRenewal, { loseFirstReceipt: true, replayProblem }) + const first = await handle(request()) + assert.equal(first.status, 502) + const retry = await handle(request({ authorization: 'Bearer synthetic-holder-renewed' })) + assert.equal(retry.status, status) + assert.deepEqual(await retry.json(), { + code: 'holder-action.outcome-unresolved', message: 'The Action outcome is unconfirmed. Keep the original attempt.', + }) + assert.deepEqual(calls.map(call => call.headers['idempotency-key']), [attemptId, attemptId]) + assert.deepEqual(writes, [licenceId]) + } +}) + +test('an ordinary product conflict keeps its refusal response', async () => { + const { handle, writes } = setup(prepareRenewal, { replayProblem: 'mutation.conflict' }) + assert.equal((await handle(request())).status, 200) + const conflict = await handle(request()) + assert.equal(conflict.status, 409) + assert.deepEqual(await conflict.json(), { message: 'BReg refused the request.' }) + assert.deepEqual(writes, [licenceId]) +}) + +test('a target submission needs a string UUID record and a strong condition', async () => { + for (const [name, parse] of [ + ['weak condition', (value: unknown) => ({ ...parseSubmission(value)!, ifMatch: 'W/"reviewed-revision"' })], + ['unquoted condition', (value: unknown) => ({ ...parseSubmission(value)!, ifMatch: 'reviewed-revision' })], + // A one-element array stringifies to a valid value, so only the type check refuses it. + ['array record', (value: unknown) => { + const parsed = parseSubmission(value)! + return { ...parsed, recordId: [parsed.recordId] as unknown as string } + }], + ['array condition', (value: unknown) => { + const parsed = parseSubmission(value)! + return { ...parsed, ifMatch: [parsed.ifMatch] as unknown as string } + }], + ] as const) { + const { handle, preparations, calls } = setup(prepareRenewal, { parse }) + assert.equal((await handle(request())).status, 400, name) + assert.deepEqual([preparations.length, calls.length], [0, 0], name) + } +}) diff --git a/clients/typescript/tests/package.test.ts b/clients/typescript/tests/package.test.ts index 390c4aa195..ed01c8d0e1 100644 --- a/clients/typescript/tests/package.test.ts +++ b/clients/typescript/tests/package.test.ts @@ -14,6 +14,9 @@ test('the browser package is publishable at the unified client release version', assert.equal(manifest.exports['.'].types, './dist/browser.d.ts') assert.equal(manifest.exports['.'].default, './dist/browser.js') assert.deepEqual(manifest.exports['./mcp'], { types: './dist/mcp.d.ts', default: './dist/mcp.js' }) + // A trusted host invokes a holder-authorized Action through this binding. + assert.deepEqual(manifest.exports['./holder-function'], + { types: './dist/holder-function.d.ts', default: './dist/holder-function.js' }) assert.equal(manifest.license, 'Apache-2.0') const binaries = { 'registry-generate': './registry-generate.js', 'registry-preview': './preview/cli.mjs' } assert.deepEqual(manifest.bin, binaries) @@ -28,3 +31,11 @@ test('the browser package is publishable at the unified client release version', } assert.deepEqual(manifest.files, ['dist', 'registry-generate.js', 'preview/*.mjs', 'LICENSE']) }) + +test('the package builds and exports the holder binding source', async () => { + // CI runs the tests before the build, so check the source the export is built from. + const build = JSON.parse(readFileSync(new URL('../tsconfig.browser.json', import.meta.url), 'utf8')) + assert.ok(build.include.includes('holder-function.ts')) + const { createHolderActionHandler } = await import('../holder-function.ts') + assert.equal(typeof createHolderActionHandler, 'function') +}) diff --git a/clients/typescript/tsconfig.browser.json b/clients/typescript/tsconfig.browser.json index 2d68615e35..d858b90af0 100644 --- a/clients/typescript/tsconfig.browser.json +++ b/clients/typescript/tsconfig.browser.json @@ -8,5 +8,5 @@ "outDir": "dist", "declaration": true }, - "include": ["browser.ts", "core.ts", "mcp.ts", "webhook.ts", "schema.ts", "generated/**/*.ts"] + "include": ["browser.ts", "core.ts", "holder-function.ts", "mcp.ts", "webhook.ts", "schema.ts", "generated/**/*.ts"] } diff --git a/products/platform/CHANGELOG.md b/products/platform/CHANGELOG.md index 3e69b876ca..ff8c6b250d 100644 --- a/products/platform/CHANGELOG.md +++ b/products/platform/CHANGELOG.md @@ -4,6 +4,7 @@ - `rstack dev check` refuses incompatible owner reports and mismatched identity facts. For Messaging it also checks the staged package, runtime input and tool around facts generation. +- Add `@registrystack/client/holder-function`, a pre-1.0 subpath export of the existing `@registrystack/client` package with no new package name. A trusted host uses `createHolderActionHandler` to invoke one generated BReg Action for a signed-in person, with a declared function that only prepares the input. The function receives one projected value and a signal, never the Request, the bearer or a product client, and runs in the host's process, so the binding minimises arguments for trusted, reviewed code and does not isolate it. - BREAKING: `dev.yaml` declares its products with the same mapping as `service.yaml`, and `rstack dev` refuses the list form with `rstack.dev.products-list`. Migration: replace each `- {product: KIND, project: PATH, audience: AUDIENCE}` entry with `products.KIND.projects.KIND.path: PATH` for `breg`, `coordinator` and `evidence`, or `products.KIND.path: PATH` for the other products, and move the audience to `audiences.KIND: AUDIENCE`. A directory has one inventory: when its `service.yaml` declares `products`, keep only `audiences` in `dev.yaml`. `service.yaml` also accepts `adapter`, `discovery`, `documents`, `render` and `scheduling` projects. - The file secret provider accepts `mountPolicy: compose-native`, an explicit production setting that also admits a root-owned, single-link regular file From 29510822d8198674905bc627c9755b7bd5e5387c Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 34/55] test: fix the dev runtime checks hosted CI found Folds these reviewed commits: - test(journeys): parenthesize the Documents sink headers for jq 1.7 - test(adapter): give signed-event fixtures a bare origin - test(platform): hold CA bundles to the public-document read - test(casework): bind the backup proof to the current starter issuer - test(adapter): drop the loopback range from the Postgres source fixture Signed-off-by: Jeremi Joslin --- crates/registry-adapter-job/tests/job_file_host.rs | 2 +- .../registry-adapter-job/tests/postgres_source_host.rs | 4 ++-- crates/registry-adapter-job/tests/posture.rs | 2 +- crates/registry-adapter-job/tests/sftp_cli_host.rs | 2 +- .../tests/job_provision_postgres.rs | 5 ++++- crates/registry-casework/tests/secret_diagnostics.rs | 10 ++++++---- products/casework/scripts/test-backup-restore.sh | 2 +- products/platform/journeys/test_journey_tables.py | 4 ++-- 8 files changed, 18 insertions(+), 13 deletions(-) diff --git a/crates/registry-adapter-job/tests/job_file_host.rs b/crates/registry-adapter-job/tests/job_file_host.rs index 468abcef49..3e0e3d29e2 100644 --- a/crates/registry-adapter-job/tests/job_file_host.rs +++ b/crates/registry-adapter-job/tests/job_file_host.rs @@ -200,7 +200,7 @@ fn runtime_json(source: &Path, component: &str) -> String { }, "destinations": {"coordinator-test": { "type": "signed-coordinator-event", - "baseUrl": "http://127.0.0.1:9/events", + "baseUrl": "http://127.0.0.1:9", "hmacSha256KeyRef": "secret:env/JOB_TEST_SIGNING_KEY", "attemptTimeoutMilliseconds": 1000 }} diff --git a/crates/registry-adapter-job/tests/postgres_source_host.rs b/crates/registry-adapter-job/tests/postgres_source_host.rs index a400ea2a54..d2b672cf27 100644 --- a/crates/registry-adapter-job/tests/postgres_source_host.rs +++ b/crates/registry-adapter-job/tests/postgres_source_host.rs @@ -820,7 +820,7 @@ fn runtime_yaml(binding: &DatabaseBinding, query_kind: SourceQuery) -> String { "id": "ledger-job-test", "endpoints": [], "sources": {"postgres": postgres_sources}, - "allowedPrivateCidrs": ["127.0.0.0/8"], + "allowedPrivateCidrs": [], "store": { "runtimeUrlRef": "secret:env/JOB_TEST_DB", "transport": "loopback-plaintext" @@ -828,7 +828,7 @@ fn runtime_yaml(binding: &DatabaseBinding, query_kind: SourceQuery) -> String { "destinations": { "coordinator-test": { "type": "signed-coordinator-event", - "baseUrl": "http://127.0.0.1:9/events", + "baseUrl": "http://127.0.0.1:9", "hmacSha256KeyRef": "secret:env/JOB_TEST_SIGNING_KEY", "attemptTimeoutMilliseconds": 1000 } diff --git a/crates/registry-adapter-job/tests/posture.rs b/crates/registry-adapter-job/tests/posture.rs index 0e93d2a3d5..56cbfc8bf2 100644 --- a/crates/registry-adapter-job/tests/posture.rs +++ b/crates/registry-adapter-job/tests/posture.rs @@ -130,7 +130,7 @@ fn job_check_enforces_and_lists_the_posture() { .unwrap() .join("runtime.yaml"); let yaml = std::fs::read_to_string(base.join("job-runtime.yaml")).unwrap(); - let destination = "\ndestinations:\n coordinator-test:\n type: signed-coordinator-event\n baseUrl: http://127.0.0.1:9/events\n hmacSha256KeyRef: secret:env/JOB_EVENT_KEY\n attemptTimeoutMilliseconds: 1000\n"; + let destination = "\ndestinations:\n coordinator-test:\n type: signed-coordinator-event\n baseUrl: http://127.0.0.1:9\n hmacSha256KeyRef: secret:env/JOB_EVENT_KEY\n attemptTimeoutMilliseconds: 1000\n"; let run = |flag: Option<&str>, environment: Option<&str>| { let mut command = Command::new(env!("CARGO_BIN_EXE_adapter-job")); command diff --git a/crates/registry-adapter-job/tests/sftp_cli_host.rs b/crates/registry-adapter-job/tests/sftp_cli_host.rs index 35605401cd..4bb1bc04eb 100644 --- a/crates/registry-adapter-job/tests/sftp_cli_host.rs +++ b/crates/registry-adapter-job/tests/sftp_cli_host.rs @@ -189,7 +189,7 @@ fn runtime_json(server: &SftpSourceServer) -> Vec { }, "destinations": {"coordinator-test": { "type": "signed-coordinator-event", - "baseUrl": "http://127.0.0.1:9/events", + "baseUrl": "http://127.0.0.1:9", "hmacSha256KeyRef": "secret:env/JOB_TEST_SIGNING_KEY", "attemptTimeoutMilliseconds": 1000 }} diff --git a/crates/registry-adapterctl/tests/job_provision_postgres.rs b/crates/registry-adapterctl/tests/job_provision_postgres.rs index 6fb0afa58d..732fb08edc 100644 --- a/crates/registry-adapterctl/tests/job_provision_postgres.rs +++ b/crates/registry-adapterctl/tests/job_provision_postgres.rs @@ -160,7 +160,6 @@ async fn provision_then_initialize_and_run_with_split_roles() { for (member, name) in [ ("runtimeUrlRef", "runtime-url"), ("migrationUrlRef", "migration-url"), - ("caBundleRef", "ca.pem"), ] { let secret = secrets.join(name); std::fs::set_permissions(&secret, std::fs::Permissions::from_mode(0o644)).unwrap(); @@ -207,8 +206,12 @@ async fn provision_then_initialize_and_run_with_split_roles() { "the failed initialization committed part of the schema" ); + // A CA bundle is a public document: a world-readable one is read. + let ca_file = secrets.join("ca.pem"); + std::fs::set_permissions(&ca_file, std::fs::Permissions::from_mode(0o644)).unwrap(); let (first, second) = tokio::join!(run(job.clone(), init_args()), run(job.clone(), init_args())); + std::fs::set_permissions(&ca_file, std::fs::Permissions::from_mode(0o600)).unwrap(); assert_eq!(first["ok"], true); assert_eq!(second["ok"], true); diff --git a/crates/registry-casework/tests/secret_diagnostics.rs b/crates/registry-casework/tests/secret_diagnostics.rs index b349505db4..1f75d4e080 100644 --- a/crates/registry-casework/tests/secret_diagnostics.rs +++ b/crates/registry-casework/tests/secret_diagnostics.rs @@ -110,7 +110,7 @@ mod unix { } #[test] - fn a_group_readable_trusted_root_reference_is_refused_without_the_reference() { + fn a_group_readable_trusted_root_is_read_as_a_public_document() { let root = tempfile::tempdir().expect("temporary secret root"); write_secret(root.path(), "casework-database-url", DATABASE_URL, 0o600); write_secret( @@ -124,16 +124,18 @@ mod unix { config.ca_bundle_ref = Some("secret:file/database-root.pem".to_owned()); let error = PostgresStore::connect_runtime(&config, &secrets, None) - .expect_err("a group-readable certificate file is refused"); + .expect_err("the truncated certificate holds no trusted root"); + // A CA bundle is public: the mode rule does not apply, and the + // refusal comes from the certificate content instead. let message = error.to_string(); assert!( !message.contains("secret:file/database-root.pem"), "the failure repeats the certificate reference: {message}" ); assert!( - message.contains("0400 or 0600"), - "the failure does not name the mode rule: {message}" + !message.contains("0400 or 0600"), + "a public CA bundle was held to the secret mode rule: {message}" ); } } diff --git a/products/casework/scripts/test-backup-restore.sh b/products/casework/scripts/test-backup-restore.sh index edc73baf25..1483269933 100755 --- a/products/casework/scripts/test-backup-restore.sh +++ b/products/casework/scripts/test-backup-restore.sh @@ -204,7 +204,7 @@ from pathlib import Path import sys path = Path(sys.argv[1]) text = path.read_text() -for before, after in (("issuer: http://127.0.0.1:8093", f"issuer: {sys.argv[2]}"), +for before, after in (("issuer: https://identity.casework.example.test", f"issuer: {sys.argv[2]}"), ("subject: b75315b2-5854-70f3-8867-511dd771a6da", "subject: requester")): assert text.count(before) == 1, before text = text.replace(before, after) diff --git a/products/platform/journeys/test_journey_tables.py b/products/platform/journeys/test_journey_tables.py index dcbb284427..205ed2ad4c 100644 --- a/products/platform/journeys/test_journey_tables.py +++ b/products/platform/journeys/test_journey_tables.py @@ -1294,11 +1294,11 @@ def walk(self, product, delivered): type: "document-version-ready", data: {documentId: "retained-id", versionId: (if $mode == "other-version" then "other" else "version-id" end), versionDigest: $digest, policyId: "institutional-custody", policyVersion: "1"}} as $event | - [{body: ($event | tojson), headers: [ + [{body: ($event | tojson), headers: ([ {name: "webhook-id", value: "evt-1"}, {name: "webhook-timestamp", value: "1"}, {name: "webhook-signature", value: "v1,fixture"} - ] + (if $mode == "forwarded-auth" then [{name: "authorization", value: "fixture"}] else [] end)}]' + ] + (if $mode == "forwarded-auth" then [{name: "authorization", value: "fixture"}] else [] end))}]' return fi case "$delivered" in From 502d7f95205813fe81fc7f6222ba135211adc346 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 35/55] fix(contracts): declare development refusal diagnostics and reject malformed problem codes Folds these reviewed commits: - test(client): validate task response fixtures against OpenAPI [skip ci] - fix(contracts): declare development refusal diagnostics - fix(docs): enforce retired Evidence and Casework terminology - fix(identifiers): reject malformed exported problem codes Signed-off-by: Jeremi Joslin --- clients/typescript/generated/breg-facility.ts | 10 +- clients/typescript/generated/breg-minimal.ts | 10 +- clients/typescript/generated/casework.ts | 10 +- clients/typescript/generated/documents.ts | 10 +- .../typescript/generated/evidence-oid4vci.ts | 10 +- .../typescript/generated/evidence-oid4vp.ts | 14 +- clients/typescript/generated/evidence.ts | 10 +- clients/typescript/generated/messaging.ts | 10 +- clients/typescript/generated/render.ts | 10 +- clients/typescript/generated/scheduling.ts | 10 +- clients/typescript/package-lock.json | 78 +++++++ clients/typescript/package.json | 2 + clients/typescript/tests/acceptance.test.ts | 7 +- .../tasks/proposal-application-refused.json | 17 +- .../fixtures/tasks/proposal-applied.json | 15 +- .../fixtures/tasks/proposal-approved.json | 15 +- .../fixtures/tasks/proposal-cancelled.json | 15 +- .../tasks/proposal-draft-attached.json | 19 +- .../tasks/proposal-draft-no-input.json | 15 +- .../tasks/proposal-draft-optional.json | 17 +- .../tests/fixtures/tasks/proposal-draft.json | 17 +- .../fixtures/tasks/proposal-list-last.json | 15 +- .../tests/fixtures/tasks/proposal-list.json | 36 ++-- .../tasks/proposal-package-changed.json | 17 +- .../fixtures/tasks/proposal-rejected.json | 15 +- .../fixtures/tasks/proposal-sent-back.json | 19 +- .../tasks/proposal-submitted-stale.json | 17 +- .../fixtures/tasks/proposal-submitted.json | 17 +- .../typescript/tests/tasks-proposals.test.ts | 200 ++++++++++-------- .../tests/tasks-response-contracts.test.ts | 57 +++++ .../typescript/tests/tasks-screens.test.ts | 2 +- .../src/govstack/consultation/openapi.rs | 25 +++ crates/registry-breg/src/artifacts.rs | 3 +- .../tests/artifacts_response_schema_tests.rs | 5 + crates/registry-coordinator/src/http.rs | 2 +- crates/registry-documents/src/schema.rs | 3 +- .../src/contracts.rs | 3 +- .../registry-evidence-oid4vci/src/draft13.rs | 3 +- .../registry-evidence-oid4vci/src/service.rs | 11 +- .../registry-evidence-oid4vp/src/contracts.rs | 8 +- crates/registry-evidence/src/contracts.rs | 27 ++- crates/registry-messaging/src/schema.rs | 3 +- .../check-stale-config-vocabulary.baseline | 13 +- .../scripts/check-stale-config-vocabulary.sh | 21 +- .../check-stale-config-vocabulary.test.mjs | 22 +- .../operate/advanced/upgrade-and-retire.mdx | 6 +- docs/site/src/data/projects.yaml | 2 +- .../breg-govstack/generated/openapi.json | 4 + .../dhis2-consultation/generated/openapi.json | 4 + .../generated/openapi.json | 4 + .../examples/required-attachment/openapi.json | 2 +- .../generated/facility/generated/openapi.json | 2 +- .../generated/minimal/generated/openapi.json | 2 +- .../generated/registry-casework.openapi.json | 4 + products/casework/scripts/generate_openapi.py | 5 +- .../casework/scripts/test_generate_openapi.py | 15 ++ .../openapi/coordinator.openapi.json | 4 + .../generated/registry-documents.openapi.json | 4 + .../evidence/generated/problem-v1.schema.json | 4 + .../registry-evidence-oid4vci.openapi.json | 8 + .../registry-evidence-oid4vp.openapi.json | 8 + .../generated/registry-evidence.openapi.json | 4 + products/identifiers/scripts/generate.py | 27 ++- products/identifiers/scripts/test_generate.py | 37 ++++ .../generated/registry-messaging.openapi.json | 4 + .../generated/registry-render.openapi.json | 1 + .../registry-scheduling.openapi.json | 4 + .../scheduling/scripts/generate_openapi.py | 4 + .../scripts/test_generate_openapi.py | 5 +- 69 files changed, 709 insertions(+), 320 deletions(-) create mode 100644 clients/typescript/tests/tasks-response-contracts.test.ts diff --git a/clients/typescript/generated/breg-facility.ts b/clients/typescript/generated/breg-facility.ts index a28c0de235..76ce4edc69 100644 --- a/clients/typescript/generated/breg-facility.ts +++ b/clients/typescript/generated/breg-facility.ts @@ -1,5 +1,5 @@ -// Generated for Stack version 0.51.0, client version 0.51.0. -// Source SHA-256 94a82325cbe2563c5296e8619a338f596d553a6698d7cad7bcf3d4c68fc5c65d +// Generated for Stack version 0.50.0, client version 0.50.0. +// Source SHA-256 6485fa087e38e5eb1ae48b534c45883ee2ed231b4c62c8a8f6004ebfb5b300e7 // Unconstrained JSON /paths/~1v1~1records~1directory-entries~1{record_id}/patch/requestBody/content/application~1json-patch+json/schema/items/properties/value // Unconstrained JSON /paths/~1v1~1records~1operators~1{record_id}/patch/requestBody/content/application~1json-patch+json/schema/items/properties/value import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" @@ -10,7 +10,7 @@ import { listPage, listQuery, type FieldValue, type Filter, type ListPage, type export type Schema_ImmediateActionPrecondition = ({ "ifMatch": (string) }) export type Schema_ImmediateActionResultReference = ({ "recordId": (string); "recordType": (string); "revision": (number) }) -export type Schema_Problem = (({ "code"?: "access-profile.ambiguous"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous" }) | ({ "code"?: "action.evidence-failed"; "status"?: 503; "type"?: "https://id.registrystack.org/problems/registry-breg/action/evidence-failed" }) | ({ "code"?: "action.guard-failed"; "status"?: 412; "type"?: "https://id.registrystack.org/problems/registry-breg/action/guard-failed" }) | ({ "code"?: "action.handler-failed"; "status"?: 500; "type"?: "https://id.registrystack.org/problems/registry-breg/action/handler-failed" }) | ({ "code"?: "action.refused"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/action/refused" }) | ({ "code"?: "attachment.content-type"; "status"?: 415; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/content-type" }) | ({ "code"?: "attachment.digest-mismatch"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch" }) | ({ "code"?: "attachment.limit-reached"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/limit-reached" }) | ({ "code"?: "attachment.required"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/required" }) | ({ "code"?: "attachment.slot-write-once"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once" }) | ({ "code"?: "attachment.too-large"; "status"?: 413; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/too-large" }) | ({ "code"?: "attachment.verification-pending"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/verification-pending" }) | ({ "code"?: "attachment.verification-rejected"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected" }) | ({ "code"?: "authentication.refused"; "status"?: 401; "type"?: "https://id.registrystack.org/problems/registry-breg/authentication/refused" }) | ({ "code"?: "idempotency.expired"; "status"?: 410; "type"?: "https://id.registrystack.org/problems/registry-breg/idempotency/expired" }) | ({ "code"?: "idempotency.key-reused"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/idempotency/key-reused" }) | ({ "code"?: "ingestion.chunk-mismatch"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch" }) | ({ "code"?: "ingestion.profile-mismatch"; "status"?: 403; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch" }) | ({ "code"?: "ingestion.receipt-erased"; "status"?: 410; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased" }) | ({ "code"?: "ingestion.run-blocked"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked" }) | ({ "code"?: "ingestion.run-not-open"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open" }) | ({ "code"?: "lookup.unresolved"; "status"?: 404; "type"?: "https://id.registrystack.org/problems/registry-breg/lookup/unresolved" }) | ({ "code"?: "mutation.conflict"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/mutation/conflict" }) | ({ "code"?: "precondition.failed"; "status"?: 412; "type"?: "https://id.registrystack.org/problems/registry-breg/precondition/failed" }) | ({ "code"?: "precondition.required"; "status"?: 428; "type"?: "https://id.registrystack.org/problems/registry-breg/precondition/required" }) | ({ "code"?: "profile.not-authorized"; "status"?: 403; "type"?: "https://id.registrystack.org/problems/registry-breg/profile/not-authorized" }) | ({ "code"?: "proposal.rejected"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/proposal/rejected" }) | ({ "code"?: "proposal.review-result-mismatch"; "status"?: 412; "type"?: "https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch" }) | ({ "code"?: "proposal.submission-expired"; "status"?: 410; "type"?: "https://id.registrystack.org/problems/registry-breg/proposal/submission-expired" }) | ({ "code"?: "query.cursor-invalid"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/query/cursor-invalid" }) | ({ "code"?: "query.filter-required"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/query/filter-required" }) | ({ "code"?: "query.invalid"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/query/invalid" }) | ({ "code"?: "request.access-reason-required"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/request/access-reason-required" }) | ({ "code"?: "request.invalid"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/request/invalid" }) | ({ "code"?: "request.timeout"; "status"?: 504; "type"?: "https://id.registrystack.org/problems/registry-breg/request/timeout" }) | ({ "code"?: "resource.not-found"; "status"?: 404; "type"?: "https://id.registrystack.org/problems/registry-breg/resource/not-found" }) | ({ "code"?: "runtime.field-encryption.unavailable"; "status"?: 503; "type"?: "https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable" }) | ({ "code"?: "service.unavailable"; "status"?: 503; "type"?: "https://id.registrystack.org/problems/registry-breg/service/unavailable" }) | ({ "code"?: "source.unavailable"; "status"?: 503; "type"?: "https://id.registrystack.org/problems/registry-breg/source/unavailable" }) | ({ "code"?: "statistical-dataset.domain-violation"; "status"?: 500; "type"?: "https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation" }) | ({ "code"?: "statistical-dataset.release-refused"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused" }) | ({ "code"?: "statistical-dataset.version-conflict"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict" }) | ({ "code"?: "statistical-dataset.version-withdrawn"; "status"?: 410; "type"?: "https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn" }) | ({ "code"?: "unsupported.media-type"; "status"?: 415; "type"?: "https://id.registrystack.org/problems/registry-breg/unsupported/media-type" }) | ({ "code"?: "write.outside-boundary"; "status"?: 403; "type"?: "https://id.registrystack.org/problems/registry-breg/write/outside-boundary" })) & ({ "accessProfiles"?: (Array<(string)>); "atField"?: (string); "code": ("access-profile.ambiguous" | "action.evidence-failed" | "action.guard-failed" | "action.handler-failed" | "action.refused" | "attachment.content-type" | "attachment.digest-mismatch" | "attachment.limit-reached" | "attachment.required" | "attachment.slot-write-once" | "attachment.too-large" | "attachment.verification-pending" | "attachment.verification-rejected" | "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" | "profile.not-authorized" | "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") & (string); "constraintId"?: (string); "constraintKind"?: ("compare" | "int-range" | "vocabulary") & (string); "detail": (string); "field"?: (string); "fieldId"?: (string); "fieldPath"?: (string); "guardReason"?: (string); "left"?: (string); "notAfterField"?: (string); "reasonCode"?: ("computation-error" | "source-data-error" | "disclosure-risk") & (string); "recordType"?: (string); "refusalCode"?: (string); "requiredFilters"?: (Array<(Array<(string)>)>); "right"?: (string); "status": (number); "title": (string); "traceId": (string); "type": (string) }) & (({ "code": "access-profile.ambiguous" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & ({ "status"?: 400; "accessProfiles": {} | null })) | ({ "code": "action.evidence-failed" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never } & ({ "detail"?: "The declared Evidence dependency could not be accepted."; "fieldPath"?: (string); "status"?: 503 })) | ({ "code": "action.guard-failed" } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "action.handler-failed" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never } & ({ "status"?: 500 })) | ({ "code": "action.refused" } & { "guardReason"?: never } & ({ "status"?: 422; "refusalCode": {} | null }) & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.content-type" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.digest-mismatch" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.limit-reached" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.required" } & ({ "fieldPath": (string) }) & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.slot-write-once" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.too-large" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.verification-pending" } & ({ "fieldPath": (string) }) & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.verification-rejected" } & ({ "fieldPath": (string) }) & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "authentication.refused" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "idempotency.expired" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "idempotency.key-reused" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.chunk-mismatch" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.profile-mismatch" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.receipt-erased" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.run-blocked" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.run-not-open" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "lookup.unresolved" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "mutation.conflict" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "precondition.failed" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "precondition.required" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "profile.not-authorized" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "proposal.rejected" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "proposal.review-result-mismatch" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "proposal.submission-expired" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "query.cursor-invalid" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "query.filter-required" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "query.invalid" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "request.access-reason-required" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "request.invalid" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "request.timeout" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "resource.not-found" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "runtime.field-encryption.unavailable" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "service.unavailable" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "source.unavailable" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "statistical-dataset.domain-violation" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "statistical-dataset.release-refused" } & { "guardReason"?: never } & ({ "refusalCode": ("period-not-ended" | "before-first-period" | "provisional-after-final" | "already-withdrawn" | "negative-value"); "status"?: 422 }) & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "statistical-dataset.version-conflict" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "statistical-dataset.version-withdrawn" } & { "guardReason"?: never } & { "refusalCode"?: never } & ({ "status"?: 410; "reasonCode": {} | null }) & { "accessProfiles"?: never }) | ({ "code": "unsupported.media-type" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "write.outside-boundary" } & ({ "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"; "type"?: "https://id.registrystack.org/problems/registry-breg/write/outside-boundary" }) & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never })) +export type Schema_Problem = (({ "code"?: "access-profile.ambiguous"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous" }) | ({ "code"?: "action.evidence-failed"; "status"?: 503; "type"?: "https://id.registrystack.org/problems/registry-breg/action/evidence-failed" }) | ({ "code"?: "action.guard-failed"; "status"?: 412; "type"?: "https://id.registrystack.org/problems/registry-breg/action/guard-failed" }) | ({ "code"?: "action.handler-failed"; "status"?: 500; "type"?: "https://id.registrystack.org/problems/registry-breg/action/handler-failed" }) | ({ "code"?: "action.refused"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/action/refused" }) | ({ "code"?: "attachment.content-type"; "status"?: 415; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/content-type" }) | ({ "code"?: "attachment.digest-mismatch"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch" }) | ({ "code"?: "attachment.limit-reached"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/limit-reached" }) | ({ "code"?: "attachment.required"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/required" }) | ({ "code"?: "attachment.slot-write-once"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once" }) | ({ "code"?: "attachment.too-large"; "status"?: 413; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/too-large" }) | ({ "code"?: "attachment.verification-pending"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/verification-pending" }) | ({ "code"?: "attachment.verification-rejected"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected" }) | ({ "code"?: "authentication.refused"; "status"?: 401; "type"?: "https://id.registrystack.org/problems/registry-breg/authentication/refused" }) | ({ "code"?: "idempotency.expired"; "status"?: 410; "type"?: "https://id.registrystack.org/problems/registry-breg/idempotency/expired" }) | ({ "code"?: "idempotency.key-reused"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/idempotency/key-reused" }) | ({ "code"?: "ingestion.chunk-mismatch"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch" }) | ({ "code"?: "ingestion.profile-mismatch"; "status"?: 403; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch" }) | ({ "code"?: "ingestion.receipt-erased"; "status"?: 410; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased" }) | ({ "code"?: "ingestion.run-blocked"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked" }) | ({ "code"?: "ingestion.run-not-open"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open" }) | ({ "code"?: "lookup.unresolved"; "status"?: 404; "type"?: "https://id.registrystack.org/problems/registry-breg/lookup/unresolved" }) | ({ "code"?: "mutation.conflict"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/mutation/conflict" }) | ({ "code"?: "precondition.failed"; "status"?: 412; "type"?: "https://id.registrystack.org/problems/registry-breg/precondition/failed" }) | ({ "code"?: "precondition.required"; "status"?: 428; "type"?: "https://id.registrystack.org/problems/registry-breg/precondition/required" }) | ({ "code"?: "profile.not-authorized"; "status"?: 403; "type"?: "https://id.registrystack.org/problems/registry-breg/profile/not-authorized" }) | ({ "code"?: "proposal.rejected"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/proposal/rejected" }) | ({ "code"?: "proposal.review-result-mismatch"; "status"?: 412; "type"?: "https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch" }) | ({ "code"?: "proposal.submission-expired"; "status"?: 410; "type"?: "https://id.registrystack.org/problems/registry-breg/proposal/submission-expired" }) | ({ "code"?: "query.cursor-invalid"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/query/cursor-invalid" }) | ({ "code"?: "query.filter-required"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/query/filter-required" }) | ({ "code"?: "query.invalid"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/query/invalid" }) | ({ "code"?: "request.access-reason-required"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/request/access-reason-required" }) | ({ "code"?: "request.invalid"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/request/invalid" }) | ({ "code"?: "request.timeout"; "status"?: 504; "type"?: "https://id.registrystack.org/problems/registry-breg/request/timeout" }) | ({ "code"?: "resource.not-found"; "status"?: 404; "type"?: "https://id.registrystack.org/problems/registry-breg/resource/not-found" }) | ({ "code"?: "runtime.field-encryption.unavailable"; "status"?: 503; "type"?: "https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable" }) | ({ "code"?: "service.unavailable"; "status"?: 503; "type"?: "https://id.registrystack.org/problems/registry-breg/service/unavailable" }) | ({ "code"?: "source.unavailable"; "status"?: 503; "type"?: "https://id.registrystack.org/problems/registry-breg/source/unavailable" }) | ({ "code"?: "statistical-dataset.domain-violation"; "status"?: 500; "type"?: "https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation" }) | ({ "code"?: "statistical-dataset.release-refused"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused" }) | ({ "code"?: "statistical-dataset.version-conflict"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict" }) | ({ "code"?: "statistical-dataset.version-withdrawn"; "status"?: 410; "type"?: "https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn" }) | ({ "code"?: "unsupported.media-type"; "status"?: 415; "type"?: "https://id.registrystack.org/problems/registry-breg/unsupported/media-type" }) | ({ "code"?: "write.outside-boundary"; "status"?: 403; "type"?: "https://id.registrystack.org/problems/registry-breg/write/outside-boundary" })) & ({ "accessProfiles"?: (Array<(string)>); "atField"?: (string); "code": ("access-profile.ambiguous" | "action.evidence-failed" | "action.guard-failed" | "action.handler-failed" | "action.refused" | "attachment.content-type" | "attachment.digest-mismatch" | "attachment.limit-reached" | "attachment.required" | "attachment.slot-write-once" | "attachment.too-large" | "attachment.verification-pending" | "attachment.verification-rejected" | "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" | "profile.not-authorized" | "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") & (string); "constraintId"?: (string); "constraintKind"?: ("compare" | "int-range" | "vocabulary") & (string); "detail": (string); "failedCheck"?: (string); "field"?: (string); "fieldId"?: (string); "fieldPath"?: (string); "guardReason"?: (string); "left"?: (string); "notAfterField"?: (string); "reasonCode"?: ("computation-error" | "source-data-error" | "disclosure-risk") & (string); "recordType"?: (string); "refusalCode"?: (string); "requiredFilters"?: (Array<(Array<(string)>)>); "right"?: (string); "status": (number); "title": (string); "traceId": (string); "type": (string) }) & (({ "code": "access-profile.ambiguous" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & ({ "status"?: 400; "accessProfiles": {} | null })) | ({ "code": "action.evidence-failed" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never } & ({ "detail"?: "The declared Evidence dependency could not be accepted."; "fieldPath"?: (string); "status"?: 503 })) | ({ "code": "action.guard-failed" } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "action.handler-failed" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never } & ({ "status"?: 500 })) | ({ "code": "action.refused" } & { "guardReason"?: never } & ({ "status"?: 422; "refusalCode": {} | null }) & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.content-type" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.digest-mismatch" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.limit-reached" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.required" } & ({ "fieldPath": (string) }) & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.slot-write-once" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.too-large" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.verification-pending" } & ({ "fieldPath": (string) }) & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.verification-rejected" } & ({ "fieldPath": (string) }) & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "authentication.refused" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "idempotency.expired" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "idempotency.key-reused" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.chunk-mismatch" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.profile-mismatch" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.receipt-erased" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.run-blocked" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.run-not-open" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "lookup.unresolved" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "mutation.conflict" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "precondition.failed" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "precondition.required" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "profile.not-authorized" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "proposal.rejected" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "proposal.review-result-mismatch" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "proposal.submission-expired" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "query.cursor-invalid" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "query.filter-required" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "query.invalid" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "request.access-reason-required" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "request.invalid" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "request.timeout" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "resource.not-found" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "runtime.field-encryption.unavailable" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "service.unavailable" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "source.unavailable" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "statistical-dataset.domain-violation" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "statistical-dataset.release-refused" } & { "guardReason"?: never } & ({ "refusalCode": ("period-not-ended" | "before-first-period" | "provisional-after-final" | "already-withdrawn" | "negative-value"); "status"?: 422 }) & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "statistical-dataset.version-conflict" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "statistical-dataset.version-withdrawn" } & { "guardReason"?: never } & { "refusalCode"?: never } & ({ "status"?: 410; "reasonCode": {} | null }) & { "accessProfiles"?: never }) | ({ "code": "unsupported.media-type" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "write.outside-boundary" } & ({ "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"; "type"?: "https://id.registrystack.org/problems/registry-breg/write/outside-boundary" }) & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never })) export type Schema_ReviewCompletion = ({ "completedAt": (string); "eventId": (string); "requestId": (string); "resultId": (string); "type": "review.completed" }) export type Schema_action_correct_address_invoke_input = ({ "input": ({ "addressLine"?: (string); "city"?: (string); "facilityId"?: (string); "postalCode"?: (string) }) }) export type Schema_action_correct_address_invoke_response = ({ "actionId": (string); "actionRevision": (string); "application"?: ({ "applicationId": (string); "effectDigest": (string); "resultLinks": (Array<({ "recordId": (string); "recordType": (string); "revision": (number) })>); "submissionVersion": (number) }); "applicationStatus"?: ({ "automaticRetry"?: ({ "attempts": (number); "maximumAttempts": (number); "scheduled": (boolean) }); "mode": ("automatic" | "manual"); "reason"?: ("package-changed" | "dependency-outage" | "lease-expired" | "application-refused" | "attempts-exhausted"); "recovery"?: ("retry" | "rebase" | "revise" | "correct-input"); "state": ("awaiting-review" | "pending" | "applying" | "blocked" | "applied" | "cancelled" | "rejected") }); "asks"?: (Array<({ "answer"?: ({ "additions": (Array<(string)>); "answeredAt": (string); "text"?: (string) }); "askedAt": (string); "dueAt"?: (string); "id": (string); "links": ({ "answer"?: ({ "accessProfile": (string); "availability": ({ "available": (boolean); "observedRevision": (number); "reason"?: ("pending-review" | "review-rejected" | "review-changes-requested" | "review-ended" | "stale-revision" | "package-changed" | "dependency-outage" | "invalid-input" | "already-applied" | "limit-reached" | "application-pending" | "attachment-required" | "attachment-pending" | "ask-answered" | "ask-closed" | "ask-due-passed"); "recovery"?: ("refresh" | "revise" | "retry" | "rebase" | "correct-input" | "receipt-only") }); "ifMatch": (string); "method": "POST"; "operation": "answer"; "path": (string) }) }); "state": ("open" | "answered" | "expired" | "closed"); "text": (string); "wants": (Array<({ "kind": ("answer" | "document") })>) })>); "attachments"?: (Record); "id": (string); "links": (Record); "maximumBytes": (number); "required": (boolean); "value"?: ({ "byteSize": (number); "contentType": (string); "sha256": (string); "submissionVersion": (number); "uploadedAt"?: (string); "verificationStatus": ("notRequired" | "pending" | "approved" | "rejected") }) })>); "blockedReason"?: ("package-changed"); "createdAt"?: (string); "decision"?: ({ "decidedAt": (string); "publicReason"?: (string); "status": ("approved" | "rejected" | "changes-requested" | "answered") }); "effectDigest"?: (string); "handoffRefusal"?: ({ "code": ("review.initiator-required" | "review.initiator-excluded" | "review.policy-mismatch" | "review.refused") }); "id": (string); "input"?: (Record); "links": (Record); "revision": (number); "state": ("draft" | "submitted" | "applied" | "cancelled" | "rejected"); "status"?: ("draft" | "awaiting-party" | "in-review" | "approved" | "processing" | "applied" | "rejected" | "cancelled"); "submissionVersion": (number); "title"?: (string); "turn": ("party" | "official" | "nobody") }) @@ -105,7 +105,7 @@ function recordRow(record: RecordEnvelope & { domainData: Data }): RecordR } const rules: Record = Object.fromEntries([ - ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"allOf\":[{\"if\":{\"properties\":{\"code\":{\"enum\":[\"attachment.required\",\"attachment.verification-pending\",\"attachment.verification-rejected\"]}}},\"then\":{\"allOf\":[{\"else\":{\"properties\":{\"status\":{\"const\":422}}},\"if\":{\"properties\":{\"code\":{\"const\":\"attachment.verification-pending\"}}},\"then\":{\"properties\":{\"status\":{\"const\":409}}}}],\"properties\":{\"fieldPath\":{\"pattern\":\"^/attachments/[a-z][a-z0-9_-]{0,63}$\",\"type\":\"string\"}},\"propertyNames\":{\"enum\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\",\"fieldPath\"]},\"required\":[\"fieldPath\"]}},{\"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\":\"access-profile.ambiguous\"}}},\"then\":{\"additionalProperties\":true,\"properties\":{\"status\":{\"const\":400}},\"required\":[\"accessProfiles\"]}},{\"if\":{\"properties\":{\"code\":{\"not\":{\"const\":\"access-profile.ambiguous\"}}}},\"then\":{\"not\":{\"required\":[\"accessProfiles\"]}}},{\"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\"]}}],\"anyOf\":[{\"properties\":{\"code\":{\"const\":\"access-profile.ambiguous\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous\"}}},{\"properties\":{\"code\":{\"const\":\"action.evidence-failed\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/evidence-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.guard-failed\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/guard-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.handler-failed\"},\"status\":{\"const\":500},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/handler-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.refused\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/refused\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.content-type\"},\"status\":{\"const\":415},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/content-type\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.digest-mismatch\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.limit-reached\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.required\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/required\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.slot-write-once\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.too-large\"},\"status\":{\"const\":413},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/too-large\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.verification-pending\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.verification-rejected\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected\"}}},{\"properties\":{\"code\":{\"const\":\"authentication.refused\"},\"status\":{\"const\":401},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/authentication/refused\"}}},{\"properties\":{\"code\":{\"const\":\"idempotency.expired\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/idempotency/expired\"}}},{\"properties\":{\"code\":{\"const\":\"idempotency.key-reused\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.chunk-mismatch\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.profile-mismatch\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.receipt-erased\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.run-blocked\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.run-not-open\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open\"}}},{\"properties\":{\"code\":{\"const\":\"lookup.unresolved\"},\"status\":{\"const\":404},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/lookup/unresolved\"}}},{\"properties\":{\"code\":{\"const\":\"mutation.conflict\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/mutation/conflict\"}}},{\"properties\":{\"code\":{\"const\":\"precondition.failed\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/precondition/failed\"}}},{\"properties\":{\"code\":{\"const\":\"precondition.required\"},\"status\":{\"const\":428},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/precondition/required\"}}},{\"properties\":{\"code\":{\"const\":\"profile.not-authorized\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/profile/not-authorized\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.rejected\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/rejected\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.review-result-mismatch\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.submission-expired\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired\"}}},{\"properties\":{\"code\":{\"const\":\"query.cursor-invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid\"}}},{\"properties\":{\"code\":{\"const\":\"query.filter-required\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/filter-required\"}}},{\"properties\":{\"code\":{\"const\":\"query.invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/invalid\"}}},{\"properties\":{\"code\":{\"const\":\"request.access-reason-required\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/access-reason-required\"}}},{\"properties\":{\"code\":{\"const\":\"request.invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/invalid\"}}},{\"properties\":{\"code\":{\"const\":\"request.timeout\"},\"status\":{\"const\":504},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/timeout\"}}},{\"properties\":{\"code\":{\"const\":\"resource.not-found\"},\"status\":{\"const\":404},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/resource/not-found\"}}},{\"properties\":{\"code\":{\"const\":\"runtime.field-encryption.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"service.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/service/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"source.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/source/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.domain-violation\"},\"status\":{\"const\":500},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.release-refused\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.version-conflict\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.version-withdrawn\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn\"}}},{\"properties\":{\"code\":{\"const\":\"unsupported.media-type\"},\"status\":{\"const\":415},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/unsupported/media-type\"}}},{\"properties\":{\"code\":{\"const\":\"write.outside-boundary\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/write/outside-boundary\"}}}],\"properties\":{\"accessProfiles\":{\"items\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"minItems\":2,\"type\":\"array\",\"uniqueItems\":true},\"atField\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"code\":{\"enum\":[\"access-profile.ambiguous\",\"action.evidence-failed\",\"action.guard-failed\",\"action.handler-failed\",\"action.refused\",\"attachment.content-type\",\"attachment.digest-mismatch\",\"attachment.limit-reached\",\"attachment.required\",\"attachment.slot-write-once\",\"attachment.too-large\",\"attachment.verification-pending\",\"attachment.verification-rejected\",\"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\",\"profile.not-authorized\",\"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\":{\"maxLength\":256,\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], + ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"allOf\":[{\"if\":{\"properties\":{\"code\":{\"enum\":[\"attachment.required\",\"attachment.verification-pending\",\"attachment.verification-rejected\"]}}},\"then\":{\"allOf\":[{\"else\":{\"properties\":{\"status\":{\"const\":422}}},\"if\":{\"properties\":{\"code\":{\"const\":\"attachment.verification-pending\"}}},\"then\":{\"properties\":{\"status\":{\"const\":409}}}}],\"properties\":{\"fieldPath\":{\"pattern\":\"^/attachments/[a-z][a-z0-9_-]{0,63}$\",\"type\":\"string\"}},\"propertyNames\":{\"enum\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\",\"fieldPath\"]},\"required\":[\"fieldPath\"]}},{\"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\",\"failedCheck\"]}}},{\"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\":\"access-profile.ambiguous\"}}},\"then\":{\"additionalProperties\":true,\"properties\":{\"status\":{\"const\":400}},\"required\":[\"accessProfiles\"]}},{\"if\":{\"properties\":{\"code\":{\"not\":{\"const\":\"access-profile.ambiguous\"}}}},\"then\":{\"not\":{\"required\":[\"accessProfiles\"]}}},{\"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\"]}}],\"anyOf\":[{\"properties\":{\"code\":{\"const\":\"access-profile.ambiguous\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous\"}}},{\"properties\":{\"code\":{\"const\":\"action.evidence-failed\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/evidence-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.guard-failed\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/guard-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.handler-failed\"},\"status\":{\"const\":500},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/handler-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.refused\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/refused\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.content-type\"},\"status\":{\"const\":415},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/content-type\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.digest-mismatch\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.limit-reached\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.required\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/required\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.slot-write-once\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.too-large\"},\"status\":{\"const\":413},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/too-large\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.verification-pending\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.verification-rejected\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected\"}}},{\"properties\":{\"code\":{\"const\":\"authentication.refused\"},\"status\":{\"const\":401},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/authentication/refused\"}}},{\"properties\":{\"code\":{\"const\":\"idempotency.expired\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/idempotency/expired\"}}},{\"properties\":{\"code\":{\"const\":\"idempotency.key-reused\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.chunk-mismatch\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.profile-mismatch\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.receipt-erased\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.run-blocked\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.run-not-open\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open\"}}},{\"properties\":{\"code\":{\"const\":\"lookup.unresolved\"},\"status\":{\"const\":404},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/lookup/unresolved\"}}},{\"properties\":{\"code\":{\"const\":\"mutation.conflict\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/mutation/conflict\"}}},{\"properties\":{\"code\":{\"const\":\"precondition.failed\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/precondition/failed\"}}},{\"properties\":{\"code\":{\"const\":\"precondition.required\"},\"status\":{\"const\":428},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/precondition/required\"}}},{\"properties\":{\"code\":{\"const\":\"profile.not-authorized\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/profile/not-authorized\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.rejected\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/rejected\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.review-result-mismatch\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.submission-expired\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired\"}}},{\"properties\":{\"code\":{\"const\":\"query.cursor-invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid\"}}},{\"properties\":{\"code\":{\"const\":\"query.filter-required\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/filter-required\"}}},{\"properties\":{\"code\":{\"const\":\"query.invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/invalid\"}}},{\"properties\":{\"code\":{\"const\":\"request.access-reason-required\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/access-reason-required\"}}},{\"properties\":{\"code\":{\"const\":\"request.invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/invalid\"}}},{\"properties\":{\"code\":{\"const\":\"request.timeout\"},\"status\":{\"const\":504},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/timeout\"}}},{\"properties\":{\"code\":{\"const\":\"resource.not-found\"},\"status\":{\"const\":404},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/resource/not-found\"}}},{\"properties\":{\"code\":{\"const\":\"runtime.field-encryption.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"service.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/service/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"source.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/source/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.domain-violation\"},\"status\":{\"const\":500},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.release-refused\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.version-conflict\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.version-withdrawn\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn\"}}},{\"properties\":{\"code\":{\"const\":\"unsupported.media-type\"},\"status\":{\"const\":415},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/unsupported/media-type\"}}},{\"properties\":{\"code\":{\"const\":\"write.outside-boundary\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/write/outside-boundary\"}}}],\"properties\":{\"accessProfiles\":{\"items\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"minItems\":2,\"type\":\"array\",\"uniqueItems\":true},\"atField\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"code\":{\"enum\":[\"access-profile.ambiguous\",\"action.evidence-failed\",\"action.guard-failed\",\"action.handler-failed\",\"action.refused\",\"attachment.content-type\",\"attachment.digest-mismatch\",\"attachment.limit-reached\",\"attachment.required\",\"attachment.slot-write-once\",\"attachment.too-large\",\"attachment.verification-pending\",\"attachment.verification-rejected\",\"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\",\"profile.not-authorized\",\"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\"},\"failedCheck\":{\"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\":{\"maxLength\":256,\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], ["/components/schemas/ReviewCompletion", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"completedAt\":{\"type\":\"string\"},\"eventId\":{\"type\":\"string\"},\"requestId\":{\"type\":\"string\"},\"resultId\":{\"type\":\"string\"},\"type\":{\"const\":\"review.completed\"}},\"required\":[\"type\",\"eventId\",\"requestId\",\"resultId\",\"completedAt\"],\"type\":\"object\"}")], ["/components/schemas/action-correct-address-invoke-input", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"input\":{\"additionalProperties\":false,\"properties\":{\"addressLine\":{\"maxLength\":240,\"minLength\":1,\"type\":\"string\"},\"city\":{\"maxLength\":120,\"minLength\":1,\"type\":\"string\"},\"facilityId\":{\"type\":\"string\"},\"postalCode\":{\"maxLength\":24,\"minLength\":1,\"type\":\"string\"}},\"required\":[],\"type\":\"object\"}},\"required\":[\"input\"],\"type\":\"object\"}")], ["/components/schemas/action-correct-address-invoke-response", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"actionId\":{\"type\":\"string\"},\"actionRevision\":{\"type\":\"string\"},\"application\":{\"additionalProperties\":false,\"properties\":{\"applicationId\":{\"type\":\"string\"},\"effectDigest\":{\"pattern\":\"^sha256:[0-9a-f]{64}$\",\"type\":\"string\"},\"resultLinks\":{\"items\":{\"additionalProperties\":false,\"properties\":{\"recordId\":{\"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\",\"revise\",\"correct-input\"]},\"state\":{\"enum\":[\"awaiting-review\",\"pending\",\"applying\",\"blocked\",\"applied\",\"cancelled\",\"rejected\"]}},\"required\":[\"state\",\"mode\"],\"type\":\"object\"},\"asks\":{\"items\":{\"additionalProperties\":false,\"properties\":{\"answer\":{\"additionalProperties\":false,\"properties\":{\"additions\":{\"items\":{\"type\":\"string\"},\"maxItems\":32,\"type\":\"array\",\"uniqueItems\":true},\"answeredAt\":{\"type\":\"string\"},\"text\":{\"maxLength\":2000,\"minLength\":1,\"type\":\"string\"}},\"required\":[\"additions\",\"answeredAt\"],\"type\":\"object\"},\"askedAt\":{\"type\":\"string\"},\"dueAt\":{\"type\":\"string\"},\"id\":{\"type\":\"string\"},\"links\":{\"additionalProperties\":false,\"properties\":{\"answer\":{\"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\",\"limit-reached\",\"application-pending\",\"attachment-required\",\"attachment-pending\",\"ask-answered\",\"ask-closed\",\"ask-due-passed\"]},\"recovery\":{\"enum\":[\"refresh\",\"revise\",\"retry\",\"rebase\",\"correct-input\",\"receipt-only\"]}},\"required\":[\"available\",\"observedRevision\"],\"then\":{\"required\":[\"reason\",\"recovery\"]},\"type\":\"object\"},\"ifMatch\":{\"type\":\"string\"},\"method\":{\"const\":\"POST\"},\"operation\":{\"const\":\"answer\"},\"path\":{\"type\":\"string\"}},\"required\":[\"method\",\"path\",\"accessProfile\",\"operation\",\"ifMatch\",\"availability\"],\"type\":\"object\"}},\"type\":\"object\"},\"state\":{\"enum\":[\"open\",\"answered\",\"expired\",\"closed\"]},\"text\":{\"maxLength\":2000,\"minLength\":1,\"type\":\"string\"},\"wants\":{\"items\":{\"additionalProperties\":false,\"properties\":{\"kind\":{\"enum\":[\"answer\",\"document\"]}},\"required\":[\"kind\"],\"type\":\"object\"},\"maxItems\":8,\"type\":\"array\",\"uniqueItems\":true}},\"required\":[\"id\",\"text\",\"wants\",\"askedAt\",\"state\",\"links\"],\"type\":\"object\"},\"maxItems\":50,\"type\":\"array\"},\"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\",\"limit-reached\",\"application-pending\",\"attachment-required\",\"attachment-pending\",\"ask-answered\",\"ask-closed\",\"ask-due-passed\"]},\"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\":{\"type\":\"string\"},\"decision\":{\"additionalProperties\":false,\"properties\":{\"decidedAt\":{\"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\"},\"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\":{\"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\",\"limit-reached\",\"application-pending\",\"attachment-required\",\"attachment-pending\",\"ask-answered\",\"ask-closed\",\"ask-due-passed\"]},\"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\"]},\"status\":{\"enum\":[\"draft\",\"awaiting-party\",\"in-review\",\"approved\",\"processing\",\"applied\",\"rejected\",\"cancelled\"]},\"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\"}")], @@ -489,7 +489,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Pick constructor(transport: Pick) { - assertClientVersion("0.51.0") + assertClientVersion("0.50.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/breg-minimal.ts b/clients/typescript/generated/breg-minimal.ts index ac376b138c..7ade2d29af 100644 --- a/clients/typescript/generated/breg-minimal.ts +++ b/clients/typescript/generated/breg-minimal.ts @@ -1,5 +1,5 @@ -// Generated for Stack version 0.51.0, client version 0.51.0. -// Source SHA-256 9e9b53a29229bf778859e131c0dc5cf4fc76e9e580d567793411402ece1833c3 +// Generated for Stack version 0.50.0, client version 0.50.0. +// Source SHA-256 97d9de66ffaf92c88cfb85b74e1fffde050ec7fa3985f75b8887e2429b022c0b // Unconstrained JSON /paths/~1v1~1records~1contacts~1{record_id}/patch/requestBody/content/application~1json-patch+json/schema/items/properties/value import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { actionAvailability, type ActionAvailability, type DescribeOptions } from "../core.ts" @@ -9,7 +9,7 @@ import { listPage, listQuery, type FieldValue, type Filter, type ListPage, type export type Schema_ImmediateActionPrecondition = ({ "ifMatch": (string) }) export type Schema_ImmediateActionResultReference = ({ "recordId": (string); "recordType": (string); "revision": (number) }) -export type Schema_Problem = (({ "code"?: "access-profile.ambiguous"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous" }) | ({ "code"?: "action.evidence-failed"; "status"?: 503; "type"?: "https://id.registrystack.org/problems/registry-breg/action/evidence-failed" }) | ({ "code"?: "action.guard-failed"; "status"?: 412; "type"?: "https://id.registrystack.org/problems/registry-breg/action/guard-failed" }) | ({ "code"?: "action.handler-failed"; "status"?: 500; "type"?: "https://id.registrystack.org/problems/registry-breg/action/handler-failed" }) | ({ "code"?: "action.refused"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/action/refused" }) | ({ "code"?: "attachment.content-type"; "status"?: 415; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/content-type" }) | ({ "code"?: "attachment.digest-mismatch"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch" }) | ({ "code"?: "attachment.limit-reached"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/limit-reached" }) | ({ "code"?: "attachment.required"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/required" }) | ({ "code"?: "attachment.slot-write-once"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once" }) | ({ "code"?: "attachment.too-large"; "status"?: 413; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/too-large" }) | ({ "code"?: "attachment.verification-pending"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/verification-pending" }) | ({ "code"?: "attachment.verification-rejected"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected" }) | ({ "code"?: "authentication.refused"; "status"?: 401; "type"?: "https://id.registrystack.org/problems/registry-breg/authentication/refused" }) | ({ "code"?: "idempotency.expired"; "status"?: 410; "type"?: "https://id.registrystack.org/problems/registry-breg/idempotency/expired" }) | ({ "code"?: "idempotency.key-reused"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/idempotency/key-reused" }) | ({ "code"?: "ingestion.chunk-mismatch"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch" }) | ({ "code"?: "ingestion.profile-mismatch"; "status"?: 403; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch" }) | ({ "code"?: "ingestion.receipt-erased"; "status"?: 410; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased" }) | ({ "code"?: "ingestion.run-blocked"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked" }) | ({ "code"?: "ingestion.run-not-open"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open" }) | ({ "code"?: "lookup.unresolved"; "status"?: 404; "type"?: "https://id.registrystack.org/problems/registry-breg/lookup/unresolved" }) | ({ "code"?: "mutation.conflict"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/mutation/conflict" }) | ({ "code"?: "precondition.failed"; "status"?: 412; "type"?: "https://id.registrystack.org/problems/registry-breg/precondition/failed" }) | ({ "code"?: "precondition.required"; "status"?: 428; "type"?: "https://id.registrystack.org/problems/registry-breg/precondition/required" }) | ({ "code"?: "profile.not-authorized"; "status"?: 403; "type"?: "https://id.registrystack.org/problems/registry-breg/profile/not-authorized" }) | ({ "code"?: "proposal.rejected"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/proposal/rejected" }) | ({ "code"?: "proposal.review-result-mismatch"; "status"?: 412; "type"?: "https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch" }) | ({ "code"?: "proposal.submission-expired"; "status"?: 410; "type"?: "https://id.registrystack.org/problems/registry-breg/proposal/submission-expired" }) | ({ "code"?: "query.cursor-invalid"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/query/cursor-invalid" }) | ({ "code"?: "query.filter-required"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/query/filter-required" }) | ({ "code"?: "query.invalid"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/query/invalid" }) | ({ "code"?: "request.access-reason-required"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/request/access-reason-required" }) | ({ "code"?: "request.invalid"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/request/invalid" }) | ({ "code"?: "request.timeout"; "status"?: 504; "type"?: "https://id.registrystack.org/problems/registry-breg/request/timeout" }) | ({ "code"?: "resource.not-found"; "status"?: 404; "type"?: "https://id.registrystack.org/problems/registry-breg/resource/not-found" }) | ({ "code"?: "runtime.field-encryption.unavailable"; "status"?: 503; "type"?: "https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable" }) | ({ "code"?: "service.unavailable"; "status"?: 503; "type"?: "https://id.registrystack.org/problems/registry-breg/service/unavailable" }) | ({ "code"?: "source.unavailable"; "status"?: 503; "type"?: "https://id.registrystack.org/problems/registry-breg/source/unavailable" }) | ({ "code"?: "statistical-dataset.domain-violation"; "status"?: 500; "type"?: "https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation" }) | ({ "code"?: "statistical-dataset.release-refused"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused" }) | ({ "code"?: "statistical-dataset.version-conflict"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict" }) | ({ "code"?: "statistical-dataset.version-withdrawn"; "status"?: 410; "type"?: "https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn" }) | ({ "code"?: "unsupported.media-type"; "status"?: 415; "type"?: "https://id.registrystack.org/problems/registry-breg/unsupported/media-type" }) | ({ "code"?: "write.outside-boundary"; "status"?: 403; "type"?: "https://id.registrystack.org/problems/registry-breg/write/outside-boundary" })) & ({ "accessProfiles"?: (Array<(string)>); "atField"?: (string); "code": ("access-profile.ambiguous" | "action.evidence-failed" | "action.guard-failed" | "action.handler-failed" | "action.refused" | "attachment.content-type" | "attachment.digest-mismatch" | "attachment.limit-reached" | "attachment.required" | "attachment.slot-write-once" | "attachment.too-large" | "attachment.verification-pending" | "attachment.verification-rejected" | "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" | "profile.not-authorized" | "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") & (string); "constraintId"?: (string); "constraintKind"?: ("compare" | "int-range" | "vocabulary") & (string); "detail": (string); "field"?: (string); "fieldId"?: (string); "fieldPath"?: (string); "guardReason"?: (string); "left"?: (string); "notAfterField"?: (string); "reasonCode"?: ("computation-error" | "source-data-error" | "disclosure-risk") & (string); "recordType"?: (string); "refusalCode"?: (string); "requiredFilters"?: (Array<(Array<(string)>)>); "right"?: (string); "status": (number); "title": (string); "traceId": (string); "type": (string) }) & (({ "code": "access-profile.ambiguous" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & ({ "status"?: 400; "accessProfiles": {} | null })) | ({ "code": "action.evidence-failed" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never } & ({ "detail"?: "The declared Evidence dependency could not be accepted."; "fieldPath"?: (string); "status"?: 503 })) | ({ "code": "action.guard-failed" } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "action.handler-failed" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never } & ({ "status"?: 500 })) | ({ "code": "action.refused" } & { "guardReason"?: never } & ({ "status"?: 422; "refusalCode": {} | null }) & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.content-type" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.digest-mismatch" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.limit-reached" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.required" } & ({ "fieldPath": (string) }) & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.slot-write-once" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.too-large" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.verification-pending" } & ({ "fieldPath": (string) }) & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.verification-rejected" } & ({ "fieldPath": (string) }) & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "authentication.refused" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "idempotency.expired" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "idempotency.key-reused" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.chunk-mismatch" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.profile-mismatch" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.receipt-erased" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.run-blocked" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.run-not-open" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "lookup.unresolved" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "mutation.conflict" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "precondition.failed" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "precondition.required" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "profile.not-authorized" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "proposal.rejected" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "proposal.review-result-mismatch" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "proposal.submission-expired" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "query.cursor-invalid" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "query.filter-required" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "query.invalid" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "request.access-reason-required" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "request.invalid" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "request.timeout" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "resource.not-found" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "runtime.field-encryption.unavailable" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "service.unavailable" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "source.unavailable" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "statistical-dataset.domain-violation" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "statistical-dataset.release-refused" } & { "guardReason"?: never } & ({ "refusalCode": ("period-not-ended" | "before-first-period" | "provisional-after-final" | "already-withdrawn" | "negative-value"); "status"?: 422 }) & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "statistical-dataset.version-conflict" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "statistical-dataset.version-withdrawn" } & { "guardReason"?: never } & { "refusalCode"?: never } & ({ "status"?: 410; "reasonCode": {} | null }) & { "accessProfiles"?: never }) | ({ "code": "unsupported.media-type" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "write.outside-boundary" } & ({ "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"; "type"?: "https://id.registrystack.org/problems/registry-breg/write/outside-boundary" }) & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never })) +export type Schema_Problem = (({ "code"?: "access-profile.ambiguous"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous" }) | ({ "code"?: "action.evidence-failed"; "status"?: 503; "type"?: "https://id.registrystack.org/problems/registry-breg/action/evidence-failed" }) | ({ "code"?: "action.guard-failed"; "status"?: 412; "type"?: "https://id.registrystack.org/problems/registry-breg/action/guard-failed" }) | ({ "code"?: "action.handler-failed"; "status"?: 500; "type"?: "https://id.registrystack.org/problems/registry-breg/action/handler-failed" }) | ({ "code"?: "action.refused"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/action/refused" }) | ({ "code"?: "attachment.content-type"; "status"?: 415; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/content-type" }) | ({ "code"?: "attachment.digest-mismatch"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch" }) | ({ "code"?: "attachment.limit-reached"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/limit-reached" }) | ({ "code"?: "attachment.required"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/required" }) | ({ "code"?: "attachment.slot-write-once"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once" }) | ({ "code"?: "attachment.too-large"; "status"?: 413; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/too-large" }) | ({ "code"?: "attachment.verification-pending"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/verification-pending" }) | ({ "code"?: "attachment.verification-rejected"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected" }) | ({ "code"?: "authentication.refused"; "status"?: 401; "type"?: "https://id.registrystack.org/problems/registry-breg/authentication/refused" }) | ({ "code"?: "idempotency.expired"; "status"?: 410; "type"?: "https://id.registrystack.org/problems/registry-breg/idempotency/expired" }) | ({ "code"?: "idempotency.key-reused"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/idempotency/key-reused" }) | ({ "code"?: "ingestion.chunk-mismatch"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch" }) | ({ "code"?: "ingestion.profile-mismatch"; "status"?: 403; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch" }) | ({ "code"?: "ingestion.receipt-erased"; "status"?: 410; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased" }) | ({ "code"?: "ingestion.run-blocked"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked" }) | ({ "code"?: "ingestion.run-not-open"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open" }) | ({ "code"?: "lookup.unresolved"; "status"?: 404; "type"?: "https://id.registrystack.org/problems/registry-breg/lookup/unresolved" }) | ({ "code"?: "mutation.conflict"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/mutation/conflict" }) | ({ "code"?: "precondition.failed"; "status"?: 412; "type"?: "https://id.registrystack.org/problems/registry-breg/precondition/failed" }) | ({ "code"?: "precondition.required"; "status"?: 428; "type"?: "https://id.registrystack.org/problems/registry-breg/precondition/required" }) | ({ "code"?: "profile.not-authorized"; "status"?: 403; "type"?: "https://id.registrystack.org/problems/registry-breg/profile/not-authorized" }) | ({ "code"?: "proposal.rejected"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/proposal/rejected" }) | ({ "code"?: "proposal.review-result-mismatch"; "status"?: 412; "type"?: "https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch" }) | ({ "code"?: "proposal.submission-expired"; "status"?: 410; "type"?: "https://id.registrystack.org/problems/registry-breg/proposal/submission-expired" }) | ({ "code"?: "query.cursor-invalid"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/query/cursor-invalid" }) | ({ "code"?: "query.filter-required"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/query/filter-required" }) | ({ "code"?: "query.invalid"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/query/invalid" }) | ({ "code"?: "request.access-reason-required"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/request/access-reason-required" }) | ({ "code"?: "request.invalid"; "status"?: 400; "type"?: "https://id.registrystack.org/problems/registry-breg/request/invalid" }) | ({ "code"?: "request.timeout"; "status"?: 504; "type"?: "https://id.registrystack.org/problems/registry-breg/request/timeout" }) | ({ "code"?: "resource.not-found"; "status"?: 404; "type"?: "https://id.registrystack.org/problems/registry-breg/resource/not-found" }) | ({ "code"?: "runtime.field-encryption.unavailable"; "status"?: 503; "type"?: "https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable" }) | ({ "code"?: "service.unavailable"; "status"?: 503; "type"?: "https://id.registrystack.org/problems/registry-breg/service/unavailable" }) | ({ "code"?: "source.unavailable"; "status"?: 503; "type"?: "https://id.registrystack.org/problems/registry-breg/source/unavailable" }) | ({ "code"?: "statistical-dataset.domain-violation"; "status"?: 500; "type"?: "https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation" }) | ({ "code"?: "statistical-dataset.release-refused"; "status"?: 422; "type"?: "https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused" }) | ({ "code"?: "statistical-dataset.version-conflict"; "status"?: 409; "type"?: "https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict" }) | ({ "code"?: "statistical-dataset.version-withdrawn"; "status"?: 410; "type"?: "https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn" }) | ({ "code"?: "unsupported.media-type"; "status"?: 415; "type"?: "https://id.registrystack.org/problems/registry-breg/unsupported/media-type" }) | ({ "code"?: "write.outside-boundary"; "status"?: 403; "type"?: "https://id.registrystack.org/problems/registry-breg/write/outside-boundary" })) & ({ "accessProfiles"?: (Array<(string)>); "atField"?: (string); "code": ("access-profile.ambiguous" | "action.evidence-failed" | "action.guard-failed" | "action.handler-failed" | "action.refused" | "attachment.content-type" | "attachment.digest-mismatch" | "attachment.limit-reached" | "attachment.required" | "attachment.slot-write-once" | "attachment.too-large" | "attachment.verification-pending" | "attachment.verification-rejected" | "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" | "profile.not-authorized" | "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") & (string); "constraintId"?: (string); "constraintKind"?: ("compare" | "int-range" | "vocabulary") & (string); "detail": (string); "failedCheck"?: (string); "field"?: (string); "fieldId"?: (string); "fieldPath"?: (string); "guardReason"?: (string); "left"?: (string); "notAfterField"?: (string); "reasonCode"?: ("computation-error" | "source-data-error" | "disclosure-risk") & (string); "recordType"?: (string); "refusalCode"?: (string); "requiredFilters"?: (Array<(Array<(string)>)>); "right"?: (string); "status": (number); "title": (string); "traceId": (string); "type": (string) }) & (({ "code": "access-profile.ambiguous" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & ({ "status"?: 400; "accessProfiles": {} | null })) | ({ "code": "action.evidence-failed" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never } & ({ "detail"?: "The declared Evidence dependency could not be accepted."; "fieldPath"?: (string); "status"?: 503 })) | ({ "code": "action.guard-failed" } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "action.handler-failed" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never } & ({ "status"?: 500 })) | ({ "code": "action.refused" } & { "guardReason"?: never } & ({ "status"?: 422; "refusalCode": {} | null }) & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.content-type" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.digest-mismatch" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.limit-reached" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.required" } & ({ "fieldPath": (string) }) & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.slot-write-once" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.too-large" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.verification-pending" } & ({ "fieldPath": (string) }) & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "attachment.verification-rejected" } & ({ "fieldPath": (string) }) & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "authentication.refused" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "idempotency.expired" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "idempotency.key-reused" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.chunk-mismatch" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.profile-mismatch" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.receipt-erased" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.run-blocked" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "ingestion.run-not-open" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "lookup.unresolved" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "mutation.conflict" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "precondition.failed" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "precondition.required" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "profile.not-authorized" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "proposal.rejected" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "proposal.review-result-mismatch" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "proposal.submission-expired" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "query.cursor-invalid" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "query.filter-required" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "query.invalid" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "request.access-reason-required" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "request.invalid" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "request.timeout" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "resource.not-found" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "runtime.field-encryption.unavailable" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "service.unavailable" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "source.unavailable" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "statistical-dataset.domain-violation" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "statistical-dataset.release-refused" } & { "guardReason"?: never } & ({ "refusalCode": ("period-not-ended" | "before-first-period" | "provisional-after-final" | "already-withdrawn" | "negative-value"); "status"?: 422 }) & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "statistical-dataset.version-conflict" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "statistical-dataset.version-withdrawn" } & { "guardReason"?: never } & { "refusalCode"?: never } & ({ "status"?: 410; "reasonCode": {} | null }) & { "accessProfiles"?: never }) | ({ "code": "unsupported.media-type" } & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never }) | ({ "code": "write.outside-boundary" } & ({ "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"; "type"?: "https://id.registrystack.org/problems/registry-breg/write/outside-boundary" }) & { "guardReason"?: never } & { "refusalCode"?: never } & { "reasonCode"?: never } & { "accessProfiles"?: never })) export type Schema_ReviewCompletion = ({ "completedAt": (string); "eventId": (string); "requestId": (string); "resultId": (string); "type": "review.completed" }) export type Schema_action_register_contact_invoke_input = ({ "input": ({ "email"?: (string); "jurisdiction"?: (string); "name"?: (string) }) }) export type Schema_action_register_contact_invoke_response = ({ "actionId": (string); "actionRevision": (string); "application"?: ({ "applicationId": (string); "effectDigest": (string); "resultLinks": (Array<({ "recordId": (string); "recordType": (string); "revision": (number) })>); "submissionVersion": (number) }); "applicationStatus"?: ({ "automaticRetry"?: ({ "attempts": (number); "maximumAttempts": (number); "scheduled": (boolean) }); "mode": ("automatic" | "manual"); "reason"?: ("package-changed" | "dependency-outage" | "lease-expired" | "application-refused" | "attempts-exhausted"); "recovery"?: ("retry" | "rebase" | "revise" | "correct-input"); "state": ("awaiting-review" | "pending" | "applying" | "blocked" | "applied" | "cancelled" | "rejected") }); "asks"?: (Array<({ "answer"?: ({ "additions": (Array<(string)>); "answeredAt": (string); "text"?: (string) }); "askedAt": (string); "dueAt"?: (string); "id": (string); "links": ({ "answer"?: ({ "accessProfile": (string); "availability": ({ "available": (boolean); "observedRevision": (number); "reason"?: ("pending-review" | "review-rejected" | "review-changes-requested" | "review-ended" | "stale-revision" | "package-changed" | "dependency-outage" | "invalid-input" | "already-applied" | "limit-reached" | "application-pending" | "attachment-required" | "attachment-pending" | "ask-answered" | "ask-closed" | "ask-due-passed"); "recovery"?: ("refresh" | "revise" | "retry" | "rebase" | "correct-input" | "receipt-only") }); "ifMatch": (string); "method": "POST"; "operation": "answer"; "path": (string) }) }); "state": ("open" | "answered" | "expired" | "closed"); "text": (string); "wants": (Array<({ "kind": ("answer" | "document") })>) })>); "attachments"?: (Record); "id": (string); "links": (Record); "maximumBytes": (number); "required": (boolean); "value"?: ({ "byteSize": (number); "contentType": (string); "sha256": (string); "submissionVersion": (number); "uploadedAt"?: (string); "verificationStatus": ("notRequired" | "pending" | "approved" | "rejected") }) })>); "blockedReason"?: ("package-changed"); "createdAt"?: (string); "decision"?: ({ "decidedAt": (string); "publicReason"?: (string); "status": ("approved" | "rejected" | "changes-requested" | "answered") }); "effectDigest"?: (string); "handoffRefusal"?: ({ "code": ("review.initiator-required" | "review.initiator-excluded" | "review.policy-mismatch" | "review.refused") }); "id": (string); "input"?: (Record); "links": (Record); "revision": (number); "state": ("draft" | "submitted" | "applied" | "cancelled" | "rejected"); "status"?: ("draft" | "awaiting-party" | "in-review" | "approved" | "processing" | "applied" | "rejected" | "cancelled"); "submissionVersion": (number); "title"?: (string); "turn": ("party" | "official" | "nobody") }) @@ -68,7 +68,7 @@ function recordRow(record: RecordEnvelope & { domainData: Data }): RecordR } const rules: Record = Object.fromEntries([ - ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"allOf\":[{\"if\":{\"properties\":{\"code\":{\"enum\":[\"attachment.required\",\"attachment.verification-pending\",\"attachment.verification-rejected\"]}}},\"then\":{\"allOf\":[{\"else\":{\"properties\":{\"status\":{\"const\":422}}},\"if\":{\"properties\":{\"code\":{\"const\":\"attachment.verification-pending\"}}},\"then\":{\"properties\":{\"status\":{\"const\":409}}}}],\"properties\":{\"fieldPath\":{\"pattern\":\"^/attachments/[a-z][a-z0-9_-]{0,63}$\",\"type\":\"string\"}},\"propertyNames\":{\"enum\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\",\"fieldPath\"]},\"required\":[\"fieldPath\"]}},{\"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\":\"access-profile.ambiguous\"}}},\"then\":{\"additionalProperties\":true,\"properties\":{\"status\":{\"const\":400}},\"required\":[\"accessProfiles\"]}},{\"if\":{\"properties\":{\"code\":{\"not\":{\"const\":\"access-profile.ambiguous\"}}}},\"then\":{\"not\":{\"required\":[\"accessProfiles\"]}}},{\"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\"]}}],\"anyOf\":[{\"properties\":{\"code\":{\"const\":\"access-profile.ambiguous\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous\"}}},{\"properties\":{\"code\":{\"const\":\"action.evidence-failed\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/evidence-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.guard-failed\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/guard-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.handler-failed\"},\"status\":{\"const\":500},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/handler-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.refused\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/refused\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.content-type\"},\"status\":{\"const\":415},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/content-type\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.digest-mismatch\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.limit-reached\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.required\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/required\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.slot-write-once\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.too-large\"},\"status\":{\"const\":413},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/too-large\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.verification-pending\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.verification-rejected\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected\"}}},{\"properties\":{\"code\":{\"const\":\"authentication.refused\"},\"status\":{\"const\":401},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/authentication/refused\"}}},{\"properties\":{\"code\":{\"const\":\"idempotency.expired\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/idempotency/expired\"}}},{\"properties\":{\"code\":{\"const\":\"idempotency.key-reused\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.chunk-mismatch\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.profile-mismatch\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.receipt-erased\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.run-blocked\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.run-not-open\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open\"}}},{\"properties\":{\"code\":{\"const\":\"lookup.unresolved\"},\"status\":{\"const\":404},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/lookup/unresolved\"}}},{\"properties\":{\"code\":{\"const\":\"mutation.conflict\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/mutation/conflict\"}}},{\"properties\":{\"code\":{\"const\":\"precondition.failed\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/precondition/failed\"}}},{\"properties\":{\"code\":{\"const\":\"precondition.required\"},\"status\":{\"const\":428},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/precondition/required\"}}},{\"properties\":{\"code\":{\"const\":\"profile.not-authorized\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/profile/not-authorized\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.rejected\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/rejected\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.review-result-mismatch\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.submission-expired\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired\"}}},{\"properties\":{\"code\":{\"const\":\"query.cursor-invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid\"}}},{\"properties\":{\"code\":{\"const\":\"query.filter-required\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/filter-required\"}}},{\"properties\":{\"code\":{\"const\":\"query.invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/invalid\"}}},{\"properties\":{\"code\":{\"const\":\"request.access-reason-required\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/access-reason-required\"}}},{\"properties\":{\"code\":{\"const\":\"request.invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/invalid\"}}},{\"properties\":{\"code\":{\"const\":\"request.timeout\"},\"status\":{\"const\":504},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/timeout\"}}},{\"properties\":{\"code\":{\"const\":\"resource.not-found\"},\"status\":{\"const\":404},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/resource/not-found\"}}},{\"properties\":{\"code\":{\"const\":\"runtime.field-encryption.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"service.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/service/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"source.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/source/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.domain-violation\"},\"status\":{\"const\":500},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.release-refused\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.version-conflict\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.version-withdrawn\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn\"}}},{\"properties\":{\"code\":{\"const\":\"unsupported.media-type\"},\"status\":{\"const\":415},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/unsupported/media-type\"}}},{\"properties\":{\"code\":{\"const\":\"write.outside-boundary\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/write/outside-boundary\"}}}],\"properties\":{\"accessProfiles\":{\"items\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"minItems\":2,\"type\":\"array\",\"uniqueItems\":true},\"atField\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"code\":{\"enum\":[\"access-profile.ambiguous\",\"action.evidence-failed\",\"action.guard-failed\",\"action.handler-failed\",\"action.refused\",\"attachment.content-type\",\"attachment.digest-mismatch\",\"attachment.limit-reached\",\"attachment.required\",\"attachment.slot-write-once\",\"attachment.too-large\",\"attachment.verification-pending\",\"attachment.verification-rejected\",\"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\",\"profile.not-authorized\",\"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\":{\"maxLength\":256,\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], + ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"allOf\":[{\"if\":{\"properties\":{\"code\":{\"enum\":[\"attachment.required\",\"attachment.verification-pending\",\"attachment.verification-rejected\"]}}},\"then\":{\"allOf\":[{\"else\":{\"properties\":{\"status\":{\"const\":422}}},\"if\":{\"properties\":{\"code\":{\"const\":\"attachment.verification-pending\"}}},\"then\":{\"properties\":{\"status\":{\"const\":409}}}}],\"properties\":{\"fieldPath\":{\"pattern\":\"^/attachments/[a-z][a-z0-9_-]{0,63}$\",\"type\":\"string\"}},\"propertyNames\":{\"enum\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\",\"fieldPath\"]},\"required\":[\"fieldPath\"]}},{\"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\",\"failedCheck\"]}}},{\"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\":\"access-profile.ambiguous\"}}},\"then\":{\"additionalProperties\":true,\"properties\":{\"status\":{\"const\":400}},\"required\":[\"accessProfiles\"]}},{\"if\":{\"properties\":{\"code\":{\"not\":{\"const\":\"access-profile.ambiguous\"}}}},\"then\":{\"not\":{\"required\":[\"accessProfiles\"]}}},{\"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\"]}}],\"anyOf\":[{\"properties\":{\"code\":{\"const\":\"access-profile.ambiguous\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous\"}}},{\"properties\":{\"code\":{\"const\":\"action.evidence-failed\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/evidence-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.guard-failed\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/guard-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.handler-failed\"},\"status\":{\"const\":500},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/handler-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.refused\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/refused\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.content-type\"},\"status\":{\"const\":415},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/content-type\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.digest-mismatch\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.limit-reached\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.required\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/required\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.slot-write-once\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.too-large\"},\"status\":{\"const\":413},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/too-large\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.verification-pending\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.verification-rejected\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected\"}}},{\"properties\":{\"code\":{\"const\":\"authentication.refused\"},\"status\":{\"const\":401},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/authentication/refused\"}}},{\"properties\":{\"code\":{\"const\":\"idempotency.expired\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/idempotency/expired\"}}},{\"properties\":{\"code\":{\"const\":\"idempotency.key-reused\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.chunk-mismatch\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.profile-mismatch\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.receipt-erased\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.run-blocked\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.run-not-open\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open\"}}},{\"properties\":{\"code\":{\"const\":\"lookup.unresolved\"},\"status\":{\"const\":404},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/lookup/unresolved\"}}},{\"properties\":{\"code\":{\"const\":\"mutation.conflict\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/mutation/conflict\"}}},{\"properties\":{\"code\":{\"const\":\"precondition.failed\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/precondition/failed\"}}},{\"properties\":{\"code\":{\"const\":\"precondition.required\"},\"status\":{\"const\":428},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/precondition/required\"}}},{\"properties\":{\"code\":{\"const\":\"profile.not-authorized\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/profile/not-authorized\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.rejected\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/rejected\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.review-result-mismatch\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.submission-expired\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired\"}}},{\"properties\":{\"code\":{\"const\":\"query.cursor-invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid\"}}},{\"properties\":{\"code\":{\"const\":\"query.filter-required\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/filter-required\"}}},{\"properties\":{\"code\":{\"const\":\"query.invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/invalid\"}}},{\"properties\":{\"code\":{\"const\":\"request.access-reason-required\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/access-reason-required\"}}},{\"properties\":{\"code\":{\"const\":\"request.invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/invalid\"}}},{\"properties\":{\"code\":{\"const\":\"request.timeout\"},\"status\":{\"const\":504},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/timeout\"}}},{\"properties\":{\"code\":{\"const\":\"resource.not-found\"},\"status\":{\"const\":404},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/resource/not-found\"}}},{\"properties\":{\"code\":{\"const\":\"runtime.field-encryption.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"service.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/service/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"source.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/source/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.domain-violation\"},\"status\":{\"const\":500},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.release-refused\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.version-conflict\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.version-withdrawn\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn\"}}},{\"properties\":{\"code\":{\"const\":\"unsupported.media-type\"},\"status\":{\"const\":415},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/unsupported/media-type\"}}},{\"properties\":{\"code\":{\"const\":\"write.outside-boundary\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/write/outside-boundary\"}}}],\"properties\":{\"accessProfiles\":{\"items\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"minItems\":2,\"type\":\"array\",\"uniqueItems\":true},\"atField\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"code\":{\"enum\":[\"access-profile.ambiguous\",\"action.evidence-failed\",\"action.guard-failed\",\"action.handler-failed\",\"action.refused\",\"attachment.content-type\",\"attachment.digest-mismatch\",\"attachment.limit-reached\",\"attachment.required\",\"attachment.slot-write-once\",\"attachment.too-large\",\"attachment.verification-pending\",\"attachment.verification-rejected\",\"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\",\"profile.not-authorized\",\"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\"},\"failedCheck\":{\"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\":{\"maxLength\":256,\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], ["/components/schemas/ReviewCompletion", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"completedAt\":{\"type\":\"string\"},\"eventId\":{\"type\":\"string\"},\"requestId\":{\"type\":\"string\"},\"resultId\":{\"type\":\"string\"},\"type\":{\"const\":\"review.completed\"}},\"required\":[\"type\",\"eventId\",\"requestId\",\"resultId\",\"completedAt\"],\"type\":\"object\"}")], ["/components/schemas/action-register-contact-invoke-input", JSON.parse("{\"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\"}")], ["/components/schemas/action-register-contact-invoke-response", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"actionId\":{\"type\":\"string\"},\"actionRevision\":{\"type\":\"string\"},\"application\":{\"additionalProperties\":false,\"properties\":{\"applicationId\":{\"type\":\"string\"},\"effectDigest\":{\"pattern\":\"^sha256:[0-9a-f]{64}$\",\"type\":\"string\"},\"resultLinks\":{\"items\":{\"additionalProperties\":false,\"properties\":{\"recordId\":{\"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\",\"revise\",\"correct-input\"]},\"state\":{\"enum\":[\"awaiting-review\",\"pending\",\"applying\",\"blocked\",\"applied\",\"cancelled\",\"rejected\"]}},\"required\":[\"state\",\"mode\"],\"type\":\"object\"},\"asks\":{\"items\":{\"additionalProperties\":false,\"properties\":{\"answer\":{\"additionalProperties\":false,\"properties\":{\"additions\":{\"items\":{\"type\":\"string\"},\"maxItems\":32,\"type\":\"array\",\"uniqueItems\":true},\"answeredAt\":{\"type\":\"string\"},\"text\":{\"maxLength\":2000,\"minLength\":1,\"type\":\"string\"}},\"required\":[\"additions\",\"answeredAt\"],\"type\":\"object\"},\"askedAt\":{\"type\":\"string\"},\"dueAt\":{\"type\":\"string\"},\"id\":{\"type\":\"string\"},\"links\":{\"additionalProperties\":false,\"properties\":{\"answer\":{\"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\",\"limit-reached\",\"application-pending\",\"attachment-required\",\"attachment-pending\",\"ask-answered\",\"ask-closed\",\"ask-due-passed\"]},\"recovery\":{\"enum\":[\"refresh\",\"revise\",\"retry\",\"rebase\",\"correct-input\",\"receipt-only\"]}},\"required\":[\"available\",\"observedRevision\"],\"then\":{\"required\":[\"reason\",\"recovery\"]},\"type\":\"object\"},\"ifMatch\":{\"type\":\"string\"},\"method\":{\"const\":\"POST\"},\"operation\":{\"const\":\"answer\"},\"path\":{\"type\":\"string\"}},\"required\":[\"method\",\"path\",\"accessProfile\",\"operation\",\"ifMatch\",\"availability\"],\"type\":\"object\"}},\"type\":\"object\"},\"state\":{\"enum\":[\"open\",\"answered\",\"expired\",\"closed\"]},\"text\":{\"maxLength\":2000,\"minLength\":1,\"type\":\"string\"},\"wants\":{\"items\":{\"additionalProperties\":false,\"properties\":{\"kind\":{\"enum\":[\"answer\",\"document\"]}},\"required\":[\"kind\"],\"type\":\"object\"},\"maxItems\":8,\"type\":\"array\",\"uniqueItems\":true}},\"required\":[\"id\",\"text\",\"wants\",\"askedAt\",\"state\",\"links\"],\"type\":\"object\"},\"maxItems\":50,\"type\":\"array\"},\"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\",\"limit-reached\",\"application-pending\",\"attachment-required\",\"attachment-pending\",\"ask-answered\",\"ask-closed\",\"ask-due-passed\"]},\"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\":{\"type\":\"string\"},\"decision\":{\"additionalProperties\":false,\"properties\":{\"decidedAt\":{\"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\"},\"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\":{\"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\",\"limit-reached\",\"application-pending\",\"attachment-required\",\"attachment-pending\",\"ask-answered\",\"ask-closed\",\"ask-due-passed\"]},\"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\"]},\"status\":{\"enum\":[\"draft\",\"awaiting-party\",\"in-review\",\"approved\",\"processing\",\"applied\",\"rejected\",\"cancelled\"]},\"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\"}")], @@ -247,7 +247,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Pick constructor(transport: Pick) { - assertClientVersion("0.51.0") + assertClientVersion("0.50.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/casework.ts b/clients/typescript/generated/casework.ts index 54c49a0657..56d2a9b445 100644 --- a/clients/typescript/generated/casework.ts +++ b/clients/typescript/generated/casework.ts @@ -1,5 +1,5 @@ -// Generated for Stack version 0.51.0, client version 0.51.0. -// Source SHA-256 691504b8b68dceae66076c762c43ecc7f87b292e3db32efe58e7a234e3b079a9 +// Generated for Stack version 0.50.0, client version 0.50.0. +// Source SHA-256 16076ee86feb6ad3659c1ac01a53ea7c11f7f1a6bef10f21b677b1cee6cb27cc // Unconstrained JSON /components/schemas/ReviewHistoryEntry/properties/detail // Unconstrained JSON /components/schemas/ReviewPolicy/properties/displaySchema // Unconstrained JSON /components/schemas/ReviewPolicy/properties/resultSchema @@ -72,7 +72,7 @@ export type Schema_OwnReviewDecision = ({ "decisionReceipt": Schema_ReviewDecisi export type Schema_OwnReviewDecisionPage = ({ "items": (Array); "nextCursor"?: (string | null); "status": Schema_PageStatus }) export type Schema_PageStatus = ("complete" | "budget-exhausted" | "source-unavailable") & (string) export type Schema_PolicyBinding = ({ "digest": Schema_ContentDigest; "id": (string); "version": (string) }) -export type Schema_Problem = ({ "code": (string); "detail": (string); "status": (number); "title": (string); "traceId": (string); "type": (string) }) +export type Schema_Problem = ({ "code": (string); "detail": (string); "failedCheck"?: (string); "status": (number); "title": (string); "traceId": (string); "type": (string) }) export type Schema_ProblemAbsenceCoverCycle = (Schema_Problem & ({ "code"?: "absence.cover-cycle"; "detail"?: "Choose cover assignments that do not return to an earlier person during a shared period."; "status"?: 422; "title"?: "Absence cover cycle"; "type"?: "https://id.registrystack.org/problems/registry-casework/absence/cover-cycle" })) export type Schema_ProblemAbsenceInvalidPeriod = (Schema_Problem & ({ "code"?: "absence.invalid-period"; "detail"?: "Set until later than from."; "status"?: 422; "title"?: "Invalid absence period"; "type"?: "https://id.registrystack.org/problems/registry-casework/absence/invalid-period" })) export type Schema_ProblemAbsenceOverlap = (Schema_Problem & ({ "code"?: "absence.overlap"; "detail"?: "Adjust the period so this person has no overlapping absence."; "status"?: 422; "title"?: "Absence period overlaps"; "type"?: "https://id.registrystack.org/problems/registry-casework/absence/overlap" })) @@ -353,7 +353,7 @@ const rules: Record = Object.fromEntries([ ["/components/schemas/OwnReviewDecisionPage", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"items\":{\"items\":{\"$ref\":\"/components/schemas/OwnReviewDecision\"},\"type\":\"array\"},\"nextCursor\":{\"type\":[\"string\",\"null\"]},\"status\":{\"$ref\":\"/components/schemas/PageStatus\"}},\"required\":[\"items\",\"status\"],\"type\":\"object\"}")], ["/components/schemas/PageStatus", JSON.parse("{\"enum\":[\"complete\",\"budget-exhausted\",\"source-unavailable\"],\"type\":\"string\"}")], ["/components/schemas/PolicyBinding", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"digest\":{\"$ref\":\"/components/schemas/ContentDigest\"},\"id\":{\"type\":\"string\"},\"version\":{\"type\":\"string\"}},\"required\":[\"id\",\"version\",\"digest\"],\"type\":\"object\"}")], - ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"code\":{\"type\":\"string\"},\"detail\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"title\":{\"type\":\"string\"},\"traceId\":{\"type\":\"string\"},\"type\":{\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], + ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"code\":{\"type\":\"string\"},\"detail\":{\"type\":\"string\"},\"failedCheck\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"title\":{\"type\":\"string\"},\"traceId\":{\"type\":\"string\"},\"type\":{\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], ["/components/schemas/ProblemAbsenceCoverCycle", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"const\":\"absence.cover-cycle\"},\"detail\":{\"const\":\"Choose cover assignments that do not return to an earlier person during a shared period.\"},\"status\":{\"const\":422},\"title\":{\"const\":\"Absence cover cycle\"},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-casework/absence/cover-cycle\"}}}]}")], ["/components/schemas/ProblemAbsenceInvalidPeriod", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"const\":\"absence.invalid-period\"},\"detail\":{\"const\":\"Set until later than from.\"},\"status\":{\"const\":422},\"title\":{\"const\":\"Invalid absence period\"},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-casework/absence/invalid-period\"}}}]}")], ["/components/schemas/ProblemAbsenceOverlap", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"const\":\"absence.overlap\"},\"detail\":{\"const\":\"Adjust the period so this person has no overlapping absence.\"},\"status\":{\"const\":422},\"title\":{\"const\":\"Absence period overlaps\"},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-casework/absence/overlap\"}}}]}")], @@ -1305,7 +1305,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.51.0") + assertClientVersion("0.50.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/documents.ts b/clients/typescript/generated/documents.ts index 248677bc42..f23fe04f7f 100644 --- a/clients/typescript/generated/documents.ts +++ b/clients/typescript/generated/documents.ts @@ -1,5 +1,5 @@ -// Generated for Stack version 0.51.0, client version 0.51.0. -// Source SHA-256 0859c890595bbe1d6229c78bc4ab324b60222f5689a8d47c9272e03490ff5631 +// Generated for Stack version 0.50.0, client version 0.50.0. +// Source SHA-256 3ae4d3cb2bdd8a07d034758175ecea78c67d4ae87b2b34ad6886187a26647ae6 import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -23,7 +23,7 @@ export type Schema_GranteeRef = ({ "kind": Schema_ActorKind; "subject": Schema_E export type Schema_IssueGrantRequest = ({ "expiryHours"?: (number); "grantee": Schema_GranteeRef; "versionId": (string) }) export type Schema_LocalId = (string) export type Schema_PolicyBinding = ({ "digest": Schema_Digest; "id": Schema_LocalId; "version": (string) }) -export type Schema_Problem = ({ "code": ("authentication.refused" | "custody.not-permitted" | "custody.quota-exceeded" | "document-grant.expiry-out-of-range" | "document-policy.unknown" | "document-version.not-releasable" | "document.content-type-not-allowed" | "document.too-large" | "idempotency.expired" | "idempotency.key-reused" | "profile.not-authorized" | "request.body-too-large" | "request.invalid" | "request.method-not-allowed" | "request.not-found" | "request.unprocessable" | "request.unsupported-media-type" | "resource.not-found" | "service.unavailable" | "upload.content-type-mismatch" | "upload.digest-mismatch" | "upload.expired" | "upload.finalized" | "upload.length-mismatch") & (string); "detail": (string); "status": (number); "title": (string); "traceId": (string); "type": ("https://id.registrystack.org/problems/registry-documents/authentication/refused" | "https://id.registrystack.org/problems/registry-documents/custody/not-permitted" | "https://id.registrystack.org/problems/registry-documents/custody/quota-exceeded" | "https://id.registrystack.org/problems/registry-documents/document-grant/expiry-out-of-range" | "https://id.registrystack.org/problems/registry-documents/document-policy/unknown" | "https://id.registrystack.org/problems/registry-documents/document-version/not-releasable" | "https://id.registrystack.org/problems/registry-documents/document/content-type-not-allowed" | "https://id.registrystack.org/problems/registry-documents/document/too-large" | "https://id.registrystack.org/problems/registry-documents/idempotency/expired" | "https://id.registrystack.org/problems/registry-documents/idempotency/key-reused" | "https://id.registrystack.org/problems/registry-documents/profile/not-authorized" | "https://id.registrystack.org/problems/registry-documents/request/body-too-large" | "https://id.registrystack.org/problems/registry-documents/request/invalid" | "https://id.registrystack.org/problems/registry-documents/request/method-not-allowed" | "https://id.registrystack.org/problems/registry-documents/request/not-found" | "https://id.registrystack.org/problems/registry-documents/request/unprocessable" | "https://id.registrystack.org/problems/registry-documents/request/unsupported-media-type" | "https://id.registrystack.org/problems/registry-documents/resource/not-found" | "https://id.registrystack.org/problems/registry-documents/service/unavailable" | "https://id.registrystack.org/problems/registry-documents/upload/content-type-mismatch" | "https://id.registrystack.org/problems/registry-documents/upload/digest-mismatch" | "https://id.registrystack.org/problems/registry-documents/upload/expired" | "https://id.registrystack.org/problems/registry-documents/upload/finalized" | "https://id.registrystack.org/problems/registry-documents/upload/length-mismatch") & (string) }) +export type Schema_Problem = ({ "code": ("authentication.refused" | "custody.not-permitted" | "custody.quota-exceeded" | "document-grant.expiry-out-of-range" | "document-policy.unknown" | "document-version.not-releasable" | "document.content-type-not-allowed" | "document.too-large" | "idempotency.expired" | "idempotency.key-reused" | "profile.not-authorized" | "request.body-too-large" | "request.invalid" | "request.method-not-allowed" | "request.not-found" | "request.unprocessable" | "request.unsupported-media-type" | "resource.not-found" | "service.unavailable" | "upload.content-type-mismatch" | "upload.digest-mismatch" | "upload.expired" | "upload.finalized" | "upload.length-mismatch") & (string); "detail": (string); "failedCheck"?: (string); "status": (number); "title": (string); "traceId": (string); "type": ("https://id.registrystack.org/problems/registry-documents/authentication/refused" | "https://id.registrystack.org/problems/registry-documents/custody/not-permitted" | "https://id.registrystack.org/problems/registry-documents/custody/quota-exceeded" | "https://id.registrystack.org/problems/registry-documents/document-grant/expiry-out-of-range" | "https://id.registrystack.org/problems/registry-documents/document-policy/unknown" | "https://id.registrystack.org/problems/registry-documents/document-version/not-releasable" | "https://id.registrystack.org/problems/registry-documents/document/content-type-not-allowed" | "https://id.registrystack.org/problems/registry-documents/document/too-large" | "https://id.registrystack.org/problems/registry-documents/idempotency/expired" | "https://id.registrystack.org/problems/registry-documents/idempotency/key-reused" | "https://id.registrystack.org/problems/registry-documents/profile/not-authorized" | "https://id.registrystack.org/problems/registry-documents/request/body-too-large" | "https://id.registrystack.org/problems/registry-documents/request/invalid" | "https://id.registrystack.org/problems/registry-documents/request/method-not-allowed" | "https://id.registrystack.org/problems/registry-documents/request/not-found" | "https://id.registrystack.org/problems/registry-documents/request/unprocessable" | "https://id.registrystack.org/problems/registry-documents/request/unsupported-media-type" | "https://id.registrystack.org/problems/registry-documents/resource/not-found" | "https://id.registrystack.org/problems/registry-documents/service/unavailable" | "https://id.registrystack.org/problems/registry-documents/upload/content-type-mismatch" | "https://id.registrystack.org/problems/registry-documents/upload/digest-mismatch" | "https://id.registrystack.org/problems/registry-documents/upload/expired" | "https://id.registrystack.org/problems/registry-documents/upload/finalized" | "https://id.registrystack.org/problems/registry-documents/upload/length-mismatch") & (string) }) export type Schema_Readiness = ({ "developmentSettings": (Array<({ "code": (string); "pointer": (string) })>); "posture": ("production" | "development"); "status": "ready" }) export type Schema_ReservationView = ({ "document": Schema_DocumentView; "uploadExpiresAt": (string); "uploadPath": (string) }) export type Schema_ReserveDocumentRequest = ({ "custodian"?: Schema_CustodianRef; "expectedDigest": Schema_Digest; "issuingInstitution"?: Schema_ExternalId; "label"?: Schema_DocumentLabel; "length": (number); "mediaType": (string); "policyId": (string) }) @@ -65,7 +65,7 @@ const rules: Record = Object.fromEntries([ ["/components/schemas/IssueGrantRequest", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"expiryHours\":{\"minimum\":0,\"type\":\"integer\"},\"grantee\":{\"$ref\":\"/components/schemas/GranteeRef\"},\"versionId\":{\"type\":\"string\"}},\"required\":[\"versionId\",\"grantee\"],\"type\":\"object\"}")], ["/components/schemas/LocalId", JSON.parse("{\"pattern\":\"^[a-z][a-z0-9_-]{0,63}$\",\"type\":\"string\"}")], ["/components/schemas/PolicyBinding", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"digest\":{\"$ref\":\"/components/schemas/Digest\"},\"id\":{\"$ref\":\"/components/schemas/LocalId\"},\"version\":{\"type\":\"string\"}},\"required\":[\"id\",\"version\",\"digest\"],\"type\":\"object\"}")], - ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"code\":{\"enum\":[\"authentication.refused\",\"custody.not-permitted\",\"custody.quota-exceeded\",\"document-grant.expiry-out-of-range\",\"document-policy.unknown\",\"document-version.not-releasable\",\"document.content-type-not-allowed\",\"document.too-large\",\"idempotency.expired\",\"idempotency.key-reused\",\"profile.not-authorized\",\"request.body-too-large\",\"request.invalid\",\"request.method-not-allowed\",\"request.not-found\",\"request.unprocessable\",\"request.unsupported-media-type\",\"resource.not-found\",\"service.unavailable\",\"upload.content-type-mismatch\",\"upload.digest-mismatch\",\"upload.expired\",\"upload.finalized\",\"upload.length-mismatch\"],\"type\":\"string\"},\"detail\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"title\":{\"type\":\"string\"},\"traceId\":{\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-documents/authentication/refused\",\"https://id.registrystack.org/problems/registry-documents/custody/not-permitted\",\"https://id.registrystack.org/problems/registry-documents/custody/quota-exceeded\",\"https://id.registrystack.org/problems/registry-documents/document-grant/expiry-out-of-range\",\"https://id.registrystack.org/problems/registry-documents/document-policy/unknown\",\"https://id.registrystack.org/problems/registry-documents/document-version/not-releasable\",\"https://id.registrystack.org/problems/registry-documents/document/content-type-not-allowed\",\"https://id.registrystack.org/problems/registry-documents/document/too-large\",\"https://id.registrystack.org/problems/registry-documents/idempotency/expired\",\"https://id.registrystack.org/problems/registry-documents/idempotency/key-reused\",\"https://id.registrystack.org/problems/registry-documents/profile/not-authorized\",\"https://id.registrystack.org/problems/registry-documents/request/body-too-large\",\"https://id.registrystack.org/problems/registry-documents/request/invalid\",\"https://id.registrystack.org/problems/registry-documents/request/method-not-allowed\",\"https://id.registrystack.org/problems/registry-documents/request/not-found\",\"https://id.registrystack.org/problems/registry-documents/request/unprocessable\",\"https://id.registrystack.org/problems/registry-documents/request/unsupported-media-type\",\"https://id.registrystack.org/problems/registry-documents/resource/not-found\",\"https://id.registrystack.org/problems/registry-documents/service/unavailable\",\"https://id.registrystack.org/problems/registry-documents/upload/content-type-mismatch\",\"https://id.registrystack.org/problems/registry-documents/upload/digest-mismatch\",\"https://id.registrystack.org/problems/registry-documents/upload/expired\",\"https://id.registrystack.org/problems/registry-documents/upload/finalized\",\"https://id.registrystack.org/problems/registry-documents/upload/length-mismatch\"],\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], + ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"code\":{\"enum\":[\"authentication.refused\",\"custody.not-permitted\",\"custody.quota-exceeded\",\"document-grant.expiry-out-of-range\",\"document-policy.unknown\",\"document-version.not-releasable\",\"document.content-type-not-allowed\",\"document.too-large\",\"idempotency.expired\",\"idempotency.key-reused\",\"profile.not-authorized\",\"request.body-too-large\",\"request.invalid\",\"request.method-not-allowed\",\"request.not-found\",\"request.unprocessable\",\"request.unsupported-media-type\",\"resource.not-found\",\"service.unavailable\",\"upload.content-type-mismatch\",\"upload.digest-mismatch\",\"upload.expired\",\"upload.finalized\",\"upload.length-mismatch\"],\"type\":\"string\"},\"detail\":{\"type\":\"string\"},\"failedCheck\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"title\":{\"type\":\"string\"},\"traceId\":{\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-documents/authentication/refused\",\"https://id.registrystack.org/problems/registry-documents/custody/not-permitted\",\"https://id.registrystack.org/problems/registry-documents/custody/quota-exceeded\",\"https://id.registrystack.org/problems/registry-documents/document-grant/expiry-out-of-range\",\"https://id.registrystack.org/problems/registry-documents/document-policy/unknown\",\"https://id.registrystack.org/problems/registry-documents/document-version/not-releasable\",\"https://id.registrystack.org/problems/registry-documents/document/content-type-not-allowed\",\"https://id.registrystack.org/problems/registry-documents/document/too-large\",\"https://id.registrystack.org/problems/registry-documents/idempotency/expired\",\"https://id.registrystack.org/problems/registry-documents/idempotency/key-reused\",\"https://id.registrystack.org/problems/registry-documents/profile/not-authorized\",\"https://id.registrystack.org/problems/registry-documents/request/body-too-large\",\"https://id.registrystack.org/problems/registry-documents/request/invalid\",\"https://id.registrystack.org/problems/registry-documents/request/method-not-allowed\",\"https://id.registrystack.org/problems/registry-documents/request/not-found\",\"https://id.registrystack.org/problems/registry-documents/request/unprocessable\",\"https://id.registrystack.org/problems/registry-documents/request/unsupported-media-type\",\"https://id.registrystack.org/problems/registry-documents/resource/not-found\",\"https://id.registrystack.org/problems/registry-documents/service/unavailable\",\"https://id.registrystack.org/problems/registry-documents/upload/content-type-mismatch\",\"https://id.registrystack.org/problems/registry-documents/upload/digest-mismatch\",\"https://id.registrystack.org/problems/registry-documents/upload/expired\",\"https://id.registrystack.org/problems/registry-documents/upload/finalized\",\"https://id.registrystack.org/problems/registry-documents/upload/length-mismatch\"],\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], ["/components/schemas/Readiness", JSON.parse("{\"properties\":{\"developmentSettings\":{\"items\":{\"properties\":{\"code\":{\"type\":\"string\"},\"pointer\":{\"type\":\"string\"}},\"required\":[\"code\",\"pointer\"],\"type\":\"object\"},\"type\":\"array\"},\"posture\":{\"enum\":[\"production\",\"development\"]},\"status\":{\"const\":\"ready\"}},\"required\":[\"status\",\"posture\",\"developmentSettings\"],\"type\":\"object\"}")], ["/components/schemas/ReservationView", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"document\":{\"$ref\":\"/components/schemas/DocumentView\"},\"uploadExpiresAt\":{\"type\":\"string\"},\"uploadPath\":{\"type\":\"string\"}},\"required\":[\"document\",\"uploadPath\",\"uploadExpiresAt\"],\"type\":\"object\"}")], ["/components/schemas/ReserveDocumentRequest", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"custodian\":{\"$ref\":\"/components/schemas/CustodianRef\"},\"expectedDigest\":{\"$ref\":\"/components/schemas/Digest\"},\"issuingInstitution\":{\"$ref\":\"/components/schemas/ExternalId\"},\"label\":{\"$ref\":\"/components/schemas/DocumentLabel\"},\"length\":{\"minimum\":0,\"type\":\"integer\"},\"mediaType\":{\"type\":\"string\"},\"policyId\":{\"type\":\"string\"}},\"required\":[\"policyId\",\"expectedDigest\",\"length\",\"mediaType\"],\"type\":\"object\"}")], @@ -184,7 +184,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.51.0") + assertClientVersion("0.50.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/evidence-oid4vci.ts b/clients/typescript/generated/evidence-oid4vci.ts index 5d40c6a941..6dc1cedcc7 100644 --- a/clients/typescript/generated/evidence-oid4vci.ts +++ b/clients/typescript/generated/evidence-oid4vci.ts @@ -1,5 +1,5 @@ -// Generated for Stack version 0.51.0, client version 0.51.0. -// Source SHA-256 6a79e7501e3aa796c17617d3293ad46ebb62b2ea27bc856af10b60336e3897c8 +// Generated for Stack version 0.50.0, client version 0.50.0. +// Source SHA-256 218dc077f5442dd03c2f4f2b802413b3a9fd908ac01d3d838aafcacd73963c46 import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -10,7 +10,7 @@ export type Schema_Draft13PreAuthorizedCodeGrant = ({ "pre-authorized_code": (st export type Schema_OfferRequest = ({ "credentialConfigurationId": (string); "subjects": (Array); "transactionCode"?: (boolean) }) export type Schema_OfferResponse = ({ "credentialOffer": Schema_CredentialOffer; "credentialOfferUri": (string); "expiresIn": (number); "transactionCode"?: (string) }) export type Schema_PreAuthorizedCodeGrant = ({ "pre-authorized_code": (string); "tx_code"?: Schema_TransactionCodeDescription }) -export type Schema_Problem = ({ "error": ("access_denied" | "invalid_request" | "invalid_token" | "unsupported_grant_type" | "invalid_grant" | "invalid_credential_request" | "invalid_proof" | "invalid_nonce" | "credential_request_denied" | "temporarily_unavailable" | "server_error"); "error_description": (string) }) +export type Schema_Problem = ({ "error": ("access_denied" | "invalid_request" | "invalid_token" | "unsupported_grant_type" | "invalid_grant" | "invalid_credential_request" | "invalid_proof" | "invalid_nonce" | "credential_request_denied" | "temporarily_unavailable" | "server_error"); "error_description": (string); "failedCheck"?: (string) }) export type Schema_RequestedSubject = ({ "role": (string); "selectorValues"?: (Record) }) export type Schema_TransactionCodeDescription = ({ "input_mode": "numeric"; "length": 6 }) @@ -27,7 +27,7 @@ const rules: Record = Object.fromEntries([ ["/components/schemas/OfferRequest", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"credentialConfigurationId\":{\"type\":\"string\"},\"subjects\":{\"items\":{\"$ref\":\"/components/schemas/RequestedSubject\"},\"maxItems\":8,\"minItems\":1,\"type\":\"array\"},\"transactionCode\":{\"type\":\"boolean\"}},\"required\":[\"credentialConfigurationId\",\"subjects\"],\"type\":\"object\"}")], ["/components/schemas/OfferResponse", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"credentialOffer\":{\"$ref\":\"/components/schemas/CredentialOffer\"},\"credentialOfferUri\":{\"type\":\"string\"},\"expiresIn\":{\"maximum\":900,\"minimum\":60,\"type\":\"integer\"},\"transactionCode\":{\"pattern\":\"^[0-9]{6}$\",\"type\":\"string\"}},\"required\":[\"credentialOffer\",\"credentialOfferUri\",\"expiresIn\"],\"type\":\"object\"}")], ["/components/schemas/PreAuthorizedCodeGrant", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"pre-authorized_code\":{\"type\":\"string\"},\"tx_code\":{\"$ref\":\"/components/schemas/TransactionCodeDescription\"}},\"required\":[\"pre-authorized_code\"],\"type\":\"object\"}")], - ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"error\":{\"enum\":[\"access_denied\",\"invalid_request\",\"invalid_token\",\"unsupported_grant_type\",\"invalid_grant\",\"invalid_credential_request\",\"invalid_proof\",\"invalid_nonce\",\"credential_request_denied\",\"temporarily_unavailable\",\"server_error\"]},\"error_description\":{\"type\":\"string\"}},\"required\":[\"error\",\"error_description\"],\"type\":\"object\"}")], + ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"error\":{\"enum\":[\"access_denied\",\"invalid_request\",\"invalid_token\",\"unsupported_grant_type\",\"invalid_grant\",\"invalid_credential_request\",\"invalid_proof\",\"invalid_nonce\",\"credential_request_denied\",\"temporarily_unavailable\",\"server_error\"]},\"error_description\":{\"type\":\"string\"},\"failedCheck\":{\"type\":\"string\"}},\"required\":[\"error\",\"error_description\"],\"type\":\"object\"}")], ["/components/schemas/RequestedSubject", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"role\":{\"pattern\":\"^[a-z][a-z0-9._-]{0,63}$\",\"type\":\"string\"},\"selectorValues\":{\"additionalProperties\":{\"type\":[\"string\",\"integer\",\"boolean\"]},\"maxProperties\":16,\"type\":\"object\"}},\"required\":[\"role\"],\"type\":\"object\"}")], ["/components/schemas/TransactionCodeDescription", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"input_mode\":{\"const\":\"numeric\"},\"length\":{\"const\":6}},\"required\":[\"input_mode\",\"length\"],\"type\":\"object\"}")], ["/paths/~1offers/post/responses/201/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/OfferResponse\"}")], @@ -50,7 +50,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.51.0") + assertClientVersion("0.50.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/evidence-oid4vp.ts b/clients/typescript/generated/evidence-oid4vp.ts index a600a7a2d3..459fa4a0c5 100644 --- a/clients/typescript/generated/evidence-oid4vp.ts +++ b/clients/typescript/generated/evidence-oid4vp.ts @@ -1,5 +1,5 @@ -// Generated for Stack version 0.51.0, client version 0.51.0. -// Source SHA-256 96efd52e3c7176c603e3f9d47a23a9fbb1f7d4bb673bdc1682fb5eb74d115fc9 +// Generated for Stack version 0.50.0, client version 0.50.0. +// Source SHA-256 d75c4179f20a0db17beff06e65f74b00d6e5950ae789d8861d0e767929bffca8 import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -9,9 +9,9 @@ export type Schema_DidDocument = ({ "@context": (Array<(string)>); "assertionMet export type Schema_Empty = (Record) export type Schema_HealthResponse = ({ "status": "ok" }) export type Schema_Jwks = ({ "keys": (Array<({ "alg": "EdDSA"; "crv": "Ed25519"; "kid": (string); "kty": "OKP"; "use": "sig"; "x": (string) })>) }) -export type Schema_OAuthError = ({ "error": ("invalid_request" | "temporarily_unavailable") }) +export type Schema_OAuthError = ({ "error": ("invalid_request" | "temporarily_unavailable"); "failedCheck"?: (string) }) export type Schema_Principal = ({ "issuer": (string); "subject": (string) }) -export type Schema_Problem = ({ "detail"?: (string); "status": (number); "title": (string); "type": (string) }) +export type Schema_Problem = ({ "detail"?: (string); "failedCheck"?: (string); "status": (number); "title": (string); "type": (string) }) export type Schema_ReadRequest = ({ "principal": Schema_Principal; "reference": (string) }) export type Schema_ReadResponse = ({ "context": ({ "clientId": (string); "createdBy": Schema_Principal; "nonce": (string); "policyId": (string); "receivedAt": (string); "responseKeyThumbprint": (string); "responseUri": (string) }); "presentation": (Record)>) }) export type Schema_ReadinessResponse = ({ "developmentSettings"?: (Array<({ "code": (string); "pointer"?: (string) })>); "posture"?: ("development" | "production"); "status": ("ready" | "not_ready") }) @@ -37,9 +37,9 @@ const rules: Record = Object.fromEntries([ ["/components/schemas/Empty", JSON.parse("{\"additionalProperties\":false,\"type\":\"object\"}")], ["/components/schemas/HealthResponse", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"status\":{\"const\":\"ok\"}},\"required\":[\"status\"],\"type\":\"object\"}")], ["/components/schemas/Jwks", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"keys\":{\"items\":{\"additionalProperties\":false,\"properties\":{\"alg\":{\"const\":\"EdDSA\"},\"crv\":{\"const\":\"Ed25519\"},\"kid\":{\"type\":\"string\"},\"kty\":{\"const\":\"OKP\"},\"use\":{\"const\":\"sig\"},\"x\":{\"type\":\"string\"}},\"required\":[\"kty\",\"crv\",\"x\",\"kid\",\"use\",\"alg\"],\"type\":\"object\"},\"minItems\":1,\"type\":\"array\"}},\"required\":[\"keys\"],\"type\":\"object\"}")], - ["/components/schemas/OAuthError", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"error\":{\"enum\":[\"invalid_request\",\"temporarily_unavailable\"]}},\"required\":[\"error\"],\"type\":\"object\"}")], + ["/components/schemas/OAuthError", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"error\":{\"enum\":[\"invalid_request\",\"temporarily_unavailable\"]},\"failedCheck\":{\"type\":\"string\"}},\"required\":[\"error\"],\"type\":\"object\"}")], ["/components/schemas/Principal", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"issuer\":{\"type\":\"string\"},\"subject\":{\"type\":\"string\"}},\"required\":[\"issuer\",\"subject\"],\"type\":\"object\"}")], - ["/components/schemas/Problem", JSON.parse("{\"properties\":{\"detail\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"title\":{\"type\":\"string\"},\"type\":{\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\"],\"type\":\"object\"}")], + ["/components/schemas/Problem", JSON.parse("{\"properties\":{\"detail\":{\"type\":\"string\"},\"failedCheck\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"title\":{\"type\":\"string\"},\"type\":{\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\"],\"type\":\"object\"}")], ["/components/schemas/ReadRequest", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"principal\":{\"$ref\":\"/components/schemas/Principal\"},\"reference\":{\"type\":\"string\"}},\"required\":[\"reference\",\"principal\"],\"type\":\"object\"}")], ["/components/schemas/ReadResponse", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"context\":{\"additionalProperties\":false,\"properties\":{\"clientId\":{\"type\":\"string\"},\"createdBy\":{\"$ref\":\"/components/schemas/Principal\"},\"nonce\":{\"type\":\"string\"},\"policyId\":{\"type\":\"string\"},\"receivedAt\":{\"type\":\"string\"},\"responseKeyThumbprint\":{\"type\":\"string\"},\"responseUri\":{\"type\":\"string\"}},\"required\":[\"nonce\",\"clientId\",\"responseUri\",\"responseKeyThumbprint\",\"policyId\",\"createdBy\",\"receivedAt\"],\"type\":\"object\"},\"presentation\":{\"additionalProperties\":{\"items\":{\"type\":\"string\"},\"type\":\"array\"},\"type\":\"object\"}},\"required\":[\"presentation\",\"context\"],\"type\":\"object\"}")], ["/components/schemas/ReadinessResponse", JSON.parse("{\"additionalProperties\":false,\"else\":{\"maxProperties\":1},\"if\":{\"properties\":{\"status\":{\"const\":\"ready\"}}},\"properties\":{\"developmentSettings\":{\"items\":{\"additionalProperties\":false,\"properties\":{\"code\":{\"type\":\"string\"},\"pointer\":{\"type\":\"string\"}},\"required\":[\"code\"],\"type\":\"object\"},\"type\":\"array\"},\"posture\":{\"enum\":[\"development\",\"production\"]},\"status\":{\"enum\":[\"ready\",\"not_ready\"]}},\"required\":[\"status\"],\"then\":{\"required\":[\"posture\",\"developmentSettings\"]},\"type\":\"object\"}")], @@ -120,7 +120,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.51.0") + assertClientVersion("0.50.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/evidence.ts b/clients/typescript/generated/evidence.ts index cd5df15204..683f66dfdf 100644 --- a/clients/typescript/generated/evidence.ts +++ b/clients/typescript/generated/evidence.ts @@ -1,5 +1,5 @@ -// Generated for Stack version 0.51.0, client version 0.51.0. -// Source SHA-256 0efed0e1cfb0a05b17a1bbfd40ed25952674648d93d7fcf728a52d77b802d179 +// Generated for Stack version 0.50.0, client version 0.50.0. +// Source SHA-256 b9c0bb7eba93c05066706dec51ffea0da3d2eb323c641920ff63b4f49b2448e1 import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -32,7 +32,7 @@ export type Schema_JwksDocument = ({ "keys": (Array) }) export type Schema_JwtVcIssuerMetadata = ({ "issuer": (string); "jwks_uri": (string) }) export type Schema_P256PublicJwk = ({ "alg": ("ES256") & (string); "crv": ("P-256") & (string); "kid": (string); "kty": ("EC") & (string); "x": (string); "x5c"?: (Array<(string)>); "y": (string) }) export type Schema_PresentedCredential = ({ "issuedAt": (string); "issuer": (string); "subjectLink": ("possession" | "attribute-match") & (string); "trustEntry": (string); "type": (string) }) -export type Schema_Problem = (({ "code"?: ("evidence.invalid-request") & (string); "detail"?: ("the Evidence request is invalid") & (string); "status"?: (400) & (number); "title"?: ("Evidence request is invalid") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/evidence/invalid-request") & (string) }) | ({ "code"?: ("request.nonce-invalid") & (string); "detail"?: ("requestNonce must be 32 random bytes encoded as unpadded base64url (43 characters), generated anew for each request") & (string); "status"?: (400) & (number); "title"?: ("Request nonce is invalid") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/request/nonce-invalid") & (string) }) | ({ "code"?: ("request.selector-invalid") & (string); "detail"?: ("selector does not match an available request profile") & (string); "status"?: (400) & (number); "title"?: ("Selector is invalid") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/request/selector-invalid") & (string) }) | ({ "code"?: ("auth.invalid-credential") & (string); "detail"?: ("bearer access token validation failed") & (string); "status"?: (401) & (number); "title"?: ("Bearer access token is invalid") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/auth/invalid-credential") & (string) }) | ({ "code"?: ("platform.task-grant.development-assertion") & (string); "detail"?: ("task grant was issued in the development posture") & (string); "status"?: (401) & (number); "title"?: ("Development task assertion refused") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/platform/task-grant/development-assertion") & (string) }) | ({ "code"?: ("evidence.denied") & (string); "detail"?: ("the Evidence request is not permitted") & (string); "status"?: (403) & (number); "title"?: ("Evidence request is not permitted") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/evidence/denied") & (string) }) | ({ "code"?: ("format.unsupported") & (string); "detail"?: ("the requested format is not supported") & (string); "status"?: (406) & (number); "title"?: ("Requested format is not supported") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/format/unsupported") & (string) }) | ({ "code"?: ("evidence.unavailable") & (string); "detail"?: ("evidence could not be produced for this request") & (string); "status"?: (422) & (number); "title"?: ("Evidence could not be produced") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/evidence/unavailable") & (string) }) | ({ "code"?: ("evidence.rate-limited") & (string); "detail"?: ("the Evidence request rate is exhausted") & (string); "status"?: (429) & (number); "title"?: ("Evidence request rate is exhausted") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/evidence/rate-limited") & (string) }) | ({ "code"?: ("source.unavailable") & (string); "detail"?: ("the authoritative source is unavailable") & (string); "status"?: (503) & (number); "title"?: ("Authoritative source is unavailable") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/source/unavailable") & (string) }) | ({ "code"?: ("service.unavailable") & (string); "detail"?: ("the request could not be served") & (string); "status"?: (503) & (number); "title"?: ("Service is unavailable") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/service/unavailable") & (string) }) | ({ "code"?: ("resource.not-found") & (string); "detail"?: ("the requested resource was not found") & (string); "status"?: (404) & (number); "title"?: ("Requested resource was not found") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/resource/not-found") & (string) })) & ({ "code": ("evidence.invalid-request" | "request.nonce-invalid" | "request.selector-invalid" | "auth.invalid-credential" | "platform.task-grant.development-assertion" | "evidence.denied" | "format.unsupported" | "evidence.unavailable" | "evidence.rate-limited" | "source.unavailable" | "service.unavailable" | "resource.not-found") & (string); "detail": ("the Evidence request is invalid" | "requestNonce must be 32 random bytes encoded as unpadded base64url (43 characters), generated anew for each request" | "selector does not match an available request profile" | "bearer access token validation failed" | "task grant was issued in the development posture" | "the Evidence request is not permitted" | "the requested format is not supported" | "evidence could not be produced for this request" | "the Evidence request rate is exhausted" | "the authoritative source is unavailable" | "the request could not be served" | "the requested resource was not found") & (string); "status": (400 | 401 | 403 | 404 | 406 | 422 | 429 | 503) & (number); "title": ("Evidence request is invalid" | "Request nonce is invalid" | "Selector is invalid" | "Bearer access token is invalid" | "Development task assertion refused" | "Evidence request is not permitted" | "Requested format is not supported" | "Evidence could not be produced" | "Evidence request rate is exhausted" | "Authoritative source is unavailable" | "Service is unavailable" | "Requested resource was not found") & (string); "traceId": (string); "type": ("https://id.registrystack.org/problems/registry-evidence/evidence/invalid-request" | "https://id.registrystack.org/problems/registry-evidence/request/nonce-invalid" | "https://id.registrystack.org/problems/registry-evidence/request/selector-invalid" | "https://id.registrystack.org/problems/registry-evidence/auth/invalid-credential" | "https://id.registrystack.org/problems/registry-evidence/platform/task-grant/development-assertion" | "https://id.registrystack.org/problems/registry-evidence/evidence/denied" | "https://id.registrystack.org/problems/registry-evidence/format/unsupported" | "https://id.registrystack.org/problems/registry-evidence/evidence/unavailable" | "https://id.registrystack.org/problems/registry-evidence/evidence/rate-limited" | "https://id.registrystack.org/problems/registry-evidence/source/unavailable" | "https://id.registrystack.org/problems/registry-evidence/service/unavailable" | "https://id.registrystack.org/problems/registry-evidence/resource/not-found") & (string) }) +export type Schema_Problem = (({ "code"?: ("evidence.invalid-request") & (string); "detail"?: ("the Evidence request is invalid") & (string); "status"?: (400) & (number); "title"?: ("Evidence request is invalid") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/evidence/invalid-request") & (string) }) | ({ "code"?: ("request.nonce-invalid") & (string); "detail"?: ("requestNonce must be 32 random bytes encoded as unpadded base64url (43 characters), generated anew for each request") & (string); "status"?: (400) & (number); "title"?: ("Request nonce is invalid") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/request/nonce-invalid") & (string) }) | ({ "code"?: ("request.selector-invalid") & (string); "detail"?: ("selector does not match an available request profile") & (string); "status"?: (400) & (number); "title"?: ("Selector is invalid") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/request/selector-invalid") & (string) }) | ({ "code"?: ("auth.invalid-credential") & (string); "detail"?: ("bearer access token validation failed") & (string); "status"?: (401) & (number); "title"?: ("Bearer access token is invalid") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/auth/invalid-credential") & (string) }) | ({ "code"?: ("platform.task-grant.development-assertion") & (string); "detail"?: ("task grant was issued in the development posture") & (string); "status"?: (401) & (number); "title"?: ("Development task assertion refused") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/platform/task-grant/development-assertion") & (string) }) | ({ "code"?: ("evidence.denied") & (string); "detail"?: ("the Evidence request is not permitted") & (string); "status"?: (403) & (number); "title"?: ("Evidence request is not permitted") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/evidence/denied") & (string) }) | ({ "code"?: ("format.unsupported") & (string); "detail"?: ("the requested format is not supported") & (string); "status"?: (406) & (number); "title"?: ("Requested format is not supported") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/format/unsupported") & (string) }) | ({ "code"?: ("evidence.unavailable") & (string); "detail"?: ("evidence could not be produced for this request") & (string); "status"?: (422) & (number); "title"?: ("Evidence could not be produced") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/evidence/unavailable") & (string) }) | ({ "code"?: ("evidence.rate-limited") & (string); "detail"?: ("the Evidence request rate is exhausted") & (string); "status"?: (429) & (number); "title"?: ("Evidence request rate is exhausted") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/evidence/rate-limited") & (string) }) | ({ "code"?: ("source.unavailable") & (string); "detail"?: ("the authoritative source is unavailable") & (string); "status"?: (503) & (number); "title"?: ("Authoritative source is unavailable") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/source/unavailable") & (string) }) | ({ "code"?: ("service.unavailable") & (string); "detail"?: ("the request could not be served") & (string); "status"?: (503) & (number); "title"?: ("Service is unavailable") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/service/unavailable") & (string) }) | ({ "code"?: ("resource.not-found") & (string); "detail"?: ("the requested resource was not found") & (string); "status"?: (404) & (number); "title"?: ("Requested resource was not found") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/resource/not-found") & (string) })) & ({ "code": ("evidence.invalid-request" | "request.nonce-invalid" | "request.selector-invalid" | "auth.invalid-credential" | "platform.task-grant.development-assertion" | "evidence.denied" | "format.unsupported" | "evidence.unavailable" | "evidence.rate-limited" | "source.unavailable" | "service.unavailable" | "resource.not-found") & (string); "detail": ("the Evidence request is invalid" | "requestNonce must be 32 random bytes encoded as unpadded base64url (43 characters), generated anew for each request" | "selector does not match an available request profile" | "bearer access token validation failed" | "task grant was issued in the development posture" | "the Evidence request is not permitted" | "the requested format is not supported" | "evidence could not be produced for this request" | "the Evidence request rate is exhausted" | "the authoritative source is unavailable" | "the request could not be served" | "the requested resource was not found") & (string); "failedCheck"?: (string); "status": (400 | 401 | 403 | 404 | 406 | 422 | 429 | 503) & (number); "title": ("Evidence request is invalid" | "Request nonce is invalid" | "Selector is invalid" | "Bearer access token is invalid" | "Development task assertion refused" | "Evidence request is not permitted" | "Requested format is not supported" | "Evidence could not be produced" | "Evidence request rate is exhausted" | "Authoritative source is unavailable" | "Service is unavailable" | "Requested resource was not found") & (string); "traceId": (string); "type": ("https://id.registrystack.org/problems/registry-evidence/evidence/invalid-request" | "https://id.registrystack.org/problems/registry-evidence/request/nonce-invalid" | "https://id.registrystack.org/problems/registry-evidence/request/selector-invalid" | "https://id.registrystack.org/problems/registry-evidence/auth/invalid-credential" | "https://id.registrystack.org/problems/registry-evidence/platform/task-grant/development-assertion" | "https://id.registrystack.org/problems/registry-evidence/evidence/denied" | "https://id.registrystack.org/problems/registry-evidence/format/unsupported" | "https://id.registrystack.org/problems/registry-evidence/evidence/unavailable" | "https://id.registrystack.org/problems/registry-evidence/evidence/rate-limited" | "https://id.registrystack.org/problems/registry-evidence/source/unavailable" | "https://id.registrystack.org/problems/registry-evidence/service/unavailable" | "https://id.registrystack.org/problems/registry-evidence/resource/not-found") & (string) }) export type Schema_ProtectedResourceMetadata = ({ "authorization_servers": (Array<(string)>); "bearer_methods_supported": (Array<"header">); "jwks_uri": (string); "resource": (string) }) export type Schema_PublicCheckAnswer = ({ "fields": (Record); "observedAt": (string); "schema": ("registry.evidence.public-check/v1alpha1") & (string); "status": ("valid" | "suspended" | "revoked" | "expired") & (string) }) export type Schema_PublicCheckRequest = ({ "checkCode": (string); "documentNumber": (string) }) @@ -96,7 +96,7 @@ const rules: Record = Object.fromEntries([ ["/components/schemas/JwtVcIssuerMetadata", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"issuer\":{\"maxLength\":512,\"type\":\"string\"},\"jwks_uri\":{\"maxLength\":1024,\"type\":\"string\"}},\"required\":[\"issuer\",\"jwks_uri\"],\"type\":\"object\"}")], ["/components/schemas/P256PublicJwk", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"alg\":{\"enum\":[\"ES256\"],\"type\":\"string\"},\"crv\":{\"enum\":[\"P-256\"],\"type\":\"string\"},\"kid\":{\"pattern\":\"^[A-Za-z0-9_-]{43}$\",\"type\":\"string\"},\"kty\":{\"enum\":[\"EC\"],\"type\":\"string\"},\"x\":{\"pattern\":\"^[A-Za-z0-9_-]{43}$\",\"type\":\"string\"},\"x5c\":{\"items\":{\"maxLength\":21848,\"minLength\":1,\"type\":\"string\"},\"maxItems\":3,\"minItems\":1,\"type\":\"array\"},\"y\":{\"pattern\":\"^[A-Za-z0-9_-]{43}$\",\"type\":\"string\"}},\"required\":[\"kty\",\"kid\",\"alg\",\"crv\",\"x\",\"y\"],\"type\":\"object\"}")], ["/components/schemas/PresentedCredential", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"issuedAt\":{\"type\":\"string\"},\"issuer\":{\"maxLength\":512,\"type\":\"string\"},\"subjectLink\":{\"enum\":[\"possession\",\"attribute-match\"],\"type\":\"string\"},\"trustEntry\":{\"pattern\":\"^[a-z][a-z0-9_-]{0,63}$\",\"type\":\"string\"},\"type\":{\"maxLength\":512,\"minLength\":1,\"type\":\"string\"}},\"required\":[\"trustEntry\",\"issuer\",\"type\",\"issuedAt\",\"subjectLink\"],\"type\":\"object\"}")], - ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"oneOf\":[{\"properties\":{\"code\":{\"enum\":[\"evidence.invalid-request\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the Evidence request is invalid\"],\"type\":\"string\"},\"status\":{\"enum\":[400],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence request is invalid\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/invalid-request\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"request.nonce-invalid\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"requestNonce must be 32 random bytes encoded as unpadded base64url (43 characters), generated anew for each request\"],\"type\":\"string\"},\"status\":{\"enum\":[400],\"type\":\"integer\"},\"title\":{\"enum\":[\"Request nonce is invalid\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/request/nonce-invalid\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"request.selector-invalid\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"selector does not match an available request profile\"],\"type\":\"string\"},\"status\":{\"enum\":[400],\"type\":\"integer\"},\"title\":{\"enum\":[\"Selector is invalid\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/request/selector-invalid\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"auth.invalid-credential\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"bearer access token validation failed\"],\"type\":\"string\"},\"status\":{\"enum\":[401],\"type\":\"integer\"},\"title\":{\"enum\":[\"Bearer access token is invalid\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/auth/invalid-credential\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"platform.task-grant.development-assertion\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"task grant was issued in the development posture\"],\"type\":\"string\"},\"status\":{\"enum\":[401],\"type\":\"integer\"},\"title\":{\"enum\":[\"Development task assertion refused\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/platform/task-grant/development-assertion\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"evidence.denied\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the Evidence request is not permitted\"],\"type\":\"string\"},\"status\":{\"enum\":[403],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence request is not permitted\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/denied\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"format.unsupported\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the requested format is not supported\"],\"type\":\"string\"},\"status\":{\"enum\":[406],\"type\":\"integer\"},\"title\":{\"enum\":[\"Requested format is not supported\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/format/unsupported\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"evidence.unavailable\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"evidence could not be produced for this request\"],\"type\":\"string\"},\"status\":{\"enum\":[422],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence could not be produced\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/unavailable\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"evidence.rate-limited\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the Evidence request rate is exhausted\"],\"type\":\"string\"},\"status\":{\"enum\":[429],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence request rate is exhausted\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/rate-limited\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"source.unavailable\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the authoritative source is unavailable\"],\"type\":\"string\"},\"status\":{\"enum\":[503],\"type\":\"integer\"},\"title\":{\"enum\":[\"Authoritative source is unavailable\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/source/unavailable\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"service.unavailable\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the request could not be served\"],\"type\":\"string\"},\"status\":{\"enum\":[503],\"type\":\"integer\"},\"title\":{\"enum\":[\"Service is unavailable\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/service/unavailable\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"resource.not-found\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the requested resource was not found\"],\"type\":\"string\"},\"status\":{\"enum\":[404],\"type\":\"integer\"},\"title\":{\"enum\":[\"Requested resource was not found\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/resource/not-found\"],\"type\":\"string\"}}}],\"properties\":{\"code\":{\"enum\":[\"evidence.invalid-request\",\"request.nonce-invalid\",\"request.selector-invalid\",\"auth.invalid-credential\",\"platform.task-grant.development-assertion\",\"evidence.denied\",\"format.unsupported\",\"evidence.unavailable\",\"evidence.rate-limited\",\"source.unavailable\",\"service.unavailable\",\"resource.not-found\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the Evidence request is invalid\",\"requestNonce must be 32 random bytes encoded as unpadded base64url (43 characters), generated anew for each request\",\"selector does not match an available request profile\",\"bearer access token validation failed\",\"task grant was issued in the development posture\",\"the Evidence request is not permitted\",\"the requested format is not supported\",\"evidence could not be produced for this request\",\"the Evidence request rate is exhausted\",\"the authoritative source is unavailable\",\"the request could not be served\",\"the requested resource was not found\"],\"type\":\"string\"},\"status\":{\"enum\":[400,401,403,404,406,422,429,503],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence request is invalid\",\"Request nonce is invalid\",\"Selector is invalid\",\"Bearer access token is invalid\",\"Development task assertion refused\",\"Evidence request is not permitted\",\"Requested format is not supported\",\"Evidence could not be produced\",\"Evidence request rate is exhausted\",\"Authoritative source is unavailable\",\"Service is unavailable\",\"Requested resource was not found\"],\"type\":\"string\"},\"traceId\":{\"pattern\":\"^(?!0{32}$)[0-9a-f]{32}$\",\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/invalid-request\",\"https://id.registrystack.org/problems/registry-evidence/request/nonce-invalid\",\"https://id.registrystack.org/problems/registry-evidence/request/selector-invalid\",\"https://id.registrystack.org/problems/registry-evidence/auth/invalid-credential\",\"https://id.registrystack.org/problems/registry-evidence/platform/task-grant/development-assertion\",\"https://id.registrystack.org/problems/registry-evidence/evidence/denied\",\"https://id.registrystack.org/problems/registry-evidence/format/unsupported\",\"https://id.registrystack.org/problems/registry-evidence/evidence/unavailable\",\"https://id.registrystack.org/problems/registry-evidence/evidence/rate-limited\",\"https://id.registrystack.org/problems/registry-evidence/source/unavailable\",\"https://id.registrystack.org/problems/registry-evidence/service/unavailable\",\"https://id.registrystack.org/problems/registry-evidence/resource/not-found\"],\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], + ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"oneOf\":[{\"properties\":{\"code\":{\"enum\":[\"evidence.invalid-request\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the Evidence request is invalid\"],\"type\":\"string\"},\"status\":{\"enum\":[400],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence request is invalid\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/invalid-request\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"request.nonce-invalid\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"requestNonce must be 32 random bytes encoded as unpadded base64url (43 characters), generated anew for each request\"],\"type\":\"string\"},\"status\":{\"enum\":[400],\"type\":\"integer\"},\"title\":{\"enum\":[\"Request nonce is invalid\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/request/nonce-invalid\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"request.selector-invalid\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"selector does not match an available request profile\"],\"type\":\"string\"},\"status\":{\"enum\":[400],\"type\":\"integer\"},\"title\":{\"enum\":[\"Selector is invalid\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/request/selector-invalid\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"auth.invalid-credential\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"bearer access token validation failed\"],\"type\":\"string\"},\"status\":{\"enum\":[401],\"type\":\"integer\"},\"title\":{\"enum\":[\"Bearer access token is invalid\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/auth/invalid-credential\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"platform.task-grant.development-assertion\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"task grant was issued in the development posture\"],\"type\":\"string\"},\"status\":{\"enum\":[401],\"type\":\"integer\"},\"title\":{\"enum\":[\"Development task assertion refused\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/platform/task-grant/development-assertion\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"evidence.denied\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the Evidence request is not permitted\"],\"type\":\"string\"},\"status\":{\"enum\":[403],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence request is not permitted\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/denied\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"format.unsupported\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the requested format is not supported\"],\"type\":\"string\"},\"status\":{\"enum\":[406],\"type\":\"integer\"},\"title\":{\"enum\":[\"Requested format is not supported\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/format/unsupported\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"evidence.unavailable\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"evidence could not be produced for this request\"],\"type\":\"string\"},\"status\":{\"enum\":[422],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence could not be produced\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/unavailable\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"evidence.rate-limited\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the Evidence request rate is exhausted\"],\"type\":\"string\"},\"status\":{\"enum\":[429],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence request rate is exhausted\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/rate-limited\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"source.unavailable\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the authoritative source is unavailable\"],\"type\":\"string\"},\"status\":{\"enum\":[503],\"type\":\"integer\"},\"title\":{\"enum\":[\"Authoritative source is unavailable\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/source/unavailable\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"service.unavailable\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the request could not be served\"],\"type\":\"string\"},\"status\":{\"enum\":[503],\"type\":\"integer\"},\"title\":{\"enum\":[\"Service is unavailable\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/service/unavailable\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"resource.not-found\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the requested resource was not found\"],\"type\":\"string\"},\"status\":{\"enum\":[404],\"type\":\"integer\"},\"title\":{\"enum\":[\"Requested resource was not found\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/resource/not-found\"],\"type\":\"string\"}}}],\"properties\":{\"code\":{\"enum\":[\"evidence.invalid-request\",\"request.nonce-invalid\",\"request.selector-invalid\",\"auth.invalid-credential\",\"platform.task-grant.development-assertion\",\"evidence.denied\",\"format.unsupported\",\"evidence.unavailable\",\"evidence.rate-limited\",\"source.unavailable\",\"service.unavailable\",\"resource.not-found\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the Evidence request is invalid\",\"requestNonce must be 32 random bytes encoded as unpadded base64url (43 characters), generated anew for each request\",\"selector does not match an available request profile\",\"bearer access token validation failed\",\"task grant was issued in the development posture\",\"the Evidence request is not permitted\",\"the requested format is not supported\",\"evidence could not be produced for this request\",\"the Evidence request rate is exhausted\",\"the authoritative source is unavailable\",\"the request could not be served\",\"the requested resource was not found\"],\"type\":\"string\"},\"failedCheck\":{\"type\":\"string\"},\"status\":{\"enum\":[400,401,403,404,406,422,429,503],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence request is invalid\",\"Request nonce is invalid\",\"Selector is invalid\",\"Bearer access token is invalid\",\"Development task assertion refused\",\"Evidence request is not permitted\",\"Requested format is not supported\",\"Evidence could not be produced\",\"Evidence request rate is exhausted\",\"Authoritative source is unavailable\",\"Service is unavailable\",\"Requested resource was not found\"],\"type\":\"string\"},\"traceId\":{\"pattern\":\"^(?!0{32}$)[0-9a-f]{32}$\",\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/invalid-request\",\"https://id.registrystack.org/problems/registry-evidence/request/nonce-invalid\",\"https://id.registrystack.org/problems/registry-evidence/request/selector-invalid\",\"https://id.registrystack.org/problems/registry-evidence/auth/invalid-credential\",\"https://id.registrystack.org/problems/registry-evidence/platform/task-grant/development-assertion\",\"https://id.registrystack.org/problems/registry-evidence/evidence/denied\",\"https://id.registrystack.org/problems/registry-evidence/format/unsupported\",\"https://id.registrystack.org/problems/registry-evidence/evidence/unavailable\",\"https://id.registrystack.org/problems/registry-evidence/evidence/rate-limited\",\"https://id.registrystack.org/problems/registry-evidence/source/unavailable\",\"https://id.registrystack.org/problems/registry-evidence/service/unavailable\",\"https://id.registrystack.org/problems/registry-evidence/resource/not-found\"],\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], ["/components/schemas/ProtectedResourceMetadata", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"authorization_servers\":{\"items\":{\"maxLength\":512,\"type\":\"string\"},\"maxItems\":1,\"minItems\":1,\"type\":\"array\",\"uniqueItems\":true},\"bearer_methods_supported\":{\"items\":{\"const\":\"header\"},\"maxItems\":1,\"minItems\":1,\"type\":\"array\",\"uniqueItems\":true},\"jwks_uri\":{\"maxLength\":1024,\"type\":\"string\"},\"resource\":{\"maxLength\":512,\"type\":\"string\"}},\"required\":[\"resource\",\"authorization_servers\",\"jwks_uri\",\"bearer_methods_supported\"],\"type\":\"object\"}")], ["/components/schemas/PublicCheckAnswer", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"fields\":{\"type\":\"object\"},\"observedAt\":{\"pattern\":\"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$\",\"type\":\"string\"},\"schema\":{\"enum\":[\"registry.evidence.public-check/v1alpha1\"],\"type\":\"string\"},\"status\":{\"enum\":[\"valid\",\"suspended\",\"revoked\",\"expired\"],\"type\":\"string\"}},\"required\":[\"schema\",\"status\",\"fields\",\"observedAt\"],\"type\":\"object\"}")], ["/components/schemas/PublicCheckRequest", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"checkCode\":{\"pattern\":\"^[A-Za-z2-7]{24}$\",\"type\":\"string\"},\"documentNumber\":{\"minLength\":1,\"type\":\"string\"}},\"required\":[\"documentNumber\",\"checkCode\"],\"type\":\"object\"}")], @@ -173,7 +173,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.51.0") + assertClientVersion("0.50.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/messaging.ts b/clients/typescript/generated/messaging.ts index 4a4d714c09..bb4363f29a 100644 --- a/clients/typescript/generated/messaging.ts +++ b/clients/typescript/generated/messaging.ts @@ -1,5 +1,5 @@ -// Generated for Stack version 0.51.0, client version 0.51.0. -// Source SHA-256 25ae1bbe330a1d77df32ec07a9fd12eb272bca5fbb19379e7cce19cb8c773810 +// Generated for Stack version 0.50.0, client version 0.50.0. +// Source SHA-256 f0ab883a6241d7686d1f9d6b896bea6e2798a9471435ad587b1955c5f64a548f // Unconstrained JSON /components/schemas/SubmitMessageRequest/properties/data // Unconstrained JSON /components/schemas/TemplatePreviewRequest/properties/data // Unconstrained JSON /paths/~1v1~1provider-callbacks~1{provider_id}/post/requestBody/content/application~1json/schema @@ -15,7 +15,7 @@ export type Schema_MessageReceipt = ({ "id": (string); "links": Schema_MessageLi export type Schema_MessageReport = ("none" | "sent" | "delivered" | "undelivered" | "unavailable") & (string) export type Schema_MessageStatus = ("queued" | "sending" | "submitted" | "delivered" | "failed" | "expired" | "cancelled" | "unknown") & (string) export type Schema_MessageView = ({ "acceptedAt": (string); "attempts": (Array); "channel": ("email" | "sms") & (string); "correlationId"?: (string); "dispatch": Schema_MessageDispatch; "expiresAt": (string); "id": (string); "links": Schema_MessageLinks; "notBefore"?: (string); "report": Schema_MessageReport; "reportedAt"?: (string); "senderProfile": (string); "status": Schema_MessageStatus; "template"?: Schema_TemplateReference; "to": Schema_MaskedRecipient; "updatedAt": (string) }) -export type Schema_Problem = ({ "code": ("authentication.refused" | "callback.unreadable" | "callback.unverified" | "content.invalid" | "content.too-large" | "content.too-many-segments" | "idempotency.expired" | "idempotency.key-reused" | "message.dispatch-started" | "message.not-visible" | "message.terminal" | "operation.not-authorized" | "profile.not-authorized" | "quota.exceeded" | "rate-limit.exceeded" | "receipt.unresolved" | "request.body-too-large" | "request.invalid" | "request.method-not-allowed" | "request.not-found" | "request.unprocessable" | "request.unsupported-media-type" | "service.unavailable" | "template.data-invalid" | "template.locale-unavailable" | "template.not-found" | "template.render-refused") & (string); "detail": (string); "status": (number); "title": (string); "traceId": (string); "type": ("https://id.registrystack.org/problems/registry-messaging/authentication/refused" | "https://id.registrystack.org/problems/registry-messaging/callback/unreadable" | "https://id.registrystack.org/problems/registry-messaging/callback/unverified" | "https://id.registrystack.org/problems/registry-messaging/content/invalid" | "https://id.registrystack.org/problems/registry-messaging/content/too-large" | "https://id.registrystack.org/problems/registry-messaging/content/too-many-segments" | "https://id.registrystack.org/problems/registry-messaging/idempotency/expired" | "https://id.registrystack.org/problems/registry-messaging/idempotency/key-reused" | "https://id.registrystack.org/problems/registry-messaging/message/dispatch-started" | "https://id.registrystack.org/problems/registry-messaging/message/not-visible" | "https://id.registrystack.org/problems/registry-messaging/message/terminal" | "https://id.registrystack.org/problems/registry-messaging/operation/not-authorized" | "https://id.registrystack.org/problems/registry-messaging/profile/not-authorized" | "https://id.registrystack.org/problems/registry-messaging/quota/exceeded" | "https://id.registrystack.org/problems/registry-messaging/rate-limit/exceeded" | "https://id.registrystack.org/problems/registry-messaging/receipt/unresolved" | "https://id.registrystack.org/problems/registry-messaging/request/body-too-large" | "https://id.registrystack.org/problems/registry-messaging/request/invalid" | "https://id.registrystack.org/problems/registry-messaging/request/method-not-allowed" | "https://id.registrystack.org/problems/registry-messaging/request/not-found" | "https://id.registrystack.org/problems/registry-messaging/request/unprocessable" | "https://id.registrystack.org/problems/registry-messaging/request/unsupported-media-type" | "https://id.registrystack.org/problems/registry-messaging/service/unavailable" | "https://id.registrystack.org/problems/registry-messaging/template/data-invalid" | "https://id.registrystack.org/problems/registry-messaging/template/locale-unavailable" | "https://id.registrystack.org/problems/registry-messaging/template/not-found" | "https://id.registrystack.org/problems/registry-messaging/template/render-refused") & (string) }) +export type Schema_Problem = ({ "code": ("authentication.refused" | "callback.unreadable" | "callback.unverified" | "content.invalid" | "content.too-large" | "content.too-many-segments" | "idempotency.expired" | "idempotency.key-reused" | "message.dispatch-started" | "message.not-visible" | "message.terminal" | "operation.not-authorized" | "profile.not-authorized" | "quota.exceeded" | "rate-limit.exceeded" | "receipt.unresolved" | "request.body-too-large" | "request.invalid" | "request.method-not-allowed" | "request.not-found" | "request.unprocessable" | "request.unsupported-media-type" | "service.unavailable" | "template.data-invalid" | "template.locale-unavailable" | "template.not-found" | "template.render-refused") & (string); "detail": (string); "failedCheck"?: (string); "status": (number); "title": (string); "traceId": (string); "type": ("https://id.registrystack.org/problems/registry-messaging/authentication/refused" | "https://id.registrystack.org/problems/registry-messaging/callback/unreadable" | "https://id.registrystack.org/problems/registry-messaging/callback/unverified" | "https://id.registrystack.org/problems/registry-messaging/content/invalid" | "https://id.registrystack.org/problems/registry-messaging/content/too-large" | "https://id.registrystack.org/problems/registry-messaging/content/too-many-segments" | "https://id.registrystack.org/problems/registry-messaging/idempotency/expired" | "https://id.registrystack.org/problems/registry-messaging/idempotency/key-reused" | "https://id.registrystack.org/problems/registry-messaging/message/dispatch-started" | "https://id.registrystack.org/problems/registry-messaging/message/not-visible" | "https://id.registrystack.org/problems/registry-messaging/message/terminal" | "https://id.registrystack.org/problems/registry-messaging/operation/not-authorized" | "https://id.registrystack.org/problems/registry-messaging/profile/not-authorized" | "https://id.registrystack.org/problems/registry-messaging/quota/exceeded" | "https://id.registrystack.org/problems/registry-messaging/rate-limit/exceeded" | "https://id.registrystack.org/problems/registry-messaging/receipt/unresolved" | "https://id.registrystack.org/problems/registry-messaging/request/body-too-large" | "https://id.registrystack.org/problems/registry-messaging/request/invalid" | "https://id.registrystack.org/problems/registry-messaging/request/method-not-allowed" | "https://id.registrystack.org/problems/registry-messaging/request/not-found" | "https://id.registrystack.org/problems/registry-messaging/request/unprocessable" | "https://id.registrystack.org/problems/registry-messaging/request/unsupported-media-type" | "https://id.registrystack.org/problems/registry-messaging/service/unavailable" | "https://id.registrystack.org/problems/registry-messaging/template/data-invalid" | "https://id.registrystack.org/problems/registry-messaging/template/locale-unavailable" | "https://id.registrystack.org/problems/registry-messaging/template/not-found" | "https://id.registrystack.org/problems/registry-messaging/template/render-refused") & (string) }) export type Schema_ReadyStatus = ({ "developmentSettings": (Array<({ "code": (string); "pointer": (string) })>); "posture": ("development" | "production"); "status": "ready" }) export type Schema_Recipient = (({ "email": (string) }) | ({ "phone": (string) })) export type Schema_SubmitMessageRequest = ({ "content"?: ({ "subject"?: (string); "text": (string) }); "correlationId"?: (string); "data"?: JsonValue; "expiresAt"?: (string); "locale"?: (string); "notBefore"?: (string); "senderProfile": (string); "template"?: Schema_TemplateReference; "to": Schema_Recipient }) @@ -44,7 +44,7 @@ const rules: Record = Object.fromEntries([ ["/components/schemas/MessageReport", JSON.parse("{\"enum\":[\"none\",\"sent\",\"delivered\",\"undelivered\",\"unavailable\"],\"type\":\"string\"}")], ["/components/schemas/MessageStatus", JSON.parse("{\"enum\":[\"queued\",\"sending\",\"submitted\",\"delivered\",\"failed\",\"expired\",\"cancelled\",\"unknown\"],\"type\":\"string\"}")], ["/components/schemas/MessageView", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"acceptedAt\":{\"type\":\"string\"},\"attempts\":{\"items\":{\"$ref\":\"/components/schemas/AttemptSummary\"},\"type\":\"array\"},\"channel\":{\"enum\":[\"email\",\"sms\"],\"type\":\"string\"},\"correlationId\":{\"type\":\"string\"},\"dispatch\":{\"$ref\":\"/components/schemas/MessageDispatch\"},\"expiresAt\":{\"type\":\"string\"},\"id\":{\"type\":\"string\"},\"links\":{\"$ref\":\"/components/schemas/MessageLinks\"},\"notBefore\":{\"type\":\"string\"},\"report\":{\"$ref\":\"/components/schemas/MessageReport\"},\"reportedAt\":{\"type\":\"string\"},\"senderProfile\":{\"type\":\"string\"},\"status\":{\"$ref\":\"/components/schemas/MessageStatus\"},\"template\":{\"$ref\":\"/components/schemas/TemplateReference\"},\"to\":{\"$ref\":\"/components/schemas/MaskedRecipient\"},\"updatedAt\":{\"type\":\"string\"}},\"required\":[\"id\",\"status\",\"dispatch\",\"report\",\"channel\",\"senderProfile\",\"to\",\"acceptedAt\",\"expiresAt\",\"updatedAt\",\"attempts\",\"links\"],\"type\":\"object\"}")], - ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"code\":{\"enum\":[\"authentication.refused\",\"callback.unreadable\",\"callback.unverified\",\"content.invalid\",\"content.too-large\",\"content.too-many-segments\",\"idempotency.expired\",\"idempotency.key-reused\",\"message.dispatch-started\",\"message.not-visible\",\"message.terminal\",\"operation.not-authorized\",\"profile.not-authorized\",\"quota.exceeded\",\"rate-limit.exceeded\",\"receipt.unresolved\",\"request.body-too-large\",\"request.invalid\",\"request.method-not-allowed\",\"request.not-found\",\"request.unprocessable\",\"request.unsupported-media-type\",\"service.unavailable\",\"template.data-invalid\",\"template.locale-unavailable\",\"template.not-found\",\"template.render-refused\"],\"type\":\"string\"},\"detail\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"title\":{\"type\":\"string\"},\"traceId\":{\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-messaging/authentication/refused\",\"https://id.registrystack.org/problems/registry-messaging/callback/unreadable\",\"https://id.registrystack.org/problems/registry-messaging/callback/unverified\",\"https://id.registrystack.org/problems/registry-messaging/content/invalid\",\"https://id.registrystack.org/problems/registry-messaging/content/too-large\",\"https://id.registrystack.org/problems/registry-messaging/content/too-many-segments\",\"https://id.registrystack.org/problems/registry-messaging/idempotency/expired\",\"https://id.registrystack.org/problems/registry-messaging/idempotency/key-reused\",\"https://id.registrystack.org/problems/registry-messaging/message/dispatch-started\",\"https://id.registrystack.org/problems/registry-messaging/message/not-visible\",\"https://id.registrystack.org/problems/registry-messaging/message/terminal\",\"https://id.registrystack.org/problems/registry-messaging/operation/not-authorized\",\"https://id.registrystack.org/problems/registry-messaging/profile/not-authorized\",\"https://id.registrystack.org/problems/registry-messaging/quota/exceeded\",\"https://id.registrystack.org/problems/registry-messaging/rate-limit/exceeded\",\"https://id.registrystack.org/problems/registry-messaging/receipt/unresolved\",\"https://id.registrystack.org/problems/registry-messaging/request/body-too-large\",\"https://id.registrystack.org/problems/registry-messaging/request/invalid\",\"https://id.registrystack.org/problems/registry-messaging/request/method-not-allowed\",\"https://id.registrystack.org/problems/registry-messaging/request/not-found\",\"https://id.registrystack.org/problems/registry-messaging/request/unprocessable\",\"https://id.registrystack.org/problems/registry-messaging/request/unsupported-media-type\",\"https://id.registrystack.org/problems/registry-messaging/service/unavailable\",\"https://id.registrystack.org/problems/registry-messaging/template/data-invalid\",\"https://id.registrystack.org/problems/registry-messaging/template/locale-unavailable\",\"https://id.registrystack.org/problems/registry-messaging/template/not-found\",\"https://id.registrystack.org/problems/registry-messaging/template/render-refused\"],\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], + ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"code\":{\"enum\":[\"authentication.refused\",\"callback.unreadable\",\"callback.unverified\",\"content.invalid\",\"content.too-large\",\"content.too-many-segments\",\"idempotency.expired\",\"idempotency.key-reused\",\"message.dispatch-started\",\"message.not-visible\",\"message.terminal\",\"operation.not-authorized\",\"profile.not-authorized\",\"quota.exceeded\",\"rate-limit.exceeded\",\"receipt.unresolved\",\"request.body-too-large\",\"request.invalid\",\"request.method-not-allowed\",\"request.not-found\",\"request.unprocessable\",\"request.unsupported-media-type\",\"service.unavailable\",\"template.data-invalid\",\"template.locale-unavailable\",\"template.not-found\",\"template.render-refused\"],\"type\":\"string\"},\"detail\":{\"type\":\"string\"},\"failedCheck\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"title\":{\"type\":\"string\"},\"traceId\":{\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-messaging/authentication/refused\",\"https://id.registrystack.org/problems/registry-messaging/callback/unreadable\",\"https://id.registrystack.org/problems/registry-messaging/callback/unverified\",\"https://id.registrystack.org/problems/registry-messaging/content/invalid\",\"https://id.registrystack.org/problems/registry-messaging/content/too-large\",\"https://id.registrystack.org/problems/registry-messaging/content/too-many-segments\",\"https://id.registrystack.org/problems/registry-messaging/idempotency/expired\",\"https://id.registrystack.org/problems/registry-messaging/idempotency/key-reused\",\"https://id.registrystack.org/problems/registry-messaging/message/dispatch-started\",\"https://id.registrystack.org/problems/registry-messaging/message/not-visible\",\"https://id.registrystack.org/problems/registry-messaging/message/terminal\",\"https://id.registrystack.org/problems/registry-messaging/operation/not-authorized\",\"https://id.registrystack.org/problems/registry-messaging/profile/not-authorized\",\"https://id.registrystack.org/problems/registry-messaging/quota/exceeded\",\"https://id.registrystack.org/problems/registry-messaging/rate-limit/exceeded\",\"https://id.registrystack.org/problems/registry-messaging/receipt/unresolved\",\"https://id.registrystack.org/problems/registry-messaging/request/body-too-large\",\"https://id.registrystack.org/problems/registry-messaging/request/invalid\",\"https://id.registrystack.org/problems/registry-messaging/request/method-not-allowed\",\"https://id.registrystack.org/problems/registry-messaging/request/not-found\",\"https://id.registrystack.org/problems/registry-messaging/request/unprocessable\",\"https://id.registrystack.org/problems/registry-messaging/request/unsupported-media-type\",\"https://id.registrystack.org/problems/registry-messaging/service/unavailable\",\"https://id.registrystack.org/problems/registry-messaging/template/data-invalid\",\"https://id.registrystack.org/problems/registry-messaging/template/locale-unavailable\",\"https://id.registrystack.org/problems/registry-messaging/template/not-found\",\"https://id.registrystack.org/problems/registry-messaging/template/render-refused\"],\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], ["/components/schemas/ReadyStatus", JSON.parse("{\"properties\":{\"developmentSettings\":{\"items\":{\"properties\":{\"code\":{\"type\":\"string\"},\"pointer\":{\"type\":\"string\"}},\"required\":[\"code\",\"pointer\"],\"type\":\"object\"},\"type\":\"array\"},\"posture\":{\"enum\":[\"development\",\"production\"]},\"status\":{\"const\":\"ready\"}},\"required\":[\"status\",\"posture\",\"developmentSettings\"],\"type\":\"object\"}")], ["/components/schemas/Recipient", JSON.parse("{\"oneOf\":[{\"additionalProperties\":false,\"properties\":{\"email\":{\"maxLength\":254,\"minLength\":3,\"pattern\":\"^[\\\\x21-\\\\x7e]+$\",\"type\":\"string\"}},\"required\":[\"email\"],\"type\":\"object\"},{\"additionalProperties\":false,\"properties\":{\"phone\":{\"pattern\":\"^\\\\+[1-9][0-9]{1,14}$\",\"type\":\"string\"}},\"required\":[\"phone\"],\"type\":\"object\"}]}")], ["/components/schemas/SubmitMessageRequest", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"content\":{\"additionalProperties\":false,\"properties\":{\"subject\":{\"type\":\"string\"},\"text\":{\"type\":\"string\"}},\"required\":[\"text\"],\"type\":\"object\"},\"correlationId\":{\"maxLength\":128,\"minLength\":1,\"pattern\":\"^[^\\\\x00-\\\\x1f\\\\x7f-\\\\x9f]+$\",\"type\":\"string\"},\"data\":true,\"expiresAt\":{\"type\":\"string\"},\"locale\":{\"type\":\"string\"},\"notBefore\":{\"type\":\"string\"},\"senderProfile\":{\"type\":\"string\"},\"template\":{\"$ref\":\"/components/schemas/TemplateReference\"},\"to\":{\"$ref\":\"/components/schemas/Recipient\"}},\"required\":[\"senderProfile\",\"to\"],\"type\":\"object\"}")], @@ -140,7 +140,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.51.0") + assertClientVersion("0.50.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/render.ts b/clients/typescript/generated/render.ts index 8eb48d9b98..6d767a827b 100644 --- a/clients/typescript/generated/render.ts +++ b/clients/typescript/generated/render.ts @@ -1,9 +1,9 @@ -// Generated for Stack version 0.51.0, client version 0.51.0. -// Source SHA-256 aedf1cb0402eee9fb30e3a0606bfa6ba209102a612174716cf006c8fab5e7b96 +// Generated for Stack version 0.50.0, client version 0.50.0. +// Source SHA-256 3932fc501fa2ca0d8a982595fb073ee64cc218aa9726ec9cea5b09e28d938901 import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" -export type Schema_Problem = ({ "type": (string); "title": (string); "status": (number); "detail": (string); "code": (string); "traceId": (string); "pointers"?: (Array<(string)>) }) +export type Schema_Problem = ({ "type": (string); "title": (string); "status": (number); "detail": (string); "code": (string); "traceId": (string); "failedCheck"?: (string); "pointers"?: (Array<(string)>) }) export type Schema_Digest = (string) export interface Operations { @@ -17,7 +17,7 @@ export interface Operations { const rules: Record = Object.fromEntries([ ["/components/schemas/Digest", JSON.parse("{\"type\":\"string\",\"pattern\":\"^sha256:[0-9a-f]{64}$\"}")], - ["/components/schemas/Problem", JSON.parse("{\"type\":\"object\",\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"properties\":{\"type\":{\"type\":\"string\"},\"title\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"detail\":{\"type\":\"string\"},\"code\":{\"type\":\"string\"},\"traceId\":{\"type\":\"string\",\"pattern\":\"^[0-9a-f]{32}$\"},\"pointers\":{\"type\":\"array\",\"maxItems\":32,\"items\":{\"type\":\"string\",\"maxLength\":256}}}}")], + ["/components/schemas/Problem", JSON.parse("{\"type\":\"object\",\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"properties\":{\"type\":{\"type\":\"string\"},\"title\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"detail\":{\"type\":\"string\"},\"code\":{\"type\":\"string\"},\"traceId\":{\"type\":\"string\",\"pattern\":\"^[0-9a-f]{32}$\"},\"failedCheck\":{\"type\":\"string\"},\"pointers\":{\"type\":\"array\",\"maxItems\":32,\"items\":{\"type\":\"string\",\"maxLength\":256}}}}")], ["/paths/~1health/get/responses/200/content/application~1json/schema", JSON.parse("{\"type\":\"object\",\"required\":[\"status\",\"projectVersion\",\"bundleHash\",\"rendererVersion\",\"typstPin\"],\"properties\":{\"status\":{\"const\":\"ok\"},\"projectVersion\":{\"type\":\"string\"},\"bundleHash\":{\"type\":\"string\"},\"rendererVersion\":{\"type\":\"string\"},\"typstPin\":{\"type\":\"string\"}}}")], ["/paths/~1openapi.json/get/responses/200/content/application~1json/schema", JSON.parse("{\"type\":\"object\",\"required\":[\"openapi\",\"info\",\"paths\"],\"properties\":{\"openapi\":{\"const\":\"3.1.0\"},\"info\":{\"type\":\"object\",\"required\":[\"title\",\"version\"],\"properties\":{\"title\":{\"type\":\"string\"},\"version\":{\"type\":\"string\"}}},\"paths\":{\"type\":\"object\"}}}")], ["/paths/~1ready/get/responses/200/content/application~1json/schema", JSON.parse("{\"type\":\"object\",\"required\":[\"status\",\"posture\",\"developmentSettings\"],\"properties\":{\"status\":{\"const\":\"ready\"},\"posture\":{\"enum\":[\"development\",\"production\"]},\"developmentSettings\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"required\":[\"code\"],\"properties\":{\"code\":{\"type\":\"string\"},\"pointer\":{\"type\":\"string\"}}}},\"signing\":{\"type\":\"object\"}}}")], @@ -68,7 +68,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.51.0") + assertClientVersion("0.50.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/scheduling.ts b/clients/typescript/generated/scheduling.ts index 1a595a958e..2f02781363 100644 --- a/clients/typescript/generated/scheduling.ts +++ b/clients/typescript/generated/scheduling.ts @@ -1,5 +1,5 @@ -// Generated for Stack version 0.51.0, client version 0.51.0. -// Source SHA-256 b27d0697472e608de91b276148b26b3c1737348a7b86f69724f205bd8cd099a3 +// Generated for Stack version 0.50.0, client version 0.50.0. +// Source SHA-256 5ae205e03d651d545b289c186d43e4b3e6f445f5500952f2d829ca7ca020ecd1 // Unconstrained JSON /components/schemas/AppointmentHistoryEntryDocument/properties/detail import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -44,7 +44,7 @@ export type Schema_OperationalAppointmentDocument = ({ "allocations"?: (Array); "nextCursor": ((string) | (null)) }) export type Schema_PartyCounts = ({ "attendees": (number); "recipients": (number) }) export type Schema_PartyReference = ({ "reference": Schema_ExternalReference; "role": ("beneficiary" | "organization") & (string) }) -export type Schema_Problem = ({ "code": ("access-profile.ambiguous" | "authentication.refused" | "booking.duplicate-active" | "cancellation.cutoff-passed" | "capability.unmatched" | "capacity.exhausted" | "cursor.expired" | "cursor.invalid" | "eligibility.unavailable" | "grant.lifetime-too-long" | "hold.expired" | "hold.released" | "hook.unavailable" | "horizon.outside" | "idempotency.expired" | "idempotency.key-reused" | "location.closed" | "operation.not-authorized" | "party.capacity-inadequate" | "platform.task-grant.development-assertion" | "policy.changed" | "precondition.failed" | "precondition.required" | "prerequisite.missing" | "profile.not-authorized" | "receipt.unresolved" | "request.body-too-large" | "request.invalid" | "request.method-not-allowed" | "request.not-found" | "request.unprocessable" | "request.unsupported-media-type" | "resource.unavailable" | "revision.mismatch" | "schedule.unpublished" | "service.unavailable") & (string); "detail": (string); "status": (number); "title": (string); "traceId": (string); "type": (string) }) +export type Schema_Problem = ({ "code": ("access-profile.ambiguous" | "authentication.refused" | "booking.duplicate-active" | "cancellation.cutoff-passed" | "capability.unmatched" | "capacity.exhausted" | "cursor.expired" | "cursor.invalid" | "eligibility.unavailable" | "grant.lifetime-too-long" | "hold.expired" | "hold.released" | "hook.unavailable" | "horizon.outside" | "idempotency.expired" | "idempotency.key-reused" | "location.closed" | "operation.not-authorized" | "party.capacity-inadequate" | "platform.task-grant.development-assertion" | "policy.changed" | "precondition.failed" | "precondition.required" | "prerequisite.missing" | "profile.not-authorized" | "receipt.unresolved" | "request.body-too-large" | "request.invalid" | "request.method-not-allowed" | "request.not-found" | "request.unprocessable" | "request.unsupported-media-type" | "resource.unavailable" | "revision.mismatch" | "schedule.unpublished" | "service.unavailable") & (string); "detail": (string); "failedCheck"?: (string); "status": (number); "title": (string); "traceId": (string); "type": (string) }) export type Schema_ProblemAccessProfileAmbiguous = ({ "accessProfiles": (Array<(string)>); "code": "access-profile.ambiguous" & (string); "detail": "Multiple access profiles admit this request on this route; select one with accessProfile." & (string); "status": 400 & (number); "title": "Ambiguous access profile" & (string); "traceId": (string); "type": "https://id.registrystack.org/problems/registry-scheduling/access-profile/ambiguous" & (string) }) export type Schema_ProblemAuthenticationRefused = (Schema_Problem & ({ "code"?: "authentication.refused"; "detail"?: "The bearer credential is missing, invalid, or expired. Sign in again."; "status"?: 401; "title"?: "Authentication refused"; "type"?: "https://id.registrystack.org/problems/registry-scheduling/authentication/refused" })) export type Schema_ProblemBookingDuplicateActive = (Schema_Problem & ({ "code"?: "booking.duplicate-active"; "detail"?: "An active booking already holds this party's duplicate key. Cancel it, or wait until it has passed, before booking again."; "status"?: 409; "title"?: "Duplicate active booking"; "type"?: "https://id.registrystack.org/problems/registry-scheduling/booking/duplicate-active" })) @@ -159,7 +159,7 @@ const rules: Record = Object.fromEntries([ ["/components/schemas/OperationalAppointmentPage", JSON.parse("{\"additionalProperties\":true,\"properties\":{\"items\":{\"items\":{\"$ref\":\"/components/schemas/OperationalAppointmentDocument\"},\"type\":\"array\"},\"nextCursor\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"null\"}]}},\"required\":[\"items\",\"nextCursor\"],\"type\":\"object\"}")], ["/components/schemas/PartyCounts", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"attendees\":{\"minimum\":0,\"type\":\"integer\"},\"recipients\":{\"minimum\":0,\"type\":\"integer\"}},\"required\":[\"recipients\",\"attendees\"],\"type\":\"object\"}")], ["/components/schemas/PartyReference", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"reference\":{\"$ref\":\"/components/schemas/ExternalReference\"},\"role\":{\"enum\":[\"beneficiary\",\"organization\"],\"type\":\"string\"}},\"required\":[\"role\",\"reference\"],\"type\":\"object\"}")], - ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"code\":{\"enum\":[\"access-profile.ambiguous\",\"authentication.refused\",\"booking.duplicate-active\",\"cancellation.cutoff-passed\",\"capability.unmatched\",\"capacity.exhausted\",\"cursor.expired\",\"cursor.invalid\",\"eligibility.unavailable\",\"grant.lifetime-too-long\",\"hold.expired\",\"hold.released\",\"hook.unavailable\",\"horizon.outside\",\"idempotency.expired\",\"idempotency.key-reused\",\"location.closed\",\"operation.not-authorized\",\"party.capacity-inadequate\",\"platform.task-grant.development-assertion\",\"policy.changed\",\"precondition.failed\",\"precondition.required\",\"prerequisite.missing\",\"profile.not-authorized\",\"receipt.unresolved\",\"request.body-too-large\",\"request.invalid\",\"request.method-not-allowed\",\"request.not-found\",\"request.unprocessable\",\"request.unsupported-media-type\",\"resource.unavailable\",\"revision.mismatch\",\"schedule.unpublished\",\"service.unavailable\"],\"type\":\"string\"},\"detail\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"title\":{\"type\":\"string\"},\"traceId\":{\"type\":\"string\"},\"type\":{\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], + ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"code\":{\"enum\":[\"access-profile.ambiguous\",\"authentication.refused\",\"booking.duplicate-active\",\"cancellation.cutoff-passed\",\"capability.unmatched\",\"capacity.exhausted\",\"cursor.expired\",\"cursor.invalid\",\"eligibility.unavailable\",\"grant.lifetime-too-long\",\"hold.expired\",\"hold.released\",\"hook.unavailable\",\"horizon.outside\",\"idempotency.expired\",\"idempotency.key-reused\",\"location.closed\",\"operation.not-authorized\",\"party.capacity-inadequate\",\"platform.task-grant.development-assertion\",\"policy.changed\",\"precondition.failed\",\"precondition.required\",\"prerequisite.missing\",\"profile.not-authorized\",\"receipt.unresolved\",\"request.body-too-large\",\"request.invalid\",\"request.method-not-allowed\",\"request.not-found\",\"request.unprocessable\",\"request.unsupported-media-type\",\"resource.unavailable\",\"revision.mismatch\",\"schedule.unpublished\",\"service.unavailable\"],\"type\":\"string\"},\"detail\":{\"type\":\"string\"},\"failedCheck\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"title\":{\"type\":\"string\"},\"traceId\":{\"type\":\"string\"},\"type\":{\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], ["/components/schemas/ProblemAccessProfileAmbiguous", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"accessProfiles\":{\"items\":{\"type\":\"string\"},\"minItems\":2,\"type\":\"array\",\"uniqueItems\":true},\"code\":{\"const\":\"access-profile.ambiguous\",\"type\":\"string\"},\"detail\":{\"const\":\"Multiple access profiles admit this request on this route; select one with accessProfile.\",\"type\":\"string\"},\"status\":{\"const\":400,\"type\":\"integer\"},\"title\":{\"const\":\"Ambiguous access profile\",\"type\":\"string\"},\"traceId\":{\"type\":\"string\"},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-scheduling/access-profile/ambiguous\",\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\",\"accessProfiles\"],\"type\":\"object\"}")], ["/components/schemas/ProblemAuthenticationRefused", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"const\":\"authentication.refused\"},\"detail\":{\"const\":\"The bearer credential is missing, invalid, or expired. Sign in again.\"},\"status\":{\"const\":401},\"title\":{\"const\":\"Authentication refused\"},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-scheduling/authentication/refused\"}},\"type\":\"object\"}]}")], ["/components/schemas/ProblemBookingDuplicateActive", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"const\":\"booking.duplicate-active\"},\"detail\":{\"const\":\"An active booking already holds this party's duplicate key. Cancel it, or wait until it has passed, before booking again.\"},\"status\":{\"const\":409},\"title\":{\"const\":\"Duplicate active booking\"},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-scheduling/booking/duplicate-active\"}},\"type\":\"object\"}]}")], @@ -451,7 +451,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.51.0") + assertClientVersion("0.50.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/package-lock.json b/clients/typescript/package-lock.json index 177f5a5a4d..29cd3ddce3 100644 --- a/clients/typescript/package-lock.json +++ b/clients/typescript/package-lock.json @@ -20,6 +20,8 @@ }, "devDependencies": { "@types/node": "24.10.1", + "ajv": "8.20.0", + "ajv-formats": "3.0.1", "playwright-core": "1.63.0" }, "engines": { @@ -452,6 +454,41 @@ "undici-types": "~7.16.0" } }, + "node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, "node_modules/esbuild": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", @@ -493,6 +530,37 @@ "@esbuild/win32-x64": "0.25.12" } }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-uri": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz", + "integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" + }, "node_modules/playwright-core": { "version": "1.63.0", "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.63.0.tgz", @@ -506,6 +574,16 @@ "node": ">=20" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/srvx": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/srvx/-/srvx-1.0.8.tgz", diff --git a/clients/typescript/package.json b/clients/typescript/package.json index f5f91250d9..86e65b9277 100644 --- a/clients/typescript/package.json +++ b/clients/typescript/package.json @@ -66,6 +66,8 @@ }, "devDependencies": { "@types/node": "24.10.1", + "ajv": "8.20.0", + "ajv-formats": "3.0.1", "playwright-core": "1.63.0" }, "engines": { diff --git a/clients/typescript/tests/acceptance.test.ts b/clients/typescript/tests/acceptance.test.ts index 15ff24fecf..06d99ecc35 100644 --- a/clients/typescript/tests/acceptance.test.ts +++ b/clients/typescript/tests/acceptance.test.ts @@ -66,6 +66,7 @@ for (const { answer, reason, requestInput, options, extra } of [ test('service Proposal start and attach keep the existing HTTP exchange', async () => { const draft = JSON.parse(readFileSync(new URL('./fixtures/tasks/proposal-draft-optional.json', import.meta.url), 'utf8')) const attached = JSON.parse(readFileSync(new URL('./fixtures/tasks/proposal-draft-attached.json', import.meta.url), 'utf8')) + const proposalPath = `/v1/proposals/${draft.id}` const requests: Array<{ method: string; path: string; query: string; headers: Headers; body: RequestInit['body'] }> = [] let view = draft const client = facility({ baseUrl, fetch: async (url, init) => { @@ -80,9 +81,9 @@ test('service Proposal start and attach keep the existing HTTP exchange', async await client.facility.proposals.attach(proposal, 'supporting-document', file) assert.deepEqual(requests.map(({ method, path }) => [method, path]), [ ['POST', '/v1/actions/correct-address/proposals'], - ['GET', '/v1/proposals/prop-1'], - ['PATCH', '/v1/proposals/prop-1/attachments/supporting-document'], - ['GET', '/v1/proposals/prop-1'], + ['GET', proposalPath], + ['PATCH', `${proposalPath}/attachments/supporting-document`], + ['GET', proposalPath], ]) assert.ok(requests.every(({ query }) => query === '?accessProfile=facility-correction-author')) assert.deepEqual(JSON.parse(String(requests[0]?.body)), { input: { city: 'Springfield' } }) diff --git a/clients/typescript/tests/fixtures/tasks/proposal-application-refused.json b/clients/typescript/tests/fixtures/tasks/proposal-application-refused.json index 17144f6082..5816536572 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-application-refused.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-application-refused.json @@ -1,8 +1,9 @@ { - "id": "prop-1", + "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "actionId": "correct-address", "actionRevision": "rev-a", "state": "submitted", + "status": "awaiting-party", "turn": "party", "submissionVersion": 1, "revision": 5, @@ -26,7 +27,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "download", - "path": "/v1/proposals/prop-1/attachments/supporting-document?submissionVersion=1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document?submissionVersion=1", "availability": { "observedRevision": 3, "available": true @@ -47,7 +48,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/prop-1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "availability": { "observedRevision": 5, "available": true @@ -57,7 +58,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/prop-1/edit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, @@ -70,7 +71,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/prop-1/submit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, @@ -83,7 +84,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/prop-1/revise", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, @@ -96,7 +97,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/prop-1/cancel", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, @@ -107,7 +108,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/prop-1/rebase", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, diff --git a/clients/typescript/tests/fixtures/tasks/proposal-applied.json b/clients/typescript/tests/fixtures/tasks/proposal-applied.json index 1ff8480d5b..f3d56fc39a 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-applied.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-applied.json @@ -1,8 +1,9 @@ { - "id": "prop-1", + "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "actionId": "correct-address", "actionRevision": "rev-a", "state": "applied", + "status": "applied", "turn": "nobody", "submissionVersion": 1, "revision": 8, @@ -18,7 +19,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/prop-1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "availability": { "observedRevision": 8, "available": true @@ -28,7 +29,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/prop-1/edit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, @@ -41,7 +42,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/prop-1/submit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, @@ -54,7 +55,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/prop-1/revise", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, @@ -67,7 +68,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/prop-1/cancel", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, @@ -80,7 +81,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/prop-1/rebase", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, diff --git a/clients/typescript/tests/fixtures/tasks/proposal-approved.json b/clients/typescript/tests/fixtures/tasks/proposal-approved.json index 170129207c..fd4d4cec3c 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-approved.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-approved.json @@ -1,8 +1,9 @@ { - "id": "prop-1", + "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "actionId": "correct-address", "actionRevision": "rev-a", "state": "submitted", + "status": "approved", "turn": "nobody", "submissionVersion": 1, "revision": 7, @@ -18,7 +19,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/prop-1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "availability": { "observedRevision": 7, "available": true @@ -28,7 +29,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/prop-1/edit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", "ifMatch": "\"etag-7\"", "availability": { "observedRevision": 7, @@ -41,7 +42,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/prop-1/submit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", "ifMatch": "\"etag-7\"", "availability": { "observedRevision": 7, @@ -54,7 +55,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/prop-1/revise", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", "ifMatch": "\"etag-7\"", "availability": { "observedRevision": 7, @@ -65,7 +66,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/prop-1/cancel", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", "ifMatch": "\"etag-7\"", "availability": { "observedRevision": 7, @@ -76,7 +77,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/prop-1/rebase", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", "ifMatch": "\"etag-7\"", "availability": { "observedRevision": 7, diff --git a/clients/typescript/tests/fixtures/tasks/proposal-cancelled.json b/clients/typescript/tests/fixtures/tasks/proposal-cancelled.json index 0accfce7a1..02f586174c 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-cancelled.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-cancelled.json @@ -1,8 +1,9 @@ { - "id": "prop-1", + "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "actionId": "correct-address", "actionRevision": "rev-a", "state": "cancelled", + "status": "cancelled", "turn": "nobody", "submissionVersion": 1, "revision": 8, @@ -18,7 +19,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/prop-1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "availability": { "observedRevision": 8, "available": true @@ -28,7 +29,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/prop-1/edit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, @@ -41,7 +42,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/prop-1/submit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, @@ -54,7 +55,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/prop-1/revise", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, @@ -67,7 +68,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/prop-1/cancel", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, @@ -80,7 +81,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/prop-1/rebase", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, diff --git a/clients/typescript/tests/fixtures/tasks/proposal-draft-attached.json b/clients/typescript/tests/fixtures/tasks/proposal-draft-attached.json index 3065015f7a..08e9f7deba 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-draft-attached.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-draft-attached.json @@ -1,8 +1,9 @@ { - "id": "prop-1", + "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "actionId": "correct-address", "actionRevision": "rev-a", "state": "draft", + "status": "draft", "turn": "party", "submissionVersion": 1, "revision": 4, @@ -26,7 +27,7 @@ "accessProfile": "facility-correction-author", "method": "PATCH", "operation": "upload", - "path": "/v1/proposals/prop-1/attachments/supporting-document", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document", "ifMatch": "\"etag-4\"", "availability": { "observedRevision": 4, @@ -37,7 +38,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "download", - "path": "/v1/proposals/prop-1/attachments/supporting-document?submissionVersion=1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document?submissionVersion=1", "availability": { "observedRevision": 3, "available": true @@ -58,7 +59,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/prop-1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "availability": { "observedRevision": 4, "available": true @@ -68,7 +69,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/prop-1/edit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", "ifMatch": "\"etag-4\"", "availability": { "observedRevision": 4, @@ -79,7 +80,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/prop-1/submit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", "ifMatch": "\"etag-4\"", "availability": { "observedRevision": 4, @@ -90,7 +91,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/prop-1/revise", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", "ifMatch": "\"etag-4\"", "availability": { "observedRevision": 4, @@ -103,7 +104,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/prop-1/cancel", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", "ifMatch": "\"etag-4\"", "availability": { "observedRevision": 4, @@ -114,7 +115,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/prop-1/rebase", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", "ifMatch": "\"etag-4\"", "availability": { "observedRevision": 4, diff --git a/clients/typescript/tests/fixtures/tasks/proposal-draft-no-input.json b/clients/typescript/tests/fixtures/tasks/proposal-draft-no-input.json index 62bd3792c4..3370e4e287 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-draft-no-input.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-draft-no-input.json @@ -1,8 +1,9 @@ { - "id": "prop-1", + "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "actionId": "correct-address", "actionRevision": "rev-a", "state": "draft", + "status": "draft", "turn": "party", "submissionVersion": 1, "revision": 3, @@ -14,7 +15,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/prop-1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "availability": { "observedRevision": 3, "available": true @@ -24,7 +25,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/prop-1/edit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -35,7 +36,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/prop-1/submit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -46,7 +47,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/prop-1/revise", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -59,7 +60,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/prop-1/cancel", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -70,7 +71,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/prop-1/rebase", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, diff --git a/clients/typescript/tests/fixtures/tasks/proposal-draft-optional.json b/clients/typescript/tests/fixtures/tasks/proposal-draft-optional.json index 206eaef223..97c2ec3842 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-draft-optional.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-draft-optional.json @@ -1,8 +1,9 @@ { - "id": "prop-1", + "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "actionId": "correct-address", "actionRevision": "rev-a", "state": "draft", + "status": "draft", "turn": "party", "submissionVersion": 1, "revision": 3, @@ -26,7 +27,7 @@ "accessProfile": "facility-correction-author", "method": "PATCH", "operation": "upload", - "path": "/v1/proposals/prop-1/attachments/supporting-document", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -41,7 +42,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/prop-1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "availability": { "observedRevision": 3, "available": true @@ -51,7 +52,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/prop-1/edit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -62,7 +63,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/prop-1/submit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -73,7 +74,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/prop-1/revise", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -86,7 +87,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/prop-1/cancel", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -97,7 +98,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/prop-1/rebase", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, diff --git a/clients/typescript/tests/fixtures/tasks/proposal-draft.json b/clients/typescript/tests/fixtures/tasks/proposal-draft.json index d466cf445e..98f6900574 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-draft.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-draft.json @@ -1,8 +1,9 @@ { - "id": "prop-1", + "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "actionId": "correct-address", "actionRevision": "rev-a", "state": "draft", + "status": "draft", "turn": "party", "submissionVersion": 1, "revision": 3, @@ -26,7 +27,7 @@ "accessProfile": "facility-correction-author", "method": "PATCH", "operation": "upload", - "path": "/v1/proposals/prop-1/attachments/supporting-document", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -41,7 +42,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/prop-1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "availability": { "observedRevision": 3, "available": true @@ -51,7 +52,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/prop-1/edit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -62,7 +63,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/prop-1/submit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -73,7 +74,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/prop-1/revise", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -86,7 +87,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/prop-1/cancel", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -97,7 +98,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/prop-1/rebase", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, diff --git a/clients/typescript/tests/fixtures/tasks/proposal-list-last.json b/clients/typescript/tests/fixtures/tasks/proposal-list-last.json index 94f2fbc5ee..d538b64ff6 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-list-last.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-list-last.json @@ -1,10 +1,11 @@ { "items": [ { - "id": "prop-1", + "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "actionId": "correct-address", "actionRevision": "rev-a", "state": "applied", + "status": "applied", "turn": "nobody", "submissionVersion": 1, "revision": 8, @@ -20,7 +21,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/prop-1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "availability": { "observedRevision": 8, "available": true @@ -30,7 +31,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/prop-1/edit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, @@ -43,7 +44,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/prop-1/submit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, @@ -56,7 +57,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/prop-1/revise", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, @@ -69,7 +70,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/prop-1/cancel", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, @@ -82,7 +83,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/prop-1/rebase", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, diff --git a/clients/typescript/tests/fixtures/tasks/proposal-list.json b/clients/typescript/tests/fixtures/tasks/proposal-list.json index 1bc6037836..2133533668 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-list.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-list.json @@ -1,10 +1,11 @@ { "items": [ { - "id": "prop-1", + "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "actionId": "correct-address", "actionRevision": "rev-a", "state": "draft", + "status": "draft", "turn": "party", "submissionVersion": 1, "revision": 3, @@ -28,7 +29,7 @@ "accessProfile": "facility-correction-author", "method": "PATCH", "operation": "upload", - "path": "/v1/proposals/prop-1/attachments/supporting-document", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -43,7 +44,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/prop-1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "availability": { "observedRevision": 3, "available": true @@ -53,7 +54,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/prop-1/edit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -64,7 +65,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/prop-1/submit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -75,7 +76,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/prop-1/revise", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -88,7 +89,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/prop-1/cancel", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -99,7 +100,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/prop-1/rebase", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, @@ -109,10 +110,11 @@ } }, { - "id": "prop-1", + "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "actionId": "correct-address", "actionRevision": "rev-a", "state": "submitted", + "status": "awaiting-party", "turn": "party", "submissionVersion": 1, "revision": 6, @@ -136,7 +138,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "download", - "path": "/v1/proposals/prop-1/attachments/supporting-document?submissionVersion=1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document?submissionVersion=1", "availability": { "observedRevision": 3, "available": true @@ -157,7 +159,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/prop-1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "availability": { "observedRevision": 6, "available": true @@ -167,7 +169,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/prop-1/edit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", "ifMatch": "\"etag-6\"", "availability": { "observedRevision": 6, @@ -180,7 +182,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/prop-1/submit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", "ifMatch": "\"etag-6\"", "availability": { "observedRevision": 6, @@ -193,7 +195,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/prop-1/revise", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", "ifMatch": "\"etag-6\"", "availability": { "observedRevision": 6, @@ -204,7 +206,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/prop-1/cancel", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", "ifMatch": "\"etag-6\"", "availability": { "observedRevision": 6, @@ -215,7 +217,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/prop-1/rebase", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", "ifMatch": "\"etag-6\"", "availability": { "observedRevision": 6, @@ -225,7 +227,7 @@ }, "decision": { "status": "changes-requested", - "decidedAt": "2026-11-27T11:00:00Z", + "decidedAt": "2026-11-27T11:00:00.000000Z", "publicReason": "Please add the licence number." } } diff --git a/clients/typescript/tests/fixtures/tasks/proposal-package-changed.json b/clients/typescript/tests/fixtures/tasks/proposal-package-changed.json index cf8017cc14..0abb019ea5 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-package-changed.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-package-changed.json @@ -1,8 +1,9 @@ { - "id": "prop-1", + "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "actionId": "correct-address", "actionRevision": "rev-a", "state": "submitted", + "status": "awaiting-party", "turn": "party", "submissionVersion": 1, "revision": 5, @@ -26,7 +27,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "download", - "path": "/v1/proposals/prop-1/attachments/supporting-document?submissionVersion=1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document?submissionVersion=1", "availability": { "observedRevision": 3, "available": true @@ -47,7 +48,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/prop-1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "availability": { "observedRevision": 5, "available": true @@ -57,7 +58,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/prop-1/edit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, @@ -70,7 +71,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/prop-1/submit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, @@ -83,7 +84,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/prop-1/revise", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, @@ -96,7 +97,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/prop-1/cancel", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, @@ -107,7 +108,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/prop-1/rebase", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, diff --git a/clients/typescript/tests/fixtures/tasks/proposal-rejected.json b/clients/typescript/tests/fixtures/tasks/proposal-rejected.json index 58ecdf52a8..154993d965 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-rejected.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-rejected.json @@ -1,8 +1,9 @@ { - "id": "prop-1", + "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "actionId": "correct-address", "actionRevision": "rev-a", "state": "rejected", + "status": "rejected", "turn": "nobody", "submissionVersion": 1, "revision": 8, @@ -18,7 +19,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/prop-1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "availability": { "observedRevision": 8, "available": true @@ -28,7 +29,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/prop-1/edit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, @@ -41,7 +42,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/prop-1/submit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, @@ -54,7 +55,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/prop-1/revise", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, @@ -67,7 +68,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/prop-1/cancel", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, @@ -80,7 +81,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/prop-1/rebase", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", "ifMatch": "\"etag-8\"", "availability": { "observedRevision": 8, diff --git a/clients/typescript/tests/fixtures/tasks/proposal-sent-back.json b/clients/typescript/tests/fixtures/tasks/proposal-sent-back.json index bb10c44546..b3b9531748 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-sent-back.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-sent-back.json @@ -1,8 +1,9 @@ { - "id": "prop-1", + "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "actionId": "correct-address", "actionRevision": "rev-a", "state": "submitted", + "status": "awaiting-party", "turn": "party", "submissionVersion": 1, "revision": 6, @@ -26,7 +27,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "download", - "path": "/v1/proposals/prop-1/attachments/supporting-document?submissionVersion=1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document?submissionVersion=1", "availability": { "observedRevision": 3, "available": true @@ -47,7 +48,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/prop-1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "availability": { "observedRevision": 6, "available": true @@ -57,7 +58,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/prop-1/edit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", "ifMatch": "\"etag-6\"", "availability": { "observedRevision": 6, @@ -70,7 +71,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/prop-1/submit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", "ifMatch": "\"etag-6\"", "availability": { "observedRevision": 6, @@ -83,7 +84,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/prop-1/revise", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", "ifMatch": "\"etag-6\"", "availability": { "observedRevision": 6, @@ -94,7 +95,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/prop-1/cancel", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", "ifMatch": "\"etag-6\"", "availability": { "observedRevision": 6, @@ -105,7 +106,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/prop-1/rebase", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", "ifMatch": "\"etag-6\"", "availability": { "observedRevision": 6, @@ -115,7 +116,7 @@ }, "decision": { "status": "changes-requested", - "decidedAt": "2026-11-27T11:00:00Z", + "decidedAt": "2026-11-27T11:00:00.000000Z", "publicReason": "Please add the licence number." } } diff --git a/clients/typescript/tests/fixtures/tasks/proposal-submitted-stale.json b/clients/typescript/tests/fixtures/tasks/proposal-submitted-stale.json index 40506cf847..66d876af91 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-submitted-stale.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-submitted-stale.json @@ -1,8 +1,9 @@ { - "id": "prop-1", + "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "actionId": "correct-address", "actionRevision": "rev-a", "state": "submitted", + "status": "in-review", "turn": "official", "submissionVersion": 1, "revision": 5, @@ -26,7 +27,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "download", - "path": "/v1/proposals/prop-1/attachments/supporting-document?submissionVersion=1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document?submissionVersion=1", "availability": { "observedRevision": 3, "available": true @@ -47,7 +48,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/prop-1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "availability": { "observedRevision": 5, "available": true @@ -57,7 +58,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/prop-1/edit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, @@ -70,7 +71,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/prop-1/submit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, @@ -83,7 +84,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/prop-1/revise", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, @@ -96,7 +97,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/prop-1/cancel", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, @@ -107,7 +108,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/prop-1/rebase", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, diff --git a/clients/typescript/tests/fixtures/tasks/proposal-submitted.json b/clients/typescript/tests/fixtures/tasks/proposal-submitted.json index af87ffc63e..a7759b9b1a 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-submitted.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-submitted.json @@ -1,8 +1,9 @@ { - "id": "prop-1", + "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "actionId": "correct-address", "actionRevision": "rev-a", "state": "submitted", + "status": "in-review", "turn": "official", "submissionVersion": 1, "revision": 5, @@ -26,7 +27,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "download", - "path": "/v1/proposals/prop-1/attachments/supporting-document?submissionVersion=1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document?submissionVersion=1", "availability": { "observedRevision": 3, "available": true @@ -47,7 +48,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/prop-1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", "availability": { "observedRevision": 5, "available": true @@ -57,7 +58,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/prop-1/edit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, @@ -70,7 +71,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/prop-1/submit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, @@ -83,7 +84,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/prop-1/revise", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, @@ -94,7 +95,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/prop-1/cancel", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, @@ -105,7 +106,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/prop-1/rebase", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, diff --git a/clients/typescript/tests/tasks-proposals.test.ts b/clients/typescript/tests/tasks-proposals.test.ts index 7c6452907f..01f412c4ce 100644 --- a/clients/typescript/tests/tasks-proposals.test.ts +++ b/clients/typescript/tests/tasks-proposals.test.ts @@ -41,7 +41,8 @@ function register(routes: Record, extra: { token?: boolean } = } const ok = (doc: unknown, status = 200) => Response.json(doc, { status }) -const P = '/v1/proposals/prop-1' +const proposalId = '9a7ce3fb-c931-4d60-8991-7f6d395f0c44' +const P = `/v1/proposals/${proposalId}` const calls = (seen: Seen[]) => seen.map(s => `${s.method} ${s.path.replace(P, '')}`) const keyOf = (s: Seen) => s.headers.get('idempotency-key') ?? '' @@ -71,8 +72,8 @@ async function refusal(promise: Promise, code: string, reason?: string) // 1 and 14: commands follow served links, only start/get/list use the options profile. test('get reads the proposal with the options profile and no mutation headers', async () => { const { seen, commands } = register({ [`GET ${P}`]: () => ok(fixture('proposal-draft-optional')) }) - const proposal = await commands.get('prop-1') - assert.equal(proposal.id, 'prop-1') + const proposal = await commands.get(proposalId) + assert.equal(proposal.id, proposalId) assert.equal(seen[0]?.query.get('accessProfile'), accessProfile) assert.equal(seen[0]?.headers.has('if-match'), false) assert.equal(seen[0]?.headers.get('authorization'), 'Bearer fixture') @@ -120,7 +121,7 @@ test('list sends the filter and returns plain Proposals with a null cursor on th assert.equal(last.nextCursor, null) }) -// 4: status, row by row (rule: records/2026/2026-11-27-proposal-review-loop/status-rule.md). +// These helper-only inputs exercise the fallback for older responses without a served status. test('proposalStatus follows the derivation row by row', () => { const submitted = fixture('proposal-submitted') const rows: [string, ServedProposal, string][] = [ @@ -136,11 +137,15 @@ test('proposalStatus follows the derivation row by row', () => { ['nobody, no decision', { ...submitted, turn: 'nobody' }, 'processing'], ['nobody, application applying', { ...submitted, turn: 'nobody', applicationStatus: { mode: 'automatic', state: 'applying' } }, 'processing'], ] - for (const [name, served, status] of rows) assert.equal(proposalStatus(served), status, name) + for (const [name, served, status] of rows) { + const { status: _servedStatus, ...legacy } = served + assert.equal(proposalStatus(legacy), status, name) + } }) test('proposalStatus: the party turn wins over an approved decision', () => { - assert.equal(proposalStatus({ ...fixture('proposal-approved'), turn: 'party' }), 'awaiting-party') + const { status: _servedStatus, ...legacy } = fixture('proposal-approved') + assert.equal(proposalStatus({ ...legacy, turn: 'party' }), 'awaiting-party') }) test('proposalStatus uses a served status of the eight, and derives when the value is unknown', () => { @@ -154,7 +159,7 @@ test('proposalStatus uses a served status of the eight, and derives when the val // 3, 5, 6: the derived view. test('can is total, maps links, and gives a reason and a sentence when a command is not offered', async () => { const { commands } = register({ [`GET ${P}`]: () => ok(fixture('proposal-draft-optional')) }) - const draft = await commands.get('prop-1') + const draft = await commands.get(proposalId) assert.deepEqual(Object.keys(draft.can).sort(), ['attach', 'cancel', 'edit', 'rebase', 'resubmit', 'submit']) for (const name of ['attach', 'cancel', 'edit', 'submit'] as const) { assert.equal(draft.can[name].available, true, name) @@ -170,11 +175,11 @@ test('can is total, maps links, and gives a reason and a sentence when a command test('can.resubmit follows the revise link and carries the served reason and recovery', async () => { const docs = { open: fixture('proposal-sent-back'), stale: fixture('proposal-submitted-stale') } const { commands } = register({ [`GET ${P}`]: (_s, n) => ok(n === 1 ? docs.open : docs.stale) }) - const open = await commands.get('prop-1') + const open = await commands.get(proposalId) assert.equal(open.can.resubmit.available, true) assert.equal(open.can.attach.available, false) assert.equal(open.can.attach.reason, 'not-offered') - const waiting = await commands.get('prop-1') + const waiting = await commands.get(proposalId) assert.deepEqual( { available: waiting.can.resubmit.available, reason: waiting.can.resubmit.reason, recovery: waiting.can.resubmit.recovery }, { available: false, reason: 'pending-review', recovery: 'refresh' }, @@ -185,12 +190,19 @@ test('can.resubmit follows the revise link and carries the served reason and rec test('sentBack is true only for a submitted proposal whose decision asks for changes', async () => { const docs = ['proposal-sent-back', 'proposal-submitted', 'proposal-approved'] const { commands } = register({ [`GET ${P}`]: (_s, n) => ok(fixture(docs[n - 1]!)) }) - assert.equal((await commands.get('prop-1')).sentBack, true) - assert.equal((await commands.get('prop-1')).sentBack, false) - assert.equal((await commands.get('prop-1')).sentBack, false) + const sentBack = await commands.get(proposalId) + assert.equal(sentBack.sentBack, true) + assert.equal(sentBack.status, 'awaiting-party') + assert.deepEqual(sentBack.decision, { + status: 'changes-requested', + decidedAt: '2026-11-27T11:00:00.000000Z', + publicReason: 'Please add the licence number.', + }) + assert.equal((await commands.get(proposalId)).sentBack, false) + assert.equal((await commands.get(proposalId)).sentBack, false) const draftWithDecision = { ...fixture('proposal-draft-optional'), decision: { status: 'changes-requested', decidedAt: '2026-11-27T11:00:00Z' } } const { commands: other } = register({ [`GET ${P}`]: () => ok(draftWithDecision) }) - assert.equal((await other.get('prop-1')).sentBack, false) + assert.equal((await other.get(proposalId)).sentBack, false) }) test('the attachments view maps value and verification status and carries what the slot accepts', async () => { @@ -206,7 +218,7 @@ test('the attachments view maps value and verification status and carries what t }, }) for (const [index, status] of expected.entries()) { - const view = (await commands.get('prop-1')).attachments['supporting-document']! + const view = (await commands.get(proposalId)).attachments['supporting-document']! assert.equal(view.status, status, `row ${index}`) assert.equal(view.required, true) assert.deepEqual(view.accepts, { contentTypes: ['application/pdf'], maximumBytes: 1048576 }) @@ -217,10 +229,10 @@ test('the attachments view maps value and verification status and carries what t test('a Proposal is plain data: it survives structuredClone and a JSON round trip', async () => { const { commands } = register({ [`GET ${P}`]: () => ok(fixture('proposal-draft-attached')) }) - const proposal = await commands.get('prop-1') + const proposal = await commands.get(proposalId) assert.deepEqual(structuredClone(proposal), proposal) assert.deepEqual(JSON.parse(JSON.stringify(proposal)), proposal) - const minimal = await register({ [`GET ${P}`]: () => ok(fixture('proposal-draft-no-input')) }).commands.get('prop-1') + const minimal = await register({ [`GET ${P}`]: () => ok(fixture('proposal-draft-no-input')) }).commands.get(proposalId) assert.deepEqual(JSON.parse(JSON.stringify(minimal)), minimal) assert.equal('input' in minimal, false) }) @@ -232,7 +244,7 @@ test('edit merges into the readable input, sends the link condition and a derive [`GET ${P}`]: () => ok(fixture('proposal-draft-attached')), [`POST ${P}/edit`]: () => ok(fixture('proposal-draft-attached')), }) - const p = (await register({ [`GET ${P}`]: () => ok(draft) }).commands.get('prop-1')) + const p = (await register({ [`GET ${P}`]: () => ok(draft) }).commands.get(proposalId)) const view = await scripted.commands.edit(p, { city: 'Shelbyville' }) assert.deepEqual(calls(scripted.seen), ['POST /edit', 'GET ']) const [edit] = scripted.seen @@ -245,7 +257,7 @@ test('edit merges into the readable input, sends the link condition and a derive }) test('the derived key repeats for the same command and differs for another body', async () => { - const p = await register({ [`GET ${P}`]: () => ok(fixture('proposal-draft-optional')) }).commands.get('prop-1') + const p = await register({ [`GET ${P}`]: () => ok(fixture('proposal-draft-optional')) }).commands.get(proposalId) const keys: string[] = [] for (const city of ['A', 'A', 'B']) { const { seen, commands } = register({ @@ -261,7 +273,7 @@ test('the derived key repeats for the same command and differs for another body' test('edit refuses before sending when the grant cannot read the input', async () => { const { seen, commands } = register({ [`GET ${P}`]: () => ok(fixture('proposal-draft-no-input')) }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) await refusal(commands.edit(p, { city: 'X' }), 'client.inputs-not-readable') assert.equal(seen.length, 1, 'only the get was sent') }) @@ -271,7 +283,7 @@ test('a missing link refuses with client.command-unavailable and not-offered, wi const doc = fixture('proposal-draft-optional') delete doc.links['submit'] const { seen, commands } = register({ [`GET ${P}`]: () => ok(doc) }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) seen.length = 0 const error = await refusal(commands.submit(p), 'client.command-unavailable', 'not-offered') assert.match(error.detail ?? '', /not offered/i) @@ -280,7 +292,7 @@ test('a missing link refuses with client.command-unavailable and not-offered, wi test('a command the state does not allow refuses with the served reason, without a request', async () => { const { seen, commands } = register({ [`GET ${P}`]: () => ok(fixture('proposal-submitted')) }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) seen.length = 0 await refusal(commands.submit(p), 'client.command-unavailable', 'stale-revision') await refusal(commands.edit(p, {}), 'client.command-unavailable', 'stale-revision') @@ -290,7 +302,7 @@ test('a command the state does not allow refuses with the served reason, without test('a link the register marks unavailable refuses with its reason and recovery', async () => { const { seen, commands } = register({ [`GET ${P}`]: () => ok(fixture('proposal-submitted-stale')) }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) seen.length = 0 const error = await refusal(commands.resubmit(p), 'client.command-unavailable', 'pending-review') assert.equal(error.problem?.['recovery'], 'refresh') @@ -301,7 +313,7 @@ test('a command link that carries a different operation than its name is refused const doc = fixture('proposal-draft-optional') doc.links['submit']!.operation = 'apply' const { seen, commands } = register({ [`GET ${P}`]: () => ok(doc) }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) seen.length = 0 await refusal(commands.submit(p), 'client.link-operation') assert.equal(seen.length, 0) @@ -310,7 +322,7 @@ test('a command link that carries a different operation than its name is refused // 9: attach. test('attach checks the slot, the type and the size before sending', async () => { const { seen, commands } = register({ [`GET ${P}`]: () => ok(fixture('proposal-draft-optional')) }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) seen.length = 0 await refusal(commands.attach(p, 'nope', pdf()), 'client.unknown-slot') const type = await refusal(commands.attach(p, 'supporting-document', new Blob(['x'], { type: 'image/png' })), 'client.file-type') @@ -330,7 +342,7 @@ test('attach sends the bytes with the slot link condition, the file type and a d [`GET ${P}`]: () => ok(doc), [`PATCH ${P}/attachments/supporting-document`]: () => { doc = fixture('proposal-draft-attached'); return ok(doc) }, }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) const file = pdf(6) const view = await commands.attach(p, 'supporting-document', file) const patch = seen.find(s => s.method === 'PATCH')! @@ -348,7 +360,7 @@ test('attach infers PDF from an untyped filename and sends the resolved content [`GET ${P}`]: () => ok(fixture('proposal-draft-optional')), [`PATCH ${P}/attachments/supporting-document`]: () => ok(fixture('proposal-draft-attached')), }) - const draft = await commands.get('prop-1') + const draft = await commands.get(proposalId) const file = new File(['bytes'], 'support.PDF') assert.equal(file.type, '') await commands.attach(draft, 'supporting-document', file) @@ -369,13 +381,13 @@ test('attach normalises JPEG aliases and refuses a PDF filename on a PNG-only sl }, }, { accessProfile }) slot.contentTypes = ['image/jpeg'] - const jpeg = await commands.get('prop-1') + const jpeg = await commands.get(proposalId) for (const alias of ['image/jpg', 'image/pjpeg']) { await commands.attach(jpeg, 'supporting-document', new File(['x'], 'photo.unknown', { type: alias })) } assert.deepEqual(contentTypes, ['image/jpeg', 'image/jpeg']) slot.contentTypes = ['image/png'] - const png = await commands.get('prop-1') + const png = await commands.get(proposalId) const error = await refusal(commands.attach(png, 'supporting-document', new File(['x'], 'support.pdf')), 'client.file-type') assert.match(error.detail!, /accepts image\/png/u) assert.equal(contentTypes.length, 2) @@ -388,7 +400,7 @@ test('the attach key follows the file bytes', async () => { [`GET ${P}`]: () => ok(fixture('proposal-draft-optional')), [`PATCH ${P}/attachments/supporting-document`]: () => ok(fixture('proposal-draft-attached')), }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) await commands.attach(p, 'supporting-document', new Blob([new Uint8Array(4).fill(fill)], { type: 'application/pdf' })) keys.push(keyOf(seen.find(s => s.method === 'PATCH')!)) } @@ -403,7 +415,7 @@ test('submit and cancel send an empty body with their own link condition', async [`POST ${P}/submit`]: () => ok(fixture('proposal-submitted')), [`POST ${P}/cancel`]: () => ok(fixture('proposal-cancelled')), }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) await commands.submit(p) const submit = seen.find(s => s.path.endsWith('/submit'))! assert.equal(submit.headers.get('if-match'), '"etag-3"') @@ -412,7 +424,7 @@ test('submit and cancel send an empty body with their own link condition', async [`GET ${P}`]: () => ok(fixture('proposal-draft-optional')), [`POST ${P}/cancel`]: () => ok(fixture('proposal-cancelled')), }) - const view = await other.cancel(await other.get('prop-1')) + const view = await other.cancel(await other.get(proposalId)) assert.equal(seenCancel.find(s => s.path.endsWith('/cancel'))?.headers.get('if-match'), '"etag-3"') assert.equal(view.status, 'draft', 'the view is the document read again, not the command answer') }) @@ -474,7 +486,7 @@ const changed = { city: 'Shelbyville' } test('resubmit reads the register, revises, attaches, edits only when needed, then submits', async () => { const server = resubmitServer({ ignoreRevisedInput: true }) - const p = await server.commands.get('prop-1') + const p = await server.commands.get(proposalId) server.seen.length = 0 const view = await server.commands.resubmit(p, { changes: changed, files: { 'supporting-document': pdf() } }) assert.deepEqual(calls(server.seen), [ @@ -490,12 +502,12 @@ test('resubmit reads the register, revises, attaches, edits only when needed, th test('resubmit skips the edit when the revised document already holds the changes, and sends {} without changes', async () => { const withChanges = resubmitServer() - const p = await withChanges.commands.get('prop-1') + const p = await withChanges.commands.get(proposalId) withChanges.seen.length = 0 await withChanges.commands.resubmit(p, { changes: changed }) assert.deepEqual(calls(withChanges.seen).filter(c => !c.startsWith('GET')), ['POST /revise', 'POST /submit']) const plain = resubmitServer() - const q = await plain.commands.get('prop-1') + const q = await plain.commands.get(proposalId) plain.seen.length = 0 await plain.commands.resubmit(q) assert.deepEqual(JSON.parse(String(writesOf(plain.seen)[0]?.body)), {}) @@ -503,7 +515,7 @@ test('resubmit skips the edit when the revised document already holds the change test('resubmit removes an input that a change sets to undefined', async () => { const server = resubmitServer() - const p = await server.commands.get('prop-1') + const p = await server.commands.get(proposalId) server.seen.length = 0 await server.commands.resubmit(p, { changes: { city: undefined } }) assert.deepEqual(JSON.parse(String(writesOf(server.seen)[0]?.body)), { input: { facilityId: 'f-1' } }) @@ -514,7 +526,7 @@ test('resubmit removes an input that a change sets to undefined', async () => { test('resubmit refuses a bad file before the first write', async () => { const server = resubmitServer() - const p = await server.commands.get('prop-1') + const p = await server.commands.get(proposalId) server.seen.length = 0 await refusal(server.commands.resubmit(p, { files: { 'supporting-document': new Blob(['x'], { type: 'image/png' }) } }), 'client.file-type') await refusal(server.commands.resubmit(p, { files: { nope: pdf() } }), 'client.unknown-slot') @@ -523,22 +535,22 @@ test('resubmit refuses a bad file before the first write', async () => { test('resubmit is available only while the party is to act, and says so', async () => { const { seen, commands } = register({ [`GET ${P}`]: () => ok(fixture('proposal-submitted')) }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) assert.equal(p.served.links['revise']?.availability?.available, true, 'the register offers revise in review') assert.deepEqual([p.can.resubmit.available, p.can.resubmit.reason], [false, 'not-awaiting-party']) assert.ok(p.can.resubmit.message.length > 5) seen.length = 0 await refusal(commands.resubmit(p), 'client.command-unavailable', 'not-awaiting-party') assert.equal(writesOf(seen).length, 0) - const approved = await register({ [`GET ${P}`]: () => ok(fixture('proposal-approved')) }).commands.get('prop-1') + const approved = await register({ [`GET ${P}`]: () => ok(fixture('proposal-approved')) }).commands.get(proposalId) assert.equal(approved.can.resubmit.reason, 'not-awaiting-party') - const sentBack = await register({ [`GET ${P}`]: () => ok(fixture('proposal-sent-back')) }).commands.get('prop-1') + const sentBack = await register({ [`GET ${P}`]: () => ok(fixture('proposal-sent-back')) }).commands.get(proposalId) assert.equal(sentBack.can.resubmit.available, true) }) test('two concurrent resubmit calls with the same correction make one revise and one submit', async () => { const server = resubmitServer() - const p = await server.commands.get('prop-1') + const p = await server.commands.get(proposalId) const [a, b] = await Promise.all([server.commands.resubmit(p, { changes: changed }), server.commands.resubmit(p, { changes: changed })]) assert.deepEqual([server.count.revise, server.count.submit], [1, 1]) assert.equal(a.status, 'in-review') @@ -547,7 +559,7 @@ test('two concurrent resubmit calls with the same correction make one revise and test('two different concurrent corrections: the second is refused, not reported as done', async () => { const server = resubmitServer() - const p = await server.commands.get('prop-1') + const p = await server.commands.get(proposalId) const [a, b] = await Promise.allSettled([server.commands.resubmit(p, { changes: { city: 'A' } }), server.commands.resubmit(p, { changes: { city: 'B' } })]) assert.equal(a.status, 'fulfilled') assert.equal(b.status, 'rejected') @@ -557,7 +569,7 @@ test('two different concurrent corrections: the second is refused, not reported test('a copy older than a later round is refused', async () => { const server = resubmitServer() - const p = await server.commands.get('prop-1') + const p = await server.commands.get(proposalId) server.setDoc({ ...fixture('proposal-submitted'), submissionVersion: 3 }) server.seen.length = 0 await staleCopy(server.commands.resubmit(p, { changes: changed })) @@ -566,7 +578,7 @@ test('a copy older than a later round is refused', async () => { test("another tab's different correction is refused, not overwritten", async () => { const server = resubmitServer() - const p = await server.commands.get('prop-1') + const p = await server.commands.get(proposalId) server.setDoc({ ...nextVersion(fixture('proposal-draft-optional')), input: { facilityId: 'f-1', city: 'Other' } }) server.seen.length = 0 await staleCopy(server.commands.resubmit(p, { changes: changed })) @@ -575,7 +587,7 @@ test("another tab's different correction is refused, not overwritten", async () test('a refused stale resubmit does not make the register copy this instance\'s own', async () => { const server = resubmitServer() - const p = await server.commands.get('prop-1') + const p = await server.commands.get(proposalId) const later = { ...nextVersion(fixture('proposal-submitted')), revision: 9, input: { facilityId: 'f-1', city: 'Other' } } for (const link of Object.values(later.links)) if (link.ifMatch) link.ifMatch = '"etag-9"' server.setDoc(later) @@ -587,7 +599,7 @@ test('a refused stale resubmit does not make the register copy this instance\'s test('without changes, a draft is resumed only when nothing else was edited and given files are held', async () => { const server = resubmitServer() - const p = await server.commands.get('prop-1') + const p = await server.commands.get(proposalId) server.setDoc({ ...nextVersion(fixture('proposal-draft-optional')), input: { facilityId: 'f-1', city: 'Half-edited' } }) server.seen.length = 0 await staleCopy(server.commands.resubmit(p)) @@ -601,7 +613,7 @@ test('without changes, a draft is resumed only when nothing else was edited and test('a plain retry with the same file resumes after a revise landed and the attach failed', async () => { const server = resubmitServer({ failAttachOnce: true }) - const p = await server.commands.get('prop-1') + const p = await server.commands.get(proposalId) const options = { files: { 'supporting-document': pdf() } } await assert.rejects(server.commands.resubmit(p, options), { status: 503 }) const view = await server.commands.resubmit(p, options) @@ -611,7 +623,7 @@ test('a plain retry with the same file resumes after a revise landed and the att test('a draft whose slot holds a third file is refused as another tab\'s upload', async () => { const server = resubmitServer() - const p = await server.commands.get('prop-1') + const p = await server.commands.get(proposalId) const draft = { ...nextVersion(fixture('proposal-draft-attached')), input: { ...p.input } } draft.attachments!['supporting-document']!.value!.sha256 = 'c'.repeat(64) server.setDoc(draft) @@ -623,7 +635,7 @@ test('a draft whose slot holds a third file is refused as another tab\'s upload' test('resuming from a draft whose input cannot be read is refused', async () => { const server = resubmitServer() - const p = await server.commands.get('prop-1') + const p = await server.commands.get(proposalId) const hidden = nextVersion(fixture('proposal-draft-optional')) delete hidden.input server.setDoc(hidden) @@ -634,7 +646,7 @@ test('resuming from a draft whose input cannot be read is refused', async () => test('a retry after a submit that landed but lost its answer returns the submitted document', async () => { const server = resubmitServer({ loseSubmitAnswerOnce: true }) - const p = await server.commands.get('prop-1') + const p = await server.commands.get(proposalId) await assert.rejects(server.commands.resubmit(p, { changes: changed }), { status: 503 }) const view = await server.commands.resubmit(p, { changes: changed }) assert.equal(view.state, 'submitted') @@ -645,7 +657,7 @@ test('a retry after a submit that landed but lost its answer returns the submitt test('a retry after a failure between revise and submit matches the resolved type on the draft', async () => { const file = new File([pdf()], 'support.pdf') const server = resubmitServer({ failSubmitOnce: true, sha256: await hex(file) }) - const p = await server.commands.get('prop-1') + const p = await server.commands.get(proposalId) const options = { changes: changed, files: { 'supporting-document': file } } await assert.rejects(server.commands.resubmit(p, options), { status: 503 }) const view = await server.commands.resubmit(p, options) @@ -656,7 +668,7 @@ test('a retry after a failure between revise and submit matches the resolved typ test('a fresh instance after a failure in the middle continues from the draft', async () => { const server = resubmitServer({ failAttachOnce: true }) - const p = await server.commands.get('prop-1') + const p = await server.commands.get(proposalId) const options = { changes: changed, files: { 'supporting-document': pdf() } } await assert.rejects(server.commands.resubmit(p, options), { status: 503 }) const reloaded = proposalCommands(server.client, { accessProfile }) @@ -679,7 +691,7 @@ test('two quick submits make one submit and one clean refusal, never a stale err return ok(doc) }, }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) events.length = 0 const [a, b] = await Promise.allSettled([commands.submit(p), commands.submit(p)]) assert.equal(a.status, 'fulfilled') @@ -696,7 +708,7 @@ test('a queued write uses the newest document this instance has seen, not the st [`GET ${P}`]: () => ok(served), [`POST ${P}/edit`]: () => { served = fixture('proposal-draft-attached'); return ok(served) }, }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) seen.length = 0 await Promise.all([commands.edit(p, { city: 'A' }), commands.edit(p, { city: 'B' })]) const edits = seen.filter(s => s.path.endsWith('/edit')) @@ -709,14 +721,14 @@ test('writes on different proposals do not wait for each other', async () => { const gate = new Promise(resolve => { release = resolve }) const second = fixture('proposal-draft-optional') second.id = 'prop-2' - for (const link of Object.values(second.links)) link.path = link.path.replace('prop-1', 'prop-2') + for (const link of Object.values(second.links)) link.path = link.path.replace(proposalId, 'prop-2') const { commands } = register({ [`GET ${P}`]: () => ok(fixture('proposal-draft-optional')), 'GET /v1/proposals/prop-2': () => ok(second), [`POST ${P}/submit`]: async () => { await gate; return ok(fixture('proposal-submitted')) }, 'POST /v1/proposals/prop-2/submit': () => ok(fixture('proposal-submitted')), }) - const one = await commands.get('prop-1') + const one = await commands.get(proposalId) const two = await commands.get('prop-2') const slow = commands.submit(one) const fast = await commands.submit(two) @@ -741,7 +753,7 @@ test('download returns a Blob with the stored type when the register answers wit [`GET ${P}`]: () => ok(doc), [`GET ${P}/attachments/supporting-document`]: () => new Response(bytes, { headers: { 'Content-Type': 'application/pdf' } }), }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) const blob = await commands.download(p, 'supporting-document') assert.equal(blob.type, 'application/pdf') assert.deepEqual(new Uint8Array(await blob.arrayBuffer()), bytes) @@ -756,7 +768,7 @@ test('download returns a Blob when the register answers with octet-stream', asyn [`GET ${P}`]: () => ok(doc), [`GET ${P}/attachments/supporting-document`]: () => new Response(new Uint8Array([1, 2, 3]), { headers: { 'Content-Type': 'application/octet-stream' } }), }) - const blob = await commands.download(await commands.get('prop-1'), 'supporting-document') + const blob = await commands.download(await commands.get(proposalId), 'supporting-document') assert.equal(blob.type, 'application/octet-stream') assert.deepEqual(new Uint8Array(await blob.arrayBuffer()), new Uint8Array([1, 2, 3])) }) @@ -771,7 +783,7 @@ test('download keeps only a short list of safe served types', async () => { }, } const commands = proposalCommands(stub, { accessProfile }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) const seen: string[] = [] for (const served of ['application/pdf', 'image/png', 'image/jpeg', 'text/html', 'image/svg+xml']) { types.push(served) @@ -791,7 +803,7 @@ test('download caps the answer at the slot size and checks size and digest befor }, } const commands = proposalCommands(stub, { accessProfile }) - await commands.download(await commands.get('prop-1'), 'supporting-document') + await commands.download(await commands.get(proposalId), 'supporting-document') assert.equal(calls.at(-1)?.maxResponseBytes, 1048576) }) @@ -801,7 +813,7 @@ test('download throws too-large for a body over the slot size', async () => { [`GET ${P}`]: () => ok(doc), [`GET ${P}/attachments/supporting-document`]: () => new Response(new Uint8Array(1048577), { headers: { 'Content-Type': 'application/octet-stream' } }), }) - await assert.rejects(commands.download(await commands.get('prop-1'), 'supporting-document'), { reason: 'too-large' }) + await assert.rejects(commands.download(await commands.get(proposalId), 'supporting-document'), { reason: 'too-large' }) }) test('download throws client.content-digest when the bytes do not match the served digest or size', async () => { @@ -811,7 +823,7 @@ test('download throws client.content-digest when the bytes do not match the serv [`GET ${P}`]: () => ok(doc), [`GET ${P}/attachments/supporting-document`]: () => new Response(body, { headers: { 'Content-Type': 'application/octet-stream' } }), }) - await assert.rejects(commands.download(await commands.get('prop-1'), 'supporting-document'), + await assert.rejects(commands.download(await commands.get(proposalId), 'supporting-document'), (error: unknown) => error instanceof RegistryError && error.code === 'client.content-digest' && error.kind === 'unexpected' && error.reason === 'schema' && (onScreen(error), true)) } @@ -821,9 +833,9 @@ test('download refuses a link that names no submission version as an unexpected const doc = fixture('proposal-draft-attached') const slot = doc.attachments!['supporting-document']! delete slot.value - slot.links['download']!.path = '/v1/proposals/prop-1/attachments/supporting-document' + slot.links['download']!.path = `/v1/proposals/${proposalId}/attachments/supporting-document` const { seen, commands } = register({ [`GET ${P}`]: () => ok(doc) }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) seen.length = 0 const error = await refusal(commands.download(p, 'supporting-document'), 'client.link-operation') assert.equal(describeError(error), clientSentences['client.link-operation']) @@ -832,7 +844,7 @@ test('download refuses a link that names no submission version as an unexpected test('download refuses an unknown slot and a slot without a download link', async () => { const { seen, commands } = register({ [`GET ${P}`]: () => ok(fixture('proposal-draft-optional')) }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) seen.length = 0 await refusal(commands.download(p, 'nope'), 'client.unknown-slot') await refusal(commands.download(p, 'supporting-document'), 'client.command-unavailable', 'not-offered') @@ -842,11 +854,11 @@ test('download refuses an unknown slot and a slot without a download link', asyn // signal and page mode. test('an aborted signal reaches the call', async () => { const { commands } = register({ [`GET ${P}`]: () => ok(fixture('proposal-draft-optional')) }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) const controller = new AbortController() controller.abort() await assert.rejects(commands.submit(p, { signal: controller.signal }), { reason: 'aborted' }) - await assert.rejects(commands.get('prop-1', { signal: controller.signal }), { reason: 'aborted' }) + await assert.rejects(commands.get(proposalId, { signal: controller.signal }), { reason: 'aborted' }) }) test('page mode sends no bearer credential and cookies to the same origin only', async () => { @@ -854,7 +866,7 @@ test('page mode sends no bearer credential and cookies to the same origin only', [`GET ${P}`]: () => ok(fixture('proposal-draft-optional')), [`POST ${P}/submit`]: () => ok(fixture('proposal-submitted')), }, { token: false }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) await commands.submit(p) for (const s of seen) { assert.equal(s.headers.has('authorization'), false) @@ -873,7 +885,7 @@ test('the helper accepts the facility and the minimal generated clients', async const minimal = new Minimal(new Transport({ baseUrl, token: () => 'fixture', fetch: async () => ok(fixture('proposal-draft-optional')) })) const commands = proposalCommands(minimal, { accessProfile: 'directory-editor' }) assert.equal(typeof acceptsGeneratedClients, 'function') - await assert.doesNotReject(commands.get('prop-1')) + await assert.doesNotReject(commands.get(proposalId)) }) test('onProgress goes unchanged to the byte transfer calls only', async () => { @@ -891,7 +903,7 @@ test('onProgress goes unchanged to the byte transfer calls only', async () => { } const commands = proposalCommands(stub, { accessProfile }) const onProgress = () => {} - await commands.resubmit(await commands.get('prop-1'), { files: { 'supporting-document': pdf() }, onProgress }) + await commands.resubmit(await commands.get(proposalId), { files: { 'supporting-document': pdf() }, onProgress }) const byOperation = Object.fromEntries(recorded.map(r => [r.operation, r.onProgress])) assert.equal(byOperation['proposals.attachments.supporting-document.patch'], onProgress) assert.equal(byOperation['proposals.revise'], undefined) @@ -899,11 +911,11 @@ test('onProgress goes unchanged to the byte transfer calls only', async () => { recorded.length = 0 const later = proposalCommands(stub, { accessProfile }) doc = await holding(new Uint8Array([1])) - await later.download(await later.get('prop-1'), 'supporting-document', { onProgress }) + await later.download(await later.get(proposalId), 'supporting-document', { onProgress }) assert.equal(recorded.find(r => r.operation.startsWith('proposals.attachments.') && r.operation.endsWith('.get'))?.onProgress, onProgress) doc = fixture('proposal-draft-optional') recorded.length = 0 - await later.attach(await later.get('prop-1'), 'supporting-document', pdf(), { onProgress }) + await later.attach(await later.get(proposalId), 'supporting-document', pdf(), { onProgress }) assert.equal(recorded.find(r => r.operation.endsWith('.patch'))?.onProgress, onProgress) }) @@ -916,7 +928,7 @@ test('start keeps its own key and reports a saved change when the read after it const error = await commands.start('correct-address', {}).then(() => assert.fail('expected an error'), (e: unknown) => e) assert.ok(error instanceof RegistryError) assert.equal(error.problem?.['code'], 'client.read-after-write') - assert.equal(error.problem?.['proposalId'], 'prop-1') + assert.equal(error.problem?.['proposalId'], proposalId) assert.equal(error.kind, 'unreachable') assert.equal(error.status, 503) assert.equal(error.outcomeUnknown, false) @@ -933,12 +945,12 @@ test('a command whose write landed but whose read fails reports it with the writ [`GET ${P}`]: () => ++reads === 1 ? ok(fixture('proposal-draft-optional')) : new Response(null, { status: 503 }), [`POST ${P}/submit`]: () => ok(fixture('proposal-submitted')), }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) const error = await commands.submit(p).then(() => assert.fail('expected an error'), (e: unknown) => e) assert.ok(error instanceof RegistryError) assert.equal(error.code, 'client.read-after-write') onScreen(error) - assert.equal(error.problem?.['proposalId'], 'prop-1') + assert.equal(error.problem?.['proposalId'], proposalId) assert.equal(error.idempotencyKey, keyOf(seen.find(s => s.method === 'POST')!)) assert.equal(error.outcomeUnknown, false) assert.match(error.detail ?? '', /saved/i) @@ -971,19 +983,19 @@ test('can.rebase is available only when the register offers it and the proposal recovery.links['submit']!.availability = { available: false, observedRevision: 3, reason: 'invalid-input', recovery: 'rebase' } const docs = ['proposal-package-changed', 'proposal-draft', 'proposal-sent-back', 'proposal-applied'] const { commands } = register({ [`GET ${P}`]: (_s, n) => ok(n <= 4 ? fixture(docs[n - 1]!) : recovery) }) - const changed = await commands.get('prop-1') + const changed = await commands.get(proposalId) assert.equal(changed.can.rebase.available, true) assert.match(changed.can.rebase.message, /form for this application has changed/i) assert.deepEqual(changed.can.resubmit, { available: false, reason: 'package-changed', recovery: 'rebase', message: changed.can.resubmit.message }) for (const name of ['proposal-draft', 'proposal-sent-back']) { - const view = await commands.get('prop-1') + const view = await commands.get(proposalId) assert.deepEqual([view.can.rebase.available, view.can.rebase.reason], [false, 'not-needed'], name) } - assert.equal((await commands.get('prop-1')).can.rebase.reason, 'already-applied') - assert.equal((await commands.get('prop-1')).can.rebase.available, true, 'a link that recovers by rebase is enough') + assert.equal((await commands.get(proposalId)).can.rebase.reason, 'already-applied') + assert.equal((await commands.get(proposalId)).can.rebase.available, true, 'a link that recovers by rebase is enough') const missing = fixture('proposal-package-changed') delete missing.links['rebase'] - const view = await register({ [`GET ${P}`]: () => ok(missing) }).commands.get('prop-1') + const view = await register({ [`GET ${P}`]: () => ok(missing) }).commands.get(proposalId) assert.equal(view.can.rebase.reason, 'not-offered') }) @@ -994,7 +1006,7 @@ test('a package-changed proposal can be rebased and then submitted', async () => [`POST ${P}/rebase`]: () => { doc = { ...fixture('proposal-draft-optional'), submissionVersion: 2, revision: 6 }; return ok(doc) }, [`POST ${P}/submit`]: () => { doc = fixture('proposal-submitted'); return ok(doc) }, }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) seen.length = 0 const draft = await commands.rebase(p, { city: 'Shelbyville' }) assert.deepEqual(calls(seen), ['POST /rebase', 'GET ']) @@ -1013,20 +1025,20 @@ test('rebase without changes sends the readable input unchanged', async () => { [`GET ${P}`]: () => ok(doc), [`POST ${P}/rebase`]: () => { doc = fixture('proposal-draft-optional'); return ok(doc) }, }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) await commands.rebase(p) assert.deepEqual(JSON.parse(String(seen.find(s => s.method === 'POST')?.body)), { input: { facilityId: 'f-1', city: 'Springfield' } }) }) test('rebase refuses with not-needed, and when the input cannot be read, without a write', async () => { const { seen, commands } = register({ [`GET ${P}`]: () => ok(fixture('proposal-draft-optional')) }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) seen.length = 0 await refusal(commands.rebase(p), 'client.command-unavailable', 'not-needed') const hidden = fixture('proposal-package-changed') delete hidden.input const other = register({ [`GET ${P}`]: () => ok(hidden) }) - await refusal(other.commands.rebase(await other.commands.get('prop-1')), 'client.inputs-not-readable') + await refusal(other.commands.rebase(await other.commands.get(proposalId)), 'client.inputs-not-readable') assert.equal(writesOf(seen).length + writesOf(other.seen).length, 0) }) @@ -1039,7 +1051,7 @@ test('after a write whose read failed, the next write reads the proposal first a [`GET ${P}`]: () => ++reads === 2 ? new Response(null, { status: 503 }) : ok(doc), [`POST ${P}/edit`]: s => { doc = { ...fixture('proposal-draft-attached'), input: sent(s) }; return ok(doc) }, }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) await assert.rejects(commands.edit(p, { city: 'A' }), { code: 'client.read-after-write' }) seen.length = 0 await commands.edit(p, { facilityId: 'f-9' }) @@ -1059,9 +1071,9 @@ test('a list that learns a newer revision does not change the condition a comman 'GET /v1/proposals': () => ok({ items: [newer] }), [`POST ${P}/submit`]: () => ok(fixture('proposal-submitted')), }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) await commands.list() - await commands.get('prop-1') + await commands.get(proposalId) await commands.submit(p) assert.equal(seen.find(s => s.method === 'POST')?.headers.get('if-match'), '"etag-3"') }) @@ -1071,7 +1083,7 @@ test('submit follows the register: unavailable with attachment-required refuses const doc = fixture('proposal-draft') doc.links['submit']!.availability = { available: false, observedRevision: 3, reason: 'attachment-required', recovery: 'correct-input' } const { seen, commands } = register({ [`GET ${P}`]: () => ok(doc) }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) assert.deepEqual([p.can.submit.available, p.can.submit.reason, p.can.submit.recovery], [false, 'attachment-required', 'correct-input']) assert.equal(p.can.submit.message, 'A required document is missing. Add it before sending.') seen.length = 0 @@ -1084,7 +1096,7 @@ test('the helper does not compute a missing required slot: an available submit l [`GET ${P}`]: () => ok(fixture('proposal-draft')), [`POST ${P}/submit`]: () => ok(fixture('proposal-submitted')), }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) assert.equal(p.attachments['supporting-document']?.status, 'empty') assert.equal(p.attachments['supporting-document']?.required, true) assert.equal(p.can.submit.available, true) @@ -1099,7 +1111,7 @@ test('a manual Apply the register refused counts as needing a rebase, with its o [`GET ${P}`]: () => ok(doc), [`POST ${P}/rebase`]: () => { doc = { ...fixture('proposal-draft-optional'), submissionVersion: 2, revision: 6 }; return ok(doc) }, }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) assert.equal(p.can.rebase.available, true) assert.match(p.can.rebase.message, /could not be applied/i) assert.notEqual(p.can.rebase.message, availabilityMessages['rebase']) @@ -1183,7 +1195,7 @@ test('edit removes an input whose change is undefined', async () => { [`GET ${P}`]: () => ok(fixture('proposal-draft-optional')), [`POST ${P}/edit`]: () => ok(fixture('proposal-draft-attached')), }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) await commands.edit(p, { city: undefined, postalCode: '12345' }) assert.deepEqual(JSON.parse(String(seen.find(s => s.method === 'POST')?.body)), { input: { facilityId: 'f-1', postalCode: '12345' } }) }) @@ -1197,7 +1209,7 @@ test('a Proposal carries the served action revision, digest, handoff refusal, ap doc.application = { applicationId: 'app-1', effectDigest: digest, resultLinks: [{ recordId: 'r', recordType: 'facility', revision: 2 }], submissionVersion: 1 } doc.applicationStatus = { mode: 'manual', state: 'blocked', reason: 'package-changed', recovery: 'rebase' } const { commands } = register({ [`GET ${P}`]: () => ok(doc) }) - const p = await commands.get('prop-1') + const p = await commands.get(proposalId) assert.equal(p.actionRevision, 'rev-a') assert.equal(p.effectDigest, digest) assert.deepEqual(p.handoffRefusal, { code: 'review.refused' }) @@ -1205,7 +1217,7 @@ test('a Proposal carries the served action revision, digest, handoff refusal, ap assert.deepEqual(p.applicationStatus, doc.applicationStatus) assert.equal(p.blockedReason, 'package-changed') assert.deepEqual(JSON.parse(JSON.stringify(p)), p) - const plain = await register({ [`GET ${P}`]: () => ok(fixture('proposal-draft')) }).commands.get('prop-1') + const plain = await register({ [`GET ${P}`]: () => ok(fixture('proposal-draft')) }).commands.get(proposalId) for (const member of ['effectDigest', 'handoffRefusal', 'application', 'applicationStatus', 'blockedReason']) assert.equal(member in plain, false, member) }) @@ -1214,7 +1226,7 @@ test('the attachments view says whether a slot can be uploaded to and downloaded const { commands } = register({ [`GET ${P}`]: (_s, n) => ok(fixture(docs[n - 1]!)) }) const flags = [] for (const _ of docs) { - const view = (await commands.get('prop-1')).attachments['supporting-document']! + const view = (await commands.get(proposalId)).attachments['supporting-document']! flags.push([view.canUpload, view.canDownload]) } assert.deepEqual(flags, [[true, false], [true, true], [false, true]]) @@ -1223,5 +1235,5 @@ test('the attachments view says whether a slot can be uploaded to and downloaded test('proposalFromServed gives the same Proposal the commands do', async () => { const doc = fixture('proposal-sent-back') const { commands } = register({ [`GET ${P}`]: () => ok(doc) }) - assert.deepEqual(proposalFromServed(doc), await commands.get('prop-1')) + assert.deepEqual(proposalFromServed(doc), await commands.get(proposalId)) }) diff --git a/clients/typescript/tests/tasks-response-contracts.test.ts b/clients/typescript/tests/tasks-response-contracts.test.ts new file mode 100644 index 0000000000..41fee6f160 --- /dev/null +++ b/clients/typescript/tests/tasks-response-contracts.test.ts @@ -0,0 +1,57 @@ +import test from 'node:test' +import assert from 'node:assert/strict' +import { readdirSync, readFileSync } from 'node:fs' +import { Ajv2020 } from 'ajv/dist/2020.js' +import { default as formats } from 'ajv-formats' + +type Schema = Record +interface OpenApi { + components: { schemas: Record } + paths: Record + }>> +} + +const readJson = (relativePath: string): unknown => + JSON.parse(readFileSync(new URL(relativePath, import.meta.url), 'utf8')) +const breg = readJson('../../../products/breg/examples/required-attachment/openapi.json') as OpenApi +const documents = readJson('../../../products/documents/generated/registry-documents.openapi.json') as OpenApi + +function responseValidator(api: OpenApi, path: string, method = 'get', status = '200') { + // OpenAPI carries its local references in components and may annotate schemas with x- fields. + const ajv = new Ajv2020({ strictSchema: false }) + formats.default(ajv) + ajv.addFormat('uint32', { type: 'number', validate: value => value >= 0 && value <= 0xffff_ffff }) + ajv.addFormat('uint64', { type: 'number', validate: value => value >= 0 && value < 2 ** 64 }) + return ajv.compile({ + ...api.paths[path]![method]!.responses[status]!.content['application/json'].schema, + components: api.components, + }) +} + +const proposal = responseValidator(breg, '/v1/proposals/{proposal_id}') +const proposalPage = responseValidator(breg, '/v1/proposals') +const document = responseValidator(documents, '/v1/documents/{documentId}') +const documentResponses: Record> = { + 'document-ready.json': document, + 'document-pending.json': responseValidator(documents, '/v1/uploads/{uploadId}/content', 'put'), + 'document-policies.json': responseValidator(documents, '/v1/document-policies'), + 'document-reservation.json': responseValidator(documents, '/v1/documents', 'post', '201'), + 'document-grant.json': responseValidator(documents, '/v1/documents/{documentId}/grants', 'post', '201'), +} + +for (const name of readdirSync(new URL('./fixtures/tasks/', import.meta.url)).filter(name => name.endsWith('.json')).sort()) { + test(`task response fixture ${name} matches its generated OpenAPI schema`, () => { + const validate = name.startsWith('proposal-list') ? proposalPage : + name.startsWith('proposal-') ? proposal : documentResponses[name] + assert.ok(validate, `missing response schema for ${name}`) + const fixture = readJson(`./fixtures/tasks/${name}`) + assert.ok(validate(fixture), JSON.stringify(validate.errors)) + if (name.startsWith('proposal-')) { + const response = fixture as { status?: string; items?: { status?: string }[] } + for (const item of response.items ?? [response]) { + assert.equal(typeof item.status, 'string', 'current Proposal fixtures carry the served status') + } + } + }) +} diff --git a/clients/typescript/tests/tasks-screens.test.ts b/clients/typescript/tests/tasks-screens.test.ts index 021a67959e..e2ad198ad7 100644 --- a/clients/typescript/tests/tasks-screens.test.ts +++ b/clients/typescript/tests/tasks-screens.test.ts @@ -120,7 +120,7 @@ test('a replaced table reaches every can.* message, as the same table reaches de test('proposalCommands takes the table, so what it reads and what describeError shows agree', async () => { const doc = fixture('proposal-draft') const commands = proposalCommands({ call: async () => ({ data: doc }) }, { accessProfile: 'facility-correction-author', clientSentences: { available: 'Oui.' } }) - const p = await commands.get('prop-1') + const p = await commands.get(doc.id) assert.equal(p.can.submit.message, 'Oui.') const { items } = await proposalCommands({ call: async () => ({ data: { items: [doc] } }) }, { accessProfile: 'x', clientSentences: { available: 'Oui.' } }).list() assert.equal(items[0]!.can.submit.message, 'Oui.') diff --git a/crates/registry-adapter/src/govstack/consultation/openapi.rs b/crates/registry-adapter/src/govstack/consultation/openapi.rs index 462c026bd8..a19342aa88 100644 --- a/crates/registry-adapter/src/govstack/consultation/openapi.rs +++ b/crates/registry-adapter/src/govstack/consultation/openapi.rs @@ -657,6 +657,11 @@ fn problem_schema(validation: bool) -> Value { }}); if validation { schema["required"] = json!(["type", "title", "status", "traceId", "errors"]); + } else { + schema["properties"]["failedCheck"] = json!({ + "type": "string", + "description": "The check that refused the request, included only in development." + }); } schema } @@ -1054,6 +1059,26 @@ mod tests { } } + #[test] + fn problem_schema_accepts_development_refusal_diagnostics() { + let schema = problem_schema(false); + let compiled = jsonschema::JSONSchema::options() + .with_draft(jsonschema::Draft::Draft202012) + .compile(&schema) + .expect("problem schema compiles"); + let mut problem = json!({ + "type": "https://govstack.global/problems/digital-registries/unauthorized", + "title": "the request carries no valid credential", + "status": 401, + "traceId": "0123456789abcdef0123456789abcdef" + }); + assert!(compiled.is_valid(&problem)); + problem["failedCheck"] = json!("credential-missing"); + assert!(compiled.is_valid(&problem)); + problem["failedCheck"] = json!(false); + assert!(!compiled.is_valid(&problem)); + } + fn admits(schema: &Value, value: &str) -> bool { jsonschema::JSONSchema::options() .with_draft(jsonschema::Draft::Draft202012) diff --git a/crates/registry-breg/src/artifacts.rs b/crates/registry-breg/src/artifacts.rs index 9c82f23948..9a75742cae 100644 --- a/crates/registry-breg/src/artifacts.rs +++ b/crates/registry-breg/src/artifacts.rs @@ -4628,6 +4628,7 @@ fn problem_schema() -> Value { "status": {"type": "integer", "minimum": 400, "maximum": 599}, "detail": {"type": "string", "maxLength": 256}, "traceId": {"type": "string", "minLength": 32, "maxLength": 32, "pattern": "^[0-9a-f]{32}$"}, + "failedCheck": {"type": "string", "description": "The check that refused the request, included only in development."}, "fieldPath": {"type": "string", "maxLength": 256}, "refusalCode": {"type": "string", "minLength": 1, "maxLength": 128}, "guardReason": {"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"}, @@ -4690,7 +4691,7 @@ fn problem_schema() -> Value { "if": {"properties": {"code": {"const": write_outside_boundary.code()}}}, "then": { "propertyNames": {"enum": [ - "type", "title", "status", "detail", "code", "traceId" + "type", "title", "status", "detail", "code", "traceId", "failedCheck" ]}, "properties": { "type": {"const": write_outside_boundary.type_uri()}, 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 53958e6fe6..f5af5b2ce9 100644 --- a/crates/registry-breg/src/tests/artifacts_response_schema_tests.rs +++ b/crates/registry-breg/src/tests/artifacts_response_schema_tests.rs @@ -132,6 +132,11 @@ fn write_outside_boundary_problem_is_exact_and_does_not_narrow_located_problems( "traceId": "11111111111111111111111111111111" }); assert_valid(&schema, &exact); + let mut development = exact.clone(); + development["failedCheck"] = json!("row-boundary"); + assert_valid(&schema, &development); + development["failedCheck"] = json!(false); + assert_invalid(&schema, &development); for (member, value) in [ ("fieldPath", json!("/data/jurisdiction")), diff --git a/crates/registry-coordinator/src/http.rs b/crates/registry-coordinator/src/http.rs index 85ced4d8f8..67317527a0 100644 --- a/crates/registry-coordinator/src/http.rs +++ b/crates/registry-coordinator/src/http.rs @@ -2411,7 +2411,7 @@ pub fn openapi() -> Value { "Doctor":{"type":"object","required":["activationReady","state","findings"],"properties":{"activationReady":{"type":"boolean"},"findings":{"type":"array","maxItems":1,"items":{"type":"object","required":["code","message","suggestedAction"],"properties":{"code":{"const":"platform.activation.posture-mismatch"},"message":{"type":"string"},"suggestedAction":{"type":"string"}}}},"state":{"type":"object","required":["databaseId","schemaVersion","restoreHold","auditReady","admissionsHold","restoreReviewRequired","states","uncertain","terminalPayloads","oldestTerminalPayloadAt","proposalWaitsByTurn","heldRunCount","heldRuns"],"properties":{"databaseId":{"type":"string"},"schemaVersion":{"type":"integer"},"restoreHold":{"type":"boolean"},"auditReady":{"type":"boolean"},"admissionsHold":{"type":"boolean"},"restoreReviewRequired":{"type":"integer","minimum":0},"states":{"type":"object","additionalProperties":{"type":"integer"}},"uncertain":{"type":"integer"},"oldestDueAt":{"type":["string","null"],"format":"date-time"},"terminalPayloads":{"type":"integer","minimum":0},"oldestTerminalPayloadAt":{"type":["string","null"],"format":"date-time"},"proposalWaitsByTurn":{"$ref":"#/components/schemas/ProposalWaitsByTurn"},"heldRunCount":{"type":"integer","minimum":0},"heldRuns":{"$ref":"#/components/schemas/HeldRuns"}}}}}, "RetryScheduled":{"type":"object","required":["runId","status"],"properties":{"runId":{"type":"string","format":"uuid"},"status":{"const":"retry-scheduled"}}}, "Hold":{"type":"object","required":["restoreHold"],"properties":{"restoreHold":{"type":"boolean"}}},"Erased":{"type":"object","required":["erased"],"properties":{"erased":{"type":"integer","minimum":0}}}, - "Problem":{"type":"object","additionalProperties":false,"required":["type","title","status","detail","code","traceId"],"properties":{"type":{"type":"string","enum":problem_types},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"code":{"type":"string","enum":problem_codes},"traceId":{"type":"string"},"pointer":{"type":"string"}}} + "Problem":{"type":"object","additionalProperties":false,"required":["type","title","status","detail","code","traceId"],"properties":{"type":{"type":"string","enum":problem_types},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"code":{"type":"string","enum":problem_codes},"traceId":{"type":"string"},"pointer":{"type":"string"},"failedCheck":{"type":"string","description":"The check that refused the request, included only in development."}}} }); let count = json!({"type":"integer","minimum":0}); schemas["HeldRuns"] = json!({"type":"array","maxItems":100,"description":"The first live runs by run id held because this Coordinator version does not restore their retained definition; heldRunCount counts them all.","items":{"$ref":"#/components/schemas/HeldRun"}}); diff --git a/crates/registry-documents/src/schema.rs b/crates/registry-documents/src/schema.rs index 9a7e4e643e..80ef3cfd79 100644 --- a/crates/registry-documents/src/schema.rs +++ b/crates/registry-documents/src/schema.rs @@ -655,7 +655,8 @@ pub fn openapi_documents() -> Result, serde_json: "status": {"type": "integer"}, "detail": {"type": "string"}, "code": {"type": "string", "enum": codes}, - "traceId": {"type": "string"} + "traceId": {"type": "string"}, + "failedCheck": {"type": "string", "description": "The check that refused the request, included only in development."} } }), ); diff --git a/crates/registry-evidence-oid4vci/src/contracts.rs b/crates/registry-evidence-oid4vci/src/contracts.rs index a51f8e9533..4c30948fea 100644 --- a/crates/registry-evidence-oid4vci/src/contracts.rs +++ b/crates/registry-evidence-oid4vci/src/contracts.rs @@ -367,7 +367,8 @@ fn schemas() -> Value { "invalid_grant", "invalid_credential_request", "invalid_proof", "invalid_nonce", "credential_request_denied", "temporarily_unavailable", "server_error" ]}, - "error_description": {"type": "string"} + "error_description": {"type": "string"}, + "failedCheck": {"type": "string", "description": "The check that refused the request, included only in development."} } }, "CredentialIssuerMetadata": { diff --git a/crates/registry-evidence-oid4vci/src/draft13.rs b/crates/registry-evidence-oid4vci/src/draft13.rs index d84be3c51b..02e5c5bd05 100644 --- a/crates/registry-evidence-oid4vci/src/draft13.rs +++ b/crates/registry-evidence-oid4vci/src/draft13.rs @@ -257,7 +257,8 @@ pub(crate) fn openapi_schemas() -> Value { "unsupported_credential_type", "invalid_proof", "credential_request_denied", "temporarily_unavailable", "server_error" ]}, - "error_description": {"type": "string"} + "error_description": {"type": "string"}, + "failedCheck": {"type": "string", "description": "The check that refused the request, included only in development."} } }, "Draft13IssuerMetadata": { diff --git a/crates/registry-evidence-oid4vci/src/service.rs b/crates/registry-evidence-oid4vci/src/service.rs index 2fd5b3c0c0..641d086755 100644 --- a/crates/registry-evidence-oid4vci/src/service.rs +++ b/crates/registry-evidence-oid4vci/src/service.rs @@ -2280,6 +2280,11 @@ mod tests { async fn the_development_body_names_the_failed_check_and_production_does_not() { use registry_platform_config::{DeclaredPosture, Posture, PostureReport, PostureSource}; let directory = canonical_tempdir(); + let openapi = crate::contracts::openapi_document(); + let schema = jsonschema::JSONSchema::options() + .with_draft(jsonschema::Draft::Draft202012) + .compile(&openapi["components"]["schemas"]["Problem"]) + .expect("problem schema compiles"); for (posture, expected) in [ (Posture::Production, None), (Posture::Development, Some("credential-missing")), @@ -2295,7 +2300,11 @@ mod tests { .json(&offer_body(false)) .await; assert_eq!(response.status_code(), StatusCode::UNAUTHORIZED); - assert_eq!(response.json::()["failedCheck"].as_str(), expected); + let mut problem = response.json::(); + assert_eq!(problem["failedCheck"].as_str(), expected); + assert!(schema.is_valid(&problem), "{problem}"); + problem["failedCheck"] = json!(false); + assert!(!schema.is_valid(&problem), "{problem}"); } } diff --git a/crates/registry-evidence-oid4vp/src/contracts.rs b/crates/registry-evidence-oid4vp/src/contracts.rs index b4d9c80362..7046ff1a98 100644 --- a/crates/registry-evidence-oid4vp/src/contracts.rs +++ b/crates/registry-evidence-oid4vp/src/contracts.rs @@ -361,12 +361,16 @@ fn schemas() -> Value { "type": {"type": "string", "format": "uri"}, "title": {"type": "string"}, "status": {"type": "integer"}, - "detail": {"type": "string"} + "detail": {"type": "string"}, + "failedCheck": {"type": "string", "description": "The check that refused the request, included only in development."} } }, "OAuthError": { "type": "object", "additionalProperties": false, "required": ["error"], - "properties": {"error": {"enum": ["invalid_request", "temporarily_unavailable"]}} + "properties": { + "error": {"enum": ["invalid_request", "temporarily_unavailable"]}, + "failedCheck": {"type": "string", "description": "The check that refused the request, included only in development."} + } }, "CreateSessionRequest": { "type": "object", "additionalProperties": false, "required": ["policy"], diff --git a/crates/registry-evidence/src/contracts.rs b/crates/registry-evidence/src/contracts.rs index 65849f7416..1548a2dce1 100644 --- a/crates/registry-evidence/src/contracts.rs +++ b/crates/registry-evidence/src/contracts.rs @@ -872,7 +872,8 @@ fn problem_schema() -> Value { "the Evidence request rate is exhausted", "the authoritative source is unavailable", "the request could not be served", "the requested resource was not found" ]}, - "traceId": {"type": "string", "pattern": TRACE_ID_PATTERN} + "traceId": {"type": "string", "pattern": TRACE_ID_PATTERN}, + "failedCheck": {"type": "string", "description": "The check that refused the request, included only in development."} }, "$comment": "Problem members are a closed safe shape. No request, authority, source, script, supported-value, subject-binding, candidate, or credential detail is returned." }); @@ -2454,7 +2455,7 @@ mod tests { assert_eq!(problem["additionalProperties"], json!(false)); assert_eq!( problem["properties"].as_object().map(|value| value.len()), - Some(6) + Some(7) ); } @@ -2624,6 +2625,28 @@ mod tests { } } + #[test] + fn problem_schema_accepts_development_refusal_diagnostics() { + let schema = problem_schema(); + let compiled = JSONSchema::options() + .with_draft(Draft::Draft202012) + .compile(&schema) + .expect("problem schema compiles"); + let mut problem = json!({ + "type": "https://id.registrystack.org/problems/registry-evidence/evidence/denied", + "title": "Evidence request is not permitted", + "status": 403, + "detail": "the Evidence request is not permitted", + "code": "evidence.denied", + "traceId": "0123456789abcdef0123456789abcdef" + }); + assert!(compiled.is_valid(&problem)); + problem["failedCheck"] = json!("access-profile"); + assert!(compiled.is_valid(&problem)); + problem["failedCheck"] = json!(false); + assert!(!compiled.is_valid(&problem)); + } + #[test] fn problem_schema_rejects_mismatched_code_status_and_title() { let schema = problem_schema(); diff --git a/crates/registry-messaging/src/schema.rs b/crates/registry-messaging/src/schema.rs index 0c1f0b99f9..1cd9ba95b9 100644 --- a/crates/registry-messaging/src/schema.rs +++ b/crates/registry-messaging/src/schema.rs @@ -372,7 +372,8 @@ pub fn openapi_documents() -> Result, serde_json: "status": {"type": "integer"}, "detail": {"type": "string"}, "code": {"type": "string", "enum": codes}, - "traceId": {"type": "string"} + "traceId": {"type": "string"}, + "failedCheck": {"type": "string", "description": "The check that refused the request, included only in development."} } }, "Recipient": { diff --git a/docs/site/scripts/check-stale-config-vocabulary.baseline b/docs/site/scripts/check-stale-config-vocabulary.baseline index 5d39d89ceb..5e2502e825 100644 --- a/docs/site/scripts/check-stale-config-vocabulary.baseline +++ b/docs/site/scripts/check-stale-config-vocabulary.baseline @@ -1,10 +1,8 @@ # Pending-rewrite baseline for check-stale-config-vocabulary.sh. # -# Each line names one page, relative to docs/site, that still carries retired -# vocabulary. The check counts and reports its lines instead of refusing them. -# The comment names the docs rewrite package that removes the vocabulary; that -# package deletes the line. A page not listed here fails the check on its -# first retired spelling. +# Each line names a page relative to docs/site with a BReg vocabulary +# exception. The check reports the BReg matches on those pages. Retired +# Evidence and Casework terms still fail on each page the gate scans. # # Not scanned: the field descriptions the generated configuration reference # renders from products/breg/generated/*/*.schema.json. Several still say @@ -14,6 +12,5 @@ # BReg rewrite, PR 5: Reference and src/data src/content/docs/reference/bregctl-publicschema-wizard.mdx # quotes the wizard's own prompts, which still say entity (crates/registry-bregctl/src/init_from_model/wizard.rs); cleared when the product renames them -# Evidence and Casework rewrite: Start and Reference -src/content/docs/operate/advanced/upgrade-and-retire.mdx # review round -src/data/projects.yaml # bounded question +# Historical BReg upgrade steps need the names used by predecessor versions. +src/content/docs/operate/advanced/upgrade-and-retire.mdx # v0.41.0 change requests and removed recovery values diff --git a/docs/site/scripts/check-stale-config-vocabulary.sh b/docs/site/scripts/check-stale-config-vocabulary.sh index b3dd26e414..555c954b30 100755 --- a/docs/site/scripts/check-stale-config-vocabulary.sh +++ b/docs/site/scripts/check-stale-config-vocabulary.sh @@ -51,9 +51,10 @@ EVIDENCE_CASEWORK_RETIRED='[Aa]uthoring [Ww]orkspaces?|[Bb]ounded [Qq]uestions?| # - Registry Manifest renderings and retired Relay tool names; # - the Rust source types and functions cited by evidence anchors; # - the configure/breg-change-control page slug in links. +# shellcheck disable=SC2016 # the backticks are literal Markdown code marks ALLOWED='[Ee]ntity[ -]tags?|(audience-scoped-)?entity-reference(-list)?|[a-z_]*entity_reference[a-z_]*|[Tt]racked[ _-]?[Ee]ntit(y|ies)(_id)?|entity JSON Schemas?|SHACL entity shapes|get_metadata_entity_[a-z_]+|Entity(Extension)?Source|[a-z_]*entit(y|ies)[a-z_]*\(\)|breg-change-control|`--entity`' -# Pages that still carry retired vocabulary until a later rewrite removes it. -# Their lines are counted and reported, not refused. +# Pages with remaining BReg vocabulary exceptions. The gate counts their +# matching lines and still refuses retired Evidence and Casework terminology. BASELINE="$ROOT/scripts/check-stale-config-vocabulary.baseline" is_breg_page() { @@ -106,17 +107,16 @@ done < <( find "$ROOT/src/data" -maxdepth 1 -type f -name '*.yaml' -print0 ) -# The awk program reads the baseline first, then every page. A retired -# spelling on a baselined page is counted and reported; anywhere else it -# fails the check. +# The awk program reads the BReg baseline first, then every page. retired_status=0 ROOT="$ROOT" CROSS_PRODUCT_RETIRED="$CROSS_PRODUCT_RETIRED" BREG_RETIRED="$BREG_RETIRED" \ EVIDENCE_CASEWORK_RETIRED="$EVIDENCE_CASEWORK_RETIRED" ALLOWED="$ALLOWED" \ awk ' BEGIN { root = ENVIRON["ROOT"] "/" - narrow = ENVIRON["CROSS_PRODUCT_RETIRED"] "|" ENVIRON["EVIDENCE_CASEWORK_RETIRED"] + narrow = ENVIRON["CROSS_PRODUCT_RETIRED"] broad = narrow "|" ENVIRON["BREG_RETIRED"] + evidence_casework = ENVIRON["EVIDENCE_CASEWORK_RETIRED"] allowed = ENVIRON["ALLOWED"] pending = 0 failures = 0 @@ -139,12 +139,11 @@ ROOT="$ROOT" CROSS_PRODUCT_RETIRED="$CROSS_PRODUCT_RETIRED" BREG_RETIRED="$BREG_ text = $0 gsub(allowed, "", text) retired = (mode == "breg") ? broad : narrow - if (text !~ retired) next - if (page in baselined) { - count[page]++ - } else { + if (text ~ evidence_casework || (text ~ retired && !(page in baselined))) { print page ":" FNR ": " $0 failures++ + } else if (text ~ retired) { + count[page]++ } } END { @@ -163,7 +162,7 @@ ROOT="$ROOT" CROSS_PRODUCT_RETIRED="$CROSS_PRODUCT_RETIRED" BREG_RETIRED="$BREG_ ' mode=baseline "$BASELINE" ${pages[@]+"${pages[@]}"} || retired_status=$? if [[ "$retired_status" -eq 1 ]]; then - echo "retired vocabulary found outside the pending-rewrite baseline ($BASELINE)" >&2 + echo "retired vocabulary found (BReg exceptions: $BASELINE)" >&2 exit 1 elif [[ "$retired_status" -ne 0 ]]; then echo "retired vocabulary search failed with exit code $retired_status" >&2 diff --git a/docs/site/scripts/check-stale-config-vocabulary.test.mjs b/docs/site/scripts/check-stale-config-vocabulary.test.mjs index f42683ae29..91d853d16f 100644 --- a/docs/site/scripts/check-stale-config-vocabulary.test.mjs +++ b/docs/site/scripts/check-stale-config-vocabulary.test.mjs @@ -61,7 +61,7 @@ test('a retired word on a BReg page outside the baseline fails', async () => { const result = await runGate(root); assert.equal(result.code, 1, result.output); assert.match(result.output, /configure\/breg-access\.mdx:2: Each entity has fields\./u); - assert.match(result.output, /retired vocabulary found outside the pending-rewrite baseline/u); + assert.match(result.output, /retired vocabulary found/u); }, ); }); @@ -176,6 +176,26 @@ test('retired Evidence and Casework spellings fail on any page', async () => { } }); +test('a pending BReg rewrite cannot hide retired Evidence or Casework terminology', async () => { + const projectData = 'src/data/projects.yaml'; + await withFixture( + { + pages: { + [bregPage]: 'Each entity has fields.\nCasework owns the review round.\n', + [projectData]: 'role: Evidence answers one bounded question.\n', + }, + baseline: [bregPage, projectData], + }, + async (root) => { + const result = await runGate(root); + assert.equal(result.code, 1, result.output); + assert.ok(result.output.includes(`${bregPage}:2:`), result.output); + assert.ok(result.output.includes(`${projectData}:1:`), result.output); + assert.match(result.output, /breg-access\.mdx: 1 line\(s\) with retired vocabulary/u); + }, + ); +}); + test('an approved specification page keeps the words it was approved with', async () => { await withFixture( { pages: { 'src/content/docs/spec/rs-arc-g.mdx': 'Casework holds one review round.\n' } }, diff --git a/docs/site/src/content/docs/operate/advanced/upgrade-and-retire.mdx b/docs/site/src/content/docs/operate/advanced/upgrade-and-retire.mdx index 6110830a36..369e6db499 100644 --- a/docs/site/src/content/docs/operate/advanced/upgrade-and-retire.mdx +++ b/docs/site/src/content/docs/operate/advanced/upgrade-and-retire.mdx @@ -650,7 +650,7 @@ in this sequence. ### Retire Casework -1. Stop new producer submissions and staff mutations. Finish pending review rounds, or cancel them +1. Stop new producer submissions and staff mutations. Finish pending ReviewRequests, or cancel them through each bound producer's supported interface. Confirm that consumers have correlated the terminal results before removing their review authority. 2. Preserve the retained results and accountability your institution requires. A final `pg_dump` @@ -666,8 +666,8 @@ in this sequence. 1. Stop every consumer, then close the import authorities still open with `bregctl import-authority close`. -2. Export what must outlive the registry. `bregctl data export` exports one entity through one - access profile, checkpointed; a final `pg_dump` is the only complete copy. See +2. Export what must outlive the registry. `bregctl data export` exports one Record type through one + access profile with a checkpoint. Only a final `pg_dump` gives you a complete copy. See [Export with a checkpoint](../../breg-data/#export-with-a-checkpoint). 3. Erase what your policy does not let you keep, before that final backup: see [Erase retained history](../../breg-retention/#erase-retained-history) and diff --git a/docs/site/src/data/projects.yaml b/docs/site/src/data/projects.yaml index 6317af2720..ed5981d991 100644 --- a/docs/site/src/data/projects.yaml +++ b/docs/site/src/data/projects.yaml @@ -41,7 +41,7 @@ name: Registry Evidence repo_path: ../registry-stack target_repo_path: ../registry-stack - role: Minimum-disclosure assertion service. Given authenticated authority, an authorized purpose, a predefined requirement, and the selector data an authoritative provider needs, each evaluation answers one bounded question about one complete subject-role set and returns the smallest sufficient signed assertion. Its request-batch route groups up to sixteen independent audience-scoped evaluations under one common requirement and purpose. Registry Evidence composes shared audit, crypto, HTTP security, OIDC, and SD-JWT primitives from Registry Platform. + role: Minimum-disclosure assertion service. Given authenticated authority, an authorized purpose, a predefined requirement, and the selector data an authoritative provider needs, each evaluation answers one question about one complete subject-role set and returns the smallest sufficient signed assertion. Its request-batch route groups up to sixteen independent audience-scoped evaluations under one common requirement and purpose. Registry Evidence composes shared audit, crypto, HTTP security, OIDC, and SD-JWT primitives from Registry Platform. owns: - Requirement definitions, bounded evaluation, and the acquisition posture recorded with every answer. - Authorization grants, purpose and audience checks, and the disclosure decision that releases an assertion. diff --git a/products/adapter/examples/breg-govstack/generated/openapi.json b/products/adapter/examples/breg-govstack/generated/openapi.json index 4add64bd37..4f3ae085d1 100644 --- a/products/adapter/examples/breg-govstack/generated/openapi.json +++ b/products/adapter/examples/breg-govstack/generated/openapi.json @@ -35,6 +35,10 @@ "minItems": 1, "type": "array" }, + "failedCheck": { + "description": "The check that refused the request, included only in development.", + "type": "string" + }, "status": { "maximum": 599, "minimum": 400, diff --git a/products/adapter/examples/dhis2-consultation/generated/openapi.json b/products/adapter/examples/dhis2-consultation/generated/openapi.json index bf5a7c05d3..23eae8ad76 100644 --- a/products/adapter/examples/dhis2-consultation/generated/openapi.json +++ b/products/adapter/examples/dhis2-consultation/generated/openapi.json @@ -35,6 +35,10 @@ "minItems": 1, "type": "array" }, + "failedCheck": { + "description": "The check that refused the request, included only in development.", + "type": "string" + }, "status": { "maximum": 599, "minimum": 400, diff --git a/products/adapter/examples/opencrvs-consultation/generated/openapi.json b/products/adapter/examples/opencrvs-consultation/generated/openapi.json index 67bca9bb9c..56fd180913 100644 --- a/products/adapter/examples/opencrvs-consultation/generated/openapi.json +++ b/products/adapter/examples/opencrvs-consultation/generated/openapi.json @@ -35,6 +35,10 @@ "minItems": 1, "type": "array" }, + "failedCheck": { + "description": "The check that refused the request, included only in development.", + "type": "string" + }, "status": { "maximum": 599, "minimum": 400, diff --git a/products/breg/examples/required-attachment/openapi.json b/products/breg/examples/required-attachment/openapi.json index 36def9f5f2..30a91234ff 100644 --- a/products/breg/examples/required-attachment/openapi.json +++ b/products/breg/examples/required-attachment/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":{"enum":["attachment.required","attachment.verification-pending","attachment.verification-rejected"]}}},"then":{"allOf":[{"else":{"properties":{"status":{"const":422}}},"if":{"properties":{"code":{"const":"attachment.verification-pending"}}},"then":{"properties":{"status":{"const":409}}}}],"properties":{"fieldPath":{"pattern":"^/attachments/[a-z][a-z0-9_-]{0,63}$","type":"string"}},"propertyNames":{"enum":["type","title","status","detail","code","traceId","fieldPath"]},"required":["fieldPath"]}},{"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":"access-profile.ambiguous"}}},"then":{"additionalProperties":true,"properties":{"status":{"const":400}},"required":["accessProfiles"]}},{"if":{"properties":{"code":{"not":{"const":"access-profile.ambiguous"}}}},"then":{"not":{"required":["accessProfiles"]}}},{"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"]}}],"anyOf":[{"properties":{"code":{"const":"access-profile.ambiguous"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},{"properties":{"code":{"const":"action.evidence-failed"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/evidence-failed"}}},{"properties":{"code":{"const":"action.guard-failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/guard-failed"}}},{"properties":{"code":{"const":"action.handler-failed"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/handler-failed"}}},{"properties":{"code":{"const":"action.refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/refused"}}},{"properties":{"code":{"const":"attachment.content-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},{"properties":{"code":{"const":"attachment.digest-mismatch"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch"}}},{"properties":{"code":{"const":"attachment.limit-reached"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached"}}},{"properties":{"code":{"const":"attachment.required"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/required"}}},{"properties":{"code":{"const":"attachment.slot-write-once"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once"}}},{"properties":{"code":{"const":"attachment.too-large"},"status":{"const":413},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},{"properties":{"code":{"const":"attachment.verification-pending"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}}},{"properties":{"code":{"const":"attachment.verification-rejected"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected"}}},{"properties":{"code":{"const":"authentication.refused"},"status":{"const":401},"type":{"const":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},{"properties":{"code":{"const":"idempotency.expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},{"properties":{"code":{"const":"idempotency.key-reused"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}}},{"properties":{"code":{"const":"ingestion.chunk-mismatch"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch"}}},{"properties":{"code":{"const":"ingestion.profile-mismatch"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch"}}},{"properties":{"code":{"const":"ingestion.receipt-erased"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased"}}},{"properties":{"code":{"const":"ingestion.run-blocked"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked"}}},{"properties":{"code":{"const":"ingestion.run-not-open"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open"}}},{"properties":{"code":{"const":"lookup.unresolved"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/lookup/unresolved"}}},{"properties":{"code":{"const":"mutation.conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},{"properties":{"code":{"const":"precondition.failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},{"properties":{"code":{"const":"precondition.required"},"status":{"const":428},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},{"properties":{"code":{"const":"profile.not-authorized"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},{"properties":{"code":{"const":"proposal.rejected"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},{"properties":{"code":{"const":"proposal.review-result-mismatch"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch"}}},{"properties":{"code":{"const":"proposal.submission-expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},{"properties":{"code":{"const":"query.cursor-invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid"}}},{"properties":{"code":{"const":"query.filter-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/filter-required"}}},{"properties":{"code":{"const":"query.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/invalid"}}},{"properties":{"code":{"const":"request.access-reason-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/access-reason-required"}}},{"properties":{"code":{"const":"request.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},{"properties":{"code":{"const":"request.timeout"},"status":{"const":504},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},{"properties":{"code":{"const":"resource.not-found"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/resource/not-found"}}},{"properties":{"code":{"const":"runtime.field-encryption.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable"}}},{"properties":{"code":{"const":"service.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},{"properties":{"code":{"const":"source.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},{"properties":{"code":{"const":"statistical-dataset.domain-violation"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation"}}},{"properties":{"code":{"const":"statistical-dataset.release-refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused"}}},{"properties":{"code":{"const":"statistical-dataset.version-conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict"}}},{"properties":{"code":{"const":"statistical-dataset.version-withdrawn"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn"}}},{"properties":{"code":{"const":"unsupported.media-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/unsupported/media-type"}}},{"properties":{"code":{"const":"write.outside-boundary"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}}],"properties":{"accessProfiles":{"items":{"maxLength":128,"minLength":1,"type":"string"},"minItems":2,"type":"array","uniqueItems":true},"atField":{"maxLength":128,"minLength":1,"type":"string"},"code":{"enum":["access-profile.ambiguous","action.evidence-failed","action.guard-failed","action.handler-failed","action.refused","attachment.content-type","attachment.digest-mismatch","attachment.limit-reached","attachment.required","attachment.slot-write-once","attachment.too-large","attachment.verification-pending","attachment.verification-rejected","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","profile.not-authorized","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-name-invoke-input":{"$id":"urn:breg:action:correct-name:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"target":{"format":"uuid","type":"string"},"value":{"maxLength":64,"minLength":0,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-name","x-registry-requiredConditionKeys":[]},"action-correct-name-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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"target":{"$id":"urn:breg:record-type:target","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"jurisdiction":{"maxLength":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"required":["name","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable","x-registry-mutationPolicy":{"patch":"proposal-required"}},"target-create-input":{"$id":"urn:breg:record-type:target:input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"jurisdiction":{"maxLength":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"required":["name","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable"}},"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"},"reviewCompletion":{"description":"The review authority's configured completion key verifies the Standard Webhooks signature.","in":"header","name":"webhook-signature","type":"apiKey"}}},"info":{"title":"required-attachment","version":"1"},"openapi":"3.1.0","paths":{"/v1/actions/correct-name/proposals":{"post":{"operationId":"actions.correct-name.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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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-name-invoke-input"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-correct-name-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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":["clerk"],"x-registry-action":{"access":{"accessProfiles":["clerk"]},"apiName":"correctName","attachments":[{"contentTypes":["text/plain"],"id":"support","maximumBytes":4096,"required":true}],"bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"display":{},"execution":{"application":"manual","mode":"proposal","review":"none"},"id":"correct-name","inputMode":"fixed","inputs":[{"apiName":"target","classification":"internal","fieldType":{"onDelete":"restrict","target":"target","type":"reference"},"id":"target","label":"target","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}},{"apiName":"value","classification":"internal","fieldType":{"maximumLength":64,"minimumLength":0,"type":"string"},"id":"value","label":"value","nullable":false,"required":true,"schema":{"maxLength":64,"minLength":0,"type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[{"apiName":"target","input":"target","targetRecordType":"target"}],"requiredConditionKeys":[],"resultEffects":[{"effect":"name","operation":"patch","recordType":"target"}],"revision":"sha256:bc33d44acbc56e239cd2c88aa76698302a40bba0bf7298b80317a82c9fc4cb36","route":"/v1/actions/correct-name/proposals","routes":{"availability":null,"start":{"inputSchema":"action-correct-name-invoke-input","method":"POST","operationId":"actions.correct-name.start","path":"/v1/actions/correct-name/proposals","requiresIdempotencyKey":true,"responseSchema":"action-correct-name-invoke-response"}}},"x-registry-defaultAccessProfile":"clerk","x-registry-operation":"start","x-registry-routeKind":"invoke"}},"/v1/proposals":{"get":{"operationId":"proposals.list","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","query.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}":{"get":{"operationId":"proposals.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/apply":{"post":{"operationId":"proposals.apply","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/attachments/support":{"delete":{"operationId":"proposals.attachments.support.delete","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]},"get":{"operationId":"proposals.attachments.support.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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":{"*/*":{"schema":{"contentMediaType":"application/octet-stream","maxLength":16777216,"type":"string"}}},"description":"Authorized Proposal operation"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]},"patch":{"operationId":"proposals.attachments.support.patch","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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":{"text/plain":{"schema":{"format":"binary","maxLength":4096,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"413":{"content":{"application/problem+json":{"examples":{"attachment.too-large":{"value":{"code":"attachment.too-large","detail":"The file is larger than the attachment slot accepts.","status":413,"title":"Content Too Large","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.too-large"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"attachment.content-type":{"value":{"code":"attachment.content-type","detail":"The file media type is not one the attachment slot accepts.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.content-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/cancel":{"post":{"operationId":"proposals.cancel","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/edit":{"post":{"operationId":"proposals.edit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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-name:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"target":{"format":"uuid","type":"string"},"value":{"maxLength":64,"minLength":0,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-name","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/rebase":{"post":{"operationId":"proposals.rebase","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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-name:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"target":{"format":"uuid","type":"string"},"value":{"maxLength":64,"minLength":0,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-name","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/revise":{"post":{"operationId":"proposals.revise","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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-name:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"target":{"format":"uuid","type":"string"},"value":{"maxLength":64,"minLength":0,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-name","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/submissions/{submission_version}":{"get":{"operationId":"proposals.get-submission","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"proposal.submission-expired":{"value":{"code":"proposal.submission-expired","detail":"The review result and application receipt of the submission are no longer retained.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["proposal.submission-expired"]}},"type":"object"}]}}},"description":"The submission's review result and application receipt are no longer retained","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/submit":{"post":{"operationId":"proposals.submit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"attachment.verification-pending":{"value":{"code":"attachment.verification-pending","detail":"The attachment is awaiting verification. Refresh the Proposal before submitting.","fieldPath":"/attachments/support","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}},"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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.verification-pending","idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"422":{"content":{"application/problem+json":{"examples":{"attachment.required":{"value":{"code":"attachment.required","detail":"The required attachment slot is empty.","fieldPath":"/attachments/support","status":422,"title":"Unprocessable Entity","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/required"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/records/targets":{"get":{"operationId":"records.target.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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"type":"object"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"type":"object"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":["clerk"],"x-registry-operation":"list","x-registry-queryKind":"list","x-registry-queryProfiles":{"clerk":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"clerk","requiredFilters":[],"selectableProperties":["jurisdiction","name"],"selectorProperties":[],"sortableProperties":[],"temporal":null}},"x-registry-recordType":"target","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"target","x-registry-responseShape":"RegistryRecordCollectionV1"},"post":{"operationId":"records.target.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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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/target-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/target"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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/target"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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":["clerk"],"x-registry-operation":"create","x-registry-recordType":"target","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"target","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/records/targets/{record_id}":{"get":{"operationId":"records.target.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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"jurisdiction":{"maxLength":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"type":"object"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"type":"object"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":["clerk"],"x-registry-operation":"get","x-registry-recordType":"target","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"target","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/review-completions":{"post":{"description":"Available when a review authority configures a completion block.","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":"webhook-id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"webhook-timestamp","required":true,"schema":{"pattern":"^(0|[1-9][0-9]{0,19})$","type":"string"}},{"in":"header","name":"webhook-signature","required":true,"schema":{"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 is invalid or eventId differs from webhook-id."},"401":{"description":"The completion authority could not be authenticated.","headers":{"WWW-Authenticate":{"schema":{"const":"Registry-Signature scheme=\"standard-webhooks\", version=\"v1\"","type":"string"}}}},"413":{"description":"The completion body exceeds 2048 bytes. The response body is empty."},"415":{"description":"The request is not application/json."},"503":{"description":"The completion could not be durably recorded."}},"security":[{"reviewCompletion":[]}],"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":{"enum":["attachment.required","attachment.verification-pending","attachment.verification-rejected"]}}},"then":{"allOf":[{"else":{"properties":{"status":{"const":422}}},"if":{"properties":{"code":{"const":"attachment.verification-pending"}}},"then":{"properties":{"status":{"const":409}}}}],"properties":{"fieldPath":{"pattern":"^/attachments/[a-z][a-z0-9_-]{0,63}$","type":"string"}},"propertyNames":{"enum":["type","title","status","detail","code","traceId","fieldPath"]},"required":["fieldPath"]}},{"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","failedCheck"]}}},{"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":"access-profile.ambiguous"}}},"then":{"additionalProperties":true,"properties":{"status":{"const":400}},"required":["accessProfiles"]}},{"if":{"properties":{"code":{"not":{"const":"access-profile.ambiguous"}}}},"then":{"not":{"required":["accessProfiles"]}}},{"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"]}}],"anyOf":[{"properties":{"code":{"const":"access-profile.ambiguous"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},{"properties":{"code":{"const":"action.evidence-failed"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/evidence-failed"}}},{"properties":{"code":{"const":"action.guard-failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/guard-failed"}}},{"properties":{"code":{"const":"action.handler-failed"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/handler-failed"}}},{"properties":{"code":{"const":"action.refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/refused"}}},{"properties":{"code":{"const":"attachment.content-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},{"properties":{"code":{"const":"attachment.digest-mismatch"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch"}}},{"properties":{"code":{"const":"attachment.limit-reached"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached"}}},{"properties":{"code":{"const":"attachment.required"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/required"}}},{"properties":{"code":{"const":"attachment.slot-write-once"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once"}}},{"properties":{"code":{"const":"attachment.too-large"},"status":{"const":413},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},{"properties":{"code":{"const":"attachment.verification-pending"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}}},{"properties":{"code":{"const":"attachment.verification-rejected"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected"}}},{"properties":{"code":{"const":"authentication.refused"},"status":{"const":401},"type":{"const":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},{"properties":{"code":{"const":"idempotency.expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},{"properties":{"code":{"const":"idempotency.key-reused"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}}},{"properties":{"code":{"const":"ingestion.chunk-mismatch"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch"}}},{"properties":{"code":{"const":"ingestion.profile-mismatch"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch"}}},{"properties":{"code":{"const":"ingestion.receipt-erased"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased"}}},{"properties":{"code":{"const":"ingestion.run-blocked"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked"}}},{"properties":{"code":{"const":"ingestion.run-not-open"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open"}}},{"properties":{"code":{"const":"lookup.unresolved"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/lookup/unresolved"}}},{"properties":{"code":{"const":"mutation.conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},{"properties":{"code":{"const":"precondition.failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},{"properties":{"code":{"const":"precondition.required"},"status":{"const":428},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},{"properties":{"code":{"const":"profile.not-authorized"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},{"properties":{"code":{"const":"proposal.rejected"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},{"properties":{"code":{"const":"proposal.review-result-mismatch"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch"}}},{"properties":{"code":{"const":"proposal.submission-expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},{"properties":{"code":{"const":"query.cursor-invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid"}}},{"properties":{"code":{"const":"query.filter-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/filter-required"}}},{"properties":{"code":{"const":"query.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/invalid"}}},{"properties":{"code":{"const":"request.access-reason-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/access-reason-required"}}},{"properties":{"code":{"const":"request.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},{"properties":{"code":{"const":"request.timeout"},"status":{"const":504},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},{"properties":{"code":{"const":"resource.not-found"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/resource/not-found"}}},{"properties":{"code":{"const":"runtime.field-encryption.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable"}}},{"properties":{"code":{"const":"service.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},{"properties":{"code":{"const":"source.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},{"properties":{"code":{"const":"statistical-dataset.domain-violation"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation"}}},{"properties":{"code":{"const":"statistical-dataset.release-refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused"}}},{"properties":{"code":{"const":"statistical-dataset.version-conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict"}}},{"properties":{"code":{"const":"statistical-dataset.version-withdrawn"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn"}}},{"properties":{"code":{"const":"unsupported.media-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/unsupported/media-type"}}},{"properties":{"code":{"const":"write.outside-boundary"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}}],"properties":{"accessProfiles":{"items":{"maxLength":128,"minLength":1,"type":"string"},"minItems":2,"type":"array","uniqueItems":true},"atField":{"maxLength":128,"minLength":1,"type":"string"},"code":{"enum":["access-profile.ambiguous","action.evidence-failed","action.guard-failed","action.handler-failed","action.refused","attachment.content-type","attachment.digest-mismatch","attachment.limit-reached","attachment.required","attachment.slot-write-once","attachment.too-large","attachment.verification-pending","attachment.verification-rejected","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","profile.not-authorized","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"},"failedCheck":{"description":"The check that refused the request, included only in development.","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-name-invoke-input":{"$id":"urn:breg:action:correct-name:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"target":{"format":"uuid","type":"string"},"value":{"maxLength":64,"minLength":0,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-name","x-registry-requiredConditionKeys":[]},"action-correct-name-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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"target":{"$id":"urn:breg:record-type:target","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"jurisdiction":{"maxLength":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"required":["name","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable","x-registry-mutationPolicy":{"patch":"proposal-required"}},"target-create-input":{"$id":"urn:breg:record-type:target:input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"jurisdiction":{"maxLength":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"required":["name","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable"}},"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"},"reviewCompletion":{"description":"The review authority's configured completion key verifies the Standard Webhooks signature.","in":"header","name":"webhook-signature","type":"apiKey"}}},"info":{"title":"required-attachment","version":"1"},"openapi":"3.1.0","paths":{"/v1/actions/correct-name/proposals":{"post":{"operationId":"actions.correct-name.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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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-name-invoke-input"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-correct-name-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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":["clerk"],"x-registry-action":{"access":{"accessProfiles":["clerk"]},"apiName":"correctName","attachments":[{"contentTypes":["text/plain"],"id":"support","maximumBytes":4096,"required":true}],"bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"display":{},"execution":{"application":"manual","mode":"proposal","review":"none"},"id":"correct-name","inputMode":"fixed","inputs":[{"apiName":"target","classification":"internal","fieldType":{"onDelete":"restrict","target":"target","type":"reference"},"id":"target","label":"target","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}},{"apiName":"value","classification":"internal","fieldType":{"maximumLength":64,"minimumLength":0,"type":"string"},"id":"value","label":"value","nullable":false,"required":true,"schema":{"maxLength":64,"minLength":0,"type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[{"apiName":"target","input":"target","targetRecordType":"target"}],"requiredConditionKeys":[],"resultEffects":[{"effect":"name","operation":"patch","recordType":"target"}],"revision":"sha256:bc33d44acbc56e239cd2c88aa76698302a40bba0bf7298b80317a82c9fc4cb36","route":"/v1/actions/correct-name/proposals","routes":{"availability":null,"start":{"inputSchema":"action-correct-name-invoke-input","method":"POST","operationId":"actions.correct-name.start","path":"/v1/actions/correct-name/proposals","requiresIdempotencyKey":true,"responseSchema":"action-correct-name-invoke-response"}}},"x-registry-defaultAccessProfile":"clerk","x-registry-operation":"start","x-registry-routeKind":"invoke"}},"/v1/proposals":{"get":{"operationId":"proposals.list","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","query.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}":{"get":{"operationId":"proposals.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/apply":{"post":{"operationId":"proposals.apply","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/attachments/support":{"delete":{"operationId":"proposals.attachments.support.delete","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]},"get":{"operationId":"proposals.attachments.support.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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":{"*/*":{"schema":{"contentMediaType":"application/octet-stream","maxLength":16777216,"type":"string"}}},"description":"Authorized Proposal operation"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]},"patch":{"operationId":"proposals.attachments.support.patch","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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":{"text/plain":{"schema":{"format":"binary","maxLength":4096,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"413":{"content":{"application/problem+json":{"examples":{"attachment.too-large":{"value":{"code":"attachment.too-large","detail":"The file is larger than the attachment slot accepts.","status":413,"title":"Content Too Large","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.too-large"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"attachment.content-type":{"value":{"code":"attachment.content-type","detail":"The file media type is not one the attachment slot accepts.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.content-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/cancel":{"post":{"operationId":"proposals.cancel","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/edit":{"post":{"operationId":"proposals.edit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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-name:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"target":{"format":"uuid","type":"string"},"value":{"maxLength":64,"minLength":0,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-name","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/rebase":{"post":{"operationId":"proposals.rebase","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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-name:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"target":{"format":"uuid","type":"string"},"value":{"maxLength":64,"minLength":0,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-name","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/revise":{"post":{"operationId":"proposals.revise","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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-name:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"target":{"format":"uuid","type":"string"},"value":{"maxLength":64,"minLength":0,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-name","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/submissions/{submission_version}":{"get":{"operationId":"proposals.get-submission","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"proposal.submission-expired":{"value":{"code":"proposal.submission-expired","detail":"The review result and application receipt of the submission are no longer retained.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["proposal.submission-expired"]}},"type":"object"}]}}},"description":"The submission's review result and application receipt are no longer retained","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/submit":{"post":{"operationId":"proposals.submit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"attachment.verification-pending":{"value":{"code":"attachment.verification-pending","detail":"The attachment is awaiting verification. Refresh the Proposal before submitting.","fieldPath":"/attachments/support","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}},"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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.verification-pending","idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"422":{"content":{"application/problem+json":{"examples":{"attachment.required":{"value":{"code":"attachment.required","detail":"The required attachment slot is empty.","fieldPath":"/attachments/support","status":422,"title":"Unprocessable Entity","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/required"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/records/targets":{"get":{"operationId":"records.target.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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"type":"object"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"type":"object"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":["clerk"],"x-registry-operation":"list","x-registry-queryKind":"list","x-registry-queryProfiles":{"clerk":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"clerk","requiredFilters":[],"selectableProperties":["jurisdiction","name"],"selectorProperties":[],"sortableProperties":[],"temporal":null}},"x-registry-recordType":"target","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"target","x-registry-responseShape":"RegistryRecordCollectionV1"},"post":{"operationId":"records.target.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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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/target-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/target"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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/target"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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":["clerk"],"x-registry-operation":"create","x-registry-recordType":"target","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"target","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/records/targets/{record_id}":{"get":{"operationId":"records.target.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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"jurisdiction":{"maxLength":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"type":"object"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"type":"object"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":["clerk"],"x-registry-operation":"get","x-registry-recordType":"target","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"target","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/review-completions":{"post":{"description":"Available when a review authority configures a completion block.","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":"webhook-id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"webhook-timestamp","required":true,"schema":{"pattern":"^(0|[1-9][0-9]{0,19})$","type":"string"}},{"in":"header","name":"webhook-signature","required":true,"schema":{"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 is invalid or eventId differs from webhook-id."},"401":{"description":"The completion authority could not be authenticated.","headers":{"WWW-Authenticate":{"schema":{"const":"Registry-Signature scheme=\"standard-webhooks\", version=\"v1\"","type":"string"}}}},"413":{"description":"The completion body exceeds 2048 bytes. The response body is empty."},"415":{"description":"The request is not application/json."},"503":{"description":"The completion could not be durably recorded."}},"security":[{"reviewCompletion":[]}],"summary":"Receive a Casework review completion"}}}} \ No newline at end of file diff --git a/products/breg/generated/facility/generated/openapi.json b/products/breg/generated/facility/generated/openapi.json index 1ddc3afc5f..62bd90a41e 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":{"enum":["attachment.required","attachment.verification-pending","attachment.verification-rejected"]}}},"then":{"allOf":[{"else":{"properties":{"status":{"const":422}}},"if":{"properties":{"code":{"const":"attachment.verification-pending"}}},"then":{"properties":{"status":{"const":409}}}}],"properties":{"fieldPath":{"pattern":"^/attachments/[a-z][a-z0-9_-]{0,63}$","type":"string"}},"propertyNames":{"enum":["type","title","status","detail","code","traceId","fieldPath"]},"required":["fieldPath"]}},{"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":"access-profile.ambiguous"}}},"then":{"additionalProperties":true,"properties":{"status":{"const":400}},"required":["accessProfiles"]}},{"if":{"properties":{"code":{"not":{"const":"access-profile.ambiguous"}}}},"then":{"not":{"required":["accessProfiles"]}}},{"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"]}}],"anyOf":[{"properties":{"code":{"const":"access-profile.ambiguous"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},{"properties":{"code":{"const":"action.evidence-failed"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/evidence-failed"}}},{"properties":{"code":{"const":"action.guard-failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/guard-failed"}}},{"properties":{"code":{"const":"action.handler-failed"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/handler-failed"}}},{"properties":{"code":{"const":"action.refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/refused"}}},{"properties":{"code":{"const":"attachment.content-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},{"properties":{"code":{"const":"attachment.digest-mismatch"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch"}}},{"properties":{"code":{"const":"attachment.limit-reached"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached"}}},{"properties":{"code":{"const":"attachment.required"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/required"}}},{"properties":{"code":{"const":"attachment.slot-write-once"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once"}}},{"properties":{"code":{"const":"attachment.too-large"},"status":{"const":413},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},{"properties":{"code":{"const":"attachment.verification-pending"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}}},{"properties":{"code":{"const":"attachment.verification-rejected"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected"}}},{"properties":{"code":{"const":"authentication.refused"},"status":{"const":401},"type":{"const":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},{"properties":{"code":{"const":"idempotency.expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},{"properties":{"code":{"const":"idempotency.key-reused"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}}},{"properties":{"code":{"const":"ingestion.chunk-mismatch"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch"}}},{"properties":{"code":{"const":"ingestion.profile-mismatch"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch"}}},{"properties":{"code":{"const":"ingestion.receipt-erased"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased"}}},{"properties":{"code":{"const":"ingestion.run-blocked"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked"}}},{"properties":{"code":{"const":"ingestion.run-not-open"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open"}}},{"properties":{"code":{"const":"lookup.unresolved"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/lookup/unresolved"}}},{"properties":{"code":{"const":"mutation.conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},{"properties":{"code":{"const":"precondition.failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},{"properties":{"code":{"const":"precondition.required"},"status":{"const":428},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},{"properties":{"code":{"const":"profile.not-authorized"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},{"properties":{"code":{"const":"proposal.rejected"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},{"properties":{"code":{"const":"proposal.review-result-mismatch"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch"}}},{"properties":{"code":{"const":"proposal.submission-expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},{"properties":{"code":{"const":"query.cursor-invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid"}}},{"properties":{"code":{"const":"query.filter-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/filter-required"}}},{"properties":{"code":{"const":"query.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/invalid"}}},{"properties":{"code":{"const":"request.access-reason-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/access-reason-required"}}},{"properties":{"code":{"const":"request.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},{"properties":{"code":{"const":"request.timeout"},"status":{"const":504},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},{"properties":{"code":{"const":"resource.not-found"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/resource/not-found"}}},{"properties":{"code":{"const":"runtime.field-encryption.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable"}}},{"properties":{"code":{"const":"service.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},{"properties":{"code":{"const":"source.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},{"properties":{"code":{"const":"statistical-dataset.domain-violation"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation"}}},{"properties":{"code":{"const":"statistical-dataset.release-refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused"}}},{"properties":{"code":{"const":"statistical-dataset.version-conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict"}}},{"properties":{"code":{"const":"statistical-dataset.version-withdrawn"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn"}}},{"properties":{"code":{"const":"unsupported.media-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/unsupported/media-type"}}},{"properties":{"code":{"const":"write.outside-boundary"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}}],"properties":{"accessProfiles":{"items":{"maxLength":128,"minLength":1,"type":"string"},"minItems":2,"type":"array","uniqueItems":true},"atField":{"maxLength":128,"minLength":1,"type":"string"},"code":{"enum":["access-profile.ambiguous","action.evidence-failed","action.guard-failed","action.handler-failed","action.refused","attachment.content-type","attachment.digest-mismatch","attachment.limit-reached","attachment.required","attachment.slot-write-once","attachment.too-large","attachment.verification-pending","attachment.verification-rejected","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","profile.not-authorized","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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},"guardLabel":{"maxLength":256,"minLength":1,"type":"string"},"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"},"reviewCompletion":{"description":"The review authority's configured completion key verifies the Standard Webhooks signature.","in":"header","name":"webhook-signature","type":"apiKey"}}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","query.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"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":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["proposal-reviewer"],"maxLength":128,"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["proposal-reviewer"]}},"/v1/proposals/{proposal_id}":{"get":{"operationId":"proposals.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-applier","facility-correction-author"]}},"/v1/proposals/{proposal_id}/apply":{"post":{"operationId":"proposals.apply","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-applier"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.review-result-mismatch":{"value":{"code":"proposal.review-result-mismatch","detail":"The current review result does not match the retained approval.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["action.guard-failed","precondition.failed","proposal.review-result-mismatch"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-applier"]}},"/v1/proposals/{proposal_id}/attachments/supporting-document":{"delete":{"operationId":"proposals.attachments.supporting-document.delete","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]},"get":{"operationId":"proposals.attachments.supporting-document.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author","proposal-reviewer"],"maxLength":128,"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":{"*/*":{"schema":{"contentMediaType":"application/octet-stream","maxLength":16777216,"type":"string"}}},"description":"Authorized Proposal operation"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author","proposal-reviewer"]},"patch":{"operationId":"proposals.attachments.supporting-document.patch","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"413":{"content":{"application/problem+json":{"examples":{"attachment.too-large":{"value":{"code":"attachment.too-large","detail":"The file is larger than the attachment slot accepts.","status":413,"title":"Content Too Large","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.too-large"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"attachment.content-type":{"value":{"code":"attachment.content-type","detail":"The file media type is not one the attachment slot accepts.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.content-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/cancel":{"post":{"operationId":"proposals.cancel","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/edit":{"post":{"operationId":"proposals.edit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/rebase":{"post":{"operationId":"proposals.rebase","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/retry":{"post":{"operationId":"proposals.retry","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/review-context":{"get":{"operationId":"proposals.get-review-context","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["proposal-reviewer"],"maxLength":128,"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Request live applicant answers for a displayed human review context. Admission and preflight reads omit this option and receive no intrinsic asks.","in":"query","name":"include","required":false,"schema":{"const":"answers"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"authority":{"type":"string"},"context":{"additionalProperties":false,"properties":{"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"answeredAt":{"format":"date-time","type":"string"},"documents":{"items":{"additionalProperties":false,"properties":{"byteSize":{"maximum":16777216,"minimum":1,"type":"integer"},"contentType":{"maxLength":255,"type":"string"},"download":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"method":{"const":"GET"},"operation":{"const":"get-review-context"},"path":{"type":"string"}},"required":["method","operation","accessProfile","path"],"type":"object"},"id":{"format":"uuid","type":"string"},"sha256":{"pattern":"^[0-9a-f]{64}$","type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["id","sha256","contentType","byteSize","verificationStatus"],"type":"object"},"maxItems":32,"type":"array"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["documents","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state"],"type":"object"},"maxItems":50,"type":"array"},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["proposal-reviewer"]}},"/v1/proposals/{proposal_id}/review-status":{"get":{"operationId":"proposals.get-review-status","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["casework-review-status","facility-correction-author"],"maxLength":128,"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["casework-review-status","facility-correction-author"]}},"/v1/proposals/{proposal_id}/revise":{"post":{"operationId":"proposals.revise","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/submissions/{submission_version}":{"get":{"operationId":"proposals.get-submission","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"maxLength":128,"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","revise","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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"proposal.submission-expired":{"value":{"code":"proposal.submission-expired","detail":"The review result and application receipt of the submission are no longer retained.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["proposal.submission-expired"]}},"type":"object"}]}}},"description":"The submission's review result and application receipt are no longer retained","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-applier","facility-correction-author"]}},"/v1/proposals/{proposal_id}/submit":{"post":{"operationId":"proposals.submit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"attachment.verification-pending":{"value":{"code":"attachment.verification-pending","detail":"The attachment is awaiting verification. Refresh the Proposal before submitting.","fieldPath":"/attachments/supporting-document","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}},"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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.verification-pending","idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["action.guard-failed","precondition.failed"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"422":{"content":{"application/problem+json":{"examples":{"action.refused/invalid-postal-code":{"value":{"code":"action.refused","detail":"Postal code is invalid","refusalCode":"invalid-postal-code","status":422,"title":"Unprocessable Entity","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/action/refused"}},"attachment.verification-rejected":{"value":{"code":"attachment.verification-rejected","detail":"The attachment was rejected by verification. Replace or remove the file before submitting.","fieldPath":"/attachments/supporting-document","status":422,"title":"Unprocessable Entity","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["action.refused","attachment.verification-rejected"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"500":{"content":{"application/problem+json":{"examples":{"action.handler-failed":{"value":{"code":"action.handler-failed","detail":"The action handler could not produce an accepted result.","status":500,"title":"Internal Server Error","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/action/handler-failed"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["action.handler-failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility-assignment"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility-assignment"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility-assignment"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility-assignment"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"selectableProperties":["jurisdiction","operatorCode","status"],"selectorProperties":[],"sortableProperties":[],"temporal":null},"operator-editor":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"operator-editor","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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 block.","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":"webhook-id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"webhook-timestamp","required":true,"schema":{"pattern":"^(0|[1-9][0-9]{0,19})$","type":"string"}},{"in":"header","name":"webhook-signature","required":true,"schema":{"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 is invalid or eventId differs from webhook-id."},"401":{"description":"The completion authority could not be authenticated.","headers":{"WWW-Authenticate":{"schema":{"const":"Registry-Signature scheme=\"standard-webhooks\", version=\"v1\"","type":"string"}}}},"413":{"description":"The completion body exceeds 2048 bytes. The response body is empty."},"415":{"description":"The request is not application/json."},"503":{"description":"The completion could not be durably recorded."}},"security":[{"reviewCompletion":[]}],"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":{"enum":["attachment.required","attachment.verification-pending","attachment.verification-rejected"]}}},"then":{"allOf":[{"else":{"properties":{"status":{"const":422}}},"if":{"properties":{"code":{"const":"attachment.verification-pending"}}},"then":{"properties":{"status":{"const":409}}}}],"properties":{"fieldPath":{"pattern":"^/attachments/[a-z][a-z0-9_-]{0,63}$","type":"string"}},"propertyNames":{"enum":["type","title","status","detail","code","traceId","fieldPath"]},"required":["fieldPath"]}},{"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","failedCheck"]}}},{"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":"access-profile.ambiguous"}}},"then":{"additionalProperties":true,"properties":{"status":{"const":400}},"required":["accessProfiles"]}},{"if":{"properties":{"code":{"not":{"const":"access-profile.ambiguous"}}}},"then":{"not":{"required":["accessProfiles"]}}},{"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"]}}],"anyOf":[{"properties":{"code":{"const":"access-profile.ambiguous"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},{"properties":{"code":{"const":"action.evidence-failed"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/evidence-failed"}}},{"properties":{"code":{"const":"action.guard-failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/guard-failed"}}},{"properties":{"code":{"const":"action.handler-failed"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/handler-failed"}}},{"properties":{"code":{"const":"action.refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/refused"}}},{"properties":{"code":{"const":"attachment.content-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},{"properties":{"code":{"const":"attachment.digest-mismatch"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch"}}},{"properties":{"code":{"const":"attachment.limit-reached"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached"}}},{"properties":{"code":{"const":"attachment.required"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/required"}}},{"properties":{"code":{"const":"attachment.slot-write-once"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once"}}},{"properties":{"code":{"const":"attachment.too-large"},"status":{"const":413},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},{"properties":{"code":{"const":"attachment.verification-pending"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}}},{"properties":{"code":{"const":"attachment.verification-rejected"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected"}}},{"properties":{"code":{"const":"authentication.refused"},"status":{"const":401},"type":{"const":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},{"properties":{"code":{"const":"idempotency.expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},{"properties":{"code":{"const":"idempotency.key-reused"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}}},{"properties":{"code":{"const":"ingestion.chunk-mismatch"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch"}}},{"properties":{"code":{"const":"ingestion.profile-mismatch"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch"}}},{"properties":{"code":{"const":"ingestion.receipt-erased"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased"}}},{"properties":{"code":{"const":"ingestion.run-blocked"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked"}}},{"properties":{"code":{"const":"ingestion.run-not-open"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open"}}},{"properties":{"code":{"const":"lookup.unresolved"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/lookup/unresolved"}}},{"properties":{"code":{"const":"mutation.conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},{"properties":{"code":{"const":"precondition.failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},{"properties":{"code":{"const":"precondition.required"},"status":{"const":428},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},{"properties":{"code":{"const":"profile.not-authorized"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},{"properties":{"code":{"const":"proposal.rejected"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},{"properties":{"code":{"const":"proposal.review-result-mismatch"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch"}}},{"properties":{"code":{"const":"proposal.submission-expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},{"properties":{"code":{"const":"query.cursor-invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid"}}},{"properties":{"code":{"const":"query.filter-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/filter-required"}}},{"properties":{"code":{"const":"query.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/invalid"}}},{"properties":{"code":{"const":"request.access-reason-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/access-reason-required"}}},{"properties":{"code":{"const":"request.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},{"properties":{"code":{"const":"request.timeout"},"status":{"const":504},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},{"properties":{"code":{"const":"resource.not-found"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/resource/not-found"}}},{"properties":{"code":{"const":"runtime.field-encryption.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable"}}},{"properties":{"code":{"const":"service.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},{"properties":{"code":{"const":"source.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},{"properties":{"code":{"const":"statistical-dataset.domain-violation"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation"}}},{"properties":{"code":{"const":"statistical-dataset.release-refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused"}}},{"properties":{"code":{"const":"statistical-dataset.version-conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict"}}},{"properties":{"code":{"const":"statistical-dataset.version-withdrawn"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn"}}},{"properties":{"code":{"const":"unsupported.media-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/unsupported/media-type"}}},{"properties":{"code":{"const":"write.outside-boundary"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}}],"properties":{"accessProfiles":{"items":{"maxLength":128,"minLength":1,"type":"string"},"minItems":2,"type":"array","uniqueItems":true},"atField":{"maxLength":128,"minLength":1,"type":"string"},"code":{"enum":["access-profile.ambiguous","action.evidence-failed","action.guard-failed","action.handler-failed","action.refused","attachment.content-type","attachment.digest-mismatch","attachment.limit-reached","attachment.required","attachment.slot-write-once","attachment.too-large","attachment.verification-pending","attachment.verification-rejected","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","profile.not-authorized","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"},"failedCheck":{"description":"The check that refused the request, included only in development.","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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},"guardLabel":{"maxLength":256,"minLength":1,"type":"string"},"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"},"reviewCompletion":{"description":"The review authority's configured completion key verifies the Standard Webhooks signature.","in":"header","name":"webhook-signature","type":"apiKey"}}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","query.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"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":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["proposal-reviewer"],"maxLength":128,"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["proposal-reviewer"]}},"/v1/proposals/{proposal_id}":{"get":{"operationId":"proposals.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-applier","facility-correction-author"]}},"/v1/proposals/{proposal_id}/apply":{"post":{"operationId":"proposals.apply","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-applier"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.review-result-mismatch":{"value":{"code":"proposal.review-result-mismatch","detail":"The current review result does not match the retained approval.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["action.guard-failed","precondition.failed","proposal.review-result-mismatch"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-applier"]}},"/v1/proposals/{proposal_id}/attachments/supporting-document":{"delete":{"operationId":"proposals.attachments.supporting-document.delete","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]},"get":{"operationId":"proposals.attachments.supporting-document.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author","proposal-reviewer"],"maxLength":128,"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":{"*/*":{"schema":{"contentMediaType":"application/octet-stream","maxLength":16777216,"type":"string"}}},"description":"Authorized Proposal operation"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author","proposal-reviewer"]},"patch":{"operationId":"proposals.attachments.supporting-document.patch","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"413":{"content":{"application/problem+json":{"examples":{"attachment.too-large":{"value":{"code":"attachment.too-large","detail":"The file is larger than the attachment slot accepts.","status":413,"title":"Content Too Large","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.too-large"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"attachment.content-type":{"value":{"code":"attachment.content-type","detail":"The file media type is not one the attachment slot accepts.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.content-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/cancel":{"post":{"operationId":"proposals.cancel","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/edit":{"post":{"operationId":"proposals.edit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/rebase":{"post":{"operationId":"proposals.rebase","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/retry":{"post":{"operationId":"proposals.retry","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/review-context":{"get":{"operationId":"proposals.get-review-context","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["proposal-reviewer"],"maxLength":128,"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Request live applicant answers for a displayed human review context. Admission and preflight reads omit this option and receive no intrinsic asks.","in":"query","name":"include","required":false,"schema":{"const":"answers"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"authority":{"type":"string"},"context":{"additionalProperties":false,"properties":{"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"answeredAt":{"format":"date-time","type":"string"},"documents":{"items":{"additionalProperties":false,"properties":{"byteSize":{"maximum":16777216,"minimum":1,"type":"integer"},"contentType":{"maxLength":255,"type":"string"},"download":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"method":{"const":"GET"},"operation":{"const":"get-review-context"},"path":{"type":"string"}},"required":["method","operation","accessProfile","path"],"type":"object"},"id":{"format":"uuid","type":"string"},"sha256":{"pattern":"^[0-9a-f]{64}$","type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["id","sha256","contentType","byteSize","verificationStatus"],"type":"object"},"maxItems":32,"type":"array"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["documents","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state"],"type":"object"},"maxItems":50,"type":"array"},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["proposal-reviewer"]}},"/v1/proposals/{proposal_id}/review-status":{"get":{"operationId":"proposals.get-review-status","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["casework-review-status","facility-correction-author"],"maxLength":128,"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["casework-review-status","facility-correction-author"]}},"/v1/proposals/{proposal_id}/revise":{"post":{"operationId":"proposals.revise","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/submissions/{submission_version}":{"get":{"operationId":"proposals.get-submission","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"maxLength":128,"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","revise","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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"proposal.submission-expired":{"value":{"code":"proposal.submission-expired","detail":"The review result and application receipt of the submission are no longer retained.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["proposal.submission-expired"]}},"type":"object"}]}}},"description":"The submission's review result and application receipt are no longer retained","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-applier","facility-correction-author"]}},"/v1/proposals/{proposal_id}/submit":{"post":{"operationId":"proposals.submit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"attachment.verification-pending":{"value":{"code":"attachment.verification-pending","detail":"The attachment is awaiting verification. Refresh the Proposal before submitting.","fieldPath":"/attachments/supporting-document","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}},"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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.verification-pending","idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["action.guard-failed","precondition.failed"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"422":{"content":{"application/problem+json":{"examples":{"action.refused/invalid-postal-code":{"value":{"code":"action.refused","detail":"Postal code is invalid","refusalCode":"invalid-postal-code","status":422,"title":"Unprocessable Entity","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/action/refused"}},"attachment.verification-rejected":{"value":{"code":"attachment.verification-rejected","detail":"The attachment was rejected by verification. Replace or remove the file before submitting.","fieldPath":"/attachments/supporting-document","status":422,"title":"Unprocessable Entity","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["action.refused","attachment.verification-rejected"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"500":{"content":{"application/problem+json":{"examples":{"action.handler-failed":{"value":{"code":"action.handler-failed","detail":"The action handler could not produce an accepted result.","status":500,"title":"Internal Server Error","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/action/handler-failed"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["action.handler-failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility-assignment"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility-assignment"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility-assignment"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility-assignment"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"selectableProperties":["jurisdiction","operatorCode","status"],"selectorProperties":[],"sortableProperties":[],"temporal":null},"operator-editor":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"operator-editor","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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 block.","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":"webhook-id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"webhook-timestamp","required":true,"schema":{"pattern":"^(0|[1-9][0-9]{0,19})$","type":"string"}},{"in":"header","name":"webhook-signature","required":true,"schema":{"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 is invalid or eventId differs from webhook-id."},"401":{"description":"The completion authority could not be authenticated.","headers":{"WWW-Authenticate":{"schema":{"const":"Registry-Signature scheme=\"standard-webhooks\", version=\"v1\"","type":"string"}}}},"413":{"description":"The completion body exceeds 2048 bytes. The response body is empty."},"415":{"description":"The request is not application/json."},"503":{"description":"The completion could not be durably recorded."}},"security":[{"reviewCompletion":[]}],"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 a084c426b4..442a7b6342 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":{"enum":["attachment.required","attachment.verification-pending","attachment.verification-rejected"]}}},"then":{"allOf":[{"else":{"properties":{"status":{"const":422}}},"if":{"properties":{"code":{"const":"attachment.verification-pending"}}},"then":{"properties":{"status":{"const":409}}}}],"properties":{"fieldPath":{"pattern":"^/attachments/[a-z][a-z0-9_-]{0,63}$","type":"string"}},"propertyNames":{"enum":["type","title","status","detail","code","traceId","fieldPath"]},"required":["fieldPath"]}},{"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":"access-profile.ambiguous"}}},"then":{"additionalProperties":true,"properties":{"status":{"const":400}},"required":["accessProfiles"]}},{"if":{"properties":{"code":{"not":{"const":"access-profile.ambiguous"}}}},"then":{"not":{"required":["accessProfiles"]}}},{"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"]}}],"anyOf":[{"properties":{"code":{"const":"access-profile.ambiguous"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},{"properties":{"code":{"const":"action.evidence-failed"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/evidence-failed"}}},{"properties":{"code":{"const":"action.guard-failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/guard-failed"}}},{"properties":{"code":{"const":"action.handler-failed"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/handler-failed"}}},{"properties":{"code":{"const":"action.refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/refused"}}},{"properties":{"code":{"const":"attachment.content-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},{"properties":{"code":{"const":"attachment.digest-mismatch"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch"}}},{"properties":{"code":{"const":"attachment.limit-reached"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached"}}},{"properties":{"code":{"const":"attachment.required"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/required"}}},{"properties":{"code":{"const":"attachment.slot-write-once"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once"}}},{"properties":{"code":{"const":"attachment.too-large"},"status":{"const":413},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},{"properties":{"code":{"const":"attachment.verification-pending"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}}},{"properties":{"code":{"const":"attachment.verification-rejected"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected"}}},{"properties":{"code":{"const":"authentication.refused"},"status":{"const":401},"type":{"const":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},{"properties":{"code":{"const":"idempotency.expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},{"properties":{"code":{"const":"idempotency.key-reused"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}}},{"properties":{"code":{"const":"ingestion.chunk-mismatch"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch"}}},{"properties":{"code":{"const":"ingestion.profile-mismatch"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch"}}},{"properties":{"code":{"const":"ingestion.receipt-erased"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased"}}},{"properties":{"code":{"const":"ingestion.run-blocked"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked"}}},{"properties":{"code":{"const":"ingestion.run-not-open"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open"}}},{"properties":{"code":{"const":"lookup.unresolved"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/lookup/unresolved"}}},{"properties":{"code":{"const":"mutation.conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},{"properties":{"code":{"const":"precondition.failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},{"properties":{"code":{"const":"precondition.required"},"status":{"const":428},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},{"properties":{"code":{"const":"profile.not-authorized"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},{"properties":{"code":{"const":"proposal.rejected"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},{"properties":{"code":{"const":"proposal.review-result-mismatch"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch"}}},{"properties":{"code":{"const":"proposal.submission-expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},{"properties":{"code":{"const":"query.cursor-invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid"}}},{"properties":{"code":{"const":"query.filter-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/filter-required"}}},{"properties":{"code":{"const":"query.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/invalid"}}},{"properties":{"code":{"const":"request.access-reason-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/access-reason-required"}}},{"properties":{"code":{"const":"request.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},{"properties":{"code":{"const":"request.timeout"},"status":{"const":504},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},{"properties":{"code":{"const":"resource.not-found"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/resource/not-found"}}},{"properties":{"code":{"const":"runtime.field-encryption.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable"}}},{"properties":{"code":{"const":"service.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},{"properties":{"code":{"const":"source.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},{"properties":{"code":{"const":"statistical-dataset.domain-violation"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation"}}},{"properties":{"code":{"const":"statistical-dataset.release-refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused"}}},{"properties":{"code":{"const":"statistical-dataset.version-conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict"}}},{"properties":{"code":{"const":"statistical-dataset.version-withdrawn"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn"}}},{"properties":{"code":{"const":"unsupported.media-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/unsupported/media-type"}}},{"properties":{"code":{"const":"write.outside-boundary"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}}],"properties":{"accessProfiles":{"items":{"maxLength":128,"minLength":1,"type":"string"},"minItems":2,"type":"array","uniqueItems":true},"atField":{"maxLength":128,"minLength":1,"type":"string"},"code":{"enum":["access-profile.ambiguous","action.evidence-failed","action.guard-failed","action.handler-failed","action.refused","attachment.content-type","attachment.digest-mismatch","attachment.limit-reached","attachment.required","attachment.slot-write-once","attachment.too-large","attachment.verification-pending","attachment.verification-rejected","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","profile.not-authorized","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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},"guardLabel":{"maxLength":256,"minLength":1,"type":"string"},"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"},"reviewCompletion":{"description":"The review authority's configured completion key verifies the Standard Webhooks signature.","in":"header","name":"webhook-signature","type":"apiKey"}}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","query.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}":{"get":{"operationId":"proposals.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/cancel":{"post":{"operationId":"proposals.cancel","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/edit":{"post":{"operationId":"proposals.edit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/submissions/{submission_version}":{"get":{"operationId":"proposals.get-submission","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"proposal.submission-expired":{"value":{"code":"proposal.submission-expired","detail":"The review result and application receipt of the submission are no longer retained.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["proposal.submission-expired"]}},"type":"object"}]}}},"description":"The submission's review result and application receipt are no longer retained","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/submit":{"post":{"operationId":"proposals.submit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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 block.","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":"webhook-id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"webhook-timestamp","required":true,"schema":{"pattern":"^(0|[1-9][0-9]{0,19})$","type":"string"}},{"in":"header","name":"webhook-signature","required":true,"schema":{"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 is invalid or eventId differs from webhook-id."},"401":{"description":"The completion authority could not be authenticated.","headers":{"WWW-Authenticate":{"schema":{"const":"Registry-Signature scheme=\"standard-webhooks\", version=\"v1\"","type":"string"}}}},"413":{"description":"The completion body exceeds 2048 bytes. The response body is empty."},"415":{"description":"The request is not application/json."},"503":{"description":"The completion could not be durably recorded."}},"security":[{"reviewCompletion":[]}],"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":{"enum":["attachment.required","attachment.verification-pending","attachment.verification-rejected"]}}},"then":{"allOf":[{"else":{"properties":{"status":{"const":422}}},"if":{"properties":{"code":{"const":"attachment.verification-pending"}}},"then":{"properties":{"status":{"const":409}}}}],"properties":{"fieldPath":{"pattern":"^/attachments/[a-z][a-z0-9_-]{0,63}$","type":"string"}},"propertyNames":{"enum":["type","title","status","detail","code","traceId","fieldPath"]},"required":["fieldPath"]}},{"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","failedCheck"]}}},{"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":"access-profile.ambiguous"}}},"then":{"additionalProperties":true,"properties":{"status":{"const":400}},"required":["accessProfiles"]}},{"if":{"properties":{"code":{"not":{"const":"access-profile.ambiguous"}}}},"then":{"not":{"required":["accessProfiles"]}}},{"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"]}}],"anyOf":[{"properties":{"code":{"const":"access-profile.ambiguous"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},{"properties":{"code":{"const":"action.evidence-failed"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/evidence-failed"}}},{"properties":{"code":{"const":"action.guard-failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/guard-failed"}}},{"properties":{"code":{"const":"action.handler-failed"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/handler-failed"}}},{"properties":{"code":{"const":"action.refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/refused"}}},{"properties":{"code":{"const":"attachment.content-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},{"properties":{"code":{"const":"attachment.digest-mismatch"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch"}}},{"properties":{"code":{"const":"attachment.limit-reached"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached"}}},{"properties":{"code":{"const":"attachment.required"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/required"}}},{"properties":{"code":{"const":"attachment.slot-write-once"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once"}}},{"properties":{"code":{"const":"attachment.too-large"},"status":{"const":413},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},{"properties":{"code":{"const":"attachment.verification-pending"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}}},{"properties":{"code":{"const":"attachment.verification-rejected"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected"}}},{"properties":{"code":{"const":"authentication.refused"},"status":{"const":401},"type":{"const":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},{"properties":{"code":{"const":"idempotency.expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},{"properties":{"code":{"const":"idempotency.key-reused"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}}},{"properties":{"code":{"const":"ingestion.chunk-mismatch"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch"}}},{"properties":{"code":{"const":"ingestion.profile-mismatch"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch"}}},{"properties":{"code":{"const":"ingestion.receipt-erased"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased"}}},{"properties":{"code":{"const":"ingestion.run-blocked"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked"}}},{"properties":{"code":{"const":"ingestion.run-not-open"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open"}}},{"properties":{"code":{"const":"lookup.unresolved"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/lookup/unresolved"}}},{"properties":{"code":{"const":"mutation.conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},{"properties":{"code":{"const":"precondition.failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},{"properties":{"code":{"const":"precondition.required"},"status":{"const":428},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},{"properties":{"code":{"const":"profile.not-authorized"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},{"properties":{"code":{"const":"proposal.rejected"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},{"properties":{"code":{"const":"proposal.review-result-mismatch"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch"}}},{"properties":{"code":{"const":"proposal.submission-expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},{"properties":{"code":{"const":"query.cursor-invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid"}}},{"properties":{"code":{"const":"query.filter-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/filter-required"}}},{"properties":{"code":{"const":"query.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/invalid"}}},{"properties":{"code":{"const":"request.access-reason-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/access-reason-required"}}},{"properties":{"code":{"const":"request.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},{"properties":{"code":{"const":"request.timeout"},"status":{"const":504},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},{"properties":{"code":{"const":"resource.not-found"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/resource/not-found"}}},{"properties":{"code":{"const":"runtime.field-encryption.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable"}}},{"properties":{"code":{"const":"service.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},{"properties":{"code":{"const":"source.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},{"properties":{"code":{"const":"statistical-dataset.domain-violation"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation"}}},{"properties":{"code":{"const":"statistical-dataset.release-refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused"}}},{"properties":{"code":{"const":"statistical-dataset.version-conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict"}}},{"properties":{"code":{"const":"statistical-dataset.version-withdrawn"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn"}}},{"properties":{"code":{"const":"unsupported.media-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/unsupported/media-type"}}},{"properties":{"code":{"const":"write.outside-boundary"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}}],"properties":{"accessProfiles":{"items":{"maxLength":128,"minLength":1,"type":"string"},"minItems":2,"type":"array","uniqueItems":true},"atField":{"maxLength":128,"minLength":1,"type":"string"},"code":{"enum":["access-profile.ambiguous","action.evidence-failed","action.guard-failed","action.handler-failed","action.refused","attachment.content-type","attachment.digest-mismatch","attachment.limit-reached","attachment.required","attachment.slot-write-once","attachment.too-large","attachment.verification-pending","attachment.verification-rejected","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","profile.not-authorized","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"},"failedCheck":{"description":"The check that refused the request, included only in development.","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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},"guardLabel":{"maxLength":256,"minLength":1,"type":"string"},"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"},"reviewCompletion":{"description":"The review authority's configured completion key verifies the Standard Webhooks signature.","in":"header","name":"webhook-signature","type":"apiKey"}}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","query.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}":{"get":{"operationId":"proposals.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/cancel":{"post":{"operationId":"proposals.cancel","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/edit":{"post":{"operationId":"proposals.edit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/submissions/{submission_version}":{"get":{"operationId":"proposals.get-submission","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"proposal.submission-expired":{"value":{"code":"proposal.submission-expired","detail":"The review result and application receipt of the submission are no longer retained.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["proposal.submission-expired"]}},"type":"object"}]}}},"description":"The submission's review result and application receipt are no longer retained","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/submit":{"post":{"operationId":"proposals.submit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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 block.","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":"webhook-id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"webhook-timestamp","required":true,"schema":{"pattern":"^(0|[1-9][0-9]{0,19})$","type":"string"}},{"in":"header","name":"webhook-signature","required":true,"schema":{"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 is invalid or eventId differs from webhook-id."},"401":{"description":"The completion authority could not be authenticated.","headers":{"WWW-Authenticate":{"schema":{"const":"Registry-Signature scheme=\"standard-webhooks\", version=\"v1\"","type":"string"}}}},"413":{"description":"The completion body exceeds 2048 bytes. The response body is empty."},"415":{"description":"The request is not application/json."},"503":{"description":"The completion could not be durably recorded."}},"security":[{"reviewCompletion":[]}],"summary":"Receive a Casework review completion"}}}} \ No newline at end of file diff --git a/products/casework/generated/registry-casework.openapi.json b/products/casework/generated/registry-casework.openapi.json index f490837492..d0ced3dbf3 100644 --- a/products/casework/generated/registry-casework.openapi.json +++ b/products/casework/generated/registry-casework.openapi.json @@ -1534,6 +1534,10 @@ "detail": { "type": "string" }, + "failedCheck": { + "description": "The check that refused the request, included only in development.", + "type": "string" + }, "status": { "type": "integer" }, diff --git a/products/casework/scripts/generate_openapi.py b/products/casework/scripts/generate_openapi.py index 2538a6fa9b..c2b0bb6ce4 100644 --- a/products/casework/scripts/generate_openapi.py +++ b/products/casework/scripts/generate_openapi.py @@ -185,7 +185,10 @@ def problem_component_name(code: str) -> str: def problem_schemas(entries: list[dict]) -> dict: text={"type":"string"} - base=object_schema({"type":text,"title":text,"status":{"type":"integer"},"detail":text,"code":text,"traceId":text},["type","title","status","detail","code","traceId"]) + base=object_schema({ + "type":text,"title":text,"status":{"type":"integer"},"detail":text,"code":text,"traceId":text, + "failedCheck":{"type":"string","description":"The check that refused the request, included only in development."}, + },["type","title","status","detail","code","traceId"]) result={"Problem":base} for entry in entries: uri=entry["uri"] diff --git a/products/casework/scripts/test_generate_openapi.py b/products/casework/scripts/test_generate_openapi.py index 3d99a0f02d..2a7f887d1b 100644 --- a/products/casework/scripts/test_generate_openapi.py +++ b/products/casework/scripts/test_generate_openapi.py @@ -43,6 +43,21 @@ def test_release_refuses_source_headers_without_advertising_source_reads(self): ) +class ProblemSchemaTests(unittest.TestCase): + def test_development_failed_check_is_optional_and_ambiguity_is_untagged(self): + schemas = GEN.problem_schemas(contract()["entries"] + [{ + "code": "access-profile.ambiguous", + "uri": "https://id.registrystack.org/problems/registry-casework/access-profile/ambiguous", + "title": "Access profile is ambiguous", + "description": "More than one access profile applies.", + "httpStatuses": [400], + }]) + envelope = schemas["Problem"] + self.assertEqual("string", envelope["properties"]["failedCheck"]["type"]) + self.assertNotIn("failedCheck", envelope["required"]) + self.assertNotIn("failedCheck", schemas["ProblemAccessProfileAmbiguous"]["properties"]) + + class GeneratedContractTests(unittest.TestCase): @classmethod def setUpClass(cls): diff --git a/products/coordinator/generated/openapi/coordinator.openapi.json b/products/coordinator/generated/openapi/coordinator.openapi.json index 6b24e69000..1b39de1134 100644 --- a/products/coordinator/generated/openapi/coordinator.openapi.json +++ b/products/coordinator/generated/openapi/coordinator.openapi.json @@ -594,6 +594,10 @@ "detail": { "type": "string" }, + "failedCheck": { + "description": "The check that refused the request, included only in development.", + "type": "string" + }, "pointer": { "type": "string" }, diff --git a/products/documents/generated/registry-documents.openapi.json b/products/documents/generated/registry-documents.openapi.json index cdb08d4c0f..73a6370898 100644 --- a/products/documents/generated/registry-documents.openapi.json +++ b/products/documents/generated/registry-documents.openapi.json @@ -426,6 +426,10 @@ "detail": { "type": "string" }, + "failedCheck": { + "description": "The check that refused the request, included only in development.", + "type": "string" + }, "status": { "type": "integer" }, diff --git a/products/evidence/generated/problem-v1.schema.json b/products/evidence/generated/problem-v1.schema.json index 0138285156..94b1cffa69 100644 --- a/products/evidence/generated/problem-v1.schema.json +++ b/products/evidence/generated/problem-v1.schema.json @@ -268,6 +268,10 @@ ], "type": "string" }, + "failedCheck": { + "description": "The check that refused the request, included only in development.", + "type": "string" + }, "status": { "enum": [ 400, diff --git a/products/evidence/generated/registry-evidence-oid4vci.openapi.json b/products/evidence/generated/registry-evidence-oid4vci.openapi.json index 7d98602b77..c174ea8a0a 100644 --- a/products/evidence/generated/registry-evidence-oid4vci.openapi.json +++ b/products/evidence/generated/registry-evidence-oid4vci.openapi.json @@ -528,6 +528,10 @@ }, "error_description": { "type": "string" + }, + "failedCheck": { + "description": "The check that refused the request, included only in development.", + "type": "string" } }, "required": [ @@ -679,6 +683,10 @@ }, "error_description": { "type": "string" + }, + "failedCheck": { + "description": "The check that refused the request, included only in development.", + "type": "string" } }, "required": [ diff --git a/products/evidence/generated/registry-evidence-oid4vp.openapi.json b/products/evidence/generated/registry-evidence-oid4vp.openapi.json index f651e315f9..be8db03eae 100644 --- a/products/evidence/generated/registry-evidence-oid4vp.openapi.json +++ b/products/evidence/generated/registry-evidence-oid4vp.openapi.json @@ -174,6 +174,10 @@ "invalid_request", "temporarily_unavailable" ] + }, + "failedCheck": { + "description": "The check that refused the request, included only in development.", + "type": "string" } }, "required": [ @@ -202,6 +206,10 @@ "detail": { "type": "string" }, + "failedCheck": { + "description": "The check that refused the request, included only in development.", + "type": "string" + }, "status": { "type": "integer" }, diff --git a/products/evidence/generated/registry-evidence.openapi.json b/products/evidence/generated/registry-evidence.openapi.json index 495e10061a..3f1e9275fd 100644 --- a/products/evidence/generated/registry-evidence.openapi.json +++ b/products/evidence/generated/registry-evidence.openapi.json @@ -1813,6 +1813,10 @@ ], "type": "string" }, + "failedCheck": { + "description": "The check that refused the request, included only in development.", + "type": "string" + }, "status": { "enum": [ 400, diff --git a/products/identifiers/scripts/generate.py b/products/identifiers/scripts/generate.py index f9e7c594e6..18ce0c06c6 100755 --- a/products/identifiers/scripts/generate.py +++ b/products/identifiers/scripts/generate.py @@ -15,6 +15,9 @@ BASE_URL = "https://id.registrystack.org" +PROBLEM_CODE_SEGMENT = re.compile(r"[a-z][a-z0-9]*(?:-[a-z0-9]+)*") +# The published OID4VP contract uses unqualified codes in its own namespace. +OID4VP_PROBLEM_URI_PREFIX = f"{BASE_URL}/problems/registry-evidence-oid4vp/" # Discovery's published type URIs predate its qualified problem codes. # Pin these pairs while other products retain the usual URI derivation. DISCOVERY_PROBLEM_URI_SUFFIXES = { @@ -439,18 +442,32 @@ def problem_entries( source = source_record(repo_root, repo_root / source_config["sourcePath"]) entries: list[dict[str, Any]] = [] expected = {"uri", "code", "title", "description", "httpStatuses"} + uri_prefix = source_config["uriPrefix"] for index, entry in enumerate(raw_entries): if not isinstance(entry, dict) or set(entry) != expected: raise CatalogError( f"{source_config['owner']} problem entry {index} has an invalid shape" ) - suffix = entry["code"].replace(".", "/") - if source_config["uriPrefix"] == f"{BASE_URL}/problems/registry-discovery/": - suffix = DISCOVERY_PROBLEM_URI_SUFFIXES.get(entry["code"]) - if suffix is None or entry["uri"] != source_config["uriPrefix"] + suffix: + code = entry["code"] + if not isinstance(code, str): + raise CatalogError( + f"{source_config['owner']} problem entry {index} has an invalid problem code" + ) + segments = code.split(".") + suffix = "/".join(segments) + if uri_prefix == f"{BASE_URL}/problems/registry-discovery/": + suffix = DISCOVERY_PROBLEM_URI_SUFFIXES.get(code) + if suffix is None or entry["uri"] != uri_prefix + suffix: raise CatalogError( f"{source_config['owner']} problem URI and code disagree: {entry}" ) + if ( + (len(segments) == 1 and uri_prefix != OID4VP_PROBLEM_URI_PREFIX) + or any(PROBLEM_CODE_SEGMENT.fullmatch(segment) is None for segment in segments) + ): + raise CatalogError( + f"{source_config['owner']} problem entry {index} has an invalid problem code {code!r}" + ) entries.append( { "uri": entry["uri"], @@ -462,7 +479,7 @@ def problem_entries( "description": entry["description"], "source": source, "problem": { - "code": entry["code"], + "code": code, "httpStatuses": entry["httpStatuses"], }, } diff --git a/products/identifiers/scripts/test_generate.py b/products/identifiers/scripts/test_generate.py index 08dc08d1b1..26a890cea8 100644 --- a/products/identifiers/scripts/test_generate.py +++ b/products/identifiers/scripts/test_generate.py @@ -312,6 +312,43 @@ def test_problem_code_must_match_its_uri(self) -> None: with self.assertRaisesRegex(generate.CatalogError, "URI and code disagree"): self.build() + def test_problem_code_grammar_even_when_the_uri_matches(self) -> None: + document = json.loads(self.fixture_problem_catalog.read_text()) + for code in ( + "example.bad_spelling", + "Example.failed", + "example..failed", + "example.bad--spelling", + "example.failed-", + "example.bad/spelling", + "invalid-request", + ): + with self.subTest(code=code): + suffix = code.replace(".", "/") + document["entries"][0].update( + uri=f"{generate.BASE_URL}/problems/registry-fixture/{suffix}", + code=code, + ) + self.fixture_problem_catalog.write_text(json.dumps(document)) + with self.assertRaisesRegex(generate.CatalogError, "invalid problem code"): + self.build() + + def test_oid4vp_single_segment_codes_still_require_kebab_case(self) -> None: + prefix = f"{generate.BASE_URL}/problems/registry-evidence-oid4vp/" + config = json.loads(self.config.read_text()) + config["problemSources"][0]["uriPrefix"] = prefix + self.config.write_text(json.dumps(config)) + document = json.loads(self.fixture_problem_catalog.read_text()) + entry = document["entries"][0] + entry.update(uri=prefix + "invalid-request", code="invalid-request") + self.fixture_problem_catalog.write_text(json.dumps(document)) + self.assertIn(entry["uri"], {item["uri"] for item in self.build()["entries"]}) + + entry.update(uri=prefix + "invalid_request", code="invalid_request") + self.fixture_problem_catalog.write_text(json.dumps(document)) + with self.assertRaisesRegex(generate.CatalogError, "invalid problem code"): + self.build() + def test_discovery_qualified_codes_keep_the_published_problem_uris(self) -> None: prefix = f"{generate.BASE_URL}/problems/registry-discovery/" spellings = { diff --git a/products/messaging/generated/registry-messaging.openapi.json b/products/messaging/generated/registry-messaging.openapi.json index ce49ae0bca..559f0cba4e 100644 --- a/products/messaging/generated/registry-messaging.openapi.json +++ b/products/messaging/generated/registry-messaging.openapi.json @@ -270,6 +270,10 @@ "detail": { "type": "string" }, + "failedCheck": { + "description": "The check that refused the request, included only in development.", + "type": "string" + }, "status": { "type": "integer" }, diff --git a/products/render/generated/registry-render.openapi.json b/products/render/generated/registry-render.openapi.json index bf530c94d9..e6e4fa31ba 100644 --- a/products/render/generated/registry-render.openapi.json +++ b/products/render/generated/registry-render.openapi.json @@ -272,6 +272,7 @@ "detail": { "type": "string" }, "code": { "type": "string" }, "traceId": { "type": "string", "pattern": "^[0-9a-f]{32}$" }, + "failedCheck": { "type": "string", "description": "The check that refused the request, included only in development." }, "pointers": { "type": "array", "maxItems": 32, "items": { "type": "string", "maxLength": 256 } } } }, diff --git a/products/scheduling/generated/registry-scheduling.openapi.json b/products/scheduling/generated/registry-scheduling.openapi.json index 308b24b799..95d16e0c18 100644 --- a/products/scheduling/generated/registry-scheduling.openapi.json +++ b/products/scheduling/generated/registry-scheduling.openapi.json @@ -1624,6 +1624,10 @@ "detail": { "type": "string" }, + "failedCheck": { + "description": "The check that refused the request, included only in development.", + "type": "string" + }, "status": { "type": "integer" }, diff --git a/products/scheduling/scripts/generate_openapi.py b/products/scheduling/scripts/generate_openapi.py index e51b4338c7..bd42d24138 100644 --- a/products/scheduling/scripts/generate_openapi.py +++ b/products/scheduling/scripts/generate_openapi.py @@ -950,6 +950,10 @@ def schemas(problem_entries: list[dict]) -> dict: "detail": text, "code": {"type": "string", "enum": [entry["code"] for entry in problem_entries]}, "traceId": text, + "failedCheck": { + "type": "string", + "description": "The check that refused the request, included only in development.", + }, }, ["type", "title", "status", "detail", "code", "traceId"], ), diff --git a/products/scheduling/scripts/test_generate_openapi.py b/products/scheduling/scripts/test_generate_openapi.py index f47b9e0882..bf17d97527 100644 --- a/products/scheduling/scripts/test_generate_openapi.py +++ b/products/scheduling/scripts/test_generate_openapi.py @@ -1012,8 +1012,11 @@ def test_the_request_edge_rejection_map_is_the_rust_one(self) -> None: def test_the_problem_envelope_is_the_platform_one(self) -> None: problem = self.openapi["components"]["schemas"]["Problem"] - self.assertEqual({"type", "title", "status", "detail", "code", "traceId"}, + self.assertEqual({"type", "title", "status", "detail", "code", "traceId", "failedCheck"}, set(problem["properties"])) + self.assertEqual("string", problem["properties"]["failedCheck"]["type"]) + ambiguous = self.openapi["components"]["schemas"]["ProblemAccessProfileAmbiguous"] + self.assertNotIn("failedCheck", ambiguous["properties"]) self.assertEqual(["code", "detail", "status", "title", "traceId", "type"], sorted(problem["required"])) self.assertEqual(36, len(problem["properties"]["code"]["enum"])) From 8656242e984a38606947c70d72ce70889a0954d8 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 36/55] test(ci): check the Rust gate inventory structurally and schedule live TypeScript verification Folds these reviewed commits: - test(typescript): require Deno for full live verification - test(ci): check Rust gate inventory structurally - test(ci): retain the Manifest selector regression - test(ci): retire the duplicate Manifest profile assertion - test(ci): rely on structural checks for ordinary Rust gates - ci: schedule live TypeScript and opt-in authoring verification Signed-off-by: Jeremi Joslin --- .github/scripts/test_ci_changes.py | 356 +++++++++++++++--- .github/workflows/ci.yml | 90 +++++ .../typescript/tests/live-teardown.test.ts | 46 +++ clients/typescript/tests/live/run.ts | 12 +- .../docs/reference/typescript-clients.mdx | 12 + release/scripts/check-gates-inventory.py | 65 +--- release/scripts/test_check_gates_inventory.py | 69 +--- 7 files changed, 490 insertions(+), 160 deletions(-) diff --git a/.github/scripts/test_ci_changes.py b/.github/scripts/test_ci_changes.py index 2a3f632bf8..04be58922c 100644 --- a/.github/scripts/test_ci_changes.py +++ b/.github/scripts/test_ci_changes.py @@ -7,13 +7,16 @@ import json import os import re +import runpy import shlex import subprocess import sys import tempfile import tomllib import unittest -from pathlib import Path +from collections.abc import Callable +from copy import deepcopy +from pathlib import Path, PurePosixPath from typing import Any import yaml @@ -397,6 +400,233 @@ def test_orphan_platform_crates_and_oid4vci_fuzz_surface_are_absent(self) -> Non ) +class RustGateInventoryTest(unittest.TestCase): + PACKAGE_RUNNER = ["python3", ".github/scripts/run_cargo_packages.py"] + + @classmethod + def setUpClass(cls) -> None: + root = Path(__file__).resolve().parents[2] + cls.live_workflow = yaml.safe_load( + (root / ".github/workflows/ci.yml").read_text(encoding="utf-8") + ) + reach_gate = runpy.run_path( + str(root / "products/platform/scripts/check_dev_runner_reach.py") + ) + # The tests also start the Evidence runtime alongside its development host. + cls.dev_host_packages = reach_gate["DEV_RUNNER_HOSTS"] | {"registry-evidence"} + + def setUp(self) -> None: + self.workflow = deepcopy(self.live_workflow) + self.gates = self.assert_inventory(self.workflow) + + def assert_inventory( + self, workflow: dict[str, Any] + ) -> dict[str, tuple[list[dict[str, Any]], int]]: + formatting = self.require_step( + workflow, "rust-quality", "Format", ["cargo", "fmt", "--check"] + ) + clippy = self.require_step( + workflow, + "rust-quality", + "Affected package clippy", + [*self.PACKAGE_RUNNER, "clippy"], + env={"CI_RUST_PACKAGES": "${{ needs.changes.outputs.rust_packages }}"}, + ) + package_tests = self.require_step( + workflow, + "rust-tests", + "Affected package tests", + [*self.PACKAGE_RUNNER, "test"], + env={ + "CI_RUST_PACKAGES": "${{ toJSON(matrix.packages) }}", + "CI_RUST_ALL_FEATURES": "${{ matrix.all_features }}", + }, + ) + build = self.require_step( + workflow, + "rust-tests", + "Build the rstack dev hosts", + self.builds_dev_hosts, + condition=( + "matrix.name == 'developer-tools' " + "&& contains(matrix.packages, 'registry-rstack')" + ), + ) + self.assertLess( + build[1], + package_tests[1], + "Build the rstack dev hosts before affected package tests", + ) + manifest = self.require_step( + workflow, + "rust-tests", + "Manifest profile validation", + [ + "cargo", "run", "--locked", "-p", "registry-manifest-cli", + "--", "validate-profiles", "profiles", + ], + condition="matrix.name == 'manifest'", + working_directory="products/manifest", + ) + return { + "format": formatting, + "clippy": clippy, + "test": package_tests, + "build": build, + "manifest": manifest, + } + + def builds_dev_hosts(self, arguments: list[str]) -> bool: + options, packages = arguments[4::2], arguments[5::2] + return ( + arguments[:4] == ["cargo", "build", "--locked", "--bins"] + and options == ["-p"] * len(self.dev_host_packages) + and len(packages) == len(self.dev_host_packages) + and set(packages) == self.dev_host_packages + ) + + def require_step( + self, + workflow: dict[str, Any], + job_id: str, + description: str, + command: list[str] | Callable[[list[str]], bool], + *, + condition: str = "success()", + working_directory: str = ".", + env: dict[str, str] | None = None, + ) -> tuple[list[dict[str, Any]], int]: + job = workflow["jobs"].get(job_id, {}) + self.assertIs( + job.get("continue-on-error", False), + False, + f"{job_id}: {description} must propagate failure", + ) + defaults = ( + workflow.get("defaults", {}).get("run", {}) + | job.get("defaults", {}).get("run", {}) + ) + job_env = workflow.get("env", {}) | job.get("env", {}) + steps = job.get("steps", []) + for index, step in enumerate(steps): + step_condition = step.get("if", "success()") + if ( + isinstance(step_condition, str) + and step_condition.startswith("${{") + and step_condition.endswith("}}") + ): + step_condition = step_condition[3:-2].strip() + if step_condition != condition or step.get("continue-on-error", False) is not False: + continue + directory = step.get("working-directory", defaults.get("working-directory", ".")) + if PurePosixPath(directory) != PurePosixPath(working_directory): + continue + if step.get("shell", defaults.get("shell", "bash")) not in {"bash", "sh"}: + continue + effective_env = job_env | step.get("env", {}) + if env is not None and any( + effective_env.get(key) != value for key, value in env.items() + ): + continue + + # A folded YAML scalar is already one shell line here. Join + # shell continuations between words, leaving other line breaks intact. + run = re.sub(r"(?<=[ \t])\\\n", "", step.get("run", "")).strip() + if not run or "\n" in run: + continue + try: + arguments = shlex.split(run) + except ValueError: + continue + matches = command(arguments) if callable(command) else arguments == command + if matches: + return steps, index + self.fail(f"{job_id}: missing {description} with its required inputs") + + def step(self, gate: str) -> dict[str, Any]: + steps, index = self.gates[gate] + return steps[index] + + def test_real_workflow_has_the_rust_gates(self) -> None: + self.assert_inventory(self.live_workflow) + + def test_equivalent_step_labels_and_command_formatting_pass(self) -> None: + runner = " ".join(self.PACKAGE_RUNNER) + for gate, folded in ( + ("format", "cargo fmt\n '--check'"), + ("clippy", f"{runner}\n 'clippy'"), + ("test", f"{runner}\n 'test'"), + ( + "manifest", + "cargo run --locked -p registry-manifest-cli\n -- validate-profiles 'profiles'", + ), + ): + step = self.step(gate) + step.update(yaml.safe_load(f"run: >-\n {folded}\nname: Renamed {gate}")) + self.step("build").pop("name", None) + self.assert_inventory(self.workflow) + + def test_literals_in_another_job_do_not_supply_the_step(self) -> None: + steps, index = self.gates["format"] + self.workflow["jobs"]["unrelated-job"] = {"steps": [steps.pop(index)]} + with self.assertRaisesRegex(AssertionError, "Format"): + self.assert_inventory(self.workflow) + + def test_rstack_host_build_is_required_and_ordered(self) -> None: + steps, index = self.gates["build"] + build = steps.pop(index) + with self.assertRaisesRegex(AssertionError, "missing Build the rstack dev hosts"): + self.assert_inventory(self.workflow) + steps.insert(self.gates["test"][1], build) + with self.assertRaisesRegex(AssertionError, "rstack dev hosts before"): + self.assert_inventory(self.workflow) + + def test_nonblocking_rstack_host_build_cannot_supply_the_prerequisite(self) -> None: + self.step("build")["continue-on-error"] = True + with self.assertRaisesRegex(AssertionError, "rstack dev hosts"): + self.assert_inventory(self.workflow) + + def test_rstack_host_build_requires_every_host(self) -> None: + packages = self.dev_host_packages - {"registry-render"} + self.step("build")["run"] = "cargo build --locked --bins " + " ".join( + f"-p {package}" for package in sorted(packages) + ) + with self.assertRaisesRegex(AssertionError, "rstack dev hosts"): + self.assert_inventory(self.workflow) + + def test_affected_tests_require_the_runner_and_matrix_features(self) -> None: + step = self.step("test") + original_command = step["run"] + step["run"] = " ".join([*self.PACKAGE_RUNNER, "skip-tests"]) + with self.assertRaisesRegex(AssertionError, "Affected package tests"): + self.assert_inventory(self.workflow) + step["run"] = original_command + step.setdefault("env", {})["CI_RUST_ALL_FEATURES"] = "false" + with self.assertRaisesRegex(AssertionError, "Affected package tests"): + self.assert_inventory(self.workflow) + + def test_clippy_cannot_replace_the_selected_package_list(self) -> None: + self.step("clippy").setdefault("env", {})["CI_RUST_PACKAGES"] = "[]" + with self.assertRaisesRegex(AssertionError, "Affected package clippy"): + self.assert_inventory(self.workflow) + + def test_manifest_validation_requires_the_profile_command_and_directory(self) -> None: + step = self.step("manifest") + original_command = step["run"] + step["run"] = "cargo run --locked -p registry-manifest-cli -- skip-profile-validation" + with self.assertRaisesRegex(AssertionError, "Manifest profile validation"): + self.assert_inventory(self.workflow) + step["run"] = original_command + step["working-directory"] = "." + with self.assertRaisesRegex(AssertionError, "Manifest profile validation"): + self.assert_inventory(self.workflow) + + def test_two_shell_commands_do_not_count_as_one(self) -> None: + self.step("format")["run"] = "cargo fmt\n--check\n" + with self.assertRaisesRegex(AssertionError, "Format"): + self.assert_inventory(self.workflow) + + class CiChangesTest(unittest.TestCase): @classmethod def setUpClass(cls) -> None: @@ -573,7 +803,9 @@ def test_deferred_ci_work_keeps_its_selector_and_explicit_status_guard( for name, job in self.workflow_jobs.items() if self.normalized_needs(job) == ("changes", "rust-policy") } - self.assertEqual(set(selectors), deferred) + # The scheduled client job has an event selector and requires a + # successful Rust policy job. ScheduledVerificationTest checks it. + self.assertEqual(set(selectors) | {"typescript-live"}, deferred) # An explicit status-check function bypasses GitHub's implicit # success() dependency guard. Requiring a successful classifier keeps @@ -694,6 +926,7 @@ def test_ci_scheduling_graph_retains_every_job_and_aggregate_dependency( "docs-archives", "client-bindings", "typescript-clients", + "typescript-live", "release-linux-node-clients", "deployment", "ci-result", @@ -780,6 +1013,7 @@ def test_ci_scheduling_graph_retains_every_job_and_aggregate_dependency( "docs", "client-bindings", "typescript-clients", + "typescript-live", "release-linux-node-clients", "deployment", ), @@ -830,9 +1064,9 @@ def test_final_aggregate_flattens_rust_results_with_equivalent_outcomes( } self.assertEqual( final_needs, - previous_final_needs.difference({"rust-result"}).union(rust_needs), + previous_final_needs.difference({"rust-result"}).union(rust_needs, {"typescript-live"}), ) - self.assertEqual(49, len(final_needs)) + self.assertEqual(50, len(final_needs)) # Platform line coverage publishes from main and the nightly sweep; # it does not hold the merge queue. self.assertNotIn("platform-coverage", final_needs) @@ -3870,13 +4104,8 @@ def test_rstack_dev_changes_run_the_harnesses_that_drive_it(self) -> None: with self.subTest(path=path, output=output): self.assertTrue(outputs[output]) - def test_development_host_changes_run_the_rstack_dev_tests_with_built_hosts( - self, - ) -> None: - """The registry-rstack dev_run tests drive the bregctl and caseworkctl - built beside rstack, which link registry-rstack-dev and host - `rstack dev`. A change to the library or to any host runs them, and - the shard builds both hosts before it tests.""" + def test_development_host_changes_select_the_rstack_shard(self) -> None: + """Changes to the development runner or its hosts select rstack.""" for path, packages in ( ( "crates/registry-rstack-dev/src/lib.rs", @@ -3904,37 +4133,6 @@ def test_development_host_changes_run_the_rstack_dev_tests_with_built_hosts( [], ) self.assertLessEqual(packages, set(selected)) - steps = self.workflow_jobs["rust-tests"]["steps"] - names = [step.get("name") for step in steps] - build = next( - step - for step in steps - if step.get("name") == "Build the rstack dev hosts" - ) - self.assertEqual( - build.get("if"), - "matrix.name == 'developer-tools' && contains(matrix.packages, 'registry-rstack')", - ) - arguments = shlex.split(folded_command(build)) - self.assertEqual(["cargo", "build", "--locked", "--bins"], arguments[:4]) - self.assertEqual( - { - "registry-adapterctl", - "registry-bregctl", - "registry-caseworkctl", - "registry-coordinator", - "registry-discoveryctl", - "registry-documentsctl", - "registry-evidence", - "registry-evidencectl", - "registry-messagingctl", - "registry-render", - "registry-schedulingctl", - }, - set(arguments[5::2]), - ) - self.assertTrue(all(option == "-p" for option in arguments[4::2])) - self.assertLess(steps.index(build), names.index("Test affected packages")) def test_service_preview_inputs_select_installed_browser_proof(self) -> None: for path in ( @@ -5254,6 +5452,80 @@ def test_unchanged_lock_text_forces_full(self) -> None: def test_lock_without_an_analysis_stays_full(self) -> None: self.assert_full(classify(self.workspace, ("Cargo.lock",))) +class ScheduledVerificationTest(unittest.TestCase): + @classmethod + def setUpClass(cls) -> None: + cls.root = Path(__file__).resolve().parents[2] + workflow = yaml.safe_load( + (cls.root / ".github/workflows/ci.yml").read_text(encoding="utf-8") + ) + cls.jobs = workflow["jobs"] + cls.routing_flags = workflow["env"]["CI_ROUTING_FLAGS"] + + def test_typescript_live_requires_a_scheduled_or_explicit_full_run(self) -> None: + selection = ( + "github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' " + "&& needs.changes.outputs.full_sweep == 'true')" + ) + live = self.jobs["typescript-live"] + result = self.jobs["ci-result"] + self.assertEqual( + "${{ !cancelled() && needs.changes.result == 'success' " + "&& needs.rust-policy.result == 'success' && (" + selection + ") }}", + live["if"], + ) + self.assertIn("typescript-live", result["needs"]) + self.assertEqual(result["env"]["TYPESCRIPT_LIVE_REQUIRED"], "${{ " + selection + " }}") + self.assertTrue(any("run test:live -- --require-deno" in step.get("run", "") + for step in live["steps"])) + + # A selected job must pass. An ordinary PR or push can skip the job. + script = result["steps"][0]["run"] + outputs = {name: "false" for name in self.routing_flags.split()} + outputs.update(rust_matrix='{"include":[]}', rust_packages="[]", breg_contracts_lanes="[]") + for required, expected_status in (("true", 1), ("false", 0)): + with self.subTest(required=required): + environment = { + "CI_JOB_RESULTS": json.dumps({"changes": {"result": "success", "outputs": outputs}, + "repository-checks": {"result": "success"}, + "typescript-live": {"result": "skipped"}}), + "CI_ROUTING_FLAGS": self.routing_flags, + "TYPESCRIPT_LIVE_REQUIRED": required, + } + completed = subprocess.run( + ("bash", "-c", script), env=environment, capture_output=True, text=True, + ) + self.assertEqual(completed.returncode, expected_status, completed.stderr) + + def test_opt_in_evidence_and_journey_verification_are_wired(self) -> None: + self.assertTrue(any( + step.get("run") == "bash products/platform/journeys/test_lib.sh" + for step in self.jobs["repository-checks"]["steps"] + )) + steps = self.jobs["evidence-tutorials"]["steps"] + index = next(i for i, step in enumerate(steps) + if step.get("name") == "Test opt-in Evidence authoring cases") + step = steps[index] + self.assertEqual(step["env"]["EVIDENCE_BIN"], "${{ github.workspace }}/target/debug/evidence") + self.assertTrue(any("cargo build --locked" in earlier.get("run", "") + and "-p registry-evidence " in earlier["run"] for earlier in steps[:index])) + for suite, case in ( + ("scaffold", "the_generated_openapi_starter_passes_check_and_test"), + ("source_recipes", "source_review_commands_accept_a_local_target_only_under_development"), + ("production_handoff", "production_package_accepts_the_real_package_check_digest"), + ("production_handoff", "offline_production_check_closes_without_target_host_mounts"), + ("production_handoff", "explain_refuses_unknown_source_members_without_disclosing_values"), + ("production_handoff", "offline_check_makes_private_staging_under_umask_022"), + ("production_handoff", "explicit_evidence_grade_target_applies_its_own_strict_source_rules"), + ): + with self.subTest(suite=suite, case=case): + self.assertIn(f"{suite} {case}", step["run"]) + source = (self.root / f"crates/registry-evidencectl/tests/{suite}.rs").read_text() + self.assertRegex(source, rf"#\[ignore[^\n]*\]\nfn {case}\(") + self.assertIn("-- --ignored --exact", step["run"]) + self.assertIn("1 passed; 0 failed", step["run"]) + + class EventScopedSelectionTest(unittest.TestCase): """Broad assurance and heavy integration wait for the merge queue.""" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 984a32f3c9..014fcf35fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -270,6 +270,9 @@ jobs: - name: Test the acceptance journey tables run: uv run --no-project --with PyYAML==6.0.2 python -m unittest products/platform/journeys/test_journey_tables.py + - name: Test the acceptance journey harness + run: bash products/platform/journeys/test_lib.sh + - name: Install pinned actionlint shell: bash run: | @@ -3119,6 +3122,31 @@ jobs: | tee "${RUNNER_TEMP}/evidence-source-recipes.log" grep -q 'test result: ok\. 1 passed' "${RUNNER_TEMP}/evidence-source-recipes.log" || { echo "::error::expected exactly one passing test for curated_source_recipes_import_check_and_run_the_existing_evaluator"; exit 1; } + - name: Test opt-in Evidence authoring cases + shell: bash + env: + EVIDENCE_BIN: ${{ github.workspace }}/target/debug/evidence + run: | + set -euo pipefail + while read -r suite case_name; do + printf 'Running %s::%s\n' "${suite}" "${case_name}" + log="${RUNNER_TEMP}/evidence-${case_name}.log" + CARGO_TERM_COLOR=never cargo test --locked -p registry-evidencectl \ + --test "${suite}" "${case_name}" -- --ignored --exact | tee "${log}" + if ! grep -qx 'test result: ok\. 1 passed; 0 failed;.*' "${log}"; then + printf '::error::expected exactly one passing test for %s::%s\n' "${suite}" "${case_name}" + exit 1 + fi + done <<'CASES' + scaffold the_generated_openapi_starter_passes_check_and_test + source_recipes source_review_commands_accept_a_local_target_only_under_development + production_handoff production_package_accepts_the_real_package_check_digest + production_handoff offline_production_check_closes_without_target_host_mounts + production_handoff explain_refuses_unknown_source_members_without_disclosing_values + production_handoff offline_check_makes_private_staging_under_umask_022 + production_handoff explicit_evidence_grade_target_applies_its_own_strict_source_rules + CASES + - name: Test the public certificate check example shell: bash env: @@ -4347,6 +4375,64 @@ jobs: "${client_dir}/node_modules/playwright-core/index.mjs" \ "${RUNNER_TEMP}/${name}" + typescript-live: + name: TypeScript live against running products + needs: [changes, rust-policy] + if: >- + ${{ !cancelled() && needs.changes.result == 'success' && needs.rust-policy.result == 'success' + && (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && needs.changes.outputs.full_sweep == 'true')) }} + runs-on: ubuntu-24.04 + timeout-minutes: 60 + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + persist-credentials: false + submodules: false + + - name: Setup Node + uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 + with: + node-version: 24.11.0 + cache: npm + cache-dependency-path: clients/typescript/package-lock.json + + - name: Setup Deno + uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2.0.5 + with: + deno-version: 2.9.7 + + - name: Cache Cargo registry + uses: Swatinem/rust-cache@eedcf2fb1c22f010a0eb66b92f378c110977f266 # v2 + with: + shared-key: workspace-registry + cache-targets: false + save-if: ${{ github.ref == 'refs/heads/main' }} + + - name: Build the product binaries from source + run: >- + cargo build --locked --bins --features registry-breg/runtime + -p registry-adapter -p registry-adapterctl -p registry-breg -p registry-bregctl + -p registry-casework -p registry-caseworkctl -p registry-coordinator + -p registry-discovery -p registry-discoveryctl -p registry-documents + -p registry-documentsctl -p registry-evidence -p registry-evidence-oid4vci + -p registry-evidence-oid4vp -p registry-evidencectl -p registry-mcp + -p registry-messaging -p registry-messagingctl -p registry-render + -p registry-rstack -p registry-scheduling -p registry-schedulingctl -p registry-session + + - name: Build the TypeScript package and install Chromium + working-directory: clients/typescript + shell: bash + run: | + set -euo pipefail + npm ci + npm run build + node node_modules/playwright-core/cli.js install --with-deps chromium + + - name: Run live Node, Deno and Chromium tests + working-directory: clients/typescript + run: npm run test:live -- --require-deno + ci-result: name: CI result if: always() @@ -4398,12 +4484,14 @@ jobs: - docs - client-bindings - typescript-clients + - typescript-live - release-linux-node-clients - deployment runs-on: ubuntu-slim timeout-minutes: 5 env: CI_JOB_RESULTS: ${{ toJSON(needs) }} + TYPESCRIPT_LIVE_REQUIRED: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && needs.changes.outputs.full_sweep == 'true') }} steps: - name: Require every selected CI job run: | @@ -4458,6 +4546,8 @@ jobs: # The repository's own tooling tests always run, so a skip fails. if jobs["repository-checks"]["result"] != "success": failed["repository-checks"] = jobs["repository-checks"]["result"] + if os.environ.get("TYPESCRIPT_LIVE_REQUIRED") == "true" and jobs["typescript-live"]["result"] != "success": + failed["typescript-live"] = jobs["typescript-live"]["result"] if failed: print(f"CI jobs did not pass: {failed}", file=sys.stderr) raise SystemExit(1) diff --git a/clients/typescript/tests/live-teardown.test.ts b/clients/typescript/tests/live-teardown.test.ts index 14cf30c97a..dba103003e 100644 --- a/clients/typescript/tests/live-teardown.test.ts +++ b/clients/typescript/tests/live-teardown.test.ts @@ -301,6 +301,52 @@ test('stopChildProcess escalates to SIGKILL when a child ignores SIGTERM and han } }) +test('runLiveSuite requires Deno when requested while preserving the optional local run', async () => { + const { root, stateDir } = makeScratch() + try { + for (const [requireDeno, deno, expectedExit] of [ + [false, undefined, 0], + [true, undefined, 1], + [true, 'deno', 0], + ] as const) { + const testFiles: string[] = [] + const errors: string[] = [] + const logs: string[] = [] + let stops = 0 + const exitCode = await runLiveSuite({ + checkBundle: false, + requireDeno, + signalTarget: new EventEmitter(), + log: message => logs.push(message), + errorLog: message => errors.push(message), + resolveDeno: async () => deno, + runCommand: async (_label, _command, args) => { + testFiles.push(args.at(-1)!) + return true + }, + startEnvironment: async () => ({ + manifest: {} as LiveManifest, + manifestPath: join(root, 'live-manifest.json'), + root, + stateDir, + stop: async () => { stops += 1 }, + }), + }) + + assert.equal(exitCode, expectedExit) + const expectedFiles = ['tests/live/products.live.test.ts'] + if (deno) expectedFiles.push('tests/live/deno/products.live.deno.test.ts') + expectedFiles.push('tests/live/browser.live.test.ts') + assert.deepEqual(testFiles, expectedFiles) + assert.equal(stops, 1) + assert.equal(errors.some(message => message.includes('Deno is required')), expectedExit === 1) + assert.equal(logs.some(message => message.includes('Skipped: deno')), !deno && !requireDeno) + } + } finally { + rmSync(root, { recursive: true, force: true }) + } +}) + test('runLiveSuite reports teardown failure visibly and exits non-zero even when all test matrices pass', async () => { const { root, stateDir } = makeScratch() const errors: string[] = [] diff --git a/clients/typescript/tests/live/run.ts b/clients/typescript/tests/live/run.ts index a9b7f716b8..1cb80be518 100644 --- a/clients/typescript/tests/live/run.ts +++ b/clients/typescript/tests/live/run.ts @@ -2,6 +2,7 @@ import { spawn, type ChildProcess } from 'node:child_process' import { existsSync, realpathSync } from 'node:fs' import { resolve } from 'node:path' import { fileURLToPath } from 'node:url' +import { parseArgs } from 'node:util' import { ChildStopError, LiveTeardownError, @@ -31,6 +32,7 @@ export type RunCommandFn = ( export interface RunLiveSuiteOptions { readonly checkBundle?: boolean + readonly requireDeno?: boolean readonly startEnvironment?: (options?: StartLiveEnvironmentOptions) => Promise readonly runCommand?: RunCommandFn readonly resolveDeno?: (signal: AbortSignal) => Promise @@ -328,7 +330,12 @@ export async function runLiveSuite(options: RunLiveSuiteOptions = {}): Promise list[str]: return blocks -def rstack_dev_hosts_precede_tests(workflow: str) -> bool: - rust_tests = yaml_job_block(workflow, "rust-tests") - if rust_tests is None: - return False - - build_condition = ( - " if: matrix.name == 'developer-tools' " - "&& contains(matrix.packages, 'registry-rstack')" - ) - test_command = " run: python3 .github/scripts/run_cargo_packages.py test" - hosts_built = False - for step in yaml_step_blocks(rust_tests): - lines = step.splitlines() - if test_command in lines: - return hosts_built - if build_condition not in lines: - continue - run = step.partition("\n run: ")[2] - if not run: - continue - command, *body = run.splitlines() - if command in {"|", "|-", "|+"}: - command = "\n".join( - takewhile(lambda line: line.startswith(" "), body) - ).replace("\\\n", "") - arguments = command.split() - options, packages = arguments[4::2], arguments[5::2] - if ( - "\n" not in command - and arguments[:4] == ["cargo", "build", "--locked", "--bins"] - and len(options) == len(packages) - and all(option == "-p" for option in options) - and set(packages) == RSTACK_DEV_BUILD_PACKAGES - ): - hosts_built = True - return False - - def shell_loop_targets(job: str) -> tuple[str, ...]: """Return the ordered target names from the nightly fuzz shell loop.""" @@ -2278,7 +2220,6 @@ def main() -> int: + len(ORDERED_RELEASE_SECURITY_GATES) + len(FORBIDDEN_RELEASE_SECURITY_GATES) + len(REQUIRED_SECURITY_WORKFLOW_SELECTIONS) - + 1 # Development hosts are checked in job order. + 8 # Structural permission, sweep, CodeQL config, isolation, retention, rebuild, and destination gates. ) print( diff --git a/release/scripts/test_check_gates_inventory.py b/release/scripts/test_check_gates_inventory.py index 348f709e66..d2ab1f365c 100644 --- a/release/scripts/test_check_gates_inventory.py +++ b/release/scripts/test_check_gates_inventory.py @@ -1662,54 +1662,22 @@ def test_missing_actionlint_pin_or_checksum_is_reported(self) -> None: text = self.workflow.replace(snippet, replacement) self.assertIn(gate, self.module.missing_gates(text)) - def test_missing_affected_package_test_is_reported(self) -> None: - text = self.workflow.replace( - "run: python3 .github/scripts/run_cargo_packages.py test", - "run: python3 .github/scripts/run_cargo_packages.py skip-tests", - ) - self.assertIn("Affected package tests", self.module.missing_gates(text)) - - def test_missing_rstack_dev_host_is_reported(self) -> None: - job = self.module.yaml_job_block(self.workflow, "rust-tests") - self.assertIsNotNone(job) - assert job is not None - build = next( - step - for step in self.module.yaml_step_blocks(job) - if "- name: Build the rstack dev hosts" in step - ) - without_render = build.replace( - "registry-render", - "registry-render-removed", - 1, - ) - self.assertNotEqual(build, without_render) - workflow = self.workflow.replace(build, without_render, 1) - - self.assertIn( - "rstack dev hosts built before the rstack tests", - self.module.missing_gates(workflow), - ) - - def test_rstack_dev_hosts_built_after_the_rstack_tests_are_reported(self) -> None: - job = self.module.yaml_job_block(self.workflow, "rust-tests") - self.assertIsNotNone(job) - assert job is not None - steps = self.module.yaml_step_blocks(job) - build = next( - step for step in steps if "- name: Build the rstack dev hosts" in step - ) - tests = next( - step for step in steps if "- name: Test affected packages" in step - ) - without_build = self.workflow.replace(build, "", 1) - workflow = without_build.replace(tests, f"{tests}\n{build}", 1) - self.assertNotEqual(self.workflow, workflow) - - self.assertIn( - "rstack dev hosts built before the rstack tests", - self.module.missing_gates(workflow), + def test_structural_rust_gates_allow_equivalent_workflow_edits(self) -> None: + workflow = self.workflow + for original, equivalent in ( + ("cargo fmt --check", "cargo fmt\n '--check'"), + ("python3 .github/scripts/run_cargo_packages.py clippy", + "python3 .github/scripts/run_cargo_packages.py\n 'clippy'"), + ("python3 .github/scripts/run_cargo_packages.py test", + "python3 .github/scripts/run_cargo_packages.py\n 'test'"), + ): + step = f" run: {original}" + self.assertIn(step, workflow) + workflow = workflow.replace(step, f" run: >-\n {equivalent}", 1) + workflow = workflow.replace( + "- name: Build the rstack dev hosts\n", "- name: Build development hosts\n", 1, ) + self.assertEqual(self.module.missing_gates(workflow), []) def test_missing_platform_coverage_threshold_is_reported(self) -> None: text = self.workflow.replace("--fail-under-lines 80", "--summary-only") @@ -1868,13 +1836,6 @@ def test_missing_production_shaped_docs_build_check_is_reported(self) -> None: self.module.missing_gates(text), ) - def test_missing_manifest_profile_validation_is_reported(self) -> None: - text = self.workflow.replace( - "cargo run --locked -p registry-manifest-cli -- validate-profiles profiles", - "cargo run --locked -p registry-manifest-cli -- skip-profile-validation", - ) - self.assertIn("Manifest profile validation", self.module.missing_gates(text)) - def test_missing_breg_tutorial_gates_are_reported(self) -> None: for snippet, replacement, gate in ( ( From 0efbd94dffe282a8c0fefd18c709ded3585a04bd Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 37/55] fix(config): enforce shared Registry Record ID spellings and pin BReg controls Folds these reviewed commits: - fix(config): enforce shared Registry Record ID spellings - test(client): match task fixtures to served proposal operations - feat(client): honor BReg list pagination names declared by OpenAPI - fix(breg): name the replacement for retired import record keys - test(config): pin BReg warning and duplicate-key controls - test(ci): require the blocking structural inventory step - fix(typescript): honor served Proposal rebase recovery - test(ci): require runnable live and authoring verification - test(config): verify synthetic canaries and exact positions Signed-off-by: Jeremi Joslin --- .github/scripts/test_ci_changes.py | 258 +++++++++++++++--- clients/typescript/core.ts | 5 +- clients/typescript/generate.ts | 11 +- clients/typescript/tasks/proposals.ts | 9 +- .../tasks/proposal-application-refused.json | 11 +- .../fixtures/tasks/proposal-applied.json | 17 ++ .../fixtures/tasks/proposal-approved.json | 15 +- .../tasks/proposal-draft-attached.json | 2 +- .../tasks/proposal-draft-revised.json | 126 +++++++++ .../tests/fixtures/tasks/proposal-draft.json | 4 +- .../fixtures/tasks/proposal-list-last.json | 87 +++--- .../tests/fixtures/tasks/proposal-list.json | 29 +- .../tasks/proposal-package-changed.json | 11 +- .../fixtures/tasks/proposal-rejected.json | 5 + .../fixtures/tasks/proposal-sent-back.json | 7 +- .../tasks/proposal-submitted-stale.json | 17 +- .../fixtures/tasks/proposal-submitted.json | 7 +- clients/typescript/tests/list.test.ts | 38 ++- .../typescript/tests/tasks-proposals.test.ts | 108 ++++++-- .../tests/tasks-response-contracts.test.ts | 75 ++++- .../typescript/tests/tasks-screens.test.ts | 12 +- crates/registry-breg/src/data.rs | 5 + crates/registry-breg/tests/data_operations.rs | 17 +- crates/registry-bregctl/src/lib.rs | 24 ++ products/platform/CONFIG-CONVENTIONS.md | 2 + .../scripts/run-config-conformance.py | 116 +++++++- .../scripts/test_check_config_conventions.py | 27 ++ .../scripts/test_run_config_conformance.py | 65 +++++ release/scripts/check-gates-inventory.py | 4 - release/scripts/test_check_gates_inventory.py | 86 ++++-- 30 files changed, 1031 insertions(+), 169 deletions(-) create mode 100644 clients/typescript/tests/fixtures/tasks/proposal-draft-revised.json diff --git a/.github/scripts/test_ci_changes.py b/.github/scripts/test_ci_changes.py index 04be58922c..12a3e5f072 100644 --- a/.github/scripts/test_ci_changes.py +++ b/.github/scripts/test_ci_changes.py @@ -516,7 +516,11 @@ def require_step( and step_condition.endswith("}}") ): step_condition = step_condition[3:-2].strip() - if step_condition != condition or step.get("continue-on-error", False) is not False: + if ( + not isinstance(step_condition, str) + or self.condition_tokens(step_condition) != self.condition_tokens(condition) + or step.get("continue-on-error", False) is not False + ): continue directory = step.get("working-directory", defaults.get("working-directory", ".")) if PurePosixPath(directory) != PurePosixPath(working_directory): @@ -543,6 +547,11 @@ def require_step( return steps, index self.fail(f"{job_id}: missing {description} with its required inputs") + @staticmethod + def condition_tokens(condition: str) -> list[str]: + # Preserve whitespace inside GitHub's single-quoted string literals. + return re.findall(r"'(?:''|[^'])*'|[\w.-]+|==|!=|&&|\|\||\S", condition) + def step(self, gate: str) -> dict[str, Any]: steps, index = self.gates[gate] return steps[index] @@ -563,9 +572,25 @@ def test_equivalent_step_labels_and_command_formatting_pass(self) -> None: ): step = self.step(gate) step.update(yaml.safe_load(f"run: >-\n {folded}\nname: Renamed {gate}")) + self.step("manifest")["if"] = "${{ matrix.name == 'manifest' }}" + self.step("build")["if"] = ( + "${{ matrix.name=='developer-tools' && contains( matrix.packages , 'registry-rstack' ) }}" + ) self.step("build").pop("name", None) self.assert_inventory(self.workflow) + def test_spacing_inside_a_shard_literal_or_a_different_host_changes_the_guard(self) -> None: + for gate, predicate in ( + ("manifest", "matrix.name == 'mani fest'"), + ("build", "matrix.name == 'developer-tools' && contains(matrix.packages, 'registry-evidence')"), + ): + with self.subTest(gate=gate): + workflow = deepcopy(self.live_workflow) + step, index = self.assert_inventory(workflow)[gate] + step[index]["if"] = predicate + with self.assertRaisesRegex(AssertionError, "missing "): + self.assert_inventory(workflow) + def test_literals_in_another_job_do_not_supply_the_step(self) -> None: steps, index = self.gates["format"] self.workflow["jobs"]["unrelated-job"] = {"steps": [steps.pop(index)]} @@ -3629,6 +3654,19 @@ def test_typescript_clients_ignore_unrelated_changes(self) -> None: classify(self.workspace, ("docs/site/README.md",))["typescript_clients"] ) + def test_typescript_task_fixture_contracts_select_the_client_gate(self) -> None: + test = Path("clients/typescript/tests/tasks-response-contracts.test.ts").read_text( + encoding="utf-8" + ) + inputs = set(re.findall(r"readJson\('\.\./\.\./\.\./(products/[^']+)\b'\)", test)) + self.assertEqual(inputs, { + "products/breg/generated/facility/generated/openapi.json", + "products/documents/generated/registry-documents.openapi.json", + }) + for path in sorted(inputs): + with self.subTest(path=path): + self.assertTrue(classify(self.workspace, (path,))["typescript_clients"]) + def test_typescript_clients_run_in_every_complete_sweep(self) -> None: self.assertTrue(classify(self.workspace, (), run_all=True)["typescript_clients"]) self.assertTrue( @@ -5453,77 +5491,219 @@ def test_lock_without_an_analysis_stays_full(self) -> None: self.assert_full(classify(self.workspace, ("Cargo.lock",))) class ScheduledVerificationTest(unittest.TestCase): + evidence_cases = ( + ("scaffold", "the_generated_openapi_starter_passes_check_and_test"), + ("source_recipes", "source_review_commands_accept_a_local_target_only_under_development"), + ("production_handoff", "production_package_accepts_the_real_package_check_digest"), + ("production_handoff", "offline_production_check_closes_without_target_host_mounts"), + ("production_handoff", "explain_refuses_unknown_source_members_without_disclosing_values"), + ("production_handoff", "offline_check_makes_private_staging_under_umask_022"), + ("production_handoff", "explicit_evidence_grade_target_applies_its_own_strict_source_rules"), + ) + @classmethod def setUpClass(cls) -> None: cls.root = Path(__file__).resolve().parents[2] - workflow = yaml.safe_load( + cls.workflow = yaml.safe_load( (cls.root / ".github/workflows/ci.yml").read_text(encoding="utf-8") ) - cls.jobs = workflow["jobs"] - cls.routing_flags = workflow["env"]["CI_ROUTING_FLAGS"] + cls.routing_flags = cls.workflow["env"]["CI_ROUTING_FLAGS"] + metadata = subprocess.run( + ("cargo", "metadata", "--locked", "--no-deps", "--format-version", "1"), + cwd=cls.root, check=True, capture_output=True, text=True, + ) + cls.package_binaries = { + package["name"]: {target["name"] for target in package["targets"] if target["kind"] == ["bin"]} + for package in json.loads(metadata.stdout)["packages"] + } - def test_typescript_live_requires_a_scheduled_or_explicit_full_run(self) -> None: + def required_step(self, workflow, job_name, name, directory="."): + job = workflow["jobs"][job_name] + self.assertIs(job.get("continue-on-error", False), False, job_name) + steps = [step for step in job["steps"] if step.get("name") == name] + self.assertEqual(len(steps), 1, name) + step = steps[0] + self.assertIn(step.get("if", "success()"), ("success()", "${{ success() }}"), name) + self.assertIs(step.get("continue-on-error", False), False, name) + working_directory = "." + for scope in (workflow, job): + working_directory = scope.get("defaults", {}).get("run", {}).get( + "working-directory", working_directory, + ) + self.assertEqual( + PurePosixPath(step.get("working-directory", working_directory)), + PurePosixPath(directory), + name, + ) + return job, step + + def assert_live_workflow(self, workflow): selection = ( "github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' " "&& needs.changes.outputs.full_sweep == 'true')" ) - live = self.jobs["typescript-live"] - result = self.jobs["ci-result"] + job_name = "typescript-live" + live, run = self.required_step( + workflow, job_name, "Run live Node, Deno and Chromium tests", "clients/typescript", + ) + self.assertEqual(set(live["needs"]), {"changes", "rust-policy"}) self.assertEqual( "${{ !cancelled() && needs.changes.result == 'success' " "&& needs.rust-policy.result == 'success' && (" + selection + ") }}", live["if"], ) - self.assertIn("typescript-live", result["needs"]) + self.assertEqual(shlex.split(run["run"]), ["npm", "run", "test:live", "--", "--require-deno"]) + _, build = self.required_step(workflow, job_name, "Build the product binaries from source") + _, node = self.required_step(workflow, job_name, "Setup Node") + _, deno = self.required_step(workflow, job_name, "Setup Deno") + _, package = self.required_step( + workflow, job_name, "Build the TypeScript package and install Chromium", "clients/typescript", + ) + for prerequisite in (build, node, deno, package): + self.assertLess(live["steps"].index(prerequisite), live["steps"].index(run)) + for prerequisite in (node, deno): + self.assertLess(live["steps"].index(prerequisite), live["steps"].index(package)) + self.assertTrue(node["uses"].startswith("actions/setup-node@")) + self.assertTrue(deno["uses"].startswith("denoland/setup-deno@")) + self.assertEqual(package["shell"], "bash") + commands = [shlex.split(line) for line in package["run"].splitlines() if line.strip()] + self.assertEqual(commands[0], ["set", "-euo", "pipefail"]) + for command in ( + ["npm", "ci"], + ["npm", "run", "build"], + ["node", "node_modules/playwright-core/cli.js", "install", "--with-deps", "chromium"], + ): + self.assertIn(command, commands) + args = shlex.split(build["run"]) + self.assertEqual(args[:2], ["cargo", "build"]) + self.assertIn("--locked", args) + self.assertIn("--bins", args) + self.assertIn("registry-breg/runtime", args[args.index("--features") + 1].split(",")) + packages = {args[index + 1] for index, value in enumerate(args) if value == "-p"} + built = set().union(*(self.package_binaries[package] for package in packages)) + harness = (self.root / "clients/typescript/tests/live/harness.ts").read_text(encoding="utf-8") + specs = harness.split("const binarySpecs: readonly BinarySpec[] = [", 1)[1].split("]", 1)[0] + required = set(re.findall(r"\bname: '([^']+)'", specs)) + self.assertTrue(required) + self.assertLessEqual(required, built, f"missing live binary builds: {required - built}") + + result, aggregate = self.required_step(workflow, "ci-result", "Require every selected CI job") + self.assertEqual(result["if"], "always()") + self.assertIn(job_name, result["needs"]) self.assertEqual(result["env"]["TYPESCRIPT_LIVE_REQUIRED"], "${{ " + selection + " }}") - self.assertTrue(any("run test:live -- --require-deno" in step.get("run", "") - for step in live["steps"])) + return aggregate["run"] + + def assert_journey_workflow(self, workflow): + job, run = self.required_step(workflow, "repository-checks", "Test the acceptance journey harness") + self.assertNotIn("if", job) + self.assertEqual(shlex.split(run["run"]), ["bash", "products/platform/journeys/test_lib.sh"]) + + def assert_evidence_workflow(self, workflow): + name = "evidence-tutorials" + evidence, test = self.required_step(workflow, name, "Test opt-in Evidence authoring cases") + self.assertEqual(evidence["needs"], "changes") + self.assertEqual(evidence["if"], "needs.changes.outputs.evidence_tutorial == 'true'") + _, build = self.required_step(workflow, name, "Build the Evidence toolset under test") + self.assertLess(evidence["steps"].index(build), evidence["steps"].index(test)) + self.assertEqual(test["env"]["EVIDENCE_BIN"], "${{ github.workspace }}/target/debug/evidence") + self.assertEqual(test["shell"], "bash") + build_line = re.search(r"^cargo build [^\n]+$", build["run"].replace("\\\n", " "), re.MULTILINE) + self.assertIsNotNone(build_line) + args = shlex.split(build_line.group()) + self.assertIn("--locked", args) + self.assertIn("--bins", args) + packages = {args[index + 1] for index, value in enumerate(args) if value == "-p"} + self.assertIn("registry-evidence", packages) + rows = re.search(r"^done <<'CASES'\n(.*?)^CASES$", test["run"], re.MULTILINE | re.DOTALL) + self.assertIsNotNone(rows) + actual = tuple(tuple(shlex.split(row)) for row in rows[1].splitlines()) + self.assertEqual(actual, self.evidence_cases) + return test["run"] - # A selected job must pass. An ordinary PR or push can skip the job. - script = result["steps"][0]["run"] + def test_typescript_live_requires_a_scheduled_or_explicit_full_run(self) -> None: + script = self.assert_live_workflow(self.workflow) outputs = {name: "false" for name in self.routing_flags.split()} outputs.update(rust_matrix='{"include":[]}', rust_packages="[]", breg_contracts_lanes="[]") - for required, expected_status in (("true", 1), ("false", 0)): - with self.subTest(required=required): + for required, result, expected in ( + ("true", "success", 0), ("true", "failure", 1), + ("true", "skipped", 1), ("false", "skipped", 0), + ): + with self.subTest(required=required, result=result): environment = { "CI_JOB_RESULTS": json.dumps({"changes": {"result": "success", "outputs": outputs}, "repository-checks": {"result": "success"}, - "typescript-live": {"result": "skipped"}}), + "typescript-live": {"result": result}}), "CI_ROUTING_FLAGS": self.routing_flags, "TYPESCRIPT_LIVE_REQUIRED": required, } completed = subprocess.run( ("bash", "-c", script), env=environment, capture_output=True, text=True, ) - self.assertEqual(completed.returncode, expected_status, completed.stderr) + self.assertEqual(completed.returncode, expected, completed.stderr) def test_opt_in_evidence_and_journey_verification_are_wired(self) -> None: - self.assertTrue(any( - step.get("run") == "bash products/platform/journeys/test_lib.sh" - for step in self.jobs["repository-checks"]["steps"] - )) - steps = self.jobs["evidence-tutorials"]["steps"] - index = next(i for i, step in enumerate(steps) - if step.get("name") == "Test opt-in Evidence authoring cases") - step = steps[index] - self.assertEqual(step["env"]["EVIDENCE_BIN"], "${{ github.workspace }}/target/debug/evidence") - self.assertTrue(any("cargo build --locked" in earlier.get("run", "") - and "-p registry-evidence " in earlier["run"] for earlier in steps[:index])) - for suite, case in ( - ("scaffold", "the_generated_openapi_starter_passes_check_and_test"), - ("source_recipes", "source_review_commands_accept_a_local_target_only_under_development"), - ("production_handoff", "production_package_accepts_the_real_package_check_digest"), - ("production_handoff", "offline_production_check_closes_without_target_host_mounts"), - ("production_handoff", "explain_refuses_unknown_source_members_without_disclosing_values"), - ("production_handoff", "offline_check_makes_private_staging_under_umask_022"), - ("production_handoff", "explicit_evidence_grade_target_applies_its_own_strict_source_rules"), - ): + self.assert_journey_workflow(self.workflow) + script = self.assert_evidence_workflow(self.workflow) + for suite, case in self.evidence_cases: with self.subTest(suite=suite, case=case): - self.assertIn(f"{suite} {case}", step["run"]) source = (self.root / f"crates/registry-evidencectl/tests/{suite}.rs").read_text() self.assertRegex(source, rf"#\[ignore[^\n]*\]\nfn {case}\(") - self.assertIn("-- --ignored --exact", step["run"]) - self.assertIn("1 passed; 0 failed", step["run"]) + + stub = """cargo() { + printf '%s\\n' "$*" >>"$RUNNER_TEMP/argv" + case "$STUB_CASE" in + failure) return 7 ;; + empty) printf '%s\\n' 'test result: ok. 0 passed; 0 failed;' ;; + pass) printf '%s\\n' 'test result: ok. 1 passed; 0 failed;' ;; + esac + } + """ + for answer, expected in (("pass", 0), ("empty", 1), ("failure", 7)): + with self.subTest(answer=answer), tempfile.TemporaryDirectory() as work: + completed = subprocess.run( + ("bash", "-c", stub + script), + env={**os.environ, "RUNNER_TEMP": work, "STUB_CASE": answer}, + capture_output=True, text=True, + ) + self.assertEqual(completed.returncode, expected, completed.stdout + completed.stderr) + tested = self.evidence_cases if answer == "pass" else self.evidence_cases[:1] + self.assertEqual( + (Path(work) / "argv").read_text().splitlines(), + [f"test --locked -p registry-evidencectl --test {suite} {case} -- --ignored --exact" + for suite, case in tested], + ) + + def test_disabled_advisory_or_incomplete_wiring_fails(self) -> None: + for job_name, step_name, check in ( + ("typescript-live", "Run live Node, Deno and Chromium tests", self.assert_live_workflow), + ("repository-checks", "Test the acceptance journey harness", self.assert_journey_workflow), + ("evidence-tutorials", "Test opt-in Evidence authoring cases", self.assert_evidence_workflow), + ): + for key, value in (("if", False), ("continue-on-error", True), ("working-directory", "docs")): + with self.subTest(job=job_name, setting=key): + workflow = deepcopy(self.workflow) + steps = workflow["jobs"][job_name]["steps"] + step = next(step for step in steps if step.get("name") == step_name) + step[key] = value + with self.assertRaises(AssertionError): + check(workflow) + + workflow = deepcopy(self.workflow) + workflow["jobs"]["typescript-live"]["continue-on-error"] = True + with self.assertRaises(AssertionError): + self.assert_live_workflow(workflow) + + workflow = deepcopy(self.workflow) + _, build = self.required_step(workflow, "typescript-live", "Build the product binaries from source") + build["run"] = build["run"].replace("-p registry-session", "") + with self.assertRaisesRegex(AssertionError, "missing live binary builds"): + self.assert_live_workflow(workflow) + + workflow = deepcopy(self.workflow) + _, evidence = self.required_step(workflow, "evidence-tutorials", "Test opt-in Evidence authoring cases") + evidence["run"] = evidence["run"].replace("\nscaffold ", "\n# scaffold ") + with self.assertRaises(AssertionError): + self.assert_evidence_workflow(workflow) class EventScopedSelectionTest(unittest.TestCase): diff --git a/clients/typescript/core.ts b/clients/typescript/core.ts index 656693ab38..a27ed2145e 100644 --- a/clients/typescript/core.ts +++ b/clients/typescript/core.ts @@ -885,6 +885,7 @@ export interface ListProfileRules { export interface ListRules { accessProfileParameter: boolean requiresAccessProfile?: boolean + paginationParameters?: { size: 'limit'; cursor: 'cursor' } profiles: Record recordProperties?: readonly string[] } @@ -958,7 +959,7 @@ export function listQuery(rules: ListRules, options: ListRequest, cursor?: strin const label = (property: unknown) => known(property) ? '`' + String(property) + '`' : 'A property' const query: Record = {} if (chosen !== undefined) query.accessProfile = chosen - if (cursor !== undefined) return { ...query, $skiptoken: cursor } + if (cursor !== undefined) return { ...query, [rules.paginationParameters?.cursor ?? '$skiptoken']: cursor } const where = options.where ?? {} if (typeof where !== 'object' || where === null || Array.isArray(where)) throw new TypeError('`where` must be an object') @@ -1004,7 +1005,7 @@ export function listQuery(rules: ListRules, options: ListRequest, cursor?: strin if (!Number.isSafeInteger(options.top) || options.top < 1 || options.top > profile.maximumPageSize) { throw new TypeError('`top` must be a whole number from 1 to ' + profile.maximumPageSize + under) } - query.$top = options.top + query[rules.paginationParameters?.size ?? '$top'] = options.top } if (options.count !== undefined) { if (typeof options.count !== 'boolean') throw new TypeError('`count` must be true or false') diff --git a/clients/typescript/generate.ts b/clients/typescript/generate.ts index d976d9e134..ba0d9155fc 100644 --- a/clients/typescript/generate.ts +++ b/clients/typescript/generate.ts @@ -814,6 +814,7 @@ export function generate(source: string, settings: Settings = {}): string { opTypes.push(' ' + quote(id) + ': { input: ' + inputs.join(' & ') + '; required: ' + String(requiredOptions) + '; output: ' + result + ' }') const cursorName = parameterMap.has('query:$skiptoken') ? '$skiptoken' : parameterMap.has('query:cursor') ? 'cursor' : undefined + const limitAndCursor = cursorName === 'cursor' && parameterMap.has('query:limit') if (page && cursorName && !definition.mutating) { const name = identifier(id) + 'Page' if (pageNames.has(name)) fail(child(pointer, 'operationId'), 'colliding page method') @@ -822,9 +823,10 @@ export function generate(source: string, settings: Settings = {}): string { : 'options: Operations[' + quote(id) + ']["input"] = {}, cursor?: string' // A BReg cursor carries the query, so a continuation sends only the access profile, // where the route takes one, and the cursor. - const query = cursorName !== '$skiptoken' ? '{ ...options.query, cursor }' - : parameterMap.has('query:accessProfile') ? '{ accessProfile: options.query?.accessProfile, "$skiptoken": cursor }' - : '{ "$skiptoken": cursor }' + const cursorOnly = cursorName === '$skiptoken' || (breg && operation['x-registry-queryKind'] === 'list') + const query = !cursorOnly ? '{ ...options.query, cursor }' + : '{ ' + (parameterMap.has('query:accessProfile') ? 'accessProfile: options.query?.accessProfile, ' : '') + + quote(cursorName) + ': cursor }' pageMethods.push(' async ' + name + '(' + rest + '): Promise> {\n' + ' const { data } = await this.call(' + quote(id) + ', { ...options, query: cursor === undefined ? options.query : ' + query + ' })\n' + ' return { items: data.' + page.items + ', nextCursor: data.' + page.cursor + ' ?? null }\n }') @@ -835,7 +837,7 @@ export function generate(source: string, settings: Settings = {}): string { && (operation['x-registry-queryKind'] ?? 'list') === 'list' ? queryProfiles(operation, pointer) : undefined if (listProfiles) { const listShape = page && page.items === 'items' && page.cursor === 'pageInfo.nextCursor' - && cursorName === '$skiptoken' && !definition.mutating + && (cursorName === '$skiptoken' || limitAndCursor) && !definition.mutating ? page : fail(pointer, 'query profiles on an operation without a BReg list page') const profileParameter = parameterMap.get('query:accessProfile')?.value if (!profileParameter && listProfiles.length > 1) fail(pointer, 'several query profiles need an accessProfile parameter') @@ -869,6 +871,7 @@ export function generate(source: string, settings: Settings = {}): string { listRules[recordType] = { operation: id, requiresAccessProfile, accessProfileParameter: Boolean(profileParameter), + ...(limitAndCursor ? { paginationParameters: { size: 'limit', cursor: 'cursor' } } : {}), recordProperties: [...new Set(listProfiles.flatMap(entry => [ ...entry.selectable, ...entry.filterable.map(filter => filter.property), ...entry.sortable.map(sort => sort.property), ]))].sort(), diff --git a/clients/typescript/tasks/proposals.ts b/clients/typescript/tasks/proposals.ts index 7264c39cef..1d93e2d33c 100644 --- a/clients/typescript/tasks/proposals.ts +++ b/clients/typescript/tasks/proposals.ts @@ -70,7 +70,7 @@ export interface ServedApplicationStatus { automaticRetry?: { attempts: number; maximumAttempts: number; scheduled: boolean } mode: 'automatic' | 'manual' reason?: 'package-changed' | 'dependency-outage' | 'lease-expired' | 'application-refused' | 'attempts-exhausted' - recovery?: 'retry' | 'rebase' | 'correct-input' + recovery?: 'retry' | 'rebase' | 'revise' | 'correct-input' state: 'awaiting-review' | 'pending' | 'applying' | 'blocked' | 'applied' | 'cancelled' | 'rejected' } @@ -274,8 +274,11 @@ function rebaseAvailability(words: Words, served: ServedProposal): Availability if (!link.available) return link const links = [...Object.values(served.links), ...Object.values(served.attachments ?? {}).flatMap(slot => Object.values(slot.links))] const changed = served.blockedReason === 'package-changed' || links.some(other => other.availability?.recovery === 'rebase') - // A manual Apply the register refused leaves Revise pointing at corrections, which only a rebase can make. - const refused = served.state === 'submitted' && served.links['revise']?.availability?.recovery === 'correct-input' + const application = served.applicationStatus + const refused = served.state === 'submitted' && (application + ? application.mode === 'manual' && application.state === 'blocked' + && application.reason === 'application-refused' && application.recovery === 'rebase' + : served.links['revise']?.availability?.recovery === 'correct-input') if (!changed && !refused) return unavailable(words, 'not-needed') return { available: true, message: sentence(changed ? 'rebase' : 'rebase-refused', words) } } diff --git a/clients/typescript/tests/fixtures/tasks/proposal-application-refused.json b/clients/typescript/tests/fixtures/tasks/proposal-application-refused.json index 5816536572..4363f12963 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-application-refused.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-application-refused.json @@ -29,7 +29,7 @@ "operation": "download", "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document?submissionVersion=1", "availability": { - "observedRevision": 3, + "observedRevision": 5, "available": true } } @@ -88,9 +88,7 @@ "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, - "available": false, - "reason": "invalid-input", - "recovery": "correct-input" + "available": true } }, "cancel": { @@ -120,6 +118,7 @@ "mode": "manual", "state": "blocked", "reason": "application-refused", - "recovery": "correct-input" - } + "recovery": "rebase" + }, + "effectDigest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } diff --git a/clients/typescript/tests/fixtures/tasks/proposal-applied.json b/clients/typescript/tests/fixtures/tasks/proposal-applied.json index f3d56fc39a..aa1f9a8d5d 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-applied.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-applied.json @@ -90,5 +90,22 @@ "recovery": "receipt-only" } } + }, + "effectDigest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "applicationStatus": { + "mode": "manual", + "state": "applied" + }, + "application": { + "applicationId": "c84775c2-2939-40ad-a11d-20e4b59b029f", + "submissionVersion": 1, + "effectDigest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "resultLinks": [ + { + "recordType": "facility", + "recordId": "eddce713-9dfd-4769-b72f-067acb8ccf8b", + "revision": 2 + } + ] } } diff --git a/clients/typescript/tests/fixtures/tasks/proposal-approved.json b/clients/typescript/tests/fixtures/tasks/proposal-approved.json index fd4d4cec3c..1e9907a107 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-approved.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-approved.json @@ -4,7 +4,7 @@ "actionRevision": "rev-a", "state": "submitted", "status": "approved", - "turn": "nobody", + "turn": "official", "submissionVersion": 1, "revision": 7, "title": "Correct address", @@ -59,7 +59,9 @@ "ifMatch": "\"etag-7\"", "availability": { "observedRevision": 7, - "available": true + "available": false, + "reason": "application-pending", + "recovery": "refresh" } }, "cancel": { @@ -81,12 +83,19 @@ "ifMatch": "\"etag-7\"", "availability": { "observedRevision": 7, - "available": true + "available": false, + "reason": "application-pending", + "recovery": "refresh" } } }, "decision": { "status": "approved", "decidedAt": "2026-11-27T12:00:00Z" + }, + "effectDigest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "applicationStatus": { + "mode": "manual", + "state": "pending" } } diff --git a/clients/typescript/tests/fixtures/tasks/proposal-draft-attached.json b/clients/typescript/tests/fixtures/tasks/proposal-draft-attached.json index 08e9f7deba..47fc8e2fc9 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-draft-attached.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-draft-attached.json @@ -40,7 +40,7 @@ "operation": "download", "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document?submissionVersion=1", "availability": { - "observedRevision": 3, + "observedRevision": 4, "available": true } } diff --git a/clients/typescript/tests/fixtures/tasks/proposal-draft-revised.json b/clients/typescript/tests/fixtures/tasks/proposal-draft-revised.json new file mode 100644 index 0000000000..4e236305de --- /dev/null +++ b/clients/typescript/tests/fixtures/tasks/proposal-draft-revised.json @@ -0,0 +1,126 @@ +{ + "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", + "actionId": "correct-address", + "actionRevision": "rev-a", + "state": "draft", + "status": "draft", + "turn": "party", + "submissionVersion": 2, + "revision": 7, + "title": "Correct address", + "createdAt": "2026-11-27T10:00:00.000000Z", + "input": { + "facilityId": "f-1", + "city": "Springfield" + }, + "attachments": { + "supporting-document": { + "id": "supporting-document", + "required": true, + "maximumBytes": 1048576, + "contentTypes": [ + "application/pdf" + ], + "classification": "internal", + "links": { + "upload": { + "accessProfile": "facility-correction-author", + "method": "PATCH", + "operation": "upload", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document", + "ifMatch": "\"etag-7\"", + "availability": { + "observedRevision": 7, + "available": true + } + }, + "download": { + "accessProfile": "facility-correction-author", + "method": "GET", + "operation": "download", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document?submissionVersion=2", + "availability": { + "observedRevision": 7, + "available": true + } + } + }, + "value": { + "submissionVersion": 2, + "sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "byteSize": 4096, + "contentType": "application/pdf", + "verificationStatus": "notRequired" + } + } + }, + "links": { + "self": { + "accessProfile": "facility-correction-author", + "method": "GET", + "operation": "get", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", + "availability": { + "observedRevision": 7, + "available": true + } + }, + "edit": { + "accessProfile": "facility-correction-author", + "method": "POST", + "operation": "edit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", + "ifMatch": "\"etag-7\"", + "availability": { + "observedRevision": 7, + "available": true + } + }, + "submit": { + "accessProfile": "facility-correction-author", + "method": "POST", + "operation": "submit", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", + "ifMatch": "\"etag-7\"", + "availability": { + "observedRevision": 7, + "available": true + } + }, + "revise": { + "accessProfile": "facility-correction-author", + "method": "POST", + "operation": "revise", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", + "ifMatch": "\"etag-7\"", + "availability": { + "observedRevision": 7, + "available": false, + "reason": "stale-revision", + "recovery": "receipt-only" + } + }, + "cancel": { + "accessProfile": "facility-correction-author", + "method": "POST", + "operation": "cancel", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", + "ifMatch": "\"etag-7\"", + "availability": { + "observedRevision": 7, + "available": true + } + }, + "rebase": { + "accessProfile": "facility-correction-author", + "method": "POST", + "operation": "rebase", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", + "ifMatch": "\"etag-7\"", + "availability": { + "observedRevision": 7, + "available": true + } + } + } +} diff --git a/clients/typescript/tests/fixtures/tasks/proposal-draft.json b/clients/typescript/tests/fixtures/tasks/proposal-draft.json index 98f6900574..65a3ce8afa 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-draft.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-draft.json @@ -67,7 +67,9 @@ "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, - "available": true + "available": false, + "reason": "attachment-required", + "recovery": "correct-input" } }, "revise": { diff --git a/clients/typescript/tests/fixtures/tasks/proposal-list-last.json b/clients/typescript/tests/fixtures/tasks/proposal-list-last.json index d538b64ff6..fd4a4518f2 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-list-last.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-list-last.json @@ -1,29 +1,52 @@ { "items": [ { - "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", + "id": "b28e42eb-71d2-48bc-8055-00fc4b960193", "actionId": "correct-address", "actionRevision": "rev-a", - "state": "applied", - "status": "applied", - "turn": "nobody", + "state": "draft", + "status": "draft", + "turn": "party", "submissionVersion": 1, - "revision": 8, + "revision": 3, "title": "Correct address", "createdAt": "2026-11-27T10:00:00.000000Z", "input": { "facilityId": "f-1", "city": "Springfield" }, - "attachments": {}, + "attachments": { + "supporting-document": { + "id": "supporting-document", + "required": true, + "maximumBytes": 1048576, + "contentTypes": [ + "application/pdf" + ], + "classification": "internal", + "links": { + "upload": { + "accessProfile": "facility-correction-author", + "method": "PATCH", + "operation": "upload", + "path": "/v1/proposals/b28e42eb-71d2-48bc-8055-00fc4b960193/attachments/supporting-document", + "ifMatch": "\"etag-3\"", + "availability": { + "observedRevision": 3, + "available": true + } + } + } + } + }, "links": { "self": { "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", + "path": "/v1/proposals/b28e42eb-71d2-48bc-8055-00fc4b960193", "availability": { - "observedRevision": 8, + "observedRevision": 3, "available": true } }, @@ -31,38 +54,36 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", - "ifMatch": "\"etag-8\"", + "path": "/v1/proposals/b28e42eb-71d2-48bc-8055-00fc4b960193/edit", + "ifMatch": "\"etag-3\"", "availability": { - "observedRevision": 8, - "available": false, - "reason": "already-applied", - "recovery": "receipt-only" + "observedRevision": 3, + "available": true } }, "submit": { "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", - "ifMatch": "\"etag-8\"", + "path": "/v1/proposals/b28e42eb-71d2-48bc-8055-00fc4b960193/submit", + "ifMatch": "\"etag-3\"", "availability": { - "observedRevision": 8, + "observedRevision": 3, "available": false, - "reason": "already-applied", - "recovery": "receipt-only" + "reason": "attachment-required", + "recovery": "correct-input" } }, "revise": { "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", - "ifMatch": "\"etag-8\"", + "path": "/v1/proposals/b28e42eb-71d2-48bc-8055-00fc4b960193/revise", + "ifMatch": "\"etag-3\"", "availability": { - "observedRevision": 8, + "observedRevision": 3, "available": false, - "reason": "already-applied", + "reason": "stale-revision", "recovery": "receipt-only" } }, @@ -70,26 +91,22 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", - "ifMatch": "\"etag-8\"", + "path": "/v1/proposals/b28e42eb-71d2-48bc-8055-00fc4b960193/cancel", + "ifMatch": "\"etag-3\"", "availability": { - "observedRevision": 8, - "available": false, - "reason": "already-applied", - "recovery": "receipt-only" + "observedRevision": 3, + "available": true } }, "rebase": { "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", - "ifMatch": "\"etag-8\"", + "path": "/v1/proposals/b28e42eb-71d2-48bc-8055-00fc4b960193/rebase", + "ifMatch": "\"etag-3\"", "availability": { - "observedRevision": 8, - "available": false, - "reason": "already-applied", - "recovery": "receipt-only" + "observedRevision": 3, + "available": true } } } diff --git a/clients/typescript/tests/fixtures/tasks/proposal-list.json b/clients/typescript/tests/fixtures/tasks/proposal-list.json index 2133533668..5cb2b13d40 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-list.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-list.json @@ -69,7 +69,9 @@ "ifMatch": "\"etag-3\"", "availability": { "observedRevision": 3, - "available": true + "available": false, + "reason": "attachment-required", + "recovery": "correct-input" } }, "revise": { @@ -110,7 +112,7 @@ } }, { - "id": "9a7ce3fb-c931-4d60-8991-7f6d395f0c44", + "id": "a20a1b52-e04e-4ab2-a2e4-e0fba0fedfb7", "actionId": "correct-address", "actionRevision": "rev-a", "state": "submitted", @@ -138,9 +140,9 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "download", - "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document?submissionVersion=1", + "path": "/v1/proposals/a20a1b52-e04e-4ab2-a2e4-e0fba0fedfb7/attachments/supporting-document?submissionVersion=1", "availability": { - "observedRevision": 3, + "observedRevision": 6, "available": true } } @@ -159,7 +161,7 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "get", - "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44", + "path": "/v1/proposals/a20a1b52-e04e-4ab2-a2e4-e0fba0fedfb7", "availability": { "observedRevision": 6, "available": true @@ -169,7 +171,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "edit", - "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/edit", + "path": "/v1/proposals/a20a1b52-e04e-4ab2-a2e4-e0fba0fedfb7/edit", "ifMatch": "\"etag-6\"", "availability": { "observedRevision": 6, @@ -182,7 +184,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "submit", - "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/submit", + "path": "/v1/proposals/a20a1b52-e04e-4ab2-a2e4-e0fba0fedfb7/submit", "ifMatch": "\"etag-6\"", "availability": { "observedRevision": 6, @@ -195,7 +197,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "revise", - "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/revise", + "path": "/v1/proposals/a20a1b52-e04e-4ab2-a2e4-e0fba0fedfb7/revise", "ifMatch": "\"etag-6\"", "availability": { "observedRevision": 6, @@ -206,7 +208,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "cancel", - "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/cancel", + "path": "/v1/proposals/a20a1b52-e04e-4ab2-a2e4-e0fba0fedfb7/cancel", "ifMatch": "\"etag-6\"", "availability": { "observedRevision": 6, @@ -217,7 +219,7 @@ "accessProfile": "facility-correction-author", "method": "POST", "operation": "rebase", - "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/rebase", + "path": "/v1/proposals/a20a1b52-e04e-4ab2-a2e4-e0fba0fedfb7/rebase", "ifMatch": "\"etag-6\"", "availability": { "observedRevision": 6, @@ -229,8 +231,13 @@ "status": "changes-requested", "decidedAt": "2026-11-27T11:00:00.000000Z", "publicReason": "Please add the licence number." + }, + "effectDigest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "applicationStatus": { + "mode": "manual", + "state": "awaiting-review" } } ], - "nextCursor": "cursor-2" + "nextCursor": "a20a1b52-e04e-4ab2-a2e4-e0fba0fedfb7" } diff --git a/clients/typescript/tests/fixtures/tasks/proposal-package-changed.json b/clients/typescript/tests/fixtures/tasks/proposal-package-changed.json index 0abb019ea5..076c8ccfd4 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-package-changed.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-package-changed.json @@ -29,7 +29,7 @@ "operation": "download", "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document?submissionVersion=1", "availability": { - "observedRevision": 3, + "observedRevision": 5, "available": true } } @@ -116,5 +116,12 @@ } } }, - "blockedReason": "package-changed" + "blockedReason": "package-changed", + "effectDigest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "applicationStatus": { + "mode": "manual", + "state": "blocked", + "reason": "package-changed", + "recovery": "rebase" + } } diff --git a/clients/typescript/tests/fixtures/tasks/proposal-rejected.json b/clients/typescript/tests/fixtures/tasks/proposal-rejected.json index 154993d965..3917beeec5 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-rejected.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-rejected.json @@ -94,5 +94,10 @@ "decision": { "status": "rejected", "decidedAt": "2026-11-27T12:00:00Z" + }, + "effectDigest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "applicationStatus": { + "mode": "manual", + "state": "rejected" } } diff --git a/clients/typescript/tests/fixtures/tasks/proposal-sent-back.json b/clients/typescript/tests/fixtures/tasks/proposal-sent-back.json index b3b9531748..ef090a61c9 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-sent-back.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-sent-back.json @@ -29,7 +29,7 @@ "operation": "download", "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document?submissionVersion=1", "availability": { - "observedRevision": 3, + "observedRevision": 6, "available": true } } @@ -118,5 +118,10 @@ "status": "changes-requested", "decidedAt": "2026-11-27T11:00:00.000000Z", "publicReason": "Please add the licence number." + }, + "effectDigest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "applicationStatus": { + "mode": "manual", + "state": "awaiting-review" } } diff --git a/clients/typescript/tests/fixtures/tasks/proposal-submitted-stale.json b/clients/typescript/tests/fixtures/tasks/proposal-submitted-stale.json index 66d876af91..e501382f80 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-submitted-stale.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-submitted-stale.json @@ -5,7 +5,7 @@ "state": "submitted", "status": "in-review", "turn": "official", - "submissionVersion": 1, + "submissionVersion": 2, "revision": 5, "title": "Correct address", "createdAt": "2026-11-27T10:00:00.000000Z", @@ -27,15 +27,15 @@ "accessProfile": "facility-correction-author", "method": "GET", "operation": "download", - "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document?submissionVersion=1", + "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document?submissionVersion=2", "availability": { - "observedRevision": 3, + "observedRevision": 5, "available": true } } }, "value": { - "submissionVersion": 1, + "submissionVersion": 2, "sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "byteSize": 4096, "contentType": "application/pdf", @@ -88,9 +88,7 @@ "ifMatch": "\"etag-5\"", "availability": { "observedRevision": 5, - "available": false, - "reason": "pending-review", - "recovery": "refresh" + "available": true } }, "cancel": { @@ -115,5 +113,10 @@ "available": true } } + }, + "effectDigest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "applicationStatus": { + "mode": "manual", + "state": "awaiting-review" } } diff --git a/clients/typescript/tests/fixtures/tasks/proposal-submitted.json b/clients/typescript/tests/fixtures/tasks/proposal-submitted.json index a7759b9b1a..cb29c2e255 100644 --- a/clients/typescript/tests/fixtures/tasks/proposal-submitted.json +++ b/clients/typescript/tests/fixtures/tasks/proposal-submitted.json @@ -29,7 +29,7 @@ "operation": "download", "path": "/v1/proposals/9a7ce3fb-c931-4d60-8991-7f6d395f0c44/attachments/supporting-document?submissionVersion=1", "availability": { - "observedRevision": 3, + "observedRevision": 5, "available": true } } @@ -113,5 +113,10 @@ "available": true } } + }, + "effectDigest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "applicationStatus": { + "mode": "manual", + "state": "awaiting-review" } } diff --git a/clients/typescript/tests/list.test.ts b/clients/typescript/tests/list.test.ts index 17cad0b1b0..4c28080634 100644 --- a/clients/typescript/tests/list.test.ts +++ b/clients/typescript/tests/list.test.ts @@ -1,7 +1,10 @@ import test from 'node:test' import { make } from './helpers.ts' import assert from 'node:assert/strict' -import { readFileSync } from 'node:fs' +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { fileURLToPath } from 'node:url' import { generate } from '../generate.ts' import { Client } from './fixtures/breg-list.ts' import { Client as FacilityClient } from '../generated/breg-facility.ts' @@ -114,6 +117,39 @@ test('a continuation sends only the access profile and the cursor', async () => assert.deepEqual(query(urls[0]!), { accessProfile: 'licence-officer', $skiptoken: 'next-1' }) }) +test('a generated BReg client uses declared limit and cursor keys', async t => { + const doc = fixture() + doc.components.parameters.top.name = 'limit' + doc.components.parameters.skiptoken.name = 'cursor' + const directory = mkdtempSync(join(tmpdir(), 'registry-list-pagination-')) + t.after(() => rmSync(directory, { recursive: true, force: true })) + const file = join(directory, 'client.ts') + writeFileSync(file, generate(JSON.stringify(doc), { + breg: true, + coreImport: fileURLToPath(new URL('../core.ts', import.meta.url)), + schemaImport: fileURLToPath(new URL('../schema.ts', import.meta.url)), + })) + const { Client } = await import(file) as typeof import('./fixtures/breg-list.ts') + const urls: URL[] = [] + const fetch: typeof globalThis.fetch = async url => { + urls.push(new URL(String(url))) + return Response.json({ items: [], pageInfo: { nextCursor: null } }) + } + const client = make(Client, { baseUrl, token: () => 'fixture', fetch }) + await client.list('licence', { accessProfile: 'licence-officer', where: { status: 'active' }, top: 3 }) + await client.list('licence', { accessProfile: 'licence-officer', after: 'opaque+/=' }) + // The generated call signature follows the synthetic OpenAPI's query names. + const options = { query: { accessProfile: 'licence-officer', limit: 3, $filter: "status eq 'active'" } } as const + await client.records_licence_listPage(options) + await client.records_licence_listPage(options, 'opaque+/=') + assert.deepEqual(urls.map(query), [ + { accessProfile: 'licence-officer', $filter: "status eq 'active'", limit: '3' }, + { accessProfile: 'licence-officer', cursor: 'opaque+/=' }, + { accessProfile: 'licence-officer', limit: '3', $filter: "status eq 'active'" }, + { accessProfile: 'licence-officer', cursor: 'opaque+/=' }, + ]) +}) + test('a single-profile route sends no access profile', async () => { const { urls, client } = recording(() => Response.json({ items: [], pageInfo: { nextCursor: null } })) await client.list('site', { where: { siteCode: 'S-1' }, orderBy: 'label' }) diff --git a/clients/typescript/tests/tasks-proposals.test.ts b/clients/typescript/tests/tasks-proposals.test.ts index 01f412c4ce..de803c2baf 100644 --- a/clients/typescript/tests/tasks-proposals.test.ts +++ b/clients/typescript/tests/tasks-proposals.test.ts @@ -111,14 +111,30 @@ test('list sends the filter and returns plain Proposals with a null cursor on th const { seen, commands } = register({ 'GET /v1/proposals': (_s, n) => ok(fixture(n === 1 ? 'proposal-list' : 'proposal-list-last')), }) - const first = await commands.list({ turn: 'party', state: 'draft', action: 'correct-address', limit: 5 }) - assert.deepEqual(Object.fromEntries(seen[0]!.query), { accessProfile, turn: 'party', state: 'draft', action: 'correct-address', limit: '5' }) + const filters = { turn: 'party', action: 'correct-address', limit: 2 } as const + const query = { accessProfile, turn: 'party', action: 'correct-address', limit: '2' } + const first = await commands.list(filters) + assert.deepEqual(Object.fromEntries(seen[0]!.query), query) assert.equal(first.items.length, 2) - assert.equal(first.nextCursor, 'cursor-2') + assert.equal(first.nextCursor, first.items[1]?.id) + assert.match(first.nextCursor ?? '', /^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/u) + assert.equal(first.items[1]?.state, 'submitted') assert.equal(first.items[1]?.sentBack, true) - const last = await commands.list({ cursor: first.nextCursor ?? undefined }) - assert.equal(seen[1]?.query.get('cursor'), 'cursor-2') + const last = await commands.list({ ...filters, cursor: first.nextCursor ?? undefined }) + assert.deepEqual(Object.fromEntries(seen[1]!.query), { ...query, cursor: first.nextCursor }) + assert.equal(last.items.length, 1) assert.equal(last.nextCursor, null) + const items = [...first.items, ...last.items] + const ids = items.map(item => item.id) + assert.deepEqual(ids, [...new Set(ids)].sort()) + for (const item of items) { + assert.equal(item.turn, filters.turn) + assert.equal(item.actionId, filters.action) + assert.equal(item.attachments['supporting-document']?.required, true) + for (const link of Object.values(item.served.links)) { + assert.equal(link.path.split('/')[3], item.id) + } + } }) // These helper-only inputs exercise the fallback for older responses without a served status. @@ -131,10 +147,10 @@ test('proposalStatus follows the derivation row by row', () => { ['draft', fixture('proposal-draft-optional'), 'draft'], ['party turn', fixture('proposal-sent-back'), 'awaiting-party'], ['approved decision', fixture('proposal-approved'), 'approved'], - ['official, no application status', submitted, 'in-review'], + ['official, no application status', { ...submitted, applicationStatus: undefined }, 'in-review'], ['official, awaiting review', { ...submitted, applicationStatus: { mode: 'manual', state: 'awaiting-review' } }, 'in-review'], ['official, application pending', { ...submitted, applicationStatus: { mode: 'manual', state: 'pending' } }, 'processing'], - ['nobody, no decision', { ...submitted, turn: 'nobody' }, 'processing'], + ['nobody, no decision', { ...submitted, turn: 'nobody', applicationStatus: undefined }, 'processing'], ['nobody, application applying', { ...submitted, turn: 'nobody', applicationStatus: { mode: 'automatic', state: 'applying' } }, 'processing'], ] for (const [name, served, status] of rows) { @@ -182,7 +198,7 @@ test('can.resubmit follows the revise link and carries the served reason and rec const waiting = await commands.get(proposalId) assert.deepEqual( { available: waiting.can.resubmit.available, reason: waiting.can.resubmit.reason, recovery: waiting.can.resubmit.recovery }, - { available: false, reason: 'pending-review', recovery: 'refresh' }, + { available: false, reason: 'not-awaiting-party', recovery: undefined }, ) assert.ok(waiting.can.resubmit.message.length > 5) }) @@ -301,7 +317,12 @@ test('a command the state does not allow refuses with the served reason, without }) test('a link the register marks unavailable refuses with its reason and recovery', async () => { - const { seen, commands } = register({ [`GET ${P}`]: () => ok(fixture('proposal-submitted-stale')) }) + // Deliberate unavailable-link variant for the helper's reason propagation. + const doc = fixture('proposal-submitted-stale') + doc.links['revise']!.availability = { + available: false, observedRevision: doc.revision, reason: 'pending-review', recovery: 'refresh', + } + const { seen, commands } = register({ [`GET ${P}`]: () => ok(doc) }) const p = await commands.get(proposalId) seen.length = 0 const error = await refusal(commands.resubmit(p), 'client.command-unavailable', 'pending-review') @@ -432,6 +453,25 @@ test('submit and cancel send an empty body with their own link condition', async // 10: resubmit. const nextVersion = (d: ServedProposal): ServedProposal => ({ ...d, submissionVersion: d.submissionVersion + 1 }) +function mockNextRevision(previous: ServedProposal, updated: ServedProposal): ServedProposal { + const view = { ...updated, revision: previous.revision + 1, submissionVersion: previous.submissionVersion } + const links = [...Object.values(view.links)] + for (const slot of Object.values(view.attachments ?? {})) { + if (slot.value) slot.value.submissionVersion = view.submissionVersion + if (slot.links['download']) { + slot.links['download'].path = slot.links['download'].path.replace( + /submissionVersion=\d+/u, `submissionVersion=${view.submissionVersion}`, + ) + } + links.push(...Object.values(slot.links)) + } + for (const link of links) { + if (link.ifMatch) link.ifMatch = `"etag-${view.revision}"` + if (link.availability) link.availability.observedRevision = view.revision + } + return view +} + interface ResubmitOptions { failAttachOnce?: boolean; failSubmitOnce?: boolean; loseSubmitAnswerOnce?: boolean; ignoreRevisedInput?: boolean; sha256?: string } // A register that moves a sent-back proposal through revise, attach, edit and submit, one @@ -447,26 +487,34 @@ function resubmitServer(options: ResubmitOptions = {}) { [`POST ${P}/revise`]: s => { count.revise++ // Revise carries the previous round's attachments forward. - const revised = { ...nextVersion(fixture('proposal-draft-optional')), input: options.ignoreRevisedInput ? doc.input : sentInput(s) ?? doc.input } + const revised = { ...fixture('proposal-draft-revised'), input: options.ignoreRevisedInput ? doc.input : sentInput(s) ?? doc.input } const carried = doc.attachments?.['supporting-document']?.value - if (carried) revised.attachments!['supporting-document']!.value = carried + const slot = revised.attachments!['supporting-document']! + if (carried) slot.value = { ...carried, submissionVersion: revised.submissionVersion } + else { + delete slot.value + delete slot.links['download'] + revised.links['submit']!.availability = { + available: false, observedRevision: revised.revision, reason: 'attachment-required', recovery: 'correct-input', + } + } doc = revised return ok(doc) }, [`PATCH ${P}/attachments/supporting-document`]: () => { count.patch++ if (options.failAttachOnce && !failed.attach) { failed.attach = true; return new Response(null, { status: 503 }) } - const attached = { ...nextVersion(fixture('proposal-draft-attached')), input: doc.input } + const attached = mockNextRevision(doc, { ...fixture('proposal-draft-attached'), input: doc.input }) if (options.sha256) attached.attachments!['supporting-document']!.value!.sha256 = options.sha256 doc = attached return ok(doc) }, - [`POST ${P}/edit`]: s => { count.edit++; doc = { ...doc, input: sentInput(s) }; return ok(doc) }, + [`POST ${P}/edit`]: s => { count.edit++; doc = mockNextRevision(doc, { ...doc, input: sentInput(s) }); return ok(doc) }, [`POST ${P}/cancel`]: () => ok(fixture('proposal-cancelled')), [`POST ${P}/submit`]: () => { count.submit++ if (options.failSubmitOnce && !failed.submit) { failed.submit = true; return new Response(null, { status: 503 }) } - doc = { ...nextVersion(fixture('proposal-submitted')), input: doc.input } + doc = mockNextRevision(doc, { ...fixture('proposal-submitted'), input: doc.input }) if (options.loseSubmitAnswerOnce && !failed.lost) { failed.lost = true; return new Response(null, { status: 503 }) } return ok(doc) }, @@ -493,7 +541,7 @@ test('resubmit reads the register, revises, attaches, edits only when needed, th 'GET ', 'POST /revise', 'GET ', 'PATCH /attachments/supporting-document', 'GET ', 'POST /edit', 'GET ', 'POST /submit', 'GET ', ]) const writes = writesOf(server.seen) - assert.deepEqual(writes.map(s => s.headers.get('if-match')), ['"etag-6"', '"etag-3"', '"etag-4"', '"etag-4"']) + assert.deepEqual(writes.map(s => s.headers.get('if-match')), ['"etag-6"', '"etag-7"', '"etag-8"', '"etag-9"']) assert.deepEqual(JSON.parse(String(writes[0]?.body)), { input: { facilityId: 'f-1', city: 'Shelbyville' } }) assert.equal(new Set(writes.map(keyOf)).size, 4, 'each step has its own key') for (const write of writes) assert.match(keyOf(write), /^rc1-/) @@ -543,7 +591,10 @@ test('resubmit is available only while the party is to act, and says so', async await refusal(commands.resubmit(p), 'client.command-unavailable', 'not-awaiting-party') assert.equal(writesOf(seen).length, 0) const approved = await register({ [`GET ${P}`]: () => ok(fixture('proposal-approved')) }).commands.get(proposalId) - assert.equal(approved.can.resubmit.reason, 'not-awaiting-party') + assert.deepEqual( + [approved.can.resubmit.reason, approved.can.resubmit.recovery], + ['application-pending', 'refresh'], + ) const sentBack = await register({ [`GET ${P}`]: () => ok(fixture('proposal-sent-back')) }).commands.get(proposalId) assert.equal(sentBack.can.resubmit.available, true) }) @@ -1081,7 +1132,6 @@ test('a list that learns a newer revision does not change the condition a comman // The register marks Submit unavailable while a required slot is empty. The helper follows the link. test('submit follows the register: unavailable with attachment-required refuses before sending', async () => { const doc = fixture('proposal-draft') - doc.links['submit']!.availability = { available: false, observedRevision: 3, reason: 'attachment-required', recovery: 'correct-input' } const { seen, commands } = register({ [`GET ${P}`]: () => ok(doc) }) const p = await commands.get(proposalId) assert.deepEqual([p.can.submit.available, p.can.submit.reason, p.can.submit.recovery], [false, 'attachment-required', 'correct-input']) @@ -1092,8 +1142,11 @@ test('submit follows the register: unavailable with attachment-required refuses }) test('the helper does not compute a missing required slot: an available submit link is sent', async () => { + // Deliberately contradict the server's attachment rule to test link-following only. + const doc = fixture('proposal-draft') + doc.links['submit']!.availability = { available: true, observedRevision: doc.revision } const { seen, commands } = register({ - [`GET ${P}`]: () => ok(fixture('proposal-draft')), + [`GET ${P}`]: () => ok(doc), [`POST ${P}/submit`]: () => ok(fixture('proposal-submitted')), }) const p = await commands.get(proposalId) @@ -1115,9 +1168,26 @@ test('a manual Apply the register refused counts as needing a rebase, with its o assert.equal(p.can.rebase.available, true) assert.match(p.can.rebase.message, /could not be applied/i) assert.notEqual(p.can.rebase.message, availabilityMessages['rebase']) - assert.equal(p.can.resubmit.available, false) + assert.equal(p.can.resubmit.available, true) assert.equal((await commands.rebase(p)).state, 'draft') assert.equal(seen.filter(s => s.method === 'POST').length, 1) + assert.equal(seen.find(s => s.method === 'POST')?.headers.get('if-match'), '"etag-5"') +}) + +test('a blocked application recovery cannot grant an unavailable Rebase command', async () => { + for (const available of [undefined, false]) { + const doc = fixture('proposal-application-refused') + if (available === undefined) delete doc.links['rebase'] + else doc.links['rebase']!.availability = { + available, observedRevision: doc.revision, reason: 'application-pending', recovery: 'refresh', + } + const { seen, commands } = register({ [`GET ${P}`]: () => ok(doc) }) + const view = await commands.get(proposalId) + assert.equal(view.can.rebase.available, false) + await refusal(commands.rebase(view), 'client.command-unavailable', + available === undefined ? 'not-offered' : 'application-pending') + assert.equal(writesOf(seen).length, 0) + } }) test('the package-changed sentence tells the reader to update the form first', () => { diff --git a/clients/typescript/tests/tasks-response-contracts.test.ts b/clients/typescript/tests/tasks-response-contracts.test.ts index 41fee6f160..873ee79569 100644 --- a/clients/typescript/tests/tasks-response-contracts.test.ts +++ b/clients/typescript/tests/tasks-response-contracts.test.ts @@ -14,7 +14,7 @@ interface OpenApi { const readJson = (relativePath: string): unknown => JSON.parse(readFileSync(new URL(relativePath, import.meta.url), 'utf8')) -const breg = readJson('../../../products/breg/examples/required-attachment/openapi.json') as OpenApi +const breg = readJson('../../../products/breg/generated/facility/generated/openapi.json') as OpenApi const documents = readJson('../../../products/documents/generated/registry-documents.openapi.json') as OpenApi function responseValidator(api: OpenApi, path: string, method = 'get', status = '200') { @@ -29,8 +29,26 @@ function responseValidator(api: OpenApi, path: string, method = 'get', status = }) } -const proposal = responseValidator(breg, '/v1/proposals/{proposal_id}') +const proposalPath = '/v1/proposals/{proposal_id}' +const proposal = responseValidator(breg, proposalPath) const proposalPage = responseValidator(breg, '/v1/proposals') +const proposalEdit = responseValidator(breg, `${proposalPath}/edit`, 'post') +const proposalSubmit = responseValidator(breg, `${proposalPath}/submit`, 'post') +const proposalApply = responseValidator(breg, `${proposalPath}/apply`, 'post') +// Mutation fixtures also exercise the subsequent read in task-helper tests. +const proposalCommands: Record[]> = { + 'proposal-draft-optional.json': [ + responseValidator(breg, '/v1/actions/correct-address/proposals', 'post', '201'), + proposalEdit, responseValidator(breg, `${proposalPath}/rebase`, 'post'), + ], + 'proposal-draft-attached.json': [ + proposalEdit, responseValidator(breg, `${proposalPath}/attachments/supporting-document`, 'patch'), + ], + 'proposal-draft-revised.json': [responseValidator(breg, `${proposalPath}/revise`, 'post')], + 'proposal-submitted.json': [proposalSubmit], + 'proposal-cancelled.json': [responseValidator(breg, `${proposalPath}/cancel`, 'post')], + 'proposal-applied.json': [proposalApply], +} const document = responseValidator(documents, '/v1/documents/{documentId}') const documentResponses: Record> = { 'document-ready.json': document, @@ -42,11 +60,13 @@ const documentResponses: Record> = for (const name of readdirSync(new URL('./fixtures/tasks/', import.meta.url)).filter(name => name.endsWith('.json')).sort()) { test(`task response fixture ${name} matches its generated OpenAPI schema`, () => { - const validate = name.startsWith('proposal-list') ? proposalPage : - name.startsWith('proposal-') ? proposal : documentResponses[name] - assert.ok(validate, `missing response schema for ${name}`) + const validators = name.startsWith('proposal-list') ? [proposalPage] : + name.startsWith('proposal-') ? [proposal, ...(proposalCommands[name] ?? [])] : [documentResponses[name]] const fixture = readJson(`./fixtures/tasks/${name}`) - assert.ok(validate(fixture), JSON.stringify(validate.errors)) + for (const validate of validators) { + assert.ok(validate, `missing response schema for ${name}`) + assert.ok(validate(fixture), JSON.stringify(validate.errors)) + } if (name.startsWith('proposal-')) { const response = fixture as { status?: string; items?: { status?: string }[] } for (const item of response.items ?? [response]) { @@ -55,3 +75,46 @@ for (const name of readdirSync(new URL('./fixtures/tasks/', import.meta.url)).fi } }) } + +test('only an authorised Proposal read can return the paired application actor fields', () => { + const applied = readJson('./fixtures/tasks/proposal-applied.json') as { application: Record } + const disclosed = { + ...applied, + application: { + ...applied.application, + appliedAt: '2026-11-27T13:00:00Z', + appliedBy: `hmac-sha256:${'1'.repeat(64)}`, + }, + } + assert.ok(proposal(disclosed), JSON.stringify(proposal.errors)) + assert.equal(proposalApply(disclosed), false) + assert.ok(proposalApply.errors?.some(error => error.instancePath === '/application' + && error.keyword === 'additionalProperties')) +}) + +test('current Proposal fixtures match the served lifecycle and link revisions', () => { + for (const [file, status, turn, applicationState, recovery] of [ + ['draft', 'draft', 'party', undefined, undefined], + ['submitted', 'in-review', 'official', 'awaiting-review', undefined], + ['sent-back', 'awaiting-party', 'party', 'awaiting-review', undefined], + ['approved', 'approved', 'official', 'pending', undefined], + ['application-refused', 'awaiting-party', 'party', 'blocked', 'rebase'], + ['applied', 'applied', 'nobody', 'applied', undefined], + ]) { + const doc = readJson(`./fixtures/tasks/proposal-${file}.json`) as { + status: string + turn: string + revision: number + effectDigest?: string + applicationStatus?: { state: string; recovery?: string } + links: Record + attachments?: Record }> + } + assert.deepEqual([doc.status, doc.turn, doc.applicationStatus?.state, doc.applicationStatus?.recovery], + [status, turn, applicationState, recovery], file) + if (applicationState) assert.match(doc.effectDigest ?? '', /^sha256:[0-9a-f]{64}$/u) + const links = [...Object.values(doc.links), + ...Object.values(doc.attachments ?? {}).flatMap(slot => Object.values(slot.links))] + for (const link of links) assert.equal(link.availability.observedRevision, doc.revision, file) + } +}) diff --git a/clients/typescript/tests/tasks-screens.test.ts b/clients/typescript/tests/tasks-screens.test.ts index e2ad198ad7..0905cd91ac 100644 --- a/clients/typescript/tests/tasks-screens.test.ts +++ b/clients/typescript/tests/tasks-screens.test.ts @@ -107,7 +107,7 @@ test('a replaced table reaches every can.* message, as the same table reaches de assert.equal(p.can.edit.available, false) for (const [name, view] of Object.entries(p.can)) assert.match(view.message, /^Replaced /u, `${name}: ${view.message}`) const served = fixture('proposal-draft') - assert.equal(proposalFromServed(served, { clientSentences }).can.submit.message, 'Replaced available.') + assert.equal(proposalFromServed(served, { clientSentences }).can.submit.message, 'Replaced attachment-required.') const changed = { ...served, blockedReason: 'package-changed' as const } assert.equal(proposalFromServed(changed, { clientSentences }).can.rebase.message, 'Replaced rebase.') assert.notEqual(proposalFromServed(changed).can.rebase.message, 'Replaced rebase.') @@ -119,10 +119,16 @@ test('a replaced table reaches every can.* message, as the same table reaches de test('proposalCommands takes the table, so what it reads and what describeError shows agree', async () => { const doc = fixture('proposal-draft') - const commands = proposalCommands({ call: async () => ({ data: doc }) }, { accessProfile: 'facility-correction-author', clientSentences: { available: 'Oui.' } }) + const commands = proposalCommands({ call: async () => ({ data: doc }) }, { + accessProfile: 'facility-correction-author', + clientSentences: { 'attachment-required': 'Oui.' }, + }) const p = await commands.get(doc.id) assert.equal(p.can.submit.message, 'Oui.') - const { items } = await proposalCommands({ call: async () => ({ data: { items: [doc] } }) }, { accessProfile: 'x', clientSentences: { available: 'Oui.' } }).list() + const { items } = await proposalCommands({ call: async () => ({ data: { items: [doc] } }) }, { + accessProfile: 'x', + clientSentences: { 'attachment-required': 'Oui.' }, + }).list() assert.equal(items[0]!.can.submit.message, 'Oui.') }) diff --git a/crates/registry-breg/src/data.rs b/crates/registry-breg/src/data.rs index e8003c87da..5bede4a540 100644 --- a/crates/registry-breg/src/data.rs +++ b/crates/registry-breg/src/data.rs @@ -365,6 +365,8 @@ pub enum DataError { InvalidInput, #[error("data item is invalid")] InvalidItem, + #[error("replace recordIdentifier with recordId in the patch item")] + RetiredRecordIdentifier, #[error("one data item exceeds the compiled batch byte bound")] ItemTooLarge, #[error("data checkpoint does not match the active binding")] @@ -665,6 +667,9 @@ fn validate_item( validate_create_data(entity, profile_id, data)?; } DataImportOperation::Patch => { + if object.contains_key("recordIdentifier") { + return Err(DataError::RetiredRecordIdentifier); + } require_exact_keys(object, &["operation", "recordId", "ifMatch", "patch"])?; if object.get("operation").and_then(Value::as_str) != Some("patch") || !object diff --git a/crates/registry-breg/tests/data_operations.rs b/crates/registry-breg/tests/data_operations.rs index 3b217e3d10..68f2c07ebb 100644 --- a/crates/registry-breg/tests/data_operations.rs +++ b/crates/registry-breg/tests/data_operations.rs @@ -441,7 +441,22 @@ fn data_lifecycle_uses_exact_compiled_api_names() { PROFILE, retired_patch, ), - Err(DataError::InvalidItem) + Err(DataError::RetiredRecordIdentifier) + ); + + let mixed_patch = b"{\"operation\":\"patch\",\"recordId\":\"018f06d6-0248-7c7f-8a7e-df9dfbd83d2c\",\"recordIdentifier\":\"retired-value-canary\",\"ifMatch\":\"\\\"breg-revision\\\"\",\"patch\":[{\"op\":\"replace\",\"path\":\"/data/publicCode\",\"value\":\"BB\"}]}\n"; + let failure = DataImportPlan::from_jsonl( + ®istry, + ENTITY, + DataImportOperation::Patch, + PROFILE, + mixed_patch, + ) + .expect_err("a retired key is refused even when the current key is supplied"); + assert_eq!(failure, DataError::RetiredRecordIdentifier); + assert_eq!( + failure.to_string(), + "replace recordIdentifier with recordId in the patch item" ); let export = DataExportPlan::from_compiled(®istry, ENTITY, PROFILE, ["publicCode"]) diff --git a/crates/registry-bregctl/src/lib.rs b/crates/registry-bregctl/src/lib.rs index 064bcde286..b56987c5f6 100644 --- a/crates/registry-bregctl/src/lib.rs +++ b/crates/registry-bregctl/src/lib.rs @@ -6419,6 +6419,13 @@ fn data_lifecycle_failure( DiagnosticArtifact::DataOperation, SuggestedAction::CorrectDataInput, ), + DataLifecycleError::Data(DataError::RetiredRecordIdentifier) => ( + format!("{prefix}.item.refused"), + "input", + "replace recordIdentifier with recordId in the patch item", + DiagnosticArtifact::DataOperation, + SuggestedAction::CorrectDataInput, + ), DataLifecycleError::Data(DataError::InvalidBinding) => ( format!("{prefix}.binding.refused"), "data", @@ -17921,6 +17928,23 @@ mod tests { } } + #[test] + fn a_retired_import_record_key_names_its_replacement() { + let report = serde_json::to_value(data_lifecycle_failure( + "data import", + "data.import", + DataLifecycleError::Data(DataError::RetiredRecordIdentifier), + )) + .expect("the failure report serializes"); + let diagnostic = &report["diagnostics"][0]; + assert_eq!(diagnostic["code"], "data.import.item.refused"); + assert_eq!(diagnostic["path"], "input"); + assert_eq!( + diagnostic["message"], + "replace recordIdentifier with recordId in the patch item" + ); + } + #[test] fn a_half_reserved_export_pair_names_the_file_that_is_missing() { let checkpoint = serde_json::to_value(data_lifecycle_failure( diff --git a/products/platform/CONFIG-CONVENTIONS.md b/products/platform/CONFIG-CONVENTIONS.md index c2b8f02f4d..9c6beaa095 100644 --- a/products/platform/CONFIG-CONVENTIONS.md +++ b/products/platform/CONFIG-CONVENTIONS.md @@ -447,6 +447,8 @@ here is added to the list in the same change that first uses it. See CFG-QTY. | Largest accepted body or file | `maximumBytes` | `maxBytes`, `maxSize` outside `pool` | | Outbound hook destination bindings, one entry per destination id | `destinations.hooks` | `eventDestinations` | | Named record lookup declaration and reference in BReg and Evidence | `lookups`, `lookup` | `selectorProfiles`, `selectorProfile` | +| Identifier of one Registry Record | `recordId` | `recordIdentifier` | +| Identifiers of several Registry Records | `recordIds` | `recordIdentifiers` | | Named grants that admit verified callers and bound what they can do | `accessProfiles` | `authentication.policies` | | Current and optional previous HMAC-SHA256 signing key references for a shared URL hook destination | `hmacSha256KeyRef`, `previousHmacSha256KeyRef` | | | What a caller resolved to an access profile is to the service (Casework, Documents, Messaging; `role` keeps its data sense elsewhere, so review refuses it here) | `actsAs` under an access profile | | diff --git a/products/platform/scripts/run-config-conformance.py b/products/platform/scripts/run-config-conformance.py index 3dd3867e73..dd70656c41 100644 --- a/products/platform/scripts/run-config-conformance.py +++ b/products/platform/scripts/run-config-conformance.py @@ -190,6 +190,7 @@ CORPUS = "products/platform/conformance/yaml" MARKER = "CONFORMANCE-MARKER-Q7ZK2W" +OPERATOR_WARNING_CANARY = "BREG-OPERATOR-MARKER-3H9V1Q" # The check command runs with VARIABLE set to the marker and UNSET_VARIABLE # removed, so a substitution case can name either. VARIABLE = "REGISTRY_CONFORMANCE_VALUE" @@ -197,6 +198,7 @@ BASELINE = "baseline" INTEGER_BOUNDARY_SWEEP = "integer-boundary-sweep" PASSIVE_REPORT_CASES = frozenset((BASELINE, INTEGER_BOUNDARY_SWEEP)) +BREG_WARNING_CONTROL = "BReg warning control: " TIMEOUT_SECONDS = 120 CODE = re.compile(r"^[a-z0-9]+(-[a-z0-9]+)*(\.[a-z0-9]+(-[a-z0-9]+)*)+$") @@ -1645,7 +1647,7 @@ def digest(problems: list[str]) -> str: def unmaskable(problem: str) -> bool: """A leak, a crash, a hang, or a failure of the harness: never an expected failure.""" - if problem.endswith(LEAK) or HARNESS.fullmatch(problem): + if problem.startswith(BREG_WARNING_CONTROL) or problem.endswith(LEAK) or HARNESS.fullmatch(problem): return True match = UNMASKABLE.search(problem) return match is not None and (match.group(1) is None or int(match.group(1)) > 3) @@ -2169,6 +2171,116 @@ def run_init_cell(fmt: Format, bin_dir: Path) -> list[str]: remove_tree(work) +def breg_authored_warnings(registry_file: Path) -> list[dict[str, Any]]: + """The complete reviewed finding sequence for the external-views example.""" + diagnostics = [] + for profile, record_index, record_type, field_index, line, column in ( + ("projection-refresh", 0, "licence", 0, 197, 28), + ("projection-refresh", 1, "licensed-business", 0, 201, 28), + ("staff-refresh", 0, "licence", 0, 214, 28), + ("staff-refresh", 1, "licensed-business", 0, 218, 28), + ("fixture-editor", 0, "licence", 1, 229, 44), + ("fixture-editor", 1, "licensed-business", 1, 234, 44), + ): + prefix = f"/accessProfiles/{profile}/permissions/records" + suffix = f"readableFields/{field_index}" + diagnostics.append({ + "artifact": "BRegProject", + "code": "breg.access.profile-higher-classification", + "message": "this field is more sensitive than its record type's classification; " + "verify the profile's scope and purpose before disclosing it", + "path": f"{prefix}/{record_index}/{suffix}", + "rank": "hygiene", + "scope": {"file": "registry.yaml", "path": f"{prefix}/@recordType={record_type}/{suffix}"}, + "severity": "warning", + "source": {"file": str(registry_file), "line": line, "column": column}, + "suggestedAction": "Remove the field from readableFields, or confirm that the " + "profile scopes and purposes admit only callers cleared for this classification.", + }) + return diagnostics + + +def breg_duplicate_key(file: Path, artifact: str, pointer: str, first: tuple[int, int], + second: tuple[int, int]) -> dict[str, Any]: + return { + "artifact": artifact, + "code": "yaml.duplicate-key", + "message": "the key is already defined in this mapping", + "path": pointer, + "related": [{"column": first[1], "file": str(file), "line": first[0], + "message": "the first definition", "path": pointer}], + "severity": "error", + "source": {"column": second[1], "file": str(file), "line": second[0]}, + "suggestedAction": "Keep one definition of the key.", + } + + +def check_breg_warning_answer(argv: list[str], work: Path, env: dict[str, str], phase: str, + diagnostics: list[dict[str, Any]], *, refusal: bool = False) -> list[str]: + code, stdout, stderr = run_command(argv, work, env) + if marker_problems(stdout, stderr) or any( + OPERATOR_WARNING_CANARY.encode() in stream for stream in (stdout, stderr) + ): + return [f"{BREG_WARNING_CONTROL}{phase}: captured a synthetic input canary"] + if code != int(refusal) or stderr: + return [f"{BREG_WARNING_CONTROL}{phase}: unexpected exit status or stderr"] + status = "domain-refusal" if refusal else "complete" + try: + report = json.loads(stdout) + except ValueError: + return [f"{BREG_WARNING_CONTROL}{phase}: invalid JSON report"] + expected_ok = not refusal + if (not isinstance(report, dict) or report.get("ok") is not expected_ok or report.get("status") != status + or json.dumps(report.get("diagnostics"), sort_keys=True) != json.dumps(diagnostics, sort_keys=True)): + return [f"{BREG_WARNING_CONTROL}{phase}: exact diagnostics or report status changed"] + return [] + + +def breg_warning_controls(root: Path, bin_dir: Path, env: dict[str, str]) -> list[str]: + """Prove BReg's located warning and duplicate-key diagnostics in a Unicode directory.""" + try: + authored = (root / "products/breg/examples/external-views/registry.yaml").read_bytes() + operator = load_yaml(root / "products/breg/examples/minimal/runtime.example.yaml") + operator["authentication"]["oidc"]["issuers"]["primary"]["allowedClients"] = [ + "licensing-refresh", "officer", "restricted", "staff-app", + ] + operator_text = json.dumps(operator, indent=2, ensure_ascii=False) + "\n" + member = '"maximumConnections": 4' + if operator_text.count(member) != 1: + return [f"{BREG_WARNING_CONTROL}the operator example must declare the test pool size"] + with tempfile.TemporaryDirectory(prefix="config-conformance-é-") as directory: + work = Path(directory).resolve() + project = work / "project" + project.mkdir() + registry = project / "registry.yaml" + runtime = work / "runtime.yaml" + command = [str(bin_dir / "bregctl"), "--format", "json", "check", str(project), "--posture", "production"] + env = {**env, "REGISTRY_STACK_POSTURE": "production"} + warnings = breg_authored_warnings(registry) + registry.write_bytes(authored) + problems = check_breg_warning_answer(command, work, env, "authored warning baseline", warnings) + registry.write_bytes(f"kind: {MARKER}\n".encode() + authored) + duplicate = breg_duplicate_key(registry, "BRegProject", "/kind", (1, 1), (4, 1)) + problems += check_breg_warning_answer( + command, work, env, "authored duplicate refusal", [duplicate], refusal=True, + ) + registry.write_bytes(authored) + command += ["--runtime-config", str(runtime)] + runtime.write_text(operator_text, encoding="utf-8") + problems += check_breg_warning_answer(command, work, env, "operator warning baseline", warnings) + duplicate_member = f'{member}, "maximumConnections": "{OPERATOR_WARNING_CANARY}"' + runtime.write_text(operator_text.replace(member, duplicate_member), encoding="utf-8") + duplicate = breg_duplicate_key( + runtime, "BRegRuntimeConfig", "/database/pool/maximumConnections", (22, 7), (22, 32), + ) + problems += check_breg_warning_answer( + command, work, env, "operator duplicate refusal", [*warnings, duplicate], refusal=True, + ) + return problems + except (OSError, KeyError, TypeError, ValueError, yaml.YAMLError) as error: + return [f"{BREG_WARNING_CONTROL}could not stage or run an input ({type(error).__name__})"] + + def run_cell(root: Path, fmt: Format, case: Case, bin_dir: Path) -> list[str]: """Run one case against one format; the problems found, sanitized.""" if case.run == "init": @@ -2182,6 +2294,8 @@ def run_cell(root: Path, fmt: Format, case: Case, bin_dir: Path) -> list[str]: problems = prepare_problems(fmt, staged, env, bin_dir) if problems: return [sanitize(problem, str(staged.work)) for problem in problems] + if fmt.id == "breg/project" and case.id == BASELINE: + problems = breg_warning_controls(root, bin_dir, env) text = prepare_example(staged.target.read_text(encoding="utf-8"), fmt, staged.values) for variant in mutate(text, case.mutation, fmt): if staged.target.is_symlink(): diff --git a/products/platform/scripts/test_check_config_conventions.py b/products/platform/scripts/test_check_config_conventions.py index d4d0b95a46..bd0f0b4987 100644 --- a/products/platform/scripts/test_check_config_conventions.py +++ b/products/platform/scripts/test_check_config_conventions.py @@ -970,6 +970,33 @@ def test_cfg_name_5_follows_the_convention_table(self) -> None: self.repo.run(), "CFG-NAME-5", P, at(PROJECT_SCHEMA, "/$defs/Queue/properties/deliveryWindowHours") ) + def test_cfg_name_5_record_ids_follow_the_maintained_convention(self) -> None: + report = lint.Report() + checker = lint.Lint(self.repo.root, report) + checker.convention = lint.load_convention(lint.ROOT, report) + self.assertEqual(report.errors, []) + schema = { + "type": "object", + "properties": { + "recordIdentifier": {"type": "string"}, + "recordIdentifiers": {"type": "array", "items": {"type": "string"}}, + "recordId": {"type": "string"}, + "recordIds": {"type": "array", "items": {"type": "string"}}, + }, + } + checker.schema_rules(P, None, PROJECT_SCHEMA, schema) + self.assertEqual( + { + finding.pointer: finding.fix + for finding in checker.findings.values() + if finding.rule == "CFG-NAME-5" + }, + { + "/properties/recordIdentifier": "Rename to recordId", + "/properties/recordIdentifiers": "Rename to recordIds", + }, + ) + def test_cfg_name_5_refuses_to_run_without_the_table(self) -> None: self.repo.write(CONVENTION, CONVENTION_TEXT.replace("Refused spellings (lint)", "Refused")) self.assertError(self.repo.run(), "CFG-NAME-5 table") diff --git a/products/platform/scripts/test_run_config_conformance.py b/products/platform/scripts/test_run_config_conformance.py index 51c376a8c8..d70f64e091 100644 --- a/products/platform/scripts/test_run_config_conformance.py +++ b/products/platform/scripts/test_run_config_conformance.py @@ -2200,6 +2200,71 @@ def test_a_selector_names_an_unknown_key_sweep_by_its_case(self) -> None: self.assertIn("3 cells: 3 pass", stdout) +class BregWarningControlTest(unittest.TestCase): + def test_exact_warning_and_refusal_control_rejects_an_extra_warning_or_canary(self) -> None: + for variant in ("expected", "extra warning", "stdout canary", "stderr canary"): + with self.subTest(variant=variant): + diagnostics = [{"code": "breg.access.profile-higher-classification"}] + report = {"ok": True, "status": "complete", "diagnostics": diagnostics.copy()} + if variant == "extra warning": + report["diagnostics"].append({"code": "breg.unexpected.warning"}) + if variant == "stdout canary": + report["extraReportMember"] = runner.MARKER + stdout = json.dumps(report).encode() + stderr = runner.MARKER.encode() if variant == "stderr canary" else b"" + with unittest.mock.patch.object(runner, "run_command", return_value=(0, stdout, stderr)): + problems = runner.check_breg_warning_answer( + [], Path("/work"), {}, "authored warning baseline", diagnostics + ) + self.assertEqual(bool(problems), variant != "expected") + if variant.endswith(" canary"): + self.assertEqual(problems, [ + f"{runner.BREG_WARNING_CONTROL}authored warning baseline: captured a synthetic input canary", + ]) + for problem in problems: + self.assertTrue(runner.unmaskable(problem)) + self.assertNotIn(runner.MARKER, problem) + + def test_exact_refusal_positions_require_json_integers(self) -> None: + diagnostic = runner.breg_duplicate_key(Path("/work/registry.yaml"), "BRegProject", + "/kind", (1, 1), (4, 1)) + for member, position, malformed in ( + ("source", "column", True), ("source", "line", 4.0), ("related", "line", True), + ): + with self.subTest(member=member, position=position): + different = json.loads(json.dumps(diagnostic)) + location = different["source"] if member == "source" else different["related"][0] + location[position] = malformed + report = {"ok": False, "status": "domain-refusal", "diagnostics": [different]} + with unittest.mock.patch.object(runner, "run_command", + return_value=(1, json.dumps(report).encode(), b"")): + self.assertTrue(runner.check_breg_warning_answer( + [], Path("/work"), {}, "duplicate refusal", [diagnostic], refusal=True, + )) + + def test_warning_control_preserves_unicode_paths_and_checks_each_native_call(self) -> None: + phases = [] + + def verify(argv, work, env, phase, diagnostics, *, refusal=False): + phases.append((phase, refusal, len(diagnostics))) + self.assertIn("é", str(work)) + self.assertIn(str(work / "project"), argv) + if phase == "operator duplicate refusal": + self.assertIn(runner.OPERATOR_WARNING_CANARY, (work / "runtime.yaml").read_text()) + for entry in diagnostics: + self.assertIn(str(work), entry["source"]["file"]) + return [] + + with unittest.mock.patch.object(runner, "check_breg_warning_answer", side_effect=verify): + self.assertEqual(runner.breg_warning_controls(ROOT, Path("/tools"), {}), []) + self.assertEqual(phases, [ + ("authored warning baseline", False, 6), + ("authored duplicate refusal", True, 1), + ("operator warning baseline", False, 6), + ("operator duplicate refusal", True, 7), + ]) + + class CommittedCorpusTest(unittest.TestCase): """The committed corpus, harness, and expected failures load and agree.""" diff --git a/release/scripts/check-gates-inventory.py b/release/scripts/check-gates-inventory.py index 5c59d7d835..98506e34a5 100644 --- a/release/scripts/check-gates-inventory.py +++ b/release/scripts/check-gates-inventory.py @@ -47,10 +47,6 @@ "CI classifier invocation", "python3 .github/scripts/ci_event_routing.py", ), - ( - "CI classifier tests", - "run: uv run --no-project --with PyYAML==6.0.2 python .github/scripts/test_ci_changes.py", - ), ( "CI workflow change classification", '".github/workflows/ci.yml",', diff --git a/release/scripts/test_check_gates_inventory.py b/release/scripts/test_check_gates_inventory.py index d2ab1f365c..464e85a702 100644 --- a/release/scripts/test_check_gates_inventory.py +++ b/release/scripts/test_check_gates_inventory.py @@ -2,6 +2,7 @@ from __future__ import annotations import importlib.util +import shlex import subprocess import tomllib import unittest @@ -355,9 +356,44 @@ def test_ci_classifier_and_its_tests_are_wired(self) -> None: "python3 .github/scripts/ci_event_routing.py", self.workflow, ) - self.assertIn( - "run: uv run --no-project --with PyYAML==6.0.2 python .github/scripts/test_ci_changes.py", - self.workflow, + workflow = yaml.safe_load(self.workflow) + steps = workflow["jobs"]["changes"]["steps"] + selected = [step for step in steps if self.is_classifier_test(step)] + self.assertEqual(len(selected), 1) + self.assertTrue(self.classifier_tests_are_required(workflow)) + step = selected[0] + for field, suppresses_failure in ( + ("if", "false"), ("continue-on-error", True), ("working-directory", "products/manifest"), + ): + with self.subTest(field=field): + step[field] = suppresses_failure + self.assertFalse(self.classifier_tests_are_required(workflow)) + del step[field] + steps.remove(step) + workflow["jobs"]["unrelated"] = {"steps": [step]} + self.assertFalse(self.classifier_tests_are_required(workflow)) + + @staticmethod + def is_classifier_test(step: dict) -> bool: + command = step.get("run", "").replace("\\\n", "").strip() + return "\n" not in command and shlex.split(command) == [ + "uv", "run", "--no-project", "--with", "PyYAML==6.0.2", + "python", ".github/scripts/test_ci_changes.py", + ] + + def classifier_tests_are_required(self, workflow: dict) -> bool: + changes = workflow["jobs"]["changes"] + defaults = workflow.get("defaults", {}).get("run", {}) | changes.get("defaults", {}).get("run", {}) + return ( + changes.get("continue-on-error", False) is False + and changes.get("if", "success()") in ("success()", "${{ success() }}") + and any( + self.is_classifier_test(step) + and step.get("if", "success()") in ("success()", "${{ success() }}") + and step.get("continue-on-error", False) is False + and Path(step.get("working-directory", defaults.get("working-directory", "."))) == Path(".") + for step in changes["steps"] + ) ) def test_workflow_policy_requires_every_marker_in_the_named_workflow(self) -> None: @@ -1663,21 +1699,35 @@ def test_missing_actionlint_pin_or_checksum_is_reported(self) -> None: self.assertIn(gate, self.module.missing_gates(text)) def test_structural_rust_gates_allow_equivalent_workflow_edits(self) -> None: - workflow = self.workflow - for original, equivalent in ( - ("cargo fmt --check", "cargo fmt\n '--check'"), - ("python3 .github/scripts/run_cargo_packages.py clippy", - "python3 .github/scripts/run_cargo_packages.py\n 'clippy'"), - ("python3 .github/scripts/run_cargo_packages.py test", - "python3 .github/scripts/run_cargo_packages.py\n 'test'"), - ): - step = f" run: {original}" - self.assertIn(step, workflow) - workflow = workflow.replace(step, f" run: >-\n {equivalent}", 1) - workflow = workflow.replace( - "- name: Build the rstack dev hosts\n", "- name: Build development hosts\n", 1, - ) - self.assertEqual(self.module.missing_gates(workflow), []) + compact = """jobs: + rust-quality: + steps: + - run: cargo fmt --check + - run: python3 .github/scripts/run_cargo_packages.py clippy + rust-tests: + steps: + - name: Build the rstack dev hosts + run: cargo build --locked --bins + - run: python3 .github/scripts/run_cargo_packages.py test +""" + equivalent = """jobs: + rust-quality: + steps: + - name: Verify formatting + run: >- + cargo fmt + '--check' + - run: >- + python3 .github/scripts/run_cargo_packages.py + 'clippy' + rust-tests: + steps: + - run: cargo build --locked --bins + - run: >- + python3 .github/scripts/run_cargo_packages.py + 'test' +""" + self.assertEqual(self.module.missing_gates(compact), self.module.missing_gates(equivalent)) def test_missing_platform_coverage_threshold_is_reported(self) -> None: text = self.workflow.replace("--fail-under-lines 80", "--summary-only") From 052ad64044ff4a8112a61982630c3524eeab4ea4 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 38/55] feat(breg): publish limit and cursor across record lists and clients Folds these reviewed commits: - feat(breg): admit limit and cursor for native Record lists - fix(evidence): constrain development problem diagnostics by response - fix(client): use the status-specific wallet OAuth schema - feat(breg): publish limit and cursor across record lists and clients - test(client): prove Deno follows the canonical BReg cursor - fix(breg-client): diagnose the retired ingestion patch key - fix(breg): name the retired batch patch key replacement Signed-off-by: Jeremi Joslin --- clients/typescript/README.md | 16 +-- clients/typescript/core.ts | 15 ++- clients/typescript/generate.ts | 47 +++++-- clients/typescript/generated/breg-facility.ts | 49 ++++---- clients/typescript/generated/breg-minimal.ts | 27 ++-- .../typescript/generated/evidence-oid4vp.ts | 12 +- clients/typescript/generated/evidence.ts | 6 +- clients/typescript/schema.ts | 8 +- clients/typescript/tests/breg.test.ts | 8 +- .../tests/deno/transport.deno.test.ts | 15 ++- clients/typescript/tests/list.test.ts | 7 +- clients/typescript/tests/oid4vp.test.ts | 7 ++ .../src/breg/batch.rs | 2 +- .../tests/breg_native.rs | 2 +- .../tests/breg_read_mutation.rs | 2 +- .../__test__/binding.test.js | 4 +- .../__test__/exact-json.test.js | 10 +- .../__test__/facade.test-d.ts | 6 +- .../__test__/read-cancellation.test.js | 4 +- .../__test__/read-parity.test.js | 14 +-- crates/registry-breg-client-node/client.d.ts | 10 +- crates/registry-breg-client-node/src/lib.rs | 28 ++--- .../python/registry_breg_client/__init__.pyi | 12 +- crates/registry-breg-client-py/src/lib.rs | 52 ++++---- .../tests/python/test_read_parity.py | 16 +-- crates/registry-breg-client/README.md | 2 +- .../examples/native_geojson.rs | 2 +- crates/registry-breg-client/src/geojson.rs | 15 +-- crates/registry-breg-client/src/ingestion.rs | 47 +++++-- crates/registry-breg-client/src/query.rs | 67 +++++----- crates/registry-breg-client/src/read.rs | 28 ++--- .../tests/http_boundary.rs | 18 ++- .../registry-breg-client/tests/read_parity.rs | 21 ++-- crates/registry-breg-mcp/src/gateway.rs | 2 +- .../registry-breg/src/api/external_views.rs | 6 +- crates/registry-breg/src/api/gis.rs | 12 +- crates/registry-breg/src/api/metadata.rs | 4 +- crates/registry-breg/src/api/mod.rs | 117 +++++++++++++----- crates/registry-breg/src/artifacts.rs | 7 +- crates/registry-breg/src/cursor.rs | 2 +- crates/registry-breg/src/data.rs | 4 +- .../src/external_view_artifacts.rs | 4 +- crates/registry-breg/src/fixtures.rs | 2 +- crates/registry-breg/src/query.rs | 79 +++++++++--- .../registry-breg/tests/compiler_contract.rs | 18 +-- crates/registry-breg/tests/http_auth.rs | 49 ++++++-- crates/registry-breg/tests/http_read_only.rs | 117 ++++++++---------- .../tests/postgres_client_capabilities.rs | 2 +- .../tests/postgres_client_relationships.rs | 2 +- .../postgres_record_profile_conformance.rs | 2 +- .../tests/postgres_spatial_read.rs | 2 +- crates/registry-bregctl/src/data_lifecycle.rs | 3 + crates/registry-bregctl/src/lib.rs | 4 +- .../registry-coordinator/src/read_in_force.rs | 2 +- .../tests/read_in_force_adapter.rs | 2 +- .../tests/draft13_profile.rs | 62 +++++++++- .../registry-evidence-oid4vp/src/contracts.rs | 17 ++- .../tests/responses.rs | 79 +++++++++++- crates/registry-evidence/src/contracts.rs | 63 +++++++++- .../src/public_check_tests.rs | 36 +++++- .../src/refusal_recording_tests.rs | 87 +++++++++++++ crates/registry-evidence/src/runtime_tests.rs | 15 ++- .../breg/client.d.ts | 10 +- .../content/docs/configure/breg-access.mdx | 2 +- .../docs/configure/breg-external-views.mdx | 8 +- .../content/docs/configure/breg-history.mdx | 10 +- .../docs/configure/breg-spatial-queries.mdx | 2 +- .../content/docs/configure/coordinator.mdx | 2 +- .../src/content/docs/reference/breg-api.mdx | 6 +- .../src/content/docs/reference/client-api.mdx | 6 +- .../src/content/docs/reference/errors.mdx | 4 +- .../docs/reference/typescript-clients.mdx | 14 +-- products/breg/CHANGELOG.md | 6 + .../breg/contracts/client-capabilities.json | 24 +--- .../explain/QueriesExplanation.schema.json | 4 +- .../breg/examples/external-views/journey.py | 6 +- .../examples/required-attachment/openapi.json | 2 +- .../generated/facility/generated/openapi.json | 2 +- .../generated/minimal/generated/openapi.json | 2 +- .../loadtest/external-views/scale_exercise.py | 22 ++-- products/breg/loadtest/lib/workload.js | 6 +- .../breg/loadtest/support/test_harness.py | 4 +- .../evidence/contracts/problem-contract.yaml | 2 +- .../evidence/generated/problem-v1.schema.json | 22 ++++ .../registry-evidence-oid4vp.openapi.json | 18 ++- .../generated/registry-evidence.openapi.json | 25 ++++ .../config-conventions-exceptions.yaml | 12 -- 87 files changed, 1098 insertions(+), 503 deletions(-) diff --git a/clients/typescript/README.md b/clients/typescript/README.md index 9bae833896..13bee0b3d1 100644 --- a/clients/typescript/README.md +++ b/clients/typescript/README.md @@ -29,7 +29,7 @@ import { createRegistryClient } from './service.ts' const registry = createRegistryClient({ baseUrl: '/registry' }) -const answer = await registry.facility.list('facility', { accessProfile: 'facility-reader', top: 25 }) +const answer = await registry.facility.list('facility', { accessProfile: 'facility-reader', limit: 25 }) console.log(answer.items) await registry.casework.call('describeCasework') ``` @@ -696,7 +696,7 @@ For unkeyed operations, use the route's recovery behavior. import { allPages } from './core.ts' const contacts = await allPages(cursor => client.records_contact_listPage({ - query: { accessProfile: 'directory-editor', $top: 25 }, + query: { accessProfile: 'directory-editor', limit: 25 }, }, cursor)) ``` @@ -705,7 +705,7 @@ responses to `Page { items, nextCursor }`. Use `pages(load, cap)` to iterate `allPages(load, cap)` to collect the items. Both default to 100 pages and throw `RangeError` if a cursor repeats or a continuation remains at the cap. A null or empty cursor ends iteration. Cursor values are opaque. BReg Record list follow-up requests carry only the -selected access profile and `$skiptoken` on the same route. The first +selected access profile and `cursor` on the same route. The first request carries filters and page size. Other cursor routes retain their query options. @@ -730,11 +730,11 @@ const page = await client.list('licence', { accessProfile: 'licence-officer', where: { status: ['active', 'suspended'], holderName: { startsWith: 'Dep' } }, orderBy: 'expiresOn', - top: 20, + limit: 20, count: true, }) if (page.nextCursor !== null) { - const next = await client.list('licence', { accessProfile: 'licence-officer', after: page.nextCursor }) + const next = await client.list('licence', { accessProfile: 'licence-officer', cursor: page.nextCursor }) } ``` @@ -744,7 +744,7 @@ if (page.nextCursor !== null) { matching operator in the profile. All filters hold together. - `orderBy` is one sortable property, or `'property desc'` where allowed. `select` lists selectable properties. `count` is allowed only with - `allowCount`. `top` runs from 1 to the profile's `maximumPageSize`. + `allowCount`. `limit` runs from 1 to the profile's `maximumPageSize`. - A list with several query profiles or a route that requires a profile needs either the service default or an explicit `accessProfile`. The explicit profile takes precedence. The client checks filters against the resolved profile. @@ -754,10 +754,10 @@ if (page.nextCursor !== null) { the resolved profile before it sends anything. A refusal is a `TypeError` naming the property and profile, never a filter value. - The answer is `{ items, nextCursor }`, plus `count` when the answer carries - it. A null cursor ends the list. With `after`, keep the same access profile. + it. A null cursor ends the list. With `cursor`, keep the same access profile. If the first page used the default, omit `accessProfile` again. If it named a profile, repeat that profile. - The client refuses `where`, `orderBy`, `select`, `count` and `top` alongside `after`, + The client refuses `where`, `orderBy`, `select`, `count` and `limit` alongside `cursor`, because the cursor carries them. The continuation sends only the access profile and the cursor. - Sub-collection lists use `call` by operation ID or their generated page method. diff --git a/clients/typescript/core.ts b/clients/typescript/core.ts index a27ed2145e..46459f18cb 100644 --- a/clients/typescript/core.ts +++ b/clients/typescript/core.ts @@ -895,6 +895,7 @@ export interface ListRequest extends CallOptions { orderBy?: string select?: readonly string[] count?: boolean + limit?: number top?: number } @@ -1001,11 +1002,17 @@ export function listQuery(rules: ListRules, options: ListRequest, cursor?: strin if (new Set(options.select).size !== options.select.length) throw new TypeError('`select` names a property twice') query.$select = options.select.join(',') } - if (options.top !== undefined) { - if (!Number.isSafeInteger(options.top) || options.top < 1 || options.top > profile.maximumPageSize) { - throw new TypeError('`top` must be a whole number from 1 to ' + profile.maximumPageSize + under) + const sizeOption = rules.paginationParameters?.size ?? 'top' + const retiredSizeOption = sizeOption === 'limit' ? 'top' : 'limit' + if (options[retiredSizeOption] !== undefined) { + throw new TypeError('This list takes `' + sizeOption + '` for page size') + } + const pageSize = options[sizeOption] + if (pageSize !== undefined) { + if (!Number.isSafeInteger(pageSize) || pageSize < 1 || pageSize > profile.maximumPageSize) { + throw new TypeError('`' + sizeOption + '` must be a whole number from 1 to ' + profile.maximumPageSize + under) } - query[rules.paginationParameters?.size ?? '$top'] = options.top + query[rules.paginationParameters?.size ?? '$top'] = pageSize } if (options.count !== undefined) { if (typeof options.count !== 'boolean') throw new TypeError('`count` must be true or false') diff --git a/clients/typescript/generate.ts b/clients/typescript/generate.ts index ba0d9155fc..43965b7009 100644 --- a/clients/typescript/generate.ts +++ b/clients/typescript/generate.ts @@ -747,7 +747,10 @@ export function generate(source: string, settings: Settings = {}): string { if (spec.schema !== undefined) { audit(spec.schema, schemaAt) if (media === 'application/problem+json' && !discoveryProblems) validationRoots.add(schemaAt) - if (media === 'application/json' && spec.schema.$ref === '#/components/schemas/OAuthError') { + if (media === 'application/json' && ( + spec.schema.$ref === '#/components/schemas/OAuthError' + || spec.schema.$ref === '#/components/schemas/OAuthRateLimit' + )) { validationRoots.add(schemaAt) definition.oauthErrors ??= {} definition.oauthErrors[status] = schemaAt @@ -823,7 +826,8 @@ export function generate(source: string, settings: Settings = {}): string { : 'options: Operations[' + quote(id) + ']["input"] = {}, cursor?: string' // A BReg cursor carries the query, so a continuation sends only the access profile, // where the route takes one, and the cursor. - const cursorOnly = cursorName === '$skiptoken' || (breg && operation['x-registry-queryKind'] === 'list') + const cursorOnly = cursorName === '$skiptoken' + || (breg && (path.startsWith('/v1/records/') || path.startsWith('/v1/external-views/'))) const query = !cursorOnly ? '{ ...options.query, cursor }' : '{ ' + (parameterMap.has('query:accessProfile') ? 'accessProfile: options.query?.accessProfile, ' : '') + quote(cursorName) + ': cursor }' @@ -843,6 +847,8 @@ export function generate(source: string, settings: Settings = {}): string { if (!profileParameter && listProfiles.length > 1) fail(pointer, 'several query profiles need an accessProfile parameter') const requiresAccessProfile = profileParameter?.required === true const row = 'ListRows[' + quote(recordType) + ']' + const sizeOption = limitAndCursor ? 'limit' : 'top' + const cursorOption = limitAndCursor ? 'cursor' : 'after' const value = (property: string) => 'FieldValue<' + row + ', ' + quote(property) + '>' const alternatives = listProfiles.map(entry => { const filters = entry.filterable.map(filter => quote(filter.property) + '?: Filter<' + value(filter.property) + ', ' + @@ -860,10 +866,10 @@ export function generate(source: string, settings: Settings = {}): string { 'orderBy?: ' + (order.length ? order.join(' | ') : 'never'), 'select?: ' + (entry.selectable.length ? 'ReadonlyArray<' + entry.selectable.map(name => quote(name)).join(' | ') + '>' : 'never'), 'count?: ' + (entry.allowCount ? 'boolean' : 'never'), - 'top?: number', + sizeOption + '?: number', ] - const first = fields.join('; ') + '; after?: never' - const next = fields[0] + '; after: string; where?: never; orderBy?: never; select?: never; count?: never; top?: never' + const first = fields.join('; ') + '; ' + cursorOption + '?: never' + const next = fields[0] + '; ' + cursorOption + ': string; where?: never; orderBy?: never; select?: never; count?: never; ' + sizeOption + '?: never' return '(CallOptions & { ' + first + ' }) | (CallOptions & { ' + next + ' })' }) listTypes.push(' ' + quote(recordType) + ': ' + alternatives.join(' | ')) @@ -1023,6 +1029,7 @@ export function generate(source: string, settings: Settings = {}): string { } const compiledRules = [...validationRoots].sort().map(pointer => [pointer, compileRule(pointer)] as const) const sourceHash = createHash('sha256').update(source).digest('hex') + const canonicalListOptions = Object.values(listRules).some(rule => rule.paginationParameters) return [ generatedVersionComment, '// Source SHA-256 ' + sourceHash, @@ -1108,7 +1115,7 @@ export function generate(source: string, settings: Settings = {}): string { (discoveryProblems ? 'problemValidators: { default: discoveryProblem }' : 'problemValidators: Object.fromEntries(Object.entries(definition.problems ?? {}).map(([status, rule]) => [status, validator(rules, rules[rule])]))') + - (schemas.OAuthError ? ', oauthErrorValidators: Object.fromEntries(Object.entries(definition.oauthErrors ?? {}).map(([status, rule]) => [status, validator(rules, rules[rule])]))' : '') + ' }', + (schemas.OAuthError ? ', oauthErrorValidators: Object.fromEntries(Object.entries(definition.oauthErrors ?? {}).map(([status, rule]) => [status, validator(rules, rules[rule], true)]))' : '') + ' }', '}', '', 'export class Client {', @@ -1129,15 +1136,29 @@ export function generate(source: string, settings: Settings = {}): string { ...pageMethods, ...(listTypes.length ? [ ' list(recordType: K, ...args: {} extends ListOptions[K] ? [options?: ListOptions[K]] : [options: ListOptions[K]]): Promise>>', - ' async list(recordType: string, options: ListRequest & { after?: string } = {}): Promise>> {', + ' async list(recordType: string, options: ListRequest & { after?: string' + + (canonicalListOptions ? '; cursor?: string' : '') + + ' } = {}): Promise>> {', ' const rules = Object.hasOwn(listRules, recordType) ? listRules[recordType] : undefined', ' if (!rules) throw new TypeError("Unknown record type for list")', - ' const { accessProfile, where, orderBy, select, count, top, after, ...call } = options', - ' if (after !== undefined && [where, orderBy, select, count, top].some(value => value !== undefined)) {', - ' throw new TypeError("Use after without where, orderBy, select, count or top.")', - ' }', - ' if (after !== undefined && (typeof after !== "string" || !after)) throw new TypeError("Use a nonempty cursor for after.")', - ' const query = listQuery(rules, options, after, this.#transport.profile)', + ...(canonicalListOptions ? [ + ' const { accessProfile, where, orderBy, select, count, top, limit, after, cursor, ...call } = options', + ' const continuationName = rules.paginationParameters ? "cursor" : "after"', + ' const continuation = rules.paginationParameters ? cursor : after', + ' if ((rules.paginationParameters ? after : cursor) !== undefined) throw new TypeError("Use " + continuationName + " for continuation.")', + ' if (continuation !== undefined && [where, orderBy, select, count, top, limit].some(value => value !== undefined)) {', + ' throw new TypeError("Use " + continuationName + " without first-page query options.")', + ' }', + ' if (continuation !== undefined && (typeof continuation !== "string" || !continuation)) throw new TypeError("Use a nonempty " + continuationName + ".")', + ' const query = listQuery(rules, options, continuation, this.#transport.profile)', + ] : [ + ' const { accessProfile, where, orderBy, select, count, top, after, ...call } = options', + ' if (after !== undefined && [where, orderBy, select, count, top].some(value => value !== undefined)) {', + ' throw new TypeError("Use after without where, orderBy, select, count or top.")', + ' }', + ' if (after !== undefined && (typeof after !== "string" || !after)) throw new TypeError("Use a nonempty cursor for after.")', + ' const query = listQuery(rules, options, after, this.#transport.profile)', + ]), ' const { data } = await this.#call<{ items: RecordEnvelope[]; pageInfo: { nextCursor?: string | null }; count?: number }>(rules.operation, { ...call, query })', ' const page = listPage(data)', ' return { ...page, items: page.items.map(recordRow) }', diff --git a/clients/typescript/generated/breg-facility.ts b/clients/typescript/generated/breg-facility.ts index 76ce4edc69..0ec11fb015 100644 --- a/clients/typescript/generated/breg-facility.ts +++ b/clients/typescript/generated/breg-facility.ts @@ -1,5 +1,5 @@ // Generated for Stack version 0.50.0, client version 0.50.0. -// Source SHA-256 6485fa087e38e5eb1ae48b534c45883ee2ed231b4c62c8a8f6004ebfb5b300e7 +// Source SHA-256 a29f66c2bbff96fab6003672e8e13f9a958c6ed04ebd6c55a6c5bb762b472187 // Unconstrained JSON /paths/~1v1~1records~1directory-entries~1{record_id}/patch/requestBody/content/application~1json-patch+json/schema/items/properties/value // Unconstrained JSON /paths/~1v1~1records~1operators~1{record_id}/patch/requestBody/content/application~1json-patch+json/schema/items/properties/value import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" @@ -48,16 +48,16 @@ export interface Operations { "proposals.revise": { input: CallOptions & { path: { "proposal_id": (string) } } & { query?: { "accessProfile"?: "facility-correction-author" } } & { headers: { "If-Match": (string) } } & ({ body: (({ "input": ({ "addressLine"?: (string); "city"?: (string); "facilityId"?: (string); "postalCode"?: (string) }) }) | ({ "input": ({ "facilityId"?: (string) }) }) | (Record)) }) & { accept?: "application/json" | "*/*" }; required: true; output: ({ "actionId": (string); "actionRevision": (string); "application"?: ({ "applicationId": (string); "effectDigest": (string); "resultLinks": (Array<({ "recordId": (string); "recordType": (string); "revision": (number) })>); "submissionVersion": (number) }); "applicationStatus"?: ({ "automaticRetry"?: ({ "attempts": (number); "maximumAttempts": (number); "scheduled": (boolean) }); "mode": ("automatic" | "manual"); "reason"?: ("package-changed" | "dependency-outage" | "lease-expired" | "application-refused" | "attempts-exhausted"); "recovery"?: ("retry" | "rebase" | "revise" | "correct-input"); "state": ("awaiting-review" | "pending" | "applying" | "blocked" | "applied" | "cancelled" | "rejected") }); "asks"?: (Array<({ "answer"?: ({ "additions": (Array<(string)>); "answeredAt": (string); "text"?: (string) }); "askedAt": (string); "dueAt"?: (string); "id": (string); "links": ({ "answer"?: ({ "accessProfile": (string); "availability": ({ "available": (boolean); "observedRevision": (number); "reason"?: ("pending-review" | "review-rejected" | "review-changes-requested" | "review-ended" | "stale-revision" | "package-changed" | "dependency-outage" | "invalid-input" | "already-applied" | "limit-reached" | "application-pending" | "attachment-required" | "attachment-pending" | "ask-answered" | "ask-closed" | "ask-due-passed"); "recovery"?: ("refresh" | "revise" | "retry" | "rebase" | "correct-input" | "receipt-only") }); "ifMatch": (string); "method": "POST"; "operation": "answer"; "path": (string) }) }); "state": ("open" | "answered" | "expired" | "closed"); "text": (string); "wants": (Array<({ "kind": ("answer" | "document") })>) })>); "attachments"?: (Record); "id": (string); "links": (Record); "maximumBytes": (number); "required": (boolean); "value"?: ({ "byteSize": (number); "contentType": (string); "sha256": (string); "submissionVersion": (number); "uploadedAt"?: (string); "verificationStatus": ("notRequired" | "pending" | "approved" | "rejected") }) })>); "blockedReason"?: ("package-changed"); "createdAt"?: (string); "decision"?: ({ "decidedAt": (string); "publicReason"?: (string); "status": ("approved" | "rejected" | "changes-requested" | "answered") }); "effectDigest"?: (string); "handoffRefusal"?: ({ "code": ("review.initiator-required" | "review.initiator-excluded" | "review.policy-mismatch" | "review.refused") }); "id": (string); "input"?: (Record); "links": (Record); "revision": (number); "state": ("draft" | "submitted" | "applied" | "cancelled" | "rejected"); "status"?: ("draft" | "awaiting-party" | "in-review" | "approved" | "processing" | "applied" | "rejected" | "cancelled"); "submissionVersion": (number); "title"?: (string); "turn": ("party" | "official" | "nobody") }) } "proposals.get-submission": { input: CallOptions & { path: { "proposal_id": (string); "submission_version": (number) } } & { query?: { "accessProfile"?: "facility-correction-applier" | "facility-correction-author" } } & { accept?: "application/json" | "*/*" }; required: true; output: ({ "actionId": (string); "application": (({ "applicationId": (string); "appliedAt"?: (string); "appliedBy"?: (string); "state": "applied" }) | ({ "automaticRetry"?: ({ "attempts": (number); "maximumAttempts": (number); "scheduled": (boolean) }); "mode": ("automatic" | "manual"); "reason"?: ("package-changed" | "dependency-outage" | "lease-expired" | "application-refused" | "attempts-exhausted"); "recovery"?: ("retry" | "rebase" | "revise" | "correct-input"); "state": ("awaiting-review" | "pending" | "applying" | "blocked" | "cancelled" | "rejected") }) | (null)); "current": (boolean); "decision"?: ({ "decidedAt": (string); "publicReason"?: (string); "status": ("approved" | "rejected" | "changes-requested" | "answered") }); "effectDigest": (string); "handoffRefusal"?: ({ "code": ("review.initiator-required" | "review.initiator-excluded" | "review.policy-mismatch" | "review.refused") }); "id": (string); "review": (({ "availableUntil"?: (string); "completedAt"?: (string); "resultId"?: (string); "state": ("pending" | "approved" | "rejected" | "changes-requested" | "answered" | "cancelled" | "superseded" | "expired") }) | (null)); "submissionVersion": (number) }) } "proposals.submit": { input: CallOptions & { path: { "proposal_id": (string) } } & { query?: { "accessProfile"?: "facility-correction-author" } } & { headers: { "If-Match": (string) } } & ({ body: (Record) }) & { accept?: "application/json" | "*/*" }; required: true; output: ({ "actionId": (string); "actionRevision": (string); "application"?: ({ "applicationId": (string); "effectDigest": (string); "resultLinks": (Array<({ "recordId": (string); "recordType": (string); "revision": (number) })>); "submissionVersion": (number) }); "applicationStatus"?: ({ "automaticRetry"?: ({ "attempts": (number); "maximumAttempts": (number); "scheduled": (boolean) }); "mode": ("automatic" | "manual"); "reason"?: ("package-changed" | "dependency-outage" | "lease-expired" | "application-refused" | "attempts-exhausted"); "recovery"?: ("retry" | "rebase" | "revise" | "correct-input"); "state": ("awaiting-review" | "pending" | "applying" | "blocked" | "applied" | "cancelled" | "rejected") }); "asks"?: (Array<({ "answer"?: ({ "additions": (Array<(string)>); "answeredAt": (string); "text"?: (string) }); "askedAt": (string); "dueAt"?: (string); "id": (string); "links": ({ "answer"?: ({ "accessProfile": (string); "availability": ({ "available": (boolean); "observedRevision": (number); "reason"?: ("pending-review" | "review-rejected" | "review-changes-requested" | "review-ended" | "stale-revision" | "package-changed" | "dependency-outage" | "invalid-input" | "already-applied" | "limit-reached" | "application-pending" | "attachment-required" | "attachment-pending" | "ask-answered" | "ask-closed" | "ask-due-passed"); "recovery"?: ("refresh" | "revise" | "retry" | "rebase" | "correct-input" | "receipt-only") }); "ifMatch": (string); "method": "POST"; "operation": "answer"; "path": (string) }) }); "state": ("open" | "answered" | "expired" | "closed"); "text": (string); "wants": (Array<({ "kind": ("answer" | "document") })>) })>); "attachments"?: (Record); "id": (string); "links": (Record); "maximumBytes": (number); "required": (boolean); "value"?: ({ "byteSize": (number); "contentType": (string); "sha256": (string); "submissionVersion": (number); "uploadedAt"?: (string); "verificationStatus": ("notRequired" | "pending" | "approved" | "rejected") }) })>); "blockedReason"?: ("package-changed"); "createdAt"?: (string); "decision"?: ({ "decidedAt": (string); "publicReason"?: (string); "status": ("approved" | "rejected" | "changes-requested" | "answered") }); "effectDigest"?: (string); "handoffRefusal"?: ({ "code": ("review.initiator-required" | "review.initiator-excluded" | "review.policy-mismatch" | "review.refused") }); "id": (string); "input"?: (Record); "links": (Record); "revision": (number); "state": ("draft" | "submitted" | "applied" | "cancelled" | "rejected"); "status"?: ("draft" | "awaiting-party" | "in-review" | "approved" | "processing" | "applied" | "rejected" | "cancelled"); "submissionVersion": (number); "title"?: (string); "turn": ("party" | "official" | "nobody") }) } - "records.directory-entry.list": { input: CallOptions & { query?: { "accessProfile"?: "directory-editor"; "$select"?: (string); "$filter"?: (string); "$orderby"?: (string); "$top"?: (number); "$count"?: (boolean); "$skiptoken"?: (string) } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: false; output: ({ "count"?: (number); "items": (Array<({ "domainData": ({ "email"?: (string); "jurisdiction"?: (string); "name"?: (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "directory-entry"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "count"?: (number); "items": (Array<({ "domainData": ({ "email"?: (string); "jurisdiction"?: (string); "name"?: (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "directory-entry"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) } + "records.directory-entry.list": { input: CallOptions & { query?: { "accessProfile"?: "directory-editor"; "$select"?: (string); "$filter"?: (string); "$orderby"?: (string); "limit"?: (number); "$count"?: (boolean); "cursor"?: (string) } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: false; output: ({ "count"?: (number); "items": (Array<({ "domainData": ({ "email"?: (string); "jurisdiction"?: (string); "name"?: (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "directory-entry"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "count"?: (number); "items": (Array<({ "domainData": ({ "email"?: (string); "jurisdiction"?: (string); "name"?: (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "directory-entry"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) } "records.directory-entry.create": { input: CallOptions & { query?: { "accessProfile"?: "directory-editor" } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & ({ body: ({ "data": Schema_directory_entry_create_input }) }) & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: true; output: ({ "data": ({ "domainData": Schema_directory_entry; "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "directory-entry"; "registryId": "facility-registry" }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "data": ({ "domainData": Schema_directory_entry; "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "directory-entry"; "registryId": "facility-registry" }) }) } "records.directory-entry.get": { input: CallOptions & { path: { "record_id": (string) } } & { query?: { "accessProfile"?: "directory-editor"; "$select"?: (string) } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: true; output: ({ "data": ({ "domainData": ({ "email"?: (string); "jurisdiction"?: (string); "name"?: (string) }); "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "directory-entry"; "registryId": "facility-registry" }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "data": ({ "domainData": ({ "email"?: (string); "jurisdiction"?: (string); "name"?: (string) }); "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "directory-entry"; "registryId": "facility-registry" }) }) } "records.directory-entry.patch": { input: CallOptions & { path: { "record_id": (string) } } & { query?: { "accessProfile"?: "directory-editor" } } & { headers: { "traceparent"?: (string); "If-Match": (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & ({ body: (Array<({ "op": ("add" | "replace" | "remove" | "test") & (string); "path": (string); "value"?: JsonValue })>) }) & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: true; output: ({ "data": ({ "domainData": Schema_directory_entry; "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "directory-entry"; "registryId": "facility-registry" }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "data": ({ "domainData": Schema_directory_entry; "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "directory-entry"; "registryId": "facility-registry" }) }) } - "records.facility.list": { input: CallOptions & { query?: { "accessProfile"?: "facility-reader"; "$select"?: (string); "$filter"?: (string); "$orderby"?: (string); "$top"?: (number); "$count"?: (boolean); "$skiptoken"?: (string) } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: false; output: ({ "count"?: (number); "items": (Array<({ "domainData": ({ "addressLine"?: (string); "city"?: (string); "facilityCode"?: (string); "jurisdiction"?: (string); "name"?: (string); "postalCode"?: (string); "status"?: ("active" | "inactive") & (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "facility"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "count"?: (number); "items": (Array<({ "domainData": ({ "addressLine"?: (string); "city"?: (string); "facilityCode"?: (string); "jurisdiction"?: (string); "name"?: (string); "postalCode"?: (string); "status"?: ("active" | "inactive") & (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "facility"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) } + "records.facility.list": { input: CallOptions & { query?: { "accessProfile"?: "facility-reader"; "$select"?: (string); "$filter"?: (string); "$orderby"?: (string); "limit"?: (number); "$count"?: (boolean); "cursor"?: (string) } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: false; output: ({ "count"?: (number); "items": (Array<({ "domainData": ({ "addressLine"?: (string); "city"?: (string); "facilityCode"?: (string); "jurisdiction"?: (string); "name"?: (string); "postalCode"?: (string); "status"?: ("active" | "inactive") & (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "facility"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "count"?: (number); "items": (Array<({ "domainData": ({ "addressLine"?: (string); "city"?: (string); "facilityCode"?: (string); "jurisdiction"?: (string); "name"?: (string); "postalCode"?: (string); "status"?: ("active" | "inactive") & (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "facility"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) } "records.facility.get": { input: CallOptions & { path: { "record_id": (string) } } & { query?: { "accessProfile"?: "facility-reader" | "proposal-reviewer"; "$select"?: (string) } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: true; output: ({ "data": ({ "domainData": ({ "addressLine"?: (string); "city"?: (string); "facilityCode"?: (string); "jurisdiction"?: (string); "name"?: (string); "postalCode"?: (string); "status"?: ("active" | "inactive") & (string) }); "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "facility"; "registryId": "facility-registry" }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "data": ({ "domainData": ({ "addressLine"?: (string); "city"?: (string); "facilityCode"?: (string); "jurisdiction"?: (string); "name"?: (string); "postalCode"?: (string); "status"?: ("active" | "inactive") & (string) }); "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "facility"; "registryId": "facility-registry" }) }) } - "records.facility.path.operators": { input: CallOptions & { path: { "record_id": (string) } } & { query?: { "accessProfile"?: "facility-reader"; "$select"?: (string); "$filter"?: (string); "$orderby"?: (string); "$top"?: (number); "$count"?: (boolean); "$skiptoken"?: (string) } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: true; output: ({ "count"?: (number); "items": (Array<({ "domainData": ({ "jurisdiction"?: (string); "operatorCode"?: (string); "status"?: ("active" | "inactive") & (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "operator"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "count"?: (number); "items": (Array<({ "domainData": ({ "jurisdiction"?: (string); "operatorCode"?: (string); "status"?: ("active" | "inactive") & (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "operator"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) } - "records.facility-assignment.list": { input: CallOptions & { query?: { "accessProfile"?: "facility-reader"; "$select"?: (string); "$filter"?: (string); "$orderby"?: (string); "$top"?: (number); "$count"?: (boolean); "$skiptoken"?: (string) } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: false; output: ({ "count"?: (number); "items": (Array<({ "domainData": ({ "facility"?: (string); "jurisdiction"?: (string); "operator"?: (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "facility-assignment"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "count"?: (number); "items": (Array<({ "domainData": ({ "facility"?: (string); "jurisdiction"?: (string); "operator"?: (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "facility-assignment"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) } + "records.facility.path.operators": { input: CallOptions & { path: { "record_id": (string) } } & { query?: { "accessProfile"?: "facility-reader"; "$select"?: (string); "$filter"?: (string); "$orderby"?: (string); "limit"?: (number); "$count"?: (boolean); "cursor"?: (string) } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: true; output: ({ "count"?: (number); "items": (Array<({ "domainData": ({ "jurisdiction"?: (string); "operatorCode"?: (string); "status"?: ("active" | "inactive") & (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "operator"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "count"?: (number); "items": (Array<({ "domainData": ({ "jurisdiction"?: (string); "operatorCode"?: (string); "status"?: ("active" | "inactive") & (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "operator"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) } + "records.facility-assignment.list": { input: CallOptions & { query?: { "accessProfile"?: "facility-reader"; "$select"?: (string); "$filter"?: (string); "$orderby"?: (string); "limit"?: (number); "$count"?: (boolean); "cursor"?: (string) } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: false; output: ({ "count"?: (number); "items": (Array<({ "domainData": ({ "facility"?: (string); "jurisdiction"?: (string); "operator"?: (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "facility-assignment"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "count"?: (number); "items": (Array<({ "domainData": ({ "facility"?: (string); "jurisdiction"?: (string); "operator"?: (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "facility-assignment"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) } "records.facility-assignment.get": { input: CallOptions & { path: { "record_id": (string) } } & { query?: { "accessProfile"?: "facility-reader"; "$select"?: (string) } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: true; output: ({ "data": ({ "domainData": ({ "facility"?: (string); "jurisdiction"?: (string); "operator"?: (string) }); "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "facility-assignment"; "registryId": "facility-registry" }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "data": ({ "domainData": ({ "facility"?: (string); "jurisdiction"?: (string); "operator"?: (string) }); "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "facility-assignment"; "registryId": "facility-registry" }) }) } - "records.operator.list": { input: CallOptions & { query?: { "accessProfile"?: "facility-reader" | "operator-editor"; "$select"?: (string); "$filter"?: (string); "$orderby"?: (string); "$top"?: (number); "$count"?: (boolean); "$skiptoken"?: (string) } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: false; output: ({ "count"?: (number); "items": (Array<({ "domainData": ({ "jurisdiction"?: (string); "operatorCode"?: (string); "status"?: ("active" | "inactive") & (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "operator"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "count"?: (number); "items": (Array<({ "domainData": ({ "jurisdiction"?: (string); "operatorCode"?: (string); "status"?: ("active" | "inactive") & (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "operator"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) } + "records.operator.list": { input: CallOptions & { query?: { "accessProfile"?: "facility-reader" | "operator-editor"; "$select"?: (string); "$filter"?: (string); "$orderby"?: (string); "limit"?: (number); "$count"?: (boolean); "cursor"?: (string) } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: false; output: ({ "count"?: (number); "items": (Array<({ "domainData": ({ "jurisdiction"?: (string); "operatorCode"?: (string); "status"?: ("active" | "inactive") & (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "operator"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "count"?: (number); "items": (Array<({ "domainData": ({ "jurisdiction"?: (string); "operatorCode"?: (string); "status"?: ("active" | "inactive") & (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "operator"; "registryId": "facility-registry" }); "pageInfo": ({ "nextCursor": (string | null) }) }) } "records.operator.create": { input: CallOptions & { query?: { "accessProfile"?: "operator-editor" } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & ({ body: ({ "data": Schema_operator_create_input }) }) & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: true; output: ({ "data": ({ "domainData": Schema_operator; "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "operator"; "registryId": "facility-registry" }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "data": ({ "domainData": Schema_operator; "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "operator"; "registryId": "facility-registry" }) }) } "records.operator.get": { input: CallOptions & { path: { "record_id": (string) } } & { query?: { "accessProfile"?: "facility-reader" | "operator-editor"; "$select"?: (string) } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: true; output: ({ "data": ({ "domainData": ({ "jurisdiction"?: (string); "operatorCode"?: (string); "status"?: ("active" | "inactive") & (string) }); "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "operator"; "registryId": "facility-registry" }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "data": ({ "domainData": ({ "jurisdiction"?: (string); "operatorCode"?: (string); "status"?: ("active" | "inactive") & (string) }); "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "operator"; "registryId": "facility-registry" }) }) } "records.operator.patch": { input: CallOptions & { path: { "record_id": (string) } } & { query?: { "accessProfile"?: "operator-editor" } } & { headers: { "traceparent"?: (string); "If-Match": (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & ({ body: (Array<({ "op": ("add" | "replace" | "remove" | "test") & (string); "path": (string); "value"?: JsonValue })>) }) & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: true; output: ({ "data": ({ "domainData": Schema_operator; "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "operator"; "registryId": "facility-registry" }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "data": ({ "domainData": Schema_operator; "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "facility-registry"; "recordTypeId": "operator"; "registryId": "facility-registry" }) }) } @@ -77,12 +77,12 @@ export interface ListRows { "operator": ({ "domainData": ({ "jurisdiction"?: (string); "operatorCode"?: (string); "status"?: ("active" | "inactive") & (string) }); "recordId": (string); "revisionId": (string) }) } export interface ListOptions { - "directory-entry": (CallOptions & { accessProfile?: "directory-editor"; where?: never; orderBy?: never; select?: ReadonlyArray<"email" | "jurisdiction" | "name">; count?: never; top?: number; after?: never }) | (CallOptions & { accessProfile?: "directory-editor"; after: string; where?: never; orderBy?: never; select?: never; count?: never; top?: never }) - "facility": (CallOptions & { accessProfile?: "facility-reader"; where?: never; orderBy?: never; select?: ReadonlyArray<"addressLine" | "city" | "facilityCode" | "jurisdiction" | "name" | "postalCode" | "status">; count?: never; top?: number; after?: never }) | (CallOptions & { accessProfile?: "facility-reader"; after: string; where?: never; orderBy?: never; select?: never; count?: never; top?: never }) - "facility-assignment": (CallOptions & { accessProfile?: "facility-reader"; where?: { "facility"?: Filter, "equals" | "in" | "is-null" | "is-not-null">; "operator"?: Filter, "equals" | "in" | "is-null" | "is-not-null"> }; orderBy?: never; select?: ReadonlyArray<"facility" | "jurisdiction" | "operator">; count?: never; top?: number; after?: never }) | (CallOptions & { accessProfile?: "facility-reader"; after: string; where?: never; orderBy?: never; select?: never; count?: never; top?: never }) - "operator": (CallOptions & { accessProfile?: "facility-reader"; where?: never; orderBy?: never; select?: ReadonlyArray<"jurisdiction" | "operatorCode" | "status">; count?: never; top?: number; after?: never }) | (CallOptions & { accessProfile?: "facility-reader"; after: string; where?: never; orderBy?: never; select?: never; count?: never; top?: never }) | (CallOptions & { accessProfile?: "operator-editor"; where?: never; orderBy?: never; select?: ReadonlyArray<"jurisdiction" | "operatorCode" | "status">; count?: never; top?: number; after?: never }) | (CallOptions & { accessProfile?: "operator-editor"; after: string; where?: never; orderBy?: never; select?: never; count?: never; top?: never }) + "directory-entry": (CallOptions & { accessProfile?: "directory-editor"; where?: never; orderBy?: never; select?: ReadonlyArray<"email" | "jurisdiction" | "name">; count?: never; limit?: number; cursor?: never }) | (CallOptions & { accessProfile?: "directory-editor"; cursor: string; where?: never; orderBy?: never; select?: never; count?: never; limit?: never }) + "facility": (CallOptions & { accessProfile?: "facility-reader"; where?: never; orderBy?: never; select?: ReadonlyArray<"addressLine" | "city" | "facilityCode" | "jurisdiction" | "name" | "postalCode" | "status">; count?: never; limit?: number; cursor?: never }) | (CallOptions & { accessProfile?: "facility-reader"; cursor: string; where?: never; orderBy?: never; select?: never; count?: never; limit?: never }) + "facility-assignment": (CallOptions & { accessProfile?: "facility-reader"; where?: { "facility"?: Filter, "equals" | "in" | "is-null" | "is-not-null">; "operator"?: Filter, "equals" | "in" | "is-null" | "is-not-null"> }; orderBy?: never; select?: ReadonlyArray<"facility" | "jurisdiction" | "operator">; count?: never; limit?: number; cursor?: never }) | (CallOptions & { accessProfile?: "facility-reader"; cursor: string; where?: never; orderBy?: never; select?: never; count?: never; limit?: never }) + "operator": (CallOptions & { accessProfile?: "facility-reader"; where?: never; orderBy?: never; select?: ReadonlyArray<"jurisdiction" | "operatorCode" | "status">; count?: never; limit?: number; cursor?: never }) | (CallOptions & { accessProfile?: "facility-reader"; cursor: string; where?: never; orderBy?: never; select?: never; count?: never; limit?: never }) | (CallOptions & { accessProfile?: "operator-editor"; where?: never; orderBy?: never; select?: ReadonlyArray<"jurisdiction" | "operatorCode" | "status">; count?: never; limit?: number; cursor?: never }) | (CallOptions & { accessProfile?: "operator-editor"; cursor: string; where?: never; orderBy?: never; select?: never; count?: never; limit?: never }) } -const listRules: Record = JSON.parse("{\"directory-entry\":{\"operation\":\"records.directory-entry.list\",\"requiresAccessProfile\":false,\"accessProfileParameter\":true,\"recordProperties\":[\"email\",\"jurisdiction\",\"name\"],\"profiles\":{\"directory-editor\":{\"maximumPageSize\":100,\"allowCount\":false,\"selectable\":[\"email\",\"jurisdiction\",\"name\"],\"filterable\":{},\"sortable\":{}}}},\"facility\":{\"operation\":\"records.facility.list\",\"requiresAccessProfile\":false,\"accessProfileParameter\":true,\"recordProperties\":[\"addressLine\",\"city\",\"facilityCode\",\"jurisdiction\",\"name\",\"postalCode\",\"status\"],\"profiles\":{\"facility-reader\":{\"maximumPageSize\":100,\"allowCount\":false,\"selectable\":[\"addressLine\",\"city\",\"facilityCode\",\"jurisdiction\",\"name\",\"postalCode\",\"status\"],\"filterable\":{},\"sortable\":{}}}},\"facility-assignment\":{\"operation\":\"records.facility-assignment.list\",\"requiresAccessProfile\":false,\"accessProfileParameter\":true,\"recordProperties\":[\"facility\",\"jurisdiction\",\"operator\"],\"profiles\":{\"facility-reader\":{\"maximumPageSize\":100,\"allowCount\":false,\"selectable\":[\"facility\",\"jurisdiction\",\"operator\"],\"filterable\":{\"facility\":[\"equals\",\"in\",\"is-null\",\"is-not-null\"],\"operator\":[\"equals\",\"in\",\"is-null\",\"is-not-null\"]},\"sortable\":{}}}},\"operator\":{\"operation\":\"records.operator.list\",\"requiresAccessProfile\":false,\"accessProfileParameter\":true,\"recordProperties\":[\"jurisdiction\",\"operatorCode\",\"status\"],\"profiles\":{\"facility-reader\":{\"maximumPageSize\":100,\"allowCount\":false,\"selectable\":[\"jurisdiction\",\"operatorCode\",\"status\"],\"filterable\":{},\"sortable\":{}},\"operator-editor\":{\"maximumPageSize\":100,\"allowCount\":false,\"selectable\":[\"jurisdiction\",\"operatorCode\",\"status\"],\"filterable\":{},\"sortable\":{}}}}}") +const listRules: Record = JSON.parse("{\"directory-entry\":{\"operation\":\"records.directory-entry.list\",\"requiresAccessProfile\":false,\"accessProfileParameter\":true,\"paginationParameters\":{\"size\":\"limit\",\"cursor\":\"cursor\"},\"recordProperties\":[\"email\",\"jurisdiction\",\"name\"],\"profiles\":{\"directory-editor\":{\"maximumPageSize\":100,\"allowCount\":false,\"selectable\":[\"email\",\"jurisdiction\",\"name\"],\"filterable\":{},\"sortable\":{}}}},\"facility\":{\"operation\":\"records.facility.list\",\"requiresAccessProfile\":false,\"accessProfileParameter\":true,\"paginationParameters\":{\"size\":\"limit\",\"cursor\":\"cursor\"},\"recordProperties\":[\"addressLine\",\"city\",\"facilityCode\",\"jurisdiction\",\"name\",\"postalCode\",\"status\"],\"profiles\":{\"facility-reader\":{\"maximumPageSize\":100,\"allowCount\":false,\"selectable\":[\"addressLine\",\"city\",\"facilityCode\",\"jurisdiction\",\"name\",\"postalCode\",\"status\"],\"filterable\":{},\"sortable\":{}}}},\"facility-assignment\":{\"operation\":\"records.facility-assignment.list\",\"requiresAccessProfile\":false,\"accessProfileParameter\":true,\"paginationParameters\":{\"size\":\"limit\",\"cursor\":\"cursor\"},\"recordProperties\":[\"facility\",\"jurisdiction\",\"operator\"],\"profiles\":{\"facility-reader\":{\"maximumPageSize\":100,\"allowCount\":false,\"selectable\":[\"facility\",\"jurisdiction\",\"operator\"],\"filterable\":{\"facility\":[\"equals\",\"in\",\"is-null\",\"is-not-null\"],\"operator\":[\"equals\",\"in\",\"is-null\",\"is-not-null\"]},\"sortable\":{}}}},\"operator\":{\"operation\":\"records.operator.list\",\"requiresAccessProfile\":false,\"accessProfileParameter\":true,\"paginationParameters\":{\"size\":\"limit\",\"cursor\":\"cursor\"},\"recordProperties\":[\"jurisdiction\",\"operatorCode\",\"status\"],\"profiles\":{\"facility-reader\":{\"maximumPageSize\":100,\"allowCount\":false,\"selectable\":[\"jurisdiction\",\"operatorCode\",\"status\"],\"filterable\":{},\"sortable\":{}},\"operator-editor\":{\"maximumPageSize\":100,\"allowCount\":false,\"selectable\":[\"jurisdiction\",\"operatorCode\",\"status\"],\"filterable\":{},\"sortable\":{}}}}}") interface ReadRows { "directory-entry": Operations["records.directory-entry.get"]["output"]["data"] @@ -105,7 +105,7 @@ function recordRow(record: RecordEnvelope & { domainData: Data }): RecordR } const rules: Record = Object.fromEntries([ - ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"allOf\":[{\"if\":{\"properties\":{\"code\":{\"enum\":[\"attachment.required\",\"attachment.verification-pending\",\"attachment.verification-rejected\"]}}},\"then\":{\"allOf\":[{\"else\":{\"properties\":{\"status\":{\"const\":422}}},\"if\":{\"properties\":{\"code\":{\"const\":\"attachment.verification-pending\"}}},\"then\":{\"properties\":{\"status\":{\"const\":409}}}}],\"properties\":{\"fieldPath\":{\"pattern\":\"^/attachments/[a-z][a-z0-9_-]{0,63}$\",\"type\":\"string\"}},\"propertyNames\":{\"enum\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\",\"fieldPath\"]},\"required\":[\"fieldPath\"]}},{\"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\",\"failedCheck\"]}}},{\"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\":\"access-profile.ambiguous\"}}},\"then\":{\"additionalProperties\":true,\"properties\":{\"status\":{\"const\":400}},\"required\":[\"accessProfiles\"]}},{\"if\":{\"properties\":{\"code\":{\"not\":{\"const\":\"access-profile.ambiguous\"}}}},\"then\":{\"not\":{\"required\":[\"accessProfiles\"]}}},{\"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\"]}}],\"anyOf\":[{\"properties\":{\"code\":{\"const\":\"access-profile.ambiguous\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous\"}}},{\"properties\":{\"code\":{\"const\":\"action.evidence-failed\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/evidence-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.guard-failed\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/guard-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.handler-failed\"},\"status\":{\"const\":500},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/handler-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.refused\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/refused\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.content-type\"},\"status\":{\"const\":415},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/content-type\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.digest-mismatch\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.limit-reached\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.required\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/required\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.slot-write-once\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.too-large\"},\"status\":{\"const\":413},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/too-large\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.verification-pending\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.verification-rejected\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected\"}}},{\"properties\":{\"code\":{\"const\":\"authentication.refused\"},\"status\":{\"const\":401},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/authentication/refused\"}}},{\"properties\":{\"code\":{\"const\":\"idempotency.expired\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/idempotency/expired\"}}},{\"properties\":{\"code\":{\"const\":\"idempotency.key-reused\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.chunk-mismatch\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.profile-mismatch\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.receipt-erased\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.run-blocked\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.run-not-open\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open\"}}},{\"properties\":{\"code\":{\"const\":\"lookup.unresolved\"},\"status\":{\"const\":404},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/lookup/unresolved\"}}},{\"properties\":{\"code\":{\"const\":\"mutation.conflict\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/mutation/conflict\"}}},{\"properties\":{\"code\":{\"const\":\"precondition.failed\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/precondition/failed\"}}},{\"properties\":{\"code\":{\"const\":\"precondition.required\"},\"status\":{\"const\":428},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/precondition/required\"}}},{\"properties\":{\"code\":{\"const\":\"profile.not-authorized\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/profile/not-authorized\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.rejected\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/rejected\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.review-result-mismatch\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.submission-expired\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired\"}}},{\"properties\":{\"code\":{\"const\":\"query.cursor-invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid\"}}},{\"properties\":{\"code\":{\"const\":\"query.filter-required\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/filter-required\"}}},{\"properties\":{\"code\":{\"const\":\"query.invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/invalid\"}}},{\"properties\":{\"code\":{\"const\":\"request.access-reason-required\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/access-reason-required\"}}},{\"properties\":{\"code\":{\"const\":\"request.invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/invalid\"}}},{\"properties\":{\"code\":{\"const\":\"request.timeout\"},\"status\":{\"const\":504},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/timeout\"}}},{\"properties\":{\"code\":{\"const\":\"resource.not-found\"},\"status\":{\"const\":404},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/resource/not-found\"}}},{\"properties\":{\"code\":{\"const\":\"runtime.field-encryption.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"service.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/service/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"source.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/source/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.domain-violation\"},\"status\":{\"const\":500},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.release-refused\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.version-conflict\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.version-withdrawn\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn\"}}},{\"properties\":{\"code\":{\"const\":\"unsupported.media-type\"},\"status\":{\"const\":415},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/unsupported/media-type\"}}},{\"properties\":{\"code\":{\"const\":\"write.outside-boundary\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/write/outside-boundary\"}}}],\"properties\":{\"accessProfiles\":{\"items\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"minItems\":2,\"type\":\"array\",\"uniqueItems\":true},\"atField\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"code\":{\"enum\":[\"access-profile.ambiguous\",\"action.evidence-failed\",\"action.guard-failed\",\"action.handler-failed\",\"action.refused\",\"attachment.content-type\",\"attachment.digest-mismatch\",\"attachment.limit-reached\",\"attachment.required\",\"attachment.slot-write-once\",\"attachment.too-large\",\"attachment.verification-pending\",\"attachment.verification-rejected\",\"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\",\"profile.not-authorized\",\"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\"},\"failedCheck\":{\"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\":{\"maxLength\":256,\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], + ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"allOf\":[{\"if\":{\"properties\":{\"code\":{\"enum\":[\"attachment.required\",\"attachment.verification-pending\",\"attachment.verification-rejected\"]}}},\"then\":{\"allOf\":[{\"else\":{\"properties\":{\"status\":{\"const\":422}}},\"if\":{\"properties\":{\"code\":{\"const\":\"attachment.verification-pending\"}}},\"then\":{\"properties\":{\"status\":{\"const\":409}}}}],\"properties\":{\"fieldPath\":{\"pattern\":\"^/attachments/[a-z][a-z0-9_-]{0,63}$\",\"type\":\"string\"}},\"propertyNames\":{\"enum\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\",\"fieldPath\"]},\"required\":[\"fieldPath\"]}},{\"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\",\"failedCheck\"]}}},{\"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\":\"access-profile.ambiguous\"}}},\"then\":{\"additionalProperties\":true,\"not\":{\"required\":[\"failedCheck\"]},\"properties\":{\"status\":{\"const\":400}},\"required\":[\"accessProfiles\"]}},{\"if\":{\"properties\":{\"code\":{\"not\":{\"const\":\"access-profile.ambiguous\"}}}},\"then\":{\"not\":{\"required\":[\"accessProfiles\"]}}},{\"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\"]}}],\"anyOf\":[{\"properties\":{\"code\":{\"const\":\"access-profile.ambiguous\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous\"}}},{\"properties\":{\"code\":{\"const\":\"action.evidence-failed\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/evidence-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.guard-failed\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/guard-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.handler-failed\"},\"status\":{\"const\":500},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/handler-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.refused\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/refused\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.content-type\"},\"status\":{\"const\":415},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/content-type\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.digest-mismatch\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.limit-reached\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.required\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/required\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.slot-write-once\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.too-large\"},\"status\":{\"const\":413},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/too-large\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.verification-pending\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.verification-rejected\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected\"}}},{\"properties\":{\"code\":{\"const\":\"authentication.refused\"},\"status\":{\"const\":401},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/authentication/refused\"}}},{\"properties\":{\"code\":{\"const\":\"idempotency.expired\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/idempotency/expired\"}}},{\"properties\":{\"code\":{\"const\":\"idempotency.key-reused\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.chunk-mismatch\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.profile-mismatch\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.receipt-erased\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.run-blocked\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.run-not-open\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open\"}}},{\"properties\":{\"code\":{\"const\":\"lookup.unresolved\"},\"status\":{\"const\":404},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/lookup/unresolved\"}}},{\"properties\":{\"code\":{\"const\":\"mutation.conflict\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/mutation/conflict\"}}},{\"properties\":{\"code\":{\"const\":\"precondition.failed\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/precondition/failed\"}}},{\"properties\":{\"code\":{\"const\":\"precondition.required\"},\"status\":{\"const\":428},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/precondition/required\"}}},{\"properties\":{\"code\":{\"const\":\"profile.not-authorized\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/profile/not-authorized\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.rejected\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/rejected\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.review-result-mismatch\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.submission-expired\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired\"}}},{\"properties\":{\"code\":{\"const\":\"query.cursor-invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid\"}}},{\"properties\":{\"code\":{\"const\":\"query.filter-required\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/filter-required\"}}},{\"properties\":{\"code\":{\"const\":\"query.invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/invalid\"}}},{\"properties\":{\"code\":{\"const\":\"request.access-reason-required\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/access-reason-required\"}}},{\"properties\":{\"code\":{\"const\":\"request.invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/invalid\"}}},{\"properties\":{\"code\":{\"const\":\"request.timeout\"},\"status\":{\"const\":504},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/timeout\"}}},{\"properties\":{\"code\":{\"const\":\"resource.not-found\"},\"status\":{\"const\":404},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/resource/not-found\"}}},{\"properties\":{\"code\":{\"const\":\"runtime.field-encryption.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"service.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/service/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"source.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/source/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.domain-violation\"},\"status\":{\"const\":500},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.release-refused\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.version-conflict\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.version-withdrawn\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn\"}}},{\"properties\":{\"code\":{\"const\":\"unsupported.media-type\"},\"status\":{\"const\":415},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/unsupported/media-type\"}}},{\"properties\":{\"code\":{\"const\":\"write.outside-boundary\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/write/outside-boundary\"}}}],\"properties\":{\"accessProfiles\":{\"items\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"minItems\":2,\"type\":\"array\",\"uniqueItems\":true},\"atField\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"code\":{\"enum\":[\"access-profile.ambiguous\",\"action.evidence-failed\",\"action.guard-failed\",\"action.handler-failed\",\"action.refused\",\"attachment.content-type\",\"attachment.digest-mismatch\",\"attachment.limit-reached\",\"attachment.required\",\"attachment.slot-write-once\",\"attachment.too-large\",\"attachment.verification-pending\",\"attachment.verification-rejected\",\"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\",\"profile.not-authorized\",\"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\"},\"failedCheck\":{\"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\":{\"maxLength\":256,\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], ["/components/schemas/ReviewCompletion", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"completedAt\":{\"type\":\"string\"},\"eventId\":{\"type\":\"string\"},\"requestId\":{\"type\":\"string\"},\"resultId\":{\"type\":\"string\"},\"type\":{\"const\":\"review.completed\"}},\"required\":[\"type\",\"eventId\",\"requestId\",\"resultId\",\"completedAt\"],\"type\":\"object\"}")], ["/components/schemas/action-correct-address-invoke-input", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"input\":{\"additionalProperties\":false,\"properties\":{\"addressLine\":{\"maxLength\":240,\"minLength\":1,\"type\":\"string\"},\"city\":{\"maxLength\":120,\"minLength\":1,\"type\":\"string\"},\"facilityId\":{\"type\":\"string\"},\"postalCode\":{\"maxLength\":24,\"minLength\":1,\"type\":\"string\"}},\"required\":[],\"type\":\"object\"}},\"required\":[\"input\"],\"type\":\"object\"}")], ["/components/schemas/action-correct-address-invoke-response", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"actionId\":{\"type\":\"string\"},\"actionRevision\":{\"type\":\"string\"},\"application\":{\"additionalProperties\":false,\"properties\":{\"applicationId\":{\"type\":\"string\"},\"effectDigest\":{\"pattern\":\"^sha256:[0-9a-f]{64}$\",\"type\":\"string\"},\"resultLinks\":{\"items\":{\"additionalProperties\":false,\"properties\":{\"recordId\":{\"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\",\"revise\",\"correct-input\"]},\"state\":{\"enum\":[\"awaiting-review\",\"pending\",\"applying\",\"blocked\",\"applied\",\"cancelled\",\"rejected\"]}},\"required\":[\"state\",\"mode\"],\"type\":\"object\"},\"asks\":{\"items\":{\"additionalProperties\":false,\"properties\":{\"answer\":{\"additionalProperties\":false,\"properties\":{\"additions\":{\"items\":{\"type\":\"string\"},\"maxItems\":32,\"type\":\"array\",\"uniqueItems\":true},\"answeredAt\":{\"type\":\"string\"},\"text\":{\"maxLength\":2000,\"minLength\":1,\"type\":\"string\"}},\"required\":[\"additions\",\"answeredAt\"],\"type\":\"object\"},\"askedAt\":{\"type\":\"string\"},\"dueAt\":{\"type\":\"string\"},\"id\":{\"type\":\"string\"},\"links\":{\"additionalProperties\":false,\"properties\":{\"answer\":{\"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\",\"limit-reached\",\"application-pending\",\"attachment-required\",\"attachment-pending\",\"ask-answered\",\"ask-closed\",\"ask-due-passed\"]},\"recovery\":{\"enum\":[\"refresh\",\"revise\",\"retry\",\"rebase\",\"correct-input\",\"receipt-only\"]}},\"required\":[\"available\",\"observedRevision\"],\"then\":{\"required\":[\"reason\",\"recovery\"]},\"type\":\"object\"},\"ifMatch\":{\"type\":\"string\"},\"method\":{\"const\":\"POST\"},\"operation\":{\"const\":\"answer\"},\"path\":{\"type\":\"string\"}},\"required\":[\"method\",\"path\",\"accessProfile\",\"operation\",\"ifMatch\",\"availability\"],\"type\":\"object\"}},\"type\":\"object\"},\"state\":{\"enum\":[\"open\",\"answered\",\"expired\",\"closed\"]},\"text\":{\"maxLength\":2000,\"minLength\":1,\"type\":\"string\"},\"wants\":{\"items\":{\"additionalProperties\":false,\"properties\":{\"kind\":{\"enum\":[\"answer\",\"document\"]}},\"required\":[\"kind\"],\"type\":\"object\"},\"maxItems\":8,\"type\":\"array\",\"uniqueItems\":true}},\"required\":[\"id\",\"text\",\"wants\",\"askedAt\",\"state\",\"links\"],\"type\":\"object\"},\"maxItems\":50,\"type\":\"array\"},\"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\",\"limit-reached\",\"application-pending\",\"attachment-required\",\"attachment-pending\",\"ask-answered\",\"ask-closed\",\"ask-due-passed\"]},\"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\":{\"type\":\"string\"},\"decision\":{\"additionalProperties\":false,\"properties\":{\"decidedAt\":{\"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\"},\"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\":{\"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\",\"limit-reached\",\"application-pending\",\"attachment-required\",\"attachment-pending\",\"ask-answered\",\"ask-closed\",\"ask-due-passed\"]},\"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\"]},\"status\":{\"enum\":[\"draft\",\"awaiting-party\",\"in-review\",\"approved\",\"processing\",\"applied\",\"rejected\",\"cancelled\"]},\"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\"}")], @@ -505,35 +505,38 @@ export class Client { return { items: data.items, nextCursor: data.nextCursor ?? null } } async records_directory_entry_listPage(options: Operations["records.directory-entry.list"]["input"] = {}, cursor?: string): Promise> { - const { data } = await this.call("records.directory-entry.list", { ...options, query: cursor === undefined ? options.query : { accessProfile: options.query?.accessProfile, "$skiptoken": cursor } }) + const { data } = await this.call("records.directory-entry.list", { ...options, query: cursor === undefined ? options.query : { accessProfile: options.query?.accessProfile, "cursor": cursor } }) return { items: data.items, nextCursor: data.pageInfo.nextCursor ?? null } } async records_facility_listPage(options: Operations["records.facility.list"]["input"] = {}, cursor?: string): Promise> { - const { data } = await this.call("records.facility.list", { ...options, query: cursor === undefined ? options.query : { accessProfile: options.query?.accessProfile, "$skiptoken": cursor } }) + const { data } = await this.call("records.facility.list", { ...options, query: cursor === undefined ? options.query : { accessProfile: options.query?.accessProfile, "cursor": cursor } }) return { items: data.items, nextCursor: data.pageInfo.nextCursor ?? null } } async records_facility_path_operatorsPage(options: Operations["records.facility.path.operators"]["input"], cursor?: string): Promise> { - const { data } = await this.call("records.facility.path.operators", { ...options, query: cursor === undefined ? options.query : { accessProfile: options.query?.accessProfile, "$skiptoken": cursor } }) + const { data } = await this.call("records.facility.path.operators", { ...options, query: cursor === undefined ? options.query : { accessProfile: options.query?.accessProfile, "cursor": cursor } }) return { items: data.items, nextCursor: data.pageInfo.nextCursor ?? null } } async records_facility_assignment_listPage(options: Operations["records.facility-assignment.list"]["input"] = {}, cursor?: string): Promise> { - const { data } = await this.call("records.facility-assignment.list", { ...options, query: cursor === undefined ? options.query : { accessProfile: options.query?.accessProfile, "$skiptoken": cursor } }) + const { data } = await this.call("records.facility-assignment.list", { ...options, query: cursor === undefined ? options.query : { accessProfile: options.query?.accessProfile, "cursor": cursor } }) return { items: data.items, nextCursor: data.pageInfo.nextCursor ?? null } } async records_operator_listPage(options: Operations["records.operator.list"]["input"] = {}, cursor?: string): Promise> { - const { data } = await this.call("records.operator.list", { ...options, query: cursor === undefined ? options.query : { accessProfile: options.query?.accessProfile, "$skiptoken": cursor } }) + const { data } = await this.call("records.operator.list", { ...options, query: cursor === undefined ? options.query : { accessProfile: options.query?.accessProfile, "cursor": cursor } }) return { items: data.items, nextCursor: data.pageInfo.nextCursor ?? null } } list(recordType: K, ...args: {} extends ListOptions[K] ? [options?: ListOptions[K]] : [options: ListOptions[K]]): Promise>> - async list(recordType: string, options: ListRequest & { after?: string } = {}): Promise>> { + async list(recordType: string, options: ListRequest & { after?: string; cursor?: string } = {}): Promise>> { const rules = Object.hasOwn(listRules, recordType) ? listRules[recordType] : undefined if (!rules) throw new TypeError("Unknown record type for list") - const { accessProfile, where, orderBy, select, count, top, after, ...call } = options - if (after !== undefined && [where, orderBy, select, count, top].some(value => value !== undefined)) { - throw new TypeError("Use after without where, orderBy, select, count or top.") + const { accessProfile, where, orderBy, select, count, top, limit, after, cursor, ...call } = options + const continuationName = rules.paginationParameters ? "cursor" : "after" + const continuation = rules.paginationParameters ? cursor : after + if ((rules.paginationParameters ? after : cursor) !== undefined) throw new TypeError("Use " + continuationName + " for continuation.") + if (continuation !== undefined && [where, orderBy, select, count, top, limit].some(value => value !== undefined)) { + throw new TypeError("Use " + continuationName + " without first-page query options.") } - if (after !== undefined && (typeof after !== "string" || !after)) throw new TypeError("Use a nonempty cursor for after.") - const query = listQuery(rules, options, after, this.#transport.profile) + if (continuation !== undefined && (typeof continuation !== "string" || !continuation)) throw new TypeError("Use a nonempty " + continuationName + ".") + const query = listQuery(rules, options, continuation, this.#transport.profile) const { data } = await this.#call<{ items: RecordEnvelope[]; pageInfo: { nextCursor?: string | null }; count?: number }>(rules.operation, { ...call, query }) const page = listPage(data) return { ...page, items: page.items.map(recordRow) } diff --git a/clients/typescript/generated/breg-minimal.ts b/clients/typescript/generated/breg-minimal.ts index 7ade2d29af..f68b4fd3b8 100644 --- a/clients/typescript/generated/breg-minimal.ts +++ b/clients/typescript/generated/breg-minimal.ts @@ -1,5 +1,5 @@ // Generated for Stack version 0.50.0, client version 0.50.0. -// Source SHA-256 97d9de66ffaf92c88cfb85b74e1fffde050ec7fa3985f75b8887e2429b022c0b +// Source SHA-256 bce07d69a8eed5bb72b32568719f0ad0dc4ed711148c6f57735cc64e379193f1 // Unconstrained JSON /paths/~1v1~1records~1contacts~1{record_id}/patch/requestBody/content/application~1json-patch+json/schema/items/properties/value import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { actionAvailability, type ActionAvailability, type DescribeOptions } from "../core.ts" @@ -33,7 +33,7 @@ export interface Operations { "proposals.edit": { input: CallOptions & { path: { "proposal_id": (string) } } & { query?: { "accessProfile"?: "directory-editor" } } & { headers: { "If-Match": (string) } } & ({ body: (({ "input": ({ "email"?: (string); "jurisdiction"?: (string); "name"?: (string) }) })) }) & { accept?: "application/json" | "*/*" }; required: true; output: ({ "actionId": (string); "actionRevision": (string); "application"?: ({ "applicationId": (string); "effectDigest": (string); "resultLinks": (Array<({ "recordId": (string); "recordType": (string); "revision": (number) })>); "submissionVersion": (number) }); "applicationStatus"?: ({ "automaticRetry"?: ({ "attempts": (number); "maximumAttempts": (number); "scheduled": (boolean) }); "mode": ("automatic" | "manual"); "reason"?: ("package-changed" | "dependency-outage" | "lease-expired" | "application-refused" | "attempts-exhausted"); "recovery"?: ("retry" | "rebase" | "revise" | "correct-input"); "state": ("awaiting-review" | "pending" | "applying" | "blocked" | "applied" | "cancelled" | "rejected") }); "asks"?: (Array<({ "answer"?: ({ "additions": (Array<(string)>); "answeredAt": (string); "text"?: (string) }); "askedAt": (string); "dueAt"?: (string); "id": (string); "links": ({ "answer"?: ({ "accessProfile": (string); "availability": ({ "available": (boolean); "observedRevision": (number); "reason"?: ("pending-review" | "review-rejected" | "review-changes-requested" | "review-ended" | "stale-revision" | "package-changed" | "dependency-outage" | "invalid-input" | "already-applied" | "limit-reached" | "application-pending" | "attachment-required" | "attachment-pending" | "ask-answered" | "ask-closed" | "ask-due-passed"); "recovery"?: ("refresh" | "revise" | "retry" | "rebase" | "correct-input" | "receipt-only") }); "ifMatch": (string); "method": "POST"; "operation": "answer"; "path": (string) }) }); "state": ("open" | "answered" | "expired" | "closed"); "text": (string); "wants": (Array<({ "kind": ("answer" | "document") })>) })>); "attachments"?: (Record); "id": (string); "links": (Record); "maximumBytes": (number); "required": (boolean); "value"?: ({ "byteSize": (number); "contentType": (string); "sha256": (string); "submissionVersion": (number); "uploadedAt"?: (string); "verificationStatus": ("notRequired" | "pending" | "approved" | "rejected") }) })>); "blockedReason"?: ("package-changed"); "createdAt"?: (string); "decision"?: ({ "decidedAt": (string); "publicReason"?: (string); "status": ("approved" | "rejected" | "changes-requested" | "answered") }); "effectDigest"?: (string); "handoffRefusal"?: ({ "code": ("review.initiator-required" | "review.initiator-excluded" | "review.policy-mismatch" | "review.refused") }); "id": (string); "input"?: (Record); "links": (Record); "revision": (number); "state": ("draft" | "submitted" | "applied" | "cancelled" | "rejected"); "status"?: ("draft" | "awaiting-party" | "in-review" | "approved" | "processing" | "applied" | "rejected" | "cancelled"); "submissionVersion": (number); "title"?: (string); "turn": ("party" | "official" | "nobody") }) } "proposals.get-submission": { input: CallOptions & { path: { "proposal_id": (string); "submission_version": (number) } } & { query?: { "accessProfile"?: "directory-editor" } } & { accept?: "application/json" | "*/*" }; required: true; output: ({ "actionId": (string); "application": (({ "applicationId": (string); "appliedAt"?: (string); "appliedBy"?: (string); "state": "applied" }) | ({ "automaticRetry"?: ({ "attempts": (number); "maximumAttempts": (number); "scheduled": (boolean) }); "mode": ("automatic" | "manual"); "reason"?: ("package-changed" | "dependency-outage" | "lease-expired" | "application-refused" | "attempts-exhausted"); "recovery"?: ("retry" | "rebase" | "revise" | "correct-input"); "state": ("awaiting-review" | "pending" | "applying" | "blocked" | "cancelled" | "rejected") }) | (null)); "current": (boolean); "decision"?: ({ "decidedAt": (string); "publicReason"?: (string); "status": ("approved" | "rejected" | "changes-requested" | "answered") }); "effectDigest": (string); "handoffRefusal"?: ({ "code": ("review.initiator-required" | "review.initiator-excluded" | "review.policy-mismatch" | "review.refused") }); "id": (string); "review": (({ "availableUntil"?: (string); "completedAt"?: (string); "resultId"?: (string); "state": ("pending" | "approved" | "rejected" | "changes-requested" | "answered" | "cancelled" | "superseded" | "expired") }) | (null)); "submissionVersion": (number) }) } "proposals.submit": { input: CallOptions & { path: { "proposal_id": (string) } } & { query?: { "accessProfile"?: "directory-editor" } } & { headers: { "If-Match": (string) } } & ({ body: (Record) }) & { accept?: "application/json" | "*/*" }; required: true; output: ({ "actionId": (string); "actionRevision": (string); "application"?: ({ "applicationId": (string); "effectDigest": (string); "resultLinks": (Array<({ "recordId": (string); "recordType": (string); "revision": (number) })>); "submissionVersion": (number) }); "applicationStatus"?: ({ "automaticRetry"?: ({ "attempts": (number); "maximumAttempts": (number); "scheduled": (boolean) }); "mode": ("automatic" | "manual"); "reason"?: ("package-changed" | "dependency-outage" | "lease-expired" | "application-refused" | "attempts-exhausted"); "recovery"?: ("retry" | "rebase" | "revise" | "correct-input"); "state": ("awaiting-review" | "pending" | "applying" | "blocked" | "applied" | "cancelled" | "rejected") }); "asks"?: (Array<({ "answer"?: ({ "additions": (Array<(string)>); "answeredAt": (string); "text"?: (string) }); "askedAt": (string); "dueAt"?: (string); "id": (string); "links": ({ "answer"?: ({ "accessProfile": (string); "availability": ({ "available": (boolean); "observedRevision": (number); "reason"?: ("pending-review" | "review-rejected" | "review-changes-requested" | "review-ended" | "stale-revision" | "package-changed" | "dependency-outage" | "invalid-input" | "already-applied" | "limit-reached" | "application-pending" | "attachment-required" | "attachment-pending" | "ask-answered" | "ask-closed" | "ask-due-passed"); "recovery"?: ("refresh" | "revise" | "retry" | "rebase" | "correct-input" | "receipt-only") }); "ifMatch": (string); "method": "POST"; "operation": "answer"; "path": (string) }) }); "state": ("open" | "answered" | "expired" | "closed"); "text": (string); "wants": (Array<({ "kind": ("answer" | "document") })>) })>); "attachments"?: (Record); "id": (string); "links": (Record); "maximumBytes": (number); "required": (boolean); "value"?: ({ "byteSize": (number); "contentType": (string); "sha256": (string); "submissionVersion": (number); "uploadedAt"?: (string); "verificationStatus": ("notRequired" | "pending" | "approved" | "rejected") }) })>); "blockedReason"?: ("package-changed"); "createdAt"?: (string); "decision"?: ({ "decidedAt": (string); "publicReason"?: (string); "status": ("approved" | "rejected" | "changes-requested" | "answered") }); "effectDigest"?: (string); "handoffRefusal"?: ({ "code": ("review.initiator-required" | "review.initiator-excluded" | "review.policy-mismatch" | "review.refused") }); "id": (string); "input"?: (Record); "links": (Record); "revision": (number); "state": ("draft" | "submitted" | "applied" | "cancelled" | "rejected"); "status"?: ("draft" | "awaiting-party" | "in-review" | "approved" | "processing" | "applied" | "rejected" | "cancelled"); "submissionVersion": (number); "title"?: (string); "turn": ("party" | "official" | "nobody") }) } - "records.contact.list": { input: CallOptions & { query?: { "accessProfile"?: "directory-editor"; "$select"?: (string); "$filter"?: (string); "$orderby"?: (string); "$top"?: (number); "$count"?: (boolean); "$skiptoken"?: (string) } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: false; output: ({ "count"?: (number); "items": (Array<({ "domainData": ({ "email"?: (string); "jurisdiction"?: (string); "name"?: (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "directory"; "recordTypeId": "contact"; "registryId": "local-directory" }); "pageInfo": ({ "nextCursor": (string | null) }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "count"?: (number); "items": (Array<({ "domainData": ({ "email"?: (string); "jurisdiction"?: (string); "name"?: (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "directory"; "recordTypeId": "contact"; "registryId": "local-directory" }); "pageInfo": ({ "nextCursor": (string | null) }) }) } + "records.contact.list": { input: CallOptions & { query?: { "accessProfile"?: "directory-editor"; "$select"?: (string); "$filter"?: (string); "$orderby"?: (string); "limit"?: (number); "$count"?: (boolean); "cursor"?: (string) } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: false; output: ({ "count"?: (number); "items": (Array<({ "domainData": ({ "email"?: (string); "jurisdiction"?: (string); "name"?: (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "directory"; "recordTypeId": "contact"; "registryId": "local-directory" }); "pageInfo": ({ "nextCursor": (string | null) }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "count"?: (number); "items": (Array<({ "domainData": ({ "email"?: (string); "jurisdiction"?: (string); "name"?: (string) }); "recordId": (string); "revisionId": (string) })>); "meta": ({ "datasetId": "directory"; "recordTypeId": "contact"; "registryId": "local-directory" }); "pageInfo": ({ "nextCursor": (string | null) }) }) } "records.contact.create": { input: CallOptions & { query?: { "accessProfile"?: "directory-editor" } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & ({ body: ({ "data": Schema_contact_create_input }) }) & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: true; output: ({ "data": ({ "domainData": Schema_contact; "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "directory"; "recordTypeId": "contact"; "registryId": "local-directory" }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "data": ({ "domainData": Schema_contact; "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "directory"; "recordTypeId": "contact"; "registryId": "local-directory" }) }) } "records.contact.get": { input: CallOptions & { path: { "record_id": (string) } } & { query?: { "accessProfile"?: "directory-editor"; "$select"?: (string) } } & { headers?: { "traceparent"?: (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: true; output: ({ "data": ({ "domainData": ({ "email"?: (string); "jurisdiction"?: (string); "name"?: (string) }); "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "directory"; "recordTypeId": "contact"; "registryId": "local-directory" }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "data": ({ "domainData": ({ "email"?: (string); "jurisdiction"?: (string); "name"?: (string) }); "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "directory"; "recordTypeId": "contact"; "registryId": "local-directory" }) }) } "records.contact.patch": { input: CallOptions & { path: { "record_id": (string) } } & { query?: { "accessProfile"?: "directory-editor" } } & { headers: { "traceparent"?: (string); "If-Match": (string); "Accept"?: ("application/json" | "application/ld+json") & (string) } } & ({ body: (Array<({ "op": ("add" | "replace" | "remove" | "test") & (string); "path": (string); "value"?: JsonValue })>) }) & { accept?: "application/json" | "application/ld+json" | "*/*" }; required: true; output: ({ "data": ({ "domainData": Schema_contact; "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "directory"; "recordTypeId": "contact"; "registryId": "local-directory" }) }) | ({ "@context": "https://id.registrystack.org/contexts/registry-record/v1"; "data": ({ "domainData": Schema_contact; "recordId": (string); "revisionId": (string) }); "meta": ({ "datasetId": "directory"; "recordTypeId": "contact"; "registryId": "local-directory" }) }) } @@ -49,9 +49,9 @@ export interface ListRows { "contact": ({ "domainData": ({ "email"?: (string); "jurisdiction"?: (string); "name"?: (string) }); "recordId": (string); "revisionId": (string) }) } export interface ListOptions { - "contact": (CallOptions & { accessProfile?: "directory-editor"; where?: never; orderBy?: never; select?: ReadonlyArray<"email" | "jurisdiction" | "name">; count?: never; top?: number; after?: never }) | (CallOptions & { accessProfile?: "directory-editor"; after: string; where?: never; orderBy?: never; select?: never; count?: never; top?: never }) + "contact": (CallOptions & { accessProfile?: "directory-editor"; where?: never; orderBy?: never; select?: ReadonlyArray<"email" | "jurisdiction" | "name">; count?: never; limit?: number; cursor?: never }) | (CallOptions & { accessProfile?: "directory-editor"; cursor: string; where?: never; orderBy?: never; select?: never; count?: never; limit?: never }) } -const listRules: Record = JSON.parse("{\"contact\":{\"operation\":\"records.contact.list\",\"requiresAccessProfile\":false,\"accessProfileParameter\":true,\"recordProperties\":[\"email\",\"jurisdiction\",\"name\"],\"profiles\":{\"directory-editor\":{\"maximumPageSize\":100,\"allowCount\":false,\"selectable\":[\"email\",\"jurisdiction\",\"name\"],\"filterable\":{},\"sortable\":{}}}}}") +const listRules: Record = JSON.parse("{\"contact\":{\"operation\":\"records.contact.list\",\"requiresAccessProfile\":false,\"accessProfileParameter\":true,\"paginationParameters\":{\"size\":\"limit\",\"cursor\":\"cursor\"},\"recordProperties\":[\"email\",\"jurisdiction\",\"name\"],\"profiles\":{\"directory-editor\":{\"maximumPageSize\":100,\"allowCount\":false,\"selectable\":[\"email\",\"jurisdiction\",\"name\"],\"filterable\":{},\"sortable\":{}}}}}") interface ReadRows { "contact": Operations["records.contact.get"]["output"]["data"] @@ -68,7 +68,7 @@ function recordRow(record: RecordEnvelope & { domainData: Data }): RecordR } const rules: Record = Object.fromEntries([ - ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"allOf\":[{\"if\":{\"properties\":{\"code\":{\"enum\":[\"attachment.required\",\"attachment.verification-pending\",\"attachment.verification-rejected\"]}}},\"then\":{\"allOf\":[{\"else\":{\"properties\":{\"status\":{\"const\":422}}},\"if\":{\"properties\":{\"code\":{\"const\":\"attachment.verification-pending\"}}},\"then\":{\"properties\":{\"status\":{\"const\":409}}}}],\"properties\":{\"fieldPath\":{\"pattern\":\"^/attachments/[a-z][a-z0-9_-]{0,63}$\",\"type\":\"string\"}},\"propertyNames\":{\"enum\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\",\"fieldPath\"]},\"required\":[\"fieldPath\"]}},{\"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\",\"failedCheck\"]}}},{\"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\":\"access-profile.ambiguous\"}}},\"then\":{\"additionalProperties\":true,\"properties\":{\"status\":{\"const\":400}},\"required\":[\"accessProfiles\"]}},{\"if\":{\"properties\":{\"code\":{\"not\":{\"const\":\"access-profile.ambiguous\"}}}},\"then\":{\"not\":{\"required\":[\"accessProfiles\"]}}},{\"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\"]}}],\"anyOf\":[{\"properties\":{\"code\":{\"const\":\"access-profile.ambiguous\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous\"}}},{\"properties\":{\"code\":{\"const\":\"action.evidence-failed\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/evidence-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.guard-failed\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/guard-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.handler-failed\"},\"status\":{\"const\":500},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/handler-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.refused\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/refused\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.content-type\"},\"status\":{\"const\":415},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/content-type\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.digest-mismatch\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.limit-reached\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.required\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/required\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.slot-write-once\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.too-large\"},\"status\":{\"const\":413},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/too-large\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.verification-pending\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.verification-rejected\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected\"}}},{\"properties\":{\"code\":{\"const\":\"authentication.refused\"},\"status\":{\"const\":401},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/authentication/refused\"}}},{\"properties\":{\"code\":{\"const\":\"idempotency.expired\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/idempotency/expired\"}}},{\"properties\":{\"code\":{\"const\":\"idempotency.key-reused\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.chunk-mismatch\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.profile-mismatch\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.receipt-erased\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.run-blocked\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.run-not-open\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open\"}}},{\"properties\":{\"code\":{\"const\":\"lookup.unresolved\"},\"status\":{\"const\":404},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/lookup/unresolved\"}}},{\"properties\":{\"code\":{\"const\":\"mutation.conflict\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/mutation/conflict\"}}},{\"properties\":{\"code\":{\"const\":\"precondition.failed\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/precondition/failed\"}}},{\"properties\":{\"code\":{\"const\":\"precondition.required\"},\"status\":{\"const\":428},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/precondition/required\"}}},{\"properties\":{\"code\":{\"const\":\"profile.not-authorized\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/profile/not-authorized\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.rejected\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/rejected\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.review-result-mismatch\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.submission-expired\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired\"}}},{\"properties\":{\"code\":{\"const\":\"query.cursor-invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid\"}}},{\"properties\":{\"code\":{\"const\":\"query.filter-required\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/filter-required\"}}},{\"properties\":{\"code\":{\"const\":\"query.invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/invalid\"}}},{\"properties\":{\"code\":{\"const\":\"request.access-reason-required\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/access-reason-required\"}}},{\"properties\":{\"code\":{\"const\":\"request.invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/invalid\"}}},{\"properties\":{\"code\":{\"const\":\"request.timeout\"},\"status\":{\"const\":504},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/timeout\"}}},{\"properties\":{\"code\":{\"const\":\"resource.not-found\"},\"status\":{\"const\":404},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/resource/not-found\"}}},{\"properties\":{\"code\":{\"const\":\"runtime.field-encryption.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"service.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/service/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"source.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/source/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.domain-violation\"},\"status\":{\"const\":500},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.release-refused\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.version-conflict\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.version-withdrawn\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn\"}}},{\"properties\":{\"code\":{\"const\":\"unsupported.media-type\"},\"status\":{\"const\":415},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/unsupported/media-type\"}}},{\"properties\":{\"code\":{\"const\":\"write.outside-boundary\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/write/outside-boundary\"}}}],\"properties\":{\"accessProfiles\":{\"items\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"minItems\":2,\"type\":\"array\",\"uniqueItems\":true},\"atField\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"code\":{\"enum\":[\"access-profile.ambiguous\",\"action.evidence-failed\",\"action.guard-failed\",\"action.handler-failed\",\"action.refused\",\"attachment.content-type\",\"attachment.digest-mismatch\",\"attachment.limit-reached\",\"attachment.required\",\"attachment.slot-write-once\",\"attachment.too-large\",\"attachment.verification-pending\",\"attachment.verification-rejected\",\"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\",\"profile.not-authorized\",\"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\"},\"failedCheck\":{\"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\":{\"maxLength\":256,\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], + ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"allOf\":[{\"if\":{\"properties\":{\"code\":{\"enum\":[\"attachment.required\",\"attachment.verification-pending\",\"attachment.verification-rejected\"]}}},\"then\":{\"allOf\":[{\"else\":{\"properties\":{\"status\":{\"const\":422}}},\"if\":{\"properties\":{\"code\":{\"const\":\"attachment.verification-pending\"}}},\"then\":{\"properties\":{\"status\":{\"const\":409}}}}],\"properties\":{\"fieldPath\":{\"pattern\":\"^/attachments/[a-z][a-z0-9_-]{0,63}$\",\"type\":\"string\"}},\"propertyNames\":{\"enum\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\",\"fieldPath\"]},\"required\":[\"fieldPath\"]}},{\"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\",\"failedCheck\"]}}},{\"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\":\"access-profile.ambiguous\"}}},\"then\":{\"additionalProperties\":true,\"not\":{\"required\":[\"failedCheck\"]},\"properties\":{\"status\":{\"const\":400}},\"required\":[\"accessProfiles\"]}},{\"if\":{\"properties\":{\"code\":{\"not\":{\"const\":\"access-profile.ambiguous\"}}}},\"then\":{\"not\":{\"required\":[\"accessProfiles\"]}}},{\"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\"]}}],\"anyOf\":[{\"properties\":{\"code\":{\"const\":\"access-profile.ambiguous\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous\"}}},{\"properties\":{\"code\":{\"const\":\"action.evidence-failed\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/evidence-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.guard-failed\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/guard-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.handler-failed\"},\"status\":{\"const\":500},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/handler-failed\"}}},{\"properties\":{\"code\":{\"const\":\"action.refused\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/action/refused\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.content-type\"},\"status\":{\"const\":415},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/content-type\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.digest-mismatch\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.limit-reached\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.required\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/required\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.slot-write-once\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.too-large\"},\"status\":{\"const\":413},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/too-large\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.verification-pending\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending\"}}},{\"properties\":{\"code\":{\"const\":\"attachment.verification-rejected\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected\"}}},{\"properties\":{\"code\":{\"const\":\"authentication.refused\"},\"status\":{\"const\":401},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/authentication/refused\"}}},{\"properties\":{\"code\":{\"const\":\"idempotency.expired\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/idempotency/expired\"}}},{\"properties\":{\"code\":{\"const\":\"idempotency.key-reused\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.chunk-mismatch\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.profile-mismatch\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.receipt-erased\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.run-blocked\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked\"}}},{\"properties\":{\"code\":{\"const\":\"ingestion.run-not-open\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open\"}}},{\"properties\":{\"code\":{\"const\":\"lookup.unresolved\"},\"status\":{\"const\":404},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/lookup/unresolved\"}}},{\"properties\":{\"code\":{\"const\":\"mutation.conflict\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/mutation/conflict\"}}},{\"properties\":{\"code\":{\"const\":\"precondition.failed\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/precondition/failed\"}}},{\"properties\":{\"code\":{\"const\":\"precondition.required\"},\"status\":{\"const\":428},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/precondition/required\"}}},{\"properties\":{\"code\":{\"const\":\"profile.not-authorized\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/profile/not-authorized\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.rejected\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/rejected\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.review-result-mismatch\"},\"status\":{\"const\":412},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch\"}}},{\"properties\":{\"code\":{\"const\":\"proposal.submission-expired\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired\"}}},{\"properties\":{\"code\":{\"const\":\"query.cursor-invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid\"}}},{\"properties\":{\"code\":{\"const\":\"query.filter-required\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/filter-required\"}}},{\"properties\":{\"code\":{\"const\":\"query.invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/query/invalid\"}}},{\"properties\":{\"code\":{\"const\":\"request.access-reason-required\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/access-reason-required\"}}},{\"properties\":{\"code\":{\"const\":\"request.invalid\"},\"status\":{\"const\":400},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/invalid\"}}},{\"properties\":{\"code\":{\"const\":\"request.timeout\"},\"status\":{\"const\":504},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/request/timeout\"}}},{\"properties\":{\"code\":{\"const\":\"resource.not-found\"},\"status\":{\"const\":404},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/resource/not-found\"}}},{\"properties\":{\"code\":{\"const\":\"runtime.field-encryption.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"service.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/service/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"source.unavailable\"},\"status\":{\"const\":503},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/source/unavailable\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.domain-violation\"},\"status\":{\"const\":500},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.release-refused\"},\"status\":{\"const\":422},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.version-conflict\"},\"status\":{\"const\":409},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict\"}}},{\"properties\":{\"code\":{\"const\":\"statistical-dataset.version-withdrawn\"},\"status\":{\"const\":410},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn\"}}},{\"properties\":{\"code\":{\"const\":\"unsupported.media-type\"},\"status\":{\"const\":415},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/unsupported/media-type\"}}},{\"properties\":{\"code\":{\"const\":\"write.outside-boundary\"},\"status\":{\"const\":403},\"type\":{\"const\":\"https://id.registrystack.org/problems/registry-breg/write/outside-boundary\"}}}],\"properties\":{\"accessProfiles\":{\"items\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"minItems\":2,\"type\":\"array\",\"uniqueItems\":true},\"atField\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"code\":{\"enum\":[\"access-profile.ambiguous\",\"action.evidence-failed\",\"action.guard-failed\",\"action.handler-failed\",\"action.refused\",\"attachment.content-type\",\"attachment.digest-mismatch\",\"attachment.limit-reached\",\"attachment.required\",\"attachment.slot-write-once\",\"attachment.too-large\",\"attachment.verification-pending\",\"attachment.verification-rejected\",\"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\",\"profile.not-authorized\",\"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\"},\"failedCheck\":{\"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\":{\"maxLength\":256,\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], ["/components/schemas/ReviewCompletion", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"completedAt\":{\"type\":\"string\"},\"eventId\":{\"type\":\"string\"},\"requestId\":{\"type\":\"string\"},\"resultId\":{\"type\":\"string\"},\"type\":{\"const\":\"review.completed\"}},\"required\":[\"type\",\"eventId\",\"requestId\",\"resultId\",\"completedAt\"],\"type\":\"object\"}")], ["/components/schemas/action-register-contact-invoke-input", JSON.parse("{\"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\"}")], ["/components/schemas/action-register-contact-invoke-response", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"actionId\":{\"type\":\"string\"},\"actionRevision\":{\"type\":\"string\"},\"application\":{\"additionalProperties\":false,\"properties\":{\"applicationId\":{\"type\":\"string\"},\"effectDigest\":{\"pattern\":\"^sha256:[0-9a-f]{64}$\",\"type\":\"string\"},\"resultLinks\":{\"items\":{\"additionalProperties\":false,\"properties\":{\"recordId\":{\"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\",\"revise\",\"correct-input\"]},\"state\":{\"enum\":[\"awaiting-review\",\"pending\",\"applying\",\"blocked\",\"applied\",\"cancelled\",\"rejected\"]}},\"required\":[\"state\",\"mode\"],\"type\":\"object\"},\"asks\":{\"items\":{\"additionalProperties\":false,\"properties\":{\"answer\":{\"additionalProperties\":false,\"properties\":{\"additions\":{\"items\":{\"type\":\"string\"},\"maxItems\":32,\"type\":\"array\",\"uniqueItems\":true},\"answeredAt\":{\"type\":\"string\"},\"text\":{\"maxLength\":2000,\"minLength\":1,\"type\":\"string\"}},\"required\":[\"additions\",\"answeredAt\"],\"type\":\"object\"},\"askedAt\":{\"type\":\"string\"},\"dueAt\":{\"type\":\"string\"},\"id\":{\"type\":\"string\"},\"links\":{\"additionalProperties\":false,\"properties\":{\"answer\":{\"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\",\"limit-reached\",\"application-pending\",\"attachment-required\",\"attachment-pending\",\"ask-answered\",\"ask-closed\",\"ask-due-passed\"]},\"recovery\":{\"enum\":[\"refresh\",\"revise\",\"retry\",\"rebase\",\"correct-input\",\"receipt-only\"]}},\"required\":[\"available\",\"observedRevision\"],\"then\":{\"required\":[\"reason\",\"recovery\"]},\"type\":\"object\"},\"ifMatch\":{\"type\":\"string\"},\"method\":{\"const\":\"POST\"},\"operation\":{\"const\":\"answer\"},\"path\":{\"type\":\"string\"}},\"required\":[\"method\",\"path\",\"accessProfile\",\"operation\",\"ifMatch\",\"availability\"],\"type\":\"object\"}},\"type\":\"object\"},\"state\":{\"enum\":[\"open\",\"answered\",\"expired\",\"closed\"]},\"text\":{\"maxLength\":2000,\"minLength\":1,\"type\":\"string\"},\"wants\":{\"items\":{\"additionalProperties\":false,\"properties\":{\"kind\":{\"enum\":[\"answer\",\"document\"]}},\"required\":[\"kind\"],\"type\":\"object\"},\"maxItems\":8,\"type\":\"array\",\"uniqueItems\":true}},\"required\":[\"id\",\"text\",\"wants\",\"askedAt\",\"state\",\"links\"],\"type\":\"object\"},\"maxItems\":50,\"type\":\"array\"},\"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\",\"limit-reached\",\"application-pending\",\"attachment-required\",\"attachment-pending\",\"ask-answered\",\"ask-closed\",\"ask-due-passed\"]},\"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\":{\"type\":\"string\"},\"decision\":{\"additionalProperties\":false,\"properties\":{\"decidedAt\":{\"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\"},\"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\":{\"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\",\"limit-reached\",\"application-pending\",\"attachment-required\",\"attachment-pending\",\"ask-answered\",\"ask-closed\",\"ask-due-passed\"]},\"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\"]},\"status\":{\"enum\":[\"draft\",\"awaiting-party\",\"in-review\",\"approved\",\"processing\",\"applied\",\"rejected\",\"cancelled\"]},\"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\"}")], @@ -263,19 +263,22 @@ export class Client { return { items: data.items, nextCursor: data.nextCursor ?? null } } async records_contact_listPage(options: Operations["records.contact.list"]["input"] = {}, cursor?: string): Promise> { - const { data } = await this.call("records.contact.list", { ...options, query: cursor === undefined ? options.query : { accessProfile: options.query?.accessProfile, "$skiptoken": cursor } }) + const { data } = await this.call("records.contact.list", { ...options, query: cursor === undefined ? options.query : { accessProfile: options.query?.accessProfile, "cursor": cursor } }) return { items: data.items, nextCursor: data.pageInfo.nextCursor ?? null } } list(recordType: K, ...args: {} extends ListOptions[K] ? [options?: ListOptions[K]] : [options: ListOptions[K]]): Promise>> - async list(recordType: string, options: ListRequest & { after?: string } = {}): Promise>> { + async list(recordType: string, options: ListRequest & { after?: string; cursor?: string } = {}): Promise>> { const rules = Object.hasOwn(listRules, recordType) ? listRules[recordType] : undefined if (!rules) throw new TypeError("Unknown record type for list") - const { accessProfile, where, orderBy, select, count, top, after, ...call } = options - if (after !== undefined && [where, orderBy, select, count, top].some(value => value !== undefined)) { - throw new TypeError("Use after without where, orderBy, select, count or top.") + const { accessProfile, where, orderBy, select, count, top, limit, after, cursor, ...call } = options + const continuationName = rules.paginationParameters ? "cursor" : "after" + const continuation = rules.paginationParameters ? cursor : after + if ((rules.paginationParameters ? after : cursor) !== undefined) throw new TypeError("Use " + continuationName + " for continuation.") + if (continuation !== undefined && [where, orderBy, select, count, top, limit].some(value => value !== undefined)) { + throw new TypeError("Use " + continuationName + " without first-page query options.") } - if (after !== undefined && (typeof after !== "string" || !after)) throw new TypeError("Use a nonempty cursor for after.") - const query = listQuery(rules, options, after, this.#transport.profile) + if (continuation !== undefined && (typeof continuation !== "string" || !continuation)) throw new TypeError("Use a nonempty " + continuationName + ".") + const query = listQuery(rules, options, continuation, this.#transport.profile) const { data } = await this.#call<{ items: RecordEnvelope[]; pageInfo: { nextCursor?: string | null }; count?: number }>(rules.operation, { ...call, query }) const page = listPage(data) return { ...page, items: page.items.map(recordRow) } diff --git a/clients/typescript/generated/evidence-oid4vp.ts b/clients/typescript/generated/evidence-oid4vp.ts index 459fa4a0c5..775c8dff32 100644 --- a/clients/typescript/generated/evidence-oid4vp.ts +++ b/clients/typescript/generated/evidence-oid4vp.ts @@ -1,5 +1,5 @@ // Generated for Stack version 0.50.0, client version 0.50.0. -// Source SHA-256 d75c4179f20a0db17beff06e65f74b00d6e5950ae789d8861d0e767929bffca8 +// Source SHA-256 136a1fc3c2c5a9424e04f7a1376de9ea8f0eff87c9aa37b85e896961c924e13f import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -9,7 +9,8 @@ export type Schema_DidDocument = ({ "@context": (Array<(string)>); "assertionMet export type Schema_Empty = (Record) export type Schema_HealthResponse = ({ "status": "ok" }) export type Schema_Jwks = ({ "keys": (Array<({ "alg": "EdDSA"; "crv": "Ed25519"; "kid": (string); "kty": "OKP"; "use": "sig"; "x": (string) })>) }) -export type Schema_OAuthError = ({ "error": ("invalid_request" | "temporarily_unavailable"); "failedCheck"?: (string) }) +export type Schema_OAuthError = ({ "error": ("invalid_request" | "temporarily_unavailable") }) +export type Schema_OAuthRateLimit = ({ "error": "temporarily_unavailable"; "failedCheck"?: "rate-limit" }) export type Schema_Principal = ({ "issuer": (string); "subject": (string) }) export type Schema_Problem = ({ "detail"?: (string); "failedCheck"?: (string); "status": (number); "title": (string); "type": (string) }) export type Schema_ReadRequest = ({ "principal": Schema_Principal; "reference": (string) }) @@ -37,7 +38,8 @@ const rules: Record = Object.fromEntries([ ["/components/schemas/Empty", JSON.parse("{\"additionalProperties\":false,\"type\":\"object\"}")], ["/components/schemas/HealthResponse", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"status\":{\"const\":\"ok\"}},\"required\":[\"status\"],\"type\":\"object\"}")], ["/components/schemas/Jwks", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"keys\":{\"items\":{\"additionalProperties\":false,\"properties\":{\"alg\":{\"const\":\"EdDSA\"},\"crv\":{\"const\":\"Ed25519\"},\"kid\":{\"type\":\"string\"},\"kty\":{\"const\":\"OKP\"},\"use\":{\"const\":\"sig\"},\"x\":{\"type\":\"string\"}},\"required\":[\"kty\",\"crv\",\"x\",\"kid\",\"use\",\"alg\"],\"type\":\"object\"},\"minItems\":1,\"type\":\"array\"}},\"required\":[\"keys\"],\"type\":\"object\"}")], - ["/components/schemas/OAuthError", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"error\":{\"enum\":[\"invalid_request\",\"temporarily_unavailable\"]},\"failedCheck\":{\"type\":\"string\"}},\"required\":[\"error\"],\"type\":\"object\"}")], + ["/components/schemas/OAuthError", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"error\":{\"enum\":[\"invalid_request\",\"temporarily_unavailable\"]}},\"required\":[\"error\"],\"type\":\"object\"}")], + ["/components/schemas/OAuthRateLimit", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"error\":{\"const\":\"temporarily_unavailable\"},\"failedCheck\":{\"const\":\"rate-limit\"}},\"required\":[\"error\"],\"type\":\"object\"}")], ["/components/schemas/Principal", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"issuer\":{\"type\":\"string\"},\"subject\":{\"type\":\"string\"}},\"required\":[\"issuer\",\"subject\"],\"type\":\"object\"}")], ["/components/schemas/Problem", JSON.parse("{\"properties\":{\"detail\":{\"type\":\"string\"},\"failedCheck\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"title\":{\"type\":\"string\"},\"type\":{\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\"],\"type\":\"object\"}")], ["/components/schemas/ReadRequest", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"principal\":{\"$ref\":\"/components/schemas/Principal\"},\"reference\":{\"type\":\"string\"}},\"required\":[\"reference\",\"principal\"],\"type\":\"object\"}")], @@ -76,7 +78,7 @@ const rules: Record = Object.fromEntries([ ["/paths/~1v1~1responses~1{request_id}/post/responses/400/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/OAuthError\"}")], ["/paths/~1v1~1responses~1{request_id}/post/responses/408/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], ["/paths/~1v1~1responses~1{request_id}/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1responses~1{request_id}/post/responses/429/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/OAuthError\"}")], + ["/paths/~1v1~1responses~1{request_id}/post/responses/429/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/OAuthRateLimit\"}")], ["/paths/~1v1~1responses~1{request_id}/post/responses/503/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/OAuthError\"}")], ["/paths/~1v1~1sessions/post/responses/201/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/CreateSessionResponse\"}")], ["/paths/~1v1~1sessions/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], @@ -114,7 +116,7 @@ for (const [id, definition] of Object.entries(definitions)) { for (const [status, variants] of Object.entries(definition.responses)) { responses[Number(status)] = variants.map(variant => ({ ...variant, validate: variant.rule === undefined ? undefined : validator(rules, rules[variant.rule]) })) } - routes[id] = { ...definition, product: "evidence-oid4vp", responses, problemValidators: Object.fromEntries(Object.entries(definition.problems ?? {}).map(([status, rule]) => [status, validator(rules, rules[rule])])), oauthErrorValidators: Object.fromEntries(Object.entries(definition.oauthErrors ?? {}).map(([status, rule]) => [status, validator(rules, rules[rule])])) } + routes[id] = { ...definition, product: "evidence-oid4vp", responses, problemValidators: Object.fromEntries(Object.entries(definition.problems ?? {}).map(([status, rule]) => [status, validator(rules, rules[rule])])), oauthErrorValidators: Object.fromEntries(Object.entries(definition.oauthErrors ?? {}).map(([status, rule]) => [status, validator(rules, rules[rule], true)])) } } export class Client { diff --git a/clients/typescript/generated/evidence.ts b/clients/typescript/generated/evidence.ts index 683f66dfdf..59d8c792c0 100644 --- a/clients/typescript/generated/evidence.ts +++ b/clients/typescript/generated/evidence.ts @@ -1,5 +1,5 @@ // Generated for Stack version 0.50.0, client version 0.50.0. -// Source SHA-256 b9c0bb7eba93c05066706dec51ffea0da3d2eb323c641920ff63b4f49b2448e1 +// Source SHA-256 e3c836a65b95052a3f6e25ef207018f6870eaeaaaa626a3253ba7eb7c730f5f3 import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -32,7 +32,7 @@ export type Schema_JwksDocument = ({ "keys": (Array) }) export type Schema_JwtVcIssuerMetadata = ({ "issuer": (string); "jwks_uri": (string) }) export type Schema_P256PublicJwk = ({ "alg": ("ES256") & (string); "crv": ("P-256") & (string); "kid": (string); "kty": ("EC") & (string); "x": (string); "x5c"?: (Array<(string)>); "y": (string) }) export type Schema_PresentedCredential = ({ "issuedAt": (string); "issuer": (string); "subjectLink": ("possession" | "attribute-match") & (string); "trustEntry": (string); "type": (string) }) -export type Schema_Problem = (({ "code"?: ("evidence.invalid-request") & (string); "detail"?: ("the Evidence request is invalid") & (string); "status"?: (400) & (number); "title"?: ("Evidence request is invalid") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/evidence/invalid-request") & (string) }) | ({ "code"?: ("request.nonce-invalid") & (string); "detail"?: ("requestNonce must be 32 random bytes encoded as unpadded base64url (43 characters), generated anew for each request") & (string); "status"?: (400) & (number); "title"?: ("Request nonce is invalid") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/request/nonce-invalid") & (string) }) | ({ "code"?: ("request.selector-invalid") & (string); "detail"?: ("selector does not match an available request profile") & (string); "status"?: (400) & (number); "title"?: ("Selector is invalid") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/request/selector-invalid") & (string) }) | ({ "code"?: ("auth.invalid-credential") & (string); "detail"?: ("bearer access token validation failed") & (string); "status"?: (401) & (number); "title"?: ("Bearer access token is invalid") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/auth/invalid-credential") & (string) }) | ({ "code"?: ("platform.task-grant.development-assertion") & (string); "detail"?: ("task grant was issued in the development posture") & (string); "status"?: (401) & (number); "title"?: ("Development task assertion refused") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/platform/task-grant/development-assertion") & (string) }) | ({ "code"?: ("evidence.denied") & (string); "detail"?: ("the Evidence request is not permitted") & (string); "status"?: (403) & (number); "title"?: ("Evidence request is not permitted") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/evidence/denied") & (string) }) | ({ "code"?: ("format.unsupported") & (string); "detail"?: ("the requested format is not supported") & (string); "status"?: (406) & (number); "title"?: ("Requested format is not supported") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/format/unsupported") & (string) }) | ({ "code"?: ("evidence.unavailable") & (string); "detail"?: ("evidence could not be produced for this request") & (string); "status"?: (422) & (number); "title"?: ("Evidence could not be produced") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/evidence/unavailable") & (string) }) | ({ "code"?: ("evidence.rate-limited") & (string); "detail"?: ("the Evidence request rate is exhausted") & (string); "status"?: (429) & (number); "title"?: ("Evidence request rate is exhausted") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/evidence/rate-limited") & (string) }) | ({ "code"?: ("source.unavailable") & (string); "detail"?: ("the authoritative source is unavailable") & (string); "status"?: (503) & (number); "title"?: ("Authoritative source is unavailable") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/source/unavailable") & (string) }) | ({ "code"?: ("service.unavailable") & (string); "detail"?: ("the request could not be served") & (string); "status"?: (503) & (number); "title"?: ("Service is unavailable") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/service/unavailable") & (string) }) | ({ "code"?: ("resource.not-found") & (string); "detail"?: ("the requested resource was not found") & (string); "status"?: (404) & (number); "title"?: ("Requested resource was not found") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/resource/not-found") & (string) })) & ({ "code": ("evidence.invalid-request" | "request.nonce-invalid" | "request.selector-invalid" | "auth.invalid-credential" | "platform.task-grant.development-assertion" | "evidence.denied" | "format.unsupported" | "evidence.unavailable" | "evidence.rate-limited" | "source.unavailable" | "service.unavailable" | "resource.not-found") & (string); "detail": ("the Evidence request is invalid" | "requestNonce must be 32 random bytes encoded as unpadded base64url (43 characters), generated anew for each request" | "selector does not match an available request profile" | "bearer access token validation failed" | "task grant was issued in the development posture" | "the Evidence request is not permitted" | "the requested format is not supported" | "evidence could not be produced for this request" | "the Evidence request rate is exhausted" | "the authoritative source is unavailable" | "the request could not be served" | "the requested resource was not found") & (string); "failedCheck"?: (string); "status": (400 | 401 | 403 | 404 | 406 | 422 | 429 | 503) & (number); "title": ("Evidence request is invalid" | "Request nonce is invalid" | "Selector is invalid" | "Bearer access token is invalid" | "Development task assertion refused" | "Evidence request is not permitted" | "Requested format is not supported" | "Evidence could not be produced" | "Evidence request rate is exhausted" | "Authoritative source is unavailable" | "Service is unavailable" | "Requested resource was not found") & (string); "traceId": (string); "type": ("https://id.registrystack.org/problems/registry-evidence/evidence/invalid-request" | "https://id.registrystack.org/problems/registry-evidence/request/nonce-invalid" | "https://id.registrystack.org/problems/registry-evidence/request/selector-invalid" | "https://id.registrystack.org/problems/registry-evidence/auth/invalid-credential" | "https://id.registrystack.org/problems/registry-evidence/platform/task-grant/development-assertion" | "https://id.registrystack.org/problems/registry-evidence/evidence/denied" | "https://id.registrystack.org/problems/registry-evidence/format/unsupported" | "https://id.registrystack.org/problems/registry-evidence/evidence/unavailable" | "https://id.registrystack.org/problems/registry-evidence/evidence/rate-limited" | "https://id.registrystack.org/problems/registry-evidence/source/unavailable" | "https://id.registrystack.org/problems/registry-evidence/service/unavailable" | "https://id.registrystack.org/problems/registry-evidence/resource/not-found") & (string) }) +export type Schema_Problem = (({ "code"?: ("evidence.invalid-request") & (string); "detail"?: ("the Evidence request is invalid") & (string); "failedCheck"?: never; "status"?: (400) & (number); "title"?: ("Evidence request is invalid") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/evidence/invalid-request") & (string) }) | ({ "code"?: ("request.nonce-invalid") & (string); "detail"?: ("requestNonce must be 32 random bytes encoded as unpadded base64url (43 characters), generated anew for each request") & (string); "failedCheck"?: never; "status"?: (400) & (number); "title"?: ("Request nonce is invalid") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/request/nonce-invalid") & (string) }) | ({ "code"?: ("request.selector-invalid") & (string); "detail"?: ("selector does not match an available request profile") & (string); "failedCheck"?: never; "status"?: (400) & (number); "title"?: ("Selector is invalid") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/request/selector-invalid") & (string) }) | ({ "code"?: ("auth.invalid-credential") & (string); "detail"?: ("bearer access token validation failed") & (string); "failedCheck"?: (string); "status"?: (401) & (number); "title"?: ("Bearer access token is invalid") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/auth/invalid-credential") & (string) }) | ({ "code"?: ("platform.task-grant.development-assertion") & (string); "detail"?: ("task grant was issued in the development posture") & (string); "failedCheck"?: (string); "status"?: (401) & (number); "title"?: ("Development task assertion refused") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/platform/task-grant/development-assertion") & (string) }) | ({ "code"?: ("evidence.denied") & (string); "detail"?: ("the Evidence request is not permitted") & (string); "failedCheck"?: (string); "status"?: (403) & (number); "title"?: ("Evidence request is not permitted") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/evidence/denied") & (string) }) | ({ "code"?: ("format.unsupported") & (string); "detail"?: ("the requested format is not supported") & (string); "failedCheck"?: never; "status"?: (406) & (number); "title"?: ("Requested format is not supported") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/format/unsupported") & (string) }) | ({ "code"?: ("evidence.unavailable") & (string); "detail"?: ("evidence could not be produced for this request") & (string); "failedCheck"?: never; "status"?: (422) & (number); "title"?: ("Evidence could not be produced") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/evidence/unavailable") & (string) }) | ({ "code"?: ("evidence.rate-limited") & (string); "detail"?: ("the Evidence request rate is exhausted") & (string); "failedCheck"?: (string); "status"?: (429) & (number); "title"?: ("Evidence request rate is exhausted") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/evidence/rate-limited") & (string) }) | ({ "code"?: ("source.unavailable") & (string); "detail"?: ("the authoritative source is unavailable") & (string); "failedCheck"?: never; "status"?: (503) & (number); "title"?: ("Authoritative source is unavailable") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/source/unavailable") & (string) }) | ({ "code"?: ("service.unavailable") & (string); "detail"?: ("the request could not be served") & (string); "failedCheck"?: ("key-source-unavailable") & (string); "status"?: (503) & (number); "title"?: ("Service is unavailable") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/service/unavailable") & (string) }) | ({ "code"?: ("resource.not-found") & (string); "detail"?: ("the requested resource was not found") & (string); "failedCheck"?: never; "status"?: (404) & (number); "title"?: ("Requested resource was not found") & (string); "type"?: ("https://id.registrystack.org/problems/registry-evidence/resource/not-found") & (string) })) & ({ "code": ("evidence.invalid-request" | "request.nonce-invalid" | "request.selector-invalid" | "auth.invalid-credential" | "platform.task-grant.development-assertion" | "evidence.denied" | "format.unsupported" | "evidence.unavailable" | "evidence.rate-limited" | "source.unavailable" | "service.unavailable" | "resource.not-found") & (string); "detail": ("the Evidence request is invalid" | "requestNonce must be 32 random bytes encoded as unpadded base64url (43 characters), generated anew for each request" | "selector does not match an available request profile" | "bearer access token validation failed" | "task grant was issued in the development posture" | "the Evidence request is not permitted" | "the requested format is not supported" | "evidence could not be produced for this request" | "the Evidence request rate is exhausted" | "the authoritative source is unavailable" | "the request could not be served" | "the requested resource was not found") & (string); "failedCheck"?: (string); "status": (400 | 401 | 403 | 404 | 406 | 422 | 429 | 503) & (number); "title": ("Evidence request is invalid" | "Request nonce is invalid" | "Selector is invalid" | "Bearer access token is invalid" | "Development task assertion refused" | "Evidence request is not permitted" | "Requested format is not supported" | "Evidence could not be produced" | "Evidence request rate is exhausted" | "Authoritative source is unavailable" | "Service is unavailable" | "Requested resource was not found") & (string); "traceId": (string); "type": ("https://id.registrystack.org/problems/registry-evidence/evidence/invalid-request" | "https://id.registrystack.org/problems/registry-evidence/request/nonce-invalid" | "https://id.registrystack.org/problems/registry-evidence/request/selector-invalid" | "https://id.registrystack.org/problems/registry-evidence/auth/invalid-credential" | "https://id.registrystack.org/problems/registry-evidence/platform/task-grant/development-assertion" | "https://id.registrystack.org/problems/registry-evidence/evidence/denied" | "https://id.registrystack.org/problems/registry-evidence/format/unsupported" | "https://id.registrystack.org/problems/registry-evidence/evidence/unavailable" | "https://id.registrystack.org/problems/registry-evidence/evidence/rate-limited" | "https://id.registrystack.org/problems/registry-evidence/source/unavailable" | "https://id.registrystack.org/problems/registry-evidence/service/unavailable" | "https://id.registrystack.org/problems/registry-evidence/resource/not-found") & (string) }) export type Schema_ProtectedResourceMetadata = ({ "authorization_servers": (Array<(string)>); "bearer_methods_supported": (Array<"header">); "jwks_uri": (string); "resource": (string) }) export type Schema_PublicCheckAnswer = ({ "fields": (Record); "observedAt": (string); "schema": ("registry.evidence.public-check/v1alpha1") & (string); "status": ("valid" | "suspended" | "revoked" | "expired") & (string) }) export type Schema_PublicCheckRequest = ({ "checkCode": (string); "documentNumber": (string) }) @@ -96,7 +96,7 @@ const rules: Record = Object.fromEntries([ ["/components/schemas/JwtVcIssuerMetadata", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"issuer\":{\"maxLength\":512,\"type\":\"string\"},\"jwks_uri\":{\"maxLength\":1024,\"type\":\"string\"}},\"required\":[\"issuer\",\"jwks_uri\"],\"type\":\"object\"}")], ["/components/schemas/P256PublicJwk", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"alg\":{\"enum\":[\"ES256\"],\"type\":\"string\"},\"crv\":{\"enum\":[\"P-256\"],\"type\":\"string\"},\"kid\":{\"pattern\":\"^[A-Za-z0-9_-]{43}$\",\"type\":\"string\"},\"kty\":{\"enum\":[\"EC\"],\"type\":\"string\"},\"x\":{\"pattern\":\"^[A-Za-z0-9_-]{43}$\",\"type\":\"string\"},\"x5c\":{\"items\":{\"maxLength\":21848,\"minLength\":1,\"type\":\"string\"},\"maxItems\":3,\"minItems\":1,\"type\":\"array\"},\"y\":{\"pattern\":\"^[A-Za-z0-9_-]{43}$\",\"type\":\"string\"}},\"required\":[\"kty\",\"kid\",\"alg\",\"crv\",\"x\",\"y\"],\"type\":\"object\"}")], ["/components/schemas/PresentedCredential", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"issuedAt\":{\"type\":\"string\"},\"issuer\":{\"maxLength\":512,\"type\":\"string\"},\"subjectLink\":{\"enum\":[\"possession\",\"attribute-match\"],\"type\":\"string\"},\"trustEntry\":{\"pattern\":\"^[a-z][a-z0-9_-]{0,63}$\",\"type\":\"string\"},\"type\":{\"maxLength\":512,\"minLength\":1,\"type\":\"string\"}},\"required\":[\"trustEntry\",\"issuer\",\"type\",\"issuedAt\",\"subjectLink\"],\"type\":\"object\"}")], - ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"oneOf\":[{\"properties\":{\"code\":{\"enum\":[\"evidence.invalid-request\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the Evidence request is invalid\"],\"type\":\"string\"},\"status\":{\"enum\":[400],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence request is invalid\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/invalid-request\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"request.nonce-invalid\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"requestNonce must be 32 random bytes encoded as unpadded base64url (43 characters), generated anew for each request\"],\"type\":\"string\"},\"status\":{\"enum\":[400],\"type\":\"integer\"},\"title\":{\"enum\":[\"Request nonce is invalid\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/request/nonce-invalid\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"request.selector-invalid\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"selector does not match an available request profile\"],\"type\":\"string\"},\"status\":{\"enum\":[400],\"type\":\"integer\"},\"title\":{\"enum\":[\"Selector is invalid\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/request/selector-invalid\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"auth.invalid-credential\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"bearer access token validation failed\"],\"type\":\"string\"},\"status\":{\"enum\":[401],\"type\":\"integer\"},\"title\":{\"enum\":[\"Bearer access token is invalid\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/auth/invalid-credential\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"platform.task-grant.development-assertion\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"task grant was issued in the development posture\"],\"type\":\"string\"},\"status\":{\"enum\":[401],\"type\":\"integer\"},\"title\":{\"enum\":[\"Development task assertion refused\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/platform/task-grant/development-assertion\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"evidence.denied\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the Evidence request is not permitted\"],\"type\":\"string\"},\"status\":{\"enum\":[403],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence request is not permitted\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/denied\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"format.unsupported\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the requested format is not supported\"],\"type\":\"string\"},\"status\":{\"enum\":[406],\"type\":\"integer\"},\"title\":{\"enum\":[\"Requested format is not supported\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/format/unsupported\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"evidence.unavailable\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"evidence could not be produced for this request\"],\"type\":\"string\"},\"status\":{\"enum\":[422],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence could not be produced\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/unavailable\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"evidence.rate-limited\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the Evidence request rate is exhausted\"],\"type\":\"string\"},\"status\":{\"enum\":[429],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence request rate is exhausted\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/rate-limited\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"source.unavailable\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the authoritative source is unavailable\"],\"type\":\"string\"},\"status\":{\"enum\":[503],\"type\":\"integer\"},\"title\":{\"enum\":[\"Authoritative source is unavailable\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/source/unavailable\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"service.unavailable\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the request could not be served\"],\"type\":\"string\"},\"status\":{\"enum\":[503],\"type\":\"integer\"},\"title\":{\"enum\":[\"Service is unavailable\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/service/unavailable\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"resource.not-found\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the requested resource was not found\"],\"type\":\"string\"},\"status\":{\"enum\":[404],\"type\":\"integer\"},\"title\":{\"enum\":[\"Requested resource was not found\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/resource/not-found\"],\"type\":\"string\"}}}],\"properties\":{\"code\":{\"enum\":[\"evidence.invalid-request\",\"request.nonce-invalid\",\"request.selector-invalid\",\"auth.invalid-credential\",\"platform.task-grant.development-assertion\",\"evidence.denied\",\"format.unsupported\",\"evidence.unavailable\",\"evidence.rate-limited\",\"source.unavailable\",\"service.unavailable\",\"resource.not-found\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the Evidence request is invalid\",\"requestNonce must be 32 random bytes encoded as unpadded base64url (43 characters), generated anew for each request\",\"selector does not match an available request profile\",\"bearer access token validation failed\",\"task grant was issued in the development posture\",\"the Evidence request is not permitted\",\"the requested format is not supported\",\"evidence could not be produced for this request\",\"the Evidence request rate is exhausted\",\"the authoritative source is unavailable\",\"the request could not be served\",\"the requested resource was not found\"],\"type\":\"string\"},\"failedCheck\":{\"type\":\"string\"},\"status\":{\"enum\":[400,401,403,404,406,422,429,503],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence request is invalid\",\"Request nonce is invalid\",\"Selector is invalid\",\"Bearer access token is invalid\",\"Development task assertion refused\",\"Evidence request is not permitted\",\"Requested format is not supported\",\"Evidence could not be produced\",\"Evidence request rate is exhausted\",\"Authoritative source is unavailable\",\"Service is unavailable\",\"Requested resource was not found\"],\"type\":\"string\"},\"traceId\":{\"pattern\":\"^(?!0{32}$)[0-9a-f]{32}$\",\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/invalid-request\",\"https://id.registrystack.org/problems/registry-evidence/request/nonce-invalid\",\"https://id.registrystack.org/problems/registry-evidence/request/selector-invalid\",\"https://id.registrystack.org/problems/registry-evidence/auth/invalid-credential\",\"https://id.registrystack.org/problems/registry-evidence/platform/task-grant/development-assertion\",\"https://id.registrystack.org/problems/registry-evidence/evidence/denied\",\"https://id.registrystack.org/problems/registry-evidence/format/unsupported\",\"https://id.registrystack.org/problems/registry-evidence/evidence/unavailable\",\"https://id.registrystack.org/problems/registry-evidence/evidence/rate-limited\",\"https://id.registrystack.org/problems/registry-evidence/source/unavailable\",\"https://id.registrystack.org/problems/registry-evidence/service/unavailable\",\"https://id.registrystack.org/problems/registry-evidence/resource/not-found\"],\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], + ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"oneOf\":[{\"properties\":{\"code\":{\"enum\":[\"evidence.invalid-request\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the Evidence request is invalid\"],\"type\":\"string\"},\"failedCheck\":false,\"status\":{\"enum\":[400],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence request is invalid\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/invalid-request\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"request.nonce-invalid\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"requestNonce must be 32 random bytes encoded as unpadded base64url (43 characters), generated anew for each request\"],\"type\":\"string\"},\"failedCheck\":false,\"status\":{\"enum\":[400],\"type\":\"integer\"},\"title\":{\"enum\":[\"Request nonce is invalid\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/request/nonce-invalid\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"request.selector-invalid\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"selector does not match an available request profile\"],\"type\":\"string\"},\"failedCheck\":false,\"status\":{\"enum\":[400],\"type\":\"integer\"},\"title\":{\"enum\":[\"Selector is invalid\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/request/selector-invalid\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"auth.invalid-credential\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"bearer access token validation failed\"],\"type\":\"string\"},\"failedCheck\":{\"type\":\"string\"},\"status\":{\"enum\":[401],\"type\":\"integer\"},\"title\":{\"enum\":[\"Bearer access token is invalid\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/auth/invalid-credential\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"platform.task-grant.development-assertion\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"task grant was issued in the development posture\"],\"type\":\"string\"},\"failedCheck\":{\"type\":\"string\"},\"status\":{\"enum\":[401],\"type\":\"integer\"},\"title\":{\"enum\":[\"Development task assertion refused\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/platform/task-grant/development-assertion\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"evidence.denied\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the Evidence request is not permitted\"],\"type\":\"string\"},\"failedCheck\":{\"type\":\"string\"},\"status\":{\"enum\":[403],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence request is not permitted\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/denied\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"format.unsupported\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the requested format is not supported\"],\"type\":\"string\"},\"failedCheck\":false,\"status\":{\"enum\":[406],\"type\":\"integer\"},\"title\":{\"enum\":[\"Requested format is not supported\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/format/unsupported\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"evidence.unavailable\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"evidence could not be produced for this request\"],\"type\":\"string\"},\"failedCheck\":false,\"status\":{\"enum\":[422],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence could not be produced\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/unavailable\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"evidence.rate-limited\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the Evidence request rate is exhausted\"],\"type\":\"string\"},\"failedCheck\":{\"type\":\"string\"},\"status\":{\"enum\":[429],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence request rate is exhausted\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/rate-limited\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"source.unavailable\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the authoritative source is unavailable\"],\"type\":\"string\"},\"failedCheck\":false,\"status\":{\"enum\":[503],\"type\":\"integer\"},\"title\":{\"enum\":[\"Authoritative source is unavailable\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/source/unavailable\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"service.unavailable\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the request could not be served\"],\"type\":\"string\"},\"failedCheck\":{\"enum\":[\"key-source-unavailable\"],\"type\":\"string\"},\"status\":{\"enum\":[503],\"type\":\"integer\"},\"title\":{\"enum\":[\"Service is unavailable\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/service/unavailable\"],\"type\":\"string\"}}},{\"properties\":{\"code\":{\"enum\":[\"resource.not-found\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the requested resource was not found\"],\"type\":\"string\"},\"failedCheck\":false,\"status\":{\"enum\":[404],\"type\":\"integer\"},\"title\":{\"enum\":[\"Requested resource was not found\"],\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/resource/not-found\"],\"type\":\"string\"}}}],\"properties\":{\"code\":{\"enum\":[\"evidence.invalid-request\",\"request.nonce-invalid\",\"request.selector-invalid\",\"auth.invalid-credential\",\"platform.task-grant.development-assertion\",\"evidence.denied\",\"format.unsupported\",\"evidence.unavailable\",\"evidence.rate-limited\",\"source.unavailable\",\"service.unavailable\",\"resource.not-found\"],\"type\":\"string\"},\"detail\":{\"enum\":[\"the Evidence request is invalid\",\"requestNonce must be 32 random bytes encoded as unpadded base64url (43 characters), generated anew for each request\",\"selector does not match an available request profile\",\"bearer access token validation failed\",\"task grant was issued in the development posture\",\"the Evidence request is not permitted\",\"the requested format is not supported\",\"evidence could not be produced for this request\",\"the Evidence request rate is exhausted\",\"the authoritative source is unavailable\",\"the request could not be served\",\"the requested resource was not found\"],\"type\":\"string\"},\"failedCheck\":{\"type\":\"string\"},\"status\":{\"enum\":[400,401,403,404,406,422,429,503],\"type\":\"integer\"},\"title\":{\"enum\":[\"Evidence request is invalid\",\"Request nonce is invalid\",\"Selector is invalid\",\"Bearer access token is invalid\",\"Development task assertion refused\",\"Evidence request is not permitted\",\"Requested format is not supported\",\"Evidence could not be produced\",\"Evidence request rate is exhausted\",\"Authoritative source is unavailable\",\"Service is unavailable\",\"Requested resource was not found\"],\"type\":\"string\"},\"traceId\":{\"pattern\":\"^(?!0{32}$)[0-9a-f]{32}$\",\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-evidence/evidence/invalid-request\",\"https://id.registrystack.org/problems/registry-evidence/request/nonce-invalid\",\"https://id.registrystack.org/problems/registry-evidence/request/selector-invalid\",\"https://id.registrystack.org/problems/registry-evidence/auth/invalid-credential\",\"https://id.registrystack.org/problems/registry-evidence/platform/task-grant/development-assertion\",\"https://id.registrystack.org/problems/registry-evidence/evidence/denied\",\"https://id.registrystack.org/problems/registry-evidence/format/unsupported\",\"https://id.registrystack.org/problems/registry-evidence/evidence/unavailable\",\"https://id.registrystack.org/problems/registry-evidence/evidence/rate-limited\",\"https://id.registrystack.org/problems/registry-evidence/source/unavailable\",\"https://id.registrystack.org/problems/registry-evidence/service/unavailable\",\"https://id.registrystack.org/problems/registry-evidence/resource/not-found\"],\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], ["/components/schemas/ProtectedResourceMetadata", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"authorization_servers\":{\"items\":{\"maxLength\":512,\"type\":\"string\"},\"maxItems\":1,\"minItems\":1,\"type\":\"array\",\"uniqueItems\":true},\"bearer_methods_supported\":{\"items\":{\"const\":\"header\"},\"maxItems\":1,\"minItems\":1,\"type\":\"array\",\"uniqueItems\":true},\"jwks_uri\":{\"maxLength\":1024,\"type\":\"string\"},\"resource\":{\"maxLength\":512,\"type\":\"string\"}},\"required\":[\"resource\",\"authorization_servers\",\"jwks_uri\",\"bearer_methods_supported\"],\"type\":\"object\"}")], ["/components/schemas/PublicCheckAnswer", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"fields\":{\"type\":\"object\"},\"observedAt\":{\"pattern\":\"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$\",\"type\":\"string\"},\"schema\":{\"enum\":[\"registry.evidence.public-check/v1alpha1\"],\"type\":\"string\"},\"status\":{\"enum\":[\"valid\",\"suspended\",\"revoked\",\"expired\"],\"type\":\"string\"}},\"required\":[\"schema\",\"status\",\"fields\",\"observedAt\"],\"type\":\"object\"}")], ["/components/schemas/PublicCheckRequest", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"checkCode\":{\"pattern\":\"^[A-Za-z2-7]{24}$\",\"type\":\"string\"},\"documentNumber\":{\"minLength\":1,\"type\":\"string\"}},\"required\":[\"documentNumber\",\"checkCode\"],\"type\":\"object\"}")], diff --git a/clients/typescript/schema.ts b/clients/typescript/schema.ts index 7346ee0fb2..2e5593519e 100644 --- a/clients/typescript/schema.ts +++ b/clients/typescript/schema.ts @@ -56,7 +56,7 @@ function bounded(value: number, min = -Infinity, max = Infinity): boolean { return value >= min && value <= max } -export function validator(schemas: unknown, schema: unknown): (value: unknown) => boolean { +export function validator(schemas: unknown, schema: unknown, closedObjects = false): (value: unknown) => boolean { const root = schemas as Record const compiled = new WeakMap() function patternsFor(rule: Exclude) { @@ -120,8 +120,10 @@ export function validator(schemas: unknown, schema: unknown): (value: unknown) = const matched = patterns.filter(([pattern]) => pattern.test(key)) if (property !== undefined && !check(property, record[key])) return false if (matched.some(([, child]) => !check(child, record[key]))) return false - if (property === undefined && matched.length === 0 && typeof rule.additionalProperties === 'object' - && !check(rule.additionalProperties, record[key])) return false + if (property === undefined && matched.length === 0) { + if (closedObjects && rule.additionalProperties === false) return false + if (typeof rule.additionalProperties === 'object' && !check(rule.additionalProperties, record[key])) return false + } } } return true diff --git a/clients/typescript/tests/breg.test.ts b/clients/typescript/tests/breg.test.ts index 18c3c5d7b7..743b2e0eda 100644 --- a/clients/typescript/tests/breg.test.ts +++ b/clients/typescript/tests/breg.test.ts @@ -10,7 +10,7 @@ const input = { contactId: id, email: 'alice@example.org' } const meta = { datasetId: 'directory', recordTypeId: 'contact', registryId: 'local-directory' } const json = (body: unknown) => Response.json(body) -test('BReg continuation keeps the same route and just the profile and skiptoken', async () => { +test('BReg continuation keeps the same route and just the profile and cursor', async () => { let count = 0 const client = make(Client, { baseUrl: 'http://localhost', token: () => 'fixture', @@ -18,16 +18,16 @@ test('BReg continuation keeps the same route and just the profile and skiptoken' const parsed = new URL(String(url)) assert.equal(parsed.pathname, '/v1/records/contacts') if (++count === 1) { - assert.equal(parsed.searchParams.get('$top'), '1') + assert.equal(parsed.searchParams.get('limit'), '1') assert.equal(parsed.searchParams.get('$filter'), "name eq 'Alice'") } else { - assert.deepEqual([...parsed.searchParams], [['accessProfile', 'directory-editor'], ['$skiptoken', 'opaque+/=']]) + assert.deepEqual([...parsed.searchParams], [['accessProfile', 'directory-editor'], ['cursor', 'opaque+/=']]) } return json({ items: [], meta, pageInfo: { nextCursor: count === 1 ? 'opaque+/=' : null } }) }, }) await allPages(cursor => client.records_contact_listPage({ - query: { accessProfile: 'directory-editor', $top: 1, $filter: "name eq 'Alice'" }, + query: { accessProfile: 'directory-editor', limit: 1, $filter: "name eq 'Alice'" }, }, cursor)) assert.equal(count, 2) }) diff --git a/clients/typescript/tests/deno/transport.deno.test.ts b/clients/typescript/tests/deno/transport.deno.test.ts index 46e09443bb..e697e11344 100644 --- a/clients/typescript/tests/deno/transport.deno.test.ts +++ b/clients/typescript/tests/deno/transport.deno.test.ts @@ -12,11 +12,18 @@ Deno.test('a generated client calls through Fetch and walks a page', async () => fetch: async (url, init) => { seen.push(String(url)) assert.equal(new Headers(init?.headers).get('authorization'), 'Bearer fixture') - return Response.json({ items: [], meta, pageInfo: { nextCursor: null } }) + return Response.json({ items: [], meta, pageInfo: { nextCursor: seen.length === 1 ? 'next+/=' : null } }) } }) - const page = await client.records_contact_listPage({ query: { accessProfile: 'directory-editor', $top: 5 } }) - assert.deepEqual(page, { items: [], nextCursor: null }) - assert.equal(seen[0], 'https://registry.example.org/v1/records/contacts?accessProfile=directory-editor&%24top=5') + const page = await client.records_contact_listPage({ query: { accessProfile: 'directory-editor', limit: 5 } }) + assert.deepEqual(page, { items: [], nextCursor: 'next+/=' }) + const second = await client.records_contact_listPage({ + query: { accessProfile: 'directory-editor', limit: 5 }, + }, page.nextCursor!) + assert.deepEqual(second, { items: [], nextCursor: null }) + assert.deepEqual(seen, [ + 'https://registry.example.org/v1/records/contacts?accessProfile=directory-editor&limit=5', + 'https://registry.example.org/v1/records/contacts?accessProfile=directory-editor&cursor=next%2B%2F%3D', + ]) }) Deno.test('a path base resolves against the page origin and dot segments are refused', () => { diff --git a/clients/typescript/tests/list.test.ts b/clients/typescript/tests/list.test.ts index 4c28080634..96e8952686 100644 --- a/clients/typescript/tests/list.test.ts +++ b/clients/typescript/tests/list.test.ts @@ -136,8 +136,11 @@ test('a generated BReg client uses declared limit and cursor keys', async t => { return Response.json({ items: [], pageInfo: { nextCursor: null } }) } const client = make(Client, { baseUrl, token: () => 'fixture', fetch }) - await client.list('licence', { accessProfile: 'licence-officer', where: { status: 'active' }, top: 3 }) - await client.list('licence', { accessProfile: 'licence-officer', after: 'opaque+/=' }) + await Reflect.apply(client.list, client, ['licence', { accessProfile: 'licence-officer', where: { status: 'active' }, limit: 3 }]) + await Reflect.apply(client.list, client, ['licence', { accessProfile: 'licence-officer', cursor: 'opaque+/=' }]) + await assert.rejects(Reflect.apply(client.list, client, ['licence', { + accessProfile: 'licence-officer', cursor: 'opaque+/=', limit: 3, + }]), /Use cursor without first-page query options/u) // The generated call signature follows the synthetic OpenAPI's query names. const options = { query: { accessProfile: 'licence-officer', limit: 3, $filter: "status eq 'active'" } } as const await client.records_licence_listPage(options) diff --git a/clients/typescript/tests/oid4vp.test.ts b/clients/typescript/tests/oid4vp.test.ts index 60376e8ddc..18f798aa07 100644 --- a/clients/typescript/tests/oid4vp.test.ts +++ b/clients/typescript/tests/oid4vp.test.ts @@ -92,6 +92,13 @@ test('OID4VP exposes wallet OAuth errors and the consumed wallet error category' }), (error: unknown) => error instanceof RegistryError && error.status === status && error.kind === (status === 503 ? 'unreachable' : 'refused') && error.oauthError === payload.error) } + for (status of [400, 429, 503]) { + payload = { error: status === 400 ? 'invalid_request' : 'temporarily_unavailable', failedCheck: 'rate-limit' } + await assert.rejects(client.call('receiveWalletResponse', { + path: { request_id: 'req' }, body: 'state=fixture', + }), (error: unknown) => error instanceof RegistryError + && error.oauthError === (status === 429 ? payload.error : undefined)) + } status = 429 payload = { error: 'unknown_error' } await assert.rejects(client.call('receiveWalletResponse', { diff --git a/crates/registry-adapter-connectors/src/breg/batch.rs b/crates/registry-adapter-connectors/src/breg/batch.rs index 73726d3a05..f0b8738b47 100644 --- a/crates/registry-adapter-connectors/src/breg/batch.rs +++ b/crates/registry-adapter-connectors/src/breg/batch.rs @@ -252,7 +252,7 @@ impl Observable for BatchRecords { let request = BRegSnapshotListRequest::default() .snapshot(correlation) .map_err(|_| ConnectorFault::InvalidInput)? - .top(1) + .limit(1) .map_err(|_| ConnectorFault::InvalidInput)?; let answer = self.connector.block( self.connector diff --git a/crates/registry-adapter-connectors/tests/breg_native.rs b/crates/registry-adapter-connectors/tests/breg_native.rs index 4389300cb0..88ed088db3 100644 --- a/crates/registry-adapter-connectors/tests/breg_native.rs +++ b/crates/registry-adapter-connectors/tests/breg_native.rs @@ -187,7 +187,7 @@ async fn direct_create_and_patch_honor_preconditions() { .reads() .list_page( ®istry_breg_client::BRegListRequest::default() - .top(10) + .limit(10) .expect("page"), 10, ) diff --git a/crates/registry-adapter-connectors/tests/breg_read_mutation.rs b/crates/registry-adapter-connectors/tests/breg_read_mutation.rs index c3de067d63..2d3b4fcfb9 100644 --- a/crates/registry-adapter-connectors/tests/breg_read_mutation.rs +++ b/crates/registry-adapter-connectors/tests/breg_read_mutation.rs @@ -531,7 +531,7 @@ async fn list_page_advances_only_until_the_caller_bound() { }; mock.push(page(json!("token-1"))); mock.push(page(Value::Null)); - let request = BRegListRequest::default().top(2).expect("page size"); + let request = BRegListRequest::default().limit(2).expect("page size"); let outcome = mock .connector .reads() diff --git a/crates/registry-breg-client-node/__test__/binding.test.js b/crates/registry-breg-client-node/__test__/binding.test.js index 8fa4b058fe..e92a6ae571 100644 --- a/crates/registry-breg-client-node/__test__/binding.test.js +++ b/crates/registry-breg-client-node/__test__/binding.test.js @@ -149,7 +149,7 @@ test('invalid request graphs fail before I/O with a stable kind', async () => { assert.throws(() => client.continueList(cyclic), (error) => ( error instanceof BaseRegistryClientError && error.kind === 'invalid-request' )); - await assert.rejects(client.listRecords('people', { top: 0 }), (error) => ( + await assert.rejects(client.listRecords('people', { limit: 0 }), (error) => ( error instanceof BaseRegistryClientError && error.kind === 'invalid-request' )); }); @@ -159,7 +159,7 @@ test('nullable record options use request defaults', async () => { select: null, accessProfile: null, format: null, - top: null, + limit: null, filter: null, orderby: null, count: null, diff --git a/crates/registry-breg-client-node/__test__/exact-json.test.js b/crates/registry-breg-client-node/__test__/exact-json.test.js index 5863a673cc..3f260482b3 100644 --- a/crates/registry-breg-client-node/__test__/exact-json.test.js +++ b/crates/registry-breg-client-node/__test__/exact-json.test.js @@ -22,7 +22,7 @@ const query = { filterableFields: [{id: 'wide', apiName: 'wide', operators: ['equals', 'in']}], sortableFields: [], allowCount: true, defaultPageSize: 20, maximumPageSize: 100, maximumFilterClauses: 10, maximumInValues: 20, - pagination: {parameter:'$skiptoken', responsePath:'pageInfo.nextCursor', exclusive:true}, temporal:{mode:'current'}, + pagination: {parameter:'cursor', responsePath:'pageInfo.nextCursor', exclusive:true}, temporal:{mode:'current'}, }; function operation(kind) { return {id:`records.item.${kind}`, method:kind === 'create' ? 'POST' : kind === 'patch' ? 'PATCH' : 'GET', @@ -33,7 +33,7 @@ function operation(kind) { readableFields:fields.map(f=>f.id), createWritableFields:kind === 'create' ? fields.map(f=>f.id) : [], patchWritableFields:kind === 'patch' ? fields.map(f=>f.id) : [], selectors:[], query:kind === 'list' ? query : null, - request:kind === 'list' ? {fieldNames:'api',queryParameters:['$filter','$skiptoken']} : { + request:kind === 'list' ? {fieldNames:'api',queryParameters:['$filter','cursor']} : { fieldNames:'api',queryParameters:[],body:kind === 'create' ? 'data_envelope' : 'json_patch', contentType:kind === 'create' ? 'application/json' : 'application/json-patch+json', idempotencyKeyRequired:true,mutationSemantics:'direct',schema:{type:kind === 'create' ? 'object' : 'array'}, @@ -114,7 +114,7 @@ test('native JSON methods preserve values, metadata, cursors and mutation precon const exactRecord = record.replace('9007199254740992', responseNumber); if (request.method === 'GET' && !request.url.split('?')[0].endsWith(id)) { response.removeHeader('etag'); - return response.end(`{"items":[${exactRecord}],"meta":${JSON.stringify(meta)},"pageInfo":{"nextCursor":${request.url.includes('$skiptoken=') ? 'null' : '"cursor-1"'}}}`); + return response.end(`{"items":[${exactRecord}],"meta":${JSON.stringify(meta)},"pageInfo":{"nextCursor":${request.url.includes('cursor=') ? 'null' : '"cursor-1"'}}}`); } if (request.method === 'POST') { response.statusCode = 201; @@ -240,9 +240,9 @@ test('native JSON methods preserve values, metadata, cursors and mutation precon assert.equal(requests.length,mutationRequestCount); const page = await client.listRecordsJson('items',{accessProfile:profile,filter:"wide eq 1"}); assert.match(page.valueJson,/9007199254740992/); - assert.equal(page.continuation.skiptoken,'cursor-1'); + assert.equal(page.continuation.cursor,'cursor-1'); await client.continueListJson(page.continuation); - assert.match(requests.at(-1).url,/\$skiptoken=cursor-1/); + assert.match(requests.at(-1).url,/cursor=cursor-1/); responseNumber = '9007199254740993'; const read = await client.getRecordJson('items',id,{accessProfile:profile}); assert.match(read.valueJson,/9007199254740993/); 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 51f917c1d7..863ba4de1c 100644 --- a/crates/registry-breg-client-node/__test__/facade.test-d.ts +++ b/crates/registry-breg-client-node/__test__/facade.test-d.ts @@ -158,7 +158,7 @@ verifyHookDelivery({ headers: {}, body: '{}', key: Buffer.alloc(32) }) // @ts-expect-error Header values must be exact strings. verifyHookDelivery({ headers: { 'webhook-id': 1 }, body: Buffer.from('{}'), key: Buffer.alloc(32) }) -const options: ListOptions = { top: 25, filter: 'status eq active', count: true, bbox: ['100.1', '13.1', '100.2', '13.2'] } +const options: ListOptions = { limit: 25, filter: 'status eq active', count: true, bbox: ['100.1', '13.1', '100.2', '13.2'] } client.listRecords('people', options) client.recordSchema('person') // @ts-expect-error The entity-named schema method is retired. @@ -278,7 +278,7 @@ client.continueList({ ...continuation, select: ['name'] }) // @ts-expect-error Continuations must preserve the complete collection binding. client.continueList({ route: 'records', - skiptoken: 'opaque', + cursor: 'opaque', format: 'json', datasetIdentifier: 'people', recordTypeIdentifier: 'person', @@ -289,7 +289,7 @@ record.data.lifecycleState.toUpperCase() client.createRecordJson(create, '{"wide":9007199254740992}', 'exact-create') client.patchRecordJson(patch, '9f6973f9-10b3-4c58-b41b-494cba26796f', '"breg-1"', '[{"op":"remove","field":"name"}]', 'exact-patch') client.getRecordJson('people', '9f6973f9-10b3-4c58-b41b-494cba26796f').then(result => result.valueJson.toUpperCase()) -client.listRecordsJson('people').then(result => result.continuation?.skiptoken.toUpperCase()) +client.listRecordsJson('people').then(result => result.continuation?.cursor.toUpperCase()) client.lookupRecordJson('people', 'identifier', '{"name":"Ada"}') metadata.operations.map(operation => operation.query?.filterableFields.map(field => field.apiName)) metadata.operations.map(operation => operation.request.allowCreate === false) diff --git a/crates/registry-breg-client-node/__test__/read-cancellation.test.js b/crates/registry-breg-client-node/__test__/read-cancellation.test.js index 6320af37aa..41e641b9d3 100644 --- a/crates/registry-breg-client-node/__test__/read-cancellation.test.js +++ b/crates/registry-breg-client-node/__test__/read-cancellation.test.js @@ -30,7 +30,7 @@ async function serve(t) { const server = http.createServer((request, response) => { const collection = !request.url.split('?')[0].endsWith(id); const body = JSON.stringify(collection - ? { items: [record], pageInfo: { nextCursor: request.url.includes('$skiptoken=') ? null : 'next' }, meta } + ? { items: [record], pageInfo: { nextCursor: request.url.includes('cursor=') ? null : 'next' }, meta } : { data: record, meta }); const entry = { url: request.url, headers: request.headers, closed: false, finish: () => response.end(body) }; requests.push(entry); @@ -99,7 +99,7 @@ for (const suffix of ['', 'Json']) { await until(() => fixture.requests[1].closed, 'continuation request closed'); cancelled(await observe(fixture.client[`continueList${suffix}`](first.continuation, { signal: controller.signal }))); await delay(30); assert.equal(fixture.requests.length, 2); - assert(fixture.requests[1].url.includes('$skiptoken=next')); + assert(fixture.requests[1].url.includes('cursor=next')); assert(fixture.requests[1].url.includes('accessProfile=reader')); fixture.mode('finish'); await fixture.client[`continueList${suffix}`](first.continuation); assert.equal(fixture.requests.length, 3); diff --git a/crates/registry-breg-client-node/__test__/read-parity.test.js b/crates/registry-breg-client-node/__test__/read-parity.test.js index fe1673d363..cf3b8719d8 100644 --- a/crates/registry-breg-client-node/__test__/read-parity.test.js +++ b/crates/registry-breg-client-node/__test__/read-parity.test.js @@ -28,7 +28,7 @@ test('specialized read methods keep routes, cursors, snapshots, exact JSON and o const server = http.createServer((request, response) => { requests.push({ accept: request.headers.accept, url: request.url }); const path = request.url.split('?')[0]; - const continuation = request.url.includes('$skiptoken='); + const continuation = request.url.includes('cursor='); if (request.headers.accept === 'application/geo+json') { if (path.endsWith(id)) return respond(response, 'application/geo+json', feature); return respond(response, 'application/geo+json', `{"type":"FeatureCollection","features":[{"type":"Feature","id":"${id}","geometry":${JSON.stringify(multiPolygon)},"properties":{"wide":9007199254740992},"registry":{"revision":1}}],"numberReturned":1,"registry":{"pageInfo":{"nextCursor":${continuation ? 'null' : '"geo-next"'}}}}`); @@ -100,9 +100,9 @@ test('specialized read methods keep routes, cursors, snapshots, exact JSON and o const beforeRetiredOption = requests.length; await assert.rejects(client.getRecord('companies', id, {requestHistoryAfterProposalVersion: 3}), error => error.kind === 'invalid-request'); assert.equal(requests.length, beforeRetiredOption); - assert(requests.some(item => item.accept === 'application/geo+json' && item.url.includes('$skiptoken=geo-next'))); + assert(requests.some(item => item.accept === 'application/geo+json' && item.url.includes('cursor=geo-next'))); assert(requests.some(item => item.url.includes('/companies:as-of?asOf=2026-09-10T00%3A00%3A00Z'))); - assert(requests.some(item => item.url.includes(`/companies/${id}/related?$skiptoken=next`))); + assert(requests.some(item => item.url.includes(`/companies/${id}/related?cursor=next`))); const requestCount = requests.length; await assert.rejects(client.listCurrentRecords('companies', { bbox: ['1', '2', '3', '4'] }), error => error.kind === 'invalid-request'); @@ -119,7 +119,7 @@ test('exact JSON reads preserve and follow the largest server cursor envelope', const requests = []; const server = http.createServer((request, response) => { requests.push(request.url); - const continuation = request.url.includes('$skiptoken='); + const continuation = request.url.includes('cursor='); respond(response, 'application/json', { items: [record], pageInfo: { nextCursor: continuation ? null : cursor }, @@ -132,12 +132,12 @@ test('exact JSON reads preserve and follow the largest server cursor envelope', baseUrl: `http://127.0.0.1:${server.address().port}`, maximumResponseBytes: 32 * 1024, }); - const first = await client.listRecordsJson('companies', { top: 1, count: true }); - assert.equal(first.continuation.skiptoken.length, cursor.length); + const first = await client.listRecordsJson('companies', { limit: 1, count: true }); + assert.equal(first.continuation.cursor.length, cursor.length); const last = await client.continueListJson(first.continuation); assert.equal(last.continuation, undefined); assert.equal(requests.length, 2); - assert.match(requests[1], /\$skiptoken=/); + assert.match(requests[1], /cursor=/); } finally { await new Promise(resolve => server.close(resolve)); } diff --git a/crates/registry-breg-client-node/client.d.ts b/crates/registry-breg-client-node/client.d.ts index 3ab5385e9c..649d277ddc 100644 --- a/crates/registry-breg-client-node/client.d.ts +++ b/crates/registry-breg-client-node/client.d.ts @@ -224,7 +224,7 @@ export interface RecordOptions extends RecordProjectionOptions { } export interface ListOptions extends RecordProjectionOptions { - top?: SafeInteger | null + limit?: SafeInteger | null filter?: string | null orderby?: string | null count?: boolean | null @@ -232,7 +232,7 @@ export interface ListOptions extends RecordProjectionOptions { } export interface CollectionOptions extends RecordProjectionOptions { - top?: SafeInteger | null + limit?: SafeInteger | null filter?: string | null orderby?: string | null count?: boolean | null @@ -248,7 +248,7 @@ export interface GeoJsonOptions { accessProfile?: string | null } export interface GeoJsonListOptions extends GeoJsonOptions { - top?: SafeInteger | null + limit?: SafeInteger | null filter?: string | null orderby?: string | null count?: boolean | null @@ -257,7 +257,7 @@ export interface GeoJsonListOptions extends GeoJsonOptions { export interface ListContinuation { route: string - skiptoken: string + cursor: string format: RecordFormat accessProfile?: string | null registryIdentifier: string @@ -276,7 +276,7 @@ export interface RelationshipListContinuation extends ListContinuation { } export interface GeoJsonListContinuation { route: string - skiptoken: string + cursor: string accessProfile?: string } diff --git a/crates/registry-breg-client-node/src/lib.rs b/crates/registry-breg-client-node/src/lib.rs index e3ae9e6984..0ea6c03e26 100644 --- a/crates/registry-breg-client-node/src/lib.rs +++ b/crates/registry-breg-client-node/src/lib.rs @@ -1326,7 +1326,7 @@ fn list_request(value: Option) -> Result { "select", "accessProfile", "format", - "top", + "limit", "filter", "orderby", "count", @@ -1341,7 +1341,7 @@ fn list_request(value: Option) -> Result { .map(|(field, value)| (field.clone(), value.clone())) .collect(); let mut request = BRegListRequest::default().options(record_options(Some(&base))?); - match object.get("top") { + match object.get("limit") { None | Some(Value::Null) => {} Some(value) => { let value = safe_integer( @@ -1349,10 +1349,10 @@ fn list_request(value: Option) -> Result { 1, 100, "invalid-request", - "top must be 1 through 100", + "limit must be 1 through 100", )?; request = request - .top(value as u32) + .limit(value as u32) .map_err(|error| binding_error("invalid-request", error.to_string()))?; } } @@ -1393,7 +1393,7 @@ fn list_request(value: Option) -> Result { struct CollectionInputs { options: BRegRecordOptions, - top: Option, + limit: Option, filter: Option, orderby: Option, count: Option, @@ -1408,7 +1408,7 @@ fn collection_inputs( "select", "accessProfile", "format", - "top", + "limit", "filter", "orderby", "count", @@ -1425,8 +1425,8 @@ fn collection_inputs( .filter(|(field, _)| matches!(field.as_str(), "select" | "accessProfile" | "format")) .map(|(field, value)| (field.clone(), value.clone())) .collect(); - let top = object - .get("top") + let limit = object + .get("limit") .filter(|value| !value.is_null()) .map(|value| { safe_integer( @@ -1434,7 +1434,7 @@ fn collection_inputs( 1, 100, "invalid-request", - "top must be 1 through 100", + "limit must be 1 through 100", ) .map(|value| value as u32) }) @@ -1463,7 +1463,7 @@ fn collection_inputs( object, CollectionInputs { options: record_options(Some(&base))?, - top, + limit, filter, orderby, count, @@ -1474,9 +1474,9 @@ fn collection_inputs( macro_rules! apply_collection_inputs { ($request:ident, $inputs:ident) => { $request = $request.options($inputs.options); - if let Some(value) = $inputs.top { + if let Some(value) = $inputs.limit { $request = $request - .top(value) + .limit(value) .map_err(|error| binding_error("invalid-request", error.to_string()))?; } if let Some(value) = $inputs.filter { @@ -1621,9 +1621,9 @@ fn geojson_list_request(value: Option) -> Result .map(|(field, value)| (field.clone(), value.clone())) .collect(); let mut request = BRegGeoJsonListRequest::default().options(geojson_options(&base)?); - if let Some(value) = inputs.top { + if let Some(value) = inputs.limit { request = request - .top(value) + .limit(value) .map_err(|error| binding_error("invalid-request", error.to_string()))?; } if let Some(value) = inputs.filter { 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 652ea24831..4a50bb57c6 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 @@ -495,7 +495,7 @@ class BaseRegistryClient: self, record_route: str, *, - top: int | None = None, + limit: int | None = None, select: Sequence[str] | None = None, access_profile: str | None = None, filter: str | None = None, @@ -533,7 +533,7 @@ class BaseRegistryClient: self, record_route: str, *, - top: int | None = None, + limit: int | None = None, select: Sequence[str] | None = None, access_profile: str | None = None, format: RecordFormat = "json", @@ -546,7 +546,7 @@ class BaseRegistryClient: self, record_route: str, *, - top: int | None = None, + limit: int | None = None, select: Sequence[str] | None = None, access_profile: str | None = None, format: RecordFormat = "json", @@ -562,7 +562,7 @@ class BaseRegistryClient: record_route: str, as_of: str, *, - top: int | None = None, + limit: int | None = None, select: Sequence[str] | None = None, access_profile: str | None = None, format: RecordFormat = "json", @@ -579,7 +579,7 @@ class BaseRegistryClient: *, snapshot: str | None = None, valid_at: str | None = None, - top: int | None = None, + limit: int | None = None, select: Sequence[str] | None = None, access_profile: str | None = None, format: RecordFormat = "json", @@ -596,7 +596,7 @@ class BaseRegistryClient: record_id: str, path_route: str, *, - top: int | None = None, + limit: int | None = None, select: Sequence[str] | None = None, access_profile: str | None = None, format: RecordFormat = "json", diff --git a/crates/registry-breg-client-py/src/lib.rs b/crates/registry-breg-client-py/src/lib.rs index 0835cb7654..a01525d68f 100644 --- a/crates/registry-breg-client-py/src/lib.rs +++ b/crates/registry-breg-client-py/src/lib.rs @@ -326,7 +326,7 @@ fn record_options( #[allow(clippy::too_many_arguments)] fn list_request( py: Python<'_>, - top: Option, + limit: Option, select: Option>, access_profile: Option, format: &str, @@ -337,9 +337,9 @@ fn list_request( ) -> PyResult { let mut request = BRegListRequest::default().options(record_options(py, select, access_profile, format)?); - if let Some(value) = top { + if let Some(value) = limit { request = request - .top(value) + .limit(value) .map_err(|error| invalid(py, error.to_string()))?; } if let Some(value) = filter { @@ -365,7 +365,7 @@ fn list_request( } struct ScalarListArguments { - top: Option, + limit: Option, select: Option>, access_profile: Option, format: String, @@ -383,9 +383,9 @@ macro_rules! configure_scalar_list { arguments.access_profile, &arguments.format, )?); - if let Some(value) = arguments.top { + if let Some(value) = arguments.limit { request = request - .top(value) + .limit(value) .map_err(|error| invalid($py, error.to_string()))?; } if let Some(value) = arguments.filter { @@ -422,9 +422,9 @@ fn geojson_list_request( .map_err(|error| invalid(py, error.to_string()))?; } let mut request = BRegGeoJsonListRequest::default().options(options); - if let Some(value) = arguments.top { + if let Some(value) = arguments.limit { request = request - .top(value) + .limit(value) .map_err(|error| invalid(py, error.to_string()))?; } if let Some(value) = arguments.filter { @@ -2203,13 +2203,13 @@ impl BaseRegistryClient { complete_value(py, &value.value, &value.metadata) } - #[pyo3(signature = (record_route, *, top=None, select=None, access_profile=None, filter=None, orderby=None, count=None, bbox=None))] + #[pyo3(signature = (record_route, *, limit=None, select=None, access_profile=None, filter=None, orderby=None, count=None, bbox=None))] #[allow(clippy::too_many_arguments)] fn list_geojson_records<'py>( &self, py: Python<'py>, record_route: &str, - top: Option, + limit: Option, select: Option>, access_profile: Option, filter: Option, @@ -2220,7 +2220,7 @@ impl BaseRegistryClient { let request = geojson_list_request( py, ScalarListArguments { - top, + limit, select, access_profile, format: "json".to_owned(), @@ -2337,13 +2337,13 @@ impl BaseRegistryClient { raw_value(py, &value.value, &value.metadata) } - #[pyo3(signature = (record_route, *, top=None, select=None, access_profile=None, format="json", filter=None, orderby=None, count=None, bbox=None))] + #[pyo3(signature = (record_route, *, limit=None, select=None, access_profile=None, format="json", filter=None, orderby=None, count=None, bbox=None))] #[allow(clippy::too_many_arguments)] fn list_records<'py>( &self, py: Python<'py>, record_route: &str, - top: Option, + limit: Option, select: Option>, access_profile: Option, format: &str, @@ -2354,7 +2354,7 @@ impl BaseRegistryClient { ) -> PyResult> { let request = list_request( py, - top, + limit, select, access_profile, format, @@ -2372,13 +2372,13 @@ impl BaseRegistryClient { page_value(py, value) } - #[pyo3(signature = (record_route, *, top=None, select=None, access_profile=None, format="json", filter=None, orderby=None, count=None))] + #[pyo3(signature = (record_route, *, limit=None, select=None, access_profile=None, format="json", filter=None, orderby=None, count=None))] #[allow(clippy::too_many_arguments)] fn list_current_records<'py>( &self, py: Python<'py>, record_route: &str, - top: Option, + limit: Option, select: Option>, access_profile: Option, format: &str, @@ -2390,7 +2390,7 @@ impl BaseRegistryClient { py, BRegCurrentListRequest::default(), ScalarListArguments { - top, + limit, select, access_profile, format: format.to_owned(), @@ -2436,14 +2436,14 @@ impl BaseRegistryClient { ) } - #[pyo3(signature = (record_route, as_of, *, top=None, select=None, access_profile=None, format="json", filter=None, orderby=None, count=None))] + #[pyo3(signature = (record_route, as_of, *, limit=None, select=None, access_profile=None, format="json", filter=None, orderby=None, count=None))] #[allow(clippy::too_many_arguments)] fn list_records_as_of<'py>( &self, py: Python<'py>, record_route: &str, as_of: &str, - top: Option, + limit: Option, select: Option>, access_profile: Option, format: &str, @@ -2457,7 +2457,7 @@ impl BaseRegistryClient { py, request, ScalarListArguments { - top, + limit, select, access_profile, format: format.to_owned(), @@ -2503,7 +2503,7 @@ impl BaseRegistryClient { ) } - #[pyo3(signature = (record_route, *, snapshot=None, valid_at=None, top=None, select=None, access_profile=None, format="json", filter=None, orderby=None, count=None))] + #[pyo3(signature = (record_route, *, snapshot=None, valid_at=None, limit=None, select=None, access_profile=None, format="json", filter=None, orderby=None, count=None))] #[allow(clippy::too_many_arguments)] fn list_snapshot_records<'py>( &self, @@ -2511,7 +2511,7 @@ impl BaseRegistryClient { record_route: &str, snapshot: Option, valid_at: Option, - top: Option, + limit: Option, select: Option>, access_profile: Option, format: &str, @@ -2523,7 +2523,7 @@ impl BaseRegistryClient { py, BRegSnapshotListRequest::default(), ScalarListArguments { - top, + limit, select, access_profile, format: format.to_owned(), @@ -2593,7 +2593,7 @@ impl BaseRegistryClient { Ok(result) } - #[pyo3(signature = (record_route, record_id, path_route, *, top=None, select=None, access_profile=None, format="json", filter=None, orderby=None, count=None))] + #[pyo3(signature = (record_route, record_id, path_route, *, limit=None, select=None, access_profile=None, format="json", filter=None, orderby=None, count=None))] #[allow(clippy::too_many_arguments)] fn list_relationship_records<'py>( &self, @@ -2601,7 +2601,7 @@ impl BaseRegistryClient { record_route: &str, record_id: &str, path_route: &str, - top: Option, + limit: Option, select: Option>, access_profile: Option, format: &str, @@ -2613,7 +2613,7 @@ impl BaseRegistryClient { py, BRegRelationshipListRequest::default(), ScalarListArguments { - top, + limit, select, access_profile, format: format.to_owned(), diff --git a/crates/registry-breg-client-py/tests/python/test_read_parity.py b/crates/registry-breg-client-py/tests/python/test_read_parity.py index b32ec90baa..45e0546ede 100644 --- a/crates/registry-breg-client-py/tests/python/test_read_parity.py +++ b/crates/registry-breg-client-py/tests/python/test_read_parity.py @@ -78,7 +78,7 @@ def do_GET(self) -> None: # noqa: N802 if RECORD_ID in self.path: self.respond(feature(), "application/geo+json", False, False) else: - cursor = None if "%24skiptoken=" in self.path or "$skiptoken=" in self.path else "geo-next" + cursor = None if "cursor=" in self.path else "geo-next" self.respond( { "type": "FeatureCollection", @@ -116,7 +116,7 @@ def do_GET(self) -> None: # noqa: N802 for marker in (":current", ":as-of", ":snapshot", "/related") ) if is_collection: - cursor = None if "%24skiptoken=" in self.path or "$skiptoken=" in self.path else "next" + cursor = None if "cursor=" in self.path else "next" value = { "items": [record_data()], "pageInfo": {"nextCursor": cursor}, @@ -183,7 +183,7 @@ def test_geojson_bbox_and_typed_continuation(self) -> None: first = self.client.list_geojson_records( "companies", access_profile="map", - top=1, + limit=1, count=True, bbox=("100.1", "13.1", "100.2", "13.2"), ) @@ -191,7 +191,7 @@ def test_geojson_bbox_and_typed_continuation(self) -> None: self.assertEqual( first["value"]["features"][0]["geometry"]["type"], "MultiPolygon" ) - self.assertEqual(first["continuation"]["skiptoken"], "geo-next") + self.assertEqual(first["continuation"]["cursor"], "geo-next") second = self.client.continue_geojson_list(first["continuation"]) self.assertIsNone(second["continuation"]) self.assertTrue(any("bbox=100.1%2C13.1%2C100.2%2C13.2" in path for path, _ in self.requests)) @@ -204,27 +204,27 @@ def test_geojson_bbox_and_typed_continuation(self) -> None: self.assertEqual(len(self.requests), request_count) def test_temporal_snapshot_relationship_revision_reads(self) -> None: - current = self.client.list_current_records("companies", top=1) + current = self.client.list_current_records("companies", limit=1) self.assertIsNone( self.client.continue_current_list(current["continuation"])["continuation"] ) as_of = self.client.list_records_as_of( - "companies", "2026-09-10T00:00:00Z", top=1 + "companies", "2026-09-10T00:00:00Z", limit=1 ) self.assertEqual(as_of["continuation"]["asOf"], "2026-09-10T00:00:00Z") self.assertIsNone( self.client.continue_as_of_list(as_of["continuation"])["continuation"] ) - snapshot = self.client.list_snapshot_records("companies", top=1) + snapshot = self.client.list_snapshot_records("companies", limit=1) self.assertEqual(snapshot["snapshot"], SNAPSHOT) resumed = self.client.continue_snapshot_list(snapshot["continuation"]) self.assertEqual(resumed["snapshot"], SNAPSHOT) self.assertIsNone(resumed["continuation"]) related = self.client.list_relationship_records( - "companies", RECORD_ID, "related", top=1 + "companies", RECORD_ID, "related", limit=1 ) self.assertEqual(related["continuation"]["pathRoute"], "related") self.assertIsNone( diff --git a/crates/registry-breg-client/README.md b/crates/registry-breg-client/README.md index 4d7f022fbf..d87a8803ab 100644 --- a/crates/registry-breg-client/README.md +++ b/crates/registry-breg-client/README.md @@ -72,7 +72,7 @@ let options = BRegRecordOptions::default() .access_profile("caseworker.v1")? .select(["legalName", "status"])? .format(BRegRecordFormat::JsonLd); -let request = BRegListRequest::default().options(options).top(25)?; +let request = BRegListRequest::default().options(options).limit(25)?; let first = client.list_records("companies", &request).await?; if let Some(next) = first.value.continuation { let _next_page = client.continue_list(&next).await?; diff --git a/crates/registry-breg-client/examples/native_geojson.rs b/crates/registry-breg-client/examples/native_geojson.rs index a31d58dc2a..d4fa3d4c11 100644 --- a/crates/registry-breg-client/examples/native_geojson.rs +++ b/crates/registry-breg-client/examples/native_geojson.rs @@ -33,7 +33,7 @@ async fn main() -> Result<(), Box> { let request = BRegGeoJsonListRequest::default() .options(options) .bbox(bbox) - .top(20)?; + .limit(20)?; let mut page = client.list_geojson_records(&route, &request).await?; loop { println!("{}", serde_json::to_string(&page.value.value)?); diff --git a/crates/registry-breg-client/src/geojson.rs b/crates/registry-breg-client/src/geojson.rs index 383105168b..cbce43fb39 100644 --- a/crates/registry-breg-client/src/geojson.rs +++ b/crates/registry-breg-client/src/geojson.rs @@ -69,8 +69,8 @@ impl BRegGeoJsonListRequest { self } - pub fn top(mut self, value: u32) -> Result { - self.list = self.list.top(value)?; + pub fn limit(mut self, value: u32) -> Result { + self.list = self.list.limit(value)?; Ok(self) } @@ -227,7 +227,8 @@ pub struct BRegGeoJsonPage { #[serde(deny_unknown_fields, rename_all = "camelCase")] pub struct BRegGeoJsonContinuationProjection { pub route: String, - pub skiptoken: String, + #[serde(alias = "skiptoken")] + pub cursor: String, #[serde(skip_serializing_if = "Option::is_none")] pub access_profile: Option, } @@ -241,12 +242,12 @@ pub struct BRegGeoJsonContinuation { impl BRegGeoJsonContinuation { pub(crate) fn try_from_parts( route: &str, - skiptoken: &str, + cursor: &str, access_profile: Option, ) -> Result { Self::try_from_projection(BRegGeoJsonContinuationProjection { route: route.to_owned(), - skiptoken: skiptoken.to_owned(), + cursor: cursor.to_owned(), access_profile, }) } @@ -256,7 +257,7 @@ impl BRegGeoJsonContinuation { ) -> Result { let placeholder = BRegContinuationProjection { route: value.route, - skiptoken: value.skiptoken, + cursor: value.cursor, format: BRegRecordFormat::Json, access_profile: value.access_profile, registry_identifier: "geojson".to_owned(), @@ -273,7 +274,7 @@ impl BRegGeoJsonContinuation { let projection = self.collection.projection(); BRegGeoJsonContinuationProjection { route: projection.route, - skiptoken: projection.skiptoken, + cursor: projection.cursor, access_profile: projection.access_profile, } } diff --git a/crates/registry-breg-client/src/ingestion.rs b/crates/registry-breg-client/src/ingestion.rs index e6c7c39ffd..03cc2838ee 100644 --- a/crates/registry-breg-client/src/ingestion.rs +++ b/crates/registry-breg-client/src/ingestion.rs @@ -82,6 +82,8 @@ pub enum BRegIngestionError { EmptyChunk, #[error("a Base Registry Engine ingestion chunk item is not a valid batch item")] InvalidItem, + #[error("replace recordIdentifier with recordId in the patch item")] + RetiredRecordIdentifier, #[error("the Base Registry Engine ingestion chunk exceeds its item ceiling")] TooManyItems, #[error("the Base Registry Engine ingestion request body exceeds its encoded-byte ceiling")] @@ -1017,9 +1019,7 @@ impl BRegIngestionChunk { if items.len() > MAXIMUM_BREG_INGESTION_CHUNK_ITEMS { return Err(BRegIngestionError::TooManyItems); } - if items.iter().any(|item| !valid_batch_item(item)) { - return Err(BRegIngestionError::InvalidItem); - } + items.iter().try_for_each(validate_batch_item)?; validate_json_values(&items, 2).map_err(|_| BRegIngestionError::InvalidItem)?; let digest = ingestion_chunk_digest(&items)?; let prefix_digest = prefix_digest.into(); @@ -1276,19 +1276,22 @@ fn bound_member(value: impl Into) -> Result Ok(value) } -/// Whether one chunk item carries the closed create-or-patch shape the Base +/// Check that a chunk item carries the closed create-or-patch shape the Base /// Registry Engine's batch route parses. A create carries exactly the /// operation and its domain data object; a patch carries exactly the /// operation, the record reference, the expected etag, and the JSON Patch /// document. Anything else is refused here rather than answered /// request.invalid by a run that could never accept it. -fn valid_batch_item(item: &Value) -> bool { +fn validate_batch_item(item: &Value) -> Result<(), BRegIngestionError> { let Some(object) = item.as_object() else { - return false; + return Err(BRegIngestionError::InvalidItem); }; - match object.get("operation").and_then(Value::as_str) { + let valid = match object.get("operation").and_then(Value::as_str) { Some("create") => object.len() == 2 && object.get("data").is_some_and(Value::is_object), Some("patch") => { + if object.contains_key("recordIdentifier") { + return Err(BRegIngestionError::RetiredRecordIdentifier); + } object.len() == 4 && object .get("recordId") @@ -1301,6 +1304,11 @@ fn valid_batch_item(item: &Value) -> bool { && object.get("patch").is_some_and(valid_json_patch_document) } _ => false, + }; + if valid { + Ok(()) + } else { + Err(BRegIngestionError::InvalidItem) } } @@ -2158,6 +2166,28 @@ mod tests { ); } + #[test] + fn a_chunk_refusal_names_the_replacement_for_a_retired_patch_key() { + let retired = json!({ + "operation": "patch", "recordIdentifier": "retired-value-canary", + "ifMatch": "\"breg-record-v1-abcdef012345\"", + "patch": [{"op": "remove", "path": "/data/legalName"}] + }); + let mut mixed = retired.clone(); + mixed["recordId"] = json!(RUN_ID); + for item in [retired, mixed] { + let error = BRegIngestionChunk::new(0, vec![item], PREFIX_DIGEST).unwrap_err(); + assert_eq!(error, BRegIngestionError::RetiredRecordIdentifier); + assert_eq!( + error.to_string(), + "replace recordIdentifier with recordId in the patch item" + ); + } + + let create = json!({"operation": "create", "data": {"recordIdentifier": "a domain value"}}); + BRegIngestionChunk::new(0, vec![create], PREFIX_DIGEST).expect("keep domain field names"); + } + #[test] fn a_chunk_refuses_items_outside_the_closed_batch_item_shapes() { let create = json!({"operation": "create", "data": {"legalName": "Example Ltd"}}); @@ -2177,9 +2207,6 @@ mod tests { json!({"operation": "create", "data": {"legalName": "Example Ltd"}, "extra": 1}), json!({"operation": "create", "data": "not-an-object"}), json!({"operation": "delete", "data": {}}), - json!({"operation": "patch", "recordIdentifier": RUN_ID, "ifMatch": etag, "patch": [ - {"op": "remove", "path": "/data/legalName"} - ]}), // A patch carries exactly the record reference, the expected etag, // and the JSON Patch document. json!({"operation": "patch", "recordId": RUN_ID, "ifMatch": etag}), diff --git a/crates/registry-breg-client/src/query.rs b/crates/registry-breg-client/src/query.rs index 4079f7217b..ca392aaede 100644 --- a/crates/registry-breg-client/src/query.rs +++ b/crates/registry-breg-client/src/query.rs @@ -234,7 +234,7 @@ impl fmt::Debug for BRegBoundingBox { #[derive(Clone, Default, PartialEq, Eq)] pub struct BRegListRequest { options: BRegRecordOptions, - top: Option, + limit: Option, filter: Option, orderby: Option, count: Option, @@ -250,13 +250,13 @@ impl BRegListRequest { } /// Set the requested page size, from one through the BReg maximum of 100. - pub fn top(mut self, value: u32) -> Result { + pub fn limit(mut self, value: u32) -> Result { if !(1..=MAX_TOP).contains(&value) { return Err(BRegRequestError::new( - "Base Registry Engine $top must be between 1 and 100", + "Base Registry Engine limit must be between 1 and 100", )); } - self.top = Some(value); + self.limit = Some(value); Ok(self) } @@ -299,8 +299,8 @@ impl BRegListRequest { if let Some(value) = &self.orderby { pairs.push(("$orderby".into(), value.clone())); } - if let Some(value) = self.top { - pairs.push(("$top".into(), value.to_string())); + if let Some(value) = self.limit { + pairs.push(("limit".into(), value.to_string())); } if let Some(value) = self.count { pairs.push(("$count".into(), value.to_string())); @@ -323,7 +323,7 @@ impl fmt::Debug for BRegListRequest { formatter .debug_struct("BRegListRequest") .field("options", &self.options) - .field("top", &self.top) + .field("limit", &self.limit) .field("filter_present", &self.filter.is_some()) .field("orderby_present", &self.orderby.is_some()) .field("count", &self.count) @@ -453,8 +453,9 @@ impl fmt::Debug for BRegLookupRequest { pub struct BRegContinuationProjection { /// Logical Base Registry Engine record route segment. pub route: String, - /// Opaque Base Registry Engine `$skiptoken`. - pub skiptoken: String, + /// Opaque Base Registry Engine `cursor`. + #[serde(alias = "skiptoken")] + pub cursor: String, /// Representation selected for the original page. pub format: BRegRecordFormat, /// Access profile selected for the original page, when explicit. @@ -473,7 +474,7 @@ impl fmt::Debug for BRegContinuationProjection { formatter .debug_struct("BRegContinuationProjection") .field("route", &"") - .field("skiptoken", &"") + .field("cursor", &"") .field("format", &self.format) .field("access_profile_present", &self.access_profile.is_some()) .field("collection_binding", &"") @@ -485,12 +486,12 @@ impl fmt::Debug for BRegContinuationProjection { /// and first-page collection identity. /// /// Only continuation operations consume this type. It intentionally exposes no -/// `$select`, `$filter`, `$orderby`, `$top`, or `$count` setters, preventing a +/// `$select`, `$filter`, `$orderby`, `limit`, or `$count` setters, preventing a /// cursor from being mixed with first-page facts. #[derive(Clone, Eq, PartialEq)] pub struct BRegContinuation { route: String, - skiptoken: String, + cursor: String, format: BRegRecordFormat, access_profile: Option, registry_identifier: String, @@ -501,14 +502,14 @@ pub struct BRegContinuation { impl BRegContinuation { pub(crate) fn try_from_parts( route: impl Into, - skiptoken: impl Into, + cursor: impl Into, format: BRegRecordFormat, access_profile: Option, meta: &RegistryRecordMeta, ) -> Result { Self::try_from_projection(BRegContinuationProjection { route: route.into(), - skiptoken: skiptoken.into(), + cursor: cursor.into(), format, access_profile, registry_identifier: meta.registry_id.clone(), @@ -524,7 +525,7 @@ impl BRegContinuation { if !valid_compiled_identifier(&value.route) { return Err(BRegRequestError::new(INVALID_ROUTE)); } - validate_skiptoken(&value.skiptoken)?; + validate_skiptoken(&value.cursor)?; if let Some(profile) = &value.access_profile { validate_access_profile(profile)?; } @@ -540,7 +541,7 @@ impl BRegContinuation { } Ok(Self { route: value.route, - skiptoken: value.skiptoken, + cursor: value.cursor, format: value.format, access_profile: value.access_profile, registry_identifier: value.registry_identifier, @@ -554,7 +555,7 @@ impl BRegContinuation { pub fn projection(&self) -> BRegContinuationProjection { BRegContinuationProjection { route: self.route.clone(), - skiptoken: self.skiptoken.clone(), + cursor: self.cursor.clone(), format: self.format, access_profile: self.access_profile.clone(), registry_identifier: self.registry_identifier.clone(), @@ -592,7 +593,7 @@ impl BRegContinuation { if let Some(value) = &self.access_profile { pairs.push(("accessProfile".into(), value.clone())); } - pairs.push(("$skiptoken".into(), self.skiptoken.clone())); + pairs.push(("cursor".into(), self.cursor.clone())); ensure_query_bound(&pairs)?; Ok(pairs) } @@ -603,7 +604,7 @@ impl fmt::Debug for BRegContinuation { formatter .debug_struct("BRegContinuation") .field("route", &"") - .field("skiptoken", &"") + .field("cursor", &"") .field("format", &self.format) .field("access_profile_present", &self.access_profile.is_some()) .field("collection_binding", &"") @@ -1067,13 +1068,13 @@ mod tests { .unwrap() .orderby("openedOn desc") .unwrap() - .top(50) + .limit(50) .unwrap() .count(false); let query = breg_encoded_query(&request.query_pairs().unwrap()); assert_eq!( query, - "accessProfile=caseworker&$select=caseCode%2Cstatus&$filter=status%20eq%20%27open%27&$orderby=openedOn%20desc&$top=50&$count=false" + "accessProfile=caseworker&$select=caseCode%2Cstatus&$filter=status%20eq%20%27open%27&$orderby=openedOn%20desc&limit=50&$count=false" ); assert_eq!( request.record_options().format_value().media_type(), @@ -1083,10 +1084,10 @@ mod tests { #[test] fn list_bounds_top_and_opaque_query_members_without_parsing_their_grammar() { - assert!(BRegListRequest::default().top(1).is_ok()); - assert!(BRegListRequest::default().top(MAX_TOP).is_ok()); - assert!(BRegListRequest::default().top(0).is_err()); - assert!(BRegListRequest::default().top(MAX_TOP + 1).is_err()); + assert!(BRegListRequest::default().limit(1).is_ok()); + assert!(BRegListRequest::default().limit(MAX_TOP).is_ok()); + assert!(BRegListRequest::default().limit(0).is_err()); + assert!(BRegListRequest::default().limit(MAX_TOP + 1).is_err()); assert!(BRegListRequest::default().filter("not parsed here").is_ok()); assert!(BRegListRequest::default().filter("").is_err()); assert!(BRegListRequest::default().filter("field\nvalue").is_err()); @@ -1203,13 +1204,13 @@ mod tests { assert_eq!(continuation.access_profile(), Some("caseworker.v1")); assert_eq!( breg_encoded_query(&continuation.query_pairs().unwrap()), - "accessProfile=caseworker.v1&$skiptoken=opaque%2B%2F%3Dtoken" + "accessProfile=caseworker.v1&cursor=opaque%2B%2F%3Dtoken" ); assert_eq!( serde_json::to_value(&continuation).unwrap(), json!({ "route": "case-files", - "skiptoken": "opaque+/=token", + "cursor": "opaque+/=token", "format": "json-ld", "accessProfile": "caseworker.v1", "registryIdentifier": "business-registry", @@ -1217,6 +1218,16 @@ mod tests { "recordTypeIdentifier": "company" }) ); + let mut legacy = serde_json::to_value(&continuation).unwrap(); + let fields = legacy.as_object_mut().unwrap(); + let cursor = fields.remove("cursor").unwrap(); + fields.insert("skiptoken".to_owned(), cursor.clone()); + assert_eq!( + serde_json::from_value::(legacy.clone()).unwrap(), + continuation + ); + legacy["cursor"] = cursor; + assert!(serde_json::from_value::(legacy).is_err()); } #[test] @@ -1241,7 +1252,7 @@ mod tests { .is_err()); assert!(serde_json::from_value::(json!({ "route": "cases", - "skiptoken": "token", + "cursor": "token", "format": "json", "registryIdentifier": "business-registry", "datasetIdentifier": "legal-entities", diff --git a/crates/registry-breg-client/src/read.rs b/crates/registry-breg-client/src/read.rs index 169df0c279..bf488286e0 100644 --- a/crates/registry-breg-client/src/read.rs +++ b/crates/registry-breg-client/src/read.rs @@ -31,8 +31,8 @@ macro_rules! collection_request { } /// Set the requested page size from one through 100. - pub fn top(mut self, value: u32) -> Result { - self.list = self.list.top(value)?; + pub fn limit(mut self, value: u32) -> Result { + self.list = self.list.limit(value)?; Ok(self) } @@ -271,7 +271,7 @@ macro_rules! simple_continuation { impl $name { pub(crate) fn try_from_parts( route: &str, - skiptoken: &str, + cursor: &str, format: BRegRecordFormat, access_profile: Option, meta: &RegistryRecordMeta, @@ -279,7 +279,7 @@ macro_rules! simple_continuation { Ok(Self { collection: BRegContinuation::try_from_parts( route, - skiptoken, + cursor, format, access_profile, meta, @@ -370,7 +370,7 @@ pub struct BRegAsOfContinuation { impl BRegAsOfContinuation { pub(crate) fn try_from_parts( route: &str, - skiptoken: &str, + cursor: &str, format: BRegRecordFormat, access_profile: Option, meta: &RegistryRecordMeta, @@ -380,7 +380,7 @@ impl BRegAsOfContinuation { Ok(Self { collection: BRegContinuation::try_from_parts( route, - skiptoken, + cursor, format, access_profile, meta, @@ -475,7 +475,7 @@ pub struct BRegSnapshotContinuation { impl BRegSnapshotContinuation { pub(crate) fn try_from_parts( route: &str, - skiptoken: &str, + cursor: &str, format: BRegRecordFormat, access_profile: Option, meta: &RegistryRecordMeta, @@ -487,7 +487,7 @@ impl BRegSnapshotContinuation { Ok(Self { collection: BRegContinuation::try_from_parts( route, - skiptoken, + cursor, format, access_profile, meta, @@ -596,7 +596,7 @@ impl BRegRelationshipContinuation { route: &str, root_record_identifier: &str, path_route: &str, - skiptoken: &str, + cursor: &str, format: BRegRecordFormat, access_profile: Option, meta: &RegistryRecordMeta, @@ -606,7 +606,7 @@ impl BRegRelationshipContinuation { Ok(Self { collection: BRegContinuation::try_from_parts( route, - skiptoken, + cursor, format, access_profile, meta, @@ -745,7 +745,7 @@ fn validate_snapshot_reference(value: &str) -> Result<(), BRegRequestError> { fn validate_route(value: &str) -> Result<(), BRegRequestError> { let projection = BRegContinuationProjection { route: value.to_owned(), - skiptoken: "valid".to_owned(), + cursor: "valid".to_owned(), format: BRegRecordFormat::Json, access_profile: None, registry_identifier: "registry".to_owned(), @@ -808,11 +808,11 @@ mod tests { let current = BRegCurrentListRequest::default() .filter("status eq 'active'") .unwrap() - .top(10) + .limit(10) .unwrap(); assert_eq!( crate::query::breg_encoded_query(¤t.query_pairs().unwrap()), - "$filter=status%20eq%20%27active%27&$top=10" + "$filter=status%20eq%20%27active%27&limit=10" ); let as_of = BRegAsOfListRequest::new("2026-09-10T00:00:00Z") .unwrap() @@ -857,7 +857,7 @@ mod tests { assert_eq!(restored.valid_at(), continuation.valid_at()); assert_eq!( crate::query::breg_encoded_query(&restored.query_pairs().unwrap()), - "accessProfile=reader&$skiptoken=opaque-token" + "accessProfile=reader&cursor=opaque-token" ); } diff --git a/crates/registry-breg-client/tests/http_boundary.rs b/crates/registry-breg-client/tests/http_boundary.rs index 697b18a656..e7ebbd994a 100644 --- a/crates/registry-breg-client/tests/http_boundary.rs +++ b/crates/registry-breg-client/tests/http_boundary.rs @@ -202,16 +202,14 @@ fn happy_response(request: &CapturedRequest, mode: Mode) -> Response { }; if collection { if let Mode::CursorBytes(bytes) = mode { - document["pageInfo"]["nextCursor"] = if request.uri.contains("$skiptoken=") { + document["pageInfo"]["nextCursor"] = if request.uri.contains("cursor=") { Value::Null } else { Value::String("A".repeat(bytes)) }; } } - if collection - && matches!(mode, Mode::MismatchedContinuation) - && request.uri.contains("$skiptoken=") + if collection && matches!(mode, Mode::MismatchedContinuation) && request.uri.contains("cursor=") { document["meta"]["registryId"] = Value::String("other-registry".into()); } @@ -569,7 +567,7 @@ async fn breg_paths_queries_credentials_and_record_representations_are_product_e .expect("filter") .orderby("legalName asc") .expect("ordering") - .top(10) + .limit(10) .expect("top") .count(false); let first_page = client @@ -627,12 +625,12 @@ async fn breg_paths_queries_credentials_and_record_representations_are_product_e assert_eq!(captured[5].accept.as_deref(), Some("application/json")); assert_eq!( captured[6].uri, - "/tenant/prefix/v1/records/companies?accessProfile=public&$select=legalName&$filter=status%20eq%20%27active%27&$orderby=legalName%20asc&$top=10&$count=false" + "/tenant/prefix/v1/records/companies?accessProfile=public&$select=legalName&$filter=status%20eq%20%27active%27&$orderby=legalName%20asc&limit=10&$count=false" ); assert_eq!(captured[6].accept.as_deref(), Some("application/ld+json")); assert_eq!( captured[7].uri, - "/tenant/prefix/v1/records/companies?accessProfile=public&$skiptoken=next-token" + "/tenant/prefix/v1/records/companies?accessProfile=public&cursor=next-token" ); assert!(!captured[7].uri.contains("$select")); assert_eq!(captured[8].method, "POST"); @@ -682,7 +680,7 @@ async fn issued_cursor_envelope_bound_survives_typed_http_continuation() { .options(json_ld_options()) .filter("status eq 'active'") .expect("filter") - .top(1) + .limit(1) .expect("small page") .count(true); let first = client @@ -690,7 +688,7 @@ async fn issued_cursor_envelope_bound_survives_typed_http_continuation() { .await .expect("first page"); let continuation = first.value.continuation.expect("issued continuation"); - assert_eq!(continuation.projection().skiptoken.len(), bytes); + assert_eq!(continuation.projection().cursor.len(), bytes); let last = client .continue_list(&continuation) .await @@ -704,7 +702,7 @@ async fn issued_cursor_envelope_bound_survives_typed_http_continuation() { assert_eq!(pairs.len(), 2); assert_eq!(pairs[0].0, "accessProfile"); assert_eq!(pairs[0].1, "public"); - assert_eq!(pairs[1].0, "$skiptoken"); + assert_eq!(pairs[1].0, "cursor"); assert_eq!(pairs[1].1.len(), bytes); assert_eq!(captured[1].accept.as_deref(), Some("application/ld+json")); } diff --git a/crates/registry-breg-client/tests/read_parity.rs b/crates/registry-breg-client/tests/read_parity.rs index 7770c47ca2..d57200dea9 100644 --- a/crates/registry-breg-client/tests/read_parity.rs +++ b/crates/registry-breg-client/tests/read_parity.rs @@ -51,7 +51,7 @@ async fn handler(State(state): State, request: Request) -> Resp "type":"FeatureCollection", "features":[feature(Value::Null)], "numberReturned":1, - "registry":{"pageInfo":{"nextCursor": if uri.contains("$skiptoken") { Value::Null } else { json!("geo-next") }}} + "registry":{"pageInfo":{"nextCursor": if uri.contains("cursor") { Value::Null } else { json!("geo-next") }}} }) } else { feature(Value::Null) @@ -74,7 +74,7 @@ async fn handler(State(state): State, request: Request) -> Resp let mut document = if collection { json!({ "items":[record()], - "pageInfo":{"nextCursor": if uri.contains("$skiptoken") { Value::Null } else { json!("next") }}, + "pageInfo":{"nextCursor": if uri.contains("cursor") { Value::Null } else { json!("next") }}, "meta":meta() }) } else { @@ -220,7 +220,7 @@ async fn geojson_uses_the_configured_response_body_bound() { let first = client .list_geojson_records( "large-geojson", - &BRegGeoJsonListRequest::default().top(1).unwrap(), + &BRegGeoJsonListRequest::default().limit(1).unwrap(), ) .await .expect("configured bound applies to a GeoJSON collection"); @@ -295,7 +295,7 @@ async fn read_routes_retain_operation_representation_and_snapshot_identity() { let geo = BRegGeoJsonListRequest::default() .options(BRegGeoJsonOptions::default().access_profile("map").unwrap()) .bbox(bbox) - .top(1) + .limit(1) .unwrap(); let first = client .list_geojson_records("companies", &geo) @@ -313,7 +313,7 @@ async fn read_routes_retain_operation_representation_and_snapshot_identity() { .list_records_as_of("companies", &as_of) .await .unwrap(); - let relationship = BRegRelationshipListRequest::default().top(1).unwrap(); + let relationship = BRegRelationshipListRequest::default().limit(1).unwrap(); client .list_relationship_records("companies", RECORD_ID, "related", &relationship) .await @@ -321,7 +321,7 @@ async fn read_routes_retain_operation_representation_and_snapshot_identity() { let snapshot = client .list_snapshot_records( "companies", - &BRegSnapshotListRequest::default().top(1).unwrap(), + &BRegSnapshotListRequest::default().limit(1).unwrap(), ) .await .unwrap(); @@ -340,17 +340,18 @@ async fn read_routes_retain_operation_representation_and_snapshot_identity() { .unwrap(); let captured = captured.lock().unwrap(); - assert!(captured.iter().any(|value| value == "application/geo+json /prefix/v1/records/companies?accessProfile=map&$top=1&bbox=100.1%2C13.1%2C100.2%2C13.2")); - assert!(captured.iter().any(|value| value == "application/geo+json /prefix/v1/records/companies?accessProfile=map&$skiptoken=geo-next")); + assert!(captured.iter().any(|value| value == "application/geo+json /prefix/v1/records/companies?accessProfile=map&limit=1&bbox=100.1%2C13.1%2C100.2%2C13.2")); + assert!(captured.iter().any(|value| value + == "application/geo+json /prefix/v1/records/companies?accessProfile=map&cursor=geo-next")); assert!(captured .iter() .any(|value| value.contains("/companies:as-of?asOf=2026-09-10T00%3A00%3A00Z"))); assert!(captured .iter() - .any(|value| value.contains(&format!("/companies/{RECORD_ID}/related?$top=1")))); + .any(|value| value.contains(&format!("/companies/{RECORD_ID}/related?limit=1")))); assert!(captured .iter() - .any(|value| value.contains("/companies:snapshot?$skiptoken=next"))); + .any(|value| value.contains("/companies:snapshot?cursor=next"))); assert!(captured .iter() .any(|value| value.ends_with(&format!("/companies/{RECORD_ID}")))); diff --git a/crates/registry-breg-mcp/src/gateway.rs b/crates/registry-breg-mcp/src/gateway.rs index 5731e2f79b..5fd096078b 100644 --- a/crates/registry-breg-mcp/src/gateway.rs +++ b/crates/registry-breg-mcp/src/gateway.rs @@ -214,7 +214,7 @@ impl Gateway { /// The citizen's own record, through the registry's linked lookup under /// the delegated token. Anything but exactly one record is a refusal. async fn resolve_own(&self, session: &Session) -> Result { - let request = BRegListRequest::default().options(self.options()?).top(2)?; + let request = BRegListRequest::default().options(self.options()?).limit(2)?; let page = session .client .list_records(&session.contract.details_route, &request) diff --git a/crates/registry-breg/src/api/external_views.rs b/crates/registry-breg/src/api/external_views.rs index 76b36d0b89..05b4610a7d 100644 --- a/crates/registry-breg/src/api/external_views.rs +++ b/crates/registry-breg/src/api/external_views.rs @@ -692,7 +692,7 @@ fn plan_query( strict_query::ParsedReadQueryMode::SkipToken { token } if allows_query => { return Ok(ExternalQueryMode::Continue(token)); } - strict_query::ParsedReadQueryMode::SkipToken { .. } => return Err("$skiptoken"), + strict_query::ParsedReadQueryMode::SkipToken { .. } => return Err("cursor"), strict_query::ParsedReadQueryMode::Query(options) => options, }; if options.select.is_some() { @@ -702,12 +702,12 @@ fn plan_query( return Err("bbox"); } if options.top.is_some() && !allows_query { - return Err("$top"); + return Err("limit"); } let page_size = u16::try_from(options.top.unwrap_or(50)) .ok() .filter(|size| (1..=100).contains(size)) - .ok_or("$top")?; + .ok_or("limit")?; let equality = options .filter .map(|filter| { diff --git a/crates/registry-breg/src/api/gis.rs b/crates/registry-breg/src/api/gis.rs index bb86836388..e8566a4117 100644 --- a/crates/registry-breg/src/api/gis.rs +++ b/crates/registry-breg/src/api/gis.rs @@ -828,13 +828,13 @@ fn query_options( authorized.collection.profile_id.clone(), )); if let Some(cursor) = query.cursor { - pairs.push(("$skiptoken".to_owned(), cursor)); + pairs.push(("cursor".to_owned(), cursor)); } else { let page_size = query .limit .map(|limit| limit.min(u32::from(authorized.collection.max_page_size))) .unwrap_or(u32::from(authorized.collection.max_page_size)); - pairs.push(("$top".to_owned(), page_size.to_string())); + pairs.push(("limit".to_owned(), page_size.to_string())); if let Some(bbox) = query.bbox { pairs.push(("bbox".to_owned(), bbox)); } @@ -947,6 +947,9 @@ mod tests { assert_eq!(query.limit, Some(1000)); assert_eq!(query.cursor, None); + for raw in ["%24top=2", "%24skiptoken=opaque", "limit=2&limit=2"] { + assert_eq!(parse_items_query(Some(raw)), Err(QueryParseError::Invalid)); + } assert_eq!( parse_items_query(Some("cursor=opaque&bbox=100,13,101,14")), Err(QueryParseError::Invalid) @@ -1070,6 +1073,11 @@ mod tests { ["parameters"] .as_array() .expect("GIS item query parameters"); + let names: Vec<_> = parameters + .iter() + .map(|parameter| parameter["name"].as_str().expect("query parameter name")) + .collect(); + assert_eq!(names, ["bbox", "limit", "cursor", "f"]); let cursor = parameters .iter() .find(|parameter| parameter["name"] == "cursor") diff --git a/crates/registry-breg/src/api/metadata.rs b/crates/registry-breg/src/api/metadata.rs index a84062fb2d..59275501e0 100644 --- a/crates/registry-breg/src/api/metadata.rs +++ b/crates/registry-breg/src/api/metadata.rs @@ -268,7 +268,7 @@ fn query_metadata(surface: &AuthorizedSurface<'_>, query: &CompiledQueryOperatio "maximumPageSize": query.max_page_size, "maximumFilterClauses": MAX_FILTER_CLAUSES, "maximumInValues": MAX_IN_VALUES, - "pagination": {"parameter": "$skiptoken", "responsePath": "pageInfo.nextCursor", "exclusive": true}, + "pagination": {"parameter": "cursor", "responsePath": "pageInfo.nextCursor", "exclusive": true}, "temporal": temporal_metadata(query), }); if !query.required_filters.is_empty() { @@ -355,7 +355,7 @@ fn request(surface: &AuthorizedSurface<'_>, query: Option<&CompiledQueryOperatio parameters.push("$select"); } if let Some(query) = query { - parameters.extend(["$top", "$skiptoken"]); + parameters.extend(["limit", "cursor"]); if !query.filter_fields.is_empty() { parameters.push("$filter"); } diff --git a/crates/registry-breg/src/api/mod.rs b/crates/registry-breg/src/api/mod.rs index 48c4428dc7..3fa675c1d9 100644 --- a/crates/registry-breg/src/api/mod.rs +++ b/crates/registry-breg/src/api/mod.rs @@ -945,7 +945,7 @@ async fn read_dispatch( &route, &claims, path.get("record_id"), - error.record_problem(), + error.problem(), &correlation, ) .await; @@ -1234,7 +1234,7 @@ async fn lookup_dispatch( &route, &claims, None, - error.record_problem(), + error.problem(), &correlation, ) .await; @@ -1503,7 +1503,7 @@ async fn revision_dispatch( &route, &claims, path.get("record_id"), - error.record_problem(), + error.problem(), &correlation, ) .await; @@ -2409,13 +2409,13 @@ async fn batch_dispatch( }; let parsed = match parse_batch_body(&body, usize::from(batch.maximum_items)) { Ok(parsed) => parsed, - Err(location) => { + Err(refusal) => { return audited_mutation_refusal( mutations, &route, &surface.context, None, - body_refusal(location), + refusal.into_response(), &correlation, ) .await; @@ -3752,7 +3752,7 @@ async fn read_query( .top .map(u16::try_from) .transpose() - .map_err(|_| ReadQueryError::InvalidAt("$top"))? + .map_err(|_| ReadQueryError::InvalidAt("limit"))? .unwrap_or(operation.max_page_size); let include_count = query_options.count.unwrap_or(false); if include_count && !operation.allow_count { @@ -4347,7 +4347,7 @@ fn validate_query_shape( page_size: u16, ) -> Result<(), ReadQueryError> { if page_size == 0 || page_size > operation.max_page_size { - return Err(ReadQueryError::InvalidAt("$top")); + return Err(ReadQueryError::InvalidAt("limit")); } let mut stats = QueryShapeStats::default(); if let Some(filter) = filter { @@ -5191,7 +5191,7 @@ impl QueryOptions { let options = self.query_options(); [ ("asOf", self.parsed.as_of.is_some()), - ("$skiptoken", self.skiptoken().is_some()), + ("cursor", self.skiptoken().is_some()), ( "$filter", options.is_some_and(|options| options.filter.is_some()), @@ -5200,7 +5200,10 @@ impl QueryOptions { "$orderby", options.is_some_and(|options| options.orderby.is_some()), ), - ("$top", options.is_some_and(|options| options.top.is_some())), + ( + "limit", + options.is_some_and(|options| options.top.is_some()), + ), ( "$count", options.is_some_and(|options| options.count.is_some()), @@ -5276,16 +5279,6 @@ impl QueryParseError { Self::InvalidAt(parameter) => invalid_query_at(parameter), } } - - fn record_problem(self) -> Response { - match self { - Self::InvalidAt("limit") => invalid_query_at_with_detail( - "limit", - "A record listing takes `$top` for its page size; `limit` is not accepted.", - ), - other => other.problem(), - } - } } /// A refused read query. `InvalidAt` names the one fixed parameter at fault. @@ -5823,37 +5816,65 @@ struct ParsedBatchBody { change_context: Option, } +#[derive(Debug)] +enum BatchBodyRefusal { + Invalid(Option), + RetiredRecordIdentifier(RequestLocation), +} + +impl IntoResponse for BatchBodyRefusal { + fn into_response(self) -> Response { + match self { + Self::Invalid(location) => body_refusal(location), + Self::RetiredRecordIdentifier(location) => { + let code = ProblemCode::RequestInvalid; + crate::correlation::problem_response_with_field_path( + StatusCode::BAD_REQUEST, + code.title(), + "replace recordIdentifier with recordId in the patch item", + code.code(), + location.as_str(), + ) + } + } + } +} + /// Parse a batch body, naming the fixed member at fault. A member name the /// caller invented is never named: the location stops at its container. fn parse_batch_body( body: &[u8], maximum_items: usize, -) -> Result> { - let value = parse_json_strict(body).map_err(|_| None)?; - let object = value.as_object().ok_or(None)?; +) -> Result { + let value = parse_json_strict(body).map_err(|_| BatchBodyRefusal::Invalid(None))?; + let object = value.as_object().ok_or(BatchBodyRefusal::Invalid(None))?; if object .keys() .any(|key| !matches!(key.as_str(), "items" | "changeContext")) { - return Err(None); + return Err(BatchBodyRefusal::Invalid(None)); } let change_context = object .get("changeContext") .map(crate::history_context::ChangeContext::parse_json) .transpose() - .map_err(|_| Some(RequestLocation::batch_change_context()))?; + .map_err(|_| BatchBodyRefusal::Invalid(Some(RequestLocation::batch_change_context())))?; let items = object .get("items") .and_then(Value::as_array) - .ok_or_else(|| Some(RequestLocation::batch_items()))?; + .ok_or_else(|| BatchBodyRefusal::Invalid(Some(RequestLocation::batch_items())))?; if items.is_empty() || items.len() > maximum_items { - return Err(Some(RequestLocation::batch_items())); + return Err(BatchBodyRefusal::Invalid(Some( + RequestLocation::batch_items(), + ))); } let items = items .iter() .enumerate() .map(|(index, item)| { - let at = |member| Some(RequestLocation::batch_item(index, member)); + let at = |member| { + BatchBodyRefusal::Invalid(Some(RequestLocation::batch_item(index, member))) + }; let object = item.as_object().ok_or_else(|| at(None))?; match object.get("operation").and_then(Value::as_str) { Some("create") => { @@ -5867,6 +5888,11 @@ fn parse_batch_body( Ok(BatchMutationItem::Create(data.clone())) } Some("patch") => { + if object.contains_key("recordIdentifier") { + return Err(BatchBodyRefusal::RetiredRecordIdentifier( + RequestLocation::batch_item(index, Some(BatchItemMember::RecordId)), + )); + } let record_id = object .get("recordId") .and_then(Value::as_str) @@ -5888,7 +5914,9 @@ fn parse_batch_body( } let patch = parse_json_patch_document(patch.clone()).map_err(|error| { match error.in_batch_item(index) { - MutationError::InvalidRequestAt(location) => Some(location), + MutationError::InvalidRequestAt(location) => { + BatchBodyRefusal::Invalid(Some(location)) + } _ => at(Some(BatchItemMember::Patch)), } })?; @@ -6204,8 +6232,41 @@ fn field_encryption_refusal(service: &HttpService, entity: &CompiledEntity) -> O #[cfg(test)] mod batch_admission_tests { use super::parse_batch_body; + use axum::response::IntoResponse as _; use serde_json::json; + #[tokio::test] + async fn a_patch_item_names_the_replacement_for_the_retired_record_key() { + let record_id = "00000000-0000-4000-8000-000000000001"; + let item = json!({ + "operation": "patch", + "recordIdentifier": record_id, + "ifMatch": "\"etag\"", + "patch": [{"op": "replace", "path": "/label", "value": "discard this canary"}] + }); + let refused = json!({"items": [item]}); + let Err(refusal) = parse_batch_body(&serde_json::to_vec(&refused).unwrap(), 1) else { + panic!("a retired envelope key must be refused"); + }; + let response = refusal.into_response(); + assert_eq!(response.status(), super::StatusCode::BAD_REQUEST); + let bytes = axum::body::to_bytes(response.into_body(), 16_384) + .await + .unwrap(); + let problem: serde_json::Value = serde_json::from_slice(&bytes).unwrap(); + assert_eq!(problem["code"], "request.invalid"); + assert_eq!(problem["fieldPath"], "/items/0/recordId"); + assert_eq!( + problem["detail"], + "replace recordIdentifier with recordId in the patch item" + ); + assert!(!problem.to_string().contains(record_id)); + assert!(!problem.to_string().contains("discard this canary")); + + let create = json!({"items": [{"operation": "create", "data": {"recordIdentifier": "domain value"}}]}); + assert!(parse_batch_body(&serde_json::to_vec(&create).unwrap(), 1).is_ok()); + } + #[test] fn correction_context_is_shared_and_validated_before_items_execute() { let item = json!({"operation": "create", "data": {"label": "fixture"}}); diff --git a/crates/registry-breg/src/artifacts.rs b/crates/registry-breg/src/artifacts.rs index 9a75742cae..d75297293e 100644 --- a/crates/registry-breg/src/artifacts.rs +++ b/crates/registry-breg/src/artifacts.rs @@ -3238,7 +3238,7 @@ fn read_query_parameters( "One compiled sortable property, ascending only.", ), query_parameter( - "$top", + "limit", false, false, json!({"type": "integer", "minimum": 1, "maximum": max_page_size(route, query, access_profiles)}), @@ -3252,7 +3252,7 @@ fn read_query_parameters( "Request count when the selected compiled query profile allows it.", ), query_parameter( - "$skiptoken", + "cursor", false, false, json!({"type": "string", "maxLength": crate::query::MAX_CURSOR_TOKEN_BYTES}), @@ -3284,7 +3284,7 @@ fn read_query_parameters( false, false, json!({"type": "string", "maxLength": 256, "example": "100.4,13.6,100.6,13.8"}), - "Inclusive west,south,east,north CRS84 bounds within the selected profile's maximum spans. Finite decimal or exponent coordinates only; zero spans are valid. No crossing, 3D, alternate CRS or temporal queries. ANDed with $filter. Continuations carry only $skiptoken and routing/profile context.", + "Inclusive west,south,east,north CRS84 bounds within the selected profile's maximum spans. Finite decimal or exponent coordinates only; zero spans are valid. No crossing, 3D, alternate CRS or temporal queries. ANDed with $filter. Continuations carry only cursor and routing/profile context.", )); } parameters @@ -4745,6 +4745,7 @@ fn problem_schema() -> Value { "if": {"properties": {"code": {"const": "access-profile.ambiguous"}}}, "then": { "required": ["accessProfiles"], + "not": {"required": ["failedCheck"]}, "properties": {"status": {"const": 400}}, // The enclosing Problem schema owns all other members. "additionalProperties": true diff --git a/crates/registry-breg/src/cursor.rs b/crates/registry-breg/src/cursor.rs index 2857b6e67b..6c836f67d4 100644 --- a/crates/registry-breg/src/cursor.rs +++ b/crates/registry-breg/src/cursor.rs @@ -711,7 +711,7 @@ mod tests { assert!(registry_breg_client::BRegContinuation::try_from_projection( registry_breg_client::BRegContinuationProjection { route: "assets".to_owned(), - skiptoken: token, + cursor: token, format: registry_breg_client::BRegRecordFormat::Json, access_profile: Some("operator".to_owned()), registry_identifier: "registry".to_owned(), diff --git a/crates/registry-breg/src/data.rs b/crates/registry-breg/src/data.rs index 5bede4a540..4ecc9a472a 100644 --- a/crates/registry-breg/src/data.rs +++ b/crates/registry-breg/src/data.rs @@ -2053,7 +2053,7 @@ where &plan.route_path, &[ ("accessProfile", plan.profile_id.as_str()), - ("$skiptoken", cursor), + ("cursor", cursor), ], ) } else { @@ -2062,7 +2062,7 @@ where &[ ("accessProfile", plan.profile_id.as_str()), ("$select", fields.as_str()), - ("$top", page_size.as_str()), + ("limit", page_size.as_str()), ], ) }; diff --git a/crates/registry-breg/src/external_view_artifacts.rs b/crates/registry-breg/src/external_view_artifacts.rs index fc9040f9cb..ae9fb48906 100644 --- a/crates/registry-breg/src/external_view_artifacts.rs +++ b/crates/registry-breg/src/external_view_artifacts.rs @@ -279,11 +279,11 @@ fn profile_parameter() -> Value { } fn size_parameter() -> Value { - json!({"name":"$top","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}}) + json!({"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}}) } fn cursor_parameter() -> Value { - json!({"name":"$skiptoken","in":"query","description":"Use alone with the same access profile","schema":{"type":"string"}}) + json!({"name":"cursor","in":"query","description":"Use alone with the same access profile","schema":{"type":"string"}}) } fn count_schema() -> Value { diff --git a/crates/registry-breg/src/fixtures.rs b/crates/registry-breg/src/fixtures.rs index 41648f7de5..a00da91d98 100644 --- a/crates/registry-breg/src/fixtures.rs +++ b/crates/registry-breg/src/fixtures.rs @@ -4536,7 +4536,7 @@ fn fixture_query_options( parameters.push(("$select", fields.join(","))); } if let Some(top) = top { - parameters.push(("$top", top.to_string())); + parameters.push(("limit", top.to_string())); } if count { parameters.push(("$count", "true".to_owned())); diff --git a/crates/registry-breg/src/query.rs b/crates/registry-breg/src/query.rs index 281ddc6cfc..e962e604e1 100644 --- a/crates/registry-breg/src/query.rs +++ b/crates/registry-breg/src/query.rs @@ -623,7 +623,7 @@ where } /// The fixed query parameter names a refusal may name as its location. -pub const QUERY_PARAMETERS: [&str; 12] = [ +pub const QUERY_PARAMETERS: [&str; 13] = [ "$select", "$filter", "$orderby", @@ -636,6 +636,7 @@ pub const QUERY_PARAMETERS: [&str; 12] = [ "snapshot", "validAt", "limit", + "cursor", ]; /// The fixed name of `key`, when a refusal while reading it is its own. @@ -713,13 +714,14 @@ where _ => builder.apply(key, value).map_err(located)?, } } + let cursor_parameter = builder.cursor_parameter(); let parsed = builder.finish_located()?; // Continuations carry the already selected snapshot and validity value. // Accepting a second value would make one request describe two queries. if matches!(parsed.mode, ParsedReadQueryMode::SkipToken { .. }) && (snapshot.is_some() || valid_at.is_some()) { - return Err((QueryParseError::ConflictingOptions, Some("$skiptoken"))); + return Err((QueryParseError::ConflictingOptions, cursor_parameter)); } Ok(ParsedSnapshotQuery { access_profile: parsed.access_profile, @@ -739,7 +741,7 @@ struct QueryBuilder { top: Option, count: Option, bbox: Option, - skiptoken: Option, + skiptoken: Option<(String, &'static str)>, } impl QueryBuilder { @@ -768,7 +770,7 @@ impl QueryBuilder { ensure_absent(self.orderby.is_none())?; self.orderby = Some(parse_orderby(value)?); } - "$top" => { + "limit" | "$top" => { ensure_absent(self.top.is_none())?; self.top = Some(parse_top(value)?); } @@ -780,12 +782,19 @@ impl QueryBuilder { ensure_absent(self.bbox.is_none())?; self.bbox = Some(parse_bbox(value)?); } - "$skiptoken" => { + "cursor" | "$skiptoken" => { ensure_absent(self.skiptoken.is_none())?; - self.skiptoken = Some(parse_opaque_value(value, MAX_CURSOR_TOKEN_BYTES)?); + let name = if key == "cursor" { + "cursor" + } else { + "$skiptoken" + }; + self.skiptoken = Some((parse_opaque_value(value, MAX_CURSOR_TOKEN_BYTES)?, name)); + } + "fields" | "filter" | "sort" | "pageSize" | "$skip" | "$apply" | "$expand" + | "$batch" => { + return Err(QueryParseError::DisallowedOption); } - "fields" | "filter" | "sort" | "pageSize" | "cursor" | "limit" | "$skip" | "$apply" - | "$expand" | "$batch" => return Err(QueryParseError::DisallowedOption), "$query" | "query" | "sql" | "statement" => { return Err(QueryParseError::DisallowedOption); } @@ -794,10 +803,15 @@ impl QueryBuilder { Ok(()) } - /// A continuation carries its whole query, so a conflict is always the - /// `$skiptoken` parameter's. + fn cursor_parameter(&self) -> Option<&'static str> { + self.skiptoken.as_ref().map(|(_, parameter)| *parameter) + } + + /// A continuation carries its whole query, so a conflict names the + /// supplied cursor parameter. fn finish_located(self) -> Result)> { - self.finish().map_err(|error| (error, Some("$skiptoken"))) + let cursor_parameter = self.cursor_parameter(); + self.finish().map_err(|error| (error, cursor_parameter)) } fn finish(self) -> Result { @@ -810,7 +824,7 @@ impl QueryBuilder { bbox: self.bbox, }; let mode = match self.skiptoken { - Some(token) => { + Some((token, _)) => { if self.as_of.is_some() || options.has_any_option() { return Err(QueryParseError::ConflictingOptions); } @@ -1878,13 +1892,8 @@ mod tests { #[test] fn rejects_unknown_disallowed_and_duplicate_options() { - assert_eq!( - parse([("limit", "10")]), - Err(QueryParseError::DisallowedOption) - ); for key in [ - "fields", "filter", "sort", "pageSize", "cursor", "$skip", "$apply", "$expand", - "$batch", "sql", + "fields", "filter", "sort", "pageSize", "$skip", "$apply", "$expand", "$batch", "sql", ] { assert_eq!( parse([(key, "value")]), @@ -1897,6 +1906,40 @@ mod tests { ); } + #[test] + fn pagination_names_share_query_and_cursor_rules() { + assert_eq!(parse([("limit", "10")]), parse([("$top", "10")])); + assert_eq!( + parse([("accessProfile", "reader"), ("cursor", "opaque-token")]), + parse([("accessProfile", "reader"), ("$skiptoken", "opaque-token"),]) + ); + for (parameters, duplicate) in [ + ([("$top", "10"), ("limit", "10")], "limit"), + ([("limit", "10"), ("$top", "10")], "$top"), + ([("$skiptoken", "same"), ("cursor", "same")], "cursor"), + ([("cursor", "same"), ("$skiptoken", "same")], "$skiptoken"), + ] { + assert_eq!( + parse_read_query_located(parameters), + Err((QueryParseError::DuplicateOption, Some(duplicate))) + ); + } + assert_eq!( + parse_read_query_located([("limit", "101")]), + Err((QueryParseError::InvalidValue, Some("limit"))) + ); + assert_eq!( + parse_read_query_located([("cursor", "opaque-token"), ("limit", "10")]), + Err((QueryParseError::ConflictingOptions, Some("cursor"))) + ); + for key in ["cursor", "$skiptoken"] { + assert_eq!( + parse_snapshot_query_located([(key, "opaque-token"), ("validAt", "later")]), + Err((QueryParseError::ConflictingOptions, Some(key))) + ); + } + } + #[test] fn skiptoken_only_allows_access_profile() { let query = parse([("accessProfile", "reader"), ("$skiptoken", "opaque-token")]) diff --git a/crates/registry-breg/tests/compiler_contract.rs b/crates/registry-breg/tests/compiler_contract.rs index f8a763d765..1afb6353a9 100644 --- a/crates/registry-breg/tests/compiler_contract.rs +++ b/crates/registry-breg/tests/compiler_contract.rs @@ -7625,10 +7625,10 @@ fn compiled_query_inventory_is_profile_scoped_bounded_and_temporal() { "$filter", "$orderby", "$select", - "$skiptoken", - "$top", "Accept", "accessProfile", + "cursor", + "limit", "traceparent", ] ); @@ -7642,11 +7642,11 @@ fn compiled_query_inventory_is_profile_scoped_bounded_and_temporal() { "$filter", "$orderby", "$select", - "$skiptoken", - "$top", "Accept", "accessProfile", "asOf", + "cursor", + "limit", "traceparent", ] ); @@ -7661,8 +7661,8 @@ fn compiled_query_inventory_is_profile_scoped_bounded_and_temporal() { assert_eq!(as_of["schema"], json!({"type": "string", "format": "date"})); let page_size = as_of_parameters .iter() - .find(|parameter| parameter["name"] == "$top") - .expect("$top parameter is rendered"); + .find(|parameter| parameter["name"] == "limit") + .expect("limit parameter is rendered"); assert_eq!( page_size["schema"], json!({"type": "integer", "minimum": 1, "maximum": 100}) @@ -7677,7 +7677,7 @@ fn compiled_query_inventory_is_profile_scoped_bounded_and_temporal() { .as_array() .unwrap() .iter() - .find(|parameter| parameter["name"] == "$skiptoken") + .find(|parameter| parameter["name"] == "cursor") .expect("continuation query parameter is rendered"); assert_eq!( cursor_parameter["schema"]["maxLength"], @@ -7931,10 +7931,10 @@ fn snapshot_operation_is_authenticated_stored_field_history_contract() { "$filter", "$orderby", "$select", - "$skiptoken", - "$top", "Accept", "accessProfile", + "cursor", + "limit", "snapshot", "traceparent", "validAt", diff --git a/crates/registry-breg/tests/http_auth.rs b/crates/registry-breg/tests/http_auth.rs index a16bf56ee4..40c7add613 100644 --- a/crates/registry-breg/tests/http_auth.rs +++ b/crates/registry-breg/tests/http_auth.rs @@ -357,17 +357,33 @@ impl Harness { } async fn with_registry(registry: Arc) -> Self { + Self::with_registry_and_posture(registry, registry_platform_config::Posture::Production) + .await + } + + async fn with_registry_and_posture( + registry: Arc, + posture: registry_platform_config::Posture, + ) -> Self { let idp = MockIdp::start().await; let authenticator = authenticator(®istry, &idp, authority_claims()) .expect("authentication config is valid"); let records = Arc::new(RecordingReadService::default()); - let service = Arc::new(HttpService::new( - Arc::clone(®istry), - read_identity(), - records.clone(), - Arc::new(Ready), - cursor_codec(), - )); + let service = Arc::new( + HttpService::new( + Arc::clone(®istry), + read_identity(), + records.clone(), + Arc::new(Ready), + cursor_codec(), + ) + .with_declared_posture_for_test( + registry_platform_config::DeclaredPosture { + posture, + source: registry_platform_config::PostureSource::Default, + }, + ), + ); let authenticator = Arc::new(authenticator); let app = authenticated_router(service, Arc::clone(&authenticator)); Self { @@ -3191,7 +3207,11 @@ async fn an_ambiguous_route_answers_400_with_the_admitted_profile_ids() { .entries .iter() .all(|entry| entry.default_profile_id.is_none())); - let harness = Harness::with_registry(registry).await; + let harness = Harness::with_registry_and_posture( + registry, + registry_platform_config::Posture::Development, + ) + .await; let token = harness.valid_token(); let path = "/v1/records/cases/00000000-0000-4000-8000-000000000001"; let response = harness.send(path, &[bearer(&token)], None).await; @@ -3205,6 +3225,19 @@ async fn an_ambiguous_route_answers_400_with_the_admitted_profile_ids() { "ambiguity is not counted as an authority refusal" ); let body = body_json(response).await; + let document: Value = serde_json::from_str(include_str!( + "../../../products/breg/generated/facility/generated/openapi.json" + )) + .unwrap(); + let problem = jsonschema::JSONSchema::options() + .with_draft(jsonschema::Draft::Draft202012) + .compile(&document["components"]["schemas"]["Problem"]) + .unwrap(); + assert!(body.get("failedCheck").is_none()); + assert!(problem.is_valid(&body), "{body}"); + let mut incorrectly_tagged = body.clone(); + incorrectly_tagged["failedCheck"] = json!("access-profile"); + assert!(!problem.is_valid(&incorrectly_tagged)); assert_eq!(body["code"], "access-profile.ambiguous"); assert_eq!( body["type"], diff --git a/crates/registry-breg/tests/http_read_only.rs b/crates/registry-breg/tests/http_read_only.rs index f57820be88..3121a4e34f 100644 --- a/crates/registry-breg/tests/http_read_only.rs +++ b/crates/registry-breg/tests/http_read_only.rs @@ -695,14 +695,7 @@ async fn snapshot_route_requires_its_own_current_authority_and_never_calls_live_ assert_eq!( operation["request"]["queryParameters"], json!([ - "$count", - "$filter", - "$orderby", - "$select", - "$skiptoken", - "$top", - "snapshot", - "validAt" + "$count", "$filter", "$orderby", "$select", "cursor", "limit", "snapshot", "validAt" ]) ); for (suffix, claims) in [ @@ -2054,15 +2047,19 @@ async fn derived_fields_are_discoverable_as_read_only_response_properties() { async fn continuation_requests_refuse_query_overrides_before_record_io() { let harness = Harness::new(true); let before = harness.records.calls(); - let response = harness - .send( - Method::GET, - "/v1/records/cases?$skiptoken=opaque-token&$select=label", - Some(public_claims()), - ) - .await; - assert_eq!(response.status(), StatusCode::BAD_REQUEST); - assert_eq!(body_json(response).await["code"], "query.invalid"); + for parameter in ["cursor", "$skiptoken"] { + let response = harness + .send( + Method::GET, + &format!("/v1/records/cases?{parameter}=opaque-token&$select=label"), + Some(public_claims()), + ) + .await; + assert_eq!(response.status(), StatusCode::BAD_REQUEST); + let problem = body_json(response).await; + assert_eq!(problem["code"], "query.invalid"); + assert_eq!(problem["fieldPath"], parameter); + } assert_eq!(harness.records.calls(), before); } @@ -2107,7 +2104,6 @@ async fn legacy_query_keys_are_not_accepted() { "/v1/records/cases?filter=label:equals:Visible", "/v1/records/cases?sort=label", "/v1/records/cases?pageSize=25", - "/v1/records/cases?cursor=opaque-token", ] { let response = harness.send(Method::GET, uri, Some(public_claims())).await; assert_eq!(response.status(), StatusCode::BAD_REQUEST, "{uri}"); @@ -2122,34 +2118,34 @@ fn retired_proposal_history_query_name_is_not_advertised() { } #[tokio::test] -async fn record_list_limit_refusal_names_limit_and_guides_top() { +async fn record_list_accepts_limit_and_top_and_refuses_ambiguous_sizes() { let harness = Harness::new(true); - let response = harness - .send( - Method::GET, - "/v1/records/cases?limit=1", - Some(public_claims()), - ) - .await; - assert_eq!(response.status(), StatusCode::BAD_REQUEST); - let problem = body_json(response).await; - assert_eq!(problem["code"], "query.invalid", "{problem}"); - assert_eq!(problem["fieldPath"], "limit", "{problem}"); - assert!( - problem["detail"].as_str().unwrap().contains("`$top`"), - "{problem}" - ); + for query in ["limit=0", "$top=1&limit=1"] { + let response = harness + .send( + Method::GET, + &format!("/v1/records/cases?{query}"), + Some(public_claims()), + ) + .await; + assert_eq!(response.status(), StatusCode::BAD_REQUEST, "{query}"); + let problem = body_json(response).await; + assert_eq!(problem["code"], "query.invalid", "{problem}"); + assert_eq!(problem["fieldPath"], "limit", "{problem}"); + } assert_eq!(harness.records.calls(), 0); - let accepted = harness - .send( - Method::GET, - "/v1/records/cases?$top=1", - Some(public_claims()), - ) - .await; - assert_eq!(accepted.status(), StatusCode::OK); - assert_eq!(harness.records.last_request().maximum_records, 2); + for query in ["limit=1", "$top=1"] { + let accepted = harness + .send( + Method::GET, + &format!("/v1/records/cases?{query}"), + Some(public_claims()), + ) + .await; + assert_eq!(accepted.status(), StatusCode::OK, "{query}"); + assert_eq!(harness.records.last_request().maximum_records, 2); + } } #[tokio::test] @@ -2454,12 +2450,14 @@ async fn continuation_keeps_the_criteria_and_cannot_drop_them() { let first_query = request_query(&first_request); let token = required_filters_cursor(first_query); - let next = required_filters_list(&harness, &format!("&$skiptoken={token}")).await; - assert_eq!(next.status(), StatusCode::OK); - let next_request = harness.records.last_request(); - let next_query = request_query(&next_request); - assert!(next_query.continuation.is_some()); - assert_eq!(single_filter_predicate(next_query).field_id, "label"); + for parameter in ["cursor", "$skiptoken"] { + let next = required_filters_list(&harness, &format!("&{parameter}={token}")).await; + assert_eq!(next.status(), StatusCode::OK, "{parameter}"); + let next_request = harness.records.last_request(); + let next_query = request_query(&next_request); + assert!(next_query.continuation.is_some()); + assert_eq!(single_filter_predicate(next_query).field_id, "label"); + } // The same cursor without its filter no longer matches its own binding. let mut stripped = serde_json::to_value(&first_query.cursor_query).expect("query serializes"); @@ -3362,10 +3360,10 @@ async fn discovery_surfaces_share_caller_filtered_routes_and_fields() { "$filter", "$orderby", "$select", - "$skiptoken", - "$top", "Accept", "accessProfile", + "cursor", + "limit", "traceparent", ] ); @@ -3394,8 +3392,8 @@ async fn discovery_surfaces_share_caller_filtered_routes_and_fields() { .as_array() .expect("query parameters are rendered") .iter() - .find(|parameter| parameter["name"] == "$top") - .expect("$top parameter is rendered"); + .find(|parameter| parameter["name"] == "limit") + .expect("limit parameter is rendered"); assert_eq!(page_size["required"], false); assert_eq!( page_size["schema"], @@ -3902,7 +3900,7 @@ async fn real_router_serves_only_authorized_explicit_revision_routes() { let extra_query = send_to( &app, Method::GET, - &format!("{list_path}?accessProfile=caseworker&$top=1"), + &format!("{list_path}?accessProfile=caseworker&limit=1"), Some(caseworker_claims("case-management")), ) .await; @@ -3911,7 +3909,7 @@ async fn real_router_serves_only_authorized_explicit_revision_routes() { assert_eq!(extra_query["code"], "query.invalid"); // A revision route takes no read query option; the first one sent, in a // fixed order, is named. - assert_eq!(extra_query["fieldPath"], "$top"); + assert_eq!(extra_query["fieldPath"], "limit"); assert_eq!(revisions.calls.load(Ordering::SeqCst), 0); // A query string that is not `name=value` pairs has no single parameter @@ -4522,14 +4520,7 @@ async fn workspace_metadata_keeps_route_fields_selectors_and_query_capabilities_ ); assert_eq!( path["request"]["queryParameters"], - json!([ - "$count", - "$filter", - "$orderby", - "$select", - "$skiptoken", - "$top" - ]) + json!(["$count", "$filter", "$orderby", "$select", "cursor", "limit"]) ); assert_eq!( path["query"]["maximumPageSize"], diff --git a/crates/registry-breg/tests/postgres_client_capabilities.rs b/crates/registry-breg/tests/postgres_client_capabilities.rs index 181098ffa8..b2e39d203f 100644 --- a/crates/registry-breg/tests/postgres_client_capabilities.rs +++ b/crates/registry-breg/tests/postgres_client_capabilities.rs @@ -220,7 +220,7 @@ async fn sdk_atomic_corrections_snapshots_revisions_tombstone_and_recovery_use_r &BRegSnapshotListRequest::default() .orderby("validFrom") .unwrap() - .top(1) + .limit(1) .unwrap(), ) .await diff --git a/crates/registry-breg/tests/postgres_client_relationships.rs b/crates/registry-breg/tests/postgres_client_relationships.rs index 53fe6690cb..bb815543e8 100644 --- a/crates/registry-breg/tests/postgres_client_relationships.rs +++ b/crates/registry-breg/tests/postgres_client_relationships.rs @@ -160,7 +160,7 @@ async fn sdk_relationship_continuation_keeps_source_path_authority_and_target_pr .orderby("personCode") .unwrap() .count(true) - .top(1) + .limit(1) .unwrap(); let mut page = client .list_relationship_records( diff --git a/crates/registry-breg/tests/postgres_record_profile_conformance.rs b/crates/registry-breg/tests/postgres_record_profile_conformance.rs index 659d985b06..4667c572b0 100644 --- a/crates/registry-breg/tests/postgres_record_profile_conformance.rs +++ b/crates/registry-breg/tests/postgres_record_profile_conformance.rs @@ -611,7 +611,7 @@ async fn exercise_breg_client( "public-units", &BRegListRequest::default() .options(public_options) - .top(1) + .limit(1) .expect("one is a valid BReg page size"), ) .await diff --git a/crates/registry-breg/tests/postgres_spatial_read.rs b/crates/registry-breg/tests/postgres_spatial_read.rs index ad26e46d91..d28fbc12a1 100644 --- a/crates/registry-breg/tests/postgres_spatial_read.rs +++ b/crates/registry-breg/tests/postgres_spatial_read.rs @@ -135,7 +135,7 @@ async fn sdk_bbox_geojson_and_continuations_use_real_postgis() { .unwrap(), ) .bbox(bbox) - .top(2) + .limit(2) .unwrap(); let mut page = client .list_geojson_records("service-sites", &request) diff --git a/crates/registry-bregctl/src/data_lifecycle.rs b/crates/registry-bregctl/src/data_lifecycle.rs index 5ef8a47983..1183ee1ef6 100644 --- a/crates/registry-bregctl/src/data_lifecycle.rs +++ b/crates/registry-bregctl/src/data_lifecycle.rs @@ -972,6 +972,9 @@ fn map_ingestion_error(error: BRegIngestionError) -> DataLifecycleError { BRegIngestionError::EmptyChunk | BRegIngestionError::InvalidItem | BRegIngestionError::BodyEncoding => DataLifecycleError::Data(DataError::InvalidItem), + BRegIngestionError::RetiredRecordIdentifier => { + DataLifecycleError::Data(DataError::RetiredRecordIdentifier) + } BRegIngestionError::BodyTooLarge => DataLifecycleError::Data(DataError::ItemTooLarge), BRegIngestionError::InvalidDigest | BRegIngestionError::UnsupportedChunkAlgorithm diff --git a/crates/registry-bregctl/src/lib.rs b/crates/registry-bregctl/src/lib.rs index b56987c5f6..a94215da77 100644 --- a/crates/registry-bregctl/src/lib.rs +++ b/crates/registry-bregctl/src/lib.rs @@ -12023,9 +12023,9 @@ fn explain_queries(compiled: &CompiledRegistry) -> serde_json::Result { "select": "$select", "filter": "$filter", "orderBy": "$orderby", - "pageSize": "$top", + "pageSize": "limit", "count": "$count", - "cursor": "$skiptoken", + "cursor": "cursor", "accessProfile": "accessProfile", "asOf": "asOf", }, diff --git a/crates/registry-coordinator/src/read_in_force.rs b/crates/registry-coordinator/src/read_in_force.rs index 0a19ca69a3..a0b4dfa545 100644 --- a/crates/registry-coordinator/src/read_in_force.rs +++ b/crates/registry-coordinator/src/read_in_force.rs @@ -137,7 +137,7 @@ pub(crate) async fn read_in_force( // is an overlap, and a third is never needed to know that. let Ok(request) = BRegAsOfListRequest::new(as_of) .and_then(|request| request.options(options.clone()).filter(filter)) - .and_then(|request| request.top(2)) + .and_then(|request| request.limit(2)) else { return refused("invalid-command"); }; diff --git a/crates/registry-coordinator/tests/read_in_force_adapter.rs b/crates/registry-coordinator/tests/read_in_force_adapter.rs index e9f79e887c..f007001096 100644 --- a/crates/registry-coordinator/tests/read_in_force_adapter.rs +++ b/crates/registry-coordinator/tests/read_in_force_adapter.rs @@ -236,7 +236,7 @@ async fn the_request_is_one_as_of_read_with_an_equality_filter_and_top_two() { "$filter", "district eq 'O''Brien''s' and grade eq 7 and hours eq 7.5 and lead eq true", )) - .and(query_param("$top", "2")) + .and(query_param("limit", "2")) .and(query_param("accessProfile", "follow-up-reader")) .and(header_exists("authorization")) .respond_with(collection(vec![row(ASSIGNMENT, "1")])) diff --git a/crates/registry-evidence-oid4vci/tests/draft13_profile.rs b/crates/registry-evidence-oid4vci/tests/draft13_profile.rs index b6f89416db..f008d937de 100644 --- a/crates/registry-evidence-oid4vci/tests/draft13_profile.rs +++ b/crates/registry-evidence-oid4vci/tests/draft13_profile.rs @@ -49,6 +49,7 @@ use registry_evidence_verifier::{ }; use registry_platform_audit::AuditWriter; use registry_platform_authcommon::FailedCheck; +use registry_platform_config::{DeclaredPosture, Posture, PostureReport, PostureSource}; use registry_platform_crypto::{hmac_sha256_base64url_no_pad, sign, PrivateJwk}; use registry_platform_sdjwt::SdJwtIssuer; use serde_json::{json, Value}; @@ -177,6 +178,7 @@ struct SigningIssuer { signing_key: String, requests: Mutex>, issued: Mutex>, + refuse_issuance: bool, } impl SigningIssuer { @@ -199,6 +201,7 @@ impl SigningIssuer { signing_key: signing_key.to_string(), requests: Mutex::new(Vec::new()), issued: Mutex::new(Vec::new()), + refuse_issuance: false, } } @@ -222,6 +225,10 @@ impl CredentialIssuer for SigningIssuer { } async fn issue(&self, spec: HolderBoundRequestSpec) -> Result, IssuanceError> { + if self.refuse_issuance { + self.requests.lock().expect("requests lock").push(spec); + return Err(IssuanceError::Refused); + } let signer = SdJwtIssuer::from_jwk( PrivateJwk::parse(&self.signing_key).expect("the issuer private JWK parses"), ) @@ -312,9 +319,17 @@ struct Harness { } fn harness(draft13: bool) -> Harness { + harness_with_issuer(draft13, Posture::Development, SigningIssuer::new()) +} + +fn harness_with_issuer(draft13: bool, posture: Posture, issuer: SigningIssuer) -> Harness { let block = draft13.then_some("draft13Profile: {}"); - let config = load_config(&config_text(block)).expect("the deployment loads"); - let issuer = Arc::new(SigningIssuer::new()); + let mut config = load_config(&config_text(block)).expect("the deployment loads"); + config.posture = PostureReport::new(DeclaredPosture { + posture, + source: PostureSource::Flag, + }); + let issuer = Arc::new(issuer); let clock = TestClock::default(); let reading = clock.clone(); let service = DeliveryService::with_halves( @@ -323,10 +338,7 @@ fn harness(draft13: bool) -> Harness { Arc::clone(&issuer) as Arc, Arc::new( DeliveryAudit::with_writer( - AuditWriter::from_line_sink( - Box::new(std::io::sink()), - registry_platform_config::Posture::Development, - ), + AuditWriter::from_line_sink(Box::new(std::io::sink()), posture), b"0123456789abcdef0123456789abcdef".to_vec(), ) .expect("the test audit profile is valid"), @@ -841,6 +853,44 @@ async fn the_draft13_token_endpoint_refuses_other_grants_and_spent_codes() { // Credential endpoint. +#[tokio::test] +async fn issuance_refusal_matches_the_draft13_credential_response_in_both_postures() { + let openapi = registry_evidence_oid4vci::contracts::openapi_document(); + let mut response_schema = openapi["paths"][draft13::CREDENTIAL_PATH]["post"]["responses"] + ["400"]["content"]["application/json"]["schema"] + .clone(); + response_schema["components"] = openapi["components"].clone(); + let schema = jsonschema::JSONSchema::options() + .with_draft(jsonschema::Draft::Draft202012) + .compile(&response_schema) + .expect("Draft 13 credential refusal schema"); + for posture in [Posture::Production, Posture::Development] { + let harness = harness_with_issuer( + true, + posture, + SigningIssuer { + refuse_issuance: true, + ..SigningIssuer::new() + }, + ); + let (token, nonce) = draft13_grant(&harness.server).await; + let jwt = proof(&holder_key(), DRAFT13_ISSUER, &nonce, &harness); + let response = post_credential(&harness.server, &token, &credential_body(&jwt)).await; + assert_eq!(response.status_code(), StatusCode::BAD_REQUEST); + assert_eq!(harness.issuer.call_count(), 1); + let body = response.json::(); + let mut expected = json!({ + "error": "credential_request_denied", + "error_description": "this credential request cannot be completed" + }); + if posture == Posture::Development { + expected["failedCheck"] = json!("source-authority"); + } + assert_eq!(body, expected); + assert!(schema.is_valid(&body), "{body}"); + } +} + #[tokio::test] async fn a_singular_proof_is_accepted_and_the_credential_is_delivered_unaltered() { let harness = harness(true); diff --git a/crates/registry-evidence-oid4vp/src/contracts.rs b/crates/registry-evidence-oid4vp/src/contracts.rs index 7046ff1a98..87fe31b4e7 100644 --- a/crates/registry-evidence-oid4vp/src/contracts.rs +++ b/crates/registry-evidence-oid4vp/src/contracts.rs @@ -136,7 +136,7 @@ pub fn openapi_document() -> Value { "400": oauth_error_response("The response was refused"), "408": problem_response("The configured request deadline elapsed"), "413": problem_response("The body exceeds the response size limit"), - "429": oauth_retry_response("Responses are arriving too quickly"), + "429": oauth_rate_limit_response(), "503": oauth_retry_response("The audit destination is stopped, the response is being recorded, or holding the presentation would pass the held-presentation byte budget") } } @@ -333,6 +333,13 @@ fn oauth_retry_response(description: &str) -> Value { response } +fn oauth_rate_limit_response() -> Value { + let mut response = oauth_retry_response("Responses are arriving too quickly"); + response["content"]["application/json"]["schema"] = + json!({"$ref": "#/components/schemas/OAuthRateLimit"}); + response +} + fn schemas() -> Value { json!({ "HealthResponse": { @@ -366,10 +373,14 @@ fn schemas() -> Value { } }, "OAuthError": { + "type": "object", "additionalProperties": false, "required": ["error"], + "properties": {"error": {"enum": ["invalid_request", "temporarily_unavailable"]}} + }, + "OAuthRateLimit": { "type": "object", "additionalProperties": false, "required": ["error"], "properties": { - "error": {"enum": ["invalid_request", "temporarily_unavailable"]}, - "failedCheck": {"type": "string", "description": "The check that refused the request, included only in development."} + "error": {"const": "temporarily_unavailable"}, + "failedCheck": {"const": "rate-limit", "description": "The check that refused the request, included only in development."} } }, "CreateSessionRequest": { diff --git a/crates/registry-evidence-oid4vp/tests/responses.rs b/crates/registry-evidence-oid4vp/tests/responses.rs index ae0833f617..af42056b8b 100644 --- a/crates/registry-evidence-oid4vp/tests/responses.rs +++ b/crates/registry-evidence-oid4vp/tests/responses.rs @@ -1216,6 +1216,65 @@ async fn responses_are_rate_limited_per_request_and_globally() { .assert_status(StatusCode::TOO_MANY_REQUESTS); } +fn wallet_response_schema(status: &str) -> jsonschema::JSONSchema { + use registry_evidence_oid4vp::{contracts::openapi_document, service::RESPONSE_PATH}; + let document = openapi_document(); + let responses = &document["paths"][RESPONSE_PATH]["post"]["responses"]; + let reference = responses[status]["content"]["application/json"]["schema"]["$ref"] + .as_str() + .unwrap(); + jsonschema::JSONSchema::options() + .with_draft(jsonschema::Draft::Draft202012) + .compile( + document + .pointer(reference.strip_prefix('#').unwrap()) + .unwrap(), + ) + .unwrap() +} + +#[tokio::test] +async fn wallet_errors_validate_against_their_status_specific_response_contract() { + use registry_platform_config::Posture; + let refused = wallet_response_schema("400"); + let limited = wallet_response_schema("429"); + let unavailable = wallet_response_schema("503"); + let incorrectly_tagged = + json!({"error": "temporarily_unavailable", "failedCheck": "rate-limit"}); + assert!(!unavailable.is_valid(&incorrectly_tagged)); + assert!(!refused.is_valid(&json!({"error": "invalid_request", "failedCheck": "rate-limit"}))); + assert!( + !limited.is_valid(&json!({"error": "temporarily_unavailable", "failedCheck": "purpose"})) + ); + + for posture in [Posture::Production, Posture::Development] { + let harness = Harness::new(&Options { + wallet_response_burst: 1, + ..Options::default() + }) + .await; + let (server, _) = harness.server_with_posture(posture).await; + let reference = "C".repeat(43); + let first = post_response(&server, &reference, "x").await; + first.assert_status(StatusCode::BAD_REQUEST); + let first = first.json::(); + assert_eq!(first, json!({"error": "invalid_request"})); + assert!(refused.is_valid(&first)); + let second = post_response(&server, &reference, "x").await; + second.assert_status(StatusCode::TOO_MANY_REQUESTS); + let second = second.json::(); + assert!(limited.is_valid(&second), "{second}"); + assert_eq!( + second, + if posture == Posture::Production { + json!({"error": "temporarily_unavailable"}) + } else { + incorrectly_tagged.clone() + } + ); + } +} + #[tokio::test] async fn reads_are_rate_limited_per_evidence_client() { let harness = Harness::new(&Options { @@ -1238,8 +1297,19 @@ async fn reads_are_rate_limited_per_evidence_client() { #[tokio::test] async fn an_audit_failure_refuses_the_response_and_leaves_the_session_pending() { + use registry_platform_config::Posture; + let schema = wallet_response_schema("503"); + for posture in [Posture::Production, Posture::Development] { + assert_wallet_audit_failure(posture, &schema).await; + } +} + +async fn assert_wallet_audit_failure( + posture: registry_platform_config::Posture, + schema: &jsonschema::JSONSchema, +) { let harness = Harness::new(&Options::default()).await; - let (server, service) = harness.server().await; + let (server, service) = harness.server_with_posture(posture).await; let exchange = start(&harness, &server, &service, "national-id", "user-1").await; let jwe = seal_to_session(&exchange, &national_id_payload(&exchange)); @@ -1249,10 +1319,9 @@ async fn an_audit_failure_refuses_the_response_and_leaves_the_session_pending() std::fs::write(&harness.audit_path, b"").unwrap(); let refused = post_response(&server, &exchange.request_id, &jwe).await; refused.assert_status(StatusCode::SERVICE_UNAVAILABLE); - assert_eq!( - refused.json::(), - json!({"error": "temporarily_unavailable"}) - ); + let body = refused.json::(); + assert_eq!(body, json!({"error": "temporarily_unavailable"})); + assert!(schema.is_valid(&body), "{body}"); assert!(refused.maybe_header("retry-after").is_some()); // The reservation was released: the session holds nothing for this // response and reads as pending. diff --git a/crates/registry-evidence/src/contracts.rs b/crates/registry-evidence/src/contracts.rs index 1548a2dce1..686a623422 100644 --- a/crates/registry-evidence/src/contracts.rs +++ b/crates/registry-evidence/src/contracts.rs @@ -881,12 +881,18 @@ fn problem_schema() -> Value { PROBLEM_VARIANTS .into_iter() .map(|(code, status, title, detail)| { + let failed_check = match (code, status) { + ("service.unavailable", 503) => json!({"const": "key-source-unavailable"}), + (_, 401 | 403 | 429) => json!({"type": "string"}), + _ => json!(false), + }; json!({"properties": { "type": {"const": format!("{PROBLEM_TYPE_BASE}{}", code.replace('.', "/"))}, "title": {"const": title}, "status": {"const": status}, "detail": {"const": detail}, - "code": {"const": code} + "code": {"const": code}, + "failedCheck": failed_check }}) }) .collect(), @@ -1806,6 +1812,38 @@ fn authentication_challenge_header() -> Value { }) } +#[cfg(test)] +pub(crate) fn assert_served_problem( + path: &str, + method: &str, + body: &Value, + code: crate::problem::ProblemCode, + failed_check: Option<&str>, +) { + let documents = documents().expect("published contracts generate"); + let document: Value = serde_json::from_str(&documents[OPENAPI_FILE]).expect("OpenAPI parses"); + let status = code.status().as_u16().to_string(); + let mut schema = document["paths"][path][method]["responses"][&status]["content"] + ["application/problem+json"]["schema"] + .clone(); + schema["components"] = document["components"].clone(); + let validator = jsonschema::JSONSchema::options() + .with_draft(jsonschema::Draft::Draft202012) + .compile(&schema) + .expect("published response schema compiles"); + let trace = body["traceId"].as_str().expect("public trace ID"); + let trace = registry_platform_httpsec::TraceId::parse(trace).expect("trace ID parses"); + let mut expected = serde_json::to_value(code.body(trace)).expect("problem serializes"); + if let Some(check) = failed_check { + expected["failedCheck"] = json!(check); + } + assert_eq!(*body, expected); + assert!( + validator.is_valid(body), + "response does not match {path} {method} {status}: {body}" + ); +} + #[cfg(test)] mod tests { use super::*; @@ -2645,6 +2683,29 @@ mod tests { assert!(compiled.is_valid(&problem)); problem["failedCheck"] = json!(false); assert!(!compiled.is_valid(&problem)); + for (code, status, title, detail) in PROBLEM_VARIANTS { + let mut problem = json!({ + "type": format!("{PROBLEM_TYPE_BASE}{}", code.replace('.', "/")), + "title": title, + "status": status, + "detail": detail, + "code": code, + "traceId": "0123456789abcdef0123456789abcdef" + }); + assert!(compiled.is_valid(&problem), "production {code}"); + problem["failedCheck"] = json!("key-source-unavailable"); + assert_eq!( + compiled.is_valid(&problem), + matches!(status, 401 | 403 | 429) || code == "service.unavailable", + "development {code}" + ); + problem["failedCheck"] = json!("access-profile"); + assert_eq!( + compiled.is_valid(&problem), + matches!(status, 401 | 403 | 429), + "{code}" + ); + } } #[test] diff --git a/crates/registry-evidence/src/public_check_tests.rs b/crates/registry-evidence/src/public_check_tests.rs index 9e11af2368..ea2bc0cb7b 100644 --- a/crates/registry-evidence/src/public_check_tests.rs +++ b/crates/registry-evidence/src/public_check_tests.rs @@ -30,6 +30,7 @@ use registry_evidence_authoring::{ project::{AcquisitionPosture, EvidenceProject, PackReference}, target::{self, EvidenceTargetAuthority}, }; +use registry_platform_config::Posture; use registry_platform_yaml::LocalId; use serde_json::{json, Value}; use tempfile::TempDir; @@ -160,6 +161,14 @@ async fn public_check_runtime(authority_kind: Authority) -> PublicCheckRuntime { async fn public_check_runtime_with_routes( authority_kind: Authority, routes: Vec, +) -> PublicCheckRuntime { + public_check_runtime_with_posture(authority_kind, routes, Posture::Development).await +} + +async fn public_check_runtime_with_posture( + authority_kind: Authority, + routes: Vec, + posture: Posture, ) -> PublicCheckRuntime { let source = MockServer::start().await; let temporary = tempfile::tempdir().expect("temporary public-check deployment"); @@ -251,16 +260,17 @@ sourceConnections: .expect("runtime configuration is written"); fs::set_permissions(&runtime_path, fs::Permissions::from_mode(0o400)) .expect("runtime configuration is sealed"); - DeploymentInputs::load( + let deployment = DeploymentInputs::load( &runtime_path, registry_platform_config::DeclaredPosture { posture: registry_platform_config::Posture::Development, source: registry_platform_config::PostureSource::Flag, }, ) - .expect("package and authority ceilings both load"); + .expect("package and authority ceilings both load") + .with_test_posture(posture); let runtime = Arc::new( - EvidenceRuntime::initialize_with_authenticator(&runtime_path, authenticator()) + EvidenceRuntime::initialize_from_with_authenticator(deployment, authenticator()) .await .expect("certificate runtime initializes"), ); @@ -1007,6 +1017,26 @@ async fn a_check_only_authority_serves_the_check() { /// Test 14: every miss class is one identical not-found response, and only /// the audit tells them apart, without the presented or stored values. +#[tokio::test] +async fn a_concealed_miss_matches_the_untagged_response_in_both_postures() { + use crate::contracts::assert_served_problem; + for posture in [Posture::Production, Posture::Development] { + let fixture = + public_check_runtime_with_posture(Authority::RelyingAndCheck, pack_routes(), posture) + .await; + fixture.mount_record(NUMBER, record("valid")).await; + let response = check(&fixture.http(), NUMBER, "AAAAAAAAAAAAAAAAAAAAAAAA").await; + response.assert_status(StatusCode::NOT_FOUND); + assert_served_problem( + "/v1/public-check", + "post", + &response.json(), + ProblemCode::ResourceNotFound, + None, + ); + } +} + #[tokio::test] async fn every_miss_is_one_identical_not_found() { let fixture = public_check_runtime(Authority::RelyingAndCheck).await; diff --git a/crates/registry-evidence/src/refusal_recording_tests.rs b/crates/registry-evidence/src/refusal_recording_tests.rs index 00e16b6fdf..de6d8a2fc3 100644 --- a/crates/registry-evidence/src/refusal_recording_tests.rs +++ b/crates/registry-evidence/src/refusal_recording_tests.rs @@ -431,6 +431,93 @@ fn golden_path() -> PathBuf { Path::new(env!("CARGO_MANIFEST_DIR")).join(GOLDEN) } +#[tokio::test] +async fn the_evidence_router_serves_the_status_specific_problem_contract_in_both_postures() { + use crate::contracts::assert_served_problem; + use registry_platform_config::Posture; + let post = "/v1/evidence"; + let definitions = "/v1/evidence-definitions"; + for posture in [Posture::Production, Posture::Development] { + let visible = |check| (posture == Posture::Development).then_some(check); + let prepared = prepare_acceptance("subject-binding-secret-canary-32-bytes-minimum").await; + make_writable(&prepared.bundle_root); + mutate_acceptance_configuration(&prepared.bundle_root.join("evidence.yaml"), |config| { + config["rateLimits"]["requestsPerPrincipalPerMinute"] = json!(1); + config["rateLimits"]["burstPerPrincipal"] = json!(1); + }); + refresh_package_envelope(&prepared.bundle_root); + make_read_only(&prepared.bundle_root); + let runtime = initialize_acceptance_with_posture(prepared, posture, false).await; + let app = build_app(Arc::clone(&runtime.runtime)); + for (name, code) in [ + ("no-authorization-header", ProblemCode::AuthenticationFailed), + ("client-not-admitted", ProblemCode::NotAuthorized), + ] { + let scenario = scenarios() + .into_iter() + .find(|case| case.name == name) + .unwrap(); + let response = app.clone().oneshot(build_request(&scenario)).await.unwrap(); + assert_eq!(response.status(), code.status()); + let bytes = axum::body::to_bytes(response.into_body(), 16_384) + .await + .unwrap(); + let body = serde_json::from_slice(&bytes).unwrap(); + assert_served_problem(post, "post", &body, code, visible(scenario.check.as_str())); + } + + Mock::given(method("POST")) + .and(path("/v1/facts")) + .respond_with(ResponseTemplate::new(503)) + .expect(1) + .mount(&runtime.server) + .await; + let http = TestServer::new(app); + let bearer = format!("Bearer {}", access_token(None)); + let source = http + .post(post) + .add_header("authorization", &bearer) + .json(&adult_request()) + .await; + source.assert_status(StatusCode::SERVICE_UNAVAILABLE); + assert_served_problem( + post, + "post", + &source.json(), + ProblemCode::DependencyUnavailable, + None, + ); + let limited = http + .get(definitions) + .add_header("authorization", &bearer) + .await; + limited.assert_status(StatusCode::TOO_MANY_REQUESTS); + assert_served_problem( + definitions, + "get", + &limited.json(), + ProblemCode::RateLimited, + visible("rate-limit"), + ); + + let prepared = prepare_acceptance("subject-binding-secret-canary-32-bytes-minimum").await; + let runtime = initialize_acceptance_with_posture(prepared, posture, true).await; + let http = TestServer::new(build_app(Arc::clone(&runtime.runtime))); + let issuer = http + .get(definitions) + .add_header("authorization", &bearer) + .await; + issuer.assert_status(StatusCode::SERVICE_UNAVAILABLE); + assert_served_problem( + definitions, + "get", + &issuer.json(), + ProblemCode::ServiceUnavailable, + visible("key-source-unavailable"), + ); + } +} + #[test] fn every_refusal_is_counted_logged_once_by_its_check_and_answered_as_before() { let scenarios = scenarios(); diff --git a/crates/registry-evidence/src/runtime_tests.rs b/crates/registry-evidence/src/runtime_tests.rs index 015c4e5ee4..cfcfb6d1d2 100644 --- a/crates/registry-evidence/src/runtime_tests.rs +++ b/crates/registry-evidence/src/runtime_tests.rs @@ -10066,10 +10066,23 @@ async fn acceptance_runtime_with_posture_authenticator( posture: registry_platform_config::Posture, ) -> AcceptanceRuntime { let prepared = prepare_acceptance("subject-binding-secret-canary-32-bytes-minimum").await; + initialize_acceptance_with_posture(prepared, posture, false).await +} + +async fn initialize_acceptance_with_posture( + prepared: PreparedAcceptance, + posture: registry_platform_config::Posture, + key_source_unavailable: bool, +) -> AcceptanceRuntime { let private = PrivateJwk::parse(AUTH_PRIVATE_JWK).expect("auth test key parses"); + let keys = if key_source_unavailable { + ResponseTemplate::new(503) + } else { + ResponseTemplate::new(200).set_body_json(json!({"keys": [private.public()]})) + }; Mock::given(method("GET")) .and(path("/.well-known/jwks.json")) - .respond_with(ResponseTemplate::new(200).set_body_json(json!({"keys": [private.public()]}))) + .respond_with(keys) .mount(&prepared.server) .await; let mut config = crate::bundle::Bundle::load(&prepared.bundle_root) diff --git a/crates/registry-stack-client-node/breg/client.d.ts b/crates/registry-stack-client-node/breg/client.d.ts index 3ab5385e9c..649d277ddc 100644 --- a/crates/registry-stack-client-node/breg/client.d.ts +++ b/crates/registry-stack-client-node/breg/client.d.ts @@ -224,7 +224,7 @@ export interface RecordOptions extends RecordProjectionOptions { } export interface ListOptions extends RecordProjectionOptions { - top?: SafeInteger | null + limit?: SafeInteger | null filter?: string | null orderby?: string | null count?: boolean | null @@ -232,7 +232,7 @@ export interface ListOptions extends RecordProjectionOptions { } export interface CollectionOptions extends RecordProjectionOptions { - top?: SafeInteger | null + limit?: SafeInteger | null filter?: string | null orderby?: string | null count?: boolean | null @@ -248,7 +248,7 @@ export interface GeoJsonOptions { accessProfile?: string | null } export interface GeoJsonListOptions extends GeoJsonOptions { - top?: SafeInteger | null + limit?: SafeInteger | null filter?: string | null orderby?: string | null count?: boolean | null @@ -257,7 +257,7 @@ export interface GeoJsonListOptions extends GeoJsonOptions { export interface ListContinuation { route: string - skiptoken: string + cursor: string format: RecordFormat accessProfile?: string | null registryIdentifier: string @@ -276,7 +276,7 @@ export interface RelationshipListContinuation extends ListContinuation { } export interface GeoJsonListContinuation { route: string - skiptoken: string + cursor: string accessProfile?: string } diff --git a/docs/site/src/content/docs/configure/breg-access.mdx b/docs/site/src/content/docs/configure/breg-access.mdx index fefeb9de0f..35faff1d5c 100644 --- a/docs/site/src/content/docs/configure/breg-access.mdx +++ b/docs/site/src/content/docs/configure/breg-access.mdx @@ -303,7 +303,7 @@ An alternative counts as met only when the filter is a top-level `and` of predic included, and every field of the alternative has an `eq` predicate with a non-null value. A predicate under `or` or `not` does not count, and neither do `ne`, comparisons, `in`, `startswith`, or a test for null. Other predicates may sit beside the required ones. `$count` is held to the same rule. A -`$skiptoken` cursor carries the first page's filter under its signature, so a continuation page +`cursor` cursor carries the first page's filter under its signature, so a continuation page cannot drop or change it. `bregctl check` refuses a `requiredFilters` that: diff --git a/docs/site/src/content/docs/configure/breg-external-views.mdx b/docs/site/src/content/docs/configure/breg-external-views.mdx index 56407d020f..b3d14fef5e 100644 --- a/docs/site/src/content/docs/configure/breg-external-views.mdx +++ b/docs/site/src/content/docs/configure/breg-external-views.mdx @@ -169,7 +169,7 @@ List the licences whose holder's family name is Lee, sorted by family name, with ```sh test-skip="needs a live registry and source" bregctl api \ - '/v1/external-views/licence-holder-indexed/holder/records?accessProfile=officer&$filter=family-name%20eq%20%27Lee%27&$orderby=family-name&$count=true&$top=20' \ + '/v1/external-views/licence-holder-indexed/holder/records?accessProfile=officer&$filter=family-name%20eq%20%27Lee%27&$orderby=family-name&$count=true&limit=20' \ --url "$BREG_URL" \ --token-file "$OFFICER_TOKEN_FILE" ``` @@ -194,9 +194,9 @@ bregctl api \ } ``` -`$filter` accepts one `eq` comparison on a filterable field, against a literal or `null`. `$top` -accepts 1 to 100 and defaults to 50. When more licences match than `$top`, the response carries -`nextCursor`. For the next page, send that value as `$skiptoken` with the same `accessProfile` and +`$filter` accepts one `eq` comparison on a filterable field, against a literal or `null`. `limit` +accepts 1 to 100 and defaults to 50. When more licences match than `limit`, the response carries +`nextCursor`. For the next page, send that value as `cursor` with the same `accessProfile` and no other query option. A cursor is bound to its caller, query, and projection, and a purge or a fresh projection epoch invalidates it. diff --git a/docs/site/src/content/docs/configure/breg-history.mdx b/docs/site/src/content/docs/configure/breg-history.mdx index 47a42f805c..1d87cc8b9a 100644 --- a/docs/site/src/content/docs/configure/breg-history.mdx +++ b/docs/site/src/content/docs/configure/breg-history.mdx @@ -29,7 +29,7 @@ Three inputs select the state a query reproduces: |---|---| | `snapshot` | Which committed registry state to reproduce. Omit it to capture the latest committed state once. | | `validAt` | Optional effective date or UTC timestamp within that recorded state. Omit it to return recorded state without an effective-time filter. | -| `$skiptoken` | Expiring continuation of an already authorised query, including its exact snapshot. | +| `cursor` | Expiring continuation of an already authorised query, including its exact snapshot. | A snapshot reference is a bookmark, not a credential. Current access rules apply on every request, including after a package or policy upgrade. @@ -120,7 +120,7 @@ Any other `asOf` value answers `400 query.invalid` naming `asOf`. On a date interval, `:current` uses the registry's local date; on a timestamp interval it uses the current instant. Every `:current` and `:as-of` response echoes the `asOf` it used in collection `meta`, so a caller can record the date its answer was for. -To tell one Record in force from several without paging, read with `$top=2` and no `$count` or `$orderby`. +To tell one Record in force from several without paging, read with `limit=2` and no `$count` or `$orderby`. BReg then returns at most two items, selected after access rules, and the item count (0, 1 or 2) is the answer; `nextCursor` need not be followed. Coordinator's `breg.read-in-force/v1` uses this read with an equality filter built from its structured subject. @@ -132,7 +132,7 @@ Only a successful read with zero rows means that nothing matched. crates/registry-breg/tests/temporal_reads.rs current_and_as_of_responses_echo_the_as_of_they_used_in_meta; crates/registry-breg/tests/postgres_historical.rs snapshot_http_reconstructs_before_filters_and_keeps_pages_pinned. */} -{/* TODO[evidence]: the $top=2 in-force read and the missing or empty row-boundary claim answers (404 resource.not-found, 401 authentication.refused) have no located test. */} +{/* TODO[evidence]: the limit=2 in-force read and the missing or empty row-boundary claim answers (404 resource.not-found, 401 authentication.refused) have no located test. */} ## Query a saved state @@ -147,8 +147,8 @@ After correcting the move's effective date to June 15, a newly captured snapshot The original saved reference still returns B, subject to current authorisation and retained history. Responses contain `items` with `recordId`, `revisionId`, and selected `domainData`, plus collection `meta`, `snapshot`, `pageInfo.nextCursor`, optional `count`, and `validAt` when supplied. -Use the usual `$select`, `$filter`, `$orderby`, `$top` and `$count` options. -Follow a continuation using only `$skiptoken` and, if needed, `accessProfile`; do not repeat or override its snapshot, effective time or query options. +Use the usual `$select`, `$filter`, `$orderby`, `limit` and `$count` options. +Follow a continuation using only `cursor` and, if needed, `accessProfile`; do not repeat or override its snapshot, effective time or query options. Date intervals accept calendar dates such as `2026-06-05`. Timestamp intervals require a UTC RFC 3339 timestamp. diff --git a/docs/site/src/content/docs/configure/breg-spatial-queries.mdx b/docs/site/src/content/docs/configure/breg-spatial-queries.mdx index 17a97ec38b..eb6ba2a558 100644 --- a/docs/site/src/content/docs/configure/breg-spatial-queries.mdx +++ b/docs/site/src/content/docs/configure/breg-spatial-queries.mdx @@ -116,7 +116,7 @@ If `$select` omits the readable primary geometry, GeoJSON emits `geometry: null` A profile that cannot read the primary geometry cannot request this representation or use bbox. A GeoJSON get does not supply a mutation ETag. -Follow `registry.pageInfo.nextCursor` with the native `$skiptoken` option and normal authorisation on every request. +Follow `registry.pageInfo.nextCursor` with the native `cursor` option and normal authorisation on every request. A cursor binds the effective query, selection, page size, profile, authority, package, and representation, so do not change those options on continuation. Pages read live data, not a frozen snapshot, so concurrent writes can affect traversal. Count remains separately authorised and opt-in. diff --git a/docs/site/src/content/docs/configure/coordinator.mdx b/docs/site/src/content/docs/configure/coordinator.mdx index 8e70c900a8..f645206293 100644 --- a/docs/site/src/content/docs/configure/coordinator.mdx +++ b/docs/site/src/content/docs/configure/coordinator.mdx @@ -707,7 +707,7 @@ The link carries only the opaque ID, which grants nothing without BReg's own gra `breg.read-in-force/v1` takes `entity`, a structured `subject` of equality values on declared fields, and a calendar `date`. It never accepts a filter string. -Coordinator sends one BReg `:as-of` read with `asOf` set to the date, an equality filter built from the subject, and `$top=2`, so BReg reads at most two rows. +Coordinator sends one BReg `:as-of` read with `asOf` set to the date, an equality filter built from the subject, and `limit=2`, so BReg reads at most two rows. Only entities whose `temporal` uses date intervals are accepted; compilation refuses other imports with `definition.read-in-force-entity`. BReg applies the interval's own semantics, an exclusive end or an inclusive last day, as the record schema's `x-registry-temporal` marker states; Coordinator never evaluates the interval itself. diff --git a/docs/site/src/content/docs/reference/breg-api.mdx b/docs/site/src/content/docs/reference/breg-api.mdx index d78fdf8e60..8176d48b6b 100644 --- a/docs/site/src/content/docs/reference/breg-api.mdx +++ b/docs/site/src/content/docs/reference/breg-api.mdx @@ -182,7 +182,7 @@ is `items[0].domainData`, not `items[0].data.domainData`: } ``` -`nextCursor` is `null` on the last page. To continue, send it as `$skiptoken` with no other option +`nextCursor` is `null` on the last page. To continue, send it as `cursor` with no other option except `accessProfile`. The cursor is signed with the runtime `cursor.secretRef`, binds the whole original query, and expires after `cursor.maximumAgeSeconds`; a cursor that fails any of those checks answers `400 query.cursor-invalid`. With `$count`, the response carries the matching total. @@ -761,7 +761,7 @@ Display labels and safe instance titles help applications present the contract, A title exposes only fields the current profile can read. Reference descriptors and bounded forward and inverse navigation reuse normal Record authority, and a link or relationship never grants target disclosure. -Use the advertised `$filter`, `$orderby`, `$select`, `$top`, and `$count` query capabilities and bounds. +Use the advertised `$filter`, `$orderby`, `$select`, `limit`, and `$count` query capabilities and bounds. Filters reduce a permitted collection; they do not supply authorisation. Continuation uses the opaque cursor and selected profile. References, spatial reads, historical reads, and statistical datasets expose only their declared capability variants. @@ -925,7 +925,7 @@ counted on the metrics listener rather than journaled; see | Patch document | `/` for operation `n`, `//op`, `//path` for a path outside `/data/` or a field you may not write, known or not, and `//value`. | | Batch body | `/items`, `/changeContext`, `/items/`, `/items//operation`, `/items//recordId`, `/items//ifMatch`, `/items//patch`, and the create and patch forms above under `/items/` and `/items//patch`. | | Header | `Idempotency-Key` when it is missing or malformed; `If-Match` when a batch request sends one, because each batch item carries its own `ifMatch`. | -| Query | The parameter: `$select`, `$filter`, `$orderby`, `$top`, `$count`, `$skiptoken`, `bbox`, `accessProfile`, `asOf`, `snapshot`, or `validAt`; on statistics routes also `from`, `to`, `status`, `limit`, or `cursor`. A revision route takes none but `accessProfile` and names the first other one you sent. | +| Query | The parameter: `$select`, `$filter`, `$orderby`, `limit`, `$count`, `cursor`, `bbox`, `accessProfile`, `asOf`, `snapshot`, or `validAt`; on statistics routes also `from`, `to`, or `status`. A revision route takes none but `accessProfile` and names the first other one you sent. | A name you sent is never echoed: an unknown member and a withheld one stop at the same location. An oversized or non-JSON body, an undefined query parameter, a malformed query string, and the diff --git a/docs/site/src/content/docs/reference/client-api.mdx b/docs/site/src/content/docs/reference/client-api.mdx index ffacebd058..e78065e7d3 100644 --- a/docs/site/src/content/docs/reference/client-api.mdx +++ b/docs/site/src/content/docs/reference/client-api.mdx @@ -179,7 +179,7 @@ selection is inert metadata that grants no access. The [HTTP problem and recovery contract](../errors/) defines the common fields, bodyless Casework result states, Scheduling concealment, meaningful Retry-After intervals and portable idempotency guidance. BReg keeps -`$top`/`$skiptoken`; Casework, Scheduling and Coordinator use `limit`/`cursor`. +`limit`/`cursor`, as do Casework, Scheduling and Coordinator. Use Python `from registry_client.auth import PrivateKeyJwt` for a product-neutral provider. The compatibility `breg.PrivateKeyJwt` is the same native class. Construct @@ -762,8 +762,8 @@ shape is refused at construction with kind `configuration`. crates/registry-breg-client-node/client.d.ts, attemptTimeoutMilliseconds, crates/registry-breg-client-py/python/registry_breg_client/__init__.pyi, attempt_timeout_seconds */} -Python's `top` list argument produces BReg's `$top` query parameter. Continue with the -returned `$skiptoken` contract. Treat `metadata.operations` identifiers as opaque +Python's `limit` list argument sets the maximum page size. Pass the returned +continuation to the matching continuation method. Treat `metadata.operations` identifiers as opaque metadata selected from the compiled registry contract; do not construct or parse identifiers using an undocumented spelling. diff --git a/docs/site/src/content/docs/reference/errors.mdx b/docs/site/src/content/docs/reference/errors.mdx index fef4d60901..584427276a 100644 --- a/docs/site/src/content/docs/reference/errors.mdx +++ b/docs/site/src/content/docs/reference/errors.mdx @@ -149,10 +149,10 @@ Client retry rules are in the client crates' documentation. {/* TODO[evidence]: the `Retry-After` and no-source-probe readiness claims are carried from the source; no single test anchors them. */} -BReg pagination uses `$top` and `$skiptoken` (Python `top`); Casework, Scheduling, and Coordinator use `limit` and `cursor`. +BReg, Casework, Scheduling and Coordinator use `limit` and `cursor` on paginated list routes. SDKs expose each actual contract and do not automatically follow continuations. -{/* Evidence: crates/registry-breg/src/api/metadata.rs $skiptoken. */} +{/* Evidence: crates/registry-breg/src/api/metadata.rs cursor. */} {/* TODO[evidence]: Casework, Scheduling, and Coordinator `limit` and `cursor` pagination anchors were not located. */} ## Product problem contracts diff --git a/docs/site/src/content/docs/reference/typescript-clients.mdx b/docs/site/src/content/docs/reference/typescript-clients.mdx index 8813905a28..cd7dfed513 100644 --- a/docs/site/src/content/docs/reference/typescript-clients.mdx +++ b/docs/site/src/content/docs/reference/typescript-clients.mdx @@ -212,7 +212,7 @@ import { createRegistryClient } from './generated/services/breg-facility-documen const registry = createRegistryClient({ baseUrl: '/registry' }) const answer = await registry.facility.call('records.facility.list', { - query: { accessProfile: 'facility-reader', $top: 25 }, + query: { accessProfile: 'facility-reader', limit: 25 }, }) await registry.casework.call('describeCasework') ``` @@ -514,7 +514,7 @@ Two helpers walk the cursor. import { allPages, pages } from './browser.ts' const contacts = await allPages(cursor => client.records_contact_listPage({ - query: { accessProfile: 'directory-editor', $top: 25 }, + query: { accessProfile: 'directory-editor', limit: 25 }, }, cursor)) for await (const page of pages(cursor => client.records_contact_listPage({}, cursor))) { @@ -593,11 +593,11 @@ const first = await client.list('licence', { where: { status: ['active', 'suspended'], region: 'north', holderName: { startsWith: 'Dep' } }, orderBy: 'expiresOn', select: ['licenceNumber', 'holderName', 'expiresOn'], - top: 20, + limit: 20, count: true, }) if (first.nextCursor !== null) { - const second = await client.list('licence', { accessProfile: 'licence-officer', after: first.nextCursor }) + const second = await client.list('licence', { accessProfile: 'licence-officer', cursor: first.nextCursor }) } ``` @@ -608,7 +608,7 @@ if (first.nextCursor !== null) { | `orderBy` | One sortable property, or `'property desc'` where the profile allows descending. | | `select` | Selectable properties, each once. | | `count` | Allowed only when the profile sets `allowCount`. The answer then carries `count`. | -| `top` | A whole number from 1 to the profile's `maximumPageSize`. | +| `limit` | A whole number from 1 to the profile's `maximumPageSize`. | `where` forms and the operators they need: @@ -636,10 +636,10 @@ A refusal is a `TypeError` that names the property and profile, for example ``Pr It never repeats a filter value, and it names a property only when the contract declares it. `list` returns `{ items, nextCursor }`, plus `count` when the answer carries it. -Pass `nextCursor` as `after` for the next page. If the first page used the default, omit `accessProfile` again. If it named a profile, repeat that profile. +Pass `nextCursor` as `cursor` for the next page. If the first page used the default, omit `accessProfile` again. If it named a profile, repeat that profile. A null cursor ends the list. The cursor carries the query, so the continuation sends only the access profile and the cursor. -The client refuses `where`, `orderBy`, `select`, `count` and `top` alongside `after` before sending a request, because the cursor carries them. +The client refuses `where`, `orderBy`, `select`, `count` and `limit` alongside `cursor` before sending a request, because the cursor carries them. `list` takes the same `signal` and `maxResponseBytes` as any call, and works with `pages` and `allPages`. Sub-collection lists use `call` by operation ID or their generated page method. diff --git a/products/breg/CHANGELOG.md b/products/breg/CHANGELOG.md index e47f5529d5..f805182b82 100644 --- a/products/breg/CHANGELOG.md +++ b/products/breg/CHANGELOG.md @@ -7,6 +7,12 @@ explicit fields. - The Evidence provider `trustedJwksRef` key set is read as a public document and refused when it holds a private or symmetric member. +- BReg Record, history, relationship and External View list contracts use `limit` + and `cursor`. Update first-page requests and continue on the same route with + the returned cursor and access profile. The server still reads earlier query + spellings during upgrades. Rust and Node list clients use `limit`, Python + takes `limit=`, and clients write `cursor` in persisted continuations. They + still read prior `skiptoken` continuations. ## 0.49.0 - 2026-12-01 diff --git a/products/breg/contracts/client-capabilities.json b/products/breg/contracts/client-capabilities.json index 0fa7603fbd..ea98833423 100644 --- a/products/breg/contracts/client-capabilities.json +++ b/products/breg/contracts/client-capabilities.json @@ -25,9 +25,7 @@ "$select", "$filter", "$orderby", - "$top", "$count", - "$skiptoken", "bbox", "asOf", "snapshot", @@ -71,21 +69,11 @@ "node": ["ListOptions.orderby"], "python": ["BaseRegistryClient.list_records.orderby"] }, - "$top": { - "rust": ["BRegListRequest.top"], - "node": ["ListOptions.top"], - "python": ["BaseRegistryClient.list_records.top"] - }, "$count": { "rust": ["BRegListRequest.count"], "node": ["ListOptions.count"], "python": ["BaseRegistryClient.list_records.count"] }, - "$skiptoken": { - "rust": ["BRegContinuationProjection.skiptoken"], - "node": ["ListContinuation.skiptoken"], - "python": ["BaseRegistryClient.continue_list.continuation"] - }, "bbox": { "rust": ["BRegListRequest.bbox", "BRegGeoJsonListRequest.bbox"], "node": ["ListOptions.bbox", "GeoJsonListOptions.bbox"], @@ -147,14 +135,14 @@ "python": ["BaseRegistryClient.list_proposals.query"] }, "cursor": { - "rust": ["BRegProposalQuery.cursor"], - "node": ["BaseRegistryClient.listProposals.query"], - "python": ["BaseRegistryClient.list_proposals.query"] + "rust": ["BRegProposalQuery.cursor", "BRegContinuationProjection.cursor"], + "node": ["BaseRegistryClient.listProposals.query", "ListContinuation.cursor"], + "python": ["BaseRegistryClient.list_proposals.query", "BaseRegistryClient.continue_list.continuation"] }, "limit": { - "rust": ["BRegProposalQuery.limit"], - "node": ["BaseRegistryClient.listProposals.query"], - "python": ["BaseRegistryClient.list_proposals.query"] + "rust": ["BRegProposalQuery.limit", "BRegListRequest.limit"], + "node": ["BaseRegistryClient.listProposals.query", "ListOptions.limit"], + "python": ["BaseRegistryClient.list_proposals.query", "BaseRegistryClient.list_records.limit"] }, "turn": { "rust": ["BRegProposalQuery.turn"], diff --git a/products/breg/contracts/explain/QueriesExplanation.schema.json b/products/breg/contracts/explain/QueriesExplanation.schema.json index f213bc4066..e51940b601 100644 --- a/products/breg/contracts/explain/QueriesExplanation.schema.json +++ b/products/breg/contracts/explain/QueriesExplanation.schema.json @@ -108,9 +108,9 @@ "select": { "const": "$select" }, "filter": { "const": "$filter" }, "orderBy": { "const": "$orderby" }, - "pageSize": { "const": "$top" }, + "pageSize": { "const": "limit" }, "count": { "const": "$count" }, - "cursor": { "const": "$skiptoken" }, + "cursor": { "const": "cursor" }, "accessProfile": { "const": "accessProfile", "x-registry-member-names": true }, "asOf": { "const": "asOf", "x-registry-member-names": true }, "bbox": { "const": "bbox" } diff --git a/products/breg/examples/external-views/journey.py b/products/breg/examples/external-views/journey.py index 2e8fc94a36..891e5b6670 100644 --- a/products/breg/examples/external-views/journey.py +++ b/products/breg/examples/external-views/journey.py @@ -184,12 +184,12 @@ def run(self): self.wait_until(lambda: len(self.rows(self.business()) or []) == 2, "the holdings sweep to publish") reads_before = self.source_calls() - response = self.licence_filter("'Lee'", **{"$orderby": "family-name", "$top": "1"}) + response = self.licence_filter("'Lee'", **{"$orderby": "family-name", "limit": "1"}) first = records(response) expect(len(first) == 1 and response[1].get("count") == 2, "surname filtering or count is incorrect") cursor = response[1].get("nextCursor") expect(isinstance(cursor, str) and cursor, "surname page has no cursor") - second = records(self.view("licence-holder-indexed", "holder", query={"$skiptoken": cursor})) + second = records(self.view("licence-holder-indexed", "holder", query={"cursor": cursor})) expect(len(second) == 1 and first[0]["rootId"] != second[0]["rootId"], "surname pages overlap") unopened = self.licence_filter("'Rivera'") expect(len(records(unopened)) == 1 and unopened[1].get("count") == 1, "unopened licence was not indexed") @@ -249,7 +249,7 @@ def person_refresh(check, description): person_refresh(lambda: self.licence_ready("'Ng'", 2), "Person recovery to publish the renamed holder") expect(surname_from_label(records(self.business())) == "Ng", "one Person refresh did not update the holding label") # A withdrawn key does not end the projection scope, so a cursor stays valid; only a tampered one is refused. - tampered = self.view("licence-holder-indexed", "holder", query={"$skiptoken": cursor[:-4] + "AAAA"}) + tampered = self.view("licence-holder-indexed", "holder", query={"cursor": cursor[:-4] + "AAAA"}) expect(tampered[0] == 400, f"a tampered cursor was not refused (status {tampered[0]})") self.control("restore-holder") diff --git a/products/breg/examples/required-attachment/openapi.json b/products/breg/examples/required-attachment/openapi.json index 30a91234ff..0fa3c3004e 100644 --- a/products/breg/examples/required-attachment/openapi.json +++ b/products/breg/examples/required-attachment/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":{"enum":["attachment.required","attachment.verification-pending","attachment.verification-rejected"]}}},"then":{"allOf":[{"else":{"properties":{"status":{"const":422}}},"if":{"properties":{"code":{"const":"attachment.verification-pending"}}},"then":{"properties":{"status":{"const":409}}}}],"properties":{"fieldPath":{"pattern":"^/attachments/[a-z][a-z0-9_-]{0,63}$","type":"string"}},"propertyNames":{"enum":["type","title","status","detail","code","traceId","fieldPath"]},"required":["fieldPath"]}},{"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","failedCheck"]}}},{"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":"access-profile.ambiguous"}}},"then":{"additionalProperties":true,"properties":{"status":{"const":400}},"required":["accessProfiles"]}},{"if":{"properties":{"code":{"not":{"const":"access-profile.ambiguous"}}}},"then":{"not":{"required":["accessProfiles"]}}},{"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"]}}],"anyOf":[{"properties":{"code":{"const":"access-profile.ambiguous"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},{"properties":{"code":{"const":"action.evidence-failed"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/evidence-failed"}}},{"properties":{"code":{"const":"action.guard-failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/guard-failed"}}},{"properties":{"code":{"const":"action.handler-failed"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/handler-failed"}}},{"properties":{"code":{"const":"action.refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/refused"}}},{"properties":{"code":{"const":"attachment.content-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},{"properties":{"code":{"const":"attachment.digest-mismatch"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch"}}},{"properties":{"code":{"const":"attachment.limit-reached"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached"}}},{"properties":{"code":{"const":"attachment.required"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/required"}}},{"properties":{"code":{"const":"attachment.slot-write-once"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once"}}},{"properties":{"code":{"const":"attachment.too-large"},"status":{"const":413},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},{"properties":{"code":{"const":"attachment.verification-pending"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}}},{"properties":{"code":{"const":"attachment.verification-rejected"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected"}}},{"properties":{"code":{"const":"authentication.refused"},"status":{"const":401},"type":{"const":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},{"properties":{"code":{"const":"idempotency.expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},{"properties":{"code":{"const":"idempotency.key-reused"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}}},{"properties":{"code":{"const":"ingestion.chunk-mismatch"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch"}}},{"properties":{"code":{"const":"ingestion.profile-mismatch"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch"}}},{"properties":{"code":{"const":"ingestion.receipt-erased"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased"}}},{"properties":{"code":{"const":"ingestion.run-blocked"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked"}}},{"properties":{"code":{"const":"ingestion.run-not-open"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open"}}},{"properties":{"code":{"const":"lookup.unresolved"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/lookup/unresolved"}}},{"properties":{"code":{"const":"mutation.conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},{"properties":{"code":{"const":"precondition.failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},{"properties":{"code":{"const":"precondition.required"},"status":{"const":428},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},{"properties":{"code":{"const":"profile.not-authorized"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},{"properties":{"code":{"const":"proposal.rejected"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},{"properties":{"code":{"const":"proposal.review-result-mismatch"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch"}}},{"properties":{"code":{"const":"proposal.submission-expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},{"properties":{"code":{"const":"query.cursor-invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid"}}},{"properties":{"code":{"const":"query.filter-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/filter-required"}}},{"properties":{"code":{"const":"query.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/invalid"}}},{"properties":{"code":{"const":"request.access-reason-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/access-reason-required"}}},{"properties":{"code":{"const":"request.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},{"properties":{"code":{"const":"request.timeout"},"status":{"const":504},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},{"properties":{"code":{"const":"resource.not-found"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/resource/not-found"}}},{"properties":{"code":{"const":"runtime.field-encryption.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable"}}},{"properties":{"code":{"const":"service.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},{"properties":{"code":{"const":"source.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},{"properties":{"code":{"const":"statistical-dataset.domain-violation"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation"}}},{"properties":{"code":{"const":"statistical-dataset.release-refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused"}}},{"properties":{"code":{"const":"statistical-dataset.version-conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict"}}},{"properties":{"code":{"const":"statistical-dataset.version-withdrawn"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn"}}},{"properties":{"code":{"const":"unsupported.media-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/unsupported/media-type"}}},{"properties":{"code":{"const":"write.outside-boundary"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}}],"properties":{"accessProfiles":{"items":{"maxLength":128,"minLength":1,"type":"string"},"minItems":2,"type":"array","uniqueItems":true},"atField":{"maxLength":128,"minLength":1,"type":"string"},"code":{"enum":["access-profile.ambiguous","action.evidence-failed","action.guard-failed","action.handler-failed","action.refused","attachment.content-type","attachment.digest-mismatch","attachment.limit-reached","attachment.required","attachment.slot-write-once","attachment.too-large","attachment.verification-pending","attachment.verification-rejected","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","profile.not-authorized","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"},"failedCheck":{"description":"The check that refused the request, included only in development.","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-name-invoke-input":{"$id":"urn:breg:action:correct-name:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"target":{"format":"uuid","type":"string"},"value":{"maxLength":64,"minLength":0,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-name","x-registry-requiredConditionKeys":[]},"action-correct-name-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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"target":{"$id":"urn:breg:record-type:target","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"jurisdiction":{"maxLength":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"required":["name","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable","x-registry-mutationPolicy":{"patch":"proposal-required"}},"target-create-input":{"$id":"urn:breg:record-type:target:input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"jurisdiction":{"maxLength":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"required":["name","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable"}},"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"},"reviewCompletion":{"description":"The review authority's configured completion key verifies the Standard Webhooks signature.","in":"header","name":"webhook-signature","type":"apiKey"}}},"info":{"title":"required-attachment","version":"1"},"openapi":"3.1.0","paths":{"/v1/actions/correct-name/proposals":{"post":{"operationId":"actions.correct-name.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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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-name-invoke-input"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-correct-name-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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":["clerk"],"x-registry-action":{"access":{"accessProfiles":["clerk"]},"apiName":"correctName","attachments":[{"contentTypes":["text/plain"],"id":"support","maximumBytes":4096,"required":true}],"bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"display":{},"execution":{"application":"manual","mode":"proposal","review":"none"},"id":"correct-name","inputMode":"fixed","inputs":[{"apiName":"target","classification":"internal","fieldType":{"onDelete":"restrict","target":"target","type":"reference"},"id":"target","label":"target","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}},{"apiName":"value","classification":"internal","fieldType":{"maximumLength":64,"minimumLength":0,"type":"string"},"id":"value","label":"value","nullable":false,"required":true,"schema":{"maxLength":64,"minLength":0,"type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[{"apiName":"target","input":"target","targetRecordType":"target"}],"requiredConditionKeys":[],"resultEffects":[{"effect":"name","operation":"patch","recordType":"target"}],"revision":"sha256:bc33d44acbc56e239cd2c88aa76698302a40bba0bf7298b80317a82c9fc4cb36","route":"/v1/actions/correct-name/proposals","routes":{"availability":null,"start":{"inputSchema":"action-correct-name-invoke-input","method":"POST","operationId":"actions.correct-name.start","path":"/v1/actions/correct-name/proposals","requiresIdempotencyKey":true,"responseSchema":"action-correct-name-invoke-response"}}},"x-registry-defaultAccessProfile":"clerk","x-registry-operation":"start","x-registry-routeKind":"invoke"}},"/v1/proposals":{"get":{"operationId":"proposals.list","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","query.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}":{"get":{"operationId":"proposals.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/apply":{"post":{"operationId":"proposals.apply","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/attachments/support":{"delete":{"operationId":"proposals.attachments.support.delete","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]},"get":{"operationId":"proposals.attachments.support.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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":{"*/*":{"schema":{"contentMediaType":"application/octet-stream","maxLength":16777216,"type":"string"}}},"description":"Authorized Proposal operation"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]},"patch":{"operationId":"proposals.attachments.support.patch","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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":{"text/plain":{"schema":{"format":"binary","maxLength":4096,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"413":{"content":{"application/problem+json":{"examples":{"attachment.too-large":{"value":{"code":"attachment.too-large","detail":"The file is larger than the attachment slot accepts.","status":413,"title":"Content Too Large","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.too-large"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"attachment.content-type":{"value":{"code":"attachment.content-type","detail":"The file media type is not one the attachment slot accepts.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.content-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/cancel":{"post":{"operationId":"proposals.cancel","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/edit":{"post":{"operationId":"proposals.edit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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-name:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"target":{"format":"uuid","type":"string"},"value":{"maxLength":64,"minLength":0,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-name","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/rebase":{"post":{"operationId":"proposals.rebase","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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-name:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"target":{"format":"uuid","type":"string"},"value":{"maxLength":64,"minLength":0,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-name","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/revise":{"post":{"operationId":"proposals.revise","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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-name:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"target":{"format":"uuid","type":"string"},"value":{"maxLength":64,"minLength":0,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-name","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/submissions/{submission_version}":{"get":{"operationId":"proposals.get-submission","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"proposal.submission-expired":{"value":{"code":"proposal.submission-expired","detail":"The review result and application receipt of the submission are no longer retained.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["proposal.submission-expired"]}},"type":"object"}]}}},"description":"The submission's review result and application receipt are no longer retained","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/submit":{"post":{"operationId":"proposals.submit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"attachment.verification-pending":{"value":{"code":"attachment.verification-pending","detail":"The attachment is awaiting verification. Refresh the Proposal before submitting.","fieldPath":"/attachments/support","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}},"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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.verification-pending","idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"422":{"content":{"application/problem+json":{"examples":{"attachment.required":{"value":{"code":"attachment.required","detail":"The required attachment slot is empty.","fieldPath":"/attachments/support","status":422,"title":"Unprocessable Entity","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/required"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/records/targets":{"get":{"operationId":"records.target.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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"type":"object"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"type":"object"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":["clerk"],"x-registry-operation":"list","x-registry-queryKind":"list","x-registry-queryProfiles":{"clerk":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"clerk","requiredFilters":[],"selectableProperties":["jurisdiction","name"],"selectorProperties":[],"sortableProperties":[],"temporal":null}},"x-registry-recordType":"target","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"target","x-registry-responseShape":"RegistryRecordCollectionV1"},"post":{"operationId":"records.target.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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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/target-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/target"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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/target"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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":["clerk"],"x-registry-operation":"create","x-registry-recordType":"target","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"target","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/records/targets/{record_id}":{"get":{"operationId":"records.target.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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"jurisdiction":{"maxLength":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"type":"object"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"type":"object"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":["clerk"],"x-registry-operation":"get","x-registry-recordType":"target","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"target","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/review-completions":{"post":{"description":"Available when a review authority configures a completion block.","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":"webhook-id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"webhook-timestamp","required":true,"schema":{"pattern":"^(0|[1-9][0-9]{0,19})$","type":"string"}},{"in":"header","name":"webhook-signature","required":true,"schema":{"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 is invalid or eventId differs from webhook-id."},"401":{"description":"The completion authority could not be authenticated.","headers":{"WWW-Authenticate":{"schema":{"const":"Registry-Signature scheme=\"standard-webhooks\", version=\"v1\"","type":"string"}}}},"413":{"description":"The completion body exceeds 2048 bytes. The response body is empty."},"415":{"description":"The request is not application/json."},"503":{"description":"The completion could not be durably recorded."}},"security":[{"reviewCompletion":[]}],"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":{"enum":["attachment.required","attachment.verification-pending","attachment.verification-rejected"]}}},"then":{"allOf":[{"else":{"properties":{"status":{"const":422}}},"if":{"properties":{"code":{"const":"attachment.verification-pending"}}},"then":{"properties":{"status":{"const":409}}}}],"properties":{"fieldPath":{"pattern":"^/attachments/[a-z][a-z0-9_-]{0,63}$","type":"string"}},"propertyNames":{"enum":["type","title","status","detail","code","traceId","fieldPath"]},"required":["fieldPath"]}},{"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","failedCheck"]}}},{"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":"access-profile.ambiguous"}}},"then":{"additionalProperties":true,"not":{"required":["failedCheck"]},"properties":{"status":{"const":400}},"required":["accessProfiles"]}},{"if":{"properties":{"code":{"not":{"const":"access-profile.ambiguous"}}}},"then":{"not":{"required":["accessProfiles"]}}},{"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"]}}],"anyOf":[{"properties":{"code":{"const":"access-profile.ambiguous"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},{"properties":{"code":{"const":"action.evidence-failed"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/evidence-failed"}}},{"properties":{"code":{"const":"action.guard-failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/guard-failed"}}},{"properties":{"code":{"const":"action.handler-failed"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/handler-failed"}}},{"properties":{"code":{"const":"action.refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/refused"}}},{"properties":{"code":{"const":"attachment.content-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},{"properties":{"code":{"const":"attachment.digest-mismatch"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch"}}},{"properties":{"code":{"const":"attachment.limit-reached"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached"}}},{"properties":{"code":{"const":"attachment.required"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/required"}}},{"properties":{"code":{"const":"attachment.slot-write-once"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once"}}},{"properties":{"code":{"const":"attachment.too-large"},"status":{"const":413},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},{"properties":{"code":{"const":"attachment.verification-pending"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}}},{"properties":{"code":{"const":"attachment.verification-rejected"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected"}}},{"properties":{"code":{"const":"authentication.refused"},"status":{"const":401},"type":{"const":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},{"properties":{"code":{"const":"idempotency.expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},{"properties":{"code":{"const":"idempotency.key-reused"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}}},{"properties":{"code":{"const":"ingestion.chunk-mismatch"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch"}}},{"properties":{"code":{"const":"ingestion.profile-mismatch"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch"}}},{"properties":{"code":{"const":"ingestion.receipt-erased"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased"}}},{"properties":{"code":{"const":"ingestion.run-blocked"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked"}}},{"properties":{"code":{"const":"ingestion.run-not-open"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open"}}},{"properties":{"code":{"const":"lookup.unresolved"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/lookup/unresolved"}}},{"properties":{"code":{"const":"mutation.conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},{"properties":{"code":{"const":"precondition.failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},{"properties":{"code":{"const":"precondition.required"},"status":{"const":428},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},{"properties":{"code":{"const":"profile.not-authorized"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},{"properties":{"code":{"const":"proposal.rejected"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},{"properties":{"code":{"const":"proposal.review-result-mismatch"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch"}}},{"properties":{"code":{"const":"proposal.submission-expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},{"properties":{"code":{"const":"query.cursor-invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid"}}},{"properties":{"code":{"const":"query.filter-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/filter-required"}}},{"properties":{"code":{"const":"query.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/invalid"}}},{"properties":{"code":{"const":"request.access-reason-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/access-reason-required"}}},{"properties":{"code":{"const":"request.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},{"properties":{"code":{"const":"request.timeout"},"status":{"const":504},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},{"properties":{"code":{"const":"resource.not-found"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/resource/not-found"}}},{"properties":{"code":{"const":"runtime.field-encryption.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable"}}},{"properties":{"code":{"const":"service.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},{"properties":{"code":{"const":"source.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},{"properties":{"code":{"const":"statistical-dataset.domain-violation"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation"}}},{"properties":{"code":{"const":"statistical-dataset.release-refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused"}}},{"properties":{"code":{"const":"statistical-dataset.version-conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict"}}},{"properties":{"code":{"const":"statistical-dataset.version-withdrawn"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn"}}},{"properties":{"code":{"const":"unsupported.media-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/unsupported/media-type"}}},{"properties":{"code":{"const":"write.outside-boundary"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}}],"properties":{"accessProfiles":{"items":{"maxLength":128,"minLength":1,"type":"string"},"minItems":2,"type":"array","uniqueItems":true},"atField":{"maxLength":128,"minLength":1,"type":"string"},"code":{"enum":["access-profile.ambiguous","action.evidence-failed","action.guard-failed","action.handler-failed","action.refused","attachment.content-type","attachment.digest-mismatch","attachment.limit-reached","attachment.required","attachment.slot-write-once","attachment.too-large","attachment.verification-pending","attachment.verification-rejected","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","profile.not-authorized","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"},"failedCheck":{"description":"The check that refused the request, included only in development.","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-name-invoke-input":{"$id":"urn:breg:action:correct-name:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"target":{"format":"uuid","type":"string"},"value":{"maxLength":64,"minLength":0,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-name","x-registry-requiredConditionKeys":[]},"action-correct-name-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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"target":{"$id":"urn:breg:record-type:target","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"jurisdiction":{"maxLength":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"required":["name","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable","x-registry-mutationPolicy":{"patch":"proposal-required"}},"target-create-input":{"$id":"urn:breg:record-type:target:input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"jurisdiction":{"maxLength":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"required":["name","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable"}},"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"},"reviewCompletion":{"description":"The review authority's configured completion key verifies the Standard Webhooks signature.","in":"header","name":"webhook-signature","type":"apiKey"}}},"info":{"title":"required-attachment","version":"1"},"openapi":"3.1.0","paths":{"/v1/actions/correct-name/proposals":{"post":{"operationId":"actions.correct-name.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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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-name-invoke-input"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-correct-name-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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":["clerk"],"x-registry-action":{"access":{"accessProfiles":["clerk"]},"apiName":"correctName","attachments":[{"contentTypes":["text/plain"],"id":"support","maximumBytes":4096,"required":true}],"bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"display":{},"execution":{"application":"manual","mode":"proposal","review":"none"},"id":"correct-name","inputMode":"fixed","inputs":[{"apiName":"target","classification":"internal","fieldType":{"onDelete":"restrict","target":"target","type":"reference"},"id":"target","label":"target","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}},{"apiName":"value","classification":"internal","fieldType":{"maximumLength":64,"minimumLength":0,"type":"string"},"id":"value","label":"value","nullable":false,"required":true,"schema":{"maxLength":64,"minLength":0,"type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[{"apiName":"target","input":"target","targetRecordType":"target"}],"requiredConditionKeys":[],"resultEffects":[{"effect":"name","operation":"patch","recordType":"target"}],"revision":"sha256:bc33d44acbc56e239cd2c88aa76698302a40bba0bf7298b80317a82c9fc4cb36","route":"/v1/actions/correct-name/proposals","routes":{"availability":null,"start":{"inputSchema":"action-correct-name-invoke-input","method":"POST","operationId":"actions.correct-name.start","path":"/v1/actions/correct-name/proposals","requiresIdempotencyKey":true,"responseSchema":"action-correct-name-invoke-response"}}},"x-registry-defaultAccessProfile":"clerk","x-registry-operation":"start","x-registry-routeKind":"invoke"}},"/v1/proposals":{"get":{"operationId":"proposals.list","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","query.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}":{"get":{"operationId":"proposals.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/apply":{"post":{"operationId":"proposals.apply","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/attachments/support":{"delete":{"operationId":"proposals.attachments.support.delete","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]},"get":{"operationId":"proposals.attachments.support.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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":{"*/*":{"schema":{"contentMediaType":"application/octet-stream","maxLength":16777216,"type":"string"}}},"description":"Authorized Proposal operation"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]},"patch":{"operationId":"proposals.attachments.support.patch","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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":{"text/plain":{"schema":{"format":"binary","maxLength":4096,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"413":{"content":{"application/problem+json":{"examples":{"attachment.too-large":{"value":{"code":"attachment.too-large","detail":"The file is larger than the attachment slot accepts.","status":413,"title":"Content Too Large","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.too-large"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"attachment.content-type":{"value":{"code":"attachment.content-type","detail":"The file media type is not one the attachment slot accepts.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.content-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/cancel":{"post":{"operationId":"proposals.cancel","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/edit":{"post":{"operationId":"proposals.edit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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-name:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"target":{"format":"uuid","type":"string"},"value":{"maxLength":64,"minLength":0,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-name","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/rebase":{"post":{"operationId":"proposals.rebase","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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-name:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"target":{"format":"uuid","type":"string"},"value":{"maxLength":64,"minLength":0,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-name","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/revise":{"post":{"operationId":"proposals.revise","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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-name:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"target":{"format":"uuid","type":"string"},"value":{"maxLength":64,"minLength":0,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-name","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/submissions/{submission_version}":{"get":{"operationId":"proposals.get-submission","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"proposal.submission-expired":{"value":{"code":"proposal.submission-expired","detail":"The review result and application receipt of the submission are no longer retained.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["proposal.submission-expired"]}},"type":"object"}]}}},"description":"The submission's review result and application receipt are no longer retained","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/proposals/{proposal_id}/submit":{"post":{"operationId":"proposals.submit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["clerk"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"attachment.verification-pending":{"value":{"code":"attachment.verification-pending","detail":"The attachment is awaiting verification. Refresh the Proposal before submitting.","fieldPath":"/attachments/support","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}},"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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.verification-pending","idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"422":{"content":{"application/problem+json":{"examples":{"attachment.required":{"value":{"code":"attachment.required","detail":"The required attachment slot is empty.","fieldPath":"/attachments/support","status":422,"title":"Unprocessable Entity","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/required"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["clerk"]}},"/v1/records/targets":{"get":{"operationId":"records.target.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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":"limit","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":"cursor","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":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"type":"object"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"type":"object"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":["clerk"],"x-registry-operation":"list","x-registry-queryKind":"list","x-registry-queryProfiles":{"clerk":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"clerk","requiredFilters":[],"selectableProperties":["jurisdiction","name"],"selectorProperties":[],"sortableProperties":[],"temporal":null}},"x-registry-recordType":"target","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"target","x-registry-responseShape":"RegistryRecordCollectionV1"},"post":{"operationId":"records.target.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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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/target-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/target"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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/target"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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":["clerk"],"x-registry-operation":"create","x-registry-recordType":"target","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"target","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/records/targets/{record_id}":{"get":{"operationId":"records.target.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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"jurisdiction":{"maxLength":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"type":"object"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":64,"minLength":0,"type":"string"},"name":{"maxLength":64,"minLength":0,"type":"string"}},"type":"object"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"target"},"registryId":{"const":"required-attachment"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":["clerk"],"x-registry-operation":"get","x-registry-recordType":"target","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"target","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/review-completions":{"post":{"description":"Available when a review authority configures a completion block.","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":"webhook-id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"webhook-timestamp","required":true,"schema":{"pattern":"^(0|[1-9][0-9]{0,19})$","type":"string"}},{"in":"header","name":"webhook-signature","required":true,"schema":{"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 is invalid or eventId differs from webhook-id."},"401":{"description":"The completion authority could not be authenticated.","headers":{"WWW-Authenticate":{"schema":{"const":"Registry-Signature scheme=\"standard-webhooks\", version=\"v1\"","type":"string"}}}},"413":{"description":"The completion body exceeds 2048 bytes. The response body is empty."},"415":{"description":"The request is not application/json."},"503":{"description":"The completion could not be durably recorded."}},"security":[{"reviewCompletion":[]}],"summary":"Receive a Casework review completion"}}}} \ No newline at end of file diff --git a/products/breg/generated/facility/generated/openapi.json b/products/breg/generated/facility/generated/openapi.json index 62bd90a41e..1d5bb9d848 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":{"enum":["attachment.required","attachment.verification-pending","attachment.verification-rejected"]}}},"then":{"allOf":[{"else":{"properties":{"status":{"const":422}}},"if":{"properties":{"code":{"const":"attachment.verification-pending"}}},"then":{"properties":{"status":{"const":409}}}}],"properties":{"fieldPath":{"pattern":"^/attachments/[a-z][a-z0-9_-]{0,63}$","type":"string"}},"propertyNames":{"enum":["type","title","status","detail","code","traceId","fieldPath"]},"required":["fieldPath"]}},{"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","failedCheck"]}}},{"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":"access-profile.ambiguous"}}},"then":{"additionalProperties":true,"properties":{"status":{"const":400}},"required":["accessProfiles"]}},{"if":{"properties":{"code":{"not":{"const":"access-profile.ambiguous"}}}},"then":{"not":{"required":["accessProfiles"]}}},{"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"]}}],"anyOf":[{"properties":{"code":{"const":"access-profile.ambiguous"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},{"properties":{"code":{"const":"action.evidence-failed"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/evidence-failed"}}},{"properties":{"code":{"const":"action.guard-failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/guard-failed"}}},{"properties":{"code":{"const":"action.handler-failed"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/handler-failed"}}},{"properties":{"code":{"const":"action.refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/refused"}}},{"properties":{"code":{"const":"attachment.content-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},{"properties":{"code":{"const":"attachment.digest-mismatch"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch"}}},{"properties":{"code":{"const":"attachment.limit-reached"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached"}}},{"properties":{"code":{"const":"attachment.required"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/required"}}},{"properties":{"code":{"const":"attachment.slot-write-once"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once"}}},{"properties":{"code":{"const":"attachment.too-large"},"status":{"const":413},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},{"properties":{"code":{"const":"attachment.verification-pending"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}}},{"properties":{"code":{"const":"attachment.verification-rejected"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected"}}},{"properties":{"code":{"const":"authentication.refused"},"status":{"const":401},"type":{"const":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},{"properties":{"code":{"const":"idempotency.expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},{"properties":{"code":{"const":"idempotency.key-reused"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}}},{"properties":{"code":{"const":"ingestion.chunk-mismatch"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch"}}},{"properties":{"code":{"const":"ingestion.profile-mismatch"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch"}}},{"properties":{"code":{"const":"ingestion.receipt-erased"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased"}}},{"properties":{"code":{"const":"ingestion.run-blocked"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked"}}},{"properties":{"code":{"const":"ingestion.run-not-open"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open"}}},{"properties":{"code":{"const":"lookup.unresolved"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/lookup/unresolved"}}},{"properties":{"code":{"const":"mutation.conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},{"properties":{"code":{"const":"precondition.failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},{"properties":{"code":{"const":"precondition.required"},"status":{"const":428},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},{"properties":{"code":{"const":"profile.not-authorized"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},{"properties":{"code":{"const":"proposal.rejected"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},{"properties":{"code":{"const":"proposal.review-result-mismatch"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch"}}},{"properties":{"code":{"const":"proposal.submission-expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},{"properties":{"code":{"const":"query.cursor-invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid"}}},{"properties":{"code":{"const":"query.filter-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/filter-required"}}},{"properties":{"code":{"const":"query.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/invalid"}}},{"properties":{"code":{"const":"request.access-reason-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/access-reason-required"}}},{"properties":{"code":{"const":"request.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},{"properties":{"code":{"const":"request.timeout"},"status":{"const":504},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},{"properties":{"code":{"const":"resource.not-found"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/resource/not-found"}}},{"properties":{"code":{"const":"runtime.field-encryption.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable"}}},{"properties":{"code":{"const":"service.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},{"properties":{"code":{"const":"source.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},{"properties":{"code":{"const":"statistical-dataset.domain-violation"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation"}}},{"properties":{"code":{"const":"statistical-dataset.release-refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused"}}},{"properties":{"code":{"const":"statistical-dataset.version-conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict"}}},{"properties":{"code":{"const":"statistical-dataset.version-withdrawn"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn"}}},{"properties":{"code":{"const":"unsupported.media-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/unsupported/media-type"}}},{"properties":{"code":{"const":"write.outside-boundary"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}}],"properties":{"accessProfiles":{"items":{"maxLength":128,"minLength":1,"type":"string"},"minItems":2,"type":"array","uniqueItems":true},"atField":{"maxLength":128,"minLength":1,"type":"string"},"code":{"enum":["access-profile.ambiguous","action.evidence-failed","action.guard-failed","action.handler-failed","action.refused","attachment.content-type","attachment.digest-mismatch","attachment.limit-reached","attachment.required","attachment.slot-write-once","attachment.too-large","attachment.verification-pending","attachment.verification-rejected","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","profile.not-authorized","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"},"failedCheck":{"description":"The check that refused the request, included only in development.","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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},"guardLabel":{"maxLength":256,"minLength":1,"type":"string"},"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"},"reviewCompletion":{"description":"The review authority's configured completion key verifies the Standard Webhooks signature.","in":"header","name":"webhook-signature","type":"apiKey"}}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","query.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"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":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["proposal-reviewer"],"maxLength":128,"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["proposal-reviewer"]}},"/v1/proposals/{proposal_id}":{"get":{"operationId":"proposals.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-applier","facility-correction-author"]}},"/v1/proposals/{proposal_id}/apply":{"post":{"operationId":"proposals.apply","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-applier"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.review-result-mismatch":{"value":{"code":"proposal.review-result-mismatch","detail":"The current review result does not match the retained approval.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["action.guard-failed","precondition.failed","proposal.review-result-mismatch"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-applier"]}},"/v1/proposals/{proposal_id}/attachments/supporting-document":{"delete":{"operationId":"proposals.attachments.supporting-document.delete","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]},"get":{"operationId":"proposals.attachments.supporting-document.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author","proposal-reviewer"],"maxLength":128,"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":{"*/*":{"schema":{"contentMediaType":"application/octet-stream","maxLength":16777216,"type":"string"}}},"description":"Authorized Proposal operation"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author","proposal-reviewer"]},"patch":{"operationId":"proposals.attachments.supporting-document.patch","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"413":{"content":{"application/problem+json":{"examples":{"attachment.too-large":{"value":{"code":"attachment.too-large","detail":"The file is larger than the attachment slot accepts.","status":413,"title":"Content Too Large","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.too-large"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"attachment.content-type":{"value":{"code":"attachment.content-type","detail":"The file media type is not one the attachment slot accepts.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.content-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/cancel":{"post":{"operationId":"proposals.cancel","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/edit":{"post":{"operationId":"proposals.edit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/rebase":{"post":{"operationId":"proposals.rebase","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/retry":{"post":{"operationId":"proposals.retry","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/review-context":{"get":{"operationId":"proposals.get-review-context","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["proposal-reviewer"],"maxLength":128,"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Request live applicant answers for a displayed human review context. Admission and preflight reads omit this option and receive no intrinsic asks.","in":"query","name":"include","required":false,"schema":{"const":"answers"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"authority":{"type":"string"},"context":{"additionalProperties":false,"properties":{"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"answeredAt":{"format":"date-time","type":"string"},"documents":{"items":{"additionalProperties":false,"properties":{"byteSize":{"maximum":16777216,"minimum":1,"type":"integer"},"contentType":{"maxLength":255,"type":"string"},"download":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"method":{"const":"GET"},"operation":{"const":"get-review-context"},"path":{"type":"string"}},"required":["method","operation","accessProfile","path"],"type":"object"},"id":{"format":"uuid","type":"string"},"sha256":{"pattern":"^[0-9a-f]{64}$","type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["id","sha256","contentType","byteSize","verificationStatus"],"type":"object"},"maxItems":32,"type":"array"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["documents","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state"],"type":"object"},"maxItems":50,"type":"array"},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["proposal-reviewer"]}},"/v1/proposals/{proposal_id}/review-status":{"get":{"operationId":"proposals.get-review-status","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["casework-review-status","facility-correction-author"],"maxLength":128,"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["casework-review-status","facility-correction-author"]}},"/v1/proposals/{proposal_id}/revise":{"post":{"operationId":"proposals.revise","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/submissions/{submission_version}":{"get":{"operationId":"proposals.get-submission","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"maxLength":128,"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","revise","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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"proposal.submission-expired":{"value":{"code":"proposal.submission-expired","detail":"The review result and application receipt of the submission are no longer retained.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["proposal.submission-expired"]}},"type":"object"}]}}},"description":"The submission's review result and application receipt are no longer retained","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-applier","facility-correction-author"]}},"/v1/proposals/{proposal_id}/submit":{"post":{"operationId":"proposals.submit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"attachment.verification-pending":{"value":{"code":"attachment.verification-pending","detail":"The attachment is awaiting verification. Refresh the Proposal before submitting.","fieldPath":"/attachments/supporting-document","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}},"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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.verification-pending","idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["action.guard-failed","precondition.failed"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"422":{"content":{"application/problem+json":{"examples":{"action.refused/invalid-postal-code":{"value":{"code":"action.refused","detail":"Postal code is invalid","refusalCode":"invalid-postal-code","status":422,"title":"Unprocessable Entity","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/action/refused"}},"attachment.verification-rejected":{"value":{"code":"attachment.verification-rejected","detail":"The attachment was rejected by verification. Replace or remove the file before submitting.","fieldPath":"/attachments/supporting-document","status":422,"title":"Unprocessable Entity","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["action.refused","attachment.verification-rejected"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"500":{"content":{"application/problem+json":{"examples":{"action.handler-failed":{"value":{"code":"action.handler-failed","detail":"The action handler could not produce an accepted result.","status":500,"title":"Internal Server Error","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/action/handler-failed"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["action.handler-failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility-assignment"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility-assignment"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility-assignment"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility-assignment"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"selectableProperties":["jurisdiction","operatorCode","status"],"selectorProperties":[],"sortableProperties":[],"temporal":null},"operator-editor":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"operator-editor","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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 block.","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":"webhook-id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"webhook-timestamp","required":true,"schema":{"pattern":"^(0|[1-9][0-9]{0,19})$","type":"string"}},{"in":"header","name":"webhook-signature","required":true,"schema":{"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 is invalid or eventId differs from webhook-id."},"401":{"description":"The completion authority could not be authenticated.","headers":{"WWW-Authenticate":{"schema":{"const":"Registry-Signature scheme=\"standard-webhooks\", version=\"v1\"","type":"string"}}}},"413":{"description":"The completion body exceeds 2048 bytes. The response body is empty."},"415":{"description":"The request is not application/json."},"503":{"description":"The completion could not be durably recorded."}},"security":[{"reviewCompletion":[]}],"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":{"enum":["attachment.required","attachment.verification-pending","attachment.verification-rejected"]}}},"then":{"allOf":[{"else":{"properties":{"status":{"const":422}}},"if":{"properties":{"code":{"const":"attachment.verification-pending"}}},"then":{"properties":{"status":{"const":409}}}}],"properties":{"fieldPath":{"pattern":"^/attachments/[a-z][a-z0-9_-]{0,63}$","type":"string"}},"propertyNames":{"enum":["type","title","status","detail","code","traceId","fieldPath"]},"required":["fieldPath"]}},{"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","failedCheck"]}}},{"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":"access-profile.ambiguous"}}},"then":{"additionalProperties":true,"not":{"required":["failedCheck"]},"properties":{"status":{"const":400}},"required":["accessProfiles"]}},{"if":{"properties":{"code":{"not":{"const":"access-profile.ambiguous"}}}},"then":{"not":{"required":["accessProfiles"]}}},{"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"]}}],"anyOf":[{"properties":{"code":{"const":"access-profile.ambiguous"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},{"properties":{"code":{"const":"action.evidence-failed"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/evidence-failed"}}},{"properties":{"code":{"const":"action.guard-failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/guard-failed"}}},{"properties":{"code":{"const":"action.handler-failed"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/handler-failed"}}},{"properties":{"code":{"const":"action.refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/refused"}}},{"properties":{"code":{"const":"attachment.content-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},{"properties":{"code":{"const":"attachment.digest-mismatch"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch"}}},{"properties":{"code":{"const":"attachment.limit-reached"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached"}}},{"properties":{"code":{"const":"attachment.required"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/required"}}},{"properties":{"code":{"const":"attachment.slot-write-once"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once"}}},{"properties":{"code":{"const":"attachment.too-large"},"status":{"const":413},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},{"properties":{"code":{"const":"attachment.verification-pending"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}}},{"properties":{"code":{"const":"attachment.verification-rejected"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected"}}},{"properties":{"code":{"const":"authentication.refused"},"status":{"const":401},"type":{"const":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},{"properties":{"code":{"const":"idempotency.expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},{"properties":{"code":{"const":"idempotency.key-reused"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}}},{"properties":{"code":{"const":"ingestion.chunk-mismatch"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch"}}},{"properties":{"code":{"const":"ingestion.profile-mismatch"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch"}}},{"properties":{"code":{"const":"ingestion.receipt-erased"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased"}}},{"properties":{"code":{"const":"ingestion.run-blocked"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked"}}},{"properties":{"code":{"const":"ingestion.run-not-open"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open"}}},{"properties":{"code":{"const":"lookup.unresolved"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/lookup/unresolved"}}},{"properties":{"code":{"const":"mutation.conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},{"properties":{"code":{"const":"precondition.failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},{"properties":{"code":{"const":"precondition.required"},"status":{"const":428},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},{"properties":{"code":{"const":"profile.not-authorized"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},{"properties":{"code":{"const":"proposal.rejected"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},{"properties":{"code":{"const":"proposal.review-result-mismatch"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch"}}},{"properties":{"code":{"const":"proposal.submission-expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},{"properties":{"code":{"const":"query.cursor-invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid"}}},{"properties":{"code":{"const":"query.filter-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/filter-required"}}},{"properties":{"code":{"const":"query.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/invalid"}}},{"properties":{"code":{"const":"request.access-reason-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/access-reason-required"}}},{"properties":{"code":{"const":"request.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},{"properties":{"code":{"const":"request.timeout"},"status":{"const":504},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},{"properties":{"code":{"const":"resource.not-found"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/resource/not-found"}}},{"properties":{"code":{"const":"runtime.field-encryption.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable"}}},{"properties":{"code":{"const":"service.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},{"properties":{"code":{"const":"source.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},{"properties":{"code":{"const":"statistical-dataset.domain-violation"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation"}}},{"properties":{"code":{"const":"statistical-dataset.release-refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused"}}},{"properties":{"code":{"const":"statistical-dataset.version-conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict"}}},{"properties":{"code":{"const":"statistical-dataset.version-withdrawn"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn"}}},{"properties":{"code":{"const":"unsupported.media-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/unsupported/media-type"}}},{"properties":{"code":{"const":"write.outside-boundary"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}}],"properties":{"accessProfiles":{"items":{"maxLength":128,"minLength":1,"type":"string"},"minItems":2,"type":"array","uniqueItems":true},"atField":{"maxLength":128,"minLength":1,"type":"string"},"code":{"enum":["access-profile.ambiguous","action.evidence-failed","action.guard-failed","action.handler-failed","action.refused","attachment.content-type","attachment.digest-mismatch","attachment.limit-reached","attachment.required","attachment.slot-write-once","attachment.too-large","attachment.verification-pending","attachment.verification-rejected","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","profile.not-authorized","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"},"failedCheck":{"description":"The check that refused the request, included only in development.","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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},"guardLabel":{"maxLength":256,"minLength":1,"type":"string"},"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"},"reviewCompletion":{"description":"The review authority's configured completion key verifies the Standard Webhooks signature.","in":"header","name":"webhook-signature","type":"apiKey"}}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","query.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"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":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["proposal-reviewer"],"maxLength":128,"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["proposal-reviewer"]}},"/v1/proposals/{proposal_id}":{"get":{"operationId":"proposals.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-applier","facility-correction-author"]}},"/v1/proposals/{proposal_id}/apply":{"post":{"operationId":"proposals.apply","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-applier"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.review-result-mismatch":{"value":{"code":"proposal.review-result-mismatch","detail":"The current review result does not match the retained approval.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["action.guard-failed","precondition.failed","proposal.review-result-mismatch"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-applier"]}},"/v1/proposals/{proposal_id}/attachments/supporting-document":{"delete":{"operationId":"proposals.attachments.supporting-document.delete","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]},"get":{"operationId":"proposals.attachments.supporting-document.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author","proposal-reviewer"],"maxLength":128,"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":{"*/*":{"schema":{"contentMediaType":"application/octet-stream","maxLength":16777216,"type":"string"}}},"description":"Authorized Proposal operation"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author","proposal-reviewer"]},"patch":{"operationId":"proposals.attachments.supporting-document.patch","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"413":{"content":{"application/problem+json":{"examples":{"attachment.too-large":{"value":{"code":"attachment.too-large","detail":"The file is larger than the attachment slot accepts.","status":413,"title":"Content Too Large","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.too-large"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"attachment.content-type":{"value":{"code":"attachment.content-type","detail":"The file media type is not one the attachment slot accepts.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.content-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/cancel":{"post":{"operationId":"proposals.cancel","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/edit":{"post":{"operationId":"proposals.edit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/rebase":{"post":{"operationId":"proposals.rebase","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/retry":{"post":{"operationId":"proposals.retry","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/review-context":{"get":{"operationId":"proposals.get-review-context","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["proposal-reviewer"],"maxLength":128,"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Request live applicant answers for a displayed human review context. Admission and preflight reads omit this option and receive no intrinsic asks.","in":"query","name":"include","required":false,"schema":{"const":"answers"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"authority":{"type":"string"},"context":{"additionalProperties":false,"properties":{"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"answeredAt":{"format":"date-time","type":"string"},"documents":{"items":{"additionalProperties":false,"properties":{"byteSize":{"maximum":16777216,"minimum":1,"type":"integer"},"contentType":{"maxLength":255,"type":"string"},"download":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"method":{"const":"GET"},"operation":{"const":"get-review-context"},"path":{"type":"string"}},"required":["method","operation","accessProfile","path"],"type":"object"},"id":{"format":"uuid","type":"string"},"sha256":{"pattern":"^[0-9a-f]{64}$","type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["id","sha256","contentType","byteSize","verificationStatus"],"type":"object"},"maxItems":32,"type":"array"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["documents","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state"],"type":"object"},"maxItems":50,"type":"array"},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["proposal-reviewer"]}},"/v1/proposals/{proposal_id}/review-status":{"get":{"operationId":"proposals.get-review-status","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["casework-review-status","facility-correction-author"],"maxLength":128,"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["casework-review-status","facility-correction-author"]}},"/v1/proposals/{proposal_id}/revise":{"post":{"operationId":"proposals.revise","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/submissions/{submission_version}":{"get":{"operationId":"proposals.get-submission","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"maxLength":128,"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","revise","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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"proposal.submission-expired":{"value":{"code":"proposal.submission-expired","detail":"The review result and application receipt of the submission are no longer retained.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["proposal.submission-expired"]}},"type":"object"}]}}},"description":"The submission's review result and application receipt are no longer retained","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["facility-correction-applier","facility-correction-author"]}},"/v1/proposals/{proposal_id}/submit":{"post":{"operationId":"proposals.submit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["facility-correction-author"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"attachment.verification-pending":{"value":{"code":"attachment.verification-pending","detail":"The attachment is awaiting verification. Refresh the Proposal before submitting.","fieldPath":"/attachments/supporting-document","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}},"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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["attachment.verification-pending","idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["action.guard-failed","precondition.failed"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"422":{"content":{"application/problem+json":{"examples":{"action.refused/invalid-postal-code":{"value":{"code":"action.refused","detail":"Postal code is invalid","refusalCode":"invalid-postal-code","status":422,"title":"Unprocessable Entity","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/action/refused"}},"attachment.verification-rejected":{"value":{"code":"attachment.verification-rejected","detail":"The attachment was rejected by verification. Replace or remove the file before submitting.","fieldPath":"/attachments/supporting-document","status":422,"title":"Unprocessable Entity","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["action.refused","attachment.verification-rejected"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"500":{"content":{"application/problem+json":{"examples":{"action.handler-failed":{"value":{"code":"action.handler-failed","detail":"The action handler could not produce an accepted result.","status":500,"title":"Internal Server Error","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/action/handler-failed"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["action.handler-failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":"limit","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":"cursor","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"directory-entry"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":"limit","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":"cursor","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":"limit","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":"cursor","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":"limit","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":"cursor","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility-assignment"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility-assignment"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility-assignment"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"facility-assignment"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":"limit","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":"cursor","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"selectableProperties":["jurisdiction","operatorCode","status"],"selectorProperties":[],"sortableProperties":[],"temporal":null},"operator-editor":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"operator-editor","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"facility-registry"},"recordTypeId":{"const":"operator"},"registryId":{"const":"facility-registry"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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 block.","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":"webhook-id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"webhook-timestamp","required":true,"schema":{"pattern":"^(0|[1-9][0-9]{0,19})$","type":"string"}},{"in":"header","name":"webhook-signature","required":true,"schema":{"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 is invalid or eventId differs from webhook-id."},"401":{"description":"The completion authority could not be authenticated.","headers":{"WWW-Authenticate":{"schema":{"const":"Registry-Signature scheme=\"standard-webhooks\", version=\"v1\"","type":"string"}}}},"413":{"description":"The completion body exceeds 2048 bytes. The response body is empty."},"415":{"description":"The request is not application/json."},"503":{"description":"The completion could not be durably recorded."}},"security":[{"reviewCompletion":[]}],"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 442a7b6342..2ac533468b 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":{"enum":["attachment.required","attachment.verification-pending","attachment.verification-rejected"]}}},"then":{"allOf":[{"else":{"properties":{"status":{"const":422}}},"if":{"properties":{"code":{"const":"attachment.verification-pending"}}},"then":{"properties":{"status":{"const":409}}}}],"properties":{"fieldPath":{"pattern":"^/attachments/[a-z][a-z0-9_-]{0,63}$","type":"string"}},"propertyNames":{"enum":["type","title","status","detail","code","traceId","fieldPath"]},"required":["fieldPath"]}},{"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","failedCheck"]}}},{"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":"access-profile.ambiguous"}}},"then":{"additionalProperties":true,"properties":{"status":{"const":400}},"required":["accessProfiles"]}},{"if":{"properties":{"code":{"not":{"const":"access-profile.ambiguous"}}}},"then":{"not":{"required":["accessProfiles"]}}},{"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"]}}],"anyOf":[{"properties":{"code":{"const":"access-profile.ambiguous"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},{"properties":{"code":{"const":"action.evidence-failed"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/evidence-failed"}}},{"properties":{"code":{"const":"action.guard-failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/guard-failed"}}},{"properties":{"code":{"const":"action.handler-failed"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/handler-failed"}}},{"properties":{"code":{"const":"action.refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/refused"}}},{"properties":{"code":{"const":"attachment.content-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},{"properties":{"code":{"const":"attachment.digest-mismatch"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch"}}},{"properties":{"code":{"const":"attachment.limit-reached"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached"}}},{"properties":{"code":{"const":"attachment.required"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/required"}}},{"properties":{"code":{"const":"attachment.slot-write-once"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once"}}},{"properties":{"code":{"const":"attachment.too-large"},"status":{"const":413},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},{"properties":{"code":{"const":"attachment.verification-pending"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}}},{"properties":{"code":{"const":"attachment.verification-rejected"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected"}}},{"properties":{"code":{"const":"authentication.refused"},"status":{"const":401},"type":{"const":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},{"properties":{"code":{"const":"idempotency.expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},{"properties":{"code":{"const":"idempotency.key-reused"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}}},{"properties":{"code":{"const":"ingestion.chunk-mismatch"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch"}}},{"properties":{"code":{"const":"ingestion.profile-mismatch"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch"}}},{"properties":{"code":{"const":"ingestion.receipt-erased"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased"}}},{"properties":{"code":{"const":"ingestion.run-blocked"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked"}}},{"properties":{"code":{"const":"ingestion.run-not-open"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open"}}},{"properties":{"code":{"const":"lookup.unresolved"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/lookup/unresolved"}}},{"properties":{"code":{"const":"mutation.conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},{"properties":{"code":{"const":"precondition.failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},{"properties":{"code":{"const":"precondition.required"},"status":{"const":428},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},{"properties":{"code":{"const":"profile.not-authorized"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},{"properties":{"code":{"const":"proposal.rejected"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},{"properties":{"code":{"const":"proposal.review-result-mismatch"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch"}}},{"properties":{"code":{"const":"proposal.submission-expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},{"properties":{"code":{"const":"query.cursor-invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid"}}},{"properties":{"code":{"const":"query.filter-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/filter-required"}}},{"properties":{"code":{"const":"query.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/invalid"}}},{"properties":{"code":{"const":"request.access-reason-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/access-reason-required"}}},{"properties":{"code":{"const":"request.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},{"properties":{"code":{"const":"request.timeout"},"status":{"const":504},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},{"properties":{"code":{"const":"resource.not-found"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/resource/not-found"}}},{"properties":{"code":{"const":"runtime.field-encryption.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable"}}},{"properties":{"code":{"const":"service.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},{"properties":{"code":{"const":"source.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},{"properties":{"code":{"const":"statistical-dataset.domain-violation"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation"}}},{"properties":{"code":{"const":"statistical-dataset.release-refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused"}}},{"properties":{"code":{"const":"statistical-dataset.version-conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict"}}},{"properties":{"code":{"const":"statistical-dataset.version-withdrawn"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn"}}},{"properties":{"code":{"const":"unsupported.media-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/unsupported/media-type"}}},{"properties":{"code":{"const":"write.outside-boundary"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}}],"properties":{"accessProfiles":{"items":{"maxLength":128,"minLength":1,"type":"string"},"minItems":2,"type":"array","uniqueItems":true},"atField":{"maxLength":128,"minLength":1,"type":"string"},"code":{"enum":["access-profile.ambiguous","action.evidence-failed","action.guard-failed","action.handler-failed","action.refused","attachment.content-type","attachment.digest-mismatch","attachment.limit-reached","attachment.required","attachment.slot-write-once","attachment.too-large","attachment.verification-pending","attachment.verification-rejected","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","profile.not-authorized","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"},"failedCheck":{"description":"The check that refused the request, included only in development.","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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},"guardLabel":{"maxLength":256,"minLength":1,"type":"string"},"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"},"reviewCompletion":{"description":"The review authority's configured completion key verifies the Standard Webhooks signature.","in":"header","name":"webhook-signature","type":"apiKey"}}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","query.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}":{"get":{"operationId":"proposals.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/cancel":{"post":{"operationId":"proposals.cancel","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/edit":{"post":{"operationId":"proposals.edit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/submissions/{submission_version}":{"get":{"operationId":"proposals.get-submission","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"proposal.submission-expired":{"value":{"code":"proposal.submission-expired","detail":"The review result and application receipt of the submission are no longer retained.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["proposal.submission-expired"]}},"type":"object"}]}}},"description":"The submission's review result and application receipt are no longer retained","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/submit":{"post":{"operationId":"proposals.submit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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 block.","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":"webhook-id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"webhook-timestamp","required":true,"schema":{"pattern":"^(0|[1-9][0-9]{0,19})$","type":"string"}},{"in":"header","name":"webhook-signature","required":true,"schema":{"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 is invalid or eventId differs from webhook-id."},"401":{"description":"The completion authority could not be authenticated.","headers":{"WWW-Authenticate":{"schema":{"const":"Registry-Signature scheme=\"standard-webhooks\", version=\"v1\"","type":"string"}}}},"413":{"description":"The completion body exceeds 2048 bytes. The response body is empty."},"415":{"description":"The request is not application/json."},"503":{"description":"The completion could not be durably recorded."}},"security":[{"reviewCompletion":[]}],"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":{"enum":["attachment.required","attachment.verification-pending","attachment.verification-rejected"]}}},"then":{"allOf":[{"else":{"properties":{"status":{"const":422}}},"if":{"properties":{"code":{"const":"attachment.verification-pending"}}},"then":{"properties":{"status":{"const":409}}}}],"properties":{"fieldPath":{"pattern":"^/attachments/[a-z][a-z0-9_-]{0,63}$","type":"string"}},"propertyNames":{"enum":["type","title","status","detail","code","traceId","fieldPath"]},"required":["fieldPath"]}},{"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","failedCheck"]}}},{"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":"access-profile.ambiguous"}}},"then":{"additionalProperties":true,"not":{"required":["failedCheck"]},"properties":{"status":{"const":400}},"required":["accessProfiles"]}},{"if":{"properties":{"code":{"not":{"const":"access-profile.ambiguous"}}}},"then":{"not":{"required":["accessProfiles"]}}},{"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"]}}],"anyOf":[{"properties":{"code":{"const":"access-profile.ambiguous"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},{"properties":{"code":{"const":"action.evidence-failed"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/evidence-failed"}}},{"properties":{"code":{"const":"action.guard-failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/guard-failed"}}},{"properties":{"code":{"const":"action.handler-failed"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/handler-failed"}}},{"properties":{"code":{"const":"action.refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/action/refused"}}},{"properties":{"code":{"const":"attachment.content-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/content-type"}}},{"properties":{"code":{"const":"attachment.digest-mismatch"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch"}}},{"properties":{"code":{"const":"attachment.limit-reached"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/limit-reached"}}},{"properties":{"code":{"const":"attachment.required"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/required"}}},{"properties":{"code":{"const":"attachment.slot-write-once"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once"}}},{"properties":{"code":{"const":"attachment.too-large"},"status":{"const":413},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/too-large"}}},{"properties":{"code":{"const":"attachment.verification-pending"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-pending"}}},{"properties":{"code":{"const":"attachment.verification-rejected"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/attachment/verification-rejected"}}},{"properties":{"code":{"const":"authentication.refused"},"status":{"const":401},"type":{"const":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},{"properties":{"code":{"const":"idempotency.expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},{"properties":{"code":{"const":"idempotency.key-reused"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}}},{"properties":{"code":{"const":"ingestion.chunk-mismatch"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/chunk-mismatch"}}},{"properties":{"code":{"const":"ingestion.profile-mismatch"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/profile-mismatch"}}},{"properties":{"code":{"const":"ingestion.receipt-erased"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/receipt-erased"}}},{"properties":{"code":{"const":"ingestion.run-blocked"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-blocked"}}},{"properties":{"code":{"const":"ingestion.run-not-open"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/ingestion/run-not-open"}}},{"properties":{"code":{"const":"lookup.unresolved"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/lookup/unresolved"}}},{"properties":{"code":{"const":"mutation.conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},{"properties":{"code":{"const":"precondition.failed"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},{"properties":{"code":{"const":"precondition.required"},"status":{"const":428},"type":{"const":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},{"properties":{"code":{"const":"profile.not-authorized"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},{"properties":{"code":{"const":"proposal.rejected"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},{"properties":{"code":{"const":"proposal.review-result-mismatch"},"status":{"const":412},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/review-result-mismatch"}}},{"properties":{"code":{"const":"proposal.submission-expired"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},{"properties":{"code":{"const":"query.cursor-invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/cursor-invalid"}}},{"properties":{"code":{"const":"query.filter-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/filter-required"}}},{"properties":{"code":{"const":"query.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/query/invalid"}}},{"properties":{"code":{"const":"request.access-reason-required"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/access-reason-required"}}},{"properties":{"code":{"const":"request.invalid"},"status":{"const":400},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},{"properties":{"code":{"const":"request.timeout"},"status":{"const":504},"type":{"const":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},{"properties":{"code":{"const":"resource.not-found"},"status":{"const":404},"type":{"const":"https://id.registrystack.org/problems/registry-breg/resource/not-found"}}},{"properties":{"code":{"const":"runtime.field-encryption.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/runtime/field-encryption/unavailable"}}},{"properties":{"code":{"const":"service.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},{"properties":{"code":{"const":"source.unavailable"},"status":{"const":503},"type":{"const":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},{"properties":{"code":{"const":"statistical-dataset.domain-violation"},"status":{"const":500},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/domain-violation"}}},{"properties":{"code":{"const":"statistical-dataset.release-refused"},"status":{"const":422},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/release-refused"}}},{"properties":{"code":{"const":"statistical-dataset.version-conflict"},"status":{"const":409},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-conflict"}}},{"properties":{"code":{"const":"statistical-dataset.version-withdrawn"},"status":{"const":410},"type":{"const":"https://id.registrystack.org/problems/registry-breg/statistical-dataset/version-withdrawn"}}},{"properties":{"code":{"const":"unsupported.media-type"},"status":{"const":415},"type":{"const":"https://id.registrystack.org/problems/registry-breg/unsupported/media-type"}}},{"properties":{"code":{"const":"write.outside-boundary"},"status":{"const":403},"type":{"const":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}}],"properties":{"accessProfiles":{"items":{"maxLength":128,"minLength":1,"type":"string"},"minItems":2,"type":"array","uniqueItems":true},"atField":{"maxLength":128,"minLength":1,"type":"string"},"code":{"enum":["access-profile.ambiguous","action.evidence-failed","action.guard-failed","action.handler-failed","action.refused","attachment.content-type","attachment.digest-mismatch","attachment.limit-reached","attachment.required","attachment.slot-write-once","attachment.too-large","attachment.verification-pending","attachment.verification-rejected","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","profile.not-authorized","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"},"failedCheck":{"description":"The check that refused the request, included only in development.","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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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},"guardLabel":{"maxLength":256,"minLength":1,"type":"string"},"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"},"reviewCompletion":{"description":"The review authority's configured completion key verifies the Standard Webhooks signature.","in":"header","name":"webhook-signature","type":"apiKey"}}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","query.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}":{"get":{"operationId":"proposals.get","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/cancel":{"post":{"operationId":"proposals.cancel","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/edit":{"post":{"operationId":"proposals.edit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"description":"Observed authority or lifecycle condition changed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/submissions/{submission_version}":{"get":{"operationId":"proposals.get-submission","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"proposal.submission-expired":{"value":{"code":"proposal.submission-expired","detail":"The review result and application receipt of the submission are no longer retained.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/submission-expired"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["proposal.submission-expired"]}},"type":"object"}]}}},"description":"The submission's review result and application receipt are no longer retained","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/submit":{"post":{"operationId":"proposals.submit","parameters":[{"description":"Select one compiled access profile. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"enum":["directory-editor"],"maxLength":128,"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","revise","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"asks":{"items":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":false,"properties":{"additions":{"items":{"format":"uuid","type":"string"},"maxItems":32,"type":"array","uniqueItems":true},"answeredAt":{"format":"date-time","type":"string"},"text":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["additions","answeredAt"],"type":"object"},"askedAt":{"format":"date-time","type":"string"},"dueAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"links":{"additionalProperties":false,"properties":{"answer":{"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"const":"POST"},"operation":{"const":"answer"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation","ifMatch","availability"],"type":"object"}},"type":"object"},"state":{"enum":["open","answered","expired","closed"]},"text":{"maxLength":2000,"minLength":1,"type":"string"},"wants":{"items":{"additionalProperties":false,"properties":{"kind":{"enum":["answer","document"]}},"required":["kind"],"type":"object"},"maxItems":8,"type":"array","uniqueItems":true}},"required":["id","text","wants","askedAt","state","links"],"type":"object"},"maxItems":50,"type":"array"},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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","limit-reached","application-pending","attachment-required","attachment-pending","ask-answered","ask-closed","ask-due-passed"]},"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"]},"status":{"enum":["draft","awaiting-party","in-review","approved","processing","applied","rejected","cancelled"]},"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"},"400":{"content":{"application/problem+json":{"examples":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["access-profile.ambiguous","request.invalid"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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 token or delivery signature was not accepted.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["authentication.refused"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["profile.not-authorized"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["resource.not-found"]}},"type":"object"}]}}},"description":"Resource unavailable to this caller","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"proposal.rejected":{"value":{"code":"proposal.rejected","detail":"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.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/proposal/rejected"}}},"schema":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.key-reused","mutation.conflict","proposal.rejected"]}},"type":"object"}]}}},"description":"The Proposal was rejected, or the idempotency key was reused with a different request","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["idempotency.expired"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.failed"]}},"type":"object"}]}}},"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","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["unsupported.media-type"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["precondition.required"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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"}},"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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["service.unavailable","source.unavailable"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"properties":{"code":{"enum":["request.timeout"]}},"type":"object"}]}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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":"limit","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":"cursor","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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","requiredFilters":[],"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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. When omitted, the sole admitting profile or the route default is used; if several admit with no default, the route answers 400 access-profile.ambiguous.","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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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"},"recordId":{"format":"uuid","type":"string"},"revisionId":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordId","revisionId","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetId":{"const":"directory"},"recordTypeId":{"const":"contact"},"registryId":{"const":"local-directory"}},"required":["registryId","datasetId","recordTypeId"],"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":{"access-profile.ambiguous":{"value":{"accessProfiles":["profile-a","profile-b"],"code":"access-profile.ambiguous","detail":"Multiple access profiles admit this request on this route; select one with accessProfile.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous"}},"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 token or delivery signature was not accepted.","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"}},"WWW-Authenticate":{"description":"The authentication scheme the route accepts. The challenge is the same for every refused credential.","schema":{"const":"Bearer","type":"string"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-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":{"profile.not-authorized":{"value":{"code":"profile.not-authorized","detail":"No access profile admits this caller for this request.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/profile/not-authorized"}},"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 block.","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":"webhook-id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"webhook-timestamp","required":true,"schema":{"pattern":"^(0|[1-9][0-9]{0,19})$","type":"string"}},{"in":"header","name":"webhook-signature","required":true,"schema":{"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 is invalid or eventId differs from webhook-id."},"401":{"description":"The completion authority could not be authenticated.","headers":{"WWW-Authenticate":{"schema":{"const":"Registry-Signature scheme=\"standard-webhooks\", version=\"v1\"","type":"string"}}}},"413":{"description":"The completion body exceeds 2048 bytes. The response body is empty."},"415":{"description":"The request is not application/json."},"503":{"description":"The completion could not be durably recorded."}},"security":[{"reviewCompletion":[]}],"summary":"Receive a Casework review completion"}}}} \ No newline at end of file diff --git a/products/breg/loadtest/external-views/scale_exercise.py b/products/breg/loadtest/external-views/scale_exercise.py index e1fa7972c2..2a04f425f3 100644 --- a/products/breg/loadtest/external-views/scale_exercise.py +++ b/products/breg/loadtest/external-views/scale_exercise.py @@ -306,7 +306,7 @@ def person_covered(origin, headers, query, count): def holdings_covered(origin, headers): for parent in (1, 2): status, document = request(origin, HOLDINGS_VIEW + "/records/" + root_id(parent, business=True), headers, - query={"accessProfile": "officer", "$count": "true", "$top": "1"}) + query={"accessProfile": "officer", "$count": "true", "limit": "1"}) if not (status == 200 and isinstance(document, dict) and document.get("count") == RELATED_ROWS): return False return True @@ -471,7 +471,7 @@ def run_scale(work, package, origin, tokens, source, plan_log, binaries, managed descending = ordered_oracle(descending=True, limit=2 * READ_PAGE_SIZE, corpus=corpus) initial = {"$filter": "family-name eq 'Cohort'", "$orderby": "family-name", - "$count": "true", "$top": str(READ_PAGE_SIZE)} + "$count": "true", "limit": str(READ_PAGE_SIZE)} print("Waiting for the in-process refresh worker to fill both indexed views", flush=True) started = time.monotonic() wait_ready(lambda: person_covered(origin, officer, initial, len(exact)), @@ -500,29 +500,29 @@ def run_scale(work, package, origin, tokens, source, plan_log, binaries, managed exact[:READ_PAGE_SIZE], corpus) expect(document.get("count") == len(exact), "native surname count differed from the oracle") for offset in range(READ_PAGE_SIZE, len(exact), READ_PAGE_SIZE): - document = person_page(observe(origin, PERSON_VIEW + "/records", {"$skiptoken": document["nextCursor"]}, + document = person_page(observe(origin, PERSON_VIEW + "/records", {"cursor": document["nextCursor"]}, officer, timing, "exact-continuation"), exact[offset:offset + READ_PAGE_SIZE], corpus) expect("nextCursor" not in document, "native surname results have additional rows") for direction, expected in (("asc", ascending), ("desc", descending)): - query = {"$orderby": f"family-name {direction}", "$top": str(READ_PAGE_SIZE), "$count": "true"} + query = {"$orderby": f"family-name {direction}", "limit": str(READ_PAGE_SIZE), "$count": "true"} document = person_page(observe(origin, PERSON_VIEW + "/records", query, officer, timing, "ordered-first"), expected[:READ_PAGE_SIZE], corpus) expect(document.get("count") == corpus.roots, "the native root count included denied roots") - person_page(observe(origin, PERSON_VIEW + "/records", {"$skiptoken": document["nextCursor"]}, + person_page(observe(origin, PERSON_VIEW + "/records", {"cursor": document["nextCursor"]}, officer, timing, "ordered-continuation"), expected[READ_PAGE_SIZE:], corpus) document = person_page(observe(origin, PERSON_VIEW + "/records", { "$filter": "family-name eq null", "$orderby": "family-name desc", - "$top": str(READ_PAGE_SIZE), "$count": "true", + "limit": str(READ_PAGE_SIZE), "$count": "true", }, officer, timing, "missing-sort-first"), absent[:READ_PAGE_SIZE], corpus) expect(document.get("count") == len(absent), "authorized missing-value count differed from the oracle") - person_page(observe(origin, PERSON_VIEW + "/records", {"$skiptoken": document["nextCursor"]}, + person_page(observe(origin, PERSON_VIEW + "/records", {"cursor": document["nextCursor"]}, officer, timing, "missing-sort-continuation"), absent[READ_PAGE_SIZE:2 * READ_PAGE_SIZE], corpus) for parent in (1, 2): path = HOLDINGS_VIEW + "/records/" + root_id(parent, business=True) all_counts = holding_oracle(parent) - related_query = {"$orderby": "share-count asc", "$count": "true", "$top": str(READ_PAGE_SIZE)} + related_query = {"$orderby": "share-count asc", "$count": "true", "limit": str(READ_PAGE_SIZE)} row_ids = [] for offset in range(0, len(all_counts), READ_PAGE_SIZE): response = observe(origin, path, related_query, officer, timing, "related-snapshot") @@ -531,16 +531,16 @@ def run_scale(work, package, origin, tokens, source, plan_log, binaries, managed if offset == 0: expect(document.get("count") == len(all_counts), "complete related count differed from the oracle") if offset + READ_PAGE_SIZE < len(all_counts): - related_query = {"$skiptoken": document["nextCursor"]} + related_query = {"cursor": document["nextCursor"]} expect("nextCursor" not in document and len(set(row_ids)) == len(all_counts), "complete related pages repeated or omitted stable row identities") expected = list(reversed(holding_oracle(parent, "common"))) document = holding_page(observe(origin, path, {"$filter": "share-class eq 'common'", "$orderby": "share-count desc", "$count": "true", - "$top": str(READ_PAGE_SIZE)}, officer, timing, "related-first"), + "limit": str(READ_PAGE_SIZE)}, officer, timing, "related-first"), expected[:READ_PAGE_SIZE]) expect(document.get("count") == len(expected), "related count differed from the parent oracle") - holding_page(observe(origin, path, {"$skiptoken": document["nextCursor"]}, officer, timing, + holding_page(observe(origin, path, {"cursor": document["nextCursor"]}, officer, timing, "related-continuation"), expected[READ_PAGE_SIZE:]) for parent in (3, 4): expect(observe(origin, HOLDINGS_VIEW + "/records/" + root_id(parent, business=True), {}, diff --git a/products/breg/loadtest/lib/workload.js b/products/breg/loadtest/lib/workload.js index 030a3b7c6b..d48bed8b02 100644 --- a/products/breg/loadtest/lib/workload.js +++ b/products/breg/loadtest/lib/workload.js @@ -72,7 +72,7 @@ export class Workload { // The de-duplication search shape: find one record by its unique code. const filter = encodeURIComponent(`establishmentCode eq '${code}'`); const response = http.get( - `${this.baseUrl}/v1/records/establishments?accessProfile=business-operator&$filter=${filter}&$top=1`, + `${this.baseUrl}/v1/records/establishments?accessProfile=business-operator&$filter=${filter}&limit=1`, { headers: headers(token), tags: { name: 'lookup_by_code' } } ); check(response, { 'lookup status 200': (r) => r.status === 200 }); @@ -94,7 +94,7 @@ export class Workload { const kind = ['production', 'warehouse', 'office'][Math.floor(this.random() * 3)]; const filter = encodeURIComponent(`establishmentKind eq '${kind}'`); const response = http.get( - `${this.baseUrl}/v1/records/establishments?accessProfile=business-operator&$filter=${filter}&$orderby=establishmentCode&$top=50`, + `${this.baseUrl}/v1/records/establishments?accessProfile=business-operator&$filter=${filter}&$orderby=establishmentCode&limit=50`, { headers: headers(token), tags: { name: 'filtered_list' } } ); check(response, { 'list status 200': (r) => r.status === 200 }); @@ -102,7 +102,7 @@ export class Workload { const body = response.json(); const cursor = body && body.pageInfo && body.pageInfo.nextCursor; if (cursor) { - const next = `${this.baseUrl}/v1/records/establishments?accessProfile=business-operator&$skiptoken=${encodeURIComponent(cursor)}`; + const next = `${this.baseUrl}/v1/records/establishments?accessProfile=business-operator&cursor=${encodeURIComponent(cursor)}`; const follow = http.get(next, { headers: headers(token), tags: { name: 'filtered_list_page2' } }); check(follow, { 'page-2 status 200': (r) => r.status === 200 }); if (follow.status === 200) cursorPagesFollowed.add(1); diff --git a/products/breg/loadtest/support/test_harness.py b/products/breg/loadtest/support/test_harness.py index 45e2d93907..84911a5e49 100644 --- a/products/breg/loadtest/support/test_harness.py +++ b/products/breg/loadtest/support/test_harness.py @@ -44,7 +44,7 @@ def test_profiles_pin_held_sweep_and_burst_recovery(self) -> None: steady = (loadtest / "profiles/steady.js").read_text(encoding="utf-8") runner = (loadtest / "run.sh").read_text(encoding="utf-8") self.assertIn("body.pageInfo.nextCursor", workload) - self.assertIn("$skiptoken=", workload) + self.assertIn("cursor=", workload) self.assertIn("executor: 'constant-arrival-rate'", sweep) self.assertNotIn("ramping-arrival-rate", sweep) self.assertIn("recovery:", burst) @@ -145,7 +145,7 @@ def log_message(self, _format: str, *args: object) -> None: thread.join(timeout=5) self.assertEqual(len(requests), 2) self.assertIn("$filter", requests[0]) - self.assertEqual(requests[1], {"accessProfile": ["business-operator"], "$skiptoken": ["cursor-value"]}) + self.assertEqual(requests[1], {"accessProfile": ["business-operator"], "cursor": ["cursor-value"]}) def test_load_environment_prepares_one_dev_client_and_preserves_existing_output(self) -> None: fixture = REPOSITORY / "products/breg/acceptance/business-establishments" diff --git a/products/evidence/contracts/problem-contract.yaml b/products/evidence/contracts/problem-contract.yaml index a8b8da75c6..2fafe32ff9 100644 --- a/products/evidence/contracts/problem-contract.yaml +++ b/products/evidence/contracts/problem-contract.yaml @@ -3,7 +3,7 @@ status: frozen media_type: application/problem+json body: exact_members: [type, title, status, detail, code, traceId] - development_refusal_member: In the development posture only, HTTP 401, 403, and 429 problem responses additionally carry failedCheck naming the failed check without revealing hidden requirement existence or protected values. In the production posture, every problem body carries only exact_members. + development_refusal_member: In the development posture, HTTP 401, 403, and 429 refusal responses can carry failedCheck. An issuer key-source outage can return service.unavailable (503) with failedCheck set to key-source-unavailable. In production, every problem body carries only exact_members. detail: Static, value-free text selected only by the service's closed problem code. traceId: Lowercase 32-hex W3C trace identifier for caller correlation; it is not an audit operation identifier. prohibited: diff --git a/products/evidence/generated/problem-v1.schema.json b/products/evidence/generated/problem-v1.schema.json index 94b1cffa69..3464d62997 100644 --- a/products/evidence/generated/problem-v1.schema.json +++ b/products/evidence/generated/problem-v1.schema.json @@ -12,6 +12,7 @@ "detail": { "const": "the Evidence request is invalid" }, + "failedCheck": false, "status": { "const": 400 }, @@ -31,6 +32,7 @@ "detail": { "const": "requestNonce must be 32 random bytes encoded as unpadded base64url (43 characters), generated anew for each request" }, + "failedCheck": false, "status": { "const": 400 }, @@ -50,6 +52,7 @@ "detail": { "const": "selector does not match an available request profile" }, + "failedCheck": false, "status": { "const": 400 }, @@ -69,6 +72,9 @@ "detail": { "const": "bearer access token validation failed" }, + "failedCheck": { + "type": "string" + }, "status": { "const": 401 }, @@ -88,6 +94,9 @@ "detail": { "const": "task grant was issued in the development posture" }, + "failedCheck": { + "type": "string" + }, "status": { "const": 401 }, @@ -107,6 +116,9 @@ "detail": { "const": "the Evidence request is not permitted" }, + "failedCheck": { + "type": "string" + }, "status": { "const": 403 }, @@ -126,6 +138,7 @@ "detail": { "const": "the requested format is not supported" }, + "failedCheck": false, "status": { "const": 406 }, @@ -145,6 +158,7 @@ "detail": { "const": "evidence could not be produced for this request" }, + "failedCheck": false, "status": { "const": 422 }, @@ -164,6 +178,9 @@ "detail": { "const": "the Evidence request rate is exhausted" }, + "failedCheck": { + "type": "string" + }, "status": { "const": 429 }, @@ -183,6 +200,7 @@ "detail": { "const": "the authoritative source is unavailable" }, + "failedCheck": false, "status": { "const": 503 }, @@ -202,6 +220,9 @@ "detail": { "const": "the request could not be served" }, + "failedCheck": { + "const": "key-source-unavailable" + }, "status": { "const": 503 }, @@ -221,6 +242,7 @@ "detail": { "const": "the requested resource was not found" }, + "failedCheck": false, "status": { "const": 404 }, diff --git a/products/evidence/generated/registry-evidence-oid4vp.openapi.json b/products/evidence/generated/registry-evidence-oid4vp.openapi.json index be8db03eae..ca55ec0760 100644 --- a/products/evidence/generated/registry-evidence-oid4vp.openapi.json +++ b/products/evidence/generated/registry-evidence-oid4vp.openapi.json @@ -174,10 +174,22 @@ "invalid_request", "temporarily_unavailable" ] + } + }, + "required": [ + "error" + ], + "type": "object" + }, + "OAuthRateLimit": { + "additionalProperties": false, + "properties": { + "error": { + "const": "temporarily_unavailable" }, "failedCheck": { - "description": "The check that refused the request, included only in development.", - "type": "string" + "const": "rate-limit", + "description": "The check that refused the request, included only in development." } }, "required": [ @@ -1412,7 +1424,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OAuthError" + "$ref": "#/components/schemas/OAuthRateLimit" } } }, diff --git a/products/evidence/generated/registry-evidence.openapi.json b/products/evidence/generated/registry-evidence.openapi.json index 3f1e9275fd..3cf470c6bb 100644 --- a/products/evidence/generated/registry-evidence.openapi.json +++ b/products/evidence/generated/registry-evidence.openapi.json @@ -1383,6 +1383,7 @@ ], "type": "string" }, + "failedCheck": false, "status": { "enum": [ 400 @@ -1417,6 +1418,7 @@ ], "type": "string" }, + "failedCheck": false, "status": { "enum": [ 400 @@ -1451,6 +1453,7 @@ ], "type": "string" }, + "failedCheck": false, "status": { "enum": [ 400 @@ -1485,6 +1488,9 @@ ], "type": "string" }, + "failedCheck": { + "type": "string" + }, "status": { "enum": [ 401 @@ -1519,6 +1525,9 @@ ], "type": "string" }, + "failedCheck": { + "type": "string" + }, "status": { "enum": [ 401 @@ -1553,6 +1562,9 @@ ], "type": "string" }, + "failedCheck": { + "type": "string" + }, "status": { "enum": [ 403 @@ -1587,6 +1599,7 @@ ], "type": "string" }, + "failedCheck": false, "status": { "enum": [ 406 @@ -1621,6 +1634,7 @@ ], "type": "string" }, + "failedCheck": false, "status": { "enum": [ 422 @@ -1655,6 +1669,9 @@ ], "type": "string" }, + "failedCheck": { + "type": "string" + }, "status": { "enum": [ 429 @@ -1689,6 +1706,7 @@ ], "type": "string" }, + "failedCheck": false, "status": { "enum": [ 503 @@ -1723,6 +1741,12 @@ ], "type": "string" }, + "failedCheck": { + "enum": [ + "key-source-unavailable" + ], + "type": "string" + }, "status": { "enum": [ 503 @@ -1757,6 +1781,7 @@ ], "type": "string" }, + "failedCheck": false, "status": { "enum": [ 404 diff --git a/products/platform/config-conventions-exceptions.yaml b/products/platform/config-conventions-exceptions.yaml index a1f85c73b8..ae22d72693 100644 --- a/products/platform/config-conventions-exceptions.yaml +++ b/products/platform/config-conventions-exceptions.yaml @@ -137,12 +137,6 @@ exceptions: class: protocol-constant reason: $count is written as OData system query options defines it resolution: Permanent. -- rule: CFG-NAME-2 - format: breg/queries-explanation - location: products/breg/contracts/explain/QueriesExplanation.schema.json#/properties/operations/items/properties/wire/properties/cursor/const/$skiptoken - class: protocol-constant - reason: $skiptoken is written as OData system query options defines it - resolution: Permanent. - rule: CFG-NAME-2 format: breg/queries-explanation location: products/breg/contracts/explain/QueriesExplanation.schema.json#/properties/operations/items/properties/wire/properties/filter/const/$filter @@ -155,12 +149,6 @@ exceptions: class: protocol-constant reason: $orderby is written as OData system query options defines it resolution: Permanent. -- rule: CFG-NAME-2 - format: breg/queries-explanation - location: products/breg/contracts/explain/QueriesExplanation.schema.json#/properties/operations/items/properties/wire/properties/pageSize/const/$top - class: protocol-constant - reason: $top is written as OData system query options defines it - resolution: Permanent. - rule: CFG-NAME-2 format: breg/queries-explanation location: products/breg/contracts/explain/QueriesExplanation.schema.json#/properties/operations/items/properties/wire/properties/select/const/$select From 53ec362480d648172c7afcc973a50c32d8ec69c4 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 39/55] fix(contracts): publish canonical route parameter names Folds these reviewed commits: - fix(contracts): publish canonical Casework and Scheduling path names - fix(contracts): update tests for published route parameters - test(contracts): check committed route names before publishing - fix(payments): emit canonical Adapter problem identifiers - fix(oid4vp): publish clear route parameter names - test(ci): require live checkout and shell execution - fix(messaging): publish canonical path parameter names - fix(adapter): publish native record path arguments - fix(cli): name production closure and Render configuration - fix(breg): align the query explanation with pagination keys - fix(docs): render prohibited OpenAPI properties safely - fix(docs): retain shared pagination keys in Proposal references Signed-off-by: Jeremi Joslin --- .github/scripts/test_ci_changes.py | 27 +- clients/typescript/README.md | 2 +- clients/typescript/generate.ts | 2 + .../generated/adapter-dhis2-tracker.ts | 58 +- clients/typescript/generated/casework.ts | 984 +++++++++--------- .../typescript/generated/evidence-oid4vp.ts | 48 +- clients/typescript/generated/messaging.ts | 100 +- clients/typescript/generated/render.ts | 52 +- clients/typescript/generated/scheduling.ts | 146 +-- clients/typescript/tests/adapter.test.ts | 12 +- clients/typescript/tests/casework.test.ts | 6 +- .../typescript/tests/generate-project.test.ts | 4 +- .../typescript/tests/live/products.live.ts | 14 +- clients/typescript/tests/media.test.ts | 2 +- clients/typescript/tests/oid4vp.test.ts | 14 +- clients/typescript/tests/render.test.ts | 12 +- clients/typescript/tests/service.test.ts | 2 +- crates/registry-adapter-core/src/profile.rs | 35 + .../src/effective_contract.rs | 21 +- crates/registry-adapter/src/payments/http.rs | 7 +- .../tests/effective_contract.rs | 14 +- .../tests/golden/payment_refusals.json | 28 +- .../src/compile/document.rs | 10 +- crates/registry-adapterctl/tests/compile.rs | 14 +- crates/registry-bregctl/src/lib.rs | 25 +- crates/registry-bregctl/tests/cli.rs | 23 + .../tests/problem_code_catalogue.rs | 4 +- crates/registry-caseworkctl/src/lib.rs | 74 +- crates/registry-cli-docs/catalog.json | 24 +- crates/registry-cli-docs/src/lib.rs | 30 + .../registry-evidence-oid4vp/src/contracts.rs | 72 +- .../tests/responses.rs | 4 +- crates/registry-evidencectl/src/check.rs | 7 +- crates/registry-evidencectl/src/lib.rs | 24 +- .../tests/production_build.rs | 53 +- crates/registry-mcp/tests/native_adapter.rs | 7 +- crates/registry-messaging/src/schema.rs | 101 +- crates/registry-payment-client/src/client.rs | 4 +- .../tests/http_boundary.rs | 99 ++ .../examples/problem-catalog.rs | 39 + crates/registry-payment-protocol/src/lib.rs | 96 +- .../tests/contract.rs | 31 + crates/registry-render/src/cli.rs | 6 +- crates/registry-render/src/openapi.rs | 4 +- crates/registry-render/src/runtime.rs | 6 +- crates/registry-render/src/server.rs | 24 +- crates/registry-render/tests/scaffold.rs | 6 +- crates/registry-render/tests/serve.rs | 9 +- crates/registry-render/tests/serve_seal.rs | 8 +- .../scripts/generate-breg-configuration.mjs | 19 +- .../generate-breg-configuration.test.mjs | 11 + docs/site/scripts/openapi-renderer.mjs | 28 +- docs/site/scripts/openapi-renderer.test.mjs | 39 +- .../src/content/docs/configure/adapter.mdx | 2 +- .../docs/configure/breg-record-timers.mdx | 2 +- .../src/content/docs/configure/casework.mdx | 2 +- .../src/content/docs/configure/discovery.mdx | 2 +- .../docs/configure/evidence-oid4vp.mdx | 2 +- .../src/content/docs/configure/scheduling.mdx | 2 +- .../operate/advanced/upgrade-and-retire.mdx | 2 +- .../src/content/docs/operate/breg-changes.mdx | 2 +- docs/site/src/content/docs/operate/breg.mdx | 6 +- .../content/docs/operate/registry-render.mdx | 8 +- .../src/content/docs/operate/stuck-work.mdx | 6 +- .../docs/reference/apis/registry-casework.mdx | 52 +- .../reference/apis/registry-messaging.mdx | 18 +- .../docs/reference/casework-configuration.mdx | 6 +- .../reference/coordinator-configuration.mdx | 2 +- .../reference/documents-configuration.mdx | 2 +- .../reference/messaging-configuration.mdx | 2 +- .../docs/reference/render-configuration.mdx | 18 +- .../content/docs/reference/render-payload.mdx | 2 +- .../src/content/docs/security/casework.mdx | 4 +- .../site/src/content/docs/security/render.mdx | 4 +- .../content/docs/start/registry-render.mdx | 2 +- .../build-and-deploy-evidence-project.mdx | 4 +- .../extend-a-registry-with-a-module.mdx | 2 +- .../move-evidence-to-production-signing.mdx | 2 +- products/adapter/CHANGELOG.md | 9 + .../dhis2-tracker/generated/openapi.json | 6 +- .../examples/formats/effective-contract.json | 8 +- .../opencrvs-events/generated/openapi.json | 4 +- .../examples/payment-collections/CONTRACT.md | 8 + .../rest-offset-mtls/generated/openapi.json | 4 +- .../formats/explain/queries-explanation.json | 24 +- products/casework/CHANGELOG.md | 7 + .../generated/registry-casework.openapi.json | 128 +-- products/casework/scripts/generate_openapi.py | 30 + .../casework/scripts/test_generate_openapi.py | 22 +- .../scripts/test_product_contracts.py | 6 +- products/evidence/CHANGELOG.md | 3 + .../registry-evidence-oid4vp.openapi.json | 12 +- .../identifiers/contracts/catalog-source.json | 16 +- .../identifiers/generated/catalog.v1.json | 209 ++++ products/identifiers/scripts/generate.py | 3 + products/identifiers/scripts/test_generate.py | 29 +- products/messaging/CHANGELOG.md | 5 + .../generated/registry-messaging.openapi.json | 22 +- products/render/CHANGELOG.md | 6 + products/render/README.md | 4 +- .../generated/registry-render.openapi.json | 16 +- products/scheduling/CHANGELOG.md | 4 + .../registry-scheduling.openapi.json | 24 +- .../scheduling/scripts/generate_openapi.py | 18 + .../scripts/test_generate_openapi.py | 23 +- 105 files changed, 2206 insertions(+), 1091 deletions(-) create mode 100644 crates/registry-payment-protocol/examples/problem-catalog.rs diff --git a/.github/scripts/test_ci_changes.py b/.github/scripts/test_ci_changes.py index 12a3e5f072..4b0b6c3b04 100644 --- a/.github/scripts/test_ci_changes.py +++ b/.github/scripts/test_ci_changes.py @@ -5526,10 +5526,13 @@ def required_step(self, workflow, job_name, name, directory="."): self.assertIn(step.get("if", "success()"), ("success()", "${{ success() }}"), name) self.assertIs(step.get("continue-on-error", False), False, name) working_directory = "." + shell = "bash" for scope in (workflow, job): - working_directory = scope.get("defaults", {}).get("run", {}).get( - "working-directory", working_directory, - ) + defaults = scope.get("defaults", {}).get("run", {}) + working_directory = defaults.get("working-directory", working_directory) + shell = defaults.get("shell", shell) + if "run" in step: + self.assertEqual(step.get("shell", shell), "bash", name) self.assertEqual( PurePosixPath(step.get("working-directory", working_directory)), PurePosixPath(directory), @@ -5553,12 +5556,16 @@ def assert_live_workflow(self, workflow): live["if"], ) self.assertEqual(shlex.split(run["run"]), ["npm", "run", "test:live", "--", "--require-deno"]) + _, checkout = self.required_step(workflow, job_name, "Checkout") + self.assertTrue(checkout["uses"].startswith("actions/checkout@")) _, build = self.required_step(workflow, job_name, "Build the product binaries from source") _, node = self.required_step(workflow, job_name, "Setup Node") _, deno = self.required_step(workflow, job_name, "Setup Deno") _, package = self.required_step( workflow, job_name, "Build the TypeScript package and install Chromium", "clients/typescript", ) + for dependent in (build, node, deno, package, run): + self.assertLess(live["steps"].index(checkout), live["steps"].index(dependent)) for prerequisite in (build, node, deno, package): self.assertLess(live["steps"].index(prerequisite), live["steps"].index(run)) for prerequisite in (node, deno): @@ -5705,6 +5712,20 @@ def test_disabled_advisory_or_incomplete_wiring_fails(self) -> None: with self.assertRaises(AssertionError): self.assert_evidence_workflow(workflow) + def test_live_checkout_and_shell_are_required(self) -> None: + for name, key, value in ( + ("Checkout", "if", False), + ("Checkout", "continue-on-error", True), + ("Run live Node, Deno and Chromium tests", "shell", 'bash -c "true" {0}'), + ): + with self.subTest(step=name, setting=key): + workflow = deepcopy(self.workflow) + steps = workflow["jobs"]["typescript-live"]["steps"] + step = next(step for step in steps if step.get("name") == name) + step[key] = value + with self.assertRaises(AssertionError): + self.assert_live_workflow(workflow) + class EventScopedSelectionTest(unittest.TestCase): """Broad assurance and heavy integration wait for the merge queue.""" diff --git a/clients/typescript/README.md b/clients/typescript/README.md index 13bee0b3d1..43e7cb98dc 100644 --- a/clients/typescript/README.md +++ b/clients/typescript/README.md @@ -254,7 +254,7 @@ const adapter = new Client(new Transport({ const { data: contract } = await adapter.call('adapter-effective-contract') const { data: person } = await adapter.call('records-get.person', { - path: { record_id: 'person-1' }, + path: { recordId: 'person-1' }, headers: { 'x-registry-adapter-contract': contract.digest }, }) const people = await allPages(cursor => diff --git a/clients/typescript/generate.ts b/clients/typescript/generate.ts index 43965b7009..93fd6b4fc5 100644 --- a/clients/typescript/generate.ts +++ b/clients/typescript/generate.ts @@ -29,6 +29,8 @@ const unconstrained: Record = { '/components/schemas/TemplatePreviewRequest/properties/data', '/paths/~1v1~1provider-callbacks~1{provider_id}/post/requestBody/content/application~1json/schema', '/paths/~1v1~1provider-callbacks~1{provider_id}~1{token}/post/requestBody/content/application~1json/schema', + '/paths/~1v1~1provider-callbacks~1{providerId}/post/requestBody/content/application~1json/schema', + '/paths/~1v1~1provider-callbacks~1{providerId}~1{token}/post/requestBody/content/application~1json/schema', ], } diff --git a/clients/typescript/generated/adapter-dhis2-tracker.ts b/clients/typescript/generated/adapter-dhis2-tracker.ts index 42abe6a738..8abc93e04f 100644 --- a/clients/typescript/generated/adapter-dhis2-tracker.ts +++ b/clients/typescript/generated/adapter-dhis2-tracker.ts @@ -1,5 +1,5 @@ -// Generated for Stack version 0.51.0, client version 0.51.0. -// Source SHA-256 a429d537cbd7b5c0ebbd3a84abfef9a855fa71d952ea0f220c57b8d780918855 +// Generated for Stack version 0.50.0, client version 0.50.0. +// Source SHA-256 26140d808406cbf4fa0e31596a1c2ea44acb9c68465c415ad382dc4538f42b46 import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -12,8 +12,8 @@ export interface Operations { "adapter-effective-contract": { input: CallOptions & { accept?: "application/json" | "*/*" }; required: false; output: Schema_EffectiveContract } "records-search.person": { input: CallOptions & { query?: { "cursor"?: (string); "limit"?: (number) } } & { headers?: { "x-registry-adapter-contract"?: (string) } } & { accept?: "application/json" | "*/*" }; required: false; output: ({ "items": (Array<({ "domainData": ({ "created_at"?: (string); "org_unit": (string); "tracked_entity_type": (string); "updated_at"?: (string) }); "recordId": (string) })>); "meta": ({ "datasetId": (string); "recordTypeId": (string); "registryId": (string) }); "pageInfo": ({ "nextCursor"?: (string) }) }) } "records-create.person": { input: CallOptions & { headers?: { "x-registry-adapter-contract"?: (string) } } & ({ body: ({ "data": ({ "domainData": ({ "created_at"?: (string); "org_unit": (string); "tracked_entity_type": (string); "updated_at"?: (string) }); "recordId": (string) }) }) }) & { accept?: "application/json" | "*/*" }; required: true; output: ({ "data": ({ "created_at"?: (string); "org_unit": (string); "tracked_entity_type": (string); "updated_at"?: (string) }); "meta": ({ "datasetId": (string); "recordTypeId": (string); "registryId": (string) }) }) } - "records-get.person": { input: CallOptions & { path: { "record_id": (string) } } & { headers?: { "x-registry-adapter-contract"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: ({ "data": ({ "domainData": ({ "created_at"?: (string); "org_unit": (string); "tracked_entity_type": (string); "updated_at"?: (string) }); "recordId": (string) }); "meta": ({ "datasetId": (string); "recordTypeId": (string); "registryId": (string) }) }) } - "records-update.person": { input: CallOptions & { path: { "record_id": (string) } } & { headers?: { "x-registry-adapter-contract"?: (string) } } & ({ body: ({ "data": ({ "domainData": ({ "created_at"?: (string); "org_unit": (string); "tracked_entity_type": (string); "updated_at"?: (string) }); "recordId": (string) }) }) }) & { accept?: "application/json" | "*/*" }; required: true; output: ({ "data": ({ "created_at"?: (string); "org_unit": (string); "tracked_entity_type": (string); "updated_at"?: (string) }); "meta": ({ "datasetId": (string); "recordTypeId": (string); "registryId": (string) }) }) } + "records-get.person": { input: CallOptions & { path: { "recordId": (string) } } & { headers?: { "x-registry-adapter-contract"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: ({ "data": ({ "domainData": ({ "created_at"?: (string); "org_unit": (string); "tracked_entity_type": (string); "updated_at"?: (string) }); "recordId": (string) }); "meta": ({ "datasetId": (string); "recordTypeId": (string); "registryId": (string) }) }) } + "records-update.person": { input: CallOptions & { path: { "recordId": (string) } } & { headers?: { "x-registry-adapter-contract"?: (string) } } & ({ body: ({ "data": ({ "domainData": ({ "created_at"?: (string); "org_unit": (string); "tracked_entity_type": (string); "updated_at"?: (string) }); "recordId": (string) }) }) }) & { accept?: "application/json" | "*/*" }; required: true; output: ({ "data": ({ "created_at"?: (string); "org_unit": (string); "tracked_entity_type": (string); "updated_at"?: (string) }); "meta": ({ "datasetId": (string); "recordTypeId": (string); "registryId": (string) }) }) } } const rules: Record = Object.fromEntries([ @@ -63,28 +63,28 @@ const rules: Record = Object.fromEntries([ ["/paths/~1v1~1records~1person/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], ["/paths/~1v1~1records~1person/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"anyOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"$ref\":\"/components/schemas/ContractUnavailableProblem\"}]}")], ["/paths/~1v1~1records~1person/post/responses/504/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/get/responses/200/content/application~1json/schema", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"data\":{\"additionalProperties\":false,\"properties\":{\"domainData\":{\"additionalProperties\":false,\"properties\":{\"created_at\":{\"type\":\"string\"},\"org_unit\":{\"type\":\"string\"},\"tracked_entity_type\":{\"type\":\"string\"},\"updated_at\":{\"type\":\"string\"}},\"required\":[\"org_unit\",\"tracked_entity_type\"],\"type\":\"object\"},\"recordId\":{\"type\":\"string\"}},\"required\":[\"domainData\",\"recordId\"],\"type\":\"object\"},\"meta\":{\"additionalProperties\":false,\"properties\":{\"datasetId\":{\"type\":\"string\"},\"recordTypeId\":{\"type\":\"string\"},\"registryId\":{\"type\":\"string\"}},\"required\":[\"datasetId\",\"recordTypeId\",\"registryId\"],\"type\":\"object\"}},\"required\":[\"data\",\"meta\"],\"type\":\"object\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/get/responses/409/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/get/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ContractPreconditionProblem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/get/responses/429/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"anyOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"$ref\":\"/components/schemas/ContractUnavailableProblem\"}]}")], - ["/paths/~1v1~1records~1person~1{record_id}/get/responses/504/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/put/responses/200/content/application~1json/schema", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"data\":{\"additionalProperties\":false,\"properties\":{\"created_at\":{\"type\":\"string\"},\"org_unit\":{\"type\":\"string\"},\"tracked_entity_type\":{\"type\":\"string\"},\"updated_at\":{\"type\":\"string\"}},\"required\":[\"org_unit\",\"tracked_entity_type\"],\"type\":\"object\"},\"meta\":{\"additionalProperties\":false,\"properties\":{\"datasetId\":{\"type\":\"string\"},\"recordTypeId\":{\"type\":\"string\"},\"registryId\":{\"type\":\"string\"}},\"required\":[\"datasetId\",\"recordTypeId\",\"registryId\"],\"type\":\"object\"}},\"required\":[\"data\",\"meta\"],\"type\":\"object\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/put/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/put/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/put/responses/409/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/put/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ContractPreconditionProblem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/put/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/put/responses/429/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/put/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/put/responses/502/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1records~1person~1{record_id}/put/responses/503/content/application~1problem+json/schema", JSON.parse("{\"anyOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"$ref\":\"/components/schemas/ContractUnavailableProblem\"}]}")], - ["/paths/~1v1~1records~1person~1{record_id}/put/responses/504/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/get/responses/200/content/application~1json/schema", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"data\":{\"additionalProperties\":false,\"properties\":{\"domainData\":{\"additionalProperties\":false,\"properties\":{\"created_at\":{\"type\":\"string\"},\"org_unit\":{\"type\":\"string\"},\"tracked_entity_type\":{\"type\":\"string\"},\"updated_at\":{\"type\":\"string\"}},\"required\":[\"org_unit\",\"tracked_entity_type\"],\"type\":\"object\"},\"recordId\":{\"type\":\"string\"}},\"required\":[\"domainData\",\"recordId\"],\"type\":\"object\"},\"meta\":{\"additionalProperties\":false,\"properties\":{\"datasetId\":{\"type\":\"string\"},\"recordTypeId\":{\"type\":\"string\"},\"registryId\":{\"type\":\"string\"}},\"required\":[\"datasetId\",\"recordTypeId\",\"registryId\"],\"type\":\"object\"}},\"required\":[\"data\",\"meta\"],\"type\":\"object\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/get/responses/409/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/get/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ContractPreconditionProblem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/get/responses/429/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"anyOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"$ref\":\"/components/schemas/ContractUnavailableProblem\"}]}")], + ["/paths/~1v1~1records~1person~1{recordId}/get/responses/504/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/put/responses/200/content/application~1json/schema", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"data\":{\"additionalProperties\":false,\"properties\":{\"created_at\":{\"type\":\"string\"},\"org_unit\":{\"type\":\"string\"},\"tracked_entity_type\":{\"type\":\"string\"},\"updated_at\":{\"type\":\"string\"}},\"required\":[\"org_unit\",\"tracked_entity_type\"],\"type\":\"object\"},\"meta\":{\"additionalProperties\":false,\"properties\":{\"datasetId\":{\"type\":\"string\"},\"recordTypeId\":{\"type\":\"string\"},\"registryId\":{\"type\":\"string\"}},\"required\":[\"datasetId\",\"recordTypeId\",\"registryId\"],\"type\":\"object\"}},\"required\":[\"data\",\"meta\"],\"type\":\"object\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/put/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/put/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/put/responses/409/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/put/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ContractPreconditionProblem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/put/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/put/responses/429/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/put/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/put/responses/502/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1records~1person~1{recordId}/put/responses/503/content/application~1problem+json/schema", JSON.parse("{\"anyOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"$ref\":\"/components/schemas/ContractUnavailableProblem\"}]}")], + ["/paths/~1v1~1records~1person~1{recordId}/put/responses/504/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], ]) const routes: Record = Object.create(null) type Definition = Omit & { problems?: Record; responses: Record> } @@ -92,8 +92,8 @@ const definitions: Record = Object.fromEntries([ ["adapter-effective-contract", JSON.parse("{\"method\":\"GET\",\"path\":\"/.well-known/registry-adapter/effective-contract\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1.well-known~1registry-adapter~1effective-contract/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"401\":\"/paths/~1.well-known~1registry-adapter~1effective-contract/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1.well-known~1registry-adapter~1effective-contract/get/responses/403/content/application~1problem+json/schema\",\"503\":\"/paths/~1.well-known~1registry-adapter~1effective-contract/get/responses/503/content/application~1problem+json/schema\"}}")], ["records-search.person", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/records/person\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1records~1person/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1records~1person/get/responses/400/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1records~1person/get/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1records~1person/get/responses/409/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1records~1person/get/responses/412/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1records~1person/get/responses/422/content/application~1problem+json/schema\",\"429\":\"/paths/~1v1~1records~1person/get/responses/429/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1records~1person/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1records~1person/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1records~1person/get/responses/503/content/application~1problem+json/schema\",\"504\":\"/paths/~1v1~1records~1person/get/responses/504/content/application~1problem+json/schema\"}}")], ["records-create.person", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/records/person\",\"responses\":{\"201\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1records~1person/post/responses/201/content/application~1json/schema\"}]},\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1records~1person/post/responses/400/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1records~1person/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1records~1person/post/responses/409/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1records~1person/post/responses/412/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1records~1person/post/responses/422/content/application~1problem+json/schema\",\"429\":\"/paths/~1v1~1records~1person/post/responses/429/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1records~1person/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1records~1person/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1records~1person/post/responses/503/content/application~1problem+json/schema\",\"504\":\"/paths/~1v1~1records~1person/post/responses/504/content/application~1problem+json/schema\"}}")], - ["records-get.person", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/records/person/{record_id}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1records~1person~1{record_id}/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1records~1person~1{record_id}/get/responses/400/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1records~1person~1{record_id}/get/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1records~1person~1{record_id}/get/responses/409/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1records~1person~1{record_id}/get/responses/412/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1records~1person~1{record_id}/get/responses/422/content/application~1problem+json/schema\",\"429\":\"/paths/~1v1~1records~1person~1{record_id}/get/responses/429/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1records~1person~1{record_id}/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1records~1person~1{record_id}/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1records~1person~1{record_id}/get/responses/503/content/application~1problem+json/schema\",\"504\":\"/paths/~1v1~1records~1person~1{record_id}/get/responses/504/content/application~1problem+json/schema\"}}")], - ["records-update.person", JSON.parse("{\"method\":\"PUT\",\"path\":\"/v1/records/person/{record_id}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1records~1person~1{record_id}/put/responses/200/content/application~1json/schema\"}]},\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1records~1person~1{record_id}/put/responses/400/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1records~1person~1{record_id}/put/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1records~1person~1{record_id}/put/responses/409/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1records~1person~1{record_id}/put/responses/412/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1records~1person~1{record_id}/put/responses/422/content/application~1problem+json/schema\",\"429\":\"/paths/~1v1~1records~1person~1{record_id}/put/responses/429/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1records~1person~1{record_id}/put/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1records~1person~1{record_id}/put/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1records~1person~1{record_id}/put/responses/503/content/application~1problem+json/schema\",\"504\":\"/paths/~1v1~1records~1person~1{record_id}/put/responses/504/content/application~1problem+json/schema\"}}")], + ["records-get.person", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/records/person/{recordId}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1records~1person~1{recordId}/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1records~1person~1{recordId}/get/responses/400/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1records~1person~1{recordId}/get/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1records~1person~1{recordId}/get/responses/409/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1records~1person~1{recordId}/get/responses/412/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1records~1person~1{recordId}/get/responses/422/content/application~1problem+json/schema\",\"429\":\"/paths/~1v1~1records~1person~1{recordId}/get/responses/429/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1records~1person~1{recordId}/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1records~1person~1{recordId}/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1records~1person~1{recordId}/get/responses/503/content/application~1problem+json/schema\",\"504\":\"/paths/~1v1~1records~1person~1{recordId}/get/responses/504/content/application~1problem+json/schema\"}}")], + ["records-update.person", JSON.parse("{\"method\":\"PUT\",\"path\":\"/v1/records/person/{recordId}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1records~1person~1{recordId}/put/responses/200/content/application~1json/schema\"}]},\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1records~1person~1{recordId}/put/responses/400/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1records~1person~1{recordId}/put/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1records~1person~1{recordId}/put/responses/409/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1records~1person~1{recordId}/put/responses/412/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1records~1person~1{recordId}/put/responses/422/content/application~1problem+json/schema\",\"429\":\"/paths/~1v1~1records~1person~1{recordId}/put/responses/429/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1records~1person~1{recordId}/put/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1records~1person~1{recordId}/put/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1records~1person~1{recordId}/put/responses/503/content/application~1problem+json/schema\",\"504\":\"/paths/~1v1~1records~1person~1{recordId}/put/responses/504/content/application~1problem+json/schema\"}}")], ]) for (const [id, definition] of Object.entries(definitions)) { const responses: Operation["responses"] = {} @@ -106,7 +106,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.51.0") + assertClientVersion("0.50.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/casework.ts b/clients/typescript/generated/casework.ts index 56d2a9b445..0c6fa8dad9 100644 --- a/clients/typescript/generated/casework.ts +++ b/clients/typescript/generated/casework.ts @@ -1,5 +1,5 @@ // Generated for Stack version 0.50.0, client version 0.50.0. -// Source SHA-256 16076ee86feb6ad3659c1ac01a53ea7c11f7f1a6bef10f21b677b1cee6cb27cc +// Source SHA-256 095bdd1b45a0e8031bb3d6cff6b2223514c250f14c985ca177abe6f8d18d9277 // Unconstrained JSON /components/schemas/ReviewHistoryEntry/properties/detail // Unconstrained JSON /components/schemas/ReviewPolicy/properties/displaySchema // Unconstrained JSON /components/schemas/ReviewPolicy/properties/resultSchema @@ -244,57 +244,57 @@ export interface Operations { "readiness": { input: CallOptions & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: false; output: Schema_ReadyStatus } "describeCasework": { input: CallOptions & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: false; output: Schema_Description } "listDelegatedStaffReviewTasks": { input: CallOptions & { query?: { "cursor"?: (string); "limit"?: (number) } } & { headers: { "traceparent"?: (string); "registry-casework-delegated-reader": (string); "registry-source-profile"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTaskPage } - "getDelegatedStaffReviewTaskContext": { input: CallOptions & { path: { "task_id": (string) } } & { headers: { "traceparent"?: (string); "registry-casework-delegated-reader": (string); "registry-source-profile"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTaskContext } + "getDelegatedStaffReviewTaskContext": { input: CallOptions & { path: { "taskId": (string) } } & { headers: { "traceparent"?: (string); "registry-casework-delegated-reader": (string); "registry-source-profile"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTaskContext } "getDirectory": { input: CallOptions & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: false; output: Schema_DirectoryResponse } "listAbsences": { input: CallOptions & { query?: { "accessProfile"?: (string); "cursor"?: (string | null); "limit"?: (number | null) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: false; output: Schema_AbsenceList } "createAbsence": { input: CallOptions & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "If-Match": (string) } } & ({ body: Schema_AbsenceInput }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AbsenceRecord } - "deleteAbsence": { input: CallOptions & { path: { "absence_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "If-Match": (string) } }; required: true; output: undefined } - "updateAbsence": { input: CallOptions & { path: { "absence_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "If-Match": (string) } } & ({ body: Schema_AbsenceInput }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AbsenceRecord } + "deleteAbsence": { input: CallOptions & { path: { "absenceId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "If-Match": (string) } }; required: true; output: undefined } + "updateAbsence": { input: CallOptions & { path: { "absenceId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "If-Match": (string) } } & ({ body: Schema_AbsenceInput }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AbsenceRecord } "bootstrapDirectory": { input: CallOptions & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "If-Match": (string) } } & ({ body: Schema_BootstrapDirectoryRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_DirectoryResponse } "applyReviewCaseload": { input: CallOptions & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & ({ body: Schema_ReviewCaseloadApplyRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewCaseloadResult } "previewReviewCaseload": { input: CallOptions & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & ({ body: Schema_ReviewCaseloadMoveRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewCaseloadPreview } "applyReviewClockRecompute": { input: CallOptions & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & ({ body: Schema_ReviewClockRecomputeApplyRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewClockRecomputeResult } "previewReviewClockRecompute": { input: CallOptions & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & ({ body: Schema_ReviewClockRecomputeRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewClockRecomputePreview } "createHolidayRevision": { input: CallOptions & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & ({ body: Schema_HolidaySetRevisionInput }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_HolidaySetDocument } - "getHolidayRevision": { input: CallOptions & { path: { "id": (string); "revision": (number) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_HolidaySetDocument } + "getHolidayRevision": { input: CallOptions & { path: { "holidayId": (string); "holidayRevision": (number) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_HolidaySetDocument } "listDirectoryTargets": { input: CallOptions & { query: { "accessProfile"?: (string); "cursor"?: (string | null); "limit"?: (number | null); "personIssuer"?: (string | null); "personSubject"?: (string | null); "purpose": Schema_InputDirectoryTargetPurpose; "queue"?: (string | null) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_DirectoryTargetPage } - "updateDirectoryTeam": { input: CallOptions & { path: { "team_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "If-Match": (string) } } & ({ body: Schema_DirectoryTeamUpdateRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_DirectoryResponse } - "getReviewAccountability": { input: CallOptions & { path: { "event_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewAccountabilityRecord } + "updateDirectoryTeam": { input: CallOptions & { path: { "teamId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "If-Match": (string) } } & ({ body: Schema_DirectoryTeamUpdateRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_DirectoryResponse } + "getReviewAccountability": { input: CallOptions & { path: { "eventId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewAccountabilityRecord } "listReviewAsks": { input: CallOptions & { query?: { "accessProfile"?: (string); "cursor"?: (string); "limit"?: (number) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: false; output: Schema_ReviewAskFeedPage } "listReviewPolicies": { input: CallOptions & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: false; output: Schema_ReviewPolicyClosureList } - "getReviewPolicy": { input: CallOptions & { path: { "policy_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewPolicyClosure } + "getReviewPolicy": { input: CallOptions & { path: { "policyId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewPolicyClosure } "createOrRecoverReviewRequest": { input: CallOptions & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & ({ body: Schema_ReviewCreateRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewRequestAccepted } - "getReviewRequest": { input: CallOptions & { path: { "request_id": (string) } } & { query?: { "accessProfile"?: (string); "include"?: (Schema_InputReviewRequestInclude | (null)) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewRequestView } - "getReviewAsk": { input: CallOptions & { path: { "request_id": (string); "ask_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewAsk } - "answerReviewAsk": { input: CallOptions & { path: { "request_id": (string); "ask_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & ({ body: Schema_ReviewAskAnswer }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewAsk } - "cancelReviewRequest": { input: CallOptions & { path: { "request_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & ({ body: Schema_ReviewCancelRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewCancelResponse } - "getReviewClocks": { input: CallOptions & { path: { "request_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewClockOccurrenceList } - "getReviewHistory": { input: CallOptions & { path: { "request_id": (string) } } & { query?: { "accessProfile"?: (string); "cursor"?: (string); "limit"?: (number) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewHistoryPage } - "addReviewNote": { input: CallOptions & { path: { "request_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & ({ body: Schema_ReviewNoteRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewHistoryEntry } - "getReviewResult": { input: CallOptions & { path: { "request_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewResult | undefined } + "getReviewRequest": { input: CallOptions & { path: { "requestId": (string) } } & { query?: { "accessProfile"?: (string); "include"?: (Schema_InputReviewRequestInclude | (null)) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewRequestView } + "getReviewAsk": { input: CallOptions & { path: { "requestId": (string); "askId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewAsk } + "answerReviewAsk": { input: CallOptions & { path: { "requestId": (string); "askId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & ({ body: Schema_ReviewAskAnswer }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewAsk } + "cancelReviewRequest": { input: CallOptions & { path: { "requestId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & ({ body: Schema_ReviewCancelRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewCancelResponse } + "getReviewClocks": { input: CallOptions & { path: { "requestId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewClockOccurrenceList } + "getReviewHistory": { input: CallOptions & { path: { "requestId": (string) } } & { query?: { "accessProfile"?: (string); "cursor"?: (string); "limit"?: (number) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewHistoryPage } + "addReviewNote": { input: CallOptions & { path: { "requestId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & ({ body: Schema_ReviewNoteRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewHistoryEntry } + "getReviewResult": { input: CallOptions & { path: { "requestId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewResult | undefined } "listReviewResults": { input: CallOptions & { query?: { "accessProfile"?: (string); "cursor"?: (string); "limit"?: (number) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: false; output: Schema_ReviewResultFeedPage } "listReviewTasks": { input: CallOptions & { query?: { "accessProfile"?: (string); "cursor"?: (string | null); "limit"?: (number | null); "marker"?: (Schema_InputReviewTaskMarker | (null)); "ownership"?: (Schema_InputReviewTaskOwnership | (null)); "queue"?: (string | null); "reference"?: (string | null); "sort"?: Schema_InputReviewTaskSort; "subjectDigest"?: (Schema_InputContentDigest | (null)); "subjectId"?: (string | null); "subjectSource"?: (string | null); "subjectType"?: (string | null); "subjectVersion"?: (string | null) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: false; output: Schema_ReviewTaskPage } "getReviewTaskHoldings": { input: CallOptions & { query?: { "accessProfile"?: (string); "cursor"?: (string | null); "limit"?: (number | null); "marker"?: (Schema_InputReviewTaskMarker | (null)); "ownership"?: (Schema_InputReviewTaskOwnership | (null)); "queue"?: (string | null); "reference"?: (string | null); "sort"?: Schema_InputReviewTaskSort; "subjectDigest"?: (Schema_InputContentDigest | (null)); "subjectId"?: (string | null); "subjectSource"?: (string | null); "subjectType"?: (string | null); "subjectVersion"?: (string | null) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: false; output: Schema_ReviewTaskPage } "getNextReviewTask": { input: CallOptions & { query?: { "accessProfile"?: (string); "cursor"?: (string | null); "limit"?: (number | null); "marker"?: (Schema_InputReviewTaskMarker | (null)); "ownership"?: (Schema_InputReviewTaskOwnership | (null)); "queue"?: (string | null); "reference"?: (string | null); "sort"?: Schema_InputReviewTaskSort; "subjectDigest"?: (Schema_InputContentDigest | (null)); "subjectId"?: (string | null); "subjectSource"?: (string | null); "subjectType"?: (string | null); "subjectVersion"?: (string | null) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: false; output: Schema_OptionalReviewTask } "listOwnReviewDecisions": { input: CallOptions & { query?: { "accessProfile"?: (string); "cursor"?: (string); "limit"?: (number); "queue"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: false; output: Schema_OwnReviewDecisionPage } "listSupervisoryReviewTasks": { input: CallOptions & { query?: { "accessProfile"?: (string); "cursor"?: (string); "limit"?: (number); "queue"?: (string); "requestId"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: false; output: Schema_SupervisoryReviewTaskPage } - "getReviewTask": { input: CallOptions & { path: { "task_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTask } - "askApplicant": { input: CallOptions & { path: { "task_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string); "If-Match": (string) } } & ({ body: Schema_ReviewTaskAskRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTaskAsked } - "assignReviewTask": { input: CallOptions & { path: { "task_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string); "If-Match": (string) } } & ({ body: Schema_AssignmentRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTask } - "claimReviewTask": { input: CallOptions & { path: { "task_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string); "If-Match": (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTask } - "getReviewTaskContext": { input: CallOptions & { path: { "task_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTaskContext } - "decideReviewTask": { input: CallOptions & { path: { "task_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string); "If-Match": (string) } } & ({ body: Schema_ReviewTaskDecisionRequest }); required: true; output: undefined } - "delegateReviewTask": { input: CallOptions & { path: { "task_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string); "If-Match": (string) } } & ({ body: Schema_DelegateRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTask } - "deleteReviewDecisionDraft": { input: CallOptions & { path: { "task_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string); "If-Match": (string) } }; required: true; output: undefined } - "getReviewDecisionDraft": { input: CallOptions & { path: { "task_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTaskDraft } - "saveReviewDecisionDraft": { input: CallOptions & { path: { "task_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string); "If-Match": (string) } } & ({ body: Schema_ReviewTaskDraftInput }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTaskDraft } - "releaseReviewTask": { input: CallOptions & { path: { "task_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "If-Match": (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTask } - "listReviewTaskGrants": { input: CallOptions & { path: { "task_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_TaskGrantList } - "approveReviewTaskGrant": { input: CallOptions & { path: { "task_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string); "If-Match": (string) } } & ({ body: Schema_TaskApprovalRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_TaskGrantView } - "revokeReviewTaskGrant": { input: CallOptions & { path: { "task_id": (string); "grant_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_TaskGrantRevocation } - "previewReviewTaskTemplates": { input: CallOptions & { path: { "task_id": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_TaskTemplatePreviews } - "getTaskAssertion": { input: CallOptions & { path: { "grant_id": (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_TaskAssertionResponse } - "getTaskGrantStatus": { input: CallOptions & { path: { "grant_id": (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_TaskGrantStatus } + "getReviewTask": { input: CallOptions & { path: { "taskId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTask } + "askApplicant": { input: CallOptions & { path: { "taskId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string); "If-Match": (string) } } & ({ body: Schema_ReviewTaskAskRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTaskAsked } + "assignReviewTask": { input: CallOptions & { path: { "taskId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string); "If-Match": (string) } } & ({ body: Schema_AssignmentRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTask } + "claimReviewTask": { input: CallOptions & { path: { "taskId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string); "If-Match": (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTask } + "getReviewTaskContext": { input: CallOptions & { path: { "taskId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTaskContext } + "decideReviewTask": { input: CallOptions & { path: { "taskId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string); "If-Match": (string) } } & ({ body: Schema_ReviewTaskDecisionRequest }); required: true; output: undefined } + "delegateReviewTask": { input: CallOptions & { path: { "taskId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string); "If-Match": (string) } } & ({ body: Schema_DelegateRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTask } + "deleteReviewDecisionDraft": { input: CallOptions & { path: { "taskId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string); "If-Match": (string) } }; required: true; output: undefined } + "getReviewDecisionDraft": { input: CallOptions & { path: { "taskId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTaskDraft } + "saveReviewDecisionDraft": { input: CallOptions & { path: { "taskId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string); "If-Match": (string) } } & ({ body: Schema_ReviewTaskDraftInput }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTaskDraft } + "releaseReviewTask": { input: CallOptions & { path: { "taskId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "If-Match": (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReviewTask } + "listReviewTaskGrants": { input: CallOptions & { path: { "taskId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_TaskGrantList } + "approveReviewTaskGrant": { input: CallOptions & { path: { "taskId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string); "If-Match": (string) } } & ({ body: Schema_TaskApprovalRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_TaskGrantView } + "revokeReviewTaskGrant": { input: CallOptions & { path: { "taskId": (string); "grantId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_TaskGrantRevocation } + "previewReviewTaskTemplates": { input: CallOptions & { path: { "taskId": (string) } } & { query?: { "accessProfile"?: (string) } } & { headers?: { "traceparent"?: (string); "registry-source-profile"?: (string); "registry-source-authorization"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_TaskTemplatePreviews } + "getTaskAssertion": { input: CallOptions & { path: { "grantId": (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_TaskAssertionResponse } + "getTaskGrantStatus": { input: CallOptions & { path: { "grantId": (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_TaskGrantStatus } } const rules: Record = Object.fromEntries([ @@ -553,18 +553,18 @@ const rules: Record = Object.fromEntries([ ["/paths/~1v1~1delegated-staff~1review-tasks/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], ["/paths/~1v1~1delegated-staff~1review-tasks/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], ["/paths/~1v1~1delegated-staff~1review-tasks/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTaskContext\"}")], - ["/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], - ["/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTaskContext\"}")], + ["/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], + ["/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], ["/paths/~1v1~1directory/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/DirectoryResponse\"}")], ["/paths/~1v1~1directory/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], ["/paths/~1v1~1directory/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], @@ -604,35 +604,35 @@ const rules: Record = Object.fromEntries([ ["/paths/~1v1~1directory~1absences/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], ["/paths/~1v1~1directory~1absences/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], ["/paths/~1v1~1directory~1absences/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/AbsenceRecord\"}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/AbsenceRecord\"}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], ["/paths/~1v1~1directory~1bootstrap/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/DirectoryResponse\"}")], ["/paths/~1v1~1directory~1bootstrap/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], ["/paths/~1v1~1directory~1bootstrap/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], @@ -723,18 +723,18 @@ const rules: Record = Object.fromEntries([ ["/paths/~1v1~1directory~1holidays/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], ["/paths/~1v1~1directory~1holidays/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], ["/paths/~1v1~1directory~1holidays/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/HolidaySetDocument\"}")], - ["/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], - ["/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/HolidaySetDocument\"}")], + ["/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], + ["/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], ["/paths/~1v1~1directory~1targets/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/DirectoryTargetPage\"}")], ["/paths/~1v1~1directory~1targets/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], ["/paths/~1v1~1directory~1targets/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], @@ -747,33 +747,33 @@ const rules: Record = Object.fromEntries([ ["/paths/~1v1~1directory~1targets/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], ["/paths/~1v1~1directory~1targets/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], ["/paths/~1v1~1directory~1targets/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1directory~1teams~1{team_id}/put/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/DirectoryResponse\"}")], - ["/paths/~1v1~1directory~1teams~1{team_id}/put/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1directory~1teams~1{team_id}/put/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1directory~1teams~1{team_id}/put/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], - ["/paths/~1v1~1directory~1teams~1{team_id}/put/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1directory~1teams~1{team_id}/put/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], - ["/paths/~1v1~1directory~1teams~1{team_id}/put/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1directory~1teams~1{team_id}/put/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], - ["/paths/~1v1~1directory~1teams~1{team_id}/put/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1directory~1teams~1{team_id}/put/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1directory~1teams~1{team_id}/put/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], - ["/paths/~1v1~1directory~1teams~1{team_id}/put/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], - ["/paths/~1v1~1directory~1teams~1{team_id}/put/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1directory~1teams~1{team_id}/put/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1directory~1teams~1{team_id}/put/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-accountability~1{event_id}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewAccountabilityRecord\"}")], - ["/paths/~1v1~1review-accountability~1{event_id}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-accountability~1{event_id}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-accountability~1{event_id}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], - ["/paths/~1v1~1review-accountability~1{event_id}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-accountability~1{event_id}/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-accountability~1{event_id}/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-accountability~1{event_id}/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-accountability~1{event_id}/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1review-accountability~1{event_id}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-accountability~1{event_id}/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-accountability~1{event_id}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1directory~1teams~1{teamId}/put/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/DirectoryResponse\"}")], + ["/paths/~1v1~1directory~1teams~1{teamId}/put/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1directory~1teams~1{teamId}/put/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1directory~1teams~1{teamId}/put/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], + ["/paths/~1v1~1directory~1teams~1{teamId}/put/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1directory~1teams~1{teamId}/put/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], + ["/paths/~1v1~1directory~1teams~1{teamId}/put/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1directory~1teams~1{teamId}/put/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], + ["/paths/~1v1~1directory~1teams~1{teamId}/put/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1directory~1teams~1{teamId}/put/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1directory~1teams~1{teamId}/put/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], + ["/paths/~1v1~1directory~1teams~1{teamId}/put/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], + ["/paths/~1v1~1directory~1teams~1{teamId}/put/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1directory~1teams~1{teamId}/put/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1directory~1teams~1{teamId}/put/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-accountability~1{eventId}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewAccountabilityRecord\"}")], + ["/paths/~1v1~1review-accountability~1{eventId}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-accountability~1{eventId}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-accountability~1{eventId}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], + ["/paths/~1v1~1review-accountability~1{eventId}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-accountability~1{eventId}/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-accountability~1{eventId}/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-accountability~1{eventId}/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-accountability~1{eventId}/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1review-accountability~1{eventId}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-accountability~1{eventId}/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-accountability~1{eventId}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], ["/paths/~1v1~1review-asks/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewAskFeedPage\"}")], ["/paths/~1v1~1review-asks/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], ["/paths/~1v1~1review-asks/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], @@ -798,18 +798,18 @@ const rules: Record = Object.fromEntries([ ["/paths/~1v1~1review-policies/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], ["/paths/~1v1~1review-policies/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], ["/paths/~1v1~1review-policies/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-policies~1{policy_id}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewPolicyClosure\"}")], - ["/paths/~1v1~1review-policies~1{policy_id}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-policies~1{policy_id}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-policies~1{policy_id}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], - ["/paths/~1v1~1review-policies~1{policy_id}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-policies~1{policy_id}/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-policies~1{policy_id}/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-policies~1{policy_id}/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-policies~1{policy_id}/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1review-policies~1{policy_id}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-policies~1{policy_id}/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-policies~1{policy_id}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-policies~1{policyId}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewPolicyClosure\"}")], + ["/paths/~1v1~1review-policies~1{policyId}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-policies~1{policyId}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-policies~1{policyId}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], + ["/paths/~1v1~1review-policies~1{policyId}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-policies~1{policyId}/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-policies~1{policyId}/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-policies~1{policyId}/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-policies~1{policyId}/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1review-policies~1{policyId}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-policies~1{policyId}/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-policies~1{policyId}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], ["/paths/~1v1~1review-requests/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewRequestAccepted\"}")], ["/paths/~1v1~1review-requests/post/responses/201/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewRequestAccepted\"}")], ["/paths/~1v1~1review-requests/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], @@ -826,107 +826,107 @@ const rules: Record = Object.fromEntries([ ["/paths/~1v1~1review-requests/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], ["/paths/~1v1~1review-requests/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], ["/paths/~1v1~1review-requests/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-requests~1{request_id}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewRequestView\"}")], - ["/paths/~1v1~1review-requests~1{request_id}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-requests~1{request_id}/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-requests~1{request_id}/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-requests~1{request_id}/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1review-requests~1{request_id}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-requests~1{request_id}/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewAsk\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewAsk\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewAskNotOpen\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewAskAnswerTimeInvalid\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewCancelResponse\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewClockOccurrenceList\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewHistoryPage\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewHistoryEntry\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewResult\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-requests~1{requestId}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewRequestView\"}")], + ["/paths/~1v1~1review-requests~1{requestId}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-requests~1{requestId}/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-requests~1{requestId}/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-requests~1{requestId}/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1review-requests~1{requestId}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-requests~1{requestId}/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewAsk\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewAsk\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewAskNotOpen\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewAskAnswerTimeInvalid\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewCancelResponse\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewClockOccurrenceList\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewHistoryPage\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewHistoryEntry\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewResult\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], ["/paths/~1v1~1review-results/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewResultFeedPage\"}")], ["/paths/~1v1~1review-results/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], ["/paths/~1v1~1review-results/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], @@ -999,240 +999,240 @@ const rules: Record = Object.fromEntries([ ["/paths/~1v1~1review-tasks~1supervision/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], ["/paths/~1v1~1review-tasks~1supervision/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], ["/paths/~1v1~1review-tasks~1supervision/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTask\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTaskAsked\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewAskAlreadyOpen\"},{\"$ref\":\"/components/schemas/ProblemReviewAskLimitReached\"},{\"$ref\":\"/components/schemas/ProblemReviewAskNotOffered\"},{\"$ref\":\"/components/schemas/ProblemReviewAskProducerUnsupported\"},{\"$ref\":\"/components/schemas/ProblemReviewAskTaskInactive\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTask\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTask\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTaskContext\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTask\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTaskDraft\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTaskDraft\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTask\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/TaskGrantList\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/TaskGrantView\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/TaskGrantRevocation\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/TaskTemplatePreviews\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/TaskAssertionResponse\"}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/TaskGrantStatus\"}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], - ["/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTask\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTaskAsked\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewAskAlreadyOpen\"},{\"$ref\":\"/components/schemas/ProblemReviewAskLimitReached\"},{\"$ref\":\"/components/schemas/ProblemReviewAskNotOffered\"},{\"$ref\":\"/components/schemas/ProblemReviewAskProducerUnsupported\"},{\"$ref\":\"/components/schemas/ProblemReviewAskTaskInactive\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTask\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTask\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTaskContext\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTask\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTaskDraft\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTaskDraft\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ReviewTask\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/TaskGrantList\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/TaskGrantView\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/TaskGrantRevocation\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/TaskTemplatePreviews\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAccessProfileAmbiguous\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/TaskAssertionResponse\"}")], + ["/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"},{\"$ref\":\"/components/schemas/ProblemReviewDistinctApproverRequired\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorExcluded\"}]}")], + ["/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemReviewPolicyMismatch\"},{\"$ref\":\"/components/schemas/ProblemReviewSubmissionConflict\"},{\"$ref\":\"/components/schemas/ProblemReviewTaskNotHeld\"}]}")], + ["/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionFailed\"}")], + ["/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAbsenceCoverCycle\"},{\"$ref\":\"/components/schemas/ProblemAbsenceInvalidPeriod\"},{\"$ref\":\"/components/schemas/ProblemAbsenceOverlap\"},{\"$ref\":\"/components/schemas/ProblemAbsenceSelfCover\"},{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemReviewInitiatorRequired\"}]}")], + ["/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], + ["/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/TaskGrantStatus\"}")], + ["/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemRequestLimitOutOfRange\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileNotApplicable\"},{\"$ref\":\"/components/schemas/ProblemSourceProfileRequired\"}]}")], + ["/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemSourceAuthorizationRequired\"}]}")], + ["/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemProfileNotHuman\"}]}")], + ["/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestNotFound\"}")], + ["/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemCursorExpired\"},{\"$ref\":\"/components/schemas/ProblemReviewResultExpired\"}]}")], + ["/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRuntimeFailure\"}")], + ["/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/502/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemSourceBadGateway\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionMismatch\"},{\"$ref\":\"/components/schemas/ProblemSourceVersionUnavailable\"}]}")], + ["/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], ]) const routes: Record = Object.create(null) type Definition = Omit & { problems?: Record; responses: Record> } @@ -1242,57 +1242,57 @@ const definitions: Record = Object.fromEntries([ ["readiness", JSON.parse("{\"method\":\"GET\",\"path\":\"/ready\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1ready/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1ready/get/responses/400/content/application~1problem+json/schema\",\"413\":\"/paths/~1ready/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1ready/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1ready/get/responses/422/content/application~1problem+json/schema\",\"503\":\"/paths/~1ready/get/responses/503/content/application~1problem+json/schema\"}}")], ["describeCasework", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/casework\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1casework/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1casework/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1casework/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1casework/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1casework/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1casework/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1casework/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1casework/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1casework/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1casework/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1casework/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1casework/get/responses/503/content/application~1problem+json/schema\"}}")], ["listDelegatedStaffReviewTasks", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/delegated-staff/review-tasks\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1delegated-staff~1review-tasks/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1delegated-staff~1review-tasks/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1delegated-staff~1review-tasks/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1delegated-staff~1review-tasks/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1delegated-staff~1review-tasks/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1delegated-staff~1review-tasks/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1delegated-staff~1review-tasks/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1delegated-staff~1review-tasks/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1delegated-staff~1review-tasks/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1delegated-staff~1review-tasks/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1delegated-staff~1review-tasks/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1delegated-staff~1review-tasks/get/responses/503/content/application~1problem+json/schema\"}}")], - ["getDelegatedStaffReviewTaskContext", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/delegated-staff/review-tasks/{task_id}/context\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{task_id}~1context/get/responses/503/content/application~1problem+json/schema\"}}")], + ["getDelegatedStaffReviewTaskContext", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/delegated-staff/review-tasks/{taskId}/context\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1delegated-staff~1review-tasks~1{taskId}~1context/get/responses/503/content/application~1problem+json/schema\"}}")], ["getDirectory", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/directory\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1directory/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1directory/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory/get/responses/503/content/application~1problem+json/schema\"}}")], ["listAbsences", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/directory/absences\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1directory~1absences/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1directory~1absences/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory~1absences/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory~1absences/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory~1absences/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory~1absences/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory~1absences/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory~1absences/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory~1absences/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory~1absences/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory~1absences/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory~1absences/get/responses/503/content/application~1problem+json/schema\"}}")], ["createAbsence", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/directory/absences\",\"responses\":{\"201\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1directory~1absences/post/responses/201/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1directory~1absences/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory~1absences/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory~1absences/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory~1absences/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1directory~1absences/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory~1absences/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1directory~1absences/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory~1absences/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory~1absences/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory~1absences/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1directory~1absences/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory~1absences/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory~1absences/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory~1absences/post/responses/503/content/application~1problem+json/schema\"}}")], - ["deleteAbsence", JSON.parse("{\"method\":\"DELETE\",\"path\":\"/v1/directory/absences/{absence_id}\",\"responses\":{\"204\":[{\"mode\":\"empty\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"problems\":{\"400\":\"/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory~1absences~1{absence_id}/delete/responses/503/content/application~1problem+json/schema\"}}")], - ["updateAbsence", JSON.parse("{\"method\":\"PUT\",\"path\":\"/v1/directory/absences/{absence_id}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory~1absences~1{absence_id}/put/responses/503/content/application~1problem+json/schema\"}}")], + ["deleteAbsence", JSON.parse("{\"method\":\"DELETE\",\"path\":\"/v1/directory/absences/{absenceId}\",\"responses\":{\"204\":[{\"mode\":\"empty\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"problems\":{\"400\":\"/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory~1absences~1{absenceId}/delete/responses/503/content/application~1problem+json/schema\"}}")], + ["updateAbsence", JSON.parse("{\"method\":\"PUT\",\"path\":\"/v1/directory/absences/{absenceId}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory~1absences~1{absenceId}/put/responses/503/content/application~1problem+json/schema\"}}")], ["bootstrapDirectory", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/directory/bootstrap\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1directory~1bootstrap/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1directory~1bootstrap/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory~1bootstrap/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory~1bootstrap/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory~1bootstrap/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1directory~1bootstrap/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory~1bootstrap/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1directory~1bootstrap/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory~1bootstrap/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory~1bootstrap/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory~1bootstrap/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1directory~1bootstrap/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory~1bootstrap/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory~1bootstrap/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory~1bootstrap/post/responses/503/content/application~1problem+json/schema\"}}")], ["applyReviewCaseload", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/directory/caseload/apply\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1directory~1caseload~1apply/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1directory~1caseload~1apply/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory~1caseload~1apply/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory~1caseload~1apply/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory~1caseload~1apply/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1directory~1caseload~1apply/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory~1caseload~1apply/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1directory~1caseload~1apply/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory~1caseload~1apply/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory~1caseload~1apply/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory~1caseload~1apply/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1directory~1caseload~1apply/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory~1caseload~1apply/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory~1caseload~1apply/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory~1caseload~1apply/post/responses/503/content/application~1problem+json/schema\"}}")], ["previewReviewCaseload", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/directory/caseload/preview\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1directory~1caseload~1preview/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1directory~1caseload~1preview/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory~1caseload~1preview/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory~1caseload~1preview/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory~1caseload~1preview/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1directory~1caseload~1preview/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory~1caseload~1preview/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1directory~1caseload~1preview/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory~1caseload~1preview/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory~1caseload~1preview/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory~1caseload~1preview/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1directory~1caseload~1preview/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory~1caseload~1preview/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory~1caseload~1preview/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory~1caseload~1preview/post/responses/503/content/application~1problem+json/schema\"}}")], ["applyReviewClockRecompute", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/directory/clocks/recompute/apply\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1directory~1clocks~1recompute~1apply/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1directory~1clocks~1recompute~1apply/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory~1clocks~1recompute~1apply/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory~1clocks~1recompute~1apply/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory~1clocks~1recompute~1apply/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1directory~1clocks~1recompute~1apply/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory~1clocks~1recompute~1apply/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1directory~1clocks~1recompute~1apply/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory~1clocks~1recompute~1apply/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory~1clocks~1recompute~1apply/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory~1clocks~1recompute~1apply/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1directory~1clocks~1recompute~1apply/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory~1clocks~1recompute~1apply/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory~1clocks~1recompute~1apply/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory~1clocks~1recompute~1apply/post/responses/503/content/application~1problem+json/schema\"}}")], ["previewReviewClockRecompute", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/directory/clocks/recompute/preview\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1directory~1clocks~1recompute~1preview/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1directory~1clocks~1recompute~1preview/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory~1clocks~1recompute~1preview/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory~1clocks~1recompute~1preview/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory~1clocks~1recompute~1preview/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1directory~1clocks~1recompute~1preview/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory~1clocks~1recompute~1preview/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1directory~1clocks~1recompute~1preview/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory~1clocks~1recompute~1preview/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory~1clocks~1recompute~1preview/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory~1clocks~1recompute~1preview/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1directory~1clocks~1recompute~1preview/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory~1clocks~1recompute~1preview/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory~1clocks~1recompute~1preview/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory~1clocks~1recompute~1preview/post/responses/503/content/application~1problem+json/schema\"}}")], ["createHolidayRevision", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/directory/holidays\",\"responses\":{\"201\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1directory~1holidays/post/responses/201/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1directory~1holidays/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory~1holidays/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory~1holidays/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory~1holidays/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1directory~1holidays/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory~1holidays/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1directory~1holidays/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory~1holidays/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory~1holidays/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory~1holidays/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1directory~1holidays/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory~1holidays/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory~1holidays/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory~1holidays/post/responses/503/content/application~1problem+json/schema\"}}")], - ["getHolidayRevision", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/directory/holidays/{id}/revisions/{revision}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory~1holidays~1{id}~1revisions~1{revision}/get/responses/503/content/application~1problem+json/schema\"}}")], + ["getHolidayRevision", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/directory/holidays/{holidayId}/revisions/{holidayRevision}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory~1holidays~1{holidayId}~1revisions~1{holidayRevision}/get/responses/503/content/application~1problem+json/schema\"}}")], ["listDirectoryTargets", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/directory/targets\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1directory~1targets/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1directory~1targets/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory~1targets/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory~1targets/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory~1targets/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory~1targets/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory~1targets/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory~1targets/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory~1targets/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory~1targets/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory~1targets/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory~1targets/get/responses/503/content/application~1problem+json/schema\"}}")], - ["updateDirectoryTeam", JSON.parse("{\"method\":\"PUT\",\"path\":\"/v1/directory/teams/{team_id}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1directory~1teams~1{team_id}/put/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1directory~1teams~1{team_id}/put/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory~1teams~1{team_id}/put/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory~1teams~1{team_id}/put/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory~1teams~1{team_id}/put/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1directory~1teams~1{team_id}/put/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory~1teams~1{team_id}/put/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1directory~1teams~1{team_id}/put/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory~1teams~1{team_id}/put/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory~1teams~1{team_id}/put/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory~1teams~1{team_id}/put/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1directory~1teams~1{team_id}/put/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory~1teams~1{team_id}/put/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory~1teams~1{team_id}/put/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory~1teams~1{team_id}/put/responses/503/content/application~1problem+json/schema\"}}")], - ["getReviewAccountability", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-accountability/{event_id}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-accountability~1{event_id}/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-accountability~1{event_id}/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-accountability~1{event_id}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-accountability~1{event_id}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-accountability~1{event_id}/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-accountability~1{event_id}/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-accountability~1{event_id}/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-accountability~1{event_id}/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-accountability~1{event_id}/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-accountability~1{event_id}/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-accountability~1{event_id}/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-accountability~1{event_id}/get/responses/503/content/application~1problem+json/schema\"}}")], + ["updateDirectoryTeam", JSON.parse("{\"method\":\"PUT\",\"path\":\"/v1/directory/teams/{teamId}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1directory~1teams~1{teamId}/put/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1directory~1teams~1{teamId}/put/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1directory~1teams~1{teamId}/put/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1directory~1teams~1{teamId}/put/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1directory~1teams~1{teamId}/put/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1directory~1teams~1{teamId}/put/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1directory~1teams~1{teamId}/put/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1directory~1teams~1{teamId}/put/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1directory~1teams~1{teamId}/put/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1directory~1teams~1{teamId}/put/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1directory~1teams~1{teamId}/put/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1directory~1teams~1{teamId}/put/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1directory~1teams~1{teamId}/put/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1directory~1teams~1{teamId}/put/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1directory~1teams~1{teamId}/put/responses/503/content/application~1problem+json/schema\"}}")], + ["getReviewAccountability", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-accountability/{eventId}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-accountability~1{eventId}/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-accountability~1{eventId}/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-accountability~1{eventId}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-accountability~1{eventId}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-accountability~1{eventId}/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-accountability~1{eventId}/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-accountability~1{eventId}/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-accountability~1{eventId}/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-accountability~1{eventId}/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-accountability~1{eventId}/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-accountability~1{eventId}/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-accountability~1{eventId}/get/responses/503/content/application~1problem+json/schema\"}}")], ["listReviewAsks", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-asks\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-asks/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-asks/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-asks/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-asks/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-asks/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-asks/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-asks/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-asks/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-asks/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-asks/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-asks/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-asks/get/responses/503/content/application~1problem+json/schema\"}}")], ["listReviewPolicies", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-policies\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-policies/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-policies/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-policies/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-policies/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-policies/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-policies/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-policies/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-policies/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-policies/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-policies/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-policies/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-policies/get/responses/503/content/application~1problem+json/schema\"}}")], - ["getReviewPolicy", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-policies/{policy_id}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-policies~1{policy_id}/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-policies~1{policy_id}/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-policies~1{policy_id}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-policies~1{policy_id}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-policies~1{policy_id}/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-policies~1{policy_id}/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-policies~1{policy_id}/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-policies~1{policy_id}/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-policies~1{policy_id}/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-policies~1{policy_id}/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-policies~1{policy_id}/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-policies~1{policy_id}/get/responses/503/content/application~1problem+json/schema\"}}")], + ["getReviewPolicy", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-policies/{policyId}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-policies~1{policyId}/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-policies~1{policyId}/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-policies~1{policyId}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-policies~1{policyId}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-policies~1{policyId}/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-policies~1{policyId}/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-policies~1{policyId}/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-policies~1{policyId}/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-policies~1{policyId}/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-policies~1{policyId}/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-policies~1{policyId}/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-policies~1{policyId}/get/responses/503/content/application~1problem+json/schema\"}}")], ["createOrRecoverReviewRequest", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-requests\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests/post/responses/200/content/application~1json/schema\"}],\"201\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests/post/responses/201/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-requests/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-requests/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-requests/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-requests/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-requests/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-requests/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-requests/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-requests/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-requests/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-requests/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-requests/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-requests/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-requests/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-requests/post/responses/503/content/application~1problem+json/schema\"}}")], - ["getReviewRequest", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-requests/{request_id}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests~1{request_id}/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-requests~1{request_id}/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-requests~1{request_id}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-requests~1{request_id}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-requests~1{request_id}/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-requests~1{request_id}/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-requests~1{request_id}/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-requests~1{request_id}/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-requests~1{request_id}/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-requests~1{request_id}/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-requests~1{request_id}/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-requests~1{request_id}/get/responses/503/content/application~1problem+json/schema\"}}")], - ["getReviewAsk", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-requests/{request_id}/asks/{ask_id}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}/get/responses/503/content/application~1problem+json/schema\"},\"emptyRefusals\":[404]}")], - ["answerReviewAsk", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-requests/{request_id}/asks/{ask_id}/answer\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/403/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-requests~1{request_id}~1asks~1{ask_id}~1answer/post/responses/503/content/application~1problem+json/schema\"},\"emptyRefusals\":[404]}")], - ["cancelReviewRequest", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-requests/{request_id}/cancel\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-requests~1{request_id}~1cancel/post/responses/503/content/application~1problem+json/schema\"}}")], - ["getReviewClocks", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-requests/{request_id}/clocks\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-requests~1{request_id}~1clocks/get/responses/503/content/application~1problem+json/schema\"}}")], - ["getReviewHistory", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-requests/{request_id}/history\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-requests~1{request_id}~1history/get/responses/503/content/application~1problem+json/schema\"}}")], - ["addReviewNote", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-requests/{request_id}/notes\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-requests~1{request_id}~1notes/post/responses/503/content/application~1problem+json/schema\"}}")], - ["getReviewResult", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-requests/{request_id}/result\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/200/content/application~1json/schema\"}],\"202\":[{\"mode\":\"empty\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-requests~1{request_id}~1result/get/responses/503/content/application~1problem+json/schema\"},\"emptyRefusals\":[404,410]}")], + ["getReviewRequest", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-requests/{requestId}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests~1{requestId}/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-requests~1{requestId}/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-requests~1{requestId}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-requests~1{requestId}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-requests~1{requestId}/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-requests~1{requestId}/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-requests~1{requestId}/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-requests~1{requestId}/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-requests~1{requestId}/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-requests~1{requestId}/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-requests~1{requestId}/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-requests~1{requestId}/get/responses/503/content/application~1problem+json/schema\"}}")], + ["getReviewAsk", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-requests/{requestId}/asks/{askId}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}/get/responses/503/content/application~1problem+json/schema\"},\"emptyRefusals\":[404]}")], + ["answerReviewAsk", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-requests/{requestId}/asks/{askId}/answer\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/403/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-requests~1{requestId}~1asks~1{askId}~1answer/post/responses/503/content/application~1problem+json/schema\"},\"emptyRefusals\":[404]}")], + ["cancelReviewRequest", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-requests/{requestId}/cancel\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-requests~1{requestId}~1cancel/post/responses/503/content/application~1problem+json/schema\"}}")], + ["getReviewClocks", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-requests/{requestId}/clocks\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-requests~1{requestId}~1clocks/get/responses/503/content/application~1problem+json/schema\"}}")], + ["getReviewHistory", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-requests/{requestId}/history\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-requests~1{requestId}~1history/get/responses/503/content/application~1problem+json/schema\"}}")], + ["addReviewNote", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-requests/{requestId}/notes\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-requests~1{requestId}~1notes/post/responses/503/content/application~1problem+json/schema\"}}")], + ["getReviewResult", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-requests/{requestId}/result\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/200/content/application~1json/schema\"}],\"202\":[{\"mode\":\"empty\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-requests~1{requestId}~1result/get/responses/503/content/application~1problem+json/schema\"},\"emptyRefusals\":[404,410]}")], ["listReviewResults", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-results\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-results/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-results/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-results/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-results/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-results/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-results/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-results/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-results/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-results/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-results/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-results/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-results/get/responses/503/content/application~1problem+json/schema\"}}")], ["listReviewTasks", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-tasks\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks/get/responses/503/content/application~1problem+json/schema\"}}")], ["getReviewTaskHoldings", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-tasks/holdings\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1holdings/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1holdings/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1holdings/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1holdings/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1holdings/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1holdings/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1holdings/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1holdings/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1holdings/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1holdings/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1holdings/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1holdings/get/responses/503/content/application~1problem+json/schema\"}}")], ["getNextReviewTask", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-tasks/next\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1next/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1next/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1next/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1next/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1next/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1next/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1next/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1next/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1next/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1next/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1next/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1next/get/responses/503/content/application~1problem+json/schema\"}}")], ["listOwnReviewDecisions", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-tasks/own-decisions\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1own-decisions/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1own-decisions/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1own-decisions/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1own-decisions/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1own-decisions/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1own-decisions/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1own-decisions/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1own-decisions/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1own-decisions/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1own-decisions/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1own-decisions/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1own-decisions/get/responses/503/content/application~1problem+json/schema\"}}")], ["listSupervisoryReviewTasks", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-tasks/supervision\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1supervision/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1supervision/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1supervision/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1supervision/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1supervision/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1supervision/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1supervision/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1supervision/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1supervision/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1supervision/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1supervision/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1supervision/get/responses/503/content/application~1problem+json/schema\"}}")], - ["getReviewTask", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-tasks/{task_id}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{task_id}/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{task_id}/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{task_id}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{task_id}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{task_id}/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{task_id}/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{task_id}/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{task_id}/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{task_id}/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{task_id}/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{task_id}/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{task_id}/get/responses/503/content/application~1problem+json/schema\"}}")], - ["askApplicant", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-tasks/{task_id}/asks\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{task_id}~1asks/post/responses/503/content/application~1problem+json/schema\"}}")], - ["assignReviewTask", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-tasks/{task_id}/assign\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{task_id}~1assign/post/responses/503/content/application~1problem+json/schema\"}}")], - ["claimReviewTask", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-tasks/{task_id}/claim\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{task_id}~1claim/post/responses/503/content/application~1problem+json/schema\"}}")], - ["getReviewTaskContext", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-tasks/{task_id}/context\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{task_id}~1context/get/responses/503/content/application~1problem+json/schema\"}}")], - ["decideReviewTask", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-tasks/{task_id}/decisions\",\"responses\":{\"204\":[{\"mode\":\"empty\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{task_id}~1decisions/post/responses/503/content/application~1problem+json/schema\"}}")], - ["delegateReviewTask", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-tasks/{task_id}/delegate\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{task_id}~1delegate/post/responses/503/content/application~1problem+json/schema\"}}")], - ["deleteReviewDecisionDraft", JSON.parse("{\"method\":\"DELETE\",\"path\":\"/v1/review-tasks/{task_id}/draft\",\"responses\":{\"204\":[{\"mode\":\"empty\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/delete/responses/503/content/application~1problem+json/schema\"}}")], - ["getReviewDecisionDraft", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-tasks/{task_id}/draft\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/get/responses/503/content/application~1problem+json/schema\"},\"emptyRefusals\":[404]}")], - ["saveReviewDecisionDraft", JSON.parse("{\"method\":\"PUT\",\"path\":\"/v1/review-tasks/{task_id}/draft\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{task_id}~1draft/put/responses/503/content/application~1problem+json/schema\"}}")], - ["releaseReviewTask", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-tasks/{task_id}/release\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{task_id}~1release/post/responses/503/content/application~1problem+json/schema\"}}")], - ["listReviewTaskGrants", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-tasks/{task_id}/task-grants\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/get/responses/503/content/application~1problem+json/schema\"}}")], - ["approveReviewTaskGrant", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-tasks/{task_id}/task-grants\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants/post/responses/503/content/application~1problem+json/schema\"}}")], - ["revokeReviewTaskGrant", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-tasks/{task_id}/task-grants/{grant_id}/revoke\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":true,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-grants~1{grant_id}~1revoke/post/responses/503/content/application~1problem+json/schema\"}}")], - ["previewReviewTaskTemplates", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-tasks/{task_id}/task-templates\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{task_id}~1task-templates/get/responses/503/content/application~1problem+json/schema\"}}")], - ["getTaskAssertion", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/task-grants/{grant_id}/assertion\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1task-grants~1{grant_id}~1assertion/post/responses/503/content/application~1problem+json/schema\"}}")], - ["getTaskGrantStatus", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/task-grants/{grant_id}/status\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1task-grants~1{grant_id}~1status/get/responses/503/content/application~1problem+json/schema\"}}")], + ["getReviewTask", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-tasks/{taskId}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{taskId}/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{taskId}/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{taskId}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{taskId}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{taskId}/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{taskId}/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{taskId}/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{taskId}/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{taskId}/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{taskId}/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{taskId}/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{taskId}/get/responses/503/content/application~1problem+json/schema\"}}")], + ["askApplicant", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-tasks/{taskId}/asks\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{taskId}~1asks/post/responses/503/content/application~1problem+json/schema\"}}")], + ["assignReviewTask", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-tasks/{taskId}/assign\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{taskId}~1assign/post/responses/503/content/application~1problem+json/schema\"}}")], + ["claimReviewTask", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-tasks/{taskId}/claim\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{taskId}~1claim/post/responses/503/content/application~1problem+json/schema\"}}")], + ["getReviewTaskContext", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-tasks/{taskId}/context\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{taskId}~1context/get/responses/503/content/application~1problem+json/schema\"}}")], + ["decideReviewTask", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-tasks/{taskId}/decisions\",\"responses\":{\"204\":[{\"mode\":\"empty\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{taskId}~1decisions/post/responses/503/content/application~1problem+json/schema\"}}")], + ["delegateReviewTask", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-tasks/{taskId}/delegate\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{taskId}~1delegate/post/responses/503/content/application~1problem+json/schema\"}}")], + ["deleteReviewDecisionDraft", JSON.parse("{\"method\":\"DELETE\",\"path\":\"/v1/review-tasks/{taskId}/draft\",\"responses\":{\"204\":[{\"mode\":\"empty\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/delete/responses/503/content/application~1problem+json/schema\"}}")], + ["getReviewDecisionDraft", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-tasks/{taskId}/draft\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/get/responses/503/content/application~1problem+json/schema\"},\"emptyRefusals\":[404]}")], + ["saveReviewDecisionDraft", JSON.parse("{\"method\":\"PUT\",\"path\":\"/v1/review-tasks/{taskId}/draft\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{taskId}~1draft/put/responses/503/content/application~1problem+json/schema\"}}")], + ["releaseReviewTask", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-tasks/{taskId}/release\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{taskId}~1release/post/responses/503/content/application~1problem+json/schema\"}}")], + ["listReviewTaskGrants", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-tasks/{taskId}/task-grants\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/get/responses/503/content/application~1problem+json/schema\"}}")], + ["approveReviewTaskGrant", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-tasks/{taskId}/task-grants\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants/post/responses/503/content/application~1problem+json/schema\"}}")], + ["revokeReviewTaskGrant", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/review-tasks/{taskId}/task-grants/{grantId}/revoke\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":true,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-grants~1{grantId}~1revoke/post/responses/503/content/application~1problem+json/schema\"}}")], + ["previewReviewTaskTemplates", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/review-tasks/{taskId}/task-templates\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1review-tasks~1{taskId}~1task-templates/get/responses/503/content/application~1problem+json/schema\"}}")], + ["getTaskAssertion", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/task-grants/{grantId}/assertion\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/404/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/428/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1task-grants~1{grantId}~1assertion/post/responses/503/content/application~1problem+json/schema\"}}")], + ["getTaskGrantStatus", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/task-grants/{grantId}/status\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/404/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1task-grants~1{grantId}~1status/get/responses/503/content/application~1problem+json/schema\"}}")], ]) for (const [id, definition] of Object.entries(definitions)) { const responses: Operation["responses"] = {} diff --git a/clients/typescript/generated/evidence-oid4vp.ts b/clients/typescript/generated/evidence-oid4vp.ts index 775c8dff32..ac4caed5a7 100644 --- a/clients/typescript/generated/evidence-oid4vp.ts +++ b/clients/typescript/generated/evidence-oid4vp.ts @@ -1,5 +1,5 @@ // Generated for Stack version 0.50.0, client version 0.50.0. -// Source SHA-256 136a1fc3c2c5a9424e04f7a1376de9ea8f0eff87c9aa37b85e896961c924e13f +// Source SHA-256 6da3ab9720fa5323564d9b5536aa5b75f1475b915dd8b111e16dabc26c6c0efa import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -25,10 +25,10 @@ export interface Operations { "readiness": { input: CallOptions & { accept?: "application/json" | "*/*" }; required: false; output: Schema_ReadinessResponse } "getVerifierKeys": { input: CallOptions & { accept?: "application/json" | "*/*" }; required: false; output: Schema_Jwks } "readPresentation": { input: CallOptions & ({ body: Schema_ReadRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ReadResponse } - "fetchRequestObject": { input: CallOptions & { path: { "request_id": (string) } } & { accept?: "application/oauth-authz-req+jwt" | "*/*" }; required: true; output: WireText<"application/oauth-authz-req+jwt"> } - "receiveWalletResponse": { input: CallOptions & { path: { "request_id": (string) } } & ({ body: string }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_Empty } + "fetchRequestObject": { input: CallOptions & { path: { "requestId": (string) } } & { accept?: "application/oauth-authz-req+jwt" | "*/*" }; required: true; output: WireText<"application/oauth-authz-req+jwt"> } + "receiveWalletResponse": { input: CallOptions & { path: { "requestId": (string) } } & ({ body: string }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_Empty } "createPresentationSession": { input: CallOptions & ({ body: Schema_CreateSessionRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_CreateSessionResponse } - "readSessionStatus": { input: CallOptions & { path: { "reference": (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_SessionStatus } + "readSessionStatus": { input: CallOptions & { path: { "sessionReference": (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_SessionStatus } } const rules: Record = Object.fromEntries([ @@ -69,17 +69,17 @@ const rules: Record = Object.fromEntries([ ["/paths/~1v1~1presentations~1read/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"category\":{\"enum\":[\"access_denied\",\"invalid_request\",\"invalid_client\",\"vp_formats_not_supported\",\"wallet_unavailable\",\"other\"]}},\"required\":[\"category\"],\"type\":\"object\"}]}")], ["/paths/~1v1~1presentations~1read/post/responses/429/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], ["/paths/~1v1~1presentations~1read/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1requests~1{request_id}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1requests~1{request_id}/get/responses/408/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1requests~1{request_id}/get/responses/429/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1requests~1{request_id}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1requests~1{request_id}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1responses~1{request_id}/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Empty\"}")], - ["/paths/~1v1~1responses~1{request_id}/post/responses/400/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/OAuthError\"}")], - ["/paths/~1v1~1responses~1{request_id}/post/responses/408/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1responses~1{request_id}/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1responses~1{request_id}/post/responses/429/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/OAuthRateLimit\"}")], - ["/paths/~1v1~1responses~1{request_id}/post/responses/503/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/OAuthError\"}")], + ["/paths/~1v1~1requests~1{requestId}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1requests~1{requestId}/get/responses/408/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1requests~1{requestId}/get/responses/429/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1requests~1{requestId}/get/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1requests~1{requestId}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1responses~1{requestId}/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Empty\"}")], + ["/paths/~1v1~1responses~1{requestId}/post/responses/400/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/OAuthError\"}")], + ["/paths/~1v1~1responses~1{requestId}/post/responses/408/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1responses~1{requestId}/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1responses~1{requestId}/post/responses/429/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/OAuthRateLimit\"}")], + ["/paths/~1v1~1responses~1{requestId}/post/responses/503/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/OAuthError\"}")], ["/paths/~1v1~1sessions/post/responses/201/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/CreateSessionResponse\"}")], ["/paths/~1v1~1sessions/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], ["/paths/~1v1~1sessions/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], @@ -91,12 +91,12 @@ const rules: Record = Object.fromEntries([ ["/paths/~1v1~1sessions/post/responses/429/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], ["/paths/~1v1~1sessions/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], ["/paths/~1v1~1sessions/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1sessions~1{reference}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/SessionStatus\"}")], - ["/paths/~1v1~1sessions~1{reference}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1sessions~1{reference}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1sessions~1{reference}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1sessions~1{reference}/get/responses/408/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1sessions~1{reference}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1sessions~1{sessionReference}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/SessionStatus\"}")], + ["/paths/~1v1~1sessions~1{sessionReference}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1sessions~1{sessionReference}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1sessions~1{sessionReference}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1sessions~1{sessionReference}/get/responses/408/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1sessions~1{sessionReference}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], ]) const routes: Record = Object.create(null) type Definition = Omit & { problems?: Record; oauthErrors?: Record; responses: Record> } @@ -106,10 +106,10 @@ const definitions: Record = Object.fromEntries([ ["readiness", JSON.parse("{\"method\":\"GET\",\"path\":\"/ready\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1ready/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"anonymous\":true,\"mutating\":false,\"problems\":{\"408\":\"/paths/~1ready/get/responses/408/content/application~1problem+json/schema\"}}")], ["getVerifierKeys", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/jwks\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1jwks/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"anonymous\":true,\"mutating\":false,\"problems\":{\"404\":\"/paths/~1v1~1jwks/get/responses/404/content/application~1problem+json/schema\",\"408\":\"/paths/~1v1~1jwks/get/responses/408/content/application~1problem+json/schema\"}}")], ["readPresentation", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/presentations/read\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1presentations~1read/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1presentations~1read/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1presentations~1read/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1presentations~1read/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1presentations~1read/post/responses/404/content/application~1problem+json/schema\",\"408\":\"/paths/~1v1~1presentations~1read/post/responses/408/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1presentations~1read/post/responses/409/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1presentations~1read/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1presentations~1read/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1presentations~1read/post/responses/422/content/application~1problem+json/schema\",\"429\":\"/paths/~1v1~1presentations~1read/post/responses/429/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1presentations~1read/post/responses/503/content/application~1problem+json/schema\"}}")], - ["fetchRequestObject", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/requests/{request_id}\",\"responses\":{\"200\":[{\"mediaType\":\"application/oauth-authz-req+jwt\",\"mode\":\"text\"}]},\"keyed\":false,\"anonymous\":true,\"mutating\":false,\"problems\":{\"404\":\"/paths/~1v1~1requests~1{request_id}/get/responses/404/content/application~1problem+json/schema\",\"408\":\"/paths/~1v1~1requests~1{request_id}/get/responses/408/content/application~1problem+json/schema\",\"429\":\"/paths/~1v1~1requests~1{request_id}/get/responses/429/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1requests~1{request_id}/get/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1requests~1{request_id}/get/responses/503/content/application~1problem+json/schema\"}}")], - ["receiveWalletResponse", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/responses/{request_id}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1responses~1{request_id}/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"anonymous\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/x-www-form-urlencoded\"],\"requestMediaType\":\"application/x-www-form-urlencoded\",\"oauthErrors\":{\"400\":\"/paths/~1v1~1responses~1{request_id}/post/responses/400/content/application~1json/schema\",\"429\":\"/paths/~1v1~1responses~1{request_id}/post/responses/429/content/application~1json/schema\",\"503\":\"/paths/~1v1~1responses~1{request_id}/post/responses/503/content/application~1json/schema\"},\"problems\":{\"408\":\"/paths/~1v1~1responses~1{request_id}/post/responses/408/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1responses~1{request_id}/post/responses/413/content/application~1problem+json/schema\"}}")], + ["fetchRequestObject", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/requests/{requestId}\",\"responses\":{\"200\":[{\"mediaType\":\"application/oauth-authz-req+jwt\",\"mode\":\"text\"}]},\"keyed\":false,\"anonymous\":true,\"mutating\":false,\"problems\":{\"404\":\"/paths/~1v1~1requests~1{requestId}/get/responses/404/content/application~1problem+json/schema\",\"408\":\"/paths/~1v1~1requests~1{requestId}/get/responses/408/content/application~1problem+json/schema\",\"429\":\"/paths/~1v1~1requests~1{requestId}/get/responses/429/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1requests~1{requestId}/get/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1requests~1{requestId}/get/responses/503/content/application~1problem+json/schema\"}}")], + ["receiveWalletResponse", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/responses/{requestId}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1responses~1{requestId}/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"anonymous\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/x-www-form-urlencoded\"],\"requestMediaType\":\"application/x-www-form-urlencoded\",\"oauthErrors\":{\"400\":\"/paths/~1v1~1responses~1{requestId}/post/responses/400/content/application~1json/schema\",\"429\":\"/paths/~1v1~1responses~1{requestId}/post/responses/429/content/application~1json/schema\",\"503\":\"/paths/~1v1~1responses~1{requestId}/post/responses/503/content/application~1json/schema\"},\"problems\":{\"408\":\"/paths/~1v1~1responses~1{requestId}/post/responses/408/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1responses~1{requestId}/post/responses/413/content/application~1problem+json/schema\"}}")], ["createPresentationSession", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/sessions\",\"responses\":{\"201\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1sessions/post/responses/201/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1sessions/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1sessions/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1sessions/post/responses/403/content/application~1problem+json/schema\",\"408\":\"/paths/~1v1~1sessions/post/responses/408/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1sessions/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1sessions/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1sessions/post/responses/422/content/application~1problem+json/schema\",\"429\":\"/paths/~1v1~1sessions/post/responses/429/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1sessions/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1sessions/post/responses/503/content/application~1problem+json/schema\"}}")], - ["readSessionStatus", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/sessions/{reference}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1sessions~1{reference}/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"401\":\"/paths/~1v1~1sessions~1{reference}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1sessions~1{reference}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1sessions~1{reference}/get/responses/404/content/application~1problem+json/schema\",\"408\":\"/paths/~1v1~1sessions~1{reference}/get/responses/408/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1sessions~1{reference}/get/responses/503/content/application~1problem+json/schema\"}}")], + ["readSessionStatus", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/sessions/{sessionReference}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1sessions~1{sessionReference}/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"401\":\"/paths/~1v1~1sessions~1{sessionReference}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1sessions~1{sessionReference}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1sessions~1{sessionReference}/get/responses/404/content/application~1problem+json/schema\",\"408\":\"/paths/~1v1~1sessions~1{sessionReference}/get/responses/408/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1sessions~1{sessionReference}/get/responses/503/content/application~1problem+json/schema\"}}")], ]) for (const [id, definition] of Object.entries(definitions)) { const responses: Operation["responses"] = {} diff --git a/clients/typescript/generated/messaging.ts b/clients/typescript/generated/messaging.ts index bb4363f29a..9321523282 100644 --- a/clients/typescript/generated/messaging.ts +++ b/clients/typescript/generated/messaging.ts @@ -1,9 +1,9 @@ // Generated for Stack version 0.50.0, client version 0.50.0. -// Source SHA-256 f0ab883a6241d7686d1f9d6b896bea6e2798a9471435ad587b1955c5f64a548f +// Source SHA-256 d10408f03ccad14c266036ab45c0cf1c5b45d21269c04a2e459e7d6b4f1b92e0 // Unconstrained JSON /components/schemas/SubmitMessageRequest/properties/data // Unconstrained JSON /components/schemas/TemplatePreviewRequest/properties/data -// Unconstrained JSON /paths/~1v1~1provider-callbacks~1{provider_id}/post/requestBody/content/application~1json/schema -// Unconstrained JSON /paths/~1v1~1provider-callbacks~1{provider_id}~1{token}/post/requestBody/content/application~1json/schema +// Unconstrained JSON /paths/~1v1~1provider-callbacks~1{providerId}/post/requestBody/content/application~1json/schema +// Unconstrained JSON /paths/~1v1~1provider-callbacks~1{providerId}~1{token}/post/requestBody/content/application~1json/schema import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -28,11 +28,11 @@ export interface Operations { "getReady": { input: CallOptions & { accept?: "application/json" | "*/*" }; required: false; output: Schema_ReadyStatus } "submitMessage": { input: CallOptions & ({ body: Schema_SubmitMessageRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_MessageReceipt } "readMessageReceipt": { input: CallOptions & { idempotencyKey: string } & ({ body: Schema_SubmitMessageRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_MessageReceipt } - "getMessage": { input: CallOptions & { path: { "message_id": (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_MessageView } - "cancelMessage": { input: CallOptions & { path: { "message_id": (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_MessageView } - "receiveProviderCallback": { input: CallOptions & { path: { "provider_id": (string) } } & ({ body: JsonValue; contentType: "application/json" } | { body: string; contentType: "application/x-www-form-urlencoded" }); required: true; output: undefined } - "receiveProviderCallbackWithToken": { input: CallOptions & { path: { "provider_id": (string); "token": (string) } } & ({ body: JsonValue; contentType: "application/json" } | { body: string; contentType: "application/x-www-form-urlencoded" }); required: true; output: undefined } - "previewTemplate": { input: CallOptions & { path: { "template_id": (string); "version": (string) } } & ({ body: Schema_TemplatePreviewRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_TemplatePreview } + "getMessage": { input: CallOptions & { path: { "messageId": (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_MessageView } + "cancelMessage": { input: CallOptions & { path: { "messageId": (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_MessageView } + "receiveProviderCallback": { input: CallOptions & { path: { "providerId": (string) } } & ({ body: JsonValue; contentType: "application/json" } | { body: string; contentType: "application/x-www-form-urlencoded" }); required: true; output: undefined } + "receiveProviderCallbackWithToken": { input: CallOptions & { path: { "providerId": (string); "token": (string) } } & ({ body: JsonValue; contentType: "application/json" } | { body: string; contentType: "application/x-www-form-urlencoded" }); required: true; output: undefined } + "previewTemplate": { input: CallOptions & { path: { "templateId": (string); "templateVersion": (string) } } & ({ body: Schema_TemplatePreviewRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_TemplatePreview } } const rules: Record = Object.fromEntries([ @@ -78,43 +78,43 @@ const rules: Record = Object.fromEntries([ ["/paths/~1v1~1messages~1receipt/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.unsupported-media-type\"]}}}]}")], ["/paths/~1v1~1messages~1receipt/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.unprocessable\"]}}}]}")], ["/paths/~1v1~1messages~1receipt/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"service.unavailable\"]}}}]}")], - ["/paths/~1v1~1messages~1{message_id}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/MessageView\"}")], - ["/paths/~1v1~1messages~1{message_id}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], - ["/paths/~1v1~1messages~1{message_id}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"profile.not-authorized\"]}}}]}")], - ["/paths/~1v1~1messages~1{message_id}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"message.not-visible\"]}}}]}")], - ["/paths/~1v1~1messages~1{message_id}/get/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], - ["/paths/~1v1~1messages~1{message_id}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"service.unavailable\"]}}}]}")], - ["/paths/~1v1~1messages~1{message_id}~1cancel/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/MessageView\"}")], - ["/paths/~1v1~1messages~1{message_id}~1cancel/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], - ["/paths/~1v1~1messages~1{message_id}~1cancel/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"profile.not-authorized\"]}}}]}")], - ["/paths/~1v1~1messages~1{message_id}~1cancel/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"message.not-visible\"]}}}]}")], - ["/paths/~1v1~1messages~1{message_id}~1cancel/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], - ["/paths/~1v1~1messages~1{message_id}~1cancel/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"message.dispatch-started\",\"message.terminal\"]}}}]}")], - ["/paths/~1v1~1messages~1{message_id}~1cancel/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"service.unavailable\"]}}}]}")], - ["/paths/~1v1~1provider-callbacks~1{provider_id}/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\"]}}}]}")], - ["/paths/~1v1~1provider-callbacks~1{provider_id}/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"callback.unverified\"]}}}]}")], - ["/paths/~1v1~1provider-callbacks~1{provider_id}/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], - ["/paths/~1v1~1provider-callbacks~1{provider_id}/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.body-too-large\"]}}}]}")], - ["/paths/~1v1~1provider-callbacks~1{provider_id}/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"callback.unreadable\"]}}}]}")], - ["/paths/~1v1~1provider-callbacks~1{provider_id}/post/responses/429/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"rate-limit.exceeded\"]}}}]}")], - ["/paths/~1v1~1provider-callbacks~1{provider_id}/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"service.unavailable\"]}}}]}")], - ["/paths/~1v1~1provider-callbacks~1{provider_id}~1{token}/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\"]}}}]}")], - ["/paths/~1v1~1provider-callbacks~1{provider_id}~1{token}/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"callback.unverified\"]}}}]}")], - ["/paths/~1v1~1provider-callbacks~1{provider_id}~1{token}/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], - ["/paths/~1v1~1provider-callbacks~1{provider_id}~1{token}/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.body-too-large\"]}}}]}")], - ["/paths/~1v1~1provider-callbacks~1{provider_id}~1{token}/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"callback.unreadable\"]}}}]}")], - ["/paths/~1v1~1provider-callbacks~1{provider_id}~1{token}/post/responses/429/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"rate-limit.exceeded\"]}}}]}")], - ["/paths/~1v1~1provider-callbacks~1{provider_id}~1{token}/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"service.unavailable\"]}}}]}")], - ["/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/TemplatePreview\"}")], - ["/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\"]}}}]}")], - ["/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], - ["/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"operation.not-authorized\",\"profile.not-authorized\"]}}}]}")], - ["/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"template.not-found\"]}}}]}")], - ["/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], - ["/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.body-too-large\"]}}}]}")], - ["/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.unsupported-media-type\"]}}}]}")], - ["/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.unprocessable\",\"template.data-invalid\",\"template.locale-unavailable\",\"template.render-refused\",\"content.too-large\"]}}}]}")], - ["/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"service.unavailable\"]}}}]}")], + ["/paths/~1v1~1messages~1{messageId}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/MessageView\"}")], + ["/paths/~1v1~1messages~1{messageId}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], + ["/paths/~1v1~1messages~1{messageId}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"profile.not-authorized\"]}}}]}")], + ["/paths/~1v1~1messages~1{messageId}/get/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"message.not-visible\"]}}}]}")], + ["/paths/~1v1~1messages~1{messageId}/get/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], + ["/paths/~1v1~1messages~1{messageId}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"service.unavailable\"]}}}]}")], + ["/paths/~1v1~1messages~1{messageId}~1cancel/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/MessageView\"}")], + ["/paths/~1v1~1messages~1{messageId}~1cancel/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], + ["/paths/~1v1~1messages~1{messageId}~1cancel/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"profile.not-authorized\"]}}}]}")], + ["/paths/~1v1~1messages~1{messageId}~1cancel/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"message.not-visible\"]}}}]}")], + ["/paths/~1v1~1messages~1{messageId}~1cancel/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], + ["/paths/~1v1~1messages~1{messageId}~1cancel/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"message.dispatch-started\",\"message.terminal\"]}}}]}")], + ["/paths/~1v1~1messages~1{messageId}~1cancel/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"service.unavailable\"]}}}]}")], + ["/paths/~1v1~1provider-callbacks~1{providerId}/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\"]}}}]}")], + ["/paths/~1v1~1provider-callbacks~1{providerId}/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"callback.unverified\"]}}}]}")], + ["/paths/~1v1~1provider-callbacks~1{providerId}/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], + ["/paths/~1v1~1provider-callbacks~1{providerId}/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.body-too-large\"]}}}]}")], + ["/paths/~1v1~1provider-callbacks~1{providerId}/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"callback.unreadable\"]}}}]}")], + ["/paths/~1v1~1provider-callbacks~1{providerId}/post/responses/429/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"rate-limit.exceeded\"]}}}]}")], + ["/paths/~1v1~1provider-callbacks~1{providerId}/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"service.unavailable\"]}}}]}")], + ["/paths/~1v1~1provider-callbacks~1{providerId}~1{token}/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\"]}}}]}")], + ["/paths/~1v1~1provider-callbacks~1{providerId}~1{token}/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"callback.unverified\"]}}}]}")], + ["/paths/~1v1~1provider-callbacks~1{providerId}~1{token}/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], + ["/paths/~1v1~1provider-callbacks~1{providerId}~1{token}/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.body-too-large\"]}}}]}")], + ["/paths/~1v1~1provider-callbacks~1{providerId}~1{token}/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"callback.unreadable\"]}}}]}")], + ["/paths/~1v1~1provider-callbacks~1{providerId}~1{token}/post/responses/429/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"rate-limit.exceeded\"]}}}]}")], + ["/paths/~1v1~1provider-callbacks~1{providerId}~1{token}/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"service.unavailable\"]}}}]}")], + ["/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/TemplatePreview\"}")], + ["/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.invalid\"]}}}]}")], + ["/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"authentication.refused\"]}}}]}")], + ["/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"operation.not-authorized\",\"profile.not-authorized\"]}}}]}")], + ["/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"template.not-found\"]}}}]}")], + ["/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.method-not-allowed\"]}}}]}")], + ["/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.body-too-large\"]}}}]}")], + ["/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.unsupported-media-type\"]}}}]}")], + ["/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"request.unprocessable\",\"template.data-invalid\",\"template.locale-unavailable\",\"template.render-refused\",\"content.too-large\"]}}}]}")], + ["/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"allOf\":[{\"$ref\":\"/components/schemas/Problem\"},{\"properties\":{\"code\":{\"enum\":[\"service.unavailable\"]}}}]}")], ]) const routes: Record = Object.create(null) type Definition = Omit & { problems?: Record; responses: Record> } @@ -123,11 +123,11 @@ const definitions: Record = Object.fromEntries([ ["getReady", JSON.parse("{\"method\":\"GET\",\"path\":\"/ready\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1ready/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"messaging\":true,\"problems\":{\"405\":\"/paths/~1ready/get/responses/405/content/application~1problem+json/schema\",\"503\":\"/paths/~1ready/get/responses/503/content/application~1problem+json/schema\"}}")], ["submitMessage", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/messages\",\"responses\":{\"202\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1messages/post/responses/202/content/application~1json/schema\"}]},\"keyed\":true,\"mutating\":true,\"messaging\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1messages/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1messages/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1messages/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1messages/post/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1messages/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1messages/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1messages/post/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1messages/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1messages/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1messages/post/responses/422/content/application~1problem+json/schema\",\"429\":\"/paths/~1v1~1messages/post/responses/429/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1messages/post/responses/503/content/application~1problem+json/schema\"}}")], ["readMessageReceipt", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/messages/receipt\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1messages~1receipt/post/responses/200/content/application~1json/schema\"}]},\"keyed\":true,\"requiresExistingKey\":true,\"mutating\":false,\"messaging\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1messages~1receipt/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1messages~1receipt/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1messages~1receipt/post/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1messages~1receipt/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1messages~1receipt/post/responses/409/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1messages~1receipt/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1messages~1receipt/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1messages~1receipt/post/responses/422/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1messages~1receipt/post/responses/503/content/application~1problem+json/schema\"}}")], - ["getMessage", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/messages/{message_id}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1messages~1{message_id}/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"messaging\":true,\"problems\":{\"401\":\"/paths/~1v1~1messages~1{message_id}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1messages~1{message_id}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1messages~1{message_id}/get/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1messages~1{message_id}/get/responses/405/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1messages~1{message_id}/get/responses/503/content/application~1problem+json/schema\"}}")], - ["cancelMessage", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/messages/{message_id}/cancel\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1messages~1{message_id}~1cancel/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":true,\"messaging\":true,\"problems\":{\"401\":\"/paths/~1v1~1messages~1{message_id}~1cancel/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1messages~1{message_id}~1cancel/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1messages~1{message_id}~1cancel/post/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1messages~1{message_id}~1cancel/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1messages~1{message_id}~1cancel/post/responses/409/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1messages~1{message_id}~1cancel/post/responses/503/content/application~1problem+json/schema\"}}")], - ["receiveProviderCallback", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/provider-callbacks/{provider_id}\",\"responses\":{\"204\":[{\"mode\":\"empty\"}]},\"keyed\":false,\"mutating\":true,\"messaging\":true,\"requestMediaTypes\":[\"application/json\",\"application/x-www-form-urlencoded\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1provider-callbacks~1{provider_id}/post/responses/400/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1provider-callbacks~1{provider_id}/post/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1provider-callbacks~1{provider_id}/post/responses/405/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1provider-callbacks~1{provider_id}/post/responses/413/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1provider-callbacks~1{provider_id}/post/responses/422/content/application~1problem+json/schema\",\"429\":\"/paths/~1v1~1provider-callbacks~1{provider_id}/post/responses/429/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1provider-callbacks~1{provider_id}/post/responses/503/content/application~1problem+json/schema\"}}")], - ["receiveProviderCallbackWithToken", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/provider-callbacks/{provider_id}/{token}\",\"responses\":{\"204\":[{\"mode\":\"empty\"}]},\"keyed\":false,\"mutating\":true,\"messaging\":true,\"requestMediaTypes\":[\"application/json\",\"application/x-www-form-urlencoded\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1provider-callbacks~1{provider_id}~1{token}/post/responses/400/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1provider-callbacks~1{provider_id}~1{token}/post/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1provider-callbacks~1{provider_id}~1{token}/post/responses/405/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1provider-callbacks~1{provider_id}~1{token}/post/responses/413/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1provider-callbacks~1{provider_id}~1{token}/post/responses/422/content/application~1problem+json/schema\",\"429\":\"/paths/~1v1~1provider-callbacks~1{provider_id}~1{token}/post/responses/429/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1provider-callbacks~1{provider_id}~1{token}/post/responses/503/content/application~1problem+json/schema\"}}")], - ["previewTemplate", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/templates/{template_id}/versions/{version}/preview\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"messaging\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/405/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/422/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1templates~1{template_id}~1versions~1{version}~1preview/post/responses/503/content/application~1problem+json/schema\"}}")], + ["getMessage", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/messages/{messageId}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1messages~1{messageId}/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"messaging\":true,\"problems\":{\"401\":\"/paths/~1v1~1messages~1{messageId}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1messages~1{messageId}/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1messages~1{messageId}/get/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1messages~1{messageId}/get/responses/405/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1messages~1{messageId}/get/responses/503/content/application~1problem+json/schema\"}}")], + ["cancelMessage", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/messages/{messageId}/cancel\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1messages~1{messageId}~1cancel/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":true,\"messaging\":true,\"problems\":{\"401\":\"/paths/~1v1~1messages~1{messageId}~1cancel/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1messages~1{messageId}~1cancel/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1messages~1{messageId}~1cancel/post/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1messages~1{messageId}~1cancel/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1messages~1{messageId}~1cancel/post/responses/409/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1messages~1{messageId}~1cancel/post/responses/503/content/application~1problem+json/schema\"}}")], + ["receiveProviderCallback", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/provider-callbacks/{providerId}\",\"responses\":{\"204\":[{\"mode\":\"empty\"}]},\"keyed\":false,\"mutating\":true,\"messaging\":true,\"requestMediaTypes\":[\"application/json\",\"application/x-www-form-urlencoded\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1provider-callbacks~1{providerId}/post/responses/400/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1provider-callbacks~1{providerId}/post/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1provider-callbacks~1{providerId}/post/responses/405/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1provider-callbacks~1{providerId}/post/responses/413/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1provider-callbacks~1{providerId}/post/responses/422/content/application~1problem+json/schema\",\"429\":\"/paths/~1v1~1provider-callbacks~1{providerId}/post/responses/429/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1provider-callbacks~1{providerId}/post/responses/503/content/application~1problem+json/schema\"}}")], + ["receiveProviderCallbackWithToken", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/provider-callbacks/{providerId}/{token}\",\"responses\":{\"204\":[{\"mode\":\"empty\"}]},\"keyed\":false,\"mutating\":true,\"messaging\":true,\"requestMediaTypes\":[\"application/json\",\"application/x-www-form-urlencoded\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1provider-callbacks~1{providerId}~1{token}/post/responses/400/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1provider-callbacks~1{providerId}~1{token}/post/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1provider-callbacks~1{providerId}~1{token}/post/responses/405/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1provider-callbacks~1{providerId}~1{token}/post/responses/413/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1provider-callbacks~1{providerId}~1{token}/post/responses/422/content/application~1problem+json/schema\",\"429\":\"/paths/~1v1~1provider-callbacks~1{providerId}~1{token}/post/responses/429/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1provider-callbacks~1{providerId}~1{token}/post/responses/503/content/application~1problem+json/schema\"}}")], + ["previewTemplate", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/templates/{templateId}/versions/{templateVersion}/preview\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"messaging\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/405/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/422/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1templates~1{templateId}~1versions~1{templateVersion}~1preview/post/responses/503/content/application~1problem+json/schema\"}}")], ]) for (const [id, definition] of Object.entries(definitions)) { const responses: Operation["responses"] = {} diff --git a/clients/typescript/generated/render.ts b/clients/typescript/generated/render.ts index 6d767a827b..e86a890fb7 100644 --- a/clients/typescript/generated/render.ts +++ b/clients/typescript/generated/render.ts @@ -1,5 +1,5 @@ // Generated for Stack version 0.50.0, client version 0.50.0. -// Source SHA-256 3932fc501fa2ca0d8a982595fb073ee64cc218aa9726ec9cea5b09e28d938901 +// Source SHA-256 7414daee20f3e26f759964b090d3159496bb7d2b9f6bce32119ce670fd493acf import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -11,8 +11,8 @@ export interface Operations { "getReady": { input: CallOptions & { accept?: "application/json" | "*/*" }; required: false; output: ({ "status": "ready"; "posture": ("development" | "production"); "developmentSettings": (Array<({ "code": (string); "pointer"?: (string) })>); "signing"?: (Record) }) } "getOpenapiJson": { input: CallOptions & { accept?: "application/json" | "*/*" }; required: false; output: ({ "openapi": "3.1.0"; "info": ({ "title": (string); "version": (string) }); "paths": (Record) }) } "getV1DocumentTypes": { input: CallOptions & { accept?: "application/json" | "*/*" }; required: false; output: ({ "documentTypes": (Array<({ "id": (string); "version": (number); "entry": (string); "labels": (Array<(string)>); "pdfStandard": (string | null); "schema": (string | null); "seal"?: (string) })>); "projectVersion": (string); "bundleHash": (string); "rendererVersion": (string); "typstPin": (string) }) } - "postV1RenderByType": { input: CallOptions & { path: { "type": (string) } } & ({ body: ({ "locale"?: (string); "issuedAt": (string); "data": (Record); "assets"?: (Record) }) }) & { accept?: "application/pdf" | "application/json" | "*/*" }; required: true; output: WireBytes<"application/pdf"> | ({ "pdfBase64": (string); "pdfDigest": Schema_Digest; "dataDigest": Schema_Digest; "documentVersion": (string); "warnings": (Array<(string)>) }) } - "postV1SealByType": { input: CallOptions & { path: { "type": (string) } } & ({ body: ({ "locale"?: (string); "issuedAt": (string); "data": (Record); "assets"?: (Record) }) }) & { accept?: "application/pdf" | "application/json" | "*/*" }; required: true; output: WireBytes<"application/pdf"> | ({ "pdfBase64": (string); "documentDigest": Schema_Digest; "signedFileDigest": Schema_Digest; "dataDigest": Schema_Digest; "documentVersion": (string); "packageDigest": Schema_Digest; "warnings": (Array<(string)>); "seal": ({ "id": (string); "level": ("B-T" | "B-B") & (string); "certificateDigest": Schema_Digest; "timestampedAt"?: (string); "testOnly"?: true & (boolean) }) }) } + "postV1RenderByType": { input: CallOptions & { path: { "documentType": (string) } } & ({ body: ({ "locale"?: (string); "issuedAt": (string); "data": (Record); "assets"?: (Record) }) }) & { accept?: "application/pdf" | "application/json" | "*/*" }; required: true; output: WireBytes<"application/pdf"> | ({ "pdfBase64": (string); "pdfDigest": Schema_Digest; "dataDigest": Schema_Digest; "documentVersion": (string); "warnings": (Array<(string)>) }) } + "postV1SealByType": { input: CallOptions & { path: { "documentType": (string) } } & ({ body: ({ "locale"?: (string); "issuedAt": (string); "data": (Record); "assets"?: (Record) }) }) & { accept?: "application/pdf" | "application/json" | "*/*" }; required: true; output: WireBytes<"application/pdf"> | ({ "pdfBase64": (string); "documentDigest": Schema_Digest; "signedFileDigest": Schema_Digest; "dataDigest": Schema_Digest; "documentVersion": (string); "packageDigest": Schema_Digest; "warnings": (Array<(string)>); "seal": ({ "id": (string); "level": ("B-T" | "B-B") & (string); "certificateDigest": Schema_Digest; "timestampedAt"?: (string); "testOnly"?: true & (boolean) }) }) } } const rules: Record = Object.fromEntries([ @@ -25,27 +25,27 @@ const rules: Record = Object.fromEntries([ ["/paths/~1v1~1document-types/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], ["/paths/~1v1~1document-types/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], ["/paths/~1v1~1document-types/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1render~1{type}/post/responses/200/content/application~1json/schema", JSON.parse("{\"type\":\"object\",\"required\":[\"pdfBase64\",\"pdfDigest\",\"dataDigest\",\"documentVersion\",\"warnings\"],\"properties\":{\"pdfBase64\":{\"type\":\"string\"},\"pdfDigest\":{\"$ref\":\"/components/schemas/Digest\"},\"dataDigest\":{\"$ref\":\"/components/schemas/Digest\"},\"documentVersion\":{\"type\":\"string\"},\"warnings\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}}}")], - ["/paths/~1v1~1render~1{type}/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1render~1{type}/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1render~1{type}/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1render~1{type}/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1render~1{type}/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1render~1{type}/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1render~1{type}/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1render~1{type}/post/responses/504/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1seal~1{type}/post/responses/200/content/application~1json/schema", JSON.parse("{\"type\":\"object\",\"required\":[\"pdfBase64\",\"documentDigest\",\"signedFileDigest\",\"dataDigest\",\"documentVersion\",\"packageDigest\",\"warnings\",\"seal\"],\"properties\":{\"pdfBase64\":{\"type\":\"string\"},\"documentDigest\":{\"$ref\":\"/components/schemas/Digest\"},\"signedFileDigest\":{\"$ref\":\"/components/schemas/Digest\"},\"dataDigest\":{\"$ref\":\"/components/schemas/Digest\"},\"documentVersion\":{\"type\":\"string\"},\"packageDigest\":{\"$ref\":\"/components/schemas/Digest\"},\"warnings\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"seal\":{\"type\":\"object\",\"required\":[\"id\",\"level\",\"certificateDigest\"],\"properties\":{\"id\":{\"type\":\"string\"},\"level\":{\"type\":\"string\",\"enum\":[\"B-T\",\"B-B\"]},\"certificateDigest\":{\"$ref\":\"/components/schemas/Digest\"},\"timestampedAt\":{\"type\":\"string\"},\"testOnly\":{\"type\":\"boolean\",\"const\":true}}}}}")], - ["/paths/~1v1~1seal~1{type}/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1seal~1{type}/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1seal~1{type}/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1seal~1{type}/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1seal~1{type}/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1seal~1{type}/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1seal~1{type}/post/responses/429/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1seal~1{type}/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1seal~1{type}/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1seal~1{type}/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], - ["/paths/~1v1~1seal~1{type}/post/responses/504/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1render~1{documentType}/post/responses/200/content/application~1json/schema", JSON.parse("{\"type\":\"object\",\"required\":[\"pdfBase64\",\"pdfDigest\",\"dataDigest\",\"documentVersion\",\"warnings\"],\"properties\":{\"pdfBase64\":{\"type\":\"string\"},\"pdfDigest\":{\"$ref\":\"/components/schemas/Digest\"},\"dataDigest\":{\"$ref\":\"/components/schemas/Digest\"},\"documentVersion\":{\"type\":\"string\"},\"warnings\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}}}")], + ["/paths/~1v1~1render~1{documentType}/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1render~1{documentType}/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1render~1{documentType}/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1render~1{documentType}/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1render~1{documentType}/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1render~1{documentType}/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1render~1{documentType}/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1render~1{documentType}/post/responses/504/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1seal~1{documentType}/post/responses/200/content/application~1json/schema", JSON.parse("{\"type\":\"object\",\"required\":[\"pdfBase64\",\"documentDigest\",\"signedFileDigest\",\"dataDigest\",\"documentVersion\",\"packageDigest\",\"warnings\",\"seal\"],\"properties\":{\"pdfBase64\":{\"type\":\"string\"},\"documentDigest\":{\"$ref\":\"/components/schemas/Digest\"},\"signedFileDigest\":{\"$ref\":\"/components/schemas/Digest\"},\"dataDigest\":{\"$ref\":\"/components/schemas/Digest\"},\"documentVersion\":{\"type\":\"string\"},\"packageDigest\":{\"$ref\":\"/components/schemas/Digest\"},\"warnings\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"seal\":{\"type\":\"object\",\"required\":[\"id\",\"level\",\"certificateDigest\"],\"properties\":{\"id\":{\"type\":\"string\"},\"level\":{\"type\":\"string\",\"enum\":[\"B-T\",\"B-B\"]},\"certificateDigest\":{\"$ref\":\"/components/schemas/Digest\"},\"timestampedAt\":{\"type\":\"string\"},\"testOnly\":{\"type\":\"boolean\",\"const\":true}}}}}")], + ["/paths/~1v1~1seal~1{documentType}/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1seal~1{documentType}/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1seal~1{documentType}/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1seal~1{documentType}/post/responses/404/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1seal~1{documentType}/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1seal~1{documentType}/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1seal~1{documentType}/post/responses/429/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1seal~1{documentType}/post/responses/500/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1seal~1{documentType}/post/responses/502/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1seal~1{documentType}/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], + ["/paths/~1v1~1seal~1{documentType}/post/responses/504/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/Problem\"}")], ]) const routes: Record = Object.create(null) type Definition = Omit & { problems?: Record; responses: Record> } @@ -54,8 +54,8 @@ const definitions: Record = Object.fromEntries([ ["getReady", JSON.parse("{\"method\":\"GET\",\"path\":\"/ready\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1ready/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"anonymous\":true,\"mutating\":false}")], ["getOpenapiJson", JSON.parse("{\"method\":\"GET\",\"path\":\"/openapi.json\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1openapi.json/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"anonymous\":true,\"mutating\":false}")], ["getV1DocumentTypes", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/document-types\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1document-types/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"401\":\"/paths/~1v1~1document-types/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1document-types/get/responses/403/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1document-types/get/responses/503/content/application~1problem+json/schema\"}}")], - ["postV1RenderByType", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/render/{type}\",\"responses\":{\"200\":[{\"mediaType\":\"application/pdf\",\"mode\":\"binary\"},{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1render~1{type}/post/responses/200/content/application~1json/schema\"}]},\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1render~1{type}/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1render~1{type}/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1render~1{type}/post/responses/403/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1render~1{type}/post/responses/413/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1render~1{type}/post/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1render~1{type}/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1render~1{type}/post/responses/503/content/application~1problem+json/schema\",\"504\":\"/paths/~1v1~1render~1{type}/post/responses/504/content/application~1problem+json/schema\"}}")], - ["postV1SealByType", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/seal/{type}\",\"responses\":{\"200\":[{\"mediaType\":\"application/pdf\",\"mode\":\"binary\"},{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1seal~1{type}/post/responses/200/content/application~1json/schema\"}]},\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1seal~1{type}/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1seal~1{type}/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1seal~1{type}/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1seal~1{type}/post/responses/404/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1seal~1{type}/post/responses/413/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1seal~1{type}/post/responses/422/content/application~1problem+json/schema\",\"429\":\"/paths/~1v1~1seal~1{type}/post/responses/429/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1seal~1{type}/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1seal~1{type}/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1seal~1{type}/post/responses/503/content/application~1problem+json/schema\",\"504\":\"/paths/~1v1~1seal~1{type}/post/responses/504/content/application~1problem+json/schema\"}}")], + ["postV1RenderByType", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/render/{documentType}\",\"responses\":{\"200\":[{\"mediaType\":\"application/pdf\",\"mode\":\"binary\"},{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1render~1{documentType}/post/responses/200/content/application~1json/schema\"}]},\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1render~1{documentType}/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1render~1{documentType}/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1render~1{documentType}/post/responses/403/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1render~1{documentType}/post/responses/413/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1render~1{documentType}/post/responses/422/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1render~1{documentType}/post/responses/500/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1render~1{documentType}/post/responses/503/content/application~1problem+json/schema\",\"504\":\"/paths/~1v1~1render~1{documentType}/post/responses/504/content/application~1problem+json/schema\"}}")], + ["postV1SealByType", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/seal/{documentType}\",\"responses\":{\"200\":[{\"mediaType\":\"application/pdf\",\"mode\":\"binary\"},{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1seal~1{documentType}/post/responses/200/content/application~1json/schema\"}]},\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1seal~1{documentType}/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1seal~1{documentType}/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1seal~1{documentType}/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1seal~1{documentType}/post/responses/404/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1seal~1{documentType}/post/responses/413/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1seal~1{documentType}/post/responses/422/content/application~1problem+json/schema\",\"429\":\"/paths/~1v1~1seal~1{documentType}/post/responses/429/content/application~1problem+json/schema\",\"500\":\"/paths/~1v1~1seal~1{documentType}/post/responses/500/content/application~1problem+json/schema\",\"502\":\"/paths/~1v1~1seal~1{documentType}/post/responses/502/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1seal~1{documentType}/post/responses/503/content/application~1problem+json/schema\",\"504\":\"/paths/~1v1~1seal~1{documentType}/post/responses/504/content/application~1problem+json/schema\"}}")], ]) for (const [id, definition] of Object.entries(definitions)) { const responses: Operation["responses"] = {} diff --git a/clients/typescript/generated/scheduling.ts b/clients/typescript/generated/scheduling.ts index 2f02781363..d50a134da0 100644 --- a/clients/typescript/generated/scheduling.ts +++ b/clients/typescript/generated/scheduling.ts @@ -1,5 +1,5 @@ // Generated for Stack version 0.50.0, client version 0.50.0. -// Source SHA-256 5ae205e03d651d545b289c186d43e4b3e6f445f5500952f2d829ca7ca020ecd1 +// Source SHA-256 5ac404c37885cc668f9a21f9e591ee8cfd20ea1aa0b97056a004a95fa2e69571 // Unconstrained JSON /components/schemas/AppointmentHistoryEntryDocument/properties/detail import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -98,16 +98,16 @@ export interface Operations { "listAppointmentsByExternalReference": { input: CallOptions & { query: { "externalReferenceProduct": (string); "externalReferenceRecordType": (string); "externalReferenceIdentifier": (string); "cursor"?: (string); "limit"?: (number) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AppointmentPage } "createAppointment": { input: CallOptions & { headers?: { "traceparent"?: (string) } } & ({ body: Schema_CreateAppointmentRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AppointmentDocument } "readAppointmentReceipt": { input: CallOptions & { headers?: { "traceparent"?: (string) } } & { idempotencyKey: string } & ({ body: Schema_CreateAppointmentRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AppointmentDocument } - "getAppointment": { input: CallOptions & { path: { "appointment_id": (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AppointmentDocument } - "recordAttendance": { input: CallOptions & { path: { "appointment_id": (string) } } & { headers?: { "traceparent"?: (string) } } & ({ body: Schema_RecordAttendanceRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AttendanceDocument } - "cancelAppointment": { input: CallOptions & { path: { "appointment_id": (string) } } & { headers?: { "traceparent"?: (string) } } & ({ body: Schema_CancelAppointmentRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AppointmentDocument } - "listAppointmentHistory": { input: CallOptions & { path: { "appointment_id": (string) } } & { query?: { "cursor"?: (string); "limit"?: (number) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AppointmentHistoryPage } - "rescheduleAppointment": { input: CallOptions & { path: { "appointment_id": (string) } } & { headers?: { "traceparent"?: (string) } } & ({ body: Schema_RescheduleAppointmentRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AppointmentDocument } + "getAppointment": { input: CallOptions & { path: { "appointmentId": (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AppointmentDocument } + "recordAttendance": { input: CallOptions & { path: { "appointmentId": (string) } } & { headers?: { "traceparent"?: (string) } } & ({ body: Schema_RecordAttendanceRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AttendanceDocument } + "cancelAppointment": { input: CallOptions & { path: { "appointmentId": (string) } } & { headers?: { "traceparent"?: (string) } } & ({ body: Schema_CancelAppointmentRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AppointmentDocument } + "listAppointmentHistory": { input: CallOptions & { path: { "appointmentId": (string) } } & { query?: { "cursor"?: (string); "limit"?: (number) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AppointmentHistoryPage } + "rescheduleAppointment": { input: CallOptions & { path: { "appointmentId": (string) } } & { headers?: { "traceparent"?: (string) } } & ({ body: Schema_RescheduleAppointmentRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AppointmentDocument } "searchAvailability": { input: CallOptions & { query: { "offering": (string); "start"?: (string); "durationMinutes"?: (number); "resource"?: (string); "end"?: (string); "cursor"?: (string); "limit"?: (number) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AvailabilityPage } "explainAvailability": { input: CallOptions & { query: { "offering": (string); "start": (string); "durationMinutes"?: (number); "resource"?: (string) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_ExplainDocument } "previewAvailability": { input: CallOptions & { headers?: { "traceparent"?: (string) } } & ({ body: Schema_AvailabilityPreviewRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_AvailabilityPreviewDocument } "createHold": { input: CallOptions & { headers?: { "traceparent"?: (string) } } & ({ body: Schema_AdmissionRequest }) & { accept?: "application/json" | "*/*" }; required: true; output: Schema_HoldDocument } - "releaseHold": { input: CallOptions & { path: { "hold_id": (string) } } & { headers?: { "traceparent"?: (string) } }; required: true; output: undefined } + "releaseHold": { input: CallOptions & { path: { "holdId": (string) } } & { headers?: { "traceparent"?: (string) } }; required: true; output: undefined } "listLocations": { input: CallOptions & { query?: { "cursor"?: (string); "limit"?: (number) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: false; output: Schema_LocationPage } "listOfferings": { input: CallOptions & { query?: { "cursor"?: (string); "limit"?: (number) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: false; output: Schema_OfferingPage } "listOperationalAppointments": { input: CallOptions & { query: { "service": (string); "location": (string); "start": (string); "end": (string); "timeBasis": ("displayed" | "occupied") & (string); "offering"?: (string); "state"?: ("confirmed" | "cancelled") & (string); "resource"?: (string); "externalReferenceProduct"?: (string); "externalReferenceRecordType"?: (string); "externalReferenceIdentifier"?: (string); "accessProfile"?: (string); "cursor"?: (string); "limit"?: (number) } } & { headers?: { "traceparent"?: (string) } } & { accept?: "application/json" | "*/*" }; required: true; output: Schema_OperationalAppointmentPage } @@ -243,58 +243,58 @@ const rules: Record = Object.fromEntries([ ["/paths/~1v1~1appointments~1receipt/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], ["/paths/~1v1~1appointments~1receipt/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], ["/paths/~1v1~1appointments~1receipt/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/AppointmentDocument\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemPlatformTaskGrantDevelopmentAssertion\"}]}")], - ["/paths/~1v1~1appointments~1{appointment_id}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"}]}")], - ["/paths/~1v1~1appointments~1{appointment_id}/get/responses/405/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestMethodNotAllowed\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/AttendanceDocument\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemPlatformTaskGrantDevelopmentAssertion\"}]}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"}]}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/405/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestMethodNotAllowed\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/409/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/410/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRevisionMismatch\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/AppointmentDocument\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemPlatformTaskGrantDevelopmentAssertion\"}]}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"}]}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestMethodNotAllowed\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemCancellationCutoffPassed\"},{\"$ref\":\"/components/schemas/ProblemHoldReleased\"}]}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRevisionMismatch\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1history/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/AppointmentHistoryPage\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1history/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"}]}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1history/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemPlatformTaskGrantDevelopmentAssertion\"}]}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1history/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"}]}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1history/get/responses/405/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestMethodNotAllowed\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1history/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemCursorExpired\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1history/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1history/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/AppointmentDocument\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemPlatformTaskGrantDevelopmentAssertion\"}]}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"}]}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestMethodNotAllowed\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemBookingDuplicateActive\"},{\"$ref\":\"/components/schemas/ProblemCapacityExhausted\"},{\"$ref\":\"/components/schemas/ProblemLocationClosed\"},{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemHoldReleased\"}]}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemPolicyChanged\"},{\"$ref\":\"/components/schemas/ProblemRevisionMismatch\"}]}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemCapabilityUnmatched\"},{\"$ref\":\"/components/schemas/ProblemHorizonOutside\"},{\"$ref\":\"/components/schemas/ProblemPartyCapacityInadequate\"},{\"$ref\":\"/components/schemas/ProblemPrerequisiteMissing\"},{\"$ref\":\"/components/schemas/ProblemScheduleUnpublished\"}]}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], - ["/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/AppointmentDocument\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemPlatformTaskGrantDevelopmentAssertion\"}]}")], + ["/paths/~1v1~1appointments~1{appointmentId}/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"}]}")], + ["/paths/~1v1~1appointments~1{appointmentId}/get/responses/405/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestMethodNotAllowed\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/AttendanceDocument\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemPlatformTaskGrantDevelopmentAssertion\"}]}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"}]}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/405/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestMethodNotAllowed\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/409/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/410/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRevisionMismatch\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/AppointmentDocument\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemPlatformTaskGrantDevelopmentAssertion\"}]}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"}]}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestMethodNotAllowed\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemCancellationCutoffPassed\"},{\"$ref\":\"/components/schemas/ProblemHoldReleased\"}]}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRevisionMismatch\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1history/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/AppointmentHistoryPage\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1history/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"}]}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1history/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemPlatformTaskGrantDevelopmentAssertion\"}]}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1history/get/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"}]}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1history/get/responses/405/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestMethodNotAllowed\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1history/get/responses/410/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemCursorExpired\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1history/get/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1history/get/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/AppointmentDocument\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemPlatformTaskGrantDevelopmentAssertion\"}]}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"}]}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/405/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestMethodNotAllowed\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/409/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemBookingDuplicateActive\"},{\"$ref\":\"/components/schemas/ProblemCapacityExhausted\"},{\"$ref\":\"/components/schemas/ProblemLocationClosed\"},{\"$ref\":\"/components/schemas/ProblemIdempotencyKeyReused\"},{\"$ref\":\"/components/schemas/ProblemHoldReleased\"}]}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/410/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/412/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemPolicyChanged\"},{\"$ref\":\"/components/schemas/ProblemRevisionMismatch\"}]}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/415/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestUnsupportedMediaType\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemCapabilityUnmatched\"},{\"$ref\":\"/components/schemas/ProblemHorizonOutside\"},{\"$ref\":\"/components/schemas/ProblemPartyCapacityInadequate\"},{\"$ref\":\"/components/schemas/ProblemPrerequisiteMissing\"},{\"$ref\":\"/components/schemas/ProblemScheduleUnpublished\"}]}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], + ["/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], ["/paths/~1v1~1availability/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/AvailabilityPage\"}")], ["/paths/~1v1~1availability/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"}]}")], ["/paths/~1v1~1availability/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemPlatformTaskGrantDevelopmentAssertion\"}]}")], @@ -336,14 +336,14 @@ const rules: Record = Object.fromEntries([ ["/paths/~1v1~1holds/post/responses/422/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemRequestUnprocessable\"},{\"$ref\":\"/components/schemas/ProblemCapabilityUnmatched\"},{\"$ref\":\"/components/schemas/ProblemHorizonOutside\"},{\"$ref\":\"/components/schemas/ProblemPartyCapacityInadequate\"},{\"$ref\":\"/components/schemas/ProblemPrerequisiteMissing\"},{\"$ref\":\"/components/schemas/ProblemScheduleUnpublished\"}]}")], ["/paths/~1v1~1holds/post/responses/428/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemPreconditionRequired\"}")], ["/paths/~1v1~1holds/post/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], - ["/paths/~1v1~1holds~1{hold_id}/delete/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"}")], - ["/paths/~1v1~1holds~1{hold_id}/delete/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemPlatformTaskGrantDevelopmentAssertion\"}]}")], - ["/paths/~1v1~1holds~1{hold_id}/delete/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"}]}")], - ["/paths/~1v1~1holds~1{hold_id}/delete/responses/405/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestMethodNotAllowed\"}")], - ["/paths/~1v1~1holds~1{hold_id}/delete/responses/409/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemHoldReleased\"}")], - ["/paths/~1v1~1holds~1{hold_id}/delete/responses/410/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"}")], - ["/paths/~1v1~1holds~1{hold_id}/delete/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], - ["/paths/~1v1~1holds~1{hold_id}/delete/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], + ["/paths/~1v1~1holds~1{holdId}/delete/responses/400/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"}")], + ["/paths/~1v1~1holds~1{holdId}/delete/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemPlatformTaskGrantDevelopmentAssertion\"}]}")], + ["/paths/~1v1~1holds~1{holdId}/delete/responses/403/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemProfileNotAuthorized\"},{\"$ref\":\"/components/schemas/ProblemOperationNotAuthorized\"}]}")], + ["/paths/~1v1~1holds~1{holdId}/delete/responses/405/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestMethodNotAllowed\"}")], + ["/paths/~1v1~1holds~1{holdId}/delete/responses/409/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemHoldReleased\"}")], + ["/paths/~1v1~1holds~1{holdId}/delete/responses/410/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemIdempotencyExpired\"}")], + ["/paths/~1v1~1holds~1{holdId}/delete/responses/413/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemRequestBodyTooLarge\"}")], + ["/paths/~1v1~1holds~1{holdId}/delete/responses/503/content/application~1problem+json/schema", JSON.parse("{\"$ref\":\"/components/schemas/ProblemServiceUnavailable\"}")], ["/paths/~1v1~1locations/get/responses/200/content/application~1json/schema", JSON.parse("{\"$ref\":\"/components/schemas/LocationPage\"}")], ["/paths/~1v1~1locations/get/responses/400/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemRequestInvalid\"},{\"$ref\":\"/components/schemas/ProblemCursorInvalid\"}]}")], ["/paths/~1v1~1locations/get/responses/401/content/application~1problem+json/schema", JSON.parse("{\"oneOf\":[{\"$ref\":\"/components/schemas/ProblemAuthenticationRefused\"},{\"$ref\":\"/components/schemas/ProblemPlatformTaskGrantDevelopmentAssertion\"}]}")], @@ -421,16 +421,16 @@ const definitions: Record = Object.fromEntries([ ["listAppointmentsByExternalReference", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/appointments\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1appointments/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1appointments/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1appointments/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1appointments/get/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1appointments/get/responses/405/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1appointments/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1appointments/get/responses/413/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1appointments/get/responses/503/content/application~1problem+json/schema\"}}")], ["createAppointment", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/appointments\",\"responses\":{\"201\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1appointments/post/responses/201/content/application~1json/schema\"}]},\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1appointments/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1appointments/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1appointments/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1appointments/post/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1appointments/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1appointments/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1appointments/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1appointments/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1appointments/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1appointments/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1appointments/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1appointments/post/responses/428/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1appointments/post/responses/503/content/application~1problem+json/schema\"}}")], ["readAppointmentReceipt", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/appointments/receipt\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1appointments~1receipt/post/responses/200/content/application~1json/schema\"}]},\"keyed\":true,\"requiresExistingKey\":true,\"mutating\":false,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1appointments~1receipt/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1appointments~1receipt/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1appointments~1receipt/post/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1appointments~1receipt/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1appointments~1receipt/post/responses/409/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1appointments~1receipt/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1appointments~1receipt/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1appointments~1receipt/post/responses/422/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1appointments~1receipt/post/responses/503/content/application~1problem+json/schema\"}}")], - ["getAppointment", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/appointments/{appointment_id}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1appointments~1{appointment_id}/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1appointments~1{appointment_id}/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1appointments~1{appointment_id}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1appointments~1{appointment_id}/get/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1appointments~1{appointment_id}/get/responses/405/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1appointments~1{appointment_id}/get/responses/413/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1appointments~1{appointment_id}/get/responses/503/content/application~1problem+json/schema\"}}")], - ["recordAttendance", JSON.parse("{\"method\":\"PUT\",\"path\":\"/v1/appointments/{appointment_id}/attendance\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/200/content/application~1json/schema\"}]},\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/422/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1appointments~1{appointment_id}~1attendance/put/responses/503/content/application~1problem+json/schema\"}}")], - ["cancelAppointment", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/appointments/{appointment_id}/cancel\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/200/content/application~1json/schema\"}]},\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/422/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1appointments~1{appointment_id}~1cancel/post/responses/503/content/application~1problem+json/schema\"}}")], - ["listAppointmentHistory", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/appointments/{appointment_id}/history\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1appointments~1{appointment_id}~1history/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1appointments~1{appointment_id}~1history/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1appointments~1{appointment_id}~1history/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1appointments~1{appointment_id}~1history/get/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1appointments~1{appointment_id}~1history/get/responses/405/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1appointments~1{appointment_id}~1history/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1appointments~1{appointment_id}~1history/get/responses/413/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1appointments~1{appointment_id}~1history/get/responses/503/content/application~1problem+json/schema\"}}")], - ["rescheduleAppointment", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/appointments/{appointment_id}/reschedule\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/200/content/application~1json/schema\"}]},\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/428/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1appointments~1{appointment_id}~1reschedule/post/responses/503/content/application~1problem+json/schema\"}}")], + ["getAppointment", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/appointments/{appointmentId}\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1appointments~1{appointmentId}/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1appointments~1{appointmentId}/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1appointments~1{appointmentId}/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1appointments~1{appointmentId}/get/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1appointments~1{appointmentId}/get/responses/405/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1appointments~1{appointmentId}/get/responses/413/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1appointments~1{appointmentId}/get/responses/503/content/application~1problem+json/schema\"}}")], + ["recordAttendance", JSON.parse("{\"method\":\"PUT\",\"path\":\"/v1/appointments/{appointmentId}/attendance\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/200/content/application~1json/schema\"}]},\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/422/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1appointments~1{appointmentId}~1attendance/put/responses/503/content/application~1problem+json/schema\"}}")], + ["cancelAppointment", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/appointments/{appointmentId}/cancel\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/200/content/application~1json/schema\"}]},\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/422/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1appointments~1{appointmentId}~1cancel/post/responses/503/content/application~1problem+json/schema\"}}")], + ["listAppointmentHistory", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/appointments/{appointmentId}/history\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1appointments~1{appointmentId}~1history/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1appointments~1{appointmentId}~1history/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1appointments~1{appointmentId}~1history/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1appointments~1{appointmentId}~1history/get/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1appointments~1{appointmentId}~1history/get/responses/405/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1appointments~1{appointmentId}~1history/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1appointments~1{appointmentId}~1history/get/responses/413/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1appointments~1{appointmentId}~1history/get/responses/503/content/application~1problem+json/schema\"}}")], + ["rescheduleAppointment", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/appointments/{appointmentId}/reschedule\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/200/content/application~1json/schema\"}]},\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/428/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1appointments~1{appointmentId}~1reschedule/post/responses/503/content/application~1problem+json/schema\"}}")], ["searchAvailability", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/availability\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1availability/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1availability/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1availability/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1availability/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1availability/get/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1availability/get/responses/405/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1availability/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1availability/get/responses/413/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1availability/get/responses/503/content/application~1problem+json/schema\"}}")], ["explainAvailability", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/availability/explain\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1availability~1explain/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1availability~1explain/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1availability~1explain/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1availability~1explain/get/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1availability~1explain/get/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1availability~1explain/get/responses/405/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1availability~1explain/get/responses/413/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1availability~1explain/get/responses/503/content/application~1problem+json/schema\"}}")], ["previewAvailability", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/availability/preview\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1availability~1preview/post/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1availability~1preview/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1availability~1preview/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1availability~1preview/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1availability~1preview/post/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1availability~1preview/post/responses/405/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1availability~1preview/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1availability~1preview/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1availability~1preview/post/responses/422/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1availability~1preview/post/responses/503/content/application~1problem+json/schema\"}}")], ["createHold", JSON.parse("{\"method\":\"POST\",\"path\":\"/v1/holds\",\"responses\":{\"201\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1holds/post/responses/201/content/application~1json/schema\"}]},\"keyed\":true,\"mutating\":true,\"requestMediaTypes\":[\"application/json\"],\"requestMediaType\":\"application/json\",\"problems\":{\"400\":\"/paths/~1v1~1holds/post/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1holds/post/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1holds/post/responses/403/content/application~1problem+json/schema\",\"404\":\"/paths/~1v1~1holds/post/responses/404/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1holds/post/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1holds/post/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1holds/post/responses/410/content/application~1problem+json/schema\",\"412\":\"/paths/~1v1~1holds/post/responses/412/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1holds/post/responses/413/content/application~1problem+json/schema\",\"415\":\"/paths/~1v1~1holds/post/responses/415/content/application~1problem+json/schema\",\"422\":\"/paths/~1v1~1holds/post/responses/422/content/application~1problem+json/schema\",\"428\":\"/paths/~1v1~1holds/post/responses/428/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1holds/post/responses/503/content/application~1problem+json/schema\"}}")], - ["releaseHold", JSON.parse("{\"method\":\"DELETE\",\"path\":\"/v1/holds/{hold_id}\",\"responses\":{\"204\":[{\"mode\":\"empty\"}]},\"keyed\":false,\"mutating\":true,\"problems\":{\"400\":\"/paths/~1v1~1holds~1{hold_id}/delete/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1holds~1{hold_id}/delete/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1holds~1{hold_id}/delete/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1holds~1{hold_id}/delete/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1holds~1{hold_id}/delete/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1holds~1{hold_id}/delete/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1holds~1{hold_id}/delete/responses/413/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1holds~1{hold_id}/delete/responses/503/content/application~1problem+json/schema\"}}")], + ["releaseHold", JSON.parse("{\"method\":\"DELETE\",\"path\":\"/v1/holds/{holdId}\",\"responses\":{\"204\":[{\"mode\":\"empty\"}]},\"keyed\":false,\"mutating\":true,\"problems\":{\"400\":\"/paths/~1v1~1holds~1{holdId}/delete/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1holds~1{holdId}/delete/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1holds~1{holdId}/delete/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1holds~1{holdId}/delete/responses/405/content/application~1problem+json/schema\",\"409\":\"/paths/~1v1~1holds~1{holdId}/delete/responses/409/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1holds~1{holdId}/delete/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1holds~1{holdId}/delete/responses/413/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1holds~1{holdId}/delete/responses/503/content/application~1problem+json/schema\"}}")], ["listLocations", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/locations\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1locations/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1locations/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1locations/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1locations/get/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1locations/get/responses/405/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1locations/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1locations/get/responses/413/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1locations/get/responses/503/content/application~1problem+json/schema\"}}")], ["listOfferings", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/offerings\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1offerings/get/responses/200/content/application~1json/schema\"}]},\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1offerings/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1offerings/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1offerings/get/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1offerings/get/responses/405/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1offerings/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1offerings/get/responses/413/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1offerings/get/responses/503/content/application~1problem+json/schema\"}}")], ["listOperationalAppointments", JSON.parse("{\"method\":\"GET\",\"path\":\"/v1/operational/appointments\",\"responses\":{\"200\":[{\"mediaType\":\"application/json\",\"mode\":\"json\",\"rule\":\"/paths/~1v1~1operational~1appointments/get/responses/200/content/application~1json/schema\"}]},\"accessProfileParameter\":true,\"keyed\":false,\"mutating\":false,\"problems\":{\"400\":\"/paths/~1v1~1operational~1appointments/get/responses/400/content/application~1problem+json/schema\",\"401\":\"/paths/~1v1~1operational~1appointments/get/responses/401/content/application~1problem+json/schema\",\"403\":\"/paths/~1v1~1operational~1appointments/get/responses/403/content/application~1problem+json/schema\",\"405\":\"/paths/~1v1~1operational~1appointments/get/responses/405/content/application~1problem+json/schema\",\"410\":\"/paths/~1v1~1operational~1appointments/get/responses/410/content/application~1problem+json/schema\",\"413\":\"/paths/~1v1~1operational~1appointments/get/responses/413/content/application~1problem+json/schema\",\"503\":\"/paths/~1v1~1operational~1appointments/get/responses/503/content/application~1problem+json/schema\"}}")], diff --git a/clients/typescript/tests/adapter.test.ts b/clients/typescript/tests/adapter.test.ts index 9b9666c609..f50c3b075c 100644 --- a/clients/typescript/tests/adapter.test.ts +++ b/clients/typescript/tests/adapter.test.ts @@ -99,7 +99,7 @@ test('Adapter acquires a fresh bearer per call, reads the effective contract and assert.equal(contract.data.contract.protocolProblems.problems[1].code, 'adapter.contract.unavailable') const person = await client.call('records-get.person', { - path: { record_id: 'person-1' }, + path: { recordId: 'person-1' }, headers: { 'x-registry-adapter-contract': digest }, }) assert.equal(person.data.data.recordId, 'person-1') @@ -157,7 +157,7 @@ test('Adapter writes send generated or caller-supplied Idempotency-Key and optio assert.equal(replayed.idempotencyKey, created.idempotencyKey) const updated = await client.call('records-update.person', { - path: { record_id: 'person-1' }, + path: { recordId: 'person-1' }, body, idempotencyKey: 'caller-update-key', }) @@ -215,7 +215,7 @@ test('Adapter decodes profile and protocol problem+json failures into RegistryEr })) await assert.rejects( - client.call('records-get.person', { path: { record_id: 'missing' } }), + client.call('records-get.person', { path: { recordId: 'missing' } }), (error: unknown) => error instanceof RegistryError && error.kind === 'refused' && error.status === 404 @@ -241,7 +241,7 @@ test('Adapter decodes profile and protocol problem+json failures into RegistryEr await assert.rejects( client.call('records-get.person', { - path: { record_id: 'person-1' }, + path: { recordId: 'person-1' }, headers: { 'x-registry-adapter-contract': digest }, }), (error: unknown) => error instanceof RegistryError @@ -261,7 +261,7 @@ test('Adapter decodes profile and protocol problem+json failures into RegistryEr ) await assert.rejects( - client.call('records-get.person', { path: { record_id: 'person-1' } }), + client.call('records-get.person', { path: { recordId: 'person-1' } }), (error: unknown) => error instanceof RegistryError && error.kind === 'unreachable' && error.status === 503 @@ -357,7 +357,7 @@ test('Adapter readOnly POST classifies dispatch failures and 5xx answers as know function typeChecks(client: Client) { // @ts-expect-error operation IDs come from the Adapter project contract. client.call('records-delete.person') - // @ts-expect-error record_id is required on records-get.person. + // @ts-expect-error recordId is required on records-get.person. client.call('records-get.person') // @ts-expect-error org_unit is required by the person record schema. client.call('records-create.person', { body: { data: { recordId: 'p-1', domainData: { tracked_entity_type: 'person' } } } }) diff --git a/clients/typescript/tests/casework.test.ts b/clients/typescript/tests/casework.test.ts index 0c1ddaa829..cdf5d1d2cf 100644 --- a/clients/typescript/tests/casework.test.ts +++ b/clients/typescript/tests/casework.test.ts @@ -4,8 +4,8 @@ import { Transport } from '../core.ts' import { Client } from '../generated/casework.ts' const id = '00000000-0000-4000-8000-000000000001' -const request = { request_id: id } -const ask = { ...request, ask_id: id } +const request = { requestId: id } +const ask = { ...request, askId: id } const traceId = '0123456789abcdef0123456789abcdef' const traceparent = '00-' + traceId + '-0123456789abcdef-01' @@ -26,7 +26,7 @@ const calls = [ subject: { digest: 'sha256:' + '0'.repeat(64), id, source: 'fixture', type: 'fixture', version: '1' }, }, })], - ['getReviewDecisionDraft', 404, (c: Client) => c.call('getReviewDecisionDraft', { path: { task_id: id } })], + ['getReviewDecisionDraft', 404, (c: Client) => c.call('getReviewDecisionDraft', { path: { taskId: id } })], ['getReviewResult', 404, (c: Client) => c.call('getReviewResult', { path: request })], ['getReviewResult', 410, (c: Client) => c.call('getReviewResult', { path: request })], ] as const diff --git a/clients/typescript/tests/generate-project.test.ts b/clients/typescript/tests/generate-project.test.ts index a56312724b..6491d2a3dc 100644 --- a/clients/typescript/tests/generate-project.test.ts +++ b/clients/typescript/tests/generate-project.test.ts @@ -266,7 +266,7 @@ const page = createRegistryClient({ baseUrl: 'https://registry.example' }) // @ts-expect-error Adapter members are server-only void page.tracker const server = createRegistryServerClient({ baseUrl: 'https://registry.example', token: () => 'fixture' }) -void server.tracker.call('records-get.person', { path: { record_id: 'p1' } }) +void server.tracker.call('records-get.person', { path: { recordId: 'p1' } }) `) checkServiceTypes(dir, 'app/check.ts') // Verify runtime server-only isolation and route prefix dispatch. @@ -290,7 +290,7 @@ void server.tracker.call('records-get.person', { path: { record_id: 'p1' } }) }, }) assert.equal('tracker' in server, true) - const answer = await server.tracker.call('records-get.person', { path: { record_id: 'p1' } }) + const answer = await server.tracker.call('records-get.person', { path: { recordId: 'p1' } }) assert.equal(seenUrl, 'https://registry.example/legacy/v1/records/person/p1') assert.equal(answer.data.data.recordId, 'p1') }) diff --git a/clients/typescript/tests/live/products.live.ts b/clients/typescript/tests/live/products.live.ts index 85488bea88..d741c6f427 100644 --- a/clients/typescript/tests/live/products.live.ts +++ b/clients/typescript/tests/live/products.live.ts @@ -296,7 +296,7 @@ export function registerServerLiveMatrix( assert.ok(created.data.reference.length > 0) const status = await client.call('readSessionStatus', { - path: { reference: created.data.reference }, + path: { sessionReference: created.data.reference }, }) assert.equal(status.status, 200) assert.equal(status.data.status, 'pending') @@ -337,11 +337,11 @@ export function registerServerLiveMatrix( }) assert.equal(receipt.data.id, submitted.data.id) - const fetched = await client.call('getMessage', { path: { message_id: submitted.data.id } }) + const fetched = await client.call('getMessage', { path: { messageId: submitted.data.id } }) assert.equal(fetched.data.id, submitted.data.id) const anon = new MessagingClient(new Transport({ baseUrl: manifest.products.messaging, token: () => undefined })) - await expectUnauthorized(anon.call('getMessage', { path: { message_id: submitted.data.id } })) + await expectUnauthorized(anon.call('getMessage', { path: { messageId: submitted.data.id } })) }) register(`${tag} Scheduling: read offerings and availability, task-grant refusal on keyed hold, and 401 refusal`, async () => { @@ -421,7 +421,7 @@ export function registerServerLiveMatrix( }, } const rendered = await client.call('postV1RenderByType', { - path: { type: manifest.metadata.renderDocumentType }, + path: { documentType: manifest.metadata.renderDocumentType }, body: renderBody, accept: 'application/json', }) @@ -430,7 +430,7 @@ export function registerServerLiveMatrix( assert.ok('pdfDigest' in rendered.data) const replayed = await client.call('postV1RenderByType', { - path: { type: manifest.metadata.renderDocumentType }, + path: { documentType: manifest.metadata.renderDocumentType }, body: renderBody, accept: 'application/json', idempotencyKey: rendered.idempotencyKey, @@ -485,7 +485,7 @@ export function registerServerLiveMatrix( assert.equal(contract.data.digest, manifest.adapter.contractDigest) const person = await reader.call('records-get.person', { - path: { record_id: manifest.adapter.personRecordId }, + path: { recordId: manifest.adapter.personRecordId }, headers: { 'x-registry-adapter-contract': contract.data.digest }, }) assert.equal(person.status, 200) @@ -552,7 +552,7 @@ export function registerServerLiveMatrix( assert.ok(tools.some(tool => tool.name === manifest.metadata.mcpToolName)) const result = await mcp.callTool(manifest.metadata.mcpToolName, { - path: { record_id: manifest.adapter.personRecordId }, + path: { recordId: manifest.adapter.personRecordId }, }) assert.ok(result.structuredContent && typeof result.structuredContent === 'object') const structured = result.structuredContent as { diff --git a/clients/typescript/tests/media.test.ts b/clients/typescript/tests/media.test.ts index b6895891cc..124a79f573 100644 --- a/clients/typescript/tests/media.test.ts +++ b/clients/typescript/tests/media.test.ts @@ -60,7 +60,7 @@ test('bodyless response retains status and rejects a transmitted body', async () assert.equal(new Headers(init?.headers).has('idempotency-key'), false) return new Response(null, { status: 204 }) })) - const result = await scheduling.call('releaseHold', { path: { hold_id: 'fixture' } }) + const result = await scheduling.call('releaseHold', { path: { holdId: 'fixture' } }) assert.equal(result.data, undefined) assert.equal(result.status, 204) assert.equal(result.idempotencyKey, undefined) diff --git a/clients/typescript/tests/oid4vp.test.ts b/clients/typescript/tests/oid4vp.test.ts index 18f798aa07..d5f9a69d69 100644 --- a/clients/typescript/tests/oid4vp.test.ts +++ b/clients/typescript/tests/oid4vp.test.ts @@ -54,13 +54,13 @@ test('OID4VP acquires a fresh bearer only for protected operations', async () => })) assert.deepEqual((await client.call('createPresentationSession', { body: { policy: 'licence' } })).data, session) - assert.equal((await client.call('readSessionStatus', { path: { reference } })).data.status, 'pending') + assert.equal((await client.call('readSessionStatus', { path: { sessionReference: reference } })).data.status, 'pending') assert.deepEqual((await client.call('readPresentation', { body: { reference, principal } })).data.presentation, {}) assert.equal((await client.call('getDidDocument')).data.id, 'did:web:verifier.example') assert.equal((await client.call('getVerifierKeys')).data.keys[0]?.kid, 'fixture') - assert.equal((await client.call('fetchRequestObject', { path: { request_id: 'req' } })).data.text, 'fixture.jwt') + assert.equal((await client.call('fetchRequestObject', { path: { requestId: 'req' } })).data.text, 'fixture.jwt') assert.deepEqual((await client.call('receiveWalletResponse', { - path: { request_id: 'req' }, body: 'state=fixture&error=access_denied', + path: { requestId: 'req' }, body: 'state=fixture&error=access_denied', })).data, {}) assert.equal((await client.call('health')).data.status, 'ok') assert.equal((await client.call('readiness')).data.status, 'ready') @@ -73,7 +73,7 @@ test('OID4VP returns request-object problem details on RegistryError', async () baseUrl: 'https://verifier.example', fetch: async () => Response.json(problem, { status: 404, headers: { 'content-type': 'application/problem+json' } }), })) - await assert.rejects(client.call('fetchRequestObject', { path: { request_id: 'missing' } }), + await assert.rejects(client.call('fetchRequestObject', { path: { requestId: 'missing' } }), (error: unknown) => error instanceof RegistryError && error.status === 404 && error.problem?.title === problem.title) }) @@ -88,21 +88,21 @@ test('OID4VP exposes wallet OAuth errors and the consumed wallet error category' for (status of [400, 429, 503]) { payload = { error: status === 400 ? 'invalid_request' : 'temporarily_unavailable' } await assert.rejects(client.call('receiveWalletResponse', { - path: { request_id: 'req' }, body: 'state=fixture', + path: { requestId: 'req' }, body: 'state=fixture', }), (error: unknown) => error instanceof RegistryError && error.status === status && error.kind === (status === 503 ? 'unreachable' : 'refused') && error.oauthError === payload.error) } for (status of [400, 429, 503]) { payload = { error: status === 400 ? 'invalid_request' : 'temporarily_unavailable', failedCheck: 'rate-limit' } await assert.rejects(client.call('receiveWalletResponse', { - path: { request_id: 'req' }, body: 'state=fixture', + path: { requestId: 'req' }, body: 'state=fixture', }), (error: unknown) => error instanceof RegistryError && error.oauthError === (status === 429 ? payload.error : undefined)) } status = 429 payload = { error: 'unknown_error' } await assert.rejects(client.call('receiveWalletResponse', { - path: { request_id: 'req' }, body: 'state=fixture', + path: { requestId: 'req' }, body: 'state=fixture', }), (error: unknown) => error instanceof RegistryError && error.kind === 'unexpected' && error.oauthError === undefined) status = 422 diff --git a/clients/typescript/tests/render.test.ts b/clients/typescript/tests/render.test.ts index 4867ce6250..3ef983e7fe 100644 --- a/clients/typescript/tests/render.test.ts +++ b/clients/typescript/tests/render.test.ts @@ -39,8 +39,8 @@ test('Render renders and seals bytes, correlates calls, and refreshes bearer cre assert.equal((await client.call('getHealth')).data.status, 'ok') assert.equal((await client.call('getReady')).data.status, 'ready') assert.equal((await client.call('getV1DocumentTypes')).data.documentTypes[0]?.id, 'notice') - const rendered = await client.call('postV1RenderByType', { path: { type: 'notice' }, body }) - const sealed = await client.call('postV1SealByType', { path: { type: 'notice' }, body, idempotencyKey: 'caller-key' }) + const rendered = await client.call('postV1RenderByType', { path: { documentType: 'notice' }, body }) + const sealed = await client.call('postV1SealByType', { path: { documentType: 'notice' }, body, idempotencyKey: 'caller-key' }) assert.deepEqual(rendered.data, { bytes: pdf, mediaType: 'application/pdf' }) assert.deepEqual(sealed.data, rendered.data) assert.equal(rendered.idempotencyKey, keys[0]) @@ -59,7 +59,7 @@ test('Render decodes an invalid render request to RegistryError', async () => { } }), })) await assert.rejects(client.call('postV1RenderByType', { - path: { type: 'notice' }, body: { issuedAt: '2026-01-01T00:00:00Z', data: {} }, + path: { documentType: 'notice' }, body: { issuedAt: '2026-01-01T00:00:00Z', data: {} }, }), (error: unknown) => error instanceof RegistryError && error.status === 400 && error.code === problem.code) }) @@ -77,7 +77,7 @@ test('Render bounds negotiated JSON responses and decodes both envelopes', async return Response.json({ ...(String(url).includes('/seal/') ? sealed : envelope), extra }) }, })) - const values = { path: { type: 'notice' }, body: { issuedAt: '2026-01-01T00:00:00Z', data: {} }, + const values = { path: { documentType: 'notice' }, body: { issuedAt: '2026-01-01T00:00:00Z', data: {} }, accept: 'application/json' as const } for (const operation of ['postV1RenderByType', 'postV1SealByType'] as const) { extra = '' @@ -113,7 +113,7 @@ test('Render exposes anonymous OpenAPI and preserves inventory and seal refusals } status = 404 await assert.rejects(client.call('postV1SealByType', { - path: { type: 'notice' }, body: { issuedAt: '2026-01-01T00:00:00Z', data: {} }, + path: { documentType: 'notice' }, body: { issuedAt: '2026-01-01T00:00:00Z', data: {} }, }), (error: unknown) => error instanceof RegistryError && error.kind === 'refused' && error.code === problem.code) }) @@ -132,7 +132,7 @@ test('A moving Render JSON response keeps the whole-call deadline', async () => const stop = setTimeout(() => caller.abort(), 500) try { await assert.rejects(client.call('postV1RenderByType', { - path: { type: 'notice' }, body: { issuedAt: '2026-01-01T00:00:00Z', data: {} }, + path: { documentType: 'notice' }, body: { issuedAt: '2026-01-01T00:00:00Z', data: {} }, accept: 'application/json', signal: caller.signal, }), (error: unknown) => error instanceof RegistryError && error.reason === 'timeout' && error.status === 200) } finally { diff --git a/clients/typescript/tests/service.test.ts b/clients/typescript/tests/service.test.ts index 382d3a85bc..99c287ebcc 100644 --- a/clients/typescript/tests/service.test.ts +++ b/clients/typescript/tests/service.test.ts @@ -443,7 +443,7 @@ for (const withAdapter of [false, true]) { facility: { routePrefix: '/facilities', profile: 'facility-correction-applier' }, } }) const noDefault = create({ baseUrl, fetch }) - const release = { path: { task_id: 'task-1' }, headers: { 'If-Match': '"revision-1"' } } + const release = { path: { taskId: 'task-1' }, headers: { 'If-Match': '"revision-1"' } } const query = { service: 'service-1', location: 'location-1', start: '2026-01-01T00:00:00Z', end: '2026-01-02T00:00:00Z', timeBasis: 'displayed', diff --git a/crates/registry-adapter-core/src/profile.rs b/crates/registry-adapter-core/src/profile.rs index 52d5460c5b..bfc82d5676 100644 --- a/crates/registry-adapter-core/src/profile.rs +++ b/crates/registry-adapter-core/src/profile.rs @@ -593,6 +593,41 @@ impl AdapterProfile { pub fn is_govstack_consultation(&self) -> bool { self.origin == ProfileOrigin::BuiltInGovStack } + + /// Name a parameter in a generated contract. The native Registry Record + /// profile uses a lower-camel public name for its authored capture alias. + #[must_use] + pub fn published_path_parameter<'a>( + &self, + operation: &ProfileOperation, + name: &'a str, + ) -> &'a str { + if self.id.as_str() == "breg-records" + && self.version == "1" + && operation.path == "/v1/records/{type}/{record_id}" + && operation.record_id_parameter.as_ref().map(LocalId::as_str) == Some("record_id") + && name == "record_id" + { + "recordId" + } else { + name + } + } + + /// Project the native parameter spelling after the record type is bound. + #[must_use] + pub fn published_operation_path( + &self, + operation: &ProfileOperation, + concrete: String, + ) -> String { + let name = self.published_path_parameter(operation, "record_id"); + if name == "record_id" { + concrete + } else { + concrete.replace("{record_id}", &format!("{{{name}}}")) + } + } } /// A path-parameter list is omitted from the wire when empty, the shape diff --git a/crates/registry-adapter-engine/src/effective_contract.rs b/crates/registry-adapter-engine/src/effective_contract.rs index 94cd51fd0e..0b41083b74 100644 --- a/crates/registry-adapter-engine/src/effective_contract.rs +++ b/crates/registry-adapter-engine/src/effective_contract.rs @@ -394,7 +394,14 @@ fn effective_operation( binding_id: served.binding.clone(), profile_operation_id: served.operation.clone(), method: method_name(served.method), - path: target.map_or(concrete_path, |target| target.path.clone()), + path: target.map_or_else( + || { + loaded + .profile + .published_operation_path(profile, concrete_path) + }, + |target| target.path.clone(), + ), support: "served", effect: operation_effect(profile.method, profile.read_only), success_status: profile.success_status.get(), @@ -404,7 +411,7 @@ fn effective_operation( .map(|_| served.request_maximum_bytes), input: OperationInput { path: target.map_or_else( - || path_schema(profile, served), + || path_schema(&loaded.profile, profile, served), |target| target.path_parameters.clone(), ), query: query_schema(served), @@ -514,17 +521,19 @@ fn closed_object(properties: Map, mut required: Vec) -> V } fn path_schema( - profile: ®istry_adapter_core::ProfileOperation, + profile: ®istry_adapter_core::AdapterProfile, + operation: ®istry_adapter_core::ProfileOperation, served: &ServedOperation, ) -> Value { let mut properties = Map::new(); let mut required = Vec::new(); - for parameter in &profile.path_parameters { + for parameter in &operation.path_parameters { if parameter.as_str() == served.record_type_parameter { continue; } - properties.insert(parameter.as_str().to_owned(), path_segment_schema()); - required.push(parameter.as_str().to_owned()); + let name = profile.published_path_parameter(operation, parameter.as_str()); + properties.insert(name.to_owned(), path_segment_schema()); + required.push(name.to_owned()); } closed_object(properties, required) } diff --git a/crates/registry-adapter/src/payments/http.rs b/crates/registry-adapter/src/payments/http.rs index 436e74b0eb..c9541f8bcc 100644 --- a/crates/registry-adapter/src/payments/http.rs +++ b/crates/registry-adapter/src/payments/http.rs @@ -102,7 +102,7 @@ pub fn contract(config: &PaymentsConfig) -> serde_json::Value { "DisbursementStatus":schemars::schema_for!(DisbursementStatus), "RecordProviderConfirmation":schemars::schema_for!(RecordProviderConfirmation), "ProviderConfirmation":schemars::schema_for!(ProviderConfirmation), - "PaymentProblem":schemars::schema_for!(PaymentProblem) + "PaymentProblem":registry_payment_protocol::payment_problem_schema() } }) } @@ -1673,7 +1673,10 @@ mod tests { assert_eq!(body["title"], expected_code, "{body}"); assert_eq!( body["type"], - format!("urn:registry:problem:{expected_code}"), + format!( + "{}{expected_code}", + registry_adapter_core::ADAPTER_PROBLEM_TYPE_BASE + ), "{body}" ); let after = recorder.counter().get(&[check.as_str()]).unwrap_or(0); diff --git a/crates/registry-adapter/tests/effective_contract.rs b/crates/registry-adapter/tests/effective_contract.rs index 9d62331e4e..be9dcd57dc 100644 --- a/crates/registry-adapter/tests/effective_contract.rs +++ b/crates/registry-adapter/tests/effective_contract.rs @@ -291,7 +291,19 @@ fn export_contains_only_effectively_served_reads_and_names_unserved_writes() { .iter() .find(|operation| operation["id"] == "records-get.person") .expect("get operation"); - let record_id = &get["input"]["path"]["properties"]["record_id"]; + assert_eq!(get["path"], "/v1/records/person/{recordId}"); + assert_eq!( + get["input"]["path"]["required"], + serde_json::json!(["recordId"]) + ); + assert_eq!( + get["input"]["path"]["properties"] + .as_object() + .unwrap() + .len(), + 1 + ); + let record_id = &get["input"]["path"]["properties"]["recordId"]; assert_eq!(record_id["minLength"], 1); assert_eq!( record_id["not"]["anyOf"][0]["enum"], diff --git a/crates/registry-adapter/tests/golden/payment_refusals.json b/crates/registry-adapter/tests/golden/payment_refusals.json index 506f54fefa..aad5c926f4 100644 --- a/crates/registry-adapter/tests/golden/payment_refusals.json +++ b/crates/registry-adapter/tests/golden/payment_refusals.json @@ -4,7 +4,7 @@ "code": "adapter.payment.forbidden", "status": 403, "title": "adapter.payment.forbidden", - "type": "urn:registry:problem:adapter.payment.forbidden" + "type": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.forbidden" }, "cache-control": "no-store", "content-type": "application/problem+json", @@ -19,7 +19,7 @@ "code": "adapter.payment.authentication-required", "status": 401, "title": "adapter.payment.authentication-required", - "type": "urn:registry:problem:adapter.payment.authentication-required" + "type": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.authentication-required" }, "cache-control": "no-store", "content-type": "application/problem+json", @@ -34,7 +34,7 @@ "code": "adapter.payment.forbidden", "status": 403, "title": "adapter.payment.forbidden", - "type": "urn:registry:problem:adapter.payment.forbidden" + "type": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.forbidden" }, "cache-control": "no-store", "content-type": "application/problem+json", @@ -49,7 +49,7 @@ "code": "adapter.payment.authentication-required", "status": 401, "title": "adapter.payment.authentication-required", - "type": "urn:registry:problem:adapter.payment.authentication-required" + "type": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.authentication-required" }, "cache-control": "no-store", "content-type": "application/problem+json", @@ -64,7 +64,7 @@ "code": "adapter.payment.authentication-required", "status": 401, "title": "adapter.payment.authentication-required", - "type": "urn:registry:problem:adapter.payment.authentication-required" + "type": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.authentication-required" }, "cache-control": "no-store", "content-type": "application/problem+json", @@ -79,7 +79,7 @@ "code": "adapter.payment.authentication-required", "status": 401, "title": "adapter.payment.authentication-required", - "type": "urn:registry:problem:adapter.payment.authentication-required" + "type": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.authentication-required" }, "cache-control": "no-store", "content-type": "application/problem+json", @@ -94,7 +94,7 @@ "code": "adapter.payment.authentication-required", "status": 401, "title": "adapter.payment.authentication-required", - "type": "urn:registry:problem:adapter.payment.authentication-required" + "type": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.authentication-required" }, "cache-control": "no-store", "content-type": "application/problem+json", @@ -109,7 +109,7 @@ "code": "adapter.payment.forbidden", "status": 403, "title": "adapter.payment.forbidden", - "type": "urn:registry:problem:adapter.payment.forbidden" + "type": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.forbidden" }, "cache-control": "no-store", "content-type": "application/problem+json", @@ -124,7 +124,7 @@ "code": "adapter.payment.authentication-required", "status": 401, "title": "adapter.payment.authentication-required", - "type": "urn:registry:problem:adapter.payment.authentication-required" + "type": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.authentication-required" }, "cache-control": "no-store", "content-type": "application/problem+json", @@ -139,7 +139,7 @@ "code": "adapter.payment.not-found", "status": 404, "title": "adapter.payment.not-found", - "type": "urn:registry:problem:adapter.payment.not-found" + "type": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.not-found" }, "cache-control": "no-store", "content-type": "application/problem+json", @@ -154,7 +154,7 @@ "code": "adapter.payment.not-found", "status": 404, "title": "adapter.payment.not-found", - "type": "urn:registry:problem:adapter.payment.not-found" + "type": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.not-found" }, "cache-control": "no-store", "content-type": "application/problem+json", @@ -169,7 +169,7 @@ "code": "adapter.payment.not-found", "status": 404, "title": "adapter.payment.not-found", - "type": "urn:registry:problem:adapter.payment.not-found" + "type": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.not-found" }, "cache-control": "no-store", "content-type": "application/problem+json", @@ -184,7 +184,7 @@ "code": "adapter.payment.authentication-required", "status": 401, "title": "adapter.payment.authentication-required", - "type": "urn:registry:problem:adapter.payment.authentication-required" + "type": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.authentication-required" }, "cache-control": "no-store", "content-type": "application/problem+json", @@ -199,7 +199,7 @@ "code": "adapter.payment.forbidden", "status": 403, "title": "adapter.payment.forbidden", - "type": "urn:registry:problem:adapter.payment.forbidden" + "type": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.forbidden" }, "cache-control": "no-store", "content-type": "application/problem+json", diff --git a/crates/registry-adapterctl/src/compile/document.rs b/crates/registry-adapterctl/src/compile/document.rs index 71e0be047c..f682804faa 100644 --- a/crates/registry-adapterctl/src/compile/document.rs +++ b/crates/registry-adapterctl/src/compile/document.rs @@ -93,7 +93,10 @@ pub(crate) fn assemble( }; let record_type = binding.record_type.as_str(); let substituted = record_type_parameter(operation); - let concrete = concrete_path(&operation.path, substituted, record_type); + let concrete = profile.published_operation_path( + operation, + concrete_path(&operation.path, substituted, record_type), + ); let method = openapi_method(operation.method); let path_item = paths .entry(concrete.clone()) @@ -126,7 +129,7 @@ pub(crate) fn assemble( if operation.method == HttpMethod::Post && operation.read_only { members.insert(READ_ONLY_OPERATION_EXTENSION.to_owned(), json!(true)); } - let mut parameters = operation_parameters(operation, binding, fields, substituted); + let mut parameters = operation_parameters(profile, operation, binding, fields, substituted); if !operation.is_read() { parameters.push(idempotency_key_parameter()); } @@ -565,6 +568,7 @@ fn concrete_path(path: &str, parameter: Option<&str>, record_type: &str) -> Stri /// filters in the request body, and the runtime refuses a query string on /// it, so such an operation declares no query parameter. fn operation_parameters( + profile: &AdapterProfile, operation: &ProfileOperation, binding: &Binding, fields: &[RecordField], @@ -576,7 +580,7 @@ fn operation_parameters( continue; } parameters.push(json!({ - "name": name.as_str(), + "name": profile.published_path_parameter(operation, name.as_str()), "in": "path", "required": true, "schema": {"type": "string"}, diff --git a/crates/registry-adapterctl/tests/compile.rs b/crates/registry-adapterctl/tests/compile.rs index b6448fcc4c..489f8ff555 100644 --- a/crates/registry-adapterctl/tests/compile.rs +++ b/crates/registry-adapterctl/tests/compile.rs @@ -437,7 +437,7 @@ fn the_maintained_example_compiles_under_breg_records() { let paths = document["paths"].as_object().expect("paths"); // `/v1/records/person` carries search (get) and create (post); - // `/v1/records/person/{record_id}` carries get. + // `/v1/records/person/{recordId}` carries get. assert_eq!(paths.len(), 3, "{paths:?}"); assert!(paths.contains_key(registry_adapter::engine::effective_contract::WELL_KNOWN_PATH)); let search = &document["paths"]["/v1/records/person"]["get"]; @@ -454,7 +454,7 @@ fn the_maintained_example_compiles_under_breg_records() { ); assert_contract_pin(&search["parameters"]); - let get = &document["paths"]["/v1/records/person/{record_id}"]["get"]; + let get = &document["paths"]["/v1/records/person/{recordId}"]["get"]; assert_eq!(get["operationId"], "records-get.person"); let path_parameters = get["parameters"] .as_array() @@ -465,7 +465,7 @@ fn the_maintained_example_compiles_under_breg_records() { assert_eq!( path_parameters, [&json!({ - "name": "record_id", + "name": "recordId", "in": "path", "required": true, "schema": {"type": "string"}, @@ -515,7 +515,7 @@ fn the_maintained_example_compiles_under_breg_records() { ); assert!(create["responses"].get("200").is_none()); - let update = &document["paths"]["/v1/records/person/{record_id}"]["put"]; + let update = &document["paths"]["/v1/records/person/{recordId}"]["put"]; assert_eq!(update["operationId"], "records-update.person"); assert_write_headers(&update["parameters"]); assert_eq!( @@ -537,7 +537,7 @@ fn the_maintained_example_compiles_under_breg_records() { // A parameterized part is a deployment value the contract cannot // know: the schema types it as a string, never the stand-in const. - let meta = &document["paths"]["/v1/records/person/{record_id}"]["get"]["responses"]["200"] + let meta = &document["paths"]["/v1/records/person/{recordId}"]["get"]["responses"]["200"] ["content"]["application/json"]["schema"]["properties"]["meta"]["properties"]; assert_eq!(meta["registryId"], json!({"type": "string"})); assert_eq!(meta["datasetId"], json!({"type": "string"})); @@ -706,6 +706,10 @@ fn the_second_target_experiment_compiles() { let search = &document["paths"]["/fhir/household"]["get"]; assert_eq!(search["operationId"], "fhir-search-type.household"); + let get = &document["paths"]["/fhir/household/{record_id}"]["get"]; + assert!(get["parameters"].as_array().unwrap().iter().any(|item| { + item["in"] == "path" && item["name"] == "record_id" && item["required"] == true + })); assert_eq!( query_parameter_names(&search["parameters"]), ["_count", "_page_token"] diff --git a/crates/registry-bregctl/src/lib.rs b/crates/registry-bregctl/src/lib.rs index a94215da77..de3bfd24c5 100644 --- a/crates/registry-bregctl/src/lib.rs +++ b/crates/registry-bregctl/src/lib.rs @@ -598,7 +598,7 @@ struct CheckArgs { #[arg( long, value_name = "DIRECTORY", - conflicts_with_all = ["project", "file", "production", "runtime_config"] + conflicts_with_all = ["project", "file", "production", "require_package_closure", "runtime_config"] )] package: Option, @@ -607,12 +607,15 @@ struct CheckArgs { /// rehearsal receipt or backup binding, a model selection, /// example scenarios, session state or source preparation file. No secret, database, /// or network is read. With PROJECT, journeys are checked against that project. - #[arg(long, value_name = "FILE", conflicts_with_all = ["production", "runtime_config"])] + #[arg(long, value_name = "FILE", conflicts_with_all = ["production", "require_package_closure", "runtime_config"])] file: Option, - /// Enforce production-only package closure requirements. - #[arg(long)] + /// Compatibility shorthand for production posture and package closure. + #[arg(long, hide = true)] production: bool, + /// Require exact package input closure. Requires production posture. + #[arg(long)] + require_package_closure: bool, /// Exit 1 when a warning is reported. /// Development posture listings do not count. #[arg(long)] @@ -3287,6 +3290,18 @@ where ); } }; + if matches!(&cli.command, Command::Check(args) if args.require_package_closure) + && posture.posture != Posture::Production + { + return write_posture_usage( + "platform.posture.conflict", + "--require-package-closure requires production posture", + "Declare production posture or omit --require-package-closure.", + cli.format, + stdout, + stderr, + ); + } (posture, cli.format.with_posture(posture)) } else { (DEFAULT_POSTURE, cli.format) @@ -3456,7 +3471,7 @@ where let request = check::Request { project: args.project.as_deref(), package: args.package.as_deref(), - production: args.production, + production: args.require_package_closure || args.production, deny_warnings: args.deny_warnings, runtime_config: args.runtime_config.as_deref(), environment: args.environment, diff --git a/crates/registry-bregctl/tests/cli.rs b/crates/registry-bregctl/tests/cli.rs index 2963d4152e..b6eb002235 100644 --- a/crates/registry-bregctl/tests/cli.rs +++ b/crates/registry-bregctl/tests/cli.rs @@ -3663,6 +3663,29 @@ fn examples_list_opens_a_pre_rename_development_run() { .contains("duplicate field `journeyFile`")); } +#[test] +fn check_package_closure_matches_the_production_shorthand() { + let project = minimal_example(); + let checked = |flags: &[&str]| { + Command::new(env!("CARGO_BIN_EXE_bregctl")) + .args(["--format", "json", "check", path(&project)]) + .args(flags) + .env_remove("REGISTRY_STACK_POSTURE") + .output() + .unwrap() + }; + let shorthand = checked(&["--production"]); + let explicit = checked(&["--posture", "production", "--require-package-closure"]); + assert_eq!(explicit.status, shorthand.status); + assert_eq!(json_stdout(&explicit), json_stdout(&shorthand)); + let incompatible = checked(&["--posture", "development", "--require-package-closure"]); + assert_eq!(incompatible.status.code(), Some(2)); + assert_eq!( + json_stdout(&incompatible)["diagnostics"][0]["code"], + "platform.posture.conflict" + ); +} + #[test] fn check_production_names_the_flag_in_an_environment_conflict() { let output = Command::new(env!("CARGO_BIN_EXE_bregctl")) diff --git a/crates/registry-casework/tests/problem_code_catalogue.rs b/crates/registry-casework/tests/problem_code_catalogue.rs index 61a12402b3..addf1cf2ba 100644 --- a/crates/registry-casework/tests/problem_code_catalogue.rs +++ b/crates/registry-casework/tests/problem_code_catalogue.rs @@ -128,11 +128,11 @@ fn the_ask_limit_refusal_is_registered_in_the_ask_operation_only() { )) .unwrap(); assert!( - schema["paths"]["/v1/review-tasks/{task_id}/asks"]["post"]["responses"]["409"] + schema["paths"]["/v1/review-tasks/{taskId}/asks"]["post"]["responses"]["409"] .to_string() .contains("ProblemReviewAskLimitReached") ); - let answer = &schema["paths"]["/v1/review-requests/{request_id}/asks/{ask_id}/answer"]["post"]; + let answer = &schema["paths"]["/v1/review-requests/{requestId}/asks/{askId}/answer"]["post"]; assert!(answer.is_object()); assert!(!answer.to_string().contains("ProblemReviewAskLimitReached")); } diff --git a/crates/registry-caseworkctl/src/lib.rs b/crates/registry-caseworkctl/src/lib.rs index 2800b28adb..7e6f4f03f3 100644 --- a/crates/registry-caseworkctl/src/lib.rs +++ b/crates/registry-caseworkctl/src/lib.rs @@ -14,7 +14,7 @@ mod selected_binary; mod templates; use anyhow::Result; use clap::{ArgGroup, Args, CommandFactory, Parser, Subcommand, ValueEnum}; -use registry_platform_config::{declared, DeclaredPosture}; +use registry_platform_config::{declared, DeclaredPosture, Posture}; use serde_json::{json, Value}; use std::{ ffi::OsString, @@ -273,9 +273,12 @@ struct CheckArgs { /// Existing authored Casework project directory. #[arg(value_name = "PROJECT")] project: PathBuf, - /// Check the exact package closure required for production. - #[arg(long)] + /// Compatibility shorthand for production posture and package closure. + #[arg(long, hide = true)] production: bool, + /// Require exact package input closure. Requires production posture. + #[arg(long)] + require_package_closure: bool, /// Refuse authored warnings as well as errors. /// Development posture listings do not count. #[arg(long)] @@ -384,7 +387,24 @@ fn main_entry_with_posture_resolver( let command_posture = match command.posture_flag() { Some(Err(diagnostic)) => return posture_usage(diagnostic, format, stdout, stderr), Some(Ok(flag)) => match resolve(flag) { - Ok(value) => Some(value), + Ok(value) => { + if matches!(&command, Command::Check(args) if args.require_package_closure) + && value.posture != Posture::Production + { + return posture_usage( + registry_platform_yaml::Diagnostic::error( + "platform.posture.conflict", + "posture", + "--require-package-closure requires production posture", + "Declare production posture or omit --require-package-closure.", + ), + format, + stdout, + stderr, + ); + } + Some(value) + } Err(error) => { return posture_usage( registry_platform_yaml::Diagnostic::error( @@ -802,10 +822,15 @@ fn run(command: Command, posture: Option) -> Result { project, template, .. } => project::init(&project, &template), Command::Check(args) => { + let require_package_closure = args.require_package_closure || args.production; let mut result = if args.runtime_config.is_some() { - project::check(&args.project, args.production, false) + project::check(&args.project, require_package_closure, false) } else { - project::check_with_acceptances(&args.project, args.production, args.deny_warnings) + project::check_with_acceptances( + &args.project, + require_package_closure, + args.deny_warnings, + ) }; if let Some(runtime) = args.runtime_config { result = project::check_runtime_config( @@ -1238,6 +1263,43 @@ mod tests { struct ClosedOutput; + #[test] + fn package_closure_is_explicit_and_preserves_the_legacy_request() { + let temporary = canonical_tempdir(); + let project_path = temporary.path().join("unpaired"); + project::init(&project_path, "canonical-review").unwrap(); + let check = |options: &[&str]| { + let mut args = vec![ + "caseworkctl".into(), + "--format".into(), + "json".into(), + "check".into(), + project_path.as_os_str().to_owned(), + ]; + args.extend(options.iter().map(OsString::from)); + let (mut output, mut errors) = (Vec::new(), Vec::new()); + let exit = main_entry_with_posture_resolver(args, &mut output, &mut errors, |flag| { + registry_platform_config::declared_from(flag, None) + }); + assert!(errors.is_empty(), "{}", String::from_utf8_lossy(&errors)); + (exit, serde_json::from_slice::(&output).unwrap()) + }; + assert_eq!(check(&["--posture", "production"]).0, ExitCode::SUCCESS); + let explicit = check(&["--posture", "production", "--require-package-closure"]); + assert_eq!(explicit.0, ExitCode::from(DOMAIN_REFUSAL_EXIT)); + assert_eq!( + explicit.1["diagnostics"][0]["code"], + "casework.context-provider.missing-description" + ); + assert_eq!(explicit, check(&["--production"])); + let development = check(&["--posture", "development", "--require-package-closure"]); + assert_eq!(development.0, ExitCode::from(report::USAGE_EXIT)); + assert_eq!( + development.1["diagnostics"][0]["code"], + "platform.posture.conflict" + ); + } + impl Write for ClosedOutput { fn write(&mut self, _: &[u8]) -> io::Result { Err(io::Error::from(io::ErrorKind::BrokenPipe)) diff --git a/crates/registry-cli-docs/catalog.json b/crates/registry-cli-docs/catalog.json index 27384f14fa..3c837cfc56 100644 --- a/crates/registry-cli-docs/catalog.json +++ b/crates/registry-cli-docs/catalog.json @@ -4306,8 +4306,8 @@ "environment": null }, { - "display": "--production", - "description": "Enforce production-only package closure requirements", + "display": "--require-package-closure", + "description": "Require exact package input closure. Requires production posture", "always_required": false, "repeatable": false, "default_values": [], @@ -4404,7 +4404,7 @@ "when": null, "arguments": [ "--file ", - "--production" + "--require-package-closure" ] }, { @@ -4420,7 +4420,7 @@ "when": null, "arguments": [ "--package ", - "--production" + "--require-package-closure" ] }, { @@ -10527,8 +10527,8 @@ ], "options": [ { - "display": "--production", - "description": "Check the exact package closure required for production", + "display": "--require-package-closure", + "description": "Require exact package input closure. Requires production posture", "always_required": false, "repeatable": false, "default_values": [], @@ -19458,8 +19458,8 @@ "environment": null }, { - "display": "--production", - "description": "Require a production or evidence-grade target and complete deployment closure. Requires --target", + "display": "--require-deployment-closure", + "description": "Require a complete production or evidence-grade target. Requires --target and production posture", "always_required": false, "repeatable": false, "default_values": [], @@ -19519,7 +19519,7 @@ }, { "kind": "requires-all", - "when": "--production", + "when": "--require-deployment-closure", "arguments": [ "--target " ] @@ -19529,7 +19529,7 @@ "when": null, "arguments": [ "--file ", - "--production" + "--require-deployment-closure" ] }, { @@ -27457,7 +27457,7 @@ "name": "serve", "invocation": "registry-render serve", "about": "Serve the HTTP rendering API (see the runtime YAML)", - "long_about": null, + "long_about": "Serve the HTTP rendering API (see the runtime YAML). Configure OIDC authentication with authentication.oidc, or shared API key authentication with authentication.apiKeyRef for unsigned rendering. Sealing requires OIDC.", "usage": "registry-render serve [OPTIONS] --runtime-config ", "arguments": [], "options": [ @@ -27481,7 +27481,7 @@ }, { "display": "-h, --help", - "description": "Print help", + "description": "Print help (see a summary with '-h')", "always_required": false, "repeatable": false, "default_values": [], diff --git a/crates/registry-cli-docs/src/lib.rs b/crates/registry-cli-docs/src/lib.rs index 822423ccb2..36970d92f9 100644 --- a/crates/registry-cli-docs/src/lib.rs +++ b/crates/registry-cli-docs/src/lib.rs @@ -342,6 +342,36 @@ mod tests { })); } + #[test] + fn production_check_closure_is_separate_from_posture_in_help() { + let catalog = catalog(); + for (command, closure) in [ + ("bregctl check", "--require-package-closure"), + ("caseworkctl check", "--require-package-closure"), + ("evidencectl check", "--require-deployment-closure"), + ] { + let check = find_command(&catalog.binaries, command); + assert!( + check + .options + .iter() + .any(|arg| arg.display == "--posture "), + "{command}" + ); + assert!( + check.options.iter().any(|arg| arg.display == closure), + "{command}" + ); + assert!( + !check + .options + .iter() + .any(|arg| arg.display == "--production"), + "{command}" + ); + } + } + #[test] fn coordinator_publishes_authoring_and_authenticated_recovery_commands() { let catalog = catalog(); diff --git a/crates/registry-evidence-oid4vp/src/contracts.rs b/crates/registry-evidence-oid4vp/src/contracts.rs index 87fe31b4e7..d59939e7de 100644 --- a/crates/registry-evidence-oid4vp/src/contracts.rs +++ b/crates/registry-evidence-oid4vp/src/contracts.rs @@ -30,6 +30,11 @@ const FAILURE_CATEGORIES: [&str; 6] = [ "other", ]; +fn contract_path(path: &str) -> String { + path.replace("{reference}", "{sessionReference}") + .replace("{request_id}", "{requestId}") +} + /// Generate the committed HTTP contract from the same route constants the /// runtime registers. #[must_use] @@ -65,14 +70,14 @@ pub fn openapi_document() -> Value { }), ); paths.insert( - SESSION_PATH.to_owned(), + contract_path(SESSION_PATH), json!({ "get": { "operationId": "readSessionStatus", "summary": "Read the state of a session the applicant created", "security": [{"applicantBearer": []}], "parameters": [{ - "name": "reference", "in": "path", "required": true, + "name": "sessionReference", "in": "path", "required": true, "schema": {"type": "string"} }], "responses": { @@ -87,14 +92,14 @@ pub fn openapi_document() -> Value { }), ); paths.insert( - REQUEST_PATH.to_owned(), + contract_path(REQUEST_PATH), json!({ "get": { "operationId": "fetchRequestObject", "summary": "Serve the signed OpenID4VP request object to the wallet", "description": "Anonymous; the request identifier is a bearer capability. The object is a JWT signed under the policy's client identifier.", "parameters": [{ - "name": "request_id", "in": "path", "required": true, + "name": "requestId", "in": "path", "required": true, "schema": {"type": "string"} }], "responses": { @@ -113,14 +118,14 @@ pub fn openapi_document() -> Value { }), ); paths.insert( - RESPONSE_PATH.to_owned(), + contract_path(RESPONSE_PATH), json!({ "post": { "operationId": "receiveWalletResponse", "summary": "Receive the wallet's direct_post.jwt response", "description": "Anonymous; the request identifier is a bearer capability. The form carries one encrypted `response` JWE, or a plain OAuth `error`. Answers use the OAuth error shape and never carry a description.", "parameters": [{ - "name": "request_id", "in": "path", "required": true, + "name": "requestId", "in": "path", "required": true, "schema": {"type": "string"} }], "requestBody": { @@ -514,16 +519,53 @@ mod tests { .as_object() .expect("paths are an object") .keys() - .map(String::as_str) + .cloned() + .collect::>(); + let expected = ROUTES + .into_iter() + .map(contract_path) .collect::>(); - assert_eq!(actual, ROUTES.into_iter().collect::>()); + assert_eq!(actual, expected); + } + + #[test] + fn path_arguments_identify_the_session_and_wallet_request() { + let document = openapi_document(); + for (path, method, parameter, operation) in [ + ( + "/v1/sessions/{sessionReference}", + "get", + "sessionReference", + "readSessionStatus", + ), + ( + "/v1/requests/{requestId}", + "get", + "requestId", + "fetchRequestObject", + ), + ( + "/v1/responses/{requestId}", + "post", + "requestId", + "receiveWalletResponse", + ), + ] { + let published = &document["paths"][path][method]; + assert_eq!(published["operationId"], operation); + assert_eq!(published["parameters"][0]["in"], "path"); + assert_eq!(published["parameters"][0]["name"], parameter); + assert_eq!(published["parameters"][0]["required"], true); + } } #[test] fn every_route_publishes_one_operation_with_the_deadline_refusal() { let document = openapi_document(); for path in ROUTES { - let operations = document["paths"][path].as_object().expect("a route"); + let operations = document["paths"][contract_path(path)] + .as_object() + .expect("a route"); assert_eq!(operations.len(), 1, "{path}"); let operation = operations.values().next().unwrap(); assert!(operation["responses"].get("408").is_some(), "{path}"); @@ -534,7 +576,7 @@ mod tests { fn every_response_publishes_the_traceparent_header() { let document = openapi_document(); for path in ROUTES { - let operation = document["paths"][path] + let operation = document["paths"][contract_path(path)] .as_object() .expect("a route") .values() @@ -559,13 +601,14 @@ mod tests { (SESSION_PATH, "get"), (READ_PATH, "post"), ] { + let path = contract_path(path); assert_eq!( - document["paths"][path][method]["responses"]["401"]["headers"]["WWW-Authenticate"] + document["paths"][&path][method]["responses"]["401"]["headers"]["WWW-Authenticate"] ["schema"]["const"], "Bearer", "{path}" ); - let forbidden = &document["paths"][path][method]["responses"]["403"]; + let forbidden = &document["paths"][&path][method]["responses"]["403"]; assert!(forbidden.is_object(), "{path} publishes 403"); assert!( forbidden["headers"].get("WWW-Authenticate").is_none(), @@ -579,7 +622,7 @@ mod tests { let document = openapi_document(); for path in [SESSIONS_PATH, READ_PATH, RESPONSE_PATH] { assert!( - document["paths"][path]["post"]["responses"] + document["paths"][contract_path(path)]["post"]["responses"] .get("413") .is_some(), "{path}" @@ -610,7 +653,8 @@ mod tests { fn the_budget_refusal_is_published_on_the_wallet_route() { let document = openapi_document(); assert!( - document["paths"][RESPONSE_PATH]["post"]["responses"]["503"]["description"] + document["paths"][contract_path(RESPONSE_PATH)]["post"]["responses"]["503"] + ["description"] .as_str() .unwrap() .contains("byte budget") diff --git a/crates/registry-evidence-oid4vp/tests/responses.rs b/crates/registry-evidence-oid4vp/tests/responses.rs index af42056b8b..ecd5b4d727 100644 --- a/crates/registry-evidence-oid4vp/tests/responses.rs +++ b/crates/registry-evidence-oid4vp/tests/responses.rs @@ -1217,9 +1217,9 @@ async fn responses_are_rate_limited_per_request_and_globally() { } fn wallet_response_schema(status: &str) -> jsonschema::JSONSchema { - use registry_evidence_oid4vp::{contracts::openapi_document, service::RESPONSE_PATH}; + use registry_evidence_oid4vp::contracts::openapi_document; let document = openapi_document(); - let responses = &document["paths"][RESPONSE_PATH]["post"]["responses"]; + let responses = &document["paths"]["/v1/responses/{requestId}"]["post"]["responses"]; let reference = responses[status]["content"]["application/json"]["schema"]["$ref"] .as_str() .unwrap(); diff --git a/crates/registry-evidencectl/src/check.rs b/crates/registry-evidencectl/src/check.rs index 3343f72b6e..a87fd2d303 100644 --- a/crates/registry-evidencectl/src/check.rs +++ b/crates/registry-evidencectl/src/check.rs @@ -86,8 +86,9 @@ pub(crate) fn check( let target_path = target.map(crate::target::target_path); let target = target_path.as_deref(); let assurance_refusal = if production { - let path = target - .ok_or_else(|| anyhow::anyhow!("--production requires an explicit EvidenceTarget"))?; + let path = target.ok_or_else(|| { + anyhow::anyhow!("deployment closure requires an explicit EvidenceTarget") + })?; let bytes = crate::authored::read_authored_file(path, "EvidenceTarget")?; let target_model = registry_evidence_authoring::target::read_target(&path.to_string_lossy(), &bytes)? @@ -102,7 +103,7 @@ pub(crate) fn check( .then(|| crate::build::TargetDocumentDiagnostic { code: "evidence.target.production-assurance-required", path: format!("{}:/assuranceProfile", path.display()), - message: "--production requires production or evidence-grade target assurance" + message: "deployment closure requires production or evidence-grade target assurance" .to_owned(), }) } else { diff --git a/crates/registry-evidencectl/src/lib.rs b/crates/registry-evidencectl/src/lib.rs index 93724e8f3f..0f4e5b3b3a 100644 --- a/crates/registry-evidencectl/src/lib.rs +++ b/crates/registry-evidencectl/src/lib.rs @@ -198,7 +198,7 @@ struct CheckArgs { /// Check one tooling file on its own, offline: a client profile, reviewed /// contracts, a ThunderID task connection or session file, a source-import /// baseline or journal, a source resolution file, or a source export manifest. - #[arg(long, conflicts_with_all = ["project", "target", "production"])] + #[arg(long, conflicts_with_all = ["project", "target", "production", "require_deployment_closure"])] file: Option, /// Check a store provisioning file offline without resolving secrets. #[arg(long, value_name = "FILE", conflicts_with_all = ["target", "production"])] @@ -209,9 +209,12 @@ struct CheckArgs { /// Explicit deployment target whose governance and runtime structure are checked. #[arg(long)] target: Option, - /// Require a production or evidence-grade target and complete deployment closure. Requires --target. - #[arg(long, requires = "target")] + /// Compatibility shorthand for production posture and deployment closure. + #[arg(long, requires = "target", hide = true)] production: bool, + /// Require a complete production or evidence-grade target. Requires --target and production posture. + #[arg(long, requires = "target")] + require_deployment_closure: bool, /// Exit 1 when a warning is reported. #[arg(long)] deny_warnings: bool, @@ -650,6 +653,19 @@ fn run_entry() -> ExitCode { } }; let posture = declared.unwrap_or(DEFAULT_POSTURE); + if matches!(&cli.command, Command::Check(args) if args.require_deployment_closure) + && posture.posture != registry_platform_config::Posture::Production + { + let report = + registry_platform_yaml::Report::new(vec![registry_platform_yaml::Diagnostic::error( + "platform.posture.conflict", + "", + "--require-deployment-closure requires production posture", + "Declare production posture or omit --require-deployment-closure.", + )]); + write_report_failure(&command_path, report::USAGE_EXIT, &report, format, None); + return ExitCode::from(report::USAGE_EXIT); + } let result = match cli.command { Command::Api(args) => { if format_explicit { @@ -1565,7 +1581,7 @@ fn run_check_command( let checked = check::check( project, args.target.as_deref(), - args.production, + args.require_deployment_closure || args.production, args.deny_warnings, declared, ); diff --git a/crates/registry-evidencectl/tests/production_build.rs b/crates/registry-evidencectl/tests/production_build.rs index 31038155bc..4cf75b0531 100644 --- a/crates/registry-evidencectl/tests/production_build.rs +++ b/crates/registry-evidencectl/tests/production_build.rs @@ -1167,7 +1167,7 @@ fn production_check_refuses_local_assurance_without_creating_local_secrets() { String::from_utf8_lossy(&output.stderr) ); assert!( - diagnostic.contains("--production requires production or evidence-grade"), + diagnostic.contains("deployment closure requires production or evidence-grade"), "{diagnostic}" ); if format == "json" { @@ -1190,6 +1190,40 @@ fn production_check_refuses_local_assurance_without_creating_local_secrets() { fixture.assert_no_staging_residue(); } +#[test] +fn deployment_closure_matches_the_legacy_option_and_requires_production() { + let fixture = Fixture::new(); + fixture.use_default_local_signer(); + let legacy = fixture.check_production("json"); + let explicit = fixture + .check_command("json", &fixture.target) + .args(["--posture", "production", "--require-deployment-closure"]) + .output() + .unwrap(); + assert_eq!(explicit.status.code(), Some(1)); + assert_eq!(explicit.status, legacy.status); + assert_eq!(explicit.stdout, legacy.stdout); + assert!(explicit.stderr.is_empty()); + let refusal: Value = serde_json::from_slice(&explicit.stdout).unwrap(); + assert_eq!( + refusal["diagnostics"][0]["code"], + "evidence.target.production-assurance-required" + ); + + let development = fixture + .check_command("json", &fixture.target) + .args(["--posture", "development", "--require-deployment-closure"]) + .output() + .unwrap(); + assert_eq!(development.status.code(), Some(2)); + let refusal: Value = serde_json::from_slice(&development.stdout).unwrap(); + assert_eq!( + refusal["diagnostics"][0]["code"], + "platform.posture.conflict" + ); + assert!(fixture.invocations().is_empty()); +} + #[test] fn unsafe_function_sources_refuse_inspection_before_missing_dependencies() { for (source, expected_code) in [ @@ -1861,20 +1895,27 @@ impl Fixture { } fn check_production_with(&self, format: &str, target: &Path) -> Output { - Command::new(env!("CARGO_BIN_EXE_evidencectl")) + self.check_command(format, target) + .arg("--production") + .output() + .expect("evidencectl check starts") + } + + fn check_command(&self, format: &str, target: &Path) -> Command { + let mut command = Command::new(env!("CARGO_BIN_EXE_evidencectl")); + command .args(["--format", format, "check"]) .arg(&self.project) .arg("--target") .arg(target) - .arg("--production") + .env_remove("REGISTRY_STACK_POSTURE") .env("EVIDENCE_BIN", &self.evidence) .env("FAKE_EVIDENCE_LOG", &self.log) .env( "FAKE_EVIDENCE_VERSION", registry_platform_buildinfo::DISPLAY_VERSION, - ) - .output() - .expect("evidencectl check starts") + ); + command } fn build_with(&self, project: &Path, target: &Path, output: &Path) -> Output { diff --git a/crates/registry-mcp/tests/native_adapter.rs b/crates/registry-mcp/tests/native_adapter.rs index efa1fefdcc..f4a8ebe188 100644 --- a/crates/registry-mcp/tests/native_adapter.rs +++ b/crates/registry-mcp/tests/native_adapter.rs @@ -40,7 +40,12 @@ async fn breg_records_facade_reads_the_configured_facility_directory() { assert_eq!(stack.exported["digest"], stack.runtime_contract["digest"]); let client = stack.client().await; - let get = call(&client, GET_TOOL, get_arguments(FACILITY_ID)).await; + let get = call( + &client, + GET_TOOL, + json!({"path":{"recordId":FACILITY_ID},"query":{}}), + ) + .await; assert_eq!(get.is_error, Some(false), "{get:?}"); let get = structured(&get); diff --git a/crates/registry-messaging/src/schema.rs b/crates/registry-messaging/src/schema.rs index 1cd9ba95b9..b72caa3f66 100644 --- a/crates/registry-messaging/src/schema.rs +++ b/crates/registry-messaging/src/schema.rs @@ -128,6 +128,7 @@ pub fn authoring_documents() -> Result, serde_jso pub fn openapi_documents() -> Result, serde_json::Error> { let mut paths = Map::new(); for operation in OPERATIONS { + let path = published_path(operation.path); let mut responses = Map::new(); responses.insert( operation.success_status.to_string(), @@ -169,7 +170,7 @@ pub fn openapi_documents() -> Result, serde_json: "summary": operation.summary, "responses": responses, }); - let mut parameters: Vec = path_parameters(operation.path) + let mut parameters: Vec = path_parameters(path) .map(|name| { json!({ "name": name, @@ -229,7 +230,7 @@ pub fn openapi_documents() -> Result, serde_json: json!([]) }; paths - .entry(operation.path.to_owned()) + .entry(path.to_owned()) .or_insert_with(|| Value::Object(Map::new())) .as_object_mut() .expect("every path item is an object") @@ -611,6 +612,22 @@ fn problem_headers(status: u16) -> Option { } } +fn published_path(path: &str) -> &str { + use registry_messaging_core::{ + MESSAGE_CANCEL_PATH, MESSAGE_PATH, PROVIDER_CALLBACK_PATH, PROVIDER_CALLBACK_TOKEN_PATH, + TEMPLATE_PREVIEW_PATH, + }; + + match path { + MESSAGE_PATH => "/v1/messages/{messageId}", + MESSAGE_CANCEL_PATH => "/v1/messages/{messageId}/cancel", + TEMPLATE_PREVIEW_PATH => "/v1/templates/{templateId}/versions/{templateVersion}/preview", + PROVIDER_CALLBACK_PATH => "/v1/provider-callbacks/{providerId}", + PROVIDER_CALLBACK_TOKEN_PATH => "/v1/provider-callbacks/{providerId}/{token}", + _ => path, + } +} + fn path_parameters(path: &str) -> impl Iterator { path.split('/').filter_map(|segment| { segment @@ -883,20 +900,80 @@ mod tests { } } + #[test] + fn openapi_publishes_explicit_path_parameter_names() { + let documents = openapi_documents().unwrap(); + let document: Value = serde_json::from_str(&documents[OPENAPI_FILE]).unwrap(); + let cases: [(&str, &str, &str, &[&str]); 5] = [ + ( + "/v1/messages/{messageId}", + "get", + "getMessage", + &["messageId"], + ), + ( + "/v1/messages/{messageId}/cancel", + "post", + "cancelMessage", + &["messageId"], + ), + ( + "/v1/templates/{templateId}/versions/{templateVersion}/preview", + "post", + "previewTemplate", + &["templateId", "templateVersion"], + ), + ( + "/v1/provider-callbacks/{providerId}", + "post", + "receiveProviderCallback", + &["providerId"], + ), + ( + "/v1/provider-callbacks/{providerId}/{token}", + "post", + "receiveProviderCallbackWithToken", + &["providerId", "token"], + ), + ]; + let path_count = document["paths"] + .as_object() + .unwrap() + .keys() + .filter(|path| path.contains('{')) + .count(); + assert_eq!(path_count, cases.len()); + for (path, method, operation_id, expected) in cases { + let operation = &document["paths"][path][method]; + assert_eq!(operation["operationId"], operation_id); + let parameters: Vec<_> = operation["parameters"] + .as_array() + .unwrap() + .iter() + .filter(|parameter| parameter["in"] == "path") + .map(|parameter| { + assert_eq!(parameter["required"], true); + parameter["name"].as_str().unwrap() + }) + .collect(); + assert_eq!(parameters.as_slice(), expected, "{path}"); + } + } + #[test] fn openapi_lists_every_operation_and_only_catalogued_problems() { let documents = openapi_documents().unwrap(); assert_eq!(documents, openapi_documents().unwrap()); let document: Value = serde_json::from_str(&documents[OPENAPI_FILE]).unwrap(); for operation in OPERATIONS { - let entry = &document["paths"][operation.path][operation.method]; + let entry = &document["paths"][published_path(operation.path)][operation.method]; assert_eq!(entry["operationId"], operation.operation_id); } assert!( document["paths"].get("/metrics").is_none(), "the metrics listener is not part of the public contract" ); - let message = &document["paths"]["/v1/messages/{message_id}"]["get"]; + let message = &document["paths"]["/v1/messages/{messageId}"]["get"]; assert_eq!(message["security"], json!([{"bearer": []}])); assert!(message["responses"]["404"].is_object()); assert!(message["responses"]["401"].is_object()); @@ -945,8 +1022,8 @@ mod tests { let documents = openapi_documents().unwrap(); let document: Value = serde_json::from_str(&documents[OPENAPI_FILE]).unwrap(); for path in [ - registry_messaging_core::PROVIDER_CALLBACK_PATH, - registry_messaging_core::PROVIDER_CALLBACK_TOKEN_PATH, + "/v1/provider-callbacks/{providerId}", + "/v1/provider-callbacks/{providerId}/{token}", ] { let callback = &document["paths"][path]["post"]; assert_eq!(callback["security"], json!([])); @@ -972,14 +1049,15 @@ mod tests { fn the_preview_operation_publishes_its_path_parameters_and_bodies() { let documents = openapi_documents().unwrap(); let document: Value = serde_json::from_str(&documents[OPENAPI_FILE]).unwrap(); - let preview = &document["paths"][registry_messaging_core::TEMPLATE_PREVIEW_PATH]["post"]; + let preview = &document["paths"] + ["/v1/templates/{templateId}/versions/{templateVersion}/preview"]["post"]; let names: Vec<&str> = preview["parameters"] .as_array() .unwrap() .iter() .map(|parameter| parameter["name"].as_str().unwrap()) .collect(); - assert_eq!(names, ["template_id", "version"]); + assert_eq!(names, ["templateId", "templateVersion"]); assert_eq!( preview["requestBody"]["content"]["application/json"]["schema"]["$ref"], "#/components/schemas/TemplatePreviewRequest" @@ -988,8 +1066,8 @@ mod tests { preview["responses"]["200"]["content"]["application/json"]["schema"]["$ref"], "#/components/schemas/TemplatePreview" ); - let message = &document["paths"]["/v1/messages/{message_id}"]["get"]; - assert_eq!(message["parameters"][0]["name"], "message_id"); + let message = &document["paths"]["/v1/messages/{messageId}"]["get"]; + assert_eq!(message["parameters"][0]["name"], "messageId"); assert!(message.get("requestBody").is_none()); } @@ -1155,7 +1233,8 @@ mod tests { let documents = openapi_documents().unwrap(); let document: Value = serde_json::from_str(&documents[OPENAPI_FILE]).unwrap(); for operation in OPERATIONS { - let responses = &document["paths"][operation.path][operation.method]["responses"]; + let responses = + &document["paths"][published_path(operation.path)][operation.method]["responses"]; for problem in operation.problems { let status = problem.http_status(); let headers = &responses[status.to_string()]["headers"]; diff --git a/crates/registry-payment-client/src/client.rs b/crates/registry-payment-client/src/client.rs index 3613db0566..fc380c34c1 100644 --- a/crates/registry-payment-client/src/client.rs +++ b/crates/registry-payment-client/src/client.rs @@ -473,7 +473,7 @@ fn validate_key(value: &str) -> Result<(), PaymentClientError> { Ok(()) } else { Err(PaymentClientError::invalid_request( - "the idempotency key is not 1 to 128 visible ASCII characters", + "Idempotency-Key must contain 1 to 128 visible ASCII characters", )) } } @@ -500,7 +500,7 @@ fn domain_problem( ) -> PaymentClientError { if document.status != status.as_u16() || document.code.status() != status.as_u16() - || document.type_uri != document.code.type_uri() + || !document.code.recognizes_type(&document.type_uri) || document.title != document.code.as_str() { return protocol(status, PaymentProtocolFailure::Problem, trace_id); diff --git a/crates/registry-payment-client/tests/http_boundary.rs b/crates/registry-payment-client/tests/http_boundary.rs index 8c1888fa45..4081b3231f 100644 --- a/crates/registry-payment-client/tests/http_boundary.rs +++ b/crates/registry-payment-client/tests/http_boundary.rs @@ -145,6 +145,31 @@ fn token() -> BearerToken { BearerToken::new("synthetic-payment-token").expect("fixture token") } +#[tokio::test] +async fn invalid_idempotency_key_names_the_header_and_sends_nothing() { + let (client, fixture) = serve_problem( + StatusCode::UNPROCESSABLE_ENTITY, + PaymentProblemCode::InvalidRequest, + ) + .await; + let request = RequestCollection { + bill_id: Uuid::new_v4(), + bill_version: 3, + }; + let error = client + .request_collection(&token(), "sensitive key", &request) + .await + .unwrap_err(); + assert!(matches!( + error, + PaymentClientError::InvalidRequest { + reason: "Idempotency-Key must contain 1 to 128 visible ASCII characters" + } + )); + assert!(!error.to_string().contains("sensitive key")); + assert!(fixture.observations.lock().unwrap().is_empty()); +} + #[tokio::test] async fn g2p_submission_sends_once_when_the_provider_outcome_is_unknown() { let (client, fixture) = serve_problem( @@ -612,6 +637,80 @@ async fn inconsistent_problem_document_is_a_protocol_failure() { assert!(error.is_outcome_unknown()); } +#[tokio::test] +async fn every_problem_accepts_its_canonical_type_and_only_its_exact_legacy_type() { + let request = RequestCollection { + bill_id: Uuid::new_v4(), + bill_version: 3, + }; + for &code in PaymentProblemCode::ALL { + let status = StatusCode::from_u16(code.status()).unwrap(); + let mut candidate = code_problem(code); + for accepted in [ + candidate["type"].as_str().unwrap().to_owned(), + format!("urn:registry:problem:{}", code.as_str()), + ] { + candidate["type"] = json!(accepted); + let (client, _) = + serve_fixture(status, "application/problem+json", candidate.to_string()).await; + let error = client + .request_collection(&token(), KEY, &request) + .await + .unwrap_err(); + assert!( + matches!(error, PaymentClientError::Problem { code: actual, status: actual_status, .. } + if actual == code && actual_status == status.as_u16()), + "{code:?} {error}" + ); + } + } + + let code = PaymentProblemCode::OutcomeUnknown; + let mut legacy = code_problem(code); + legacy["type"] = json!("urn:registry:problem:adapter.payment.outcome-unknown"); + for (field, wrong) in [ + ( + "type", + json!("urn:registry:problem:adapter.payment.unknown-type"), + ), + ( + "type", + json!("urn:registry:problem:adapter.payment.outcome-unknown#legacy"), + ), + ( + "type", + json!("urn:registry:problem:adapter.payment.unavailable"), + ), + ("type", json!(PaymentProblemCode::Unavailable.type_uri())), + ("title", json!(PaymentProblemCode::Unavailable.as_str())), + ("status", json!(500)), + ("code", json!(PaymentProblemCode::Unavailable)), + ] { + let mut body = legacy.clone(); + body[field] = wrong; + let (client, _) = serve_fixture( + StatusCode::SERVICE_UNAVAILABLE, + "application/problem+json", + body.to_string(), + ) + .await; + let error = client + .request_collection(&token(), KEY, &request) + .await + .unwrap_err(); + assert!( + matches!( + error, + PaymentClientError::Protocol { + failure: PaymentProtocolFailure::Problem, + .. + } + ), + "{field} {error}" + ); + } +} + #[test] fn connection_and_request_values_are_rejected_before_io() { let base = Url::parse("https://adapter.example.invalid/root").unwrap(); diff --git a/crates/registry-payment-protocol/examples/problem-catalog.rs b/crates/registry-payment-protocol/examples/problem-catalog.rs new file mode 100644 index 0000000000..6d0fd63e0a --- /dev/null +++ b/crates/registry-payment-protocol/examples/problem-catalog.rs @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: Apache-2.0 + +use registry_payment_protocol::PaymentProblemCode; +use serde_json::json; +use std::{env, fs, path::PathBuf, process::ExitCode}; + +fn main() -> ExitCode { + let mut args = env::args_os().skip(1); + let (Some(flag), Some(output), None) = (args.next(), args.next(), args.next()) else { + eprintln!("usage: problem-catalog --output "); + return ExitCode::from(2); + }; + if flag != "--output" { + eprintln!("usage: problem-catalog --output "); + return ExitCode::from(2); + } + + let entries: Vec<_> = PaymentProblemCode::ALL + .iter() + .copied() + .map(|code| { + json!({ + "uri": code.type_uri(), + "code": code.as_str(), + "title": code.as_str(), + "description": code.description(), + "httpStatuses": [code.status()], + }) + }) + .collect(); + let mut bytes = + serde_json::to_vec_pretty(&json!({"entries": entries})).expect("catalog serializes"); + bytes.push(b'\n'); + if fs::write(PathBuf::from(output), bytes).is_err() { + eprintln!("problem catalog could not be written"); + return ExitCode::FAILURE; + } + ExitCode::SUCCESS +} diff --git a/crates/registry-payment-protocol/src/lib.rs b/crates/registry-payment-protocol/src/lib.rs index 767e67b511..2dd8e1621f 100644 --- a/crates/registry-payment-protocol/src/lib.rs +++ b/crates/registry-payment-protocol/src/lib.rs @@ -5,6 +5,24 @@ use serde::{Deserialize, Serialize}; use uuid::Uuid; +const PAYMENT_PROBLEM_TYPE_BASE: &str = "https://id.registrystack.org/problems/registry-adapter/"; +const LEGACY_PAYMENT_PROBLEM_TYPE_BASE: &str = "urn:registry:problem:"; +// Freeze the suffixes emitted before the HTTPS migration. A future problem +// code has no legacy alias unless the released wire contract emitted it. +const LEGACY_PAYMENT_PROBLEM_CODES: &[&str] = &[ + "adapter.payment.authentication-required", + "adapter.payment.forbidden", + "adapter.payment.invalid-request", + "adapter.payment.conflict", + "adapter.payment.not-found", + "adapter.payment.receipt-unresolved", + "adapter.payment.receipt-expired", + "adapter.payment.recovery-held", + "adapter.payment.outcome-unknown", + "adapter.payment.unavailable", + "adapter.payment.provider-protocol", +]; + /// Maximum exact integer shared with JSON consumers and the synthetic provider. pub const MAX_MINOR_UNITS: u64 = 9_007_199_254_740_991; @@ -37,6 +55,21 @@ pub enum PaymentProblemCode { } impl PaymentProblemCode { + /// The closed inventory served by the payment host. + pub const ALL: &'static [Self] = &[ + Self::Unauthenticated, + Self::Forbidden, + Self::InvalidRequest, + Self::Conflict, + Self::NotFound, + Self::ReceiptUnresolved, + Self::ReceiptExpired, + Self::RecoveryHeld, + Self::OutcomeUnknown, + Self::Unavailable, + Self::ProviderProtocol, + ]; + #[must_use] pub const fn as_str(self) -> &'static str { match self { @@ -70,7 +103,45 @@ impl PaymentProblemCode { #[must_use] pub fn type_uri(self) -> String { - format!("urn:registry:problem:{}", self.as_str()) + format!("{PAYMENT_PROBLEM_TYPE_BASE}{}", self.as_str()) + } + + /// Match the canonical URI or the previous URI for this exact code. + /// Callers also validate the status and title against the same code. + #[must_use] + pub fn recognizes_type(self, uri: &str) -> bool { + let code = self.as_str(); + uri.strip_prefix(PAYMENT_PROBLEM_TYPE_BASE) == Some(code) + || (uri.strip_prefix(LEGACY_PAYMENT_PROBLEM_TYPE_BASE) == Some(code) + && LEGACY_PAYMENT_PROBLEM_CODES.contains(&code)) + } + + /// Value-free resolver description. The payment wire body has no detail member. + #[must_use] + pub const fn description(self) -> &'static str { + match self { + Self::Unauthenticated => "The payment caller credential is missing or refused.", + Self::Forbidden => "The verified caller is not admitted for this payment operation.", + Self::InvalidRequest => { + "The request does not meet the payment operation's input contract." + } + Self::Conflict => { + "The requested operation conflicts with the current payment binding or state." + } + Self::NotFound => "The payment resource is absent or not visible to the caller.", + Self::ReceiptUnresolved => "The original request has no confirmed acceptance receipt.", + Self::ReceiptExpired => "The original acceptance receipt is past its recovery window.", + Self::RecoveryHeld => { + "The original payment attempt requires reconciliation before it can proceed." + } + Self::OutcomeUnknown => { + "The outcome of the original payment attempt could not be established." + } + Self::Unavailable => "The payment operation was unavailable.", + Self::ProviderProtocol => { + "The provider's response did not meet the payment protocol contract." + } + } } } @@ -102,6 +173,29 @@ impl From for PaymentProblem { } } +/// Schema of newly emitted problem answers. Clients validate earlier peers +/// separately against the closed legacy type for the same tuple. +#[cfg(feature = "schema")] +#[must_use] +pub fn payment_problem_schema() -> schemars::Schema { + use serde_json::json; + let mut schema = schemars::schema_for!(PaymentProblem); + let variants: Vec<_> = PaymentProblemCode::ALL + .iter() + .copied() + .map(|code| { + json!({"properties": { + "type": {"const": code.type_uri()}, + "title": {"const": code.as_str()}, + "status": {"const": code.status()}, + "code": {"const": code.as_str()} + }}) + }) + .collect(); + schema.insert("oneOf".to_owned(), json!(variants)); + schema +} + /// A refused wire value. Messages never contain caller or provider values. #[derive(Debug, thiserror::Error, PartialEq, Eq)] #[error("payment contract: {0}")] diff --git a/crates/registry-payment-protocol/tests/contract.rs b/crates/registry-payment-protocol/tests/contract.rs index 8eee0dd31f..c402f6d68e 100644 --- a/crates/registry-payment-protocol/tests/contract.rs +++ b/crates/registry-payment-protocol/tests/contract.rs @@ -231,6 +231,10 @@ fn authored_money_refuses_zero_and_unsupported_fractional_precision() { #[test] fn payment_problem_accepts_only_declared_fields() { let problem = PaymentProblem::from(PaymentProblemCode::Forbidden); + assert_eq!( + problem.type_uri, + "https://id.registrystack.org/problems/registry-adapter/adapter.payment.forbidden" + ); let mut wire = serde_json::to_value(&problem).unwrap(); assert!(wire.get("failedCheck").is_none()); assert_eq!( @@ -250,3 +254,30 @@ fn payment_problem_accepts_only_declared_fields() { wire["failedCheck"] = json!(42); assert!(serde_json::from_value::(wire).is_err()); } + +#[cfg(feature = "schema")] +#[test] +fn published_payment_problem_schema_checks_the_complete_tuple() { + let document = + serde_json::to_value(registry_payment_protocol::payment_problem_schema()).unwrap(); + let schema = jsonschema::JSONSchema::options() + .with_draft(jsonschema::Draft::Draft202012) + .compile(&document) + .expect("closed Payment problem schema"); + for &code in PaymentProblemCode::ALL { + let body = serde_json::to_value(PaymentProblem::from(code)).unwrap(); + assert!(schema.is_valid(&body), "{body}"); + for (field, wrong) in [ + ( + "type", + json!(format!("urn:registry:problem:{}", code.as_str())), + ), + ("status", json!(599)), + ("title", json!("an unrelated payment problem")), + ] { + let mut mutated = body.clone(); + mutated[field] = wrong; + assert!(!schema.is_valid(&mutated), "{mutated}"); + } + } +} diff --git a/crates/registry-render/src/cli.rs b/crates/registry-render/src/cli.rs index 6c82faa9c4..5f6457ad5e 100644 --- a/crates/registry-render/src/cli.rs +++ b/crates/registry-render/src/cli.rs @@ -310,6 +310,10 @@ pub enum Command { #[command(subcommand)] Generate(GenerateCommand), /// Serve the HTTP rendering API (see the runtime YAML). + /// + /// Configure OIDC authentication with authentication.oidc, or shared API + /// key authentication with authentication.apiKeyRef for unsigned rendering. + /// Sealing requires OIDC. Serve { /// Runtime configuration file. #[arg(long = "runtime-config", value_name = "ABSOLUTE_FILE")] @@ -501,7 +505,7 @@ fn run_inner(cli: Cli) -> Result { if seal { return Err(RenderProblem::new( crate::problem::ProblemKind::InvalidArgument, - "`check --seal` was the old way to build a package: run `registry-render check`, then build a deployment package with `registry-render package --bundle --output `. To seal documents with a PAdES signature, declare `signing.seals` in the runtime file and call `POST /v1/seal/{type}`.", + "`check --seal` was the old way to build a package: run `registry-render check`, then build a deployment package with `registry-render package --bundle --output `. To seal documents with a PAdES signature, declare `signing.seals` in the runtime file and call `POST /v1/seal/{documentType}`.", )); } let declaration = if production && posture.as_deref() == Some("development") { diff --git a/crates/registry-render/src/openapi.rs b/crates/registry-render/src/openapi.rs index 0dd3bdf839..76087f1bb4 100644 --- a/crates/registry-render/src/openapi.rs +++ b/crates/registry-render/src/openapi.rs @@ -2,13 +2,13 @@ //! generator; the JSON file is the contract, and the serve tests pin its routes. //! //! The document describes every route, the seal route included. A -//! deployment without a `signing` block does not mount `/v1/seal/{type}`, +//! deployment without a `signing` block does not mount `/v1/seal/{documentType}`, //! so it serves the document without that path ([`served`]). use std::sync::OnceLock; /// The seal route, present only in a deployment that declares seals. -pub const SEAL_PATH: &str = "/v1/seal/{type}"; +pub const SEAL_PATH: &str = "/v1/seal/{documentType}"; /// The OpenAPI document a deployment serves: the whole contract when it /// seals, and the contract without the seal route when it does not. diff --git a/crates/registry-render/src/runtime.rs b/crates/registry-render/src/runtime.rs index 371a6814fe..99c298cdad 100644 --- a/crates/registry-render/src/runtime.rs +++ b/crates/registry-render/src/runtime.rs @@ -1536,7 +1536,7 @@ fn findings( (None, Some(api_key_ref)) => { if let Err(error) = runtime.secret_providers.check_reference("authentication.apiKeyRef", api_key_ref) { findings.push(block_finding(&error)); } } - _ => findings.push(Finding { code: "render.runtime.authentication", pointer: "/authentication".to_owned(), message: "authentication must configure exactly one of oidc or apiKeyRef".to_owned(), action: "Configure authentication.oidc for the Render resource, or one legacy apiKeyRef; remove the other mode.".to_owned() }), + _ => findings.push(Finding { code: "render.runtime.authentication", pointer: "/authentication".to_owned(), message: "authentication must configure exactly one of oidc or apiKeyRef".to_owned(), action: "Configure authentication.oidc or set authentication.apiKeyRef to a shared API key reference. Omit the other member.".to_owned() }), } if let Err(error) = runtime.audit.settings() { findings.push(audit_finding(&error)); @@ -1665,13 +1665,13 @@ fn signing_findings( message, action: action.to_owned(), }; - // With the legacy key, `authentication` already carries its own refusal when it is + // With the shared key, `authentication` already carries its own refusal when it is // neither mode; only the key mode makes sealing impossible. if runtime.authentication.oidc.is_none() && runtime.authentication.api_key_ref.is_some() { findings.push(finding( "render.runtime.signing-requires-oidc", "/signing".to_owned(), - "signing needs OIDC authentication: the legacy API key cannot say which client is \ + "signing needs OIDC authentication: the shared API key cannot say which client is \ sealing, so it can never be allowed to seal" .to_owned(), "Configure authentication.oidc and name the sealing clients in each seal's allowedClients, or \ diff --git a/crates/registry-render/src/server.rs b/crates/registry-render/src/server.rs index c698bed020..5669aa5dea 100644 --- a/crates/registry-render/src/server.rs +++ b/crates/registry-render/src/server.rs @@ -10,7 +10,7 @@ //! served OpenAPI document omits it, and `/ready` carries no `signing` //! member, so a deployment that does not seal is unchanged. It requires the //! `render:seal` scope, which `render:render` does not imply, and a client -//! the seal's `allowedClients` names; the legacy API key never seals. +//! the seal's `allowedClients` names; the shared API key never seals. use std::collections::BTreeMap; use std::net::SocketAddr; @@ -497,9 +497,9 @@ fn seal_scope_guidance(service: &Service) -> &'static str { _ => SEAL_SCOPE_GUIDANCE, } } -/// The caller guidance the legacy API key receives on the seal route. +/// The caller guidance the shared API key receives on the seal route. const LEGACY_KEY_GUIDANCE: &str = - "The legacy API key cannot seal; present an OIDC resource credential with the render:seal scope."; + "The shared API key cannot seal; present an OIDC resource credential with the render:seal scope."; async fn require_render_bearer( State(service): State>, @@ -600,10 +600,10 @@ async fn require_bearer( return response; } }; - // The legacy API key never seals. The runtime already refuses a signing + // The shared API key never seals. The runtime already refuses a signing // block without OIDC, so this holds even if that check is bypassed. if route == Route::Seal && service.oidc.is_none() { - let problem = RenderProblem::new(ProblemKind::Forbidden, "the legacy API key cannot seal") + let problem = RenderProblem::new(ProblemKind::Forbidden, "the shared API key cannot seal") .with_public_detail(LEGACY_KEY_GUIDANCE); let (path, headers) = (request.uri().path(), request.headers()); return refuse_access( @@ -695,7 +695,7 @@ struct Caller { /// The credential fingerprint, the only caller value the audit records. fingerprint: String, /// The verified OIDC client, for a seal's `allowedClients`; never - /// audited. `None` for the legacy API key or a token naming no client. + /// audited. `None` for the shared API key or a token naming no client. client_id: Option, } @@ -2796,7 +2796,7 @@ pub(crate) mod tests { assert_ne!(drawn, crate::audit::correlation()); } - /// The legacy API key never reaches the seal route, even on a service + /// The shared API key never reaches the seal route, even on a service /// that loaded a seal without OIDC: the bearer layer refuses it before /// the handler, with the guidance it needs, as one refusal entry. #[tokio::test] @@ -2938,13 +2938,13 @@ pub(crate) mod tests { /// The service a refusal case runs against. #[derive(Clone, Copy)] enum Mode { - /// The legacy API key. + /// The shared API key. Legacy, /// An OIDC verifier over a static key set. Oidc, /// An OIDC verifier whose issuer declares service actor kind. OidcDeclaredService, - /// The legacy API key on a service that loaded a seal. + /// The shared API key on a service that loaded a seal. LegacySealed, /// An OIDC verifier and a seal that allows a different client. OidcSealed, @@ -3502,7 +3502,7 @@ pub(crate) mod tests { ); // Verify OpenAPI documents 401, 403, and 503 on GET /v1/document-types and - // non-scope-only 403 descriptions on /v1/render/{type} and /v1/seal/{type}. + // non-scope-only 403 descriptions on the render and seal OpenAPI operations. let openapi: serde_json::Value = serde_json::from_str(crate::openapi::OPENAPI_JSON).unwrap(); let documents_responses = &openapi["paths"]["/v1/document-types"]["get"]["responses"]; @@ -3510,13 +3510,13 @@ pub(crate) mod tests { assert!(documents_responses.get("403").is_some()); assert!(documents_responses.get("503").is_some()); assert!( - openapi["paths"]["/v1/render/{type}"]["post"]["responses"]["403"]["description"] + openapi["paths"]["/v1/render/{documentType}"]["post"]["responses"]["403"]["description"] .as_str() .unwrap() .contains("admitted") ); assert!( - openapi["paths"]["/v1/seal/{type}"]["post"]["responses"]["403"]["description"] + openapi["paths"]["/v1/seal/{documentType}"]["post"]["responses"]["403"]["description"] .as_str() .unwrap() .contains("admitted") diff --git a/crates/registry-render/tests/scaffold.rs b/crates/registry-render/tests/scaffold.rs index 6dceb6de11..20c48297d7 100644 --- a/crates/registry-render/tests/scaffold.rs +++ b/crates/registry-render/tests/scaffold.rs @@ -377,7 +377,7 @@ fn retired_seal_command_names_the_package_replacement() { run(&["init", dir.to_str().unwrap()]); let bundle = dir.to_str().unwrap(); let sealing = "To seal documents with a PAdES signature, declare `signing.seals` in the \ - runtime file and call `POST /v1/seal/{type}`."; + runtime file and call `POST /v1/seal/{documentType}`."; let refused = run(&["seal", "--bundle", bundle]); assert_eq!( refused.status.code(), @@ -1156,7 +1156,7 @@ fn openapi_document_has_no_drift() { "/ready", "/openapi.json", "/v1/document-types", - "/v1/render/{type}", + "/v1/render/{documentType}", ]; assert_eq!(paths.len(), expected_paths.len(), "{paths:?}"); for path in expected_paths { @@ -1167,7 +1167,7 @@ fn openapi_document_has_no_drift() { ["required"], serde_json::json!(["status", "posture", "developmentSettings"]) ); - let render = &paths["/v1/render/{type}"]["post"]; + let render = &paths["/v1/render/{documentType}"]["post"]; assert!( render["security"][0]["bearerAuth"].is_array(), "auth is declared and enforced" diff --git a/crates/registry-render/tests/serve.rs b/crates/registry-render/tests/serve.rs index 6e0576c264..04fa1a056e 100644 --- a/crates/registry-render/tests/serve.rs +++ b/crates/registry-render/tests/serve.rs @@ -923,6 +923,11 @@ fn the_openapi_document_declares_what_the_render_route_answers() { let document = request(server.port, "GET", "/openapi.json", &[], None); assert_eq!(document.status, 200); let openapi: serde_json::Value = serde_json::from_slice(&document.body).expect("openapi json"); + let bearer = openapi["components"]["securitySchemes"]["bearerAuth"]["description"] + .as_str() + .expect("bearer authentication description"); + assert!(bearer.contains("shared API key")); + assert!(bearer.contains("authentication.apiKeyRef")); fn media(reply: &Reply) -> &str { reply .headers @@ -965,13 +970,13 @@ fn the_openapi_document_declares_what_the_render_route_answers() { assert!(properties.contains_key(member), "missing field {member}"); } } - let operation = &openapi["paths"]["/v1/render/{type}"]["post"]; + let operation = &openapi["paths"]["/v1/render/{documentType}"]["post"]; assert!(operation["parameters"] .as_array() .unwrap() .iter() .any(|parameter| { - parameter["name"] == "type" + parameter["name"] == "documentType" && parameter["in"] == "path" && parameter["required"] == true })); diff --git a/crates/registry-render/tests/serve_seal.rs b/crates/registry-render/tests/serve_seal.rs index 4159059751..25b6f41c32 100644 --- a/crates/registry-render/tests/serve_seal.rs +++ b/crates/registry-render/tests/serve_seal.rs @@ -1123,13 +1123,13 @@ fn the_openapi_document_declares_what_the_seal_route_answers() { include_bytes!("../../../products/render/generated/registry-render.openapi.json"); assert_eq!(reply.body.as_slice(), contract); let openapi = reply.json(); - let operation = &openapi["paths"]["/v1/seal/{type}"]["post"]; + let operation = &openapi["paths"]["/v1/seal/{documentType}"]["post"]; assert!(operation["parameters"] .as_array() .unwrap() .iter() .any(|parameter| { - parameter["name"] == "type" + parameter["name"] == "documentType" && parameter["in"] == "path" && parameter["required"] == true })); @@ -1454,7 +1454,7 @@ fn without_signing_the_seal_route_and_signing_readiness_do_not_exist() { serde_json::json!({"status":"ready","posture":"development","developmentSettings":[{"code":"render.posture.seals-not-served","pointer":"/signing"}]}) ); let openapi = request(server.port, "GET", "/openapi.json", &[], None).json(); - assert!(openapi["paths"].get("/v1/seal/{type}").is_none()); + assert!(openapi["paths"].get("/v1/seal/{documentType}").is_none()); } #[test] @@ -1654,7 +1654,7 @@ fn readiness_reports_each_seal_and_never_requests_a_timestamp() { } assert_eq!(tsa.requests.load(Ordering::SeqCst), 0); let openapi = request(server.port, "GET", "/openapi.json", &[], None).json(); - let seal = &openapi["paths"]["/v1/seal/{type}"]["post"]; + let seal = &openapi["paths"]["/v1/seal/{documentType}"]["post"]; assert!(seal["security"][0]["bearerAuth"].is_array()); for status in ["200", "400", "401", "403", "429", "502", "503"] { assert!(seal["responses"].get(status).is_some(), "{status}"); diff --git a/docs/site/scripts/generate-breg-configuration.mjs b/docs/site/scripts/generate-breg-configuration.mjs index d9d65763a0..3b6d9e0eb8 100644 --- a/docs/site/scripts/generate-breg-configuration.mjs +++ b/docs/site/scripts/generate-breg-configuration.mjs @@ -106,6 +106,8 @@ export const SERVICE_CONTRACTS = [ export const CLIENT_CAPABILITIES = 'products/breg/contracts/client-capabilities.json'; const PROPOSAL_QUERY_TYPE = 'BRegProposalQuery.'; +const PROPOSAL_NODE_QUERY = 'BaseRegistryClient.listProposals.query'; +const PROPOSAL_PYTHON_QUERY = 'BaseRegistryClient.list_proposals.query'; async function readContracts(repoRoot, contracts) { return Promise.all(contracts.map(async (entry) => { @@ -125,14 +127,15 @@ export function proposalQueryKeys(inventory) { if (bindings === null || typeof bindings !== 'object') { throw new Error(`${CLIENT_CAPABILITIES} has no queryOptionBindings`); } - const keys = Object.entries(bindings) - .filter(([, binding]) => binding.rust.every((name) => name.startsWith(PROPOSAL_QUERY_TYPE))) - .map(([key, binding]) => ({ - key, - rust: binding.rust, - node: binding.node, - python: binding.python, - })); + const keys = []; + for (const [key, binding] of Object.entries(bindings)) { + const rust = binding.rust.filter((name) => name.startsWith(PROPOSAL_QUERY_TYPE)); + if (rust.length === 0) continue; + if (!binding.node.includes(PROPOSAL_NODE_QUERY) || !binding.python.includes(PROPOSAL_PYTHON_QUERY)) { + throw new Error(`${CLIENT_CAPABILITIES}: ${key} lacks the Proposal list query binding for Node or Python`); + } + keys.push({ key, rust, node: [PROPOSAL_NODE_QUERY], python: [PROPOSAL_PYTHON_QUERY] }); + } if (keys.length === 0) throw new Error(`${CLIENT_CAPABILITIES} binds no Proposal list query key`); return keys; } diff --git a/docs/site/scripts/generate-breg-configuration.test.mjs b/docs/site/scripts/generate-breg-configuration.test.mjs index c321f7ff03..783cae898e 100644 --- a/docs/site/scripts/generate-breg-configuration.test.mjs +++ b/docs/site/scripts/generate-breg-configuration.test.mjs @@ -161,12 +161,23 @@ test('Proposal list query keys come from the client capability inventory', async assert.deepEqual(document.client_proposal_query.keys.map((entry) => entry.key), ['action', 'owner', 'target', 'state', 'cursor', 'limit', 'turn', 'pendingManualApplication']); for (const entry of document.client_proposal_query.keys) { + if (['cursor', 'limit'].includes(entry.key)) continue; assert.deepEqual(entry, { key: entry.key, ...inventory.queryOptionBindings[entry.key] }); } + for (const key of ['cursor', 'limit']) { + assert.ok(inventory.queryOptionBindings[key].rust.length > 1, `${key} is shared with record lists`); + assert.deepEqual(document.client_proposal_query.keys.find((entry) => entry.key === key), { + key, rust: [`BRegProposalQuery.${key}`], node: ['BaseRegistryClient.listProposals.query'], + python: ['BaseRegistryClient.list_proposals.query'], + }); + } assert.throws(() => proposalQueryKeys({}), /queryOptionBindings/); assert.throws(() => proposalQueryKeys({ queryOptionBindings: { accessProfile: { rust: ['BRegRecordOptions.access_profile'], node: [], python: [] }, } }), /no Proposal list query key/); + assert.throws(() => proposalQueryKeys({ queryOptionBindings: { + limit: { rust: ['BRegProposalQuery.limit'], node: ['ListOptions.limit'], python: [] }, + } }), /limit lacks the Proposal list query binding/); }); test('schema defaults preserve false, null, collections, and referenced defaults', () => { diff --git a/docs/site/scripts/openapi-renderer.mjs b/docs/site/scripts/openapi-renderer.mjs index 62e1b3d6c2..79d1e8190b 100644 --- a/docs/site/scripts/openapi-renderer.mjs +++ b/docs/site/scripts/openapi-renderer.mjs @@ -1,8 +1,8 @@ // starlight-openapi 0.27 assumes property/item schemas are objects when // generating examples. OpenAPI 3.1 also permits boolean JSON Schemas. Keep -// the product artifact unchanged and adapt only the renderer's input: true -// and {} accept the same values. Remove this adapter once the renderer -// supports native boolean schemas, including examples for false schemas. +// the product artifact unchanged and adapt only the renderer's input. +// Remove this adapter once the renderer supports native boolean schemas, +// including examples for prohibited properties. const schemaMaps = new Set(['properties', 'patternProperties', '$defs', 'definitions', 'dependentSchemas']); const schemaLists = new Set(['allOf', 'anyOf', 'oneOf', 'prefixItems']); @@ -19,11 +19,19 @@ export function projectOpenApiForRenderer(document) { throw new Error(`OpenAPI renderer does not support false schema at ${path}; upgrade starlight-openapi before rendering this contract`); } if (!value || typeof value !== 'object' || Array.isArray(value)) return value; - return Object.fromEntries(Object.entries(value).map(([key, child]) => { + const prohibitedProperties = []; + const result = Object.fromEntries(Object.entries(value).map(([key, child]) => { const childPath = `${path}/${escapePointer(key)}`; if (schemaMaps.has(key) && child && typeof child === 'object') { - return [key, Object.fromEntries(Object.entries(child).map(([name, entry]) => - [name, schema(entry, `${childPath}/${escapePointer(name)}`)]))]; + const entries = []; + for (const [name, entry] of Object.entries(child)) { + if (key === 'properties' && entry === false && !value.required?.includes(name)) { + prohibitedProperties.push(name); + continue; + } + entries.push([name, schema(entry, `${childPath}/${escapePointer(name)}`)]); + } + return [key, Object.fromEntries(entries)]; } if (schemaLists.has(key) && Array.isArray(child)) { return [key, child.map((entry, index) => schema(entry, `${childPath}/${index}`))]; @@ -37,6 +45,14 @@ export function projectOpenApiForRenderer(document) { if (propertyFlags.has(key) && typeof child !== 'boolean') return [key, schema(child, childPath)]; return [key, child]; })); + if (prohibitedProperties.length > 0) { + // The assertion still forbids each name. The example generator only + // visits declared properties, so it leaves these out of its fallback. + const restriction = { not: { enum: prohibitedProperties } }; + result.propertyNames = result.propertyNames === undefined + ? restriction : { allOf: [result.propertyNames, restriction] }; + } + return result; } function map(value, path, visit) { diff --git a/docs/site/scripts/openapi-renderer.test.mjs b/docs/site/scripts/openapi-renderer.test.mjs index 76611ccaf3..e8c07978d1 100644 --- a/docs/site/scripts/openapi-renderer.test.mjs +++ b/docs/site/scripts/openapi-renderer.test.mjs @@ -61,7 +61,9 @@ test('boolean schemas adapt without changing annotation values, flags, or refere }); test('false schemas fail with an actionable JSON pointer instead of an invalid generated example', () => { - const original = { components: { schemas: { 'not/allowed': { properties: { body: false } } } } }; + const original = { components: { schemas: { 'not/allowed': { + required: ['body'], properties: { body: false }, + } } } }; assert.throws(() => projectOpenApiForRenderer(original), /false schema at #\/components\/schemas\/not~1allowed\/properties\/body; upgrade starlight-openapi/); assert.equal(original.components.schemas['not/allowed'].properties.body, false); @@ -69,6 +71,41 @@ test('false schemas fail with an actionable JSON pointer instead of an invalid g assert.equal(createSchemaExampleValue({ not: {} }), 'example'); }); +test('optional prohibited properties keep their restriction and stay out of generated examples', () => { + const original = { components: { schemas: { Variant: { + type: 'object', additionalProperties: false, + propertyNames: { pattern: '^[a-zA-Z]+$' }, + properties: { code: { const: 'refusal' }, failedCheck: false, credential: false }, + } } } }; + const snapshot = structuredClone(original); + const { Variant } = projectOpenApiForRenderer(original).components.schemas; + assert.deepEqual(original, snapshot); + assert.deepEqual(Variant, { + type: 'object', additionalProperties: false, + propertyNames: { allOf: [{ pattern: '^[a-zA-Z]+$' }, { not: { enum: ['failedCheck', 'credential'] } }] }, + properties: { code: { const: 'refusal' } }, + }); + assert.deepEqual(createSchemaExampleValue(Variant), { code: 'refusal' }); +}); + +test('the published Evidence problem variants project the prohibited diagnostic without changing the contract', () => { + const source = new URL('../../../products/evidence/generated/registry-evidence.openapi.json', import.meta.url); + const original = JSON.parse(readFileSync(source, 'utf8')); + const { Problem } = projectOpenApiForRenderer(original).components.schemas; + const variants = original.components.schemas.Problem.oneOf; + assert.equal(variants.filter((variant) => variant.properties.failedCheck === false).length, 7); + for (const [index, variant] of variants.entries()) { + const projected = Problem.oneOf[index]; + if (variant.properties.failedCheck === false) { + assert.deepEqual(projected.propertyNames, { not: { enum: ['failedCheck'] } }); + assert.equal(Object.hasOwn(createSchemaExampleValue(projected), 'failedCheck'), false); + } else { + assert.deepEqual(projected, variant); + } + } + assert.deepEqual(original, JSON.parse(readFileSync(source, 'utf8'))); +}); + test('operation, callback, webhook, header, and media schemas use the same projection', () => { const data = { get: { responses: { 200: { content: { 'application/json': { schema: false } } } } } }; const operation = { parameters: [{ name: 'body', in: 'query', schema: true }], diff --git a/docs/site/src/content/docs/configure/adapter.mdx b/docs/site/src/content/docs/configure/adapter.mdx index e327529484..24b3211bb4 100644 --- a/docs/site/src/content/docs/configure/adapter.mdx +++ b/docs/site/src/content/docs/configure/adapter.mdx @@ -92,7 +92,7 @@ The built-in Consultation target is the exception: the product owns its standard See [Adapter Consultation](../adapter-consultation/). The first profile, `breg-records` v1, is a starting target, not the only one. -It mirrors the Base Registry Engine (BReg) public read surface, `/v1/records/{type}` and `/v1/records/{type}/{record_id}`, with the operations `records-search` and `records-get`. +It mirrors the Base Registry Engine (BReg) public read surface, `/v1/records/{type}` and `/v1/records/{type}/{recordId}`, with the operations `records-search` and `records-get`. It adds write operations `records-create`, `records-update` and `records-patch`, and answers in the Registry Record v1 shape. A contract that a ministry already publishes can use another profile file. diff --git a/docs/site/src/content/docs/configure/breg-record-timers.mdx b/docs/site/src/content/docs/configure/breg-record-timers.mdx index 5740c3b98e..3aa94ff481 100644 --- a/docs/site/src/content/docs/configure/breg-record-timers.mdx +++ b/docs/site/src/content/docs/configure/breg-record-timers.mdx @@ -241,7 +241,7 @@ That coverage does not extend to actual `bregctl` process logging or to every fa Run the normal authoring checks and inspect the compiled access report: ```sh -bregctl check ./registry --production +bregctl check ./registry --posture production --require-package-closure bregctl --format json explain access ./registry ``` diff --git a/docs/site/src/content/docs/configure/casework.mdx b/docs/site/src/content/docs/configure/casework.mdx index 435789efbb..066133f9d3 100644 --- a/docs/site/src/content/docs/configure/casework.mdx +++ b/docs/site/src/content/docs/configure/casework.mdx @@ -927,7 +927,7 @@ Successful assignment, claim, caseload transfer, release or task closure clears ## Check a deployment before activation -`caseworkctl check ./casework --production` reads the exact package input closure and points an unpaired context provider back to its authored `description` with the `provider pair` recovery command. +`caseworkctl check ./casework --posture production --require-package-closure` reads the exact package input closure and points an unpaired context provider back to its authored `description` with the `provider pair` recovery command. It writes no package and contacts no runtime dependency. `plan` reads the configured database, and `doctor` also checks the audit destination. [Deploy Registry Casework](../../operate/casework/) covers activation. diff --git a/docs/site/src/content/docs/configure/discovery.mdx b/docs/site/src/content/docs/configure/discovery.mdx index 8f2f723b03..6b762247a1 100644 --- a/docs/site/src/content/docs/configure/discovery.mdx +++ b/docs/site/src/content/docs/configure/discovery.mdx @@ -65,7 +65,7 @@ A provider gives you the HTTPS URL of its public description out of band. Check production does, with `--production`: ```sh test-exit="1" -discoveryctl check --project discovery-project --production +discoveryctl check --project discovery-project --posture production ``` ```text test-expect diff --git a/docs/site/src/content/docs/configure/evidence-oid4vp.mdx b/docs/site/src/content/docs/configure/evidence-oid4vp.mdx index b90a30d74b..6fb0ab6e2b 100644 --- a/docs/site/src/content/docs/configure/evidence-oid4vp.mdx +++ b/docs/site/src/content/docs/configure/evidence-oid4vp.mdx @@ -252,7 +252,7 @@ evidence-oid4vp openapi --output evidence-oid4vp.openapi.json Your portal creates a session at `POST /v1/sessions` with an applicant token and shows the returned wallet link; the wallet fetches the request object and posts its encrypted response; Evidence reads the result. The [wallet presentation API reference](../../reference/apis/evidence-oid4vp/) renders -the same contract. `GET /v1/sessions/{reference}` reports `pending`, `received`, or `failed`, and +the same contract. `GET /v1/sessions/{sessionReference}` reports `pending`, `received`, or `failed`, and adds a `failureCategory` when the wallet reported an error; it never returns presented content. The token issuers and their key sets can use loopback HTTP in either posture. HTTP beyond loopback requires development and `allowInsecureHttp: true`. A successful `/ready` response includes `posture` and `developmentSettings` alongside `status`. diff --git a/docs/site/src/content/docs/configure/scheduling.mdx b/docs/site/src/content/docs/configure/scheduling.mdx index 8b078a1c6e..d3d4c903a2 100644 --- a/docs/site/src/content/docs/configure/scheduling.mdx +++ b/docs/site/src/content/docs/configure/scheduling.mdx @@ -404,7 +404,7 @@ The source that approved the grant remains independent of the booking record and The write is: ```http -PUT /v1/appointments/{appointment_id}/attendance +PUT /v1/appointments/{appointmentId}/attendance Authorization: Bearer TASK_TOKEN Idempotency-Key: caller-chosen-key Content-Type: application/json diff --git a/docs/site/src/content/docs/operate/advanced/upgrade-and-retire.mdx b/docs/site/src/content/docs/operate/advanced/upgrade-and-retire.mdx index 369e6db499..bd3c65aa03 100644 --- a/docs/site/src/content/docs/operate/advanced/upgrade-and-retire.mdx +++ b/docs/site/src/content/docs/operate/advanced/upgrade-and-retire.mdx @@ -217,7 +217,7 @@ so a binary that cannot run leaves the installed toolset selected. `authentication.oidc.issuers` entry and replace `tokenTypes: [at+jwt]` with `accessTokenType: at+jwt`. Keep principal, tag, audience-claim, and scope settings on the outer OIDC block. Review any changed source bindings. Check and test the copied project with - `evidencectl check --target TARGET --production PROJECT` and + `evidencectl check --target TARGET --posture production --require-deployment-closure PROJECT` and `evidencectl test --target TARGET PROJECT`. Retired split authoring documents need the normalised project form. Use `evidencectl package --target TARGET --output CANDIDATE PROJECT` and install the rebuilt diff --git a/docs/site/src/content/docs/operate/breg-changes.mdx b/docs/site/src/content/docs/operate/breg-changes.mdx index a7f812fbb7..2729de0826 100644 --- a/docs/site/src/content/docs/operate/breg-changes.mdx +++ b/docs/site/src/content/docs/operate/breg-changes.mdx @@ -34,7 +34,7 @@ compound alias, advance the edited module's version, and refresh its lock with t ```sh bregctl project lock ./normalized-registry -bregctl check ./normalized-registry --production +bregctl check ./normalized-registry --posture production --require-package-closure ``` Review the normalised source to confirm that requiredness, classification, grants, identifiers, diff --git a/docs/site/src/content/docs/operate/breg.mdx b/docs/site/src/content/docs/operate/breg.mdx index 7ed7a1f543..4eb9ce1780 100644 --- a/docs/site/src/content/docs/operate/breg.mdx +++ b/docs/site/src/content/docs/operate/breg.mdx @@ -17,7 +17,7 @@ tutorial_test: --- You have a [registry project](../../reference/glossary/#registry-project) that passes -`bregctl check --production`, and you want it serving. This page takes you from an empty +`bregctl check --posture production --require-package-closure`, and you want it serving. This page takes you from an empty PostgreSQL server to a `breg` process that serves the project's first [package](../../reference/glossary/#package) and answers `GET /ready`. The examples use the facility template that `bregctl init --template facility-registry facility` creates. @@ -469,7 +469,7 @@ These three commands turn the project into a package the database can activate. the runtime file you will serve, so it also checks that file against the project: ```sh -bregctl check facility --runtime-config /etc/breg/runtime.yaml --production +bregctl check facility --runtime-config /etc/breg/runtime.yaml --posture production --require-package-closure ``` ```text @@ -478,7 +478,7 @@ Production check passed; registry revision sha256:4877be0dd9ded0447278206d829445 Warnings follow the success line. Read each one. -`check --production` declares production and checks package closure. A check +`--posture production` declares production. Add `--require-package-closure` to check the exact package inputs. A check without the flag still defaults to production for the runtime file. Use `--posture development` to report development settings as warnings in a laptop file. diff --git a/docs/site/src/content/docs/operate/registry-render.mdx b/docs/site/src/content/docs/operate/registry-render.mdx index 65a9abbcaf..da1e6b70d9 100644 --- a/docs/site/src/content/docs/operate/registry-render.mdx +++ b/docs/site/src/content/docs/operate/registry-render.mdx @@ -273,9 +273,9 @@ and `audit-failed` (503). ### Authenticate callers with OIDC tokens -Choose exactly one non-null authentication mode: `authentication.oidc` or the legacy -`authentication.apiKeyRef`, which keeps its secret-provider and entropy checks. Do not configure both, -and do not use null as an absent member. For OIDC, the block is: +Choose one non-null authentication mode. Use `authentication.oidc` for OIDC or +`authentication.apiKeyRef` for shared API key authentication. A shared key must pass the +secret-provider and entropy checks. Omit the other member. For OIDC, configure this block. ```yaml authentication: @@ -329,7 +329,7 @@ certificate, its issuer, and how you hold the key. ### Enable a seal -You need an OIDC deployment (a seal never works with the legacy API key), a seal certificate chain +You need an OIDC deployment (a seal never works with the shared API key), a seal certificate chain in a PEM file with the seal certificate first, and the seal key in Vault or OpenBao Transit: an `ecdsa-p256` key created non-exportable, reached through a Transit signing proxy on a Unix socket on the Render host. The proxy holds the Transit token; Render sends none. Create the key and its diff --git a/docs/site/src/content/docs/operate/stuck-work.mdx b/docs/site/src/content/docs/operate/stuck-work.mdx index faf2605a14..bf49037380 100644 --- a/docs/site/src/content/docs/operate/stuck-work.mdx +++ b/docs/site/src/content/docs/operate/stuck-work.mdx @@ -162,9 +162,9 @@ Use the metrics. - The metrics listener also serves `/version`. **Clear.** Supervisors move overdue tasks over HTTP with their own credentials. -The routes are `POST /v1/review-tasks/{task_id}/assign`, `release`, `claim`, and `delegate`. +The routes are `POST /v1/review-tasks/{taskId}/assign`, `release`, `claim`, and `delegate`. `GET /v1/review-tasks/supervision` lists tasks for a supervisor. -A producer withdraws a request with `POST /v1/review-requests/{request_id}/cancel`. +A producer withdraws a request with `POST /v1/review-requests/{requestId}/cancel`. These are caller actions under a role, not an operator token API. A dead-lettered completion delivery shows in `casework_completion_deliveries`, but Casework has no command or route to retry or discard it. @@ -204,7 +204,7 @@ No gauge counts failed messages, so alert on `transient` attempts and list them - The state-changing commands take `--apply`. - `messagingctl retention erase-expired` erases expired data on demand. -Over HTTP, `POST /v1/messages/{message_id}/cancel` cancels a message with an operator or owner profile. +Over HTTP, `POST /v1/messages/{messageId}/cancel` cancels a message with an operator or owner profile. It works only before dispatch has leased the message. Otherwise the service answers that dispatch has started or the message is already terminal. diff --git a/docs/site/src/content/docs/reference/apis/registry-casework.mdx b/docs/site/src/content/docs/reference/apis/registry-casework.mdx index 3bcda0c921..5c3b5019eb 100644 --- a/docs/site/src/content/docs/reference/apis/registry-casework.mdx +++ b/docs/site/src/content/docs/reference/apis/registry-casework.mdx @@ -34,38 +34,38 @@ A role that a row does not name is refused with `operation.not-authorized`. | GET | `/health`, `/ready` | Anyone, no token | `200`; `/ready` answers `503` while storage or the audit journal is unavailable | | GET | `/.well-known/jwks.json` | Anyone, no token | Keys that verify task assertions | | GET | `/v1/casework` | Any profile | The deployed project, without providers, calendars, or clocks for a requester | -| GET | `/v1/review-policies`, `/v1/review-policies/{policy_id}` | Any profile | The compiled ReviewPolicy closures the caller may use | +| GET | `/v1/review-policies`, `/v1/review-policies/{policyId}` | Any profile | The compiled ReviewPolicy closures the caller may use | | POST | `/v1/review-requests` | Requester | `201` with the accepted [ReviewRequest](../../glossary/#review-request), `200` on recovery | -| GET | `/v1/review-requests/{request_id}` | Requester | The request's state | -| POST | `/v1/review-requests/{request_id}/cancel` | Requester | The cancellation | -| GET | `/v1/review-requests/{request_id}/result` | Requester | `200` with the ReviewResult; bodiless `202` pending, `410` erased | +| GET | `/v1/review-requests/{requestId}` | Requester | The request's state | +| POST | `/v1/review-requests/{requestId}/cancel` | Requester | The cancellation | +| GET | `/v1/review-requests/{requestId}/result` | Requester | `200` with the ReviewResult; bodiless `202` pending, `410` erased | | GET | `/v1/review-results` | Requester | A resumable page of settled results | | GET | `/v1/review-asks` | Requester | A resumable page of ask announcements, `410` past retention | -| GET | `/v1/review-requests/{request_id}/asks/{ask_id}` | Requester that created the request | The ask; an empty `404` for any other ask | -| POST | `/v1/review-requests/{request_id}/asks/{ask_id}/answer` | Requester that created the request | The answered ask; `409` `review.ask-not-open` when it is not open | -| GET | `/v1/review-requests/{request_id}/history`, `/clocks` | Reviewer or requester | History; clocks | -| POST | `/v1/review-requests/{request_id}/notes` | Reviewer; requester for requester-audience notes | The entry | +| GET | `/v1/review-requests/{requestId}/asks/{askId}` | Requester that created the request | The ask; an empty `404` for any other ask | +| POST | `/v1/review-requests/{requestId}/asks/{askId}/answer` | Requester that created the request | The answered ask; `409` `review.ask-not-open` when it is not open | +| GET | `/v1/review-requests/{requestId}/history`, `/clocks` | Reviewer or requester | History; clocks | +| POST | `/v1/review-requests/{requestId}/notes` | Reviewer; requester for requester-audience notes | The entry | | GET | `/v1/review-tasks`, `/next`, `/holdings`, `/own-decisions` | Staff, supervisor | ReviewTasks | | GET | `/v1/review-tasks/supervision` | Supervisor | Tasks in served queues | -| GET | `/v1/review-tasks/{task_id}`, `/context` | Staff, supervisor | The task; its review context | +| GET | `/v1/review-tasks/{taskId}`, `/context` | Staff, supervisor | The task; its review context | | GET | `/v1/delegated-staff/review-tasks` | Configured delegated reader representing staff | A page of tasks assigned to the represented staff member, in due order | -| GET | `/v1/delegated-staff/review-tasks/{task_id}/context` | Configured delegated reader representing the holder | The held task's review context | -| POST | `/v1/review-tasks/{task_id}/claim`, `/release` | Staff, supervisor | The task | -| POST | `/v1/review-tasks/{task_id}/assign` | Supervisor serving the queue | The task | -| POST | `/v1/review-tasks/{task_id}/delegate` | A reviewer whose profile decides the stage | The task | -| GET, PUT, DELETE | `/v1/review-tasks/{task_id}/draft` | The holder | The private draft; `204` on delete | -| POST | `/v1/review-tasks/{task_id}/decisions` | The holder | `204` | -| POST | `/v1/review-tasks/{task_id}/asks` | The holder, at a stage that declares `asks` | The task with its `waiting` marker, and the ask | -| GET | `/v1/review-tasks/{task_id}/task-templates` | Staff, supervisor | Task grant previews | -| GET, POST | `/v1/review-tasks/{task_id}/task-grants` | Staff, supervisor | Grants on the task; the approved grant | -| POST | `/v1/review-tasks/{task_id}/task-grants/{grant_id}/revoke` | Staff, supervisor | The revocation | -| POST | `/v1/task-grants/{grant_id}/assertion` | The grant's agent, scope `casework:grants:assert` | A signed task assertion | -| GET | `/v1/task-grants/{grant_id}/status` | A service, scope `casework:grants:status` | Current status | -| GET | `/v1/review-accountability/{event_id}` | Supervisor | The accountability record | -| GET, PUT | `/v1/directory`, `/v1/directory/teams/{team_id}`; POST `/v1/directory/bootstrap` | Administrator | The directory | +| GET | `/v1/delegated-staff/review-tasks/{taskId}/context` | Configured delegated reader representing the holder | The held task's review context | +| POST | `/v1/review-tasks/{taskId}/claim`, `/release` | Staff, supervisor | The task | +| POST | `/v1/review-tasks/{taskId}/assign` | Supervisor serving the queue | The task | +| POST | `/v1/review-tasks/{taskId}/delegate` | A reviewer whose profile decides the stage | The task | +| GET, PUT, DELETE | `/v1/review-tasks/{taskId}/draft` | The holder | The private draft; `204` on delete | +| POST | `/v1/review-tasks/{taskId}/decisions` | The holder | `204` | +| POST | `/v1/review-tasks/{taskId}/asks` | The holder, at a stage that declares `asks` | The task with its `waiting` marker, and the ask | +| GET | `/v1/review-tasks/{taskId}/task-templates` | Staff, supervisor | Task grant previews | +| GET, POST | `/v1/review-tasks/{taskId}/task-grants` | Staff, supervisor | Grants on the task; the approved grant | +| POST | `/v1/review-tasks/{taskId}/task-grants/{grantId}/revoke` | Staff, supervisor | The revocation | +| POST | `/v1/task-grants/{grantId}/assertion` | The grant's agent, scope `casework:grants:assert` | A signed task assertion | +| GET | `/v1/task-grants/{grantId}/status` | A service, scope `casework:grants:status` | Current status | +| GET | `/v1/review-accountability/{eventId}` | Supervisor | The accountability record | +| GET, PUT | `/v1/directory`, `/v1/directory/teams/{teamId}`; POST `/v1/directory/bootstrap` | Administrator | The directory | | GET | `/v1/directory/targets` | By purpose | Nameable people and queues | -| GET, POST, PUT, DELETE | `/v1/directory/absences`, `/{absence_id}` | Staff for self, supervisor for team, administrator | Absences | -| POST, GET | `/v1/directory/holidays`, `/{id}/revisions/{revision}` | Administrator | Holiday set revisions | +| GET, POST, PUT, DELETE | `/v1/directory/absences`, `/{absenceId}` | Staff for self, supervisor for team, administrator | Absences | +| POST, GET | `/v1/directory/holidays`, `/{holidayId}/revisions/{holidayRevision}` | Administrator | Holiday set revisions | | POST | `/v1/directory/clocks/recompute/preview`, `/apply` | Administrator | Preview, then result | | POST | `/v1/directory/caseload/preview`, `/apply` | Supervisor | Preview, then result | @@ -127,7 +127,7 @@ carries `Cache-Control: no-store`. `POST /v1/review-requests` names a policy `id`. Omit `version` and `digest` to take the ReviewPolicy active at admission, or send both to require the `identity` that -`GET /v1/review-policies/{policy_id}` returned; a differing pin is `review.policy-mismatch`. The +`GET /v1/review-policies/{policyId}` returned; a differing pin is `review.policy-mismatch`. The ReviewResult repeats the accepted binding with the subject and `submissionDigest`; the consumer checks that correlation and authorises any business change itself. diff --git a/docs/site/src/content/docs/reference/apis/registry-messaging.mdx b/docs/site/src/content/docs/reference/apis/registry-messaging.mdx index fbca2d4bb7..41e21be659 100644 --- a/docs/site/src/content/docs/reference/apis/registry-messaging.mdx +++ b/docs/site/src/content/docs/reference/apis/registry-messaging.mdx @@ -187,7 +187,7 @@ is checked against the template version's JSON Schema before anything renders. A ## Message status -`GET /v1/messages/{message_id}` answers two facts separately, and one status derived from them: +`GET /v1/messages/{messageId}` answers two facts separately, and one status derived from them: - `dispatch` is what the worker did with the message: `queued`, `sending`, `submitted`, `failed`, `unknown`, `cancelled`, or `expired`. `submitted` means the provider accepted the message, never @@ -216,7 +216,7 @@ the reference itself. {/* Evidence: crates/registry-messaging/src/messages.rs, MASKED_CONTACT; crates/registry-messaging-core/src/wire.rs, AttemptOutcome and AttemptSummary. */} -`POST /v1/messages/{message_id}/cancel` cancels a message that is still queued, including one +`POST /v1/messages/{messageId}/cancel` cancels a message that is still queued, including one waiting for a retry. Once dispatch started it answers `409 message.dispatch-started`, and once the message reached a final state it answers `409 message.terminal`. @@ -224,9 +224,9 @@ message reached a final state it answers `409 message.terminal`. ## Provider callbacks -A provider that reports delivery calls `POST /v1/provider-callbacks/{provider_id}` when the runtime +A provider that reports delivery calls `POST /v1/provider-callbacks/{providerId}` when the runtime configuration gives it an `hmac-sha1-url-form` or `hmac-sha256-body` callback verifier, or -`POST /v1/provider-callbacks/{provider_id}/{token}` when it gives it a `path-token` verifier. These +`POST /v1/provider-callbacks/{providerId}/{token}` when it gives it a `path-token` verifier. These routes take no bearer token: the verifier authenticates each callback, and the provider package's receipt script reads it. @@ -275,11 +275,11 @@ HTTP status listed beside it. `request.not-found` answers a path the contract do | `GET /ready` | None | `200` when the database carries every expected migration and its package ledger names the package this process serves active, `503 service.unavailable` otherwise | | `POST /v1/messages` | Bearer, sender | Submit one message | | `POST /v1/messages/receipt` | Bearer, the exact original submitting principal | Observe a retained success receipt using the original key and request | -| `GET /v1/messages/{message_id}` | Bearer, the submitting principal or an operator | Read one message's status and attempts | -| `POST /v1/messages/{message_id}/cancel` | Bearer, the submitting principal or an operator | Cancel a queued message | -| `POST /v1/templates/{template_id}/versions/{version}/preview` | Bearer, sender | Render a listed template version with given data, persisting nothing | -| `POST /v1/provider-callbacks/{provider_id}` | The provider's callback verifier | Take one delivery callback | -| `POST /v1/provider-callbacks/{provider_id}/{token}` | A `path-token` verifier | Take one delivery callback | +| `GET /v1/messages/{messageId}` | Bearer, the submitting principal or an operator | Read one message's status and attempts | +| `POST /v1/messages/{messageId}/cancel` | Bearer, the submitting principal or an operator | Cancel a queued message | +| `POST /v1/templates/{templateId}/versions/{templateVersion}/preview` | Bearer, sender | Render a listed template version with given data, persisting nothing | +| `POST /v1/provider-callbacks/{providerId}` | The provider's callback verifier | Take one delivery callback | +| `POST /v1/provider-callbacks/{providerId}/{token}` | A `path-token` verifier | Take one delivery callback | {/* Evidence: crates/registry-messaging/src/http.rs, router(); products/messaging/generated/registry-messaging.openapi.json. */} diff --git a/docs/site/src/content/docs/reference/casework-configuration.mdx b/docs/site/src/content/docs/reference/casework-configuration.mdx index 2c4169440c..b698b272b5 100644 --- a/docs/site/src/content/docs/reference/casework-configuration.mdx +++ b/docs/site/src/content/docs/reference/casework-configuration.mdx @@ -444,12 +444,12 @@ Verification precedes source I/O and any output, including empty pages. A human request to a current-source target without `Registry-Source-Authorization` is refused before source I/O with 401 `source-authorization.required` (in both development and production postures), while concealing unknown and invisible single targets with 404 `request.not-found`. Supplying `Registry-Source-Authorization` without `Registry-Source-Profile` is refused with 400 `source-profile.required`. -Casework-retained reads that make no source call (a decided task on `GET /v1/review-tasks/{id}` and terminal history on `GET /v1/review-requests/{id}/history`) do not require `Registry-Source-Authorization`, though a supplied source header is still validated. -`GET /v1/review-tasks/{id}/context` (even when decided), `own-decisions`, `clocks`, and `notes` require `Registry-Source-Authorization`. +Casework-retained reads that make no source call (a decided task on `GET /v1/review-tasks/{taskId}` and terminal history on `GET /v1/review-requests/{requestId}/history`) do not require `Registry-Source-Authorization`, though a supplied source header is still validated. +`GET /v1/review-tasks/{taskId}/context` (even when decided), `own-decisions`, `clocks`, and `notes` require `Registry-Source-Authorization`. A submitted-context task or request needs no source token and ignores a well-formed source pair from a staff caller. Casework checks the headers' shape without verifying the source token or forwarding it. -For submitted context, Casework refuses a lone `Registry-Source-Profile` with 400 `source-profile.not-applicable` on the single task read, the draft read (`GET /v1/review-tasks/{task_id}/draft`), task mutations that preflight source context (claim, assign, delegate, decisions, asks, and saving or deleting a draft), and request history, clocks, and notes. +For submitted context, Casework refuses a lone `Registry-Source-Profile` with 400 `source-profile.not-applicable` on the single task read, the draft read (`GET /v1/review-tasks/{taskId}/draft`), task mutations that preflight source context (claim, assign, delegate, decisions, asks, and saving or deleting a draft), and request history, clocks, and notes. On the shared history, clocks, and notes routes, a requester who sends a well-formed source pair receives 403 `profile.not-authorized`. A lone source profile receives 400 `source-profile.not-applicable`. Routes outside source-credential admission refuse `Registry-Source-Authorization` with 400 `request.invalid`. These include release, task-grant revocation, accountability, policy routes, the eight dedicated requester routes, directory routes other than caseload and clock recompute, and delegated-reader routes. diff --git a/docs/site/src/content/docs/reference/coordinator-configuration.mdx b/docs/site/src/content/docs/reference/coordinator-configuration.mdx index 88d54acdd5..f403e02dc5 100644 --- a/docs/site/src/content/docs/reference/coordinator-configuration.mdx +++ b/docs/site/src/content/docs/reference/coordinator-configuration.mdx @@ -71,7 +71,7 @@ Declare `development` or `production` with `REGISTRY_STACK_POSTURE` or `--postur An undeclared posture is production. If you set both, use the same value. Run `rstack dev` for development, or declare it on the command you run. The `check` command reports development settings as warnings in development and -errors in production. `check --production` declares production. +errors in production. `check --posture production` declares production. Use `listener.tlsTermination: loopback-plaintext` for a loopback bind. Configure PostgreSQL separately with `database.transport`. Its default is `verified-tls`. diff --git a/docs/site/src/content/docs/reference/documents-configuration.mdx b/docs/site/src/content/docs/reference/documents-configuration.mdx index 3b0ebdd568..fdf6b35ca3 100644 --- a/docs/site/src/content/docs/reference/documents-configuration.mdx +++ b/docs/site/src/content/docs/reference/documents-configuration.mdx @@ -115,7 +115,7 @@ Declare `development` or `production` with `REGISTRY_STACK_POSTURE` or `--postur An undeclared posture is production. If you set both, use the same value. Run `rstack dev` for development, or declare it on the command you run. The `check` command reports development settings as warnings in development and -errors in production. `check --production` declares production. +errors in production. `check --posture production` declares production. Use `listener.tlsTermination: loopback-plaintext` for a loopback bind. Configure PostgreSQL separately with `database.transport`. Its default is `verified-tls`. diff --git a/docs/site/src/content/docs/reference/messaging-configuration.mdx b/docs/site/src/content/docs/reference/messaging-configuration.mdx index 06c0227516..ea63e0f0f5 100644 --- a/docs/site/src/content/docs/reference/messaging-configuration.mdx +++ b/docs/site/src/content/docs/reference/messaging-configuration.mdx @@ -323,7 +323,7 @@ The provider example contains the installation steps and links to AWS's maintain ## Provider callbacks -An `http` provider whose package declares `receipts: callback` reports delivery to `POST /v1/provider-callbacks/{provider_id}` on the public listener, or, for `path-token`, to `POST /v1/provider-callbacks/{provider_id}/{token}`. +An `http` provider whose package declares `receipts: callback` reports delivery to `POST /v1/provider-callbacks/{providerId}` on the public listener, or, for `path-token`, to `POST /v1/provider-callbacks/{providerId}/{token}`. These routes take no bearer token. The connection's `callbackVerifier` authenticates each callback, and is one of these: diff --git a/docs/site/src/content/docs/reference/render-configuration.mdx b/docs/site/src/content/docs/reference/render-configuration.mdx index ccefe92cc8..43ecf96de7 100644 --- a/docs/site/src/content/docs/reference/render-configuration.mdx +++ b/docs/site/src/content/docs/reference/render-configuration.mdx @@ -28,7 +28,11 @@ This grammar is not frozen. list declares each type's template, data schema, label locales, version, and PDF standard. Each `labels/.yaml` holds one label table, and every table must carry the same keys. `runtime.yaml` is what `registry-render serve` reads: listener, -package, secret providers, API key, limits, and audit. +package, secret providers, authentication, limits, and audit. + +`authentication.apiKeyRef` selects shared API key authentication for unsigned rendering and +document type discovery. Set it to a secret reference under a declared provider and send the key +as a bearer credential. To serve seals, configure `authentication.oidc`. The JSON Schema a document type names for its data is yours to write; Render applies it to every request and has no schema of its own for it. A schema-valid file still needs `registry-render @@ -79,7 +83,7 @@ The tables above list the `signing.seals.` keys and the manifest's per-docum rules are not in the tables. - Omit `signing` to leave sealing off. With it, at least one seal is required, and `serve` mounts - `POST /v1/seal/{type}`. Without it, that path is an unknown route and `/ready` has no `signing` + `POST /v1/seal/{documentType}`. Without it, that path is an unknown route and `/ready` has no `signing` member. - `signing` needs `authentication.oidc`. Each seal has exactly one of `timestampAuthority` (B-T) and `withoutTimestamp: seal-stops-validating-when-certificate-expires` (B-B). @@ -147,7 +151,7 @@ Serve and `check` report these as runtime problems at the position of the key. | Code | Meaning | |---|---| -| `render.runtime.signing-requires-oidc` | `signing` is declared with the legacy API key. | +| `render.runtime.signing-requires-oidc` | `signing` is declared with the shared API key. | | `render.runtime.no-seals` | `signing.seals` is empty. | | `render.runtime.relative-path` | `certificateChainFile`, or a `transit` signer's `unixSocketPath`, is relative or has a `.` or `..` segment. | | `render.runtime.seal-timestamp-undecided` | Neither `timestampAuthority` nor `withoutTimestamp` is declared. | @@ -214,9 +218,9 @@ seal requests only. ### The seal route -`POST /v1/seal/{type}` takes the render route's request body and returns the document sealed. It +`POST /v1/seal/{documentType}` takes the render route's request body and returns the document sealed. It requires the `render:seal` scope, which `render:render` does not imply, from a client the seal's -`allowedClients` names. The legacy API key never seals. The signing time is the server's clock, +`allowedClients` names. The shared API key never seals. The signing time is the server's clock, truncated to seconds. `GET /v1/document-types` names the seal of each document type this route takes as `seal`; a document type without it is refused here with `document-not-sealable`. @@ -248,7 +252,7 @@ The problems specific to this route, from a closed vocabulary shared with the re | Problem | HTTP | Exit code | Meaning | |---|---|---|---| -| `forbidden` | 403 | 23 | The credential lacks `render:seal`, or is the legacy API key. | +| `forbidden` | 403 | 23 | The credential lacks `render:seal`, or is the shared API key. | | `seal-client-not-allowed` | 403 | 30 | The verified client is not in the seal's `allowedClients`. | | `document-not-sealable` | 400 | 29 | The document type names no seal. | | `signing-unavailable` | 503 | 26 | The seal's key provider is not ready. | @@ -332,7 +336,7 @@ errors also exit 2, and a panic exits 101. - 21, `internal`: an internal invariant broke; it never carries data. - 22, `body-too-large`: the request body is over the configured ceiling (serve, HTTP 413). - 23, `forbidden`: the verified credential lacks `render:render` (`render:seal` on the seal route), - or the legacy API key calls the seal route (serve, HTTP 403). + or the shared API key calls the seal route (serve, HTTP 403). - 24, `authentication-unavailable`: the verifier cannot reach a verdict (serve, HTTP 503). - 25, `not-found`: the route is not exposed by the adapter (HTTP 404). - 26, `signing-unavailable`: the seal's key provider cannot sign now (serve, HTTP 503). diff --git a/docs/site/src/content/docs/reference/render-payload.mdx b/docs/site/src/content/docs/reference/render-payload.mdx index bb1deb52ce..37338d5a52 100644 --- a/docs/site/src/content/docs/reference/render-payload.mdx +++ b/docs/site/src/content/docs/reference/render-payload.mdx @@ -58,7 +58,7 @@ bytes is the `dataDigest` the caller stores on the record. - `locale` is present only when the request sent one, and is validated. - `issuedAt` is the document's issuance claim. It is also the world clock and the PDF date. - `document` carries the document type's `id` and its `version` from the manifest. -- `signing` is present only on the seal route, `POST /v1/seal/{type}`, and in +- `signing` is present only on the seal route, `POST /v1/seal/{documentType}`, and in `compile --preview-seal`. {/* Evidence: crates/registry-render/src/envelope.rs, EnvelopeInput, SigningPayload and diff --git a/docs/site/src/content/docs/security/casework.mdx b/docs/site/src/content/docs/security/casework.mdx index 812aa5c5b7..9015f7ac80 100644 --- a/docs/site/src/content/docs/security/casework.mdx +++ b/docs/site/src/content/docs/security/casework.mdx @@ -156,8 +156,8 @@ grants in [Registry Casework task grants](../../reference/casework-task-grants/) A human request to a current-source target without `Registry-Source-Authorization` is refused before source I/O with 401 `source-authorization.required` on the `credential-missing` check, while preserving 404 concealment for unknown or invisible single targets. - Casework-retained reads that make no source call (a decided task on `GET /v1/review-tasks/{id}` - and terminal history on `GET /v1/review-requests/{id}/history`) do not require + Casework-retained reads that make no source call (a decided task on `GET /v1/review-tasks/{taskId}` + and terminal history on `GET /v1/review-requests/{requestId}/history`) do not require `Registry-Source-Authorization`, though a supplied source header is still validated. Collection authentication resolves one immutable provider before filtering or output, including empty pages; missing or ambiguous providers and invalid pairs fail the invocation. diff --git a/docs/site/src/content/docs/security/render.mdx b/docs/site/src/content/docs/security/render.mdx index 238998c31c..c12bdc61b1 100644 --- a/docs/site/src/content/docs/security/render.mdx +++ b/docs/site/src/content/docs/security/render.mdx @@ -241,8 +241,8 @@ Render counts every refused request by the check that refused it, in `metricsListener` is set. Without it the counter still counts and the log line is the only signal. The `check` label is a closed set of 45 names, every one published at zero, and no caller value becomes a label. -The counter covers a missing or malformed credential, a legacy API key mismatch, a token the -verifier refuses, a key source Render cannot reach or use, a missing scope, the legacy key presented to the seal +The counter covers a missing or malformed credential, a shared API key mismatch, a token the +verifier refuses, a key source Render cannot reach or use, a missing scope, the shared key presented to the seal route, and a client that the seal's `allowedClients` does not list. Each refusal also writes one `request refused` log line with `failed_check` and the request's trace id when it has one, at most five lines per check per minute, with `suppressed` counting what a diff --git a/docs/site/src/content/docs/start/registry-render.mdx b/docs/site/src/content/docs/start/registry-render.mdx index 14e8b5f2a5..803db8b992 100644 --- a/docs/site/src/content/docs/start/registry-render.mdx +++ b/docs/site/src/content/docs/start/registry-render.mdx @@ -57,7 +57,7 @@ receives](../../reference/render-payload/#what-fixes-the-bytes) gives the rules. `registry-render compile` renders one document at a terminal, for authoring and for printing at a counter without a service. `registry-render serve` is a small HTTP service that admits callers by -OIDC access token, or by a legacy API key, and serves one package. `registry-render package` copies +OIDC access token, or by a shared API key, and serves one package. `registry-render package` copies validated source into a new directory and writes a sorted `SHA256SUMS` file covering every file, plus an optional `REVISION`. The package digest is the sha256 of that checksum file. The package writer refuses an existing directory, so a digest never gains different bytes. diff --git a/docs/site/src/content/docs/tutorials/build-and-deploy-evidence-project.mdx b/docs/site/src/content/docs/tutorials/build-and-deploy-evidence-project.mdx index cd739f3656..f087b38057 100644 --- a/docs/site/src/content/docs/tutorials/build-and-deploy-evidence-project.mdx +++ b/docs/site/src/content/docs/tutorials/build-and-deploy-evidence-project.mdx @@ -157,7 +157,7 @@ Access profiles: 1 Run the production closure check with production declared for this command. The remaining commands run in development. ```sh test-exit="1" -REGISTRY_STACK_POSTURE=production rstack evidence check adult-status --target deploy-target/target.yaml --production +rstack evidence check adult-status --target deploy-target/target.yaml --posture production --require-deployment-closure ``` ```text test-expect @@ -168,7 +168,7 @@ Explicit production setting platform.posture.issuer-loopback-plaintext at /authe Explicit production setting platform.posture.issuer-loopback-plaintext at /authentication/oidc/issuers/primary/jwksSource/uri. An issuer endpoint uses plain HTTP on loopback. Explicit production setting platform.posture.unrestricted-clients at /authentication/oidc/issuers/primary/allowedClients. Admits a token from every client this issuer signs for. error[evidence.target.production-assurance-required] deploy-target/target.yaml:/assuranceProfile - --production requires production or evidence-grade target assurance + deployment closure requires production or evidence-grade target assurance next: Correct the selected project or target artifact and rerun check. 1 error, 0 warnings in 1 file ``` diff --git a/docs/site/src/content/docs/tutorials/extend-a-registry-with-a-module.mdx b/docs/site/src/content/docs/tutorials/extend-a-registry-with-a-module.mdx index 7aa60136ab..6a845921c6 100644 --- a/docs/site/src/content/docs/tutorials/extend-a-registry-with-a-module.mdx +++ b/docs/site/src/content/docs/tutorials/extend-a-registry-with-a-module.mdx @@ -111,7 +111,7 @@ The lock writes the digest of the module's exact bytes into `registry.yaml`. If changes later, the check fails until you lock again. ```sh -rstack breg check . --production +rstack breg check . --posture production --require-package-closure ``` ```text test-expect diff --git a/docs/site/src/content/docs/tutorials/move-evidence-to-production-signing.mdx b/docs/site/src/content/docs/tutorials/move-evidence-to-production-signing.mdx index 1f1517e1b4..cdb9c7a8da 100644 --- a/docs/site/src/content/docs/tutorials/move-evidence-to-production-signing.mdx +++ b/docs/site/src/content/docs/tutorials/move-evidence-to-production-signing.mdx @@ -186,7 +186,7 @@ A successful `/ready` response includes `posture: production` and an empty `deve Check the project against the target for production: ```sh -rstack evidence check "" --target "/target.yaml" --production +rstack evidence check "" --target "/target.yaml" --posture production --require-deployment-closure ``` ```text test-expect diff --git a/products/adapter/CHANGELOG.md b/products/adapter/CHANGELOG.md index 25bd9105fe..e4a1ad8b59 100644 --- a/products/adapter/CHANGELOG.md +++ b/products/adapter/CHANGELOG.md @@ -2,6 +2,15 @@ ## Unreleased +- BREAKING: Native `breg-records` v1 contracts publish `recordId` as the + record path argument. Replace `record_id` in generated client and MCP path + arguments. Refresh the Live Effective Contract and its pinned digest + together. Operation names and concrete HTTP URLs stay the same. + +- BREAKING: Payment problems emit canonical Adapter HTTPS type URIs. Upgrade + strict payment clients before or together with the payment host. Updated + clients still read the matching enumerated legacy Payment URNs. + ## 0.49.0 - 2026-12-01 - BREAKING: The Rust payment protocol and client accept the optional `failedCheck` problem member while rejecting other unknown members. Migration: set `failed_check: None` in existing `PaymentProblem` struct literals that carry no failed check. diff --git a/products/adapter/examples/dhis2-tracker/generated/openapi.json b/products/adapter/examples/dhis2-tracker/generated/openapi.json index 9af85bed57..53b38def37 100644 --- a/products/adapter/examples/dhis2-tracker/generated/openapi.json +++ b/products/adapter/examples/dhis2-tracker/generated/openapi.json @@ -1579,13 +1579,13 @@ ] } }, - "/v1/records/person/{record_id}": { + "/v1/records/person/{recordId}": { "get": { "operationId": "records-get.person", "parameters": [ { "in": "path", - "name": "record_id", + "name": "recordId", "required": true, "schema": { "type": "string" @@ -1794,7 +1794,7 @@ "parameters": [ { "in": "path", - "name": "record_id", + "name": "recordId", "required": true, "schema": { "type": "string" diff --git a/products/adapter/examples/formats/effective-contract.json b/products/adapter/examples/formats/effective-contract.json index 282ea59acb..aa6bd5405a 100644 --- a/products/adapter/examples/formats/effective-contract.json +++ b/products/adapter/examples/formats/effective-contract.json @@ -1,7 +1,7 @@ { "apiVersion": "id.registrystack.org/formats/adapter/effective-contract/v1alpha1", "kind": "AdapterEffectiveContract", - "digest": "sha256:a67559af6bf8ac240de3218c9ad9807875fb88a8b280f8d60658dd4a68c058fa", + "digest": "sha256:ebdcf7e7317af3f015dde99458b9a296a5071279345165e00c8e5dc7ec4014d5", "contract": { "schemaDialect": "https://json-schema.org/draft/2020-12/schema", "project": { @@ -173,7 +173,7 @@ "bindingId": "person-get", "profileOperationId": "records-get", "method": "GET", - "path": "/v1/records/person/{record_id}", + "path": "/v1/records/person/{recordId}", "support": "served", "effect": "read", "successStatus": 200, @@ -181,7 +181,7 @@ "path": { "additionalProperties": false, "properties": { - "record_id": { + "recordId": { "minLength": 1, "not": { "anyOf": [ @@ -200,7 +200,7 @@ } }, "required": [ - "record_id" + "recordId" ], "type": "object" }, diff --git a/products/adapter/examples/opencrvs-events/generated/openapi.json b/products/adapter/examples/opencrvs-events/generated/openapi.json index e83f28c868..1895cc2224 100644 --- a/products/adapter/examples/opencrvs-events/generated/openapi.json +++ b/products/adapter/examples/opencrvs-events/generated/openapi.json @@ -1341,13 +1341,13 @@ ] } }, - "/v1/records/birth/{record_id}": { + "/v1/records/birth/{recordId}": { "get": { "operationId": "records-get.birth", "parameters": [ { "in": "path", - "name": "record_id", + "name": "recordId", "required": true, "schema": { "type": "string" diff --git a/products/adapter/examples/payment-collections/CONTRACT.md b/products/adapter/examples/payment-collections/CONTRACT.md index 53a3bfc756..0bfc6e4fed 100644 --- a/products/adapter/examples/payment-collections/CONTRACT.md +++ b/products/adapter/examples/payment-collections/CONTRACT.md @@ -38,6 +38,14 @@ to Coordinator. JSON Schema checks structural bounds. Runtime checks also enforce currency scale, portable integer limits, exact correlation and evidence consistency. +Payment problem types use the Adapter HTTPS namespace followed by the exact +dotted code. For example, a payment authorization refusal sends type +`https://id.registrystack.org/problems/registry-adapter/adapter.payment.forbidden` +with status 403 and code and title `adapter.payment.forbidden`. In v0.51 the +host emits HTTPS types. The updated client accepts earlier Payment URNs for the +same enumerated status, title and code. Upgrade strict payment clients before +or together with the host. + ## Relationship to payments-capability-v1 The earlier [composition capability contract](https://github.com/registrystack/registry-service-composition/blob/main/docs/capabilities/payments.md) diff --git a/products/adapter/fixtures/source-shapes/rest-offset-mtls/generated/openapi.json b/products/adapter/fixtures/source-shapes/rest-offset-mtls/generated/openapi.json index 55c8c3be25..b7531fd175 100644 --- a/products/adapter/fixtures/source-shapes/rest-offset-mtls/generated/openapi.json +++ b/products/adapter/fixtures/source-shapes/rest-offset-mtls/generated/openapi.json @@ -1327,13 +1327,13 @@ ] } }, - "/v1/records/household/{record_id}": { + "/v1/records/household/{recordId}": { "get": { "operationId": "records-get.household", "parameters": [ { "in": "path", - "name": "record_id", + "name": "recordId", "required": true, "schema": { "type": "string" diff --git a/products/breg/examples/formats/explain/queries-explanation.json b/products/breg/examples/formats/explain/queries-explanation.json index 9dcfdbda12..e18e5f99c0 100644 --- a/products/breg/examples/formats/explain/queries-explanation.json +++ b/products/breg/examples/formats/explain/queries-explanation.json @@ -59,10 +59,10 @@ "accessProfile": "accessProfile", "asOf": "asOf", "count": "$count", - "cursor": "$skiptoken", + "cursor": "cursor", "filter": "$filter", "orderBy": "$orderby", - "pageSize": "$top", + "pageSize": "limit", "select": "$select" } }, @@ -180,10 +180,10 @@ "accessProfile": "accessProfile", "asOf": "asOf", "count": "$count", - "cursor": "$skiptoken", + "cursor": "cursor", "filter": "$filter", "orderBy": "$orderby", - "pageSize": "$top", + "pageSize": "limit", "select": "$select" } }, @@ -287,10 +287,10 @@ "accessProfile": "accessProfile", "asOf": "asOf", "count": "$count", - "cursor": "$skiptoken", + "cursor": "cursor", "filter": "$filter", "orderBy": "$orderby", - "pageSize": "$top", + "pageSize": "limit", "select": "$select" } }, @@ -354,10 +354,10 @@ "accessProfile": "accessProfile", "asOf": "asOf", "count": "$count", - "cursor": "$skiptoken", + "cursor": "cursor", "filter": "$filter", "orderBy": "$orderby", - "pageSize": "$top", + "pageSize": "limit", "select": "$select" } }, @@ -421,10 +421,10 @@ "accessProfile": "accessProfile", "asOf": "asOf", "count": "$count", - "cursor": "$skiptoken", + "cursor": "cursor", "filter": "$filter", "orderBy": "$orderby", - "pageSize": "$top", + "pageSize": "limit", "select": "$select" } }, @@ -488,10 +488,10 @@ "accessProfile": "accessProfile", "asOf": "asOf", "count": "$count", - "cursor": "$skiptoken", + "cursor": "cursor", "filter": "$filter", "orderBy": "$orderby", - "pageSize": "$top", + "pageSize": "limit", "select": "$select" } } diff --git a/products/casework/CHANGELOG.md b/products/casework/CHANGELOG.md index ad4e263f4d..365cf965af 100644 --- a/products/casework/CHANGELOG.md +++ b/products/casework/CHANGELOG.md @@ -2,6 +2,13 @@ ## Unreleased +- BREAKING: Generated Casework clients use lower-camel-case `path` keys. + Replace `policy_id`, `request_id`, `ask_id`, `task_id`, `grant_id`, `event_id`, + `team_id`, and `absence_id` with `policyId`, `requestId`, `askId`, `taskId`, + `grantId`, `eventId`, `teamId`, and `absenceId`, respectively. On the holiday + revision route, replace `id` and `revision` with `holidayId` and + `holidayRevision`. Operation names and concrete HTTP URLs stay the same. + ## 0.49.0 - 2026-12-01 - The generated TypeScript client classifies declared, traced empty 404 and 410 responses as `RegistryError` refusals with an HTTP status. This covers Review Ask reads and answers, Decision Draft reads and Review Result reads. Handle these errors by inspecting `kind` and `status` when `problem` is absent. diff --git a/products/casework/generated/registry-casework.openapi.json b/products/casework/generated/registry-casework.openapi.json index d0ced3dbf3..51f855982a 100644 --- a/products/casework/generated/registry-casework.openapi.json +++ b/products/casework/generated/registry-casework.openapi.json @@ -7232,7 +7232,7 @@ "summary": "List delegated staff review tasks" } }, - "/v1/delegated-staff/review-tasks/{task_id}/context": { + "/v1/delegated-staff/review-tasks/{taskId}/context": { "get": { "operationId": "getDelegatedStaffReviewTaskContext", "parameters": [ @@ -7274,7 +7274,7 @@ { "description": "", "in": "path", - "name": "task_id", + "name": "taskId", "required": true, "schema": { "format": "uuid", @@ -8523,7 +8523,7 @@ "summary": "Create absence" } }, - "/v1/directory/absences/{absence_id}": { + "/v1/directory/absences/{absenceId}": { "delete": { "description": "Recovery repeats the exact request and caller-supplied idempotency key. Clients do not retry mutations implicitly.", "operationId": "deleteAbsence", @@ -8553,7 +8553,7 @@ { "description": "", "in": "path", - "name": "absence_id", + "name": "absenceId", "required": true, "schema": { "format": "uuid", @@ -8935,7 +8935,7 @@ { "description": "", "in": "path", - "name": "absence_id", + "name": "absenceId", "required": true, "schema": { "format": "uuid", @@ -11741,7 +11741,7 @@ "summary": "Create holiday revision" } }, - "/v1/directory/holidays/{id}/revisions/{revision}": { + "/v1/directory/holidays/{holidayId}/revisions/{holidayRevision}": { "get": { "operationId": "getHolidayRevision", "parameters": [ @@ -11770,7 +11770,7 @@ { "description": "", "in": "path", - "name": "id", + "name": "holidayId", "required": true, "schema": { "maxLength": 128, @@ -11783,7 +11783,7 @@ { "description": "", "in": "path", - "name": "revision", + "name": "holidayRevision", "required": true, "schema": { "minimum": 1, @@ -12397,7 +12397,7 @@ "summary": "List directory targets" } }, - "/v1/directory/teams/{team_id}": { + "/v1/directory/teams/{teamId}": { "put": { "description": "Recovery repeats the exact request and caller-supplied idempotency key. Clients do not retry mutations implicitly.", "operationId": "updateDirectoryTeam", @@ -12427,7 +12427,7 @@ { "description": "", "in": "path", - "name": "team_id", + "name": "teamId", "required": true, "schema": { "maxLength": 128, @@ -12814,7 +12814,7 @@ "summary": "Update directory team" } }, - "/v1/review-accountability/{event_id}": { + "/v1/review-accountability/{eventId}": { "get": { "operationId": "getReviewAccountability", "parameters": [ @@ -12843,7 +12843,7 @@ { "description": "", "in": "path", - "name": "event_id", + "name": "eventId", "required": true, "schema": { "format": "uuid", @@ -13688,7 +13688,7 @@ "summary": "List review policies" } }, - "/v1/review-policies/{policy_id}": { + "/v1/review-policies/{policyId}": { "get": { "operationId": "getReviewPolicy", "parameters": [ @@ -13717,7 +13717,7 @@ { "description": "", "in": "path", - "name": "policy_id", + "name": "policyId", "required": true, "schema": { "maxLength": 128, @@ -14422,7 +14422,7 @@ "summary": "Create or recover review request" } }, - "/v1/review-requests/{request_id}": { + "/v1/review-requests/{requestId}": { "get": { "operationId": "getReviewRequest", "parameters": [ @@ -14451,7 +14451,7 @@ { "description": "", "in": "path", - "name": "request_id", + "name": "requestId", "required": true, "schema": { "format": "uuid", @@ -14729,7 +14729,7 @@ "summary": "Get review request" } }, - "/v1/review-requests/{request_id}/asks/{ask_id}": { + "/v1/review-requests/{requestId}/asks/{askId}": { "get": { "operationId": "getReviewAsk", "parameters": [ @@ -14758,7 +14758,7 @@ { "description": "", "in": "path", - "name": "request_id", + "name": "requestId", "required": true, "schema": { "format": "uuid", @@ -14768,7 +14768,7 @@ { "description": "", "in": "path", - "name": "ask_id", + "name": "askId", "required": true, "schema": { "format": "uuid", @@ -15031,7 +15031,7 @@ "summary": "Get review ask" } }, - "/v1/review-requests/{request_id}/asks/{ask_id}/answer": { + "/v1/review-requests/{requestId}/asks/{askId}/answer": { "post": { "description": "Recovery repeats the exact request and caller-supplied idempotency key. Clients do not retry mutations implicitly.", "operationId": "answerReviewAsk", @@ -15061,7 +15061,7 @@ { "description": "", "in": "path", - "name": "request_id", + "name": "requestId", "required": true, "schema": { "format": "uuid", @@ -15071,7 +15071,7 @@ { "description": "", "in": "path", - "name": "ask_id", + "name": "askId", "required": true, "schema": { "format": "uuid", @@ -15337,7 +15337,7 @@ "summary": "Answer review ask" } }, - "/v1/review-requests/{request_id}/cancel": { + "/v1/review-requests/{requestId}/cancel": { "post": { "description": "Recovery repeats the exact request and caller-supplied idempotency key. Clients do not retry mutations implicitly.", "operationId": "cancelReviewRequest", @@ -15367,7 +15367,7 @@ { "description": "", "in": "path", - "name": "request_id", + "name": "requestId", "required": true, "schema": { "format": "uuid", @@ -15741,7 +15741,7 @@ "summary": "Cancel review request" } }, - "/v1/review-requests/{request_id}/clocks": { + "/v1/review-requests/{requestId}/clocks": { "get": { "operationId": "getReviewClocks", "parameters": [ @@ -15795,7 +15795,7 @@ { "description": "", "in": "path", - "name": "request_id", + "name": "requestId", "required": true, "schema": { "format": "uuid", @@ -16057,7 +16057,7 @@ "summary": "Get review clocks" } }, - "/v1/review-requests/{request_id}/history": { + "/v1/review-requests/{requestId}/history": { "get": { "operationId": "getReviewHistory", "parameters": [ @@ -16111,7 +16111,7 @@ { "description": "", "in": "path", - "name": "request_id", + "name": "requestId", "required": true, "schema": { "format": "uuid", @@ -16394,7 +16394,7 @@ "summary": "Get review history" } }, - "/v1/review-requests/{request_id}/notes": { + "/v1/review-requests/{requestId}/notes": { "post": { "description": "Recovery repeats the exact request and caller-supplied idempotency key. Clients do not retry mutations implicitly.", "operationId": "addReviewNote", @@ -16449,7 +16449,7 @@ { "description": "", "in": "path", - "name": "request_id", + "name": "requestId", "required": true, "schema": { "format": "uuid", @@ -16823,7 +16823,7 @@ "summary": "Add review note" } }, - "/v1/review-requests/{request_id}/result": { + "/v1/review-requests/{requestId}/result": { "get": { "operationId": "getReviewResult", "parameters": [ @@ -16852,7 +16852,7 @@ { "description": "", "in": "path", - "name": "request_id", + "name": "requestId", "required": true, "schema": { "format": "uuid", @@ -19508,7 +19508,7 @@ "summary": "List supervisory review tasks" } }, - "/v1/review-tasks/{task_id}": { + "/v1/review-tasks/{taskId}": { "get": { "operationId": "getReviewTask", "parameters": [ @@ -19562,7 +19562,7 @@ { "description": "", "in": "path", - "name": "task_id", + "name": "taskId", "required": true, "schema": { "format": "uuid", @@ -19824,7 +19824,7 @@ "summary": "Get review task" } }, - "/v1/review-tasks/{task_id}/asks": { + "/v1/review-tasks/{taskId}/asks": { "post": { "description": "Recovery repeats the exact request and caller-supplied idempotency key. Clients do not retry mutations implicitly.", "operationId": "askApplicant", @@ -19879,7 +19879,7 @@ { "description": "", "in": "path", - "name": "task_id", + "name": "taskId", "required": true, "schema": { "format": "uuid", @@ -20240,7 +20240,7 @@ "summary": "Ask applicant" } }, - "/v1/review-tasks/{task_id}/assign": { + "/v1/review-tasks/{taskId}/assign": { "post": { "description": "Recovery repeats the exact request and caller-supplied idempotency key. Clients do not retry mutations implicitly.", "operationId": "assignReviewTask", @@ -20295,7 +20295,7 @@ { "description": "", "in": "path", - "name": "task_id", + "name": "taskId", "required": true, "schema": { "format": "uuid", @@ -20679,7 +20679,7 @@ "summary": "Assign review task" } }, - "/v1/review-tasks/{task_id}/claim": { + "/v1/review-tasks/{taskId}/claim": { "post": { "description": "Recovery repeats the exact request and caller-supplied idempotency key. Clients do not retry mutations implicitly.", "operationId": "claimReviewTask", @@ -20734,7 +20734,7 @@ { "description": "", "in": "path", - "name": "task_id", + "name": "taskId", "required": true, "schema": { "format": "uuid", @@ -21095,7 +21095,7 @@ "summary": "Claim review task" } }, - "/v1/review-tasks/{task_id}/context": { + "/v1/review-tasks/{taskId}/context": { "get": { "operationId": "getReviewTaskContext", "parameters": [ @@ -21149,7 +21149,7 @@ { "description": "", "in": "path", - "name": "task_id", + "name": "taskId", "required": true, "schema": { "format": "uuid", @@ -21411,7 +21411,7 @@ "summary": "Get review task context" } }, - "/v1/review-tasks/{task_id}/decisions": { + "/v1/review-tasks/{taskId}/decisions": { "post": { "description": "Recovery repeats the exact request and caller-supplied idempotency key. Clients do not retry mutations implicitly.", "operationId": "decideReviewTask", @@ -21466,7 +21466,7 @@ { "description": "", "in": "path", - "name": "task_id", + "name": "taskId", "required": true, "schema": { "format": "uuid", @@ -21864,7 +21864,7 @@ "summary": "Decide review task" } }, - "/v1/review-tasks/{task_id}/delegate": { + "/v1/review-tasks/{taskId}/delegate": { "post": { "description": "Recovery repeats the exact request and caller-supplied idempotency key. Clients do not retry mutations implicitly.", "operationId": "delegateReviewTask", @@ -21919,7 +21919,7 @@ { "description": "", "in": "path", - "name": "task_id", + "name": "taskId", "required": true, "schema": { "format": "uuid", @@ -22303,7 +22303,7 @@ "summary": "Delegate review task" } }, - "/v1/review-tasks/{task_id}/draft": { + "/v1/review-tasks/{taskId}/draft": { "delete": { "description": "Recovery repeats the exact request and caller-supplied idempotency key. Clients do not retry mutations implicitly.", "operationId": "deleteReviewDecisionDraft", @@ -22358,7 +22358,7 @@ { "description": "", "in": "path", - "name": "task_id", + "name": "taskId", "required": true, "schema": { "format": "uuid", @@ -22764,7 +22764,7 @@ { "description": "", "in": "path", - "name": "task_id", + "name": "taskId", "required": true, "schema": { "format": "uuid", @@ -23080,7 +23080,7 @@ { "description": "", "in": "path", - "name": "task_id", + "name": "taskId", "required": true, "schema": { "format": "uuid", @@ -23464,7 +23464,7 @@ "summary": "Save review decision draft" } }, - "/v1/review-tasks/{task_id}/release": { + "/v1/review-tasks/{taskId}/release": { "post": { "description": "Recovery repeats the exact request and caller-supplied idempotency key. Clients do not retry mutations implicitly.", "operationId": "releaseReviewTask", @@ -23494,7 +23494,7 @@ { "description": "", "in": "path", - "name": "task_id", + "name": "taskId", "required": true, "schema": { "format": "uuid", @@ -23820,7 +23820,7 @@ "summary": "Release review task" } }, - "/v1/review-tasks/{task_id}/task-grants": { + "/v1/review-tasks/{taskId}/task-grants": { "get": { "operationId": "listReviewTaskGrants", "parameters": [ @@ -23874,7 +23874,7 @@ { "description": "", "in": "path", - "name": "task_id", + "name": "taskId", "required": true, "schema": { "format": "uuid", @@ -24189,7 +24189,7 @@ { "description": "", "in": "path", - "name": "task_id", + "name": "taskId", "required": true, "schema": { "format": "uuid", @@ -24573,7 +24573,7 @@ "summary": "Approve review task grant" } }, - "/v1/review-tasks/{task_id}/task-grants/{grant_id}/revoke": { + "/v1/review-tasks/{taskId}/task-grants/{grantId}/revoke": { "post": { "operationId": "revokeReviewTaskGrant", "parameters": [ @@ -24602,7 +24602,7 @@ { "description": "", "in": "path", - "name": "task_id", + "name": "taskId", "required": true, "schema": { "format": "uuid", @@ -24612,7 +24612,7 @@ { "description": "", "in": "path", - "name": "grant_id", + "name": "grantId", "required": true, "schema": { "format": "uuid", @@ -24951,7 +24951,7 @@ "summary": "Revoke review task grant" } }, - "/v1/review-tasks/{task_id}/task-templates": { + "/v1/review-tasks/{taskId}/task-templates": { "get": { "operationId": "previewReviewTaskTemplates", "parameters": [ @@ -25005,7 +25005,7 @@ { "description": "", "in": "path", - "name": "task_id", + "name": "taskId", "required": true, "schema": { "format": "uuid", @@ -25267,7 +25267,7 @@ "summary": "Preview review task templates" } }, - "/v1/task-grants/{grant_id}/assertion": { + "/v1/task-grants/{grantId}/assertion": { "post": { "operationId": "getTaskAssertion", "parameters": [ @@ -25283,7 +25283,7 @@ { "description": "", "in": "path", - "name": "grant_id", + "name": "grantId", "required": true, "schema": { "format": "uuid", @@ -25619,7 +25619,7 @@ "summary": "Get task assertion" } }, - "/v1/task-grants/{grant_id}/status": { + "/v1/task-grants/{grantId}/status": { "get": { "operationId": "getTaskGrantStatus", "parameters": [ @@ -25635,7 +25635,7 @@ { "description": "", "in": "path", - "name": "grant_id", + "name": "grantId", "required": true, "schema": { "format": "uuid", diff --git a/products/casework/scripts/generate_openapi.py b/products/casework/scripts/generate_openapi.py index c2b0bb6ce4..f136748ccd 100644 --- a/products/casework/scripts/generate_openapi.py +++ b/products/casework/scripts/generate_openapi.py @@ -393,11 +393,41 @@ def scalar(value):return "'"+str(value).replace("'","''")+"'" lines.append(" - ["+", ".join(map(scalar,["`"+entry["code"]+"`",statuses,entry["description"]]))+"]") return existing[:table.start()]+"\n".join(lines)+"\n"+existing[table.end():] +def publish_path_parameters(openapi: dict) -> None: + # Source verification keys routes by their literal Rust templates. Expose + # the public parameter names once the runtime and example checks pass. + names = { + "policy_id": "policyId", + "request_id": "requestId", + "ask_id": "askId", + "task_id": "taskId", + "grant_id": "grantId", + "event_id": "eventId", + "team_id": "teamId", + "absence_id": "absenceId", + } + paths = {} + for path, operations in openapi["paths"].items(): + path_names = names + if path == "/v1/directory/holidays/{id}/revisions/{revision}": + path_names = {"id": "holidayId", "revision": "holidayRevision"} + for authored, published in path_names.items(): + path = path.replace("{" + authored + "}", "{" + published + "}") + for operation in operations.values(): + for parameter in operation.get("parameters", []): + if parameter["in"] == "path": + name = parameter["name"] + parameter["name"] = path_names.get(name, name) + paths[path] = operations + openapi["paths"] = paths + + def main() -> int: parser=argparse.ArgumentParser();parser.add_argument("--check",action="store_true");args=parser.parse_args() try: wire=load_wire_schemas(ROOT);contract=load_rust_contract(ROOT);openapi=document(contract,wire) verify_source(ROOT,openapi);validate_wire_examples(ROOT,openapi,contract["reviewWireExamples"]) + publish_path_parameters(openapi) files={OUTPUT:json.dumps(openapi,indent=2,sort_keys=True)+"\n"} for name,content in wire["projectDocuments"].items():files[ROOT/"products/casework/generated/project"/name]=content for name,content in wire["offlineDocuments"].items():files[ROOT/"products/casework/generated"/name]=content diff --git a/products/casework/scripts/test_generate_openapi.py b/products/casework/scripts/test_generate_openapi.py index 2a7f887d1b..c34604b256 100644 --- a/products/casework/scripts/test_generate_openapi.py +++ b/products/casework/scripts/test_generate_openapi.py @@ -4,6 +4,7 @@ import copy import importlib.util import json +import re import sys import unittest from pathlib import Path @@ -21,9 +22,28 @@ def contract(): return {"entries":entries,"operations":operations,"frameworkProblems":[],"reviewWireExamples":{}} class PublishedReleaseContractTests(unittest.TestCase): + def test_public_path_names_match_required_parameters(self): + document = json.loads(GEN.OUTPUT.read_text()) + expected_names = { + "policyId", "requestId", "askId", "taskId", "grantId", "eventId", + "teamId", "absenceId", "holidayId", "holidayRevision", + } + actual_names = set() + for path, operations in document["paths"].items(): + names = re.findall(r"\{([^}]+)\}", path) + actual_names.update(names) + for operation in operations.values(): + parameters = [item for item in operation.get("parameters", []) if item["in"] == "path"] + self.assertEqual([(item["name"], item["required"]) for item in parameters], + [(name, True) for name in names], path) + self.assertEqual(actual_names, expected_names) + holiday = document["paths"]["/v1/directory/holidays/{holidayId}/revisions/{holidayRevision}"]["get"] + self.assertEqual([item["schema"]["type"] for item in holiday["parameters"] if item["in"] == "path"], + ["string", "integer"]) + def test_release_refuses_source_headers_without_advertising_source_reads(self): document = json.loads(GEN.OUTPUT.read_text()) - release = document["paths"]["/v1/review-tasks/{task_id}/release"]["post"] + release = document["paths"]["/v1/review-tasks/{taskId}/release"]["post"] headers = {parameter["name"] for parameter in release["parameters"] if parameter["in"] == "header"} self.assertEqual(headers, {"If-Match", "Idempotency-Key", "traceparent"}) queries = {parameter["name"]: parameter for parameter in release["parameters"] if parameter["in"] == "query"} diff --git a/products/casework/scripts/test_product_contracts.py b/products/casework/scripts/test_product_contracts.py index 9359e560ba..c5cc46a2d2 100644 --- a/products/casework/scripts/test_product_contracts.py +++ b/products/casework/scripts/test_product_contracts.py @@ -130,10 +130,10 @@ def test_selector_free_routes_do_not_advertise_access_profile_ambiguity(self): document = json.loads((PRODUCT / "generated/registry-casework.openapi.json").read_text()) paths = document["paths"] selector_free = [ - ("post", "/v1/task-grants/{grant_id}/assertion"), - ("get", "/v1/task-grants/{grant_id}/status"), + ("post", "/v1/task-grants/{grantId}/assertion"), + ("get", "/v1/task-grants/{grantId}/status"), ("get", "/v1/delegated-staff/review-tasks"), - ("get", "/v1/delegated-staff/review-tasks/{task_id}/context"), + ("get", "/v1/delegated-staff/review-tasks/{taskId}/context"), ] for method, path in selector_free: with self.subTest(route=f"{method.upper()} {path}"): diff --git a/products/evidence/CHANGELOG.md b/products/evidence/CHANGELOG.md index 4b4e5beaf4..cd68a88dda 100644 --- a/products/evidence/CHANGELOG.md +++ b/products/evidence/CHANGELOG.md @@ -6,6 +6,9 @@ `secretProviders.file.mountPolicy`, keeping the Version 1 rule that a key file is never readable by other users. `evidencectl doctor` reports the same refusal, and the store-provision document does not accept the member. +- BREAKING: Generated OID4VP clients use `sessionReference` and `requestId` in + `path` arguments. Replace `reference` for session status and `request_id` + for wallet requests and responses. Operation names and concrete HTTP URLs stay the same. ## 0.49.0 - 2026-12-01 diff --git a/products/evidence/generated/registry-evidence-oid4vp.openapi.json b/products/evidence/generated/registry-evidence-oid4vp.openapi.json index ca55ec0760..19a9a60e2a 100644 --- a/products/evidence/generated/registry-evidence-oid4vp.openapi.json +++ b/products/evidence/generated/registry-evidence-oid4vp.openapi.json @@ -1114,14 +1114,14 @@ "summary": "Release the presentation a wallet returned, to Evidence" } }, - "/v1/requests/{request_id}": { + "/v1/requests/{requestId}": { "get": { "description": "Anonymous; the request identifier is a bearer capability. The object is a JWT signed under the policy's client identifier.", "operationId": "fetchRequestObject", "parameters": [ { "in": "path", - "name": "request_id", + "name": "requestId", "required": true, "schema": { "type": "string" @@ -1295,14 +1295,14 @@ "summary": "Serve the signed OpenID4VP request object to the wallet" } }, - "/v1/responses/{request_id}": { + "/v1/responses/{requestId}": { "post": { "description": "Anonymous; the request identifier is a bearer capability. The form carries one encrypted `response` JWE, or a plain OAuth `error`. Answers use the OAuth error shape and never carry a description.", "operationId": "receiveWalletResponse", "parameters": [ { "in": "path", - "name": "request_id", + "name": "requestId", "required": true, "schema": { "type": "string" @@ -1802,13 +1802,13 @@ "summary": "Start one presentation exchange for the authenticated applicant" } }, - "/v1/sessions/{reference}": { + "/v1/sessions/{sessionReference}": { "get": { "operationId": "readSessionStatus", "parameters": [ { "in": "path", - "name": "reference", + "name": "sessionReference", "required": true, "schema": { "type": "string" diff --git a/products/identifiers/contracts/catalog-source.json b/products/identifiers/contracts/catalog-source.json index dcfd97f4b7..4d4ec60dc2 100644 --- a/products/identifiers/contracts/catalog-source.json +++ b/products/identifiers/contracts/catalog-source.json @@ -2,6 +2,16 @@ "version": 1, "baseUrl": "https://id.registrystack.org", "problemSources": [ + { + "owner": "adapter", + "status": "active", + "compatibilityLine": "v1", + "uriPrefix": "https://id.registrystack.org/problems/registry-adapter/", + "sourcePath": "crates/registry-payment-protocol/src/lib.rs", + "exporterPath": "crates/registry-payment-protocol/examples/problem-catalog.rs", + "cargoPackage": "registry-payment-protocol", + "cargoExample": "problem-catalog" + }, { "owner": "platform", "status": "active", @@ -272,12 +282,6 @@ "classification": "retired-product", "reason": "RegistryReleaseLockV1 identifiers belong to retired registryctl release tooling." }, - { - "path": "crates/registry-adapter-core/src/naming.rs", - "uri": "https://id.registrystack.org/problems/registry-adapter/", - "classification": "planned-resolution", - "reason": "The Adapter problem type base is reserved, not yet published: ProblemCode::ALL carries no titles or descriptions and its type URIs keep dotted codes, while the facade answers with profile-authored problems and emits no type URI under this base. The change that gives the inventory catalog metadata adds its problemSources entry and deletes this exclusion." - }, { "glob": "crates/registry-render/src/problem.rs", "classification": "released-external-vocabulary", diff --git a/products/identifiers/generated/catalog.v1.json b/products/identifiers/generated/catalog.v1.json index df60197720..c00e98e06a 100644 --- a/products/identifiers/generated/catalog.v1.json +++ b/products/identifiers/generated/catalog.v1.json @@ -51,6 +51,215 @@ "sha256": "d160f0348543a570ee8c4c54ecf5d53415a9afeb98851c5eab839e6129a75b8a" } }, + { + "uri": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.authentication-required", + "kind": "problem", + "status": "active", + "compatibilityLine": "v1", + "owner": "adapter", + "title": "adapter.payment.authentication-required", + "description": "The payment caller credential is missing or refused.", + "source": { + "path": "crates/registry-payment-protocol/src/lib.rs", + "sha256": "9dcf7cb3e37133cb8fb071ef3e4806d5c4f490c67495aa5533c17b5431882c24" + }, + "problem": { + "code": "adapter.payment.authentication-required", + "httpStatuses": [ + 401 + ] + } + }, + { + "uri": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.conflict", + "kind": "problem", + "status": "active", + "compatibilityLine": "v1", + "owner": "adapter", + "title": "adapter.payment.conflict", + "description": "The requested operation conflicts with the current payment binding or state.", + "source": { + "path": "crates/registry-payment-protocol/src/lib.rs", + "sha256": "9dcf7cb3e37133cb8fb071ef3e4806d5c4f490c67495aa5533c17b5431882c24" + }, + "problem": { + "code": "adapter.payment.conflict", + "httpStatuses": [ + 409 + ] + } + }, + { + "uri": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.forbidden", + "kind": "problem", + "status": "active", + "compatibilityLine": "v1", + "owner": "adapter", + "title": "adapter.payment.forbidden", + "description": "The verified caller is not admitted for this payment operation.", + "source": { + "path": "crates/registry-payment-protocol/src/lib.rs", + "sha256": "9dcf7cb3e37133cb8fb071ef3e4806d5c4f490c67495aa5533c17b5431882c24" + }, + "problem": { + "code": "adapter.payment.forbidden", + "httpStatuses": [ + 403 + ] + } + }, + { + "uri": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.invalid-request", + "kind": "problem", + "status": "active", + "compatibilityLine": "v1", + "owner": "adapter", + "title": "adapter.payment.invalid-request", + "description": "The request does not meet the payment operation's input contract.", + "source": { + "path": "crates/registry-payment-protocol/src/lib.rs", + "sha256": "9dcf7cb3e37133cb8fb071ef3e4806d5c4f490c67495aa5533c17b5431882c24" + }, + "problem": { + "code": "adapter.payment.invalid-request", + "httpStatuses": [ + 422 + ] + } + }, + { + "uri": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.not-found", + "kind": "problem", + "status": "active", + "compatibilityLine": "v1", + "owner": "adapter", + "title": "adapter.payment.not-found", + "description": "The payment resource is absent or not visible to the caller.", + "source": { + "path": "crates/registry-payment-protocol/src/lib.rs", + "sha256": "9dcf7cb3e37133cb8fb071ef3e4806d5c4f490c67495aa5533c17b5431882c24" + }, + "problem": { + "code": "adapter.payment.not-found", + "httpStatuses": [ + 404 + ] + } + }, + { + "uri": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.outcome-unknown", + "kind": "problem", + "status": "active", + "compatibilityLine": "v1", + "owner": "adapter", + "title": "adapter.payment.outcome-unknown", + "description": "The outcome of the original payment attempt could not be established.", + "source": { + "path": "crates/registry-payment-protocol/src/lib.rs", + "sha256": "9dcf7cb3e37133cb8fb071ef3e4806d5c4f490c67495aa5533c17b5431882c24" + }, + "problem": { + "code": "adapter.payment.outcome-unknown", + "httpStatuses": [ + 503 + ] + } + }, + { + "uri": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.provider-protocol", + "kind": "problem", + "status": "active", + "compatibilityLine": "v1", + "owner": "adapter", + "title": "adapter.payment.provider-protocol", + "description": "The provider's response did not meet the payment protocol contract.", + "source": { + "path": "crates/registry-payment-protocol/src/lib.rs", + "sha256": "9dcf7cb3e37133cb8fb071ef3e4806d5c4f490c67495aa5533c17b5431882c24" + }, + "problem": { + "code": "adapter.payment.provider-protocol", + "httpStatuses": [ + 502 + ] + } + }, + { + "uri": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.receipt-expired", + "kind": "problem", + "status": "active", + "compatibilityLine": "v1", + "owner": "adapter", + "title": "adapter.payment.receipt-expired", + "description": "The original acceptance receipt is past its recovery window.", + "source": { + "path": "crates/registry-payment-protocol/src/lib.rs", + "sha256": "9dcf7cb3e37133cb8fb071ef3e4806d5c4f490c67495aa5533c17b5431882c24" + }, + "problem": { + "code": "adapter.payment.receipt-expired", + "httpStatuses": [ + 410 + ] + } + }, + { + "uri": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.receipt-unresolved", + "kind": "problem", + "status": "active", + "compatibilityLine": "v1", + "owner": "adapter", + "title": "adapter.payment.receipt-unresolved", + "description": "The original request has no confirmed acceptance receipt.", + "source": { + "path": "crates/registry-payment-protocol/src/lib.rs", + "sha256": "9dcf7cb3e37133cb8fb071ef3e4806d5c4f490c67495aa5533c17b5431882c24" + }, + "problem": { + "code": "adapter.payment.receipt-unresolved", + "httpStatuses": [ + 404 + ] + } + }, + { + "uri": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.recovery-held", + "kind": "problem", + "status": "active", + "compatibilityLine": "v1", + "owner": "adapter", + "title": "adapter.payment.recovery-held", + "description": "The original payment attempt requires reconciliation before it can proceed.", + "source": { + "path": "crates/registry-payment-protocol/src/lib.rs", + "sha256": "9dcf7cb3e37133cb8fb071ef3e4806d5c4f490c67495aa5533c17b5431882c24" + }, + "problem": { + "code": "adapter.payment.recovery-held", + "httpStatuses": [ + 409 + ] + } + }, + { + "uri": "https://id.registrystack.org/problems/registry-adapter/adapter.payment.unavailable", + "kind": "problem", + "status": "active", + "compatibilityLine": "v1", + "owner": "adapter", + "title": "adapter.payment.unavailable", + "description": "The payment operation was unavailable.", + "source": { + "path": "crates/registry-payment-protocol/src/lib.rs", + "sha256": "9dcf7cb3e37133cb8fb071ef3e4806d5c4f490c67495aa5533c17b5431882c24" + }, + "problem": { + "code": "adapter.payment.unavailable", + "httpStatuses": [ + 503 + ] + } + }, { "uri": "https://id.registrystack.org/problems/registry-breg/access-profile/ambiguous", "kind": "problem", diff --git a/products/identifiers/scripts/generate.py b/products/identifiers/scripts/generate.py index 18ce0c06c6..8f1c02cca7 100755 --- a/products/identifiers/scripts/generate.py +++ b/products/identifiers/scripts/generate.py @@ -18,6 +18,7 @@ PROBLEM_CODE_SEGMENT = re.compile(r"[a-z][a-z0-9]*(?:-[a-z0-9]+)*") # The published OID4VP contract uses unqualified codes in its own namespace. OID4VP_PROBLEM_URI_PREFIX = f"{BASE_URL}/problems/registry-evidence-oid4vp/" +ADAPTER_PROBLEM_URI_PREFIX = f"{BASE_URL}/problems/registry-adapter/" # Discovery's published type URIs predate its qualified problem codes. # Pin these pairs while other products retain the usual URI derivation. DISCOVERY_PROBLEM_URI_SUFFIXES = { @@ -457,6 +458,8 @@ def problem_entries( suffix = "/".join(segments) if uri_prefix == f"{BASE_URL}/problems/registry-discovery/": suffix = DISCOVERY_PROBLEM_URI_SUFFIXES.get(code) + elif uri_prefix == ADAPTER_PROBLEM_URI_PREFIX: + suffix = code if suffix is None or entry["uri"] != uri_prefix + suffix: raise CatalogError( f"{source_config['owner']} problem URI and code disagree: {entry}" diff --git a/products/identifiers/scripts/test_generate.py b/products/identifiers/scripts/test_generate.py index 26a890cea8..87e7e95e63 100644 --- a/products/identifiers/scripts/test_generate.py +++ b/products/identifiers/scripts/test_generate.py @@ -395,6 +395,23 @@ def test_discovery_mapping_rejects_uri_drift_and_does_not_relax_other_products(s with self.assertRaisesRegex(generate.CatalogError, "URI and code disagree"): self.build() + def test_adapter_problem_uris_use_the_registered_dotted_code(self) -> None: + prefix = generate.ADAPTER_PROBLEM_URI_PREFIX + code = "adapter.payment.authentication-required" + config = json.loads(self.config.read_text()) + config["problemSources"][0]["uriPrefix"] = prefix + self.config.write_text(json.dumps(config)) + document = json.loads(self.fixture_problem_catalog.read_text()) + entry = document["entries"][0] + entry.update(uri=prefix + code, code=code) + self.fixture_problem_catalog.write_text(json.dumps(document)) + self.assertIn(entry["uri"], {item["uri"] for item in self.build()["entries"]}) + + entry["uri"] = prefix + code.replace(".", "/") + self.fixture_problem_catalog.write_text(json.dumps(document)) + with self.assertRaisesRegex(generate.CatalogError, "URI and code disagree"): + self.build() + def test_two_problem_sources_are_merged(self) -> None: self.write_evidence_problem_catalog() document = json.loads(self.config.read_text()) @@ -628,18 +645,18 @@ def test_adapter_profile_fixture_needs_no_reference_exclusion(self) -> None: [], ) - def test_adapter_problem_namespace_has_one_exact_reference_exclusion(self) -> None: + def test_adapter_problem_namespace_has_a_payment_catalog_owner(self) -> None: source = generate.load_source_config( SCRIPT.parents[3] / "products/identifiers/contracts/catalog-source.json" ) - uri = f"{generate.BASE_URL}/problems/registry-adapter/" + uri = generate.ADAPTER_PROBLEM_URI_PREFIX matches = [ - entry for entry in source["referenceExclusions"] if entry.get("uri") == uri + entry for entry in source["problemSources"] if entry["uriPrefix"] == uri ] self.assertEqual(len(matches), 1) - self.assertEqual(matches[0]["path"], "crates/registry-adapter-core/src/naming.rs") - self.assertEqual(matches[0]["classification"], "planned-resolution") - self.assertNotIn("glob", matches[0]) + self.assertEqual(matches[0]["owner"], "adapter") + self.assertEqual(matches[0]["cargoPackage"], "registry-payment-protocol") + self.assertFalse(any(entry.get("uri") == uri for entry in source["referenceExclusions"])) def test_configurable_mcp_schema_has_an_active_catalog_owner(self) -> None: repo_root = SCRIPT.parents[3] diff --git a/products/messaging/CHANGELOG.md b/products/messaging/CHANGELOG.md index 91b2fe32af..85131a6832 100644 --- a/products/messaging/CHANGELOG.md +++ b/products/messaging/CHANGELOG.md @@ -2,6 +2,11 @@ ## Unreleased +- BREAKING: Generated Messaging clients use `messageId`, `providerId`, and + `templateId` in `path` arguments. Replace `message_id`, `provider_id`, and + `template_id`, and replace `version` with `templateVersion` on template + previews. Operation names and concrete HTTP URLs stay the same. + ## 0.49.0 - 2026-12-01 - BREAKING: A valid token whose caller is not admitted (its kind or its client) answers 403 instead of 401. Configuration-refused issuer key sources (`KeySourceUnavailable`) answer 503 `service.unavailable` alongside live key-source outages. Migration: Clients that retried or re-authenticated on 401 treat 403 as final, and operators diagnosing 503 key-source refusals inspect issuer key-source configuration alongside network availability. diff --git a/products/messaging/generated/registry-messaging.openapi.json b/products/messaging/generated/registry-messaging.openapi.json index 559f0cba4e..5b7e832acc 100644 --- a/products/messaging/generated/registry-messaging.openapi.json +++ b/products/messaging/generated/registry-messaging.openapi.json @@ -1344,13 +1344,13 @@ "summary": "Read the retained original acceptance receipt for this caller, key and exact request without submitting or rendering a message. An unresolved receipt does not establish that no effect occurred." } }, - "/v1/messages/{message_id}": { + "/v1/messages/{messageId}": { "get": { "operationId": "getMessage", "parameters": [ { "in": "path", - "name": "message_id", + "name": "messageId", "required": true, "schema": { "minLength": 1, @@ -1513,13 +1513,13 @@ "summary": "Read the status of a message the caller submitted, or any message for an operator. A message the caller may not see answers exactly like one that does not exist. The recipient is masked, and no part or template data is returned." } }, - "/v1/messages/{message_id}/cancel": { + "/v1/messages/{messageId}/cancel": { "post": { "operationId": "cancelMessage", "parameters": [ { "in": "path", - "name": "message_id", + "name": "messageId", "required": true, "schema": { "minLength": 1, @@ -1706,13 +1706,13 @@ "summary": "Cancel a queued message, including one waiting for a retry, the caller submitted, or any queued message for an operator. A message whose dispatch started or that reached a final state is refused." } }, - "/v1/provider-callbacks/{provider_id}": { + "/v1/provider-callbacks/{providerId}": { "post": { "operationId": "receiveProviderCallback", "parameters": [ { "in": "path", - "name": "provider_id", + "name": "providerId", "required": true, "schema": { "minLength": 1, @@ -1924,13 +1924,13 @@ "summary": "Take one delivery callback from a provider whose runtime configuration names an `hmac-sha1-url-form` or `hmac-sha256-body` callback verifier. The verifier, not a bearer token, authenticates the request; the provider package's receipt script reads it. A verified callback answers 204 whether or not its reference names a message, and a receipt never moves a message's report backwards." } }, - "/v1/provider-callbacks/{provider_id}/{token}": { + "/v1/provider-callbacks/{providerId}/{token}": { "post": { "operationId": "receiveProviderCallbackWithToken", "parameters": [ { "in": "path", - "name": "provider_id", + "name": "providerId", "required": true, "schema": { "minLength": 1, @@ -2151,13 +2151,13 @@ "summary": "Take one delivery callback from a provider whose runtime configuration names a `path-token` callback verifier, with the secret token as the last path segment. Otherwise as `receiveProviderCallback`." } }, - "/v1/templates/{template_id}/versions/{version}/preview": { + "/v1/templates/{templateId}/versions/{templateVersion}/preview": { "post": { "operationId": "previewTemplate", "parameters": [ { "in": "path", - "name": "template_id", + "name": "templateId", "required": true, "schema": { "minLength": 1, @@ -2166,7 +2166,7 @@ }, { "in": "path", - "name": "version", + "name": "templateVersion", "required": true, "schema": { "minLength": 1, diff --git a/products/render/CHANGELOG.md b/products/render/CHANGELOG.md index b96562ff3b..738351d265 100644 --- a/products/render/CHANGELOG.md +++ b/products/render/CHANGELOG.md @@ -2,6 +2,12 @@ ## Unreleased +- BREAKING: Generated Render clients use `documentType` in `path` arguments + for rendering and sealing. Replace `type` when calling those operations. + Operation names and concrete HTTP URLs stay the same. +- Render help and configuration docs call `authentication.apiKeyRef` a shared + API key for document discovery and unsigned rendering. + ## 0.49.0 - 2026-12-01 - BREAKING: A valid token whose caller is not admitted (its actor kind or its client) answers HTTP 403 `render.forbidden` with a caller-admission detail and audited credential fingerprint instead of HTTP 401 `render.unauthorized`, and configuration-refused issuer key sources (`KeySourceUnavailable`) answer HTTP 503 `render.authentication-unavailable` alongside live key-source outages. `/openapi.json` documents `401`, `403`, and `503` on `GET /v1/document-types` and caller-admission `403` refusals on render and seal routes. Migration: Treat HTTP 403 on valid tokens as caller admission failure rather than retrying token acquisition, and inspect issuer key-source configuration alongside network availability when diagnosing HTTP 503 key-source refusals. diff --git a/products/render/README.md b/products/render/README.md index a97d8b917e..9dc0975ce3 100644 --- a/products/render/README.md +++ b/products/render/README.md @@ -17,11 +17,11 @@ with the same rendering guarantees: - **CLI** — `registry-render compile --bundle … --data … --issued-at … --output …`, offline, zero config: branch printing, template authoring, CI. -- **Service** — `registry-render serve`: one POST endpoint (`/v1/render/{type}`), +- **Service** — `registry-render serve`: one POST endpoint (`/v1/render/{documentType}`), resource-token or legacy API-key auth, supervised workers, and value-free audit entries written before every render and before every response. - **Seal** (optional): with a `signing` block in the runtime file, `serve` - adds `POST /v1/seal/{type}`, which returns the rendered document with a PAdES + adds `POST /v1/seal/{documentType}`, which returns the rendered document with a PAdES signature (see [Seal documents](https://docs.registrystack.org/operate/registry-render/#seal-documents)). - **Library** — `registry_render::render(bundle, document, request)` for diff --git a/products/render/generated/registry-render.openapi.json b/products/render/generated/registry-render.openapi.json index e6e4fa31ba..4877602257 100644 --- a/products/render/generated/registry-render.openapi.json +++ b/products/render/generated/registry-render.openapi.json @@ -42,12 +42,13 @@ } } }, - "/v1/render/{type}": { + "/v1/render/{documentType}": { "post": { + "operationId": "postV1RenderByType", "summary": "Render one document", "security": [{ "bearerAuth": [] }], "parameters": [ - { "name": "type", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "documentType", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "Idempotency-Key", "in": "header", @@ -124,13 +125,14 @@ } } }, - "/v1/seal/{type}": { + "/v1/seal/{documentType}": { "post": { + "operationId": "postV1SealByType", "summary": "Render one document and seal it (PAdES). Present only when the deployment declares seals.", - "description": "The render route's request body. The document type must name a seal in the bundle manifest; the payload the template reads carries a signing member {mode: seal, signerName, testOnly}. Requires the render:seal scope, which render:render does not imply, from a client the seal's allowedClients names; the legacy API key never seals. The signing time is the server's clock, truncated to seconds.", + "description": "The render route's request body. The document type must name a seal in the bundle manifest; the payload the template reads carries a signing member {mode: seal, signerName, testOnly}. Requires the render:seal scope, which render:render does not imply, from a client the seal's allowedClients names; the shared API key never seals. The signing time is the server's clock, truncated to seconds.", "security": [{ "bearerAuth": [] }], "parameters": [ - { "name": "type", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "documentType", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "Idempotency-Key", "in": "header", @@ -247,7 +249,7 @@ }, "400": { "description": "Invalid request, data, or assets; or document-not-sealable, a document type that names no seal", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } }, "401": { "description": "Missing or invalid bearer credential; Bearer challenge", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } }, - "403": { "description": "forbidden: the verified credential is not admitted (client, actor kind, or missing render:seal scope), or is the legacy API key; seal-client-not-allowed: the verified client is not in the seal's allowedClients", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } }, + "403": { "description": "forbidden: the verified credential is not admitted (client, actor kind, or missing render:seal scope), or is the shared API key; seal-client-not-allowed: the verified client is not in the seal's allowedClients", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } }, "404": { "description": "This deployment does not serve the seal route", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } }, "413": { "description": "Request body over the configured limit (problem+json; audited, after authentication)", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } }, "422": { "description": "Compile failure, strict warnings, or oversized output", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } }, @@ -283,7 +285,7 @@ } }, "securitySchemes": { - "bearerAuth": { "type": "http", "scheme": "bearer", "description": "Resource-bound OIDC access token with the route's scope: render:render for documents and rendering, render:seal for sealing. Or the configured legacy API key, which never seals." } + "bearerAuth": { "type": "http", "scheme": "bearer", "description": "Resource-bound OIDC access token with the route's scope: render:render for documents and rendering, render:seal for sealing. For document type discovery and unsigned rendering, clients can also send the shared API key configured in authentication.apiKeyRef as a bearer credential." } } } } diff --git a/products/scheduling/CHANGELOG.md b/products/scheduling/CHANGELOG.md index cc4ad2977f..be51e575fc 100644 --- a/products/scheduling/CHANGELOG.md +++ b/products/scheduling/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +- BREAKING: Generated Scheduling clients use `holdId` and `appointmentId` in + `path` arguments. Replace `hold_id` and `appointment_id` when calling the + generated methods. Operation names and concrete HTTP URLs stay the same. + ## 0.49.0 - 2026-12-01 - Signed reminders require HTTPS or loopback HTTP in either posture. The diff --git a/products/scheduling/generated/registry-scheduling.openapi.json b/products/scheduling/generated/registry-scheduling.openapi.json index 95d16e0c18..7249f96f9b 100644 --- a/products/scheduling/generated/registry-scheduling.openapi.json +++ b/products/scheduling/generated/registry-scheduling.openapi.json @@ -3974,7 +3974,7 @@ "x-scheduling-authority": "reads-scope" } }, - "/v1/appointments/{appointment_id}": { + "/v1/appointments/{appointmentId}": { "get": { "description": "An ordinary booking requires its retained actor owner and reads scope, or a current appointment.read task grant for its retained service/location. A source-managed booking additionally requires the signed source-manager binding to match its retained manager. Both grant paths require fresh online grant status, need no general reads scope, and grant no catalogue, list or history access. The grant is scoped to service/location (and manager where applicable), not to an appointment identifier. A booking outside that authority, a hold, and an unknown identifier are all operation.not-authorized, so existence outside the caller's authority is never disclosed.", "operationId": "getAppointment", @@ -3991,7 +3991,7 @@ { "description": "The appointment's identifier.", "in": "path", - "name": "appointment_id", + "name": "appointmentId", "required": true, "schema": { "format": "uuid", @@ -4163,7 +4163,7 @@ "x-scheduling-authority": "appointment-detail" } }, - "/v1/appointments/{appointment_id}/attendance": { + "/v1/appointments/{appointmentId}/attendance": { "put": { "description": "Requires attendance.record for the appointment's stored service and location. Both observedAppointmentRevision and observedRevision must match the locked current visit; observedRevision is zero before that visit's first observation. Corrections advance the attendance revision without changing the booking revision or capacity. Rescheduling starts a new visit; cancellation preserves the existing visit and permits later observations. observedAt cannot be in the future. The observation applies to the appointment, including a resource-only booking, and never invents a person count. Neither ownership, a read scope, nor an operational profile authorizes this write. Exact idempotent replay returns the original observation.", "operationId": "recordAttendance", @@ -4192,7 +4192,7 @@ { "description": "The appointment's identifier.", "in": "path", - "name": "appointment_id", + "name": "appointmentId", "required": true, "schema": { "format": "uuid", @@ -4465,7 +4465,7 @@ "x-scheduling-authority": "task-grant" } }, - "/v1/appointments/{appointment_id}/cancel": { + "/v1/appointments/{appointmentId}/cancel": { "post": { "description": "Releases the appointment's capacity and records the reason, under the task grant that names appointment.cancel. It is guarded by observedRevision and the offering's cancellation cutoff, never by the policy revision, so an appointment is always cancellable under the policy that currently governs its offering.", "operationId": "cancelAppointment", @@ -4494,7 +4494,7 @@ { "description": "The appointment's identifier.", "in": "path", - "name": "appointment_id", + "name": "appointmentId", "required": true, "schema": { "format": "uuid", @@ -4777,7 +4777,7 @@ "x-scheduling-authority": "task-grant" } }, - "/v1/appointments/{appointment_id}/history": { + "/v1/appointments/{appointmentId}/history": { "get": { "description": "Newest first, one bounded page at a time. Each step carries the booking revision, the pseudonymized actor reference when it had one, and the detail the store recorded. An attendance-observed entry retains that booking revision and carries attendanceRevision, state, observedAt and recordedAt in detail. Earlier visit observations remain in history after a reschedule. Existence is never disclosed: another caller's appointment answers operation.not-authorized.", "operationId": "listAppointmentHistory", @@ -4794,7 +4794,7 @@ { "description": "The appointment's identifier.", "in": "path", - "name": "appointment_id", + "name": "appointmentId", "required": true, "schema": { "format": "uuid", @@ -5013,7 +5013,7 @@ "x-scheduling-authority": "reads-scope" } }, - "/v1/appointments/{appointment_id}/reschedule": { + "/v1/appointments/{appointmentId}/reschedule": { "post": { "description": "Re-books the appointment under the task grant that names appointment.reschedule, with a fresh admission evaluation while retaining its original externalReferences; supplying externalReferences is request.unprocessable. The appointment it replaces is excluded from the conflict checks, so a reschedule never competes with itself. The policy guard wins over the revision guard: a caller whose observed revision is also stale learns the policy moved first.", "operationId": "rescheduleAppointment", @@ -5042,7 +5042,7 @@ { "description": "The appointment's identifier.", "in": "path", - "name": "appointment_id", + "name": "appointmentId", "required": true, "schema": { "format": "uuid", @@ -6501,7 +6501,7 @@ "x-scheduling-authority": "task-grant" } }, - "/v1/holds/{hold_id}": { + "/v1/holds/{holdId}": { "delete": { "description": "Gives a hold's capacity back before it expires, under the task grant that names hold.release. The hold's own identifier is the idempotency key, so a retried release answers as the first one did; a receipt retained past its window is idempotency.expired. A claim that is not an active hold is hold.released, whether unknown, already confirmed, or already released, and a grant naming another holder is operation.not-authorized.", "operationId": "releaseHold", @@ -6518,7 +6518,7 @@ { "description": "The hold's identifier.", "in": "path", - "name": "hold_id", + "name": "holdId", "required": true, "schema": { "format": "uuid", diff --git a/products/scheduling/scripts/generate_openapi.py b/products/scheduling/scripts/generate_openapi.py index bd42d24138..4cc3d26373 100644 --- a/products/scheduling/scripts/generate_openapi.py +++ b/products/scheduling/scripts/generate_openapi.py @@ -1945,6 +1945,23 @@ def catalog_of(contract: dict) -> dict[str, dict]: return {entry["code"]: entry for entry in contract["entries"]} +def publish_path_parameters(openapi: dict) -> None: + # The source proofs use the router's capture names. Publish the names + # consumed by OpenAPI clients after those proofs have run. + names = {"hold_id": "holdId", "appointment_id": "appointmentId"} + paths = {} + for path, operations in openapi["paths"].items(): + for authored, published in names.items(): + path = path.replace("{" + authored + "}", "{" + published + "}") + for operation in operations.values(): + for parameter in operation.get("parameters", []): + if parameter["in"] == "path": + name = parameter["name"] + parameter["name"] = names.get(name, name) + paths[path] = operations + openapi["paths"] = paths + + def main() -> int: parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) parser.add_argument("--check", action="store_true", help="verify the committed document instead of writing it") @@ -1959,6 +1976,7 @@ def main() -> int: verify_handler_wiring(repository_root, openapi["paths"], variants) verify_dto_schemas(repository_root, openapi) verify_operation_problems(openapi, contract, catalog_of(contract), variants) + publish_path_parameters(openapi) rendered = json.dumps(openapi, indent=2, sort_keys=True) + "\n" except (OSError, ValueError, KeyError, subprocess.CalledProcessError) as error: print(f"OpenAPI source check failed: {error}", file=sys.stderr) diff --git a/products/scheduling/scripts/test_generate_openapi.py b/products/scheduling/scripts/test_generate_openapi.py index bf17d97527..349ed001b2 100644 --- a/products/scheduling/scripts/test_generate_openapi.py +++ b/products/scheduling/scripts/test_generate_openapi.py @@ -54,6 +54,25 @@ def documented_codes(openapi: dict, key: tuple[str, str]) -> set[str]: return set().union(*by_status.values()) if by_status else set() +class PublishedPathTests(unittest.TestCase): + def test_public_path_names_match_required_parameters(self) -> None: + openapi = json.loads((ROOT / GENERATOR.OUTPUT).read_text()) + expected = { + "/v1/holds/{holdId}": ("delete", "holdId"), + "/v1/appointments/{appointmentId}": ("get", "appointmentId"), + "/v1/appointments/{appointmentId}/reschedule": ("post", "appointmentId"), + "/v1/appointments/{appointmentId}/cancel": ("post", "appointmentId"), + "/v1/appointments/{appointmentId}/attendance": ("put", "appointmentId"), + "/v1/appointments/{appointmentId}/history": ("get", "appointmentId"), + } + self.assertEqual(set(expected), {path for path in openapi["paths"] if "{" in path}) + for path, (method, name) in expected.items(): + self.assertEqual(set(openapi["paths"][path]), {method}, path) + parameters = [item for item in openapi["paths"][path][method]["parameters"] if item["in"] == "path"] + actual = [(item["name"], item["required"], item["schema"]) for item in parameters] + self.assertEqual(actual, [(name, True, {"type": "string", "format": "uuid"})], path) + + class BusySchemasTests(unittest.TestCase): def test_busy_snapshot_is_bounded_and_contains_only_source_facts(self) -> None: schemas = GENERATOR.schemas([]) @@ -1029,7 +1048,9 @@ def test_the_problem_envelope_is_the_platform_one(self) -> None: self.assertIn('"Bearer"', http) def test_the_committed_document_is_the_one_this_generator_writes(self) -> None: - self.assertEqual(self.committed, json.dumps(self.openapi, indent=2, sort_keys=True) + "\n") + published = copy.deepcopy(self.openapi) + GENERATOR.publish_path_parameters(published) + self.assertEqual(self.committed, json.dumps(published, indent=2, sort_keys=True) + "\n") if __name__ == "__main__": From 10b39bb98bcf7cf5082d2c48e423d03ddb171ee2 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 40/55] feat(contracts): distinguish bounded product logic from service functions Folds these reviewed commits: - feat(contracts): distinguish bounded product logic from service functions - docs(config): generate the posture diagnostic lookup - test(ci): route posture declaration drift to docs - fix(contracts): carry W2 vocabulary through migration checks - fix(ci): detect new posture diagnostic declaration sources - fix(contracts): resolve Action Plan and Derivation review findings - test(breg): verify strict checks around predecessor rehearsal - docs: retain the legacy Function glossary anchor - docs: finish the Action Plan and Derivation wording migration - fix(breg): confine historical Action Plan spelling to predecessors Signed-off-by: Jeremi Joslin --- .github/scripts/ci_changes.py | 28 ++ .github/scripts/test_ci_changes.py | 49 +++- .../tests/support/breg_native_service.rs | 10 +- .../src/api/tests/immediate_action_tests.rs | 2 +- crates/registry-breg/src/artifacts.rs | 12 +- .../registry-breg/src/authoring_integrity.rs | 8 +- crates/registry-breg/src/compiler.rs | 43 ++- crates/registry-breg/src/compiler/timezone.rs | 5 +- crates/registry-breg/src/contract.rs | 251 ++++++++++++++++-- crates/registry-breg/src/fixtures.rs | 6 +- crates/registry-breg/src/immediate_actions.rs | 20 +- crates/registry-breg/src/package.rs | 49 ++-- .../src/package/tests/immediate_actions.rs | 115 +++++++- .../src/package/tests/predecessor_sources.rs | 3 +- .../src/proposal_prepare/tests.rs | 4 +- .../tests/action_handler_benchmark_tests.rs | 8 +- .../tests/action_outcome_wasm_parity_tests.rs | 8 +- .../src/tests/wasm_runtime_tests.rs | 4 +- .../registry-breg/tests/access_explanation.rs | 4 +- .../tests/action_evidence_compiler.rs | 34 +-- .../tests/action_handler_declaration.rs | 22 +- .../tests/actions_functions_map.rs | 136 ++++++++-- .../tests/immediate_action_compiler.rs | 18 +- .../tests/immediate_action_handler.rs | 26 +- .../tests/native_inspection_inventory.rs | 18 +- .../tests/native_plan_security.rs | 6 +- .../tests/native_source_conventions.rs | 24 +- .../tests/ordered_plan_contract.rs | 8 +- .../tests/postgres_hook_changes.rs | 4 +- .../registry-breg/tests/postgres_package.rs | 8 +- .../postgres_package/compiler_upgrade.rs | 2 +- .../tests/postgres_package/derived_upgrade.rs | 6 +- .../registry-breg/tests/postgres_proposal.rs | 4 +- .../registry-breg/tests/registry_timezone.rs | 8 +- .../tests/review_context_package.rs | 4 +- crates/registry-breg/tests/script_baseline.rs | 4 +- .../support/proposal_required_attachment.rs | 4 +- crates/registry-breg/tests/timer_authoring.rs | 8 +- .../tests/wasm_handler_admission.rs | 28 +- .../src/action_handler_test.rs | 6 +- crates/registry-bregctl/src/check.rs | 3 + crates/registry-bregctl/src/explain_report.rs | 10 +- crates/registry-bregctl/src/lib.rs | 38 ++- crates/registry-bregctl/tests/cli.rs | 16 +- .../tests/explain_contract.rs | 15 +- .../tests/project_lock_refusals.rs | 6 +- .../tests/wasm_test_lifecycle.rs | 180 ++++++++++--- .../registry-caseworkctl/src/provider_add.rs | 23 +- crates/registry-cli-docs/catalog.json | 20 +- .../tests/support/breg_service.rs | 4 +- .../src/compile.rs | 15 +- .../src/derivation.rs | 16 +- .../src/formats.rs | 4 +- .../src/project.rs | 43 +-- .../registry-evidence-authoring/src/types.rs | 8 +- .../tests/acquisition_validation.rs | 4 +- .../tests/authoring_schema.rs | 20 +- .../tests/compiled_names.rs | 10 +- .../tests/derivation_depth.rs | 2 +- .../tests/finding_messages.rs | 32 +-- .../tests/formats_readers.rs | 67 ++++- .../tests/normalized_project.rs | 35 ++- .../tests/pack_sources.rs | 4 +- .../tests/public_check.rs | 4 +- .../tests/retired_source_diagnostics.rs | 2 +- .../registry-evidence/src/normalized_tests.rs | 8 +- .../src/public_check_tests.rs | 4 +- .../tests/authoring_output_forms.rs | 4 +- .../schemas/authoring/project.schema.json | 142 +++++----- crates/registry-evidencectl/src/check.rs | 40 +-- crates/registry-evidencectl/src/normalized.rs | 41 ++- crates/registry-evidencectl/src/scaffold.rs | 6 +- crates/registry-evidencectl/src/source_cli.rs | 12 +- .../src/source_import/files.rs | 2 +- .../src/source_import/mod.rs | 25 +- .../src/source_import/tests.rs | 9 +- .../src/source_mock/mod.rs | 6 +- .../registry-evidencectl/src/suggest/emit.rs | 2 +- .../registry-evidencectl/src/suggest/mod.rs | 6 +- .../templates/openapi/README.md | 4 +- .../templates/sqlite-extract/README.md | 6 +- .../templates/starter/README.md | 2 +- .../tests/explain_sources.rs | 2 +- .../tests/production_build.rs | 12 +- .../tests/production_handoff.rs | 6 +- crates/registry-language-server/README.md | 24 +- .../src/evidence/index.rs | 29 +- .../src/evidence/layout.rs | 2 +- .../src/products/catalog.rs | 8 +- crates/registry-language-server/src/refs.rs | 12 +- .../registry-language-server/src/workspace.rs | 2 +- .../tests/breg_native_authoring.rs | 13 +- .../tests/evidence_cards_protocol.rs | 2 +- .../tests/evidence_completion.rs | 12 +- .../tests/evidence_completion_adversarial.rs | 6 +- .../tests/evidence_diagnostics.rs | 2 +- .../tests/evidence_generated_navigation.rs | 22 ++ .../tests/evidence_index.rs | 10 +- .../tests/support/normalized.rs | 4 +- docs/site/.markdownlint-cli2.yaml | 1 + docs/site/astro.config.mjs | 1 + docs/site/package.json | 4 +- .../scripts/generate-posture-diagnostics.mjs | 179 +++++++++++++ .../generate-posture-diagnostics.test.mjs | 97 +++++++ .../components/PostureDiagnosticsTable.astro | 24 ++ .../content/docs/configure/adapter-jobs.mdx | 2 +- .../src/content/docs/configure/adapter.mdx | 2 +- .../content/docs/configure/breg-actions.mdx | 36 +-- .../content/docs/configure/breg-evidence.mdx | 8 +- .../content/docs/configure/breg-journeys.mdx | 4 +- .../content/docs/configure/breg-proposals.mdx | 8 +- .../docs/configure/breg-record-timers.mdx | 2 +- .../configure/breg-wasm-action-handlers.mdx | 12 +- docs/site/src/content/docs/configure/breg.mdx | 8 +- .../content/docs/configure/coordinator.mdx | 4 +- .../docs/explanation/how-evidence-works.mdx | 8 +- .../explanation/where-each-rule-lives.mdx | 10 +- .../src/content/docs/reference/breg-api.mdx | 4 +- .../evidence-request-adapter-api.mdx | 4 +- .../src/content/docs/reference/glossary.mdx | 25 +- .../docs/reference/posture-diagnostics.mdx | 26 ++ .../src/content/docs/security/evidence.mdx | 4 +- .../src/content/docs/start/coordinator.mdx | 2 +- .../assert-a-role-bound-relationship.mdx | 2 +- .../build-and-deploy-evidence-project.mdx | 2 +- .../change-a-registry-with-an-action.mdx | 2 +- .../connect-an-institution-source.mdx | 6 +- .../docs/tutorials/evidence-from-breg.mdx | 7 +- .../tutorials/first-evidence-assertion.mdx | 2 +- .../docs/tutorials/query-breg-client.mdx | 2 +- .../tutorials/return-a-governed-value.mdx | 2 +- docs/site/src/data/posture-diagnostics.json | 161 +++++++++++ .../examples/kobotoolbox-breg/registry.yaml | 6 +- .../qfield-postgis/registry/README.md | 2 +- products/breg/AGENTS.md | 5 + products/breg/CHANGELOG.md | 33 +++ .../evidence/provider/evidence.yaml | 6 +- .../farmer-landholding-evidence/registry.yaml | 10 +- .../person-registration-rhai/registry.yaml | 10 +- .../tests/run_live.py | 11 +- .../explain/ActionsExplanation.schema.json | 10 +- .../explain/LifecycleExplanation.schema.json | 2 +- .../explain/ProposalsExplanation.schema.json | 10 +- .../contracts/security-invariant-matrix.yaml | 2 +- .../evidence/offline-starter/evidence.yaml | 4 +- .../public-check/definitions.yaml.fragment | 4 +- .../starter/definitions.yaml.fragment | 6 +- .../breg/evidence/tests/verify-composition.py | 8 +- products/breg/examples/facility/registry.yaml | 6 +- .../breg/examples/formats/ctl-report.json | 8 +- .../formats/explain/access-explanation.json | 4 +- .../formats/explain/actions-explanation.json | 6 +- .../authored-display-actions-explanation.json | 2 +- .../authored-display-model-explanation.json | 2 +- .../formats/explain/model-explanation.json | 28 +- .../explain/proposals-explanation.json | 4 +- .../action-plan-branches/registry.yaml | 14 +- .../authoring/registry-module.schema.json | 154 +++++------ .../authoring/registry-project.schema.json | 154 +++++------ products/breg/scripts/test_generated_gates.py | 11 +- .../wasm-handler-sdk/admission/src/lib.rs | 10 +- .../applications-registry/registry.yaml | 6 +- products/evidence/CHANGELOG.md | 15 ++ products/evidence/README.md | 10 +- products/evidence/examples/fhir/evidence.yaml | 6 +- .../examples/operator-active/evidence.yaml | 4 +- .../examples/public-check/evidence.yaml | 4 +- .../examples/standalone/evidence.yaml | 10 +- .../wallet-presentation/evidence.yaml | 6 +- .../corpus/authoring_project/project.yaml | 4 +- .../reference/authoring-projects/CONFIG.md | 60 ++--- .../authoring-projects/SOURCE-EXPORT.md | 2 +- .../shared/evidence-project/README.md | 2 +- .../deployment-projects/CONFIG.md | 2 +- .../assertion-definitions.yaml | 2 +- .../fixture-validation/evidence.yaml | 4 +- .../assertion-definitions.yaml | 2 +- .../fixture-validation/evidence.yaml | 4 +- .../identifiers/generated/catalog.v1.json | 4 +- .../config-conventions-exceptions.yaml | 6 + products/platform/config-formats.yaml | 2 +- release/scripts/rehearse-upgrade.py | 7 +- release/scripts/test_rehearse_upgrade.py | 22 +- 183 files changed, 2426 insertions(+), 1026 deletions(-) create mode 100644 docs/site/scripts/generate-posture-diagnostics.mjs create mode 100644 docs/site/scripts/generate-posture-diagnostics.test.mjs create mode 100644 docs/site/src/components/PostureDiagnosticsTable.astro create mode 100644 docs/site/src/content/docs/reference/posture-diagnostics.mdx create mode 100644 docs/site/src/data/posture-diagnostics.json diff --git a/.github/scripts/ci_changes.py b/.github/scripts/ci_changes.py index 07f7d8797b..d52ff6e54a 100644 --- a/.github/scripts/ci_changes.py +++ b/.github/scripts/ci_changes.py @@ -1380,6 +1380,27 @@ def repo_docs_sources(root: Path = REPO_ROOT) -> frozenset[str]: ) +def has_development_setting(path: str) -> bool: + # Match the posture generator's Rust source scope and text prefilter. + source = Path(path) + parts = source.parts + if ( + len(parts) < 4 + or parts[0] != "crates" + or parts[2] != "src" + or source.suffix != ".rs" + or "tests" in parts[3:-1] + or source.name.endswith("_tests.rs") + ): + return False + source = REPO_ROOT / source + return ( + not source.is_symlink() + and source.is_file() + and "DevelopmentSetting" in source.read_text(encoding="utf-8") + ) + + CONFIG_FORMATS = "products/platform/config-formats.yaml" CONFIG_FORMAT_PATH = re.compile( r"^\s*(?:-\s+)?(?:path|file|example|driftCheck|differentialTest):\s*(\S+)\s*$", @@ -1636,6 +1657,11 @@ def classify( # The docs suite scans every current page generated from repo-docs.yaml, # so a change to one of their owning sources needs a docs run. repo_docs = repo_docs_sources() + # The posture drift check reads the Rust declarations named by this lookup. + posture_lookup = REPO_ROOT / "docs/site/src/data/posture-diagnostics.json" + posture_sources = frozenset( + json.loads(posture_lookup.read_text(encoding="utf-8"))["sources"] + ) docs = complete or "docs" in security_workflow_gates or any( matches( path, @@ -1716,6 +1742,8 @@ def classify( "release/notes/*", ) or path in repo_docs + or path in posture_sources + or has_development_setting(path) or path in { # An operator document outside the site that the docs release-pin diff --git a/.github/scripts/test_ci_changes.py b/.github/scripts/test_ci_changes.py index 4b0b6c3b04..261f00b138 100644 --- a/.github/scripts/test_ci_changes.py +++ b/.github/scripts/test_ci_changes.py @@ -18,6 +18,7 @@ from copy import deepcopy from pathlib import Path, PurePosixPath from typing import Any +from unittest.mock import patch import yaml @@ -3573,15 +3574,15 @@ def test_native_staff_mcp_inputs_select_real_product_postgres_proof(self) -> Non for name in ("BREG_BIN", "BREGCTL_BIN", "CASEWORK_BIN", "CASEWORKCTL_BIN", "REGISTRY_STACK_FIXTURES_ROOT"): self.assertIn(name, step["env"]) - def test_review_page_command_change_runs_the_catalog_test(self) -> None: + def test_review_page_source_runs_catalog_and_posture_docs(self) -> None: # `breg-review`'s Clap tree is built in its lib.rs, which the - # registry-cli-docs snapshot test holds to the committed catalog, so a - # change there runs that test rather than rebuilding the docs. + # registry-cli-docs snapshot test holds to the committed catalog. The + # same file owns a DevelopmentSetting used in the posture reference. outputs = classify( self.workspace, ("crates/registry-breg-review/src/lib.rs",), ) - self.assertFalse(outputs["docs"]) + self.assertTrue(outputs["docs"]) self.assertIn("registry-breg-review", outputs["rust_packages"]) self.assertIn("registry-cli-docs", outputs["rust_packages"]) self.assertFalse( @@ -4324,6 +4325,46 @@ def test_config_format_registry_change_runs_docs(self) -> None: self.assertTrue(Path(path).is_file()) self.assertTrue(classify(self.workspace, (path,))["docs"]) + def test_posture_diagnostic_sources_run_docs(self) -> None: + data = Path("docs/site/src/data/posture-diagnostics.json") + sources = json.loads(data.read_text(encoding="utf-8"))["sources"] + self.assertIn("crates/registry-platform-config/src/blocks.rs", sources) + for path in sources: + with self.subTest(path=path): + self.assertTrue(Path(path).is_file()) + selected = classify(self.workspace, (path,), pull_request=True) + self.assertTrue(selected["docs"]) + self.assertTrue(selected["rust"]) + + def test_unrelated_rust_source_does_not_run_posture_diagnostic_drift(self) -> None: + path = "crates/registry-breg/src/compiler/timezone.rs" + self.assertTrue(Path(path).is_file()) + selected = classify(self.workspace, (path,), pull_request=True) + self.assertFalse(selected["docs"]) + self.assertTrue(selected["rust"]) + + def test_new_posture_declaration_routes_to_docs_before_lookup_changes(self) -> None: + lookup = Path("docs/site/src/data/posture-diagnostics.json") + source = "crates/registry-breg/src/compiler/posture_example.rs" + self.assertNotIn(source, json.loads(lookup.read_text(encoding="utf-8"))["sources"]) + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + (root / lookup).parent.mkdir(parents=True) + (root / lookup).write_bytes(lookup.read_bytes()) + for path, expected in ( + (source, True), + ("crates/registry-breg/src/compiler/tests/posture_example.rs", False), + ("crates/registry-breg/src/compiler/posture_example_tests.rs", False), + ): + with self.subTest(path=path): + file = root / path + file.parent.mkdir(parents=True, exist_ok=True) + file.write_text("const NEW_SETTING: DevelopmentSetting = example();\n", encoding="utf-8") + with patch("ci_changes.REPO_ROOT", root): + selected = classify(self.workspace, (path,), pull_request=True) + self.assertIs(selected["docs"], expected) + self.assertTrue(selected["rust"]) + def test_every_published_openapi_description_runs_docs(self) -> None: """Whatever description the site fetches, a change to it rebuilds the docs.""" fetcher = Path("docs/site/scripts/fetch-openapi.mjs").read_text( diff --git a/crates/registry-adapter-connectors/tests/support/breg_native_service.rs b/crates/registry-adapter-connectors/tests/support/breg_native_service.rs index 6c31c45347..34d3bf8cf0 100644 --- a/crates/registry-adapter-connectors/tests/support/breg_native_service.rs +++ b/crates/registry-adapter-connectors/tests/support/breg_native_service.rs @@ -356,7 +356,7 @@ impl Breg { ] }}, "datasets": {"synthetic-items": {}}, - "functions": { + "actionPlans": { "update-item-plan": { "runtime": "rhai", "source": "scripts/update-item.rhai", @@ -378,8 +378,8 @@ impl Breg { {"id": "label", "type": "string", "required": true, "minimumLength": 1, "maximumLength": 80, "classification": "internal"} ], "plan": { - "type": "function", - "function": "update-item-plan", + "type": "scripted", + "actionPlan": "update-item-plan", "inputs": ["target", "label"], "writes": [{"id": "item", "target": {"fromInput": "target"}, "operation": "patch", "fields": ["label"]}] } @@ -410,8 +410,8 @@ impl Breg { {"id": "household-size", "apiName": "householdSize", "type": "int64", "required": true, "classification": "internal"} ], "plan": { - "type": "function", - "function": "register-household-plan", + "type": "scripted", + "actionPlan": "register-household-plan", "inputs": ["source-submission-id", "respondent-name", "household-size"], "writes": [{"id": "household", "target": {"recordType": "household"}, "operation": "create", "fields": ["owner", "source-submission-id", "respondent-name", "household-size"]}] } 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 2a89b37d73..15d4d7ed35 100644 --- a/crates/registry-breg/src/api/tests/immediate_action_tests.rs +++ b/crates/registry-breg/src/api/tests/immediate_action_tests.rs @@ -893,7 +893,7 @@ fn handler_timestamp_admission_enforces_the_kernel_string_bound_without_changing .unwrap(), ); project.actions[0].plan = serde_json::from_value(json!({ - "type":"function", "function":"create-entry-plan", "inputs":["label"], + "type":"scripted", "actionPlan":"create-entry-plan", "inputs":["label"], "writes": [{"id": "created", "target": {"recordType": "entry"}, "operation": "create", "fields": ["label"]}] })).unwrap(); let handler = crate::compiler::compile_project_with_assets( diff --git a/crates/registry-breg/src/artifacts.rs b/crates/registry-breg/src/artifacts.rs index d75297293e..eb54b8263b 100644 --- a/crates/registry-breg/src/artifacts.rs +++ b/crates/registry-breg/src/artifacts.rs @@ -629,7 +629,7 @@ pub(crate) fn render_mutation_policy(entity: &CompiledEntity) -> Value { /// included; caller metadata separately selects only its permitted fields. pub fn inspect_action(action: &CompiledAction) -> Value { let plan = match &action.handler { - Some(function) => json!({"type": "function", "function": inspect_plan_function(function)}), + Some(plan) => json!({"type": "scripted", "actionPlan": inspect_scripted_plan(plan)}), None => json!({"type": "fixed", "effects": action.effects, "order": action.effects.iter().map(|effect| &effect.id).collect::>()}), }; @@ -664,11 +664,11 @@ pub fn inspect_action(action: &CompiledAction) -> Value { }) } -fn inspect_plan_function(function: &crate::model::CompiledPlanFunction) -> Value { - let mut value = serde_json::to_value(function).expect("compiled function serializes"); - value["source"] = json!(match function.kind { - crate::model::CompiledPlanFunctionKind::Rhai => &function.script_path, - crate::model::CompiledPlanFunctionKind::Wasm => &function.module_path, +fn inspect_scripted_plan(plan: &crate::model::CompiledPlanFunction) -> Value { + let mut value = serde_json::to_value(plan).expect("compiled scripted plan serializes"); + value["source"] = json!(match plan.kind { + crate::model::CompiledPlanFunctionKind::Rhai => &plan.script_path, + crate::model::CompiledPlanFunctionKind::Wasm => &plan.module_path, }); value } diff --git a/crates/registry-breg/src/authoring_integrity.rs b/crates/registry-breg/src/authoring_integrity.rs index 2912e38277..0ca260d7c9 100644 --- a/crates/registry-breg/src/authoring_integrity.rs +++ b/crates/registry-breg/src/authoring_integrity.rs @@ -638,8 +638,8 @@ pub(crate) fn project_diagnostics( }), ), ( - "breg.function.id-collision", - keyed_ids("/functions", &project.functions, |item| &item.id), + "breg.action-plan.id-collision", + keyed_ids("/actionPlans", &project.functions, |item| &item.id), ), ( "breg.action.id-collision", @@ -1285,8 +1285,8 @@ pub(crate) fn module_diagnostics( keyed_ids("/recordTypes", &module.entities, |item| &item.id), ), ( - "breg.function.id-collision", - keyed_ids("/functions", &module.functions, |item| &item.id), + "breg.action-plan.id-collision", + keyed_ids("/actionPlans", &module.functions, |item| &item.id), ), ( "breg.action.id-collision", diff --git a/crates/registry-breg/src/compiler.rs b/crates/registry-breg/src/compiler.rs index 97f8008b7e..d01c7cad6b 100644 --- a/crates/registry-breg/src/compiler.rs +++ b/crates/registry-breg/src/compiler.rs @@ -298,7 +298,7 @@ pub fn compile_project_with_assets( }), ) { - validate_id(&function.id, "functions[].id", &mut diagnostics); + validate_id(&function.id, "actionPlans[].id", &mut diagnostics); if !(1..=100000).contains(&function.limits.maximum_operations) || !(1..=1048576).contains(&function.limits.maximum_output_bytes) || functions @@ -311,7 +311,7 @@ pub fn compile_project_with_assets( ) .is_some() { - diagnostics.push(Diagnostic::error("breg.function.contract-invalid", "functions[]", "functions require unique IDs across the module closure and bounded positive execution/output limits")); + diagnostics.push(Diagnostic::error("breg.action-plan.contract-invalid", "actionPlans[]", "Action Plans require unique IDs across the module closure and bounded positive execution/output limits")); } } let (mut sources, mut origins, mut action_sources) = @@ -1634,7 +1634,7 @@ fn validate_cross_file_local_id_collisions( .iter() .map(|function| SourcedLocalId { id: function.id.clone(), - path: format!("functions[id={}].id", function.id), + path: format!("actionPlans[id={}].id", function.id), source: None, }) .collect::>(); @@ -1684,7 +1684,10 @@ fn validate_cross_file_local_id_collisions( })); functions.extend(module.functions.iter().map(|function| SourcedLocalId { id: function.id.clone(), - path: format!("modules[id={}].functions[id={}].id", module.id, function.id), + path: format!( + "modules[id={}].actionPlans[id={}].id", + module.id, function.id + ), source: Some(source), })); for entity in &module.entities { @@ -1714,7 +1717,7 @@ fn validate_cross_file_local_id_collisions( ("breg.module.id-collision", &module_ids), ("breg.record-type.id-collision", &records), ("breg.action.id-collision", &actions), - ("breg.function.id-collision", &functions), + ("breg.action-plan.id-collision", &functions), ("breg.hook.id-collision", &hooks), ] { add_cross_file_collisions(code, values, errors); @@ -3422,7 +3425,25 @@ pub fn module_digest(module: &RegistryModule) -> String { } pub fn module_digest_with_assets(module: &RegistryModule, assets: &[ModuleAssetSource]) -> String { - let value = serde_json::to_value(module).expect("module serializes"); + let mut value = serde_json::to_value(module).expect("module serializes"); + // Both module digest domains use the sealed Action Plan vocabulary. + // Project and module authoring use the current names independently. + let members = value + .as_object_mut() + .expect("module serializes as a mapping"); + let action_plans = members + .remove("actionPlans") + .expect("module has an Action Plan map"); + members.insert("functions".to_owned(), action_plans); + if let Some(actions) = members.get_mut("actions").and_then(Value::as_object_mut) { + for action in actions.values_mut() { + let plan = action["plan"].as_object_mut().expect("Action has a plan"); + if let Some(action_plan) = plan.remove("actionPlan") { + plan.insert("type".to_owned(), Value::String("function".to_owned())); + plan.insert("function".to_owned(), action_plan); + } + } + } let bytes = canonicalize_json(&value).expect("module canonicalizes"); let mut module_assets = assets .iter() @@ -6431,7 +6452,7 @@ fn stored_field_fillability_findings( "recordTypes[id={}].fields[id={}]", entity.id, field.logical.id ), - "this optional stored field has no writable access grant, fixed Action set, function-plan write, or import that can supply a value; add the field to one of those writers, or remove the field", + "this optional stored field has no writable access grant, fixed Action set, scripted Action Plan write, or import that can supply a value; add the field to one of those writers, or remove the field", )); } } @@ -10174,15 +10195,15 @@ fn validate_native_definitions(project: &RegistryProject, errors: &mut Vec, - /// Written as a mapping from each function id to the rest of the function + /// Written as a mapping from each Action Plan id to the rest of the plan /// (CFG-ID-5) and held sorted by id. #[serde( default, + rename = "actionPlans", deserialize_with = "registry_platform_yaml::id_keyed_by_local_id", serialize_with = "registry_platform_yaml::serialize_id_keyed" )] @@ -478,7 +479,9 @@ pub enum ActionPlanSource { Fixed { effects: Vec, }, + #[serde(rename = "scripted")] Function { + #[serde(rename = "actionPlan")] function: String, inputs: Vec, writes: Vec, @@ -522,6 +525,7 @@ pub struct FunctionSource { } #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[cfg_attr(feature = "schema", schemars(rename = "ActionPlanCapabilitySource"))] #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize, Deserialize)] #[serde(rename_all = "kebab-case")] pub enum FunctionCapabilitySource { @@ -580,6 +584,7 @@ fn review_context_fields_schema(generator: &mut schemars::SchemaGenerator) -> sc }) } #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[cfg_attr(feature = "schema", schemars(rename = "ActionPlanLimitsSource"))] #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(deny_unknown_fields, rename_all = "camelCase")] pub struct FunctionLimitsSource { @@ -1957,10 +1962,11 @@ pub struct RegistryModule { schemars(schema_with = "local_id_map_schema::") )] pub row_boundary_sets: BTreeMap, - /// Written as a mapping from each function id to the rest of the function + /// Written as a mapping from each Action Plan id to the rest of the plan /// (CFG-ID-5) and held sorted by id. #[serde( default, + rename = "actionPlans", deserialize_with = "registry_platform_yaml::id_keyed_by_local_id", serialize_with = "registry_platform_yaml::serialize_id_keyed" )] @@ -6227,11 +6233,24 @@ const EQUALS_INPUT_REPLACEMENT: &str = "Rename `equalsInput` to `equalsFromInput`, keeping the same input reference."; const FROM_FIELD_REPLACEMENT: &str = "Rename `fromField` to `fromInput`, keeping the same input reference."; -const PLAN_CAPABILITIES_REPLACEMENT: &str = "Remove `plan.capabilities`. Declare the Action's Evidence dependencies in `evidence`; a named Function's `capabilities` list is only its ceiling."; +const PLAN_CAPABILITIES_REPLACEMENT: &str = "Remove `plan.capabilities`. Declare the Action's Evidence dependencies in `evidence`; a named Action Plan's `capabilities` list is only its ceiling."; +const RETIRED_ACTION_PLAN_KEYS: [RemovedKey<'static>; 2] = [ + RemovedKey { + pointer: "/functions", + replacement: + "Rename `functions` to `actionPlans`, keeping the Action Plan IDs and declarations.", + }, + RemovedKey { + pointer: "/actions/*/plan/function", + replacement: "Rename `plan.function` to `plan.actionPlan` and use `plan.type: scripted`.", + }, +]; /// Members `registry.yaml` no longer accepts, each with the member that /// replaced it. const PROJECT_REMOVED_KEYS: &[RemovedKey<'static>] = &[ + RETIRED_ACTION_PLAN_KEYS[0], + RETIRED_ACTION_PLAN_KEYS[1], RemovedKey { pointer: "/datasets/*/id", replacement: "Write datasets as a mapping from each id to the rest of its entry, datasets: {DATASET_ID: {display: ...}}, with no id member.", @@ -6269,8 +6288,8 @@ const PROJECT_REMOVED_KEYS: &[RemovedKey<'static>] = &[ replacement: "Write actions as a mapping from each id to the rest of its entry, actions: {ACTION_ID: {execution: ...}}, with no id member.", }, RemovedKey { - pointer: "/functions/*/id", - replacement: "Write functions as a mapping from each id to the rest of its entry, functions: {FUNCTION_ID: {runtime: ...}}, with no id member.", + pointer: "/actionPlans/*/id", + replacement: "Write actionPlans as a mapping from each id to the rest of its entry, actionPlans: {PLAN_ID: {runtime: ...}}, with no id member.", }, RemovedKey { pointer: "/recordTypes/*/id", @@ -6444,13 +6463,15 @@ const PROJECT_REMOVED_KEYS: &[RemovedKey<'static>] = &[ /// Members a module no longer accepts, each with the member that replaced it. const MODULE_REMOVED_KEYS: &[RemovedKey<'static>] = &[ + RETIRED_ACTION_PLAN_KEYS[0], + RETIRED_ACTION_PLAN_KEYS[1], RemovedKey { pointer: "/actions/*/id", replacement: "Write actions as a mapping from each id to the rest of its entry, actions: {ACTION_ID: {execution: ...}}, with no id member.", }, RemovedKey { - pointer: "/functions/*/id", - replacement: "Write functions as a mapping from each id to the rest of its entry, functions: {FUNCTION_ID: {runtime: ...}}, with no id member.", + pointer: "/actionPlans/*/id", + replacement: "Write actionPlans as a mapping from each id to the rest of its entry, actionPlans: {PLAN_ID: {runtime: ...}}, with no id member.", }, RemovedKey { pointer: "/recordTypes/*/id", @@ -6663,29 +6684,155 @@ pub const MODULE_FORMAT: FormatSpec<'static> = FormatSpec { removed_keys: MODULE_REMOVED_KEYS, }; +// Replaying a verified package can see the Action Plan keys its sealed source +// predates. Other retired keys are still checked by the shared reader. +const SEALED_PROJECT_FORMAT: FormatSpec<'static> = FormatSpec { + removed_keys: PROJECT_REMOVED_KEYS + .split_at(RETIRED_ACTION_PLAN_KEYS.len()) + .1, + ..PROJECT_FORMAT +}; +const SEALED_MODULE_FORMAT: FormatSpec<'static> = FormatSpec { + removed_keys: MODULE_REMOVED_KEYS + .split_at(RETIRED_ACTION_PLAN_KEYS.len()) + .1, + ..MODULE_FORMAT +}; + /// Read an authored project through the shared reader. `file` is the name /// diagnostics carry. Every diagnostic carries its code, path, line and /// column, and the action that fixes it (CFG-DIAG-1), and none repeats a /// value from the file. pub fn read_project_yaml(file: &str, bytes: &[u8]) -> Result, Report> { - let mut decoded = read_with_value_types(file, bytes, &PROJECT_FORMAT)?; + read_project(file, bytes, false).map(|(decoded, _)| decoded) +} + +fn read_project( + file: &str, + bytes: &[u8], + sealed: bool, +) -> Result<(Decoded, bool), Report> { + let format = if sealed { + &SEALED_PROJECT_FORMAT + } else { + &PROJECT_FORMAT + }; + let (mut decoded, translated) = read_with_value_types(file, bytes, format, sealed)?; let errors = crate::authoring_integrity::project_diagnostics(&mut decoded); if errors.is_empty() { - Ok(decoded) + Ok((decoded, translated)) } else { Err(decoded.document.report_with(errors)) } } +// Package replay starts from source bytes that have already passed integrity +// checks. Translate their historical Action Plan keys before typed decode. +fn normalize_sealed_action_plans(value: &mut Value, document: &Document) -> Result { + let Some(root) = value.as_object_mut() else { + return Ok(false); + }; + let mut current = root.contains_key("actionPlans"); + let mut translated = rename_sealed_plan_key(root, "functions", "actionPlans", "", document)?; + if let Some(actions) = root.get_mut("actions").and_then(Value::as_object_mut) { + for (id, action) in actions { + let Some(plan) = action.get_mut("plan").and_then(Value::as_object_mut) else { + continue; + }; + let plan_type = plan.get("type").and_then(Value::as_str); + let legacy_reference = plan.contains_key("function"); + let current_reference = plan.contains_key("actionPlan"); + let legacy_plan = plan_type == Some("function") && legacy_reference; + let current_plan = plan_type == Some("scripted") && current_reference; + let duplicate_reference = legacy_reference && current_reference; + if !legacy_plan && !current_plan && !duplicate_reference { + continue; + } + let id = id.replace('~', "~0").replace('/', "~1"); + let pointer = format!("/actions/{id}/plan"); + if !duplicate_reference && ((legacy_plan && current) || (current_plan && translated)) { + return Err(document.report_with([document.diagnostic_at_value( + Severity::Error, + "breg.action-plan.mixed-spelling", + &format!("{pointer}/type"), + "The sealed source mixes historical and current Action Plan spellings.", + "Use a package whose source uses one Action Plan spelling per file.", + )])); + } + current |= current_plan; + if (legacy_plan || duplicate_reference) + && rename_sealed_plan_key(plan, "function", "actionPlan", &pointer, document)? + { + plan.insert("type".to_owned(), Value::String("scripted".to_owned())); + translated = true; + } + } + } + Ok(translated) +} + +fn rename_sealed_plan_key( + members: &mut serde_json::Map, + old: &str, + current: &str, + pointer: &str, + document: &Document, +) -> Result { + let Some(value) = members.remove(old) else { + return Ok(false); + }; + if members.contains_key(current) { + return Err(document.report_with([document.diagnostic_at_key( + Severity::Error, + "yaml.duplicate-key", + &format!("{pointer}/{old}"), + &format!("The sealed source declares both `{old}` and `{current}`."), + "Use a package whose source declares exactly one spelling of the key.", + )])); + } + members.insert(current.to_owned(), value); + Ok(true) +} + fn read_with_value_types( file: &str, bytes: &[u8], format: &FormatSpec<'_>, -) -> Result, Report> { + sealed: bool, +) -> Result<(Decoded, bool), Report> { let Decoded { mut value, document, } = read_authored::(file, bytes, format)?; + let translated = if sealed { + normalize_sealed_action_plans(&mut value, &document)? + } else { + // The key `type` is still valid. The removed-key table can only + // refuse members, so report the retired tag at its value here. + let diagnostics: Vec<_> = value + .get("actions") + .and_then(Value::as_object) + .into_iter() + .flatten() + .filter(|(_, action)| { + action.pointer("/plan/type").and_then(Value::as_str) == Some("function") + }) + .map(|(id, _)| { + let id = id.replace('~', "~0").replace('/', "~1"); + document.diagnostic_at_value( + Severity::Error, + "config.removed-key", + &format!("/actions/{id}/plan/type"), + "The Action plan type `function` was renamed to `scripted`.", + "Write `plan.type: scripted` and name the Action Plan under `plan.actionPlan`.", + ) + }) + .collect(); + if !diagnostics.is_empty() { + return Err(document.report_with(diagnostics)); + } + false + }; let option_errors = field_option_diagnostics(&document, &value); if !option_errors.is_empty() { return Err(document.report_with(option_errors)); @@ -6706,8 +6853,10 @@ fn read_with_value_types( "Declare the set under rowBoundarySets in this file and reference it by its identifier, with no other member.", )]) })?; - if !has_value_types && !resolved_sets && !has_row_boundary_sets { - return document.decode().map(|value| Decoded { value, document }); + if !translated && !has_value_types && !resolved_sets && !has_row_boundary_sets { + return document + .decode() + .map(|value| (Decoded { value, document }, false)); } // Every reference is expanded, so the read file holds the boundaries // inline and no set: it serializes to source that reads back the same. @@ -6728,10 +6877,13 @@ fn read_with_value_types( } let normalized = serde_json::to_vec(&value).expect("normalized authoring value serializes"); match read_authored::(file, &normalized, format) { - Ok(decoded) => Ok(Decoded { - value: decoded.value, - document, - }), + Ok(decoded) => Ok(( + Decoded { + value: decoded.value, + document, + }, + translated, + )), Err(report) => { let diagnostics = report .into_diagnostics() @@ -6873,10 +7025,23 @@ fn field_option_diagnostics( /// Read an authored module through the shared reader, as /// [`read_project_yaml`] reads a project. pub fn read_module_yaml(file: &str, bytes: &[u8]) -> Result, Report> { - let mut decoded = read_with_value_types(file, bytes, &MODULE_FORMAT)?; + read_module(file, bytes, false).map(|(decoded, _)| decoded) +} + +fn read_module( + file: &str, + bytes: &[u8], + sealed: bool, +) -> Result<(Decoded, bool), Report> { + let format = if sealed { + &SEALED_MODULE_FORMAT + } else { + &MODULE_FORMAT + }; + let (mut decoded, translated) = read_with_value_types(file, bytes, format, sealed)?; let errors = crate::authoring_integrity::module_diagnostics(&mut decoded); if errors.is_empty() { - Ok(decoded) + Ok((decoded, translated)) } else { Err(decoded.document.report_with(errors)) } @@ -6905,6 +7070,24 @@ pub fn parse_module_yaml(bytes: &[u8]) -> Result .map_err(|report| compile_failure_from_report("module", &report)) } +#[cfg(feature = "runtime")] +pub(crate) fn parse_sealed_project_yaml( + bytes: &[u8], +) -> Result<(RegistryProject, bool), CompileFailure> { + read_project(PROJECT_FILE, bytes, true) + .map(|(decoded, translated)| (decoded.value, translated)) + .map_err(|report| compile_failure_from_report("project", &report)) +} + +#[cfg(feature = "runtime")] +pub(crate) fn parse_sealed_module_yaml( + bytes: &[u8], +) -> Result<(RegistryModule, bool), CompileFailure> { + read_module(MODULE_FILE, bytes, true) + .map(|(decoded, translated)| (decoded.value, translated)) + .map_err(|report| compile_failure_from_report("module", &report)) +} + fn parse_json_value(bytes: &[u8], root: &str) -> Result { parse_json_strict(bytes).map_err(|error| { CompileFailure::from_one(Diagnostic::error( @@ -7294,6 +7477,32 @@ mod tests { use super::*; use serde_json::json; + #[test] + fn sealed_formats_skip_only_the_two_retired_action_plan_keys() { + for (authored, sealed) in [ + (&PROJECT_FORMAT, &SEALED_PROJECT_FORMAT), + (&MODULE_FORMAT, &SEALED_MODULE_FORMAT), + ] { + let expected = authored + .removed_keys + .iter() + .map(|entry| entry.pointer) + .filter(|pointer| { + !RETIRED_ACTION_PLAN_KEYS + .iter() + .any(|entry| entry.pointer == *pointer) + }) + .collect::>(); + let observed = sealed + .removed_keys + .iter() + .map(|entry| entry.pointer) + .collect::>(); + assert_eq!(observed, expected); + assert_eq!(authored.removed_keys.len() - observed.len(), 2); + } + } + #[test] fn a_field_type_writes_each_bound_under_its_one_name() { let string = FieldTypeSource::String { diff --git a/crates/registry-breg/src/fixtures.rs b/crates/registry-breg/src/fixtures.rs index a00da91d98..dbdcb4ede1 100644 --- a/crates/registry-breg/src/fixtures.rs +++ b/crates/registry-breg/src/fixtures.rs @@ -7382,11 +7382,11 @@ journeys: "datasets":{"people": {}}, "recordTypes":{"person": {"primaryDataset":"people","route":"people","mutationMode":"mutable", "fields":[{"id":"name","type":"string","maximumLength":80,"required":true,"classification":"internal"}]}}, - "functions":{"person-plan": {"runtime":"rhai","source":"scripts/person-name-change.rhai","entrypoint":"plan","abi":"registry.action-plan/v1"}}, + "actionPlans":{"person-plan": {"runtime":"rhai","source":"scripts/person-name-change.rhai","entrypoint":"plan","abi":"registry.action-plan/v1"}}, "actions":{"rename-person": {"execution":{"mode":"immediate"}, "inputs":[{"id":"person","type":"reference","target":"person","required":true,"classification":"internal"}, {"id":"name","type":"string","maximumLength":80,"required":true,"classification":"internal"}], - "plan":{"type":"function","function":"person-plan","inputs":["person","name"], + "plan":{"type":"scripted","actionPlan":"person-plan","inputs":["person","name"], "writes":[{"id":"person","target":{"fromInput":"person"},"operation":"patch","fields":["name"]}]}}}, "accessProfiles":{"person-operator": {"principalClaim":"principal","requiredScopes":"unrestricted","requiredPurposes":["person-maintenance"], "permissions":{"records":[{"recordType":"person","operations":["get","list"],"readableFields":["name"],"rowBoundaries":"unrestricted"}], @@ -7629,7 +7629,7 @@ journeys: "id": "person-module", "version": "0.1.0", "recordTypes": entities, - "functions": project_value.as_object_mut().unwrap().remove("functions").unwrap(), + "actionPlans": project_value.as_object_mut().unwrap().remove("actionPlans").unwrap(), }); let module_bytes = serde_json::to_vec(&module_value).expect("module serializes"); let module = parse_module_yaml(&module_bytes).expect("planner module parses"); diff --git a/crates/registry-breg/src/immediate_actions.rs b/crates/registry-breg/src/immediate_actions.rs index c6bb79acc3..bb474dc6a7 100644 --- a/crates/registry-breg/src/immediate_actions.rs +++ b/crates/registry-breg/src/immediate_actions.rs @@ -173,9 +173,9 @@ fn compile_action( { let Some(function_source) = functions.get(function) else { errors.push(Diagnostic::error( - "breg.action.function-unknown", - "actions[].plan.function", - "the plan must reference a declared function", + "breg.action.plan-unknown", + "actions[].plan.actionPlan", + "the plan must reference a declared Action Plan", )); return None; }; @@ -193,7 +193,7 @@ fn compile_action( if !bound_capabilities.is_subset(&function_capabilities) || function.abi != crate::contract::ACTION_PLAN_ABI_V1 { - errors.push(Diagnostic::error("breg.action.function-contract-invalid", "actions[].plan.function", "the function requires the action-plan ABI and a capability ceiling containing every bound capability")); + errors.push(Diagnostic::error("breg.action.plan-contract-invalid", "actions[].plan.actionPlan", "the Action Plan requires the action-plan ABI and a capability ceiling containing every bound capability")); } if action.is_proposal() && (function.runtime != crate::contract::ActionHandlerKindSource::Rhai @@ -207,9 +207,9 @@ fn compile_action( .any(|input| !input_map.contains_key(input.as_str())) { errors.push(Diagnostic::error( - "breg.action.function-input-unknown", + "breg.action.plan-input-unknown", "actions[].plan.inputs", - "function inputs must uniquely name declared Action inputs", + "Action Plan inputs must uniquely name declared Action inputs", )); } let source = crate::contract::ActionHandlerSource { @@ -442,7 +442,7 @@ fn compile_handler( }; let path = format!("actions[id={}].plan", collected.source.id); - let function_path = format!("functions[id={}]", function.id); + let function_path = format!("actionPlans[id={}]", function.id); let Some(kind) = source.kind() else { // The shared handler declaration also offers a remote destination. An // action handler runs inside the triggering transaction and has no @@ -451,7 +451,7 @@ fn compile_handler( errors.push(Diagnostic::error( "breg.action.handler-kind-unsupported", format!("{function_path}.runtime"), - "a plan function runs in the registry; declare runtime rhai or wasm", + "an Action Plan runs in the registry; declare runtime rhai or wasm", )); return None; }; @@ -932,7 +932,7 @@ fn compile_handler( .into_iter() .map(|call| { ( - "breg.action.plan-function-unavailable", + "breg.action.plan-unavailable", format!( "`{}` is not available to Action plans, which run without the clock, sleep, or Rhai's language-core functions; remove the call", call.function @@ -1369,7 +1369,7 @@ fn validate_current_revision( "breg.action.concurrency-caller-value", "actions[].plan", &format!( - "Action `{}` uses concurrency: current-revision, and a function plan writes values computed from the caller's inputs into an existing record", + "Action `{}` uses concurrency: current-revision, and a scripted Action Plan writes values computed from the caller's inputs into an existing record", action.id ), )); diff --git a/crates/registry-breg/src/package.rs b/crates/registry-breg/src/package.rs index 5a5d9b4649..5d7ffd0333 100644 --- a/crates/registry-breg/src/package.rs +++ b/crates/registry-breg/src/package.rs @@ -31,8 +31,8 @@ use thiserror::Error; use crate::artifacts::REGISTRY_METADATA_ARTIFACT_PATH; use crate::compiler::{compile_project_with_assets, CompileProfile}; use crate::contract::{ - parse_module_yaml, parse_project_yaml, FieldTypeSource, ModuleAssetSource, RegistryModule, - RegistryProject, + parse_module_yaml, parse_project_yaml, parse_sealed_module_yaml, parse_sealed_project_yaml, + FieldTypeSource, ModuleAssetSource, RegistryModule, RegistryProject, }; use crate::derived_sql::MAX_DERIVED_SQL_BYTES; use crate::generated_ddl::{ @@ -795,6 +795,8 @@ pub enum PackageError { Binding, #[error("the package compiler derivation failed")] Derivation, + #[error("the sealed sources use historical Action Plan spelling or the generated artifacts differ from this release's compiler output")] + GeneratedArtifactsMismatch, /// A package whose generated files name a Record type `entityId`, as /// releases up to v0.41.0 wrote them. #[error( @@ -4347,7 +4349,8 @@ pub fn load_predecessor_rehearsal_baseline_with_verified_envelope( shared: &SharedVerifiedPackage, ) -> Result<(VerifiedPredecessorPackage, CompiledRegistry)> { let (package, loaded) = load_predecessor_closure(root, context, shared)?; - let (registry, _) = compile_package_sources(&package.manifest, &loaded)?; + let (registry, _) = + compile_package_sources(&package.manifest, &loaded, PackageSourceMode::Predecessor)?; Ok((package, registry)) } @@ -4360,7 +4363,7 @@ fn load_predecessor_closure( let (manifest, loaded) = load_verified_closure(root, shared, production)?; validate_engine_features(&manifest)?; validate_source_inventory(&manifest)?; - parse_package_sources(&manifest, &loaded)?; + parse_package_sources(&manifest, &loaded, PackageSourceMode::Predecessor)?; let governed = package_predecessor_governed_model(&manifest, &loaded)?; validate_predecessor_registry_bindings(&manifest, &governed)?; let package_digest = shared.digest().to_owned(); @@ -4859,17 +4862,33 @@ fn source_refusal(failure: &CompileFailure) -> PackageError { PackageError::PreviousReleaseSources(detail) } -/// Parse the stored sources of one verified package closure. A package built -/// before this release holds sources this reader refuses, and every reader of -/// the closure, a predecessor reader included, says so. +#[derive(Clone, Copy)] +enum PackageSourceMode { + Strict, + Predecessor, +} + +impl PackageSourceMode { + fn accept(self, parsed: std::result::Result<(T, bool), CompileFailure>) -> Result { + let (source, translated) = parsed.map_err(|failure| source_refusal(&failure))?; + if translated && matches!(self, Self::Strict) { + return Err(PackageError::GeneratedArtifactsMismatch); + } + Ok(source) + } +} + +/// Parse verified source bytes. Only predecessor planning and rehearsal can +/// use translated historical Action Plan keys. fn parse_package_sources( manifest: &PackageManifest, loaded: &BTreeMap>, + mode: PackageSourceMode, ) -> Result<(RegistryProject, Vec)> { let project_bytes = loaded .get(&manifest.sources.project) .ok_or(PackageError::Derivation)?; - let project = parse_project_yaml(project_bytes).map_err(|failure| source_refusal(&failure))?; + let project = mode.accept(parse_sealed_project_yaml(project_bytes))?; let modules = manifest .sources .modules @@ -4878,9 +4897,7 @@ fn parse_package_sources( loaded .get(&source.path) .ok_or(PackageError::Derivation) - .and_then(|bytes| { - parse_module_yaml(bytes).map_err(|failure| source_refusal(&failure)) - }) + .and_then(|bytes| mode.accept(parse_sealed_module_yaml(bytes))) }) .collect::>>()?; Ok((project, modules)) @@ -4891,6 +4908,7 @@ fn parse_package_sources( fn compile_package_sources( manifest: &PackageManifest, loaded: &BTreeMap>, + mode: PackageSourceMode, ) -> Result<(CompiledRegistry, bool)> { validate_source_inventory(manifest)?; let fixture_journeys = loaded @@ -4900,7 +4918,7 @@ fn compile_package_sources( { return Err(PackageError::Derivation); } - let (project, modules) = parse_package_sources(manifest, loaded)?; + let (project, modules) = parse_package_sources(manifest, loaded, mode)?; let module_assets = captured_compiler_assets(manifest, loaded)?; let project_assets = module_assets .iter() @@ -4955,7 +4973,8 @@ fn rederive( bool, )> { validate_engine_features(manifest)?; - let (compiled, placeholder_identity) = compile_package_sources(manifest, loaded)?; + let (compiled, placeholder_identity) = + compile_package_sources(manifest, loaded, PackageSourceMode::Strict)?; let expected_artifacts = expected_artifact_bytes(manifest, &compiled)?; let packaged_artifacts = manifest .files @@ -4980,11 +4999,11 @@ fn rederive( .collect::>() != packaged_artifacts { - return Err(PackageError::Derivation); + return Err(PackageError::GeneratedArtifactsMismatch); } for (path, bytes) in expected_artifacts { if loaded.get(&path).map(Vec::as_slice) != Some(bytes.as_slice()) { - return Err(PackageError::Derivation); + return Err(PackageError::GeneratedArtifactsMismatch); } } validate_migration_plan(manifest, &compiled)?; diff --git a/crates/registry-breg/src/package/tests/immediate_actions.rs b/crates/registry-breg/src/package/tests/immediate_actions.rs index 06b50dd014..3f808b2386 100644 --- a/crates/registry-breg/src/package/tests/immediate_actions.rs +++ b/crates/registry-breg/src/package/tests/immediate_actions.rs @@ -984,7 +984,7 @@ fn proposal_handler_evidence_source() -> Value { &["get", "edit", "submit", "cancel", "apply"], &["item", "label"], ); - value["functions"] = json!({"rename-plan": {"runtime": "rhai", + value["actionPlans"] = json!({"rename-plan": {"runtime": "rhai", "source": "handlers/rename.rhai", "entrypoint": "plan", "abi": "registry.action-plan/v1", @@ -1006,8 +1006,8 @@ fn proposal_handler_evidence_source() -> Value { "maximumObservationAgeSeconds": 60, }]}); value["actions"]["rename-item"]["plan"] = json!({ - "type": "function", - "function": "rename-plan", + "type": "scripted", + "actionPlan": "rename-plan", "inputs": ["item", "label"], "refusals": [{"code": "rename-refused", "label": "The rename was refused."}], "writes": [{ @@ -1020,6 +1020,115 @@ fn proposal_handler_evidence_source() -> Value { value } +#[test] +fn sealed_package_sources_decode_historical_action_plan_spelling() { + let project = proposal_handler_evidence_source(); + let module = json!({ + "apiVersion": "id.registrystack.org/formats/breg/module/v1alpha1", + "kind": "BRegModule", + "id": "test-module", + "version": "1", + "actionPlans": project["actionPlans"], + "actions": project["actions"], + }); + let previous_spelling = |source: &Value| { + let current = serde_json::to_string(source).expect("source serializes"); + current + .replace("\"actionPlans\":", "\"functions\":") + .replace("\"type\":\"scripted\"", "\"type\":\"function\"") + .replace("\"actionPlan\":", "\"function\":") + }; + + let old_project = previous_spelling(&project); + let old_module = previous_spelling(&module); + let project = serde_json::to_vec(&project).unwrap(); + let module = serde_json::to_vec(&module).unwrap(); + assert_eq!( + parse_sealed_project_yaml(old_project.as_bytes()).unwrap(), + (parse_project_yaml(&project).unwrap(), true) + ); + assert_eq!( + parse_sealed_module_yaml(old_module.as_bytes()).unwrap(), + (parse_module_yaml(&module).unwrap(), true) + ); +} + +#[test] +fn sealed_package_sources_refuse_conflicting_action_plan_spellings() { + let mut project = proposal_handler_evidence_source(); + project["functions"] = json!({}); + let error = parse_sealed_project_yaml(&serde_json::to_vec(&project).unwrap()) + .expect_err("a sealed source cannot specify both Action Plan maps"); + assert_eq!(error.diagnostics()[0].code, "yaml.duplicate-key"); + assert_eq!(error.diagnostics()[0].path, "project.functions"); + + project.as_object_mut().unwrap().remove("functions"); + project["actions"]["rename-item"]["plan"]["function"] = json!("other-plan"); + let error = parse_sealed_project_yaml(&serde_json::to_vec(&project).unwrap()) + .expect_err("a sealed source cannot specify both Action Plan references"); + assert_eq!(error.diagnostics()[0].code, "yaml.duplicate-key"); + assert_eq!( + error.diagnostics()[0].path, + "project.actions.rename-item.plan.function" + ); + + let plan = project["actions"]["rename-item"]["plan"] + .as_object_mut() + .unwrap(); + let action_plan = plan.remove("actionPlan").unwrap(); + assert!(parse_sealed_project_yaml(&serde_json::to_vec(&project).unwrap()).is_err()); + + let plan = project["actions"]["rename-item"]["plan"] + .as_object_mut() + .unwrap(); + plan.remove("function"); + plan.insert("actionPlan".to_owned(), action_plan); + plan.insert("type".to_owned(), json!("function")); + assert!(parse_sealed_project_yaml(&serde_json::to_vec(&project).unwrap()).is_err()); +} + +#[test] +fn sealed_package_sources_require_one_action_plan_spelling_per_file() { + let mut project = proposal_handler_evidence_source(); + let root = project.as_object_mut().unwrap(); + let plans = root.remove("actionPlans").unwrap(); + root.insert("functions".into(), plans); + let error = parse_sealed_project_yaml(&serde_json::to_vec(&project).unwrap()) + .expect_err("historical root keys and current Action plans cannot share a file"); + assert_eq!( + error.diagnostics()[0].code, + "breg.action-plan.mixed-spelling" + ); + assert_eq!( + error.diagnostics()[0].path, + "project.actions.rename-item.plan.type" + ); + + let current_action = project["actions"]["rename-item"].clone(); + let mut legacy_action = current_action.clone(); + let plan = legacy_action["plan"].as_object_mut().unwrap(); + let reference = plan.remove("actionPlan").unwrap(); + plan.insert("function".into(), reference); + plan.insert("type".into(), json!("function")); + let module = json!({ + "apiVersion": "id.registrystack.org/formats/breg/module/v1alpha1", + "kind": "BRegModule", + "id": "test-module", + "version": "1", + "actions": {"first": legacy_action, "second": current_action}, + }); + let error = parse_sealed_module_yaml(&serde_json::to_vec(&module).unwrap()) + .expect_err("historical and current Action plans cannot share a file"); + assert_eq!( + error.diagnostics()[0].code, + "breg.action-plan.mixed-spelling" + ); + assert_eq!( + error.diagnostics()[0].path, + "module.actions.second.plan.type" + ); +} + fn commit_evidence_source() -> Value { let mut value = source(); value["evidenceProviders"] = json!({"provider": {"contracts": "evidence/contracts.json", diff --git a/crates/registry-breg/src/package/tests/predecessor_sources.rs b/crates/registry-breg/src/package/tests/predecessor_sources.rs index a9c81f0516..910b6c94b6 100644 --- a/crates/registry-breg/src/package/tests/predecessor_sources.rs +++ b/crates/registry-breg/src/package/tests/predecessor_sources.rs @@ -143,7 +143,8 @@ fn list_form_sources_read_as_a_current_package_name_the_fresh_database_path() { let (manifest, loaded) = load_verified_closure(&root, &shared, false).expect("the historical closure verifies"); - let Err(refusal) = compile_package_sources(&manifest, &loaded) else { + let Err(refusal) = compile_package_sources(&manifest, &loaded, PackageSourceMode::Strict) + else { panic!("list-form access profiles are not read from a current package"); }; diff --git a/crates/registry-breg/src/proposal_prepare/tests.rs b/crates/registry-breg/src/proposal_prepare/tests.rs index 554f1d1888..caf57b2641 100644 --- a/crates/registry-breg/src/proposal_prepare/tests.rs +++ b/crates/registry-breg/src/proposal_prepare/tests.rs @@ -63,8 +63,8 @@ fn fixture_with(effects: Value, customize: impl FnOnce(&mut Value)) -> CompiledR fn function_source() -> Value { let mut value = source(json!([patch_effect()])); value["actions"]["change-target"]["inputs"][0]["required"] = json!(true); - value["functions"] = json!({"change-plan": {"runtime":"rhai","source":"plans/change.rhai","entrypoint":"plan","abi":"registry.action-plan/v1","capabilities":[]}}); - value["actions"]["change-target"]["plan"] = json!({"type":"function","function":"change-plan","inputs":["one","value"],"writes":[{"id":"patch-first","target":{"fromInput":"one"},"operation":"patch","fields":["first"]}]}); + value["actionPlans"] = json!({"change-plan": {"runtime":"rhai","source":"plans/change.rhai","entrypoint":"plan","abi":"registry.action-plan/v1","capabilities":[]}}); + value["actions"]["change-target"]["plan"] = json!({"type":"scripted","actionPlan":"change-plan","inputs":["one","value"],"writes":[{"id":"patch-first","target":{"fromInput":"one"},"operation":"patch","fields":["first"]}]}); value } const SCRIPT: &str = diff --git a/crates/registry-breg/src/tests/action_handler_benchmark_tests.rs b/crates/registry-breg/src/tests/action_handler_benchmark_tests.rs index 69254954a5..79b85cbfb0 100644 --- a/crates/registry-breg/src/tests/action_handler_benchmark_tests.rs +++ b/crates/registry-breg/src/tests/action_handler_benchmark_tests.rs @@ -43,12 +43,12 @@ fn acceptance_action() -> CompiledAction { "recordTypes":{"person": {"route":"people","primaryDataset":"records","mutationMode":"mutable","fields":[ {"id":"identifier","type":"string","required":true,"maximumLength":13,"classification":"internal"}, {"id":"display-name","type":"string","required":true,"minimumLength":1,"maximumLength":200,"classification":"internal"}]}}, - "functions":{"register-plan": {"runtime":"rhai","source":"scripts/register-person.rhai","entrypoint":"plan","abi":"registry.action-plan/v1"}}, + "actionPlans":{"register-plan": {"runtime":"rhai","source":"scripts/register-person.rhai","entrypoint":"plan","abi":"registry.action-plan/v1"}}, "actions":{"register-person": {"execution":{"mode":"immediate"},"inputs":[ {"id":"identifier","type":"string","required":true,"maximumLength":13,"classification":"internal"}, {"id":"given-name","type":"string","maximumLength":80,"classification":"internal"}, {"id":"family-name","type":"string","maximumLength":80,"classification":"internal"}], - "plan":{"type":"function","function":"register-plan","inputs":["identifier","given-name","family-name"], + "plan":{"type":"scripted","actionPlan":"register-plan","inputs":["identifier","given-name","family-name"], "refusals":[{"code":"blank-name","label":"At least one name part is required."}], "writes":[{"id":"person","target":{"recordType":"person"},"operation":"create","fields":["identifier","display-name"]}]}}}, "accessProfiles":{"writer": {"principalClaim":"principal","requiredScopes":"unrestricted","permissions":{"actions":[ @@ -95,13 +95,13 @@ fn characterization_action(script: &str) -> CompiledAction { {"id":"count","type":"int64","classification":"restricted"}, {"id":"amount","type":"decimal","precision":20,"scale":2,"classification":"restricted"} ]}}, - "functions":{"baseline-plan": {"runtime":"rhai","source":"handlers/baseline.rhai","entrypoint":"handle","abi":"registry.action-plan/v1"}}, + "actionPlans":{"baseline-plan": {"runtime":"rhai","source":"handlers/baseline.rhai","entrypoint":"handle","abi":"registry.action-plan/v1"}}, "actions":{"register-record": {"execution":{"mode":"immediate"},"inputs":[ {"id":"label","apiName":"displayLabel","type":"string","maximumLength":80,"required":true,"classification":"restricted"}, {"id":"count","type":"int64","required":true,"classification":"restricted"}, {"id":"amount","type":"decimal","precision":20,"scale":2,"required":true,"classification":"restricted"}, {"id":"note","type":"string","maximumLength":80,"classification":"restricted"} - ],"plan":{"type":"function","function":"baseline-plan","inputs":["label","count","amount","note"], + ],"plan":{"type":"scripted","actionPlan":"baseline-plan","inputs":["label","count","amount","note"], "refusals":[{"code":"blank-label","label":"A label is required."}], "writes":[{"id":"record","target":{"recordType":"record"},"operation":"create","fields":["label","count","amount"]}] }}}, diff --git a/crates/registry-breg/src/tests/action_outcome_wasm_parity_tests.rs b/crates/registry-breg/src/tests/action_outcome_wasm_parity_tests.rs index 0060e78f8f..e9fa4ba207 100644 --- a/crates/registry-breg/src/tests/action_outcome_wasm_parity_tests.rs +++ b/crates/registry-breg/src/tests/action_outcome_wasm_parity_tests.rs @@ -47,12 +47,12 @@ fn person_action(script: &str) -> CompiledAction { {"id":"name","type":"string","maximumLength":160,"required":true,"classification":"restricted"}, {"id":"friend","type":"reference","target":"person","classification":"restricted"} ]}}, - "functions":{"person-plan": {"runtime":"rhai","source":"handlers/register.rhai","entrypoint":"plan","abi":"registry.action-plan/v1","capabilities":[]}}, + "actionPlans":{"person-plan": {"runtime":"rhai","source":"handlers/register.rhai","entrypoint":"plan","abi":"registry.action-plan/v1","capabilities":[]}}, "actions":{"register-person": {"execution":{"mode":"immediate"},"inputs":[ {"id":"given-name","apiName":"givenName","type":"string","maximumLength":80,"required":true,"classification":"restricted"}, {"id":"family-name","type":"string","maximumLength":80,"classification":"restricted"}, {"id":"person","type":"reference","target":"person","required":true,"classification":"restricted"} - ],"plan":{"type":"function","function":"person-plan","inputs":["given-name","family-name","person"],"refusals":[{"code":"blank-name","label":"A name is required."}],"writes":[ + ],"plan":{"type":"scripted","actionPlan":"person-plan","inputs":["given-name","family-name","person"],"refusals":[{"code":"blank-name","label":"A name is required."}],"writes":[ {"id":"person","target":{"recordType":"person"},"operation":"create","fields":["name","friend"]}, {"id":"friend","target":{"recordType":"person"},"operation":"create","fields":["name","friend"]}, {"id":"existing","target":{"fromInput":"person"},"operation":"patch","fields":["name","friend"]} @@ -93,12 +93,12 @@ fn record_action(script: &str) -> CompiledAction { {"id":"count","type":"int64","classification":"restricted"}, {"id":"amount","type":"decimal","precision":20,"scale":2,"classification":"restricted"} ]}}, - "functions":{"record-plan": {"runtime":"rhai","source":"handlers/register.rhai","entrypoint":"plan","abi":"registry.action-plan/v1","capabilities":[]}}, + "actionPlans":{"record-plan": {"runtime":"rhai","source":"handlers/register.rhai","entrypoint":"plan","abi":"registry.action-plan/v1","capabilities":[]}}, "actions":{"register-record": {"execution":{"mode":"immediate"},"inputs":[ {"id":"label","apiName":"displayLabel","type":"string","maximumLength":80,"required":true,"classification":"restricted"}, {"id":"count","type":"int64","required":true,"classification":"restricted"}, {"id":"amount","type":"decimal","precision":20,"scale":2,"required":true,"classification":"restricted"} - ],"plan":{"type":"function","function":"record-plan","inputs":["label","count","amount"],"refusals":[{"code":"blank-label","label":"A label is required."}], + ],"plan":{"type":"scripted","actionPlan":"record-plan","inputs":["label","count","amount"],"refusals":[{"code":"blank-label","label":"A label is required."}], "writes":[{"id":"record","target":{"recordType":"record"},"operation":"create","fields":["label","count","amount"]}] }}}, "accessProfiles":{"writer": {"default":true,"principalClaim":"principal","requiredScopes":"unrestricted","permissions":{ diff --git a/crates/registry-breg/src/tests/wasm_runtime_tests.rs b/crates/registry-breg/src/tests/wasm_runtime_tests.rs index 792fdb73c2..4187d57dd6 100644 --- a/crates/registry-breg/src/tests/wasm_runtime_tests.rs +++ b/crates/registry-breg/src/tests/wasm_runtime_tests.rs @@ -145,12 +145,12 @@ fn wasm_person_action(module_bytes: &[u8]) -> CompiledAction { {"id":"name","type":"string","maximumLength":160,"required":true,"classification":"restricted"}, {"id":"friend","type":"reference","target":"person","classification":"restricted"} ]}}, - "functions":{"person-plan": {"runtime":"wasm","source":"handlers/guest.wasm","entrypoint":"handle","abi":"registry.action-plan/v1","capabilities":[]}}, + "actionPlans":{"person-plan": {"runtime":"wasm","source":"handlers/guest.wasm","entrypoint":"handle","abi":"registry.action-plan/v1","capabilities":[]}}, "actions":{"register-person": {"execution":{"mode":"immediate"},"inputs":[ {"id":"given-name","apiName":"givenName","type":"string","maximumLength":80,"required":true,"classification":"restricted"}, {"id":"family-name","type":"string","maximumLength":80,"classification":"restricted"}, {"id":"person","type":"reference","target":"person","required":true,"classification":"restricted"} - ],"plan":{"type":"function","function":"person-plan","inputs":["given-name","family-name","person"],"refusals":[{"code":"blank-name","label":"A name is required."}],"writes":[ + ],"plan":{"type":"scripted","actionPlan":"person-plan","inputs":["given-name","family-name","person"],"refusals":[{"code":"blank-name","label":"A name is required."}],"writes":[ {"id":"person","target":{"recordType":"person"},"operation":"create","fields":["name","friend"]} ]}}}, "accessProfiles":{"registrar": {"default":true,"principalClaim":"principal","requiredScopes":"unrestricted","permissions":{"actions":[{"action":"register-person","operations":["invoke"],"targets":[{"recordType":"person","rowBoundaries":"unrestricted"}],"results":["person"]}]}}} diff --git a/crates/registry-breg/tests/access_explanation.rs b/crates/registry-breg/tests/access_explanation.rs index 297fe26786..0ceb6bb9f8 100644 --- a/crates/registry-breg/tests/access_explanation.rs +++ b/crates/registry-breg/tests/access_explanation.rs @@ -91,12 +91,12 @@ fn mixed_action_target_source() -> Value { fn function_action_target_source() -> Value { let mut candidate = source(); - candidate["functions"] = json!({"create-entry-plan": {"runtime":"rhai", "source":"plans/create-entry.rhai", + candidate["actionPlans"] = json!({"create-entry-plan": {"runtime":"rhai", "source":"plans/create-entry.rhai", "entrypoint":"plan", "abi":"registry.action-plan/v1" }}); candidate["actions"] = json!({"create-entry": {"execution":{"mode":"immediate"}, "inputs":[{"id":"district", "type":"string", "maximumLength":32, "required":true, "classification":"internal"}], - "plan":{"type":"function", "function":"create-entry-plan", "inputs":["district"], "writes":[{ + "plan":{"type":"scripted", "actionPlan":"create-entry-plan", "inputs":["district"], "writes":[{ "id":"entry", "target":{"recordType":"entry"}, "operation":"create", "fields":["district"] }]} }}); diff --git a/crates/registry-breg/tests/action_evidence_compiler.rs b/crates/registry-breg/tests/action_evidence_compiler.rs index 97e7ffed1a..5de966b153 100644 --- a/crates/registry-breg/tests/action_evidence_compiler.rs +++ b/crates/registry-breg/tests/action_evidence_compiler.rs @@ -18,12 +18,12 @@ fn project() -> Value { {"id":"name","type":"string","maximumLength":160,"required":true,"classification":"restricted"}, {"id":"friend","type":"reference","target":"person","classification":"restricted"} ]}}, - "functions":{"register-plan": {"runtime":"rhai","source":"handlers/register.rhai","entrypoint":"plan","abi":"registry.action-plan/v1","capabilities":["evidence"]}}, + "actionPlans":{"register-plan": {"runtime":"rhai","source":"handlers/register.rhai","entrypoint":"plan","abi":"registry.action-plan/v1","capabilities":["evidence"]}}, "actions":{"register-person": {"execution":{"mode":"immediate"},"inputs":[ {"id":"given-name","apiName":"givenName","type":"string","maximumLength":80,"required":true,"classification":"restricted"}, {"id":"family-name","type":"string","maximumLength":80,"classification":"restricted"}, {"id":"person","type":"reference","target":"person","required":true,"classification":"restricted"} - ],"plan":{"type":"function","function":"register-plan","inputs":["given-name","family-name","person"],"refusals":[{"code":"blank-name","label":"A name is required."}],"writes":[ + ],"plan":{"type":"scripted","actionPlan":"register-plan","inputs":["given-name","family-name","person"],"refusals":[{"code":"blank-name","label":"A name is required."}],"writes":[ {"id":"person","target":{"recordType":"person"},"operation":"create","fields":["name","friend"]}, {"id":"friend","target":{"recordType":"person"},"operation":"create","fields":["name","friend"]}, {"id":"existing","target":{"fromInput":"person"},"operation":"patch","fields":["name","friend"]} @@ -151,7 +151,7 @@ fn proposal_apply_declares_commit_evidence_failure_but_submit_does_not() { "requires":[{"output":"status-holds","equals":true}],"maximumObservationAgeSeconds":60 }] }); - source["functions"]["register-plan"]["capabilities"] = json!([]); + source["actionPlans"]["register-plan"]["capabilities"] = json!([]); let permissions = &mut source["accessProfiles"]["registrar"]["permissions"]; permissions["actions"][0]["operations"] = json!(["start"]); permissions["actions"][0] @@ -219,7 +219,9 @@ fn refuses_origin_profile_output_ambiguity_and_budget_widening() { let cap = source["actions"]["register-person"]["evidence"][0].clone(); source["actions"]["register-person"]["evidence"] = json!([cap, cap, cap]); } - "abi" => source["functions"]["register-plan"]["abi"] = json!("registry.action-plan/v2"), + "abi" => { + source["actionPlans"]["register-plan"]["abi"] = json!("registry.action-plan/v2") + } "schema" => contract["schema"] = json!("unknown"), "bounds" => { contract["definitions"][0]["subjects"][0]["selector"]["fields"][0]["minimumBytes"] = @@ -252,20 +254,20 @@ fn the_evidence_declaration_selects_the_capability_under_the_one_handler_abi() { .is_empty()); let mut refused = configured(); - refused["functions"]["register-plan"]["capabilities"] = json!([]); + refused["actionPlans"]["register-plan"]["capabilities"] = json!([]); let failure = compile(refused, Some(contracts())) .expect_err("the Function capability list is a ceiling on its Evidence Action"); let diagnostic = failure .diagnostics() .iter() - .find(|diagnostic| diagnostic.code == "breg.action.function-contract-invalid") + .find(|diagnostic| diagnostic.code == "breg.action.plan-contract-invalid") .unwrap_or_else(|| { panic!( "expected the Function ceiling refusal: {:?}", failure.diagnostics() ) }); - assert_eq!(diagnostic.path, "actions[register-person].plan.function"); + assert_eq!(diagnostic.path, "actions[register-person].plan.actionPlan"); } #[test] @@ -294,20 +296,20 @@ fn plan_capabilities_are_not_an_authored_grant() { assert!(diagnostic.suggested_action.contains("Action's Evidence")); assert!(diagnostic .suggested_action - .contains("Function's `capabilities`")); + .contains("Action Plan's `capabilities`")); } } #[test] fn function_capabilities_are_a_closed_value_free_vocabulary() { let mut source = project(); - source["functions"]["register-plan"]["capabilities"] = json!(["private-capability-canary"]); + source["actionPlans"]["register-plan"]["capabilities"] = json!(["private-capability-canary"]); let report = read_project_yaml("registry.json", &serde_json::to_vec(&source).unwrap()) .expect_err("a Function capability outside the closed vocabulary is refused"); let diagnostic = report .diagnostics() .iter() - .find(|diagnostic| diagnostic.path == "/functions/register-plan/capabilities/0") + .find(|diagnostic| diagnostic.path == "/actionPlans/register-plan/capabilities/0") .unwrap_or_else(|| panic!("expected the Function capability refusal: {report:?}")); assert_eq!(diagnostic.code, "config.unknown-variant"); assert!(diagnostic.message.contains("evidence")); @@ -320,14 +322,14 @@ fn function_capabilities_are_a_closed_value_free_vocabulary() { fn the_retired_evidence_abi_is_refused_where_it_is_declared() { for (source, contract) in [(configured(), Some(contracts())), (project(), None)] { let mut source = source; - source["functions"]["register-plan"]["abi"] = json!("registry.action-plan/v2"); + source["actionPlans"]["register-plan"]["abi"] = json!("registry.action-plan/v2"); let failure = compile(source, contract).expect_err("one handler ABI is accepted"); let diagnostic = failure .diagnostics() .iter() .find(|diagnostic| diagnostic.code == "breg.action.handler-abi-invalid") .unwrap_or_else(|| panic!("expected the ABI refusal: {:?}", failure.diagnostics())); - assert_eq!(diagnostic.path, "functions[id=register-plan].abi"); + assert_eq!(diagnostic.path, "actionPlans[id=register-plan].abi"); assert!(diagnostic.message.contains("registry.action-plan/v1")); assert!(!diagnostic.message.contains("v2")); } @@ -478,7 +480,7 @@ fn evidence_calls_require_a_declared_capability_in_statements_expressions_and_ne .remove("evidence"); } assert_eq!( - source["functions"]["register-plan"]["abi"], + source["actionPlans"]["register-plan"]["abi"], "registry.action-plan/v1" ); let source = parse_project_json(&serde_json::to_vec(&source).unwrap()).unwrap(); @@ -509,7 +511,7 @@ fn evidence_calls_require_a_declared_capability_in_statements_expressions_and_ne .iter() .find(|diagnostic| diagnostic.code == "breg.action.handler-helper-contract") .unwrap_or_else(|| panic!("{body}: {:?}", failure.diagnostics())); - assert_eq!(diagnostic.path, "functions[id=register-plan].source"); + assert_eq!(diagnostic.path, "actionPlans[id=register-plan].source"); assert!(!diagnostic.message.contains("v2"), "{body}"); } } @@ -540,14 +542,14 @@ fn published_authoring_schema_accepts_evidence_action_and_rejects_every_other_ab "the schema removes the redundant Action plan capability" ); let mut with_unknown_capability = source.clone(); - with_unknown_capability["functions"]["register-plan"]["capabilities"] = + with_unknown_capability["actionPlans"]["register-plan"]["capabilities"] = json!(["private-capability"]); assert!( !validator.is_valid(&with_unknown_capability), "the schema closes Function capabilities to evidence" ); for other in ["registry.action-plan/v2", "registry.action-plan/v3"] { - source["functions"]["register-plan"]["abi"] = json!(other); + source["actionPlans"]["register-plan"]["abi"] = json!(other); assert!(!validator.is_valid(&source), "{other}"); } } diff --git a/crates/registry-breg/tests/action_handler_declaration.rs b/crates/registry-breg/tests/action_handler_declaration.rs index 8aba14a877..df2fbe4dd0 100644 --- a/crates/registry-breg/tests/action_handler_declaration.rs +++ b/crates/registry-breg/tests/action_handler_declaration.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -//! Named input-bound plan functions have one closed authored contract. +//! Named input-bound Action Plans have one closed authored contract. use registry_breg::compiler::{compile_project_with_assets, CompileProfile}; use registry_breg::contract::{parse_project_json, ModuleAssetSource, ACTION_PLAN_ABI_V1}; @@ -12,11 +12,11 @@ fn project() -> Value { "datasets":{"test": {}}, "recordTypes":{"person": {"primaryDataset":"test","route":"people","mutationMode":"mutable", "fields":[{"id":"code","type":"string","maximumLength":64,"required":true,"classification":"internal"}]}}, - "functions":{"person-plan": {"runtime":"rhai","source":"plans/person.rhai","entrypoint":"calculate","abi":ACTION_PLAN_ABI_V1}}, + "actionPlans":{"person-plan": {"runtime":"rhai","source":"plans/person.rhai","entrypoint":"calculate","abi":ACTION_PLAN_ABI_V1}}, "actions":{"register-person": {"execution":{"mode":"immediate"}, "inputs":[{"id":"code","type":"string","maximumLength":64,"required":true,"classification":"internal"}, {"id":"unbound","type":"string","maximumLength":64,"classification":"restricted"}], - "plan":{"type":"function","function":"person-plan","inputs":["code"], + "plan":{"type":"scripted","actionPlan":"person-plan","inputs":["code"], "writes":[{"id":"person","target":{"recordType":"person"},"operation":"create","fields":["code"]}]}}}, "accessProfiles":{"registrar": {"default":true,"principalClaim":"registry_principal","requiredScopes":"unrestricted", "permissions":{"actions":[{"action":"register-person","operations":["invoke"],"targets":[{"recordType":"person","rowBoundaries":"unrestricted"}],"results":["person"]}]}}} @@ -84,7 +84,7 @@ fn native_functions_round_trip_without_backend_aliases() { #[test] fn named_function_members_are_closed() { let mut value = project(); - value["functions"]["person-plan"]["script"] = json!("plans/person.rhai"); + value["actionPlans"]["person-plan"]["script"] = json!("plans/person.rhai"); let failure = parse_project_json(&serde_json::to_vec(&value).unwrap()).unwrap_err(); assert!(failure .diagnostics() @@ -96,7 +96,7 @@ fn named_function_members_are_closed() { fn abi_and_source_are_required_on_the_named_function() { for member in ["abi", "source", "entrypoint"] { let mut value = project(); - value["functions"]["person-plan"] + value["actionPlans"]["person-plan"] .as_object_mut() .unwrap() .remove(member); @@ -114,31 +114,31 @@ fn retired_inline_handler_and_remote_runtime_are_refused() { json!({"type":"rhai","script":"plans/person.rhai"}); assert!(parse_project_json(&serde_json::to_vec(&value).unwrap()).is_err()); let mut value = project(); - value["functions"]["person-plan"]["runtime"] = json!("url"); + value["actionPlans"]["person-plan"]["runtime"] = json!("url"); assert!(parse_project_json(&serde_json::to_vec(&value).unwrap()).is_err()); } #[test] fn source_path_and_abi_fail_at_the_named_function() { let mut value = project(); - value["functions"]["person-plan"]["source"] = json!("plans/person.wasm"); + value["actionPlans"]["person-plan"]["source"] = json!("plans/person.wasm"); let failure = compile(value).unwrap_err(); assert!(failure .diagnostics() .iter() - .any(|d| d.path == "functions[id=person-plan].source")); + .any(|d| d.path == "actionPlans[id=person-plan].source")); let mut value = project(); - value["functions"]["person-plan"]["abi"] = json!("registry.action-handler/v1"); + value["actionPlans"]["person-plan"]["abi"] = json!("registry.action-handler/v1"); assert!(compile(value).is_err()); } #[test] fn missing_named_function_is_a_compile_time_refusal() { let mut value = project(); - value["actions"]["register-person"]["plan"]["function"] = json!("absent"); + value["actions"]["register-person"]["plan"]["actionPlan"] = json!("absent"); assert!(compile(value) .unwrap_err() .diagnostics() .iter() - .any(|d| d.code == "breg.action.function-unknown")); + .any(|d| d.code == "breg.action.plan-unknown")); } diff --git a/crates/registry-breg/tests/actions_functions_map.rs b/crates/registry-breg/tests/actions_functions_map.rs index d564d23676..b71dc1d09f 100644 --- a/crates/registry-breg/tests/actions_functions_map.rs +++ b/crates/registry-breg/tests/actions_functions_map.rs @@ -1,11 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -//! `actions` and `functions` are mappings keyed by id (CFG-ID-5), in a project +//! `actions` and `actionPlans` are mappings keyed by id (CFG-ID-5), in a project //! and in a module. The key is the id, an inner id and the old list shape are //! refused with the mapping named, a repeated key is refused at the repeating //! key, and entries are held in id order whatever order the file writes them in. -use registry_breg::contract::{parse_module_yaml, parse_project_yaml}; +use registry_breg::compiler::module_digest_with_assets; +use registry_breg::contract::{parse_module_yaml, parse_project_yaml, ModuleAssetSource}; +use serde_json::json; const PROJECT_HEAD: &str = "apiVersion: id.registrystack.org/formats/breg/project/v1alpha1 kind: BRegProject @@ -24,7 +26,7 @@ id: extension version: 0.1.0 "; -fn function(key: &str) -> String { +fn action_plan(key: &str) -> String { format!( " {key}:\n runtime: rhai\n source: plans/{key}.rhai\n entrypoint: plan\n abi: registry.action-plan/v1\n" ) @@ -32,7 +34,7 @@ fn function(key: &str) -> String { fn action(key: &str) -> String { format!( - " {key}:\n execution: {{mode: immediate}}\n inputs: []\n plan:\n type: function\n function: plan\n inputs: []\n writes: []\n" + " {key}:\n execution: {{mode: immediate}}\n inputs: []\n plan:\n type: scripted\n actionPlan: go\n inputs: []\n writes: []\n" ) } @@ -53,11 +55,92 @@ fn refusals(failure: ®istry_breg::CompileFailure) -> Vec<(&str, &str)> { } #[test] -fn mappings_of_actions_and_functions_read_each_key_as_the_id_in_id_order() { +fn scripted_action_plan_round_trips_with_the_published_keys() { let written = project(&format!( - "functions:\n{}{}actions:\n{}{}", - function("zeta"), - function("alpha"), + "actionPlans:\n{}actions:\n{}", + action_plan("go"), + action("go"), + )); + let parsed = parse_project_yaml(written.as_bytes()).expect("the scripted Action Plan reads"); + let serialized = serde_json::to_value(parsed).expect("the project serializes"); + assert!(serialized.get("functions").is_none()); + assert!(serialized["actionPlans"]["go"].is_object()); + let plan = &serialized["actions"]["go"]["plan"]; + assert_eq!(plan["type"], "scripted"); + assert_eq!(plan["actionPlan"], "go"); + assert!(plan.get("function").is_none()); +} + +#[test] +fn retired_action_plan_spellings_name_their_replacements() { + let written = project(&format!("functions:\n{}", action_plan("go"))); + let error = parse_project_yaml(written.as_bytes()).expect_err("functions is retired"); + assert_eq!( + refusals(&error), + [("config.removed-key", "project.functions")] + ); + assert!(error.diagnostics()[0].message.contains("actionPlans")); + + let written = module(&format!( + "actions:\n{}", + action("go").replace("actionPlan: go", "function: go") + )); + let error = parse_module_yaml(written.as_bytes()).expect_err("plan.function is retired"); + assert_eq!( + refusals(&error), + [("config.removed-key", "module.actions.go.plan.function")] + ); + assert!(error.diagnostics()[0].message.contains("actionPlan")); + + let written = module(&format!( + "actions:\n{}", + action("go").replace("type: scripted", "type: function") + )); + let error = parse_module_yaml(written.as_bytes()).expect_err("type: function is retired"); + assert_eq!( + refusals(&error), + [("config.removed-key", "module.actions.go.plan.type")] + ); + assert!(error.diagnostics()[0].message.contains("scripted")); +} + +#[test] +fn a_scripted_action_keeps_the_historical_module_digest() { + let project = registry_platform_yaml::Reader::new("registry.yaml") + .scan(include_bytes!( + "../../../products/coordinator/examples/applications-registry/registry.yaml" + )) + .unwrap() + .unwrap() + .to_json_value(); + let source = json!({ + "apiVersion": "id.registrystack.org/formats/breg/module/v1alpha1", + "kind": "BRegModule", + "id": "extension", + "version": "0.1.0", + "actionPlans": project["actionPlans"], + "actions": project["actions"], + }); + let module = parse_module_yaml(&serde_json::to_vec(&source).unwrap()).unwrap(); + let asset = ModuleAssetSource { + module: Some("extension".into()), + path: "scripts/request-information.rhai".into(), + bytes: include_bytes!("../../../products/coordinator/examples/applications-registry/scripts/request-information.rhai").to_vec(), + }; + // Recorded by the released v0.49 `bregctl project lock` on the same + // module and asset with the historical authored spellings. + assert_eq!( + module_digest_with_assets(&module, &[asset]), + "sha256:75aa99f59952a8d9e964a0aaeef37adfc07cea9c69640152eed6bbe870e4281b" + ); +} + +#[test] +fn mappings_of_actions_and_action_plans_read_each_key_as_the_id_in_id_order() { + let written = project(&format!( + "actionPlans:\n{}{}actions:\n{}{}", + action_plan("zeta"), + action_plan("alpha"), action("zeta"), action("alpha"), )); @@ -76,9 +159,9 @@ fn mappings_of_actions_and_functions_read_each_key_as_the_id_in_id_order() { assert_eq!(actions, ["alpha", "zeta"]); let written = module(&format!( - "functions:\n{}{}actions:\n{}{}", - function("zeta"), - function("alpha"), + "actionPlans:\n{}{}actions:\n{}{}", + action_plan("zeta"), + action_plan("alpha"), action("zeta"), action("alpha"), )); @@ -98,7 +181,7 @@ fn mappings_of_actions_and_functions_read_each_key_as_the_id_in_id_order() { } #[test] -fn a_repeated_action_or_function_key_is_refused_at_the_repeating_key() { +fn a_repeated_action_or_action_plan_key_is_refused_at_the_repeating_key() { let written = project(&format!("actions:\n{}{}", action("go"), action("go"))); let failure = parse_project_yaml(written.as_bytes()).expect_err("a repeated key is refused"); assert_eq!( @@ -106,11 +189,15 @@ fn a_repeated_action_or_function_key_is_refused_at_the_repeating_key() { vec![("yaml.duplicate-key", "project.actions.go")], "{failure:?}" ); - let written = project(&format!("functions:\n{}{}", function("go"), function("go"))); + let written = project(&format!( + "actionPlans:\n{}{}", + action_plan("go"), + action_plan("go") + )); let failure = parse_project_yaml(written.as_bytes()).expect_err("a repeated key is refused"); assert_eq!( refusals(&failure), - vec![("yaml.duplicate-key", "project.functions.go")], + vec![("yaml.duplicate-key", "project.actionPlans.go")], "{failure:?}" ); let written = module(&format!("actions:\n{}{}", action("go"), action("go"))); @@ -120,11 +207,15 @@ fn a_repeated_action_or_function_key_is_refused_at_the_repeating_key() { vec![("yaml.duplicate-key", "module.actions.go")], "{failure:?}" ); - let written = module(&format!("functions:\n{}{}", function("go"), function("go"))); + let written = module(&format!( + "actionPlans:\n{}{}", + action_plan("go"), + action_plan("go") + )); let failure = parse_module_yaml(written.as_bytes()).expect_err("a repeated key is refused"); assert_eq!( refusals(&failure), - vec![("yaml.duplicate-key", "module.functions.go")], + vec![("yaml.duplicate-key", "module.actionPlans.go")], "{failure:?}" ); } @@ -138,9 +229,9 @@ fn the_list_shapes_are_refused_with_the_mapping_named() { "actions: {ACTION_ID: {", ), ( - "functions", - "functions:\n - id: go\n runtime: rhai\n", - "functions: {FUNCTION_ID: {", + "actionPlans", + "actionPlans:\n - id: go\n runtime: rhai\n", + "actionPlans: {PLAN_ID: {", ), ] { for (scope, failure) in [ @@ -170,8 +261,11 @@ fn the_list_shapes_are_refused_with_the_mapping_named() { } #[test] -fn an_inner_id_in_an_action_or_function_is_refused() { - for (collection, entry) in [("actions", action("go")), ("functions", function("go"))] { +fn an_inner_id_in_an_action_or_action_plan_is_refused() { + for (collection, entry) in [ + ("actions", action("go")), + ("actionPlans", action_plan("go")), + ] { let entry = entry.replacen(":\n", ":\n id: go\n", 1); let written = project(&format!("{collection}:\n{entry}")); let failure = parse_project_yaml(written.as_bytes()).expect_err("an inner id is refused"); diff --git a/crates/registry-breg/tests/immediate_action_compiler.rs b/crates/registry-breg/tests/immediate_action_compiler.rs index 4bd281d5a1..83b2a00891 100644 --- a/crates/registry-breg/tests/immediate_action_compiler.rs +++ b/crates/registry-breg/tests/immediate_action_compiler.rs @@ -99,8 +99,8 @@ fn handler_response_schema_accepts_omitted_slots_across_overlapping_grant_result }) }) .collect::>(); - source["functions"] = json!({"contact-plan": {"runtime":"rhai","source":"scripts/handler.rhai","entrypoint":"handle","abi":"registry.action-plan/v1"}}); - source["actions"]["register-household-contact"]["plan"] = json!({"type":"function","function":"contact-plan","inputs":["household","person-code","legal-name"],"writes":writes}); + source["actionPlans"] = json!({"contact-plan": {"runtime":"rhai","source":"scripts/handler.rhai","entrypoint":"handle","abi":"registry.action-plan/v1"}}); + source["actions"]["register-household-contact"]["plan"] = json!({"type":"scripted","actionPlan":"contact-plan","inputs":["household","person-code","legal-name"],"writes":writes}); let mut limited = source["accessProfiles"]["contact-registrar"].clone(); limited["default"] = json!(false); @@ -179,9 +179,9 @@ fn the_retired_v2_abi_is_refused_and_wasm_needs_a_wasm_capable_build() { bytes: br#"fn handle(ctx) { #{effects:[]} }"#.to_vec(), }] }; - source["functions"] = + source["actionPlans"] = json!({"contact-plan": {"runtime":kind,"source":path,"entrypoint":"handle","abi":abi}}); - source["actions"]["register-household-contact"]["plan"] = json!({"type":"function","function":"contact-plan","inputs":["household","person-code","legal-name"],"writes":writes}); + source["actions"]["register-household-contact"]["plan"] = json!({"type":"scripted","actionPlan":"contact-plan","inputs":["household","person-code","legal-name"],"writes":writes}); let project = parse_project_json(&serde_json::to_vec(&source).unwrap()).unwrap(); compile_project_with_assets(&project, &[], &assets, CompileProfile::Authoring) }; @@ -201,7 +201,7 @@ fn the_retired_v2_abi_is_refused_and_wasm_needs_a_wasm_capable_build() { .into_iter() .find(|diagnostic| diagnostic.code == "breg.action.handler-wasm-build-unsupported") .expect("input-only WASM handlers name the missing build capability"); - assert_eq!(not_admitted.path, "functions[id=contact-plan].runtime"); + assert_eq!(not_admitted.path, "actionPlans[id=contact-plan].runtime"); } #[cfg(feature = "wasm")] { @@ -212,7 +212,7 @@ fn the_retired_v2_abi_is_refused_and_wasm_needs_a_wasm_capable_build() { .into_iter() .find(|diagnostic| diagnostic.code == "breg.action.handler-module-asset-missing") .expect("an admitted WASM backend looks the declared module up"); - assert_eq!(missing_asset.path, "functions[id=contact-plan].source"); + assert_eq!(missing_asset.path, "actionPlans[id=contact-plan].source"); } // One handler ABI is accepted. The identifier that used to select the @@ -227,7 +227,7 @@ fn the_retired_v2_abi_is_refused_and_wasm_needs_a_wasm_capable_build() { .iter() .find(|diagnostic| diagnostic.code == "breg.action.handler-abi-invalid") .unwrap_or_else(|| panic!("{kind}: expected the ABI refusal, got {refused:?}")); - assert_eq!(unsupported_abi.path, "functions[id=contact-plan].abi"); + assert_eq!(unsupported_abi.path, "actionPlans[id=contact-plan].abi"); assert!(unsupported_abi.message.contains(ACTION_PLAN_ABI_V1)); assert!(refused .iter() @@ -1066,8 +1066,8 @@ fn current_revision_refuses_a_function_plan_that_writes_an_existing_record() { }) }) .collect::>(); - source["functions"] = json!({"contact-plan": {"runtime":"rhai","source":"scripts/handler.rhai","entrypoint":"handle","abi":"registry.action-plan/v1"}}); - source["actions"]["register-household-contact"]["plan"] = json!({"type":"function","function":"contact-plan","inputs":["household","person-code","legal-name"],"writes":writes}); + source["actionPlans"] = json!({"contact-plan": {"runtime":"rhai","source":"scripts/handler.rhai","entrypoint":"handle","abi":"registry.action-plan/v1"}}); + source["actions"]["register-household-contact"]["plan"] = json!({"type":"scripted","actionPlan":"contact-plan","inputs":["household","person-code","legal-name"],"writes":writes}); source["actions"]["register-household-contact"]["execution"] = json!({"mode":"immediate","concurrency":"current-revision"}); let project = parse_project_json(&serde_json::to_vec(&source).unwrap()).unwrap(); diff --git a/crates/registry-breg/tests/immediate_action_handler.rs b/crates/registry-breg/tests/immediate_action_handler.rs index d9c0bcdd10..fc4ab532ab 100644 --- a/crates/registry-breg/tests/immediate_action_handler.rs +++ b/crates/registry-breg/tests/immediate_action_handler.rs @@ -14,7 +14,7 @@ use std::time::{Duration, Instant}; use time::macros::date; fn project() -> Value { - json!({"datasets":{"test-dataset": {}},"functions":{"register-person-plan": {"runtime":"rhai","source":"handlers/register.rhai","entrypoint":"handle","abi":"registry.action-plan/v1"}}, + json!({"datasets":{"test-dataset": {}},"actionPlans":{"register-person-plan": {"runtime":"rhai","source":"handlers/register.rhai","entrypoint":"handle","abi":"registry.action-plan/v1"}}, "apiVersion":"id.registrystack.org/formats/breg/project/v1alpha1", "kind":"BRegProject", "project":{"id":"action-handler-test","version":"1","defaultLanguage":"en","canonicalBaseIri":"https://example.test"}, "recordTypes":{"person": {"primaryDataset":"test-dataset","route":"people","mutationMode":"mutable","fields":[ @@ -25,7 +25,7 @@ fn project() -> Value { {"id":"given-name","apiName":"givenName","type":"string","maximumLength":80,"required":true,"classification":"restricted"}, {"id":"family-name","type":"string","maximumLength":80,"classification":"restricted"}, {"id":"person","type":"reference","target":"person","required":true,"classification":"restricted"} - ],"plan":{"type":"function","function":"register-person-plan","inputs":["given-name", "family-name", "person"],"writes":[ + ],"plan":{"type":"scripted","actionPlan":"register-person-plan","inputs":["given-name", "family-name", "person"],"writes":[ {"id":"person","target":{"recordType":"person"},"operation":"create","fields":["name","friend"]}, {"id":"friend","target":{"recordType":"person"},"operation":"create","fields":["name","friend"]}, {"id":"existing","target":{"fromInput":"person"},"operation":"patch","fields":["name","friend"]} @@ -722,7 +722,7 @@ fn calls_by_name_to_functions_the_plan_engine_leaves_out_are_refused_at_compile( let diagnostic = failure .diagnostics() .iter() - .find(|diagnostic| diagnostic.code == "breg.action.plan-function-unavailable") + .find(|diagnostic| diagnostic.code == "breg.action.plan-unavailable") .unwrap_or_else(|| panic!("{script}: {failure:?}")); assert!( diagnostic.message.contains(&format!("`{function}`")), @@ -730,7 +730,7 @@ fn calls_by_name_to_functions_the_plan_engine_leaves_out_are_refused_at_compile( ); assert!(diagnostic.message.contains("line"), "{script}"); assert_eq!( - diagnostic.path, "functions[id=register-person-plan].source", + diagnostic.path, "actionPlans[id=register-person-plan].source", "{script}" ); } @@ -806,7 +806,7 @@ fn handler_compiler_rejects_inputs_outside_the_scalar_abi() { // The same declared input is valid for an action with fixed effects. let mut fixed = project(); fixed["actions"]["register-person"]["plan"] = json!({"type":"fixed","effects":[]}); - fixed.as_object_mut().unwrap().remove("functions"); + fixed.as_object_mut().unwrap().remove("actionPlans"); fixed["actions"]["register-person"]["inputs"] = json!([ input, {"id":"name","type":"string","maximumLength":160,"required":true,"classification":"restricted"} @@ -1010,11 +1010,11 @@ fn handler_rejects_ambiguous_sources_and_binds_governed_semantics() { let action = compile(project(), &valid).unwrap(); for (pointer, value) in [ ( - "/functions/register-person-plan/abi", + "/actionPlans/register-person-plan/abi", json!("registry.action-handler/v2"), ), ( - "/functions/register-person-plan/source", + "/actionPlans/register-person-plan/source", json!("../outside.rhai"), ), ("/actions/register-person/plan/writes/0/id", json!("friend")), @@ -1276,9 +1276,9 @@ fn handler_source_diagnostics_distinguish_assets_parse_positions_and_entrypoints assert_eq!( diagnostics[0].path, if code == "breg.action.handler-entrypoint" { - "functions[id=register-person-plan].entrypoint" + "actionPlans[id=register-person-plan].entrypoint" } else { - "functions[id=register-person-plan].source" + "actionPlans[id=register-person-plan].source" } ); assert!(!diagnostics[0].message.contains("private_source_canary")); @@ -1397,9 +1397,9 @@ fn handler_package_captures_exact_project_and_module_script_origins() { let action = source["actions"].take(); source.as_object_mut().unwrap().remove("actions"); - let functions = source["functions"].take(); - source.as_object_mut().unwrap().remove("functions"); - let module_value = json!({"apiVersion":"id.registrystack.org/formats/breg/module/v1alpha1","kind":"BRegModule", "id":"actions","version":"1","actions":action,"functions":functions}); + let functions = source["actionPlans"].take(); + source.as_object_mut().unwrap().remove("actionPlans"); + let module_value = json!({"apiVersion":"id.registrystack.org/formats/breg/module/v1alpha1","kind":"BRegModule", "id":"actions","version":"1","actions":action,"actionPlans":functions}); let module = registry_breg::contract::parse_module_json(&serde_json::to_vec(&module_value).unwrap()) .unwrap(); @@ -1429,7 +1429,7 @@ fn handler_package_captures_exact_project_and_module_script_origins() { fn fixed_action_fingerprints_omit_handler_and_bind_native_patterns() { let mut source = project(); source["actions"]["register-person"]["plan"] = json!({"type":"fixed","effects":[]}); - source.as_object_mut().unwrap().remove("functions"); + source.as_object_mut().unwrap().remove("actionPlans"); source["actions"]["register-person"]["inputs"][0]["maximumLength"] = json!(160); source["actions"]["register-person"]["plan"]["effects"] = json!([{"id":"person","target":{"recordType":"person"},"operation":"create","set":{"name":{"fromInput":"given-name"}}}]); source["accessProfiles"]["registrar"]["permissions"]["actions"][0]["results"] = diff --git a/crates/registry-breg/tests/native_inspection_inventory.rs b/crates/registry-breg/tests/native_inspection_inventory.rs index 616ae5ed54..9d1f18f02a 100644 --- a/crates/registry-breg/tests/native_inspection_inventory.rs +++ b/crates/registry-breg/tests/native_inspection_inventory.rs @@ -330,21 +330,21 @@ fn function_ceilings_fixed_clears_and_literal_null_remain_distinct() { let registry = compile(&source); let model = inspect_registry(®istry); let function = definition(&model["actions"], "correct-address"); - assert_eq!(function["plan"]["type"], "function"); + assert_eq!(function["plan"]["type"], "scripted"); assert!(function["plan"].get("effects").is_none()); assert!(function["plan"].get("order").is_none()); assert_eq!( - function["plan"]["function"]["source"], + function["plan"]["actionPlan"]["source"], "plans/correct-address.rhai" ); - assert!(function["plan"]["function"]["sourceModule"].is_null()); + assert!(function["plan"]["actionPlan"]["sourceModule"].is_null()); assert_eq!( - function["plan"]["function"]["writes"][0]["fields"], + function["plan"]["actionPlan"]["writes"][0]["fields"], json!(["address-line", "city", "postal-code"]) ); let fixed = definition(&model["actions"], "deactivate-facility"); assert_eq!(fixed["plan"]["type"], "fixed"); - assert!(fixed["plan"].get("function").is_none()); + assert!(fixed["plan"].get("actionPlan").is_none()); assert_eq!( fixed["plan"]["effects"][0]["mutations"][0], json!({"kind":"clear", "field":"city"}) @@ -409,7 +409,7 @@ fn function_ceilings_fixed_clears_and_literal_null_remain_distinct() { fn function_capability_vocabulary_keeps_action_explanations_schema_valid() { let mut source = source(); let canary = "private-capability-canary"; - source["functions"]["correct-address-plan"]["capabilities"] = json!([canary]); + source["actionPlans"]["correct-address-plan"]["capabilities"] = json!([canary]); action_mut(&mut source, "correct-address")["plan"]["capabilities"] = json!([canary]); let bytes = serde_json::to_vec(&source).unwrap(); match read_project_yaml("registry.json", &bytes) { @@ -445,12 +445,12 @@ fn function_inspection_retains_relative_asset_and_module_identity() { let module = parse_module_json( &serde_json::to_vec(&json!({ "apiVersion":"id.registrystack.org/formats/breg/module/v1alpha1", "kind":"BRegModule", - "id":"address-functions", "version":"1", "functions":source["functions"] + "id":"address-functions", "version":"1", "actionPlans":source["actionPlans"] })) .unwrap(), ) .unwrap(); - source["functions"] = json!({}); + source["actionPlans"] = json!({}); let assets = [ModuleAssetSource { module: Some("address-functions".into()), path: "plans/correct-address.rhai".into(), @@ -470,7 +470,7 @@ fn function_inspection_retains_relative_asset_and_module_identity() { .iter() .find(|action| action.id == "correct-address") .unwrap(); - let function = &inspect_action(action)["plan"]["function"]; + let function = &inspect_action(action)["plan"]["actionPlan"]; assert_eq!(function["source"], "plans/correct-address.rhai"); assert_eq!(function["sourceModule"], "address-functions"); } diff --git a/crates/registry-breg/tests/native_plan_security.rs b/crates/registry-breg/tests/native_plan_security.rs index 06aff724ff..fac5d30fa6 100644 --- a/crates/registry-breg/tests/native_plan_security.rs +++ b/crates/registry-breg/tests/native_plan_security.rs @@ -13,11 +13,11 @@ fn source() -> Value { "datasets":{"test": {}}, "recordTypes":{"item": {"primaryDataset":"test","route":"items","mutationMode":"mutable", "fields":[{"id":"label","type":"string","maximumLength":64,"required":true,"classification":"internal"}]}}, - "functions":{"calculate": {"runtime":"rhai","source":"plans/calculate.rhai","entrypoint":"calculate","abi":"registry.action-plan/v1"}}, + "actionPlans":{"calculate": {"runtime":"rhai","source":"plans/calculate.rhai","entrypoint":"calculate","abi":"registry.action-plan/v1"}}, "actions":{"register-item": {"execution":{"mode":"immediate"}, "inputs":[{"id":"label","type":"string","maximumLength":64,"required":true,"classification":"internal"}, {"id":"unbound","type":"string","maximumLength":64,"classification":"restricted"}], - "plan":{"type":"function","function":"calculate","inputs":["label"], + "plan":{"type":"scripted","actionPlan":"calculate","inputs":["label"], "writes":[{"id":"item","target":{"recordType":"item"},"operation":"create","fields":["label"]}]}}}, "accessProfiles":{"registrar": {"default":true,"principalClaim":"registry_principal","requiredScopes":"unrestricted", "permissions":{"actions":[{"action":"register-item","operations":["invoke"],"targets":[{"recordType":"item","rowBoundaries":"unrestricted"}],"results":["item"]}]}}}}) @@ -92,7 +92,7 @@ fn assert_refused_at_compile(call: &str) { failure .diagnostics() .iter() - .any(|diagnostic| diagnostic.code == "breg.action.plan-function-unavailable"), + .any(|diagnostic| diagnostic.code == "breg.action.plan-unavailable"), "{call}: {failure:?}" ); } diff --git a/crates/registry-breg/tests/native_source_conventions.rs b/crates/registry-breg/tests/native_source_conventions.rs index d31ab89266..8057fd8d4d 100644 --- a/crates/registry-breg/tests/native_source_conventions.rs +++ b/crates/registry-breg/tests/native_source_conventions.rs @@ -271,7 +271,7 @@ fn locally_defined_ids_and_type_keys_are_refused_at_their_source() { "/actions/correct-address/execution/proposal/reviewContext/id", "config.invalid-value", ); - for collection in ["functions", "actions", "datasets", "reviewAuthorities"] { + for collection in ["actionPlans", "actions", "datasets", "reviewAuthorities"] { let mut source = facility(); let entries = source[collection].as_object_mut().unwrap(); let (_, entry) = entries @@ -1036,7 +1036,7 @@ fn compiler_refuses_lookalike_ids_across_project_and_module_files() { fn compiler_warns_for_duplicate_labels_across_modules_and_extensions() { let mut project_source = facility(); project_source["modules"] = json!({"local-module": {"version":"0.1.0"}}); - project_source["functions"] = json!({}); + project_source["actionPlans"] = json!({}); project_source["actions"] = json!({}); { let profiles = project_source["accessProfiles"].as_object_mut().unwrap(); @@ -1137,9 +1137,9 @@ fn compiler_scopes_refusal_labels_by_action_across_project_and_module() { .unwrap() .value; - let function = project_source["functions"]["correct-address-plan"].clone(); + let function = project_source["actionPlans"]["correct-address-plan"].clone(); let mut action = project_source["actions"]["correct-address"].clone(); - action["plan"]["function"] = json!("module-address-plan"); + action["plan"]["actionPlan"] = json!("module-address-plan"); action["display"]["label"] = json!("Module address correction"); let module_source = json!({ "apiVersion":"id.registrystack.org/formats/breg/module/v1alpha1", @@ -1147,7 +1147,7 @@ fn compiler_scopes_refusal_labels_by_action_across_project_and_module() { "id":"local-module", "version":"0.1.0", "valueTypes":project_source["valueTypes"].clone(), - "functions":{"module-address-plan": function}, + "actionPlans":{"module-address-plan": function}, "actions":{"module-correct-address": action} }); let module = read_module_yaml("module.yaml", &bytes(&module_source)) @@ -1181,9 +1181,9 @@ fn compiler_scopes_refusal_labels_by_action_across_project_and_module() { #[test] fn function_capability_duplicates_are_not_collapsed() { - let path = "/functions/correct-address-plan/capabilities"; + let path = "/actionPlans/correct-address-plan/capabilities"; let mut source = facility(); - source["functions"]["correct-address-plan"]["capabilities"] = json!(["evidence", "evidence"]); + source["actionPlans"]["correct-address-plan"]["capabilities"] = json!(["evidence", "evidence"]); refusal(&source, &format!("{path}/1"), "config.duplicate-item"); let yaml = bytes(&source); let text = std::str::from_utf8(&yaml).unwrap(); @@ -1214,7 +1214,7 @@ fn function_capability_duplicates_are_not_collapsed() { #[test] fn nested_union_refusals_keep_the_member_path_line_and_column() { for path in [ - "/functions/correct-address-plan", + "/actionPlans/correct-address-plan", "/actions/register-facility/execution", "/actions/correct-address/plan", "/actions/deactivate-facility/execution/proposal/review", @@ -1262,10 +1262,10 @@ fn resource_bounds_and_signed_comparison_thresholds_have_distinct_semantics() { ] { for value in values { let mut source = facility(); - source["functions"]["correct-address-plan"]["limits"] = json!({key:value}); + source["actionPlans"]["correct-address-plan"]["limits"] = json!({key:value}); refusal( &source, - &format!("/functions/correct-address-plan/limits/{key}"), + &format!("/actionPlans/correct-address-plan/limits/{key}"), "config.out-of-range", ); } @@ -1329,12 +1329,12 @@ fn schema_and_reader_agree_on_bounds_native_tags_and_public_context_names() { ("maximumOutputBytes", 2_097_152), ] { for value in [1, maximum] { - source["functions"]["correct-address-plan"]["limits"] = json!({key:value}); + source["actionPlans"]["correct-address-plan"]["limits"] = json!({key:value}); assert!(schema.is_valid(&source)); read_project_yaml("registry.yaml", &bytes(&source)).unwrap(); } for value in [0, maximum + 1] { - source["functions"]["correct-address-plan"]["limits"] = json!({key:value}); + source["actionPlans"]["correct-address-plan"]["limits"] = json!({key:value}); assert!(!schema.is_valid(&source)); } } diff --git a/crates/registry-breg/tests/ordered_plan_contract.rs b/crates/registry-breg/tests/ordered_plan_contract.rs index ec46c737c8..d834cd4936 100644 --- a/crates/registry-breg/tests/ordered_plan_contract.rs +++ b/crates/registry-breg/tests/ordered_plan_contract.rs @@ -71,8 +71,8 @@ fn production_compiler_refuses_forward_and_cyclic_references_and_after() { #[test] fn production_function_evaluator_preserves_order_and_refuses_forward_refs() { let mut value = project(); - value["functions"] = json!({"pair-plan": {"runtime":"rhai","source":"plans/plan.rhai","entrypoint":"plan","abi":"registry.action-plan/v1","capabilities":[]}}); - value["actions"]["create-pair"]["plan"] = json!({"type":"function","function":"pair-plan","inputs":["name"],"writes":[ + value["actionPlans"] = json!({"pair-plan": {"runtime":"rhai","source":"plans/plan.rhai","entrypoint":"plan","abi":"registry.action-plan/v1","capabilities":[]}}); + value["actions"]["create-pair"]["plan"] = json!({"type":"scripted","actionPlan":"pair-plan","inputs":["name"],"writes":[ {"id":"z-result","target":{"recordType":"entry"},"operation":"create","fields":["name","parent"]}, {"id":"a-result","target":{"recordType":"entry"},"operation":"create","fields":["name","parent"]}]}); let script = r#"fn plan(ctx) { #{effects:[#{id:"z-result",set:#{name:ctx.inputs.name}},#{id:"a-result",set:#{name:ctx.inputs.name}}]} }"#; @@ -108,7 +108,7 @@ fn modules_share_native_record_types_value_types_and_function_asset_provenance() let mut value = project(); value["recordTypes"] = json!({}); value["modules"] = json!({"records": {"version":"1"}, "extensions": {"version":"1"}}); - value["actions"]["create-pair"]["plan"] = json!({"type":"function","function":"module-plan","inputs":["name"],"writes":[ + value["actions"]["create-pair"]["plan"] = json!({"type":"scripted","actionPlan":"module-plan","inputs":["name"],"writes":[ {"id":"z-result","target":{"recordType":"entry"},"operation":"create","fields":["name"]}, {"id":"a-result","target":{"recordType":"entry"},"operation":"create","fields":["name"]} ]}); @@ -124,7 +124,7 @@ fn modules_share_native_record_types_value_types_and_function_asset_provenance() "apiVersion":"id.registrystack.org/formats/breg/module/v1alpha1","kind":"BRegModule","id":"records","version":"1", "valueTypes":{"name":{"type":"string","maximumLength":32}}, "recordTypes":{"entry": {"route":"entries","primaryDataset":"records","mutationMode":"mutable","fields":[{"id":"name","typeRef":"name","required":true,"classification":"internal"}]}}, - "functions":{"module-plan": {"runtime":"rhai","source":"plans/plan.rhai","entrypoint":"plan","abi":"registry.action-plan/v1","capabilities":["evidence"]}} + "actionPlans":{"module-plan": {"runtime":"rhai","source":"plans/plan.rhai","entrypoint":"plan","abi":"registry.action-plan/v1","capabilities":["evidence"]}} })).unwrap()).unwrap(); let extensions = parse_module_json(&serde_json::to_vec(&json!({ "apiVersion":"id.registrystack.org/formats/breg/module/v1alpha1","kind":"BRegModule","id":"extensions","version":"1","dependencies":["records"], diff --git a/crates/registry-breg/tests/postgres_hook_changes.rs b/crates/registry-breg/tests/postgres_hook_changes.rs index e0b899aa60..3c8e4a11c4 100644 --- a/crates/registry-breg/tests/postgres_hook_changes.rs +++ b/crates/registry-breg/tests/postgres_hook_changes.rs @@ -162,7 +162,7 @@ fn hook_project_json( ], "hooks":{followup_hooks} }}}}, - "functions":{{"open-followup-plan":{{"runtime":"rhai","source":"scripts/open-followup.rhai","entrypoint":"handle","abi":"registry.action-plan/v1"}}}}, + "actionPlans":{{"open-followup-plan":{{"runtime":"rhai","source":"scripts/open-followup.rhai","entrypoint":"handle","abi":"registry.action-plan/v1"}}}}, "actions":{{"open-followup":{{ "execution":{{"mode":"immediate"}}, "inputs":[ @@ -170,7 +170,7 @@ fn hook_project_json( {{"id":"origin","apiName":"origin","type":"string","maximumLength":64,"required":true,"classification":"internal"}} ], "plan":{{ - "type":"function","function":"open-followup-plan","inputs":["jurisdiction","origin"], + "type":"scripted","actionPlan":"open-followup-plan","inputs":["jurisdiction","origin"], "writes":[{{"id":"followup","target":{{"recordType":"followup"}},"operation":"create","fields":["jurisdiction","label","origin"]}}{extra_writes}] }} }}}}, diff --git a/crates/registry-breg/tests/postgres_package.rs b/crates/registry-breg/tests/postgres_package.rs index 53b2568b9c..0f8ca3c5fe 100644 --- a/crates/registry-breg/tests/postgres_package.rs +++ b/crates/registry-breg/tests/postgres_package.rs @@ -442,7 +442,7 @@ fn projection_free_package_refuses_claimed_manifest_artifacts() { assert_eq!( load_error(root.path(), &local_context(),), - PackageError::Derivation + PackageError::GeneratedArtifactsMismatch ); } @@ -699,7 +699,7 @@ fn package_rederivation_refuses_rehashed_substituted_caller_safe_metadata() { assert_eq!( load_error(fixture.root.path(), &local_context(),), - PackageError::Derivation + PackageError::GeneratedArtifactsMismatch ); } @@ -721,7 +721,7 @@ fn package_rederivation_refuses_a_rehashed_substituted_event_inventory() { assert_eq!( load_error(fixture.root.path(), &local_context(),), - PackageError::Derivation + PackageError::GeneratedArtifactsMismatch ); } @@ -769,7 +769,7 @@ fn local_unsigned_package_rederives_every_artifact_and_refuses_filesystem_tamper }); assert_eq!( load_error(fixture.root.path(), &context), - PackageError::Derivation + PackageError::GeneratedArtifactsMismatch ); fs::write( &manifest_projection_path, diff --git a/crates/registry-breg/tests/postgres_package/compiler_upgrade.rs b/crates/registry-breg/tests/postgres_package/compiler_upgrade.rs index bd801d666a..b2423b1968 100644 --- a/crates/registry-breg/tests/postgres_package/compiler_upgrade.rs +++ b/crates/registry-breg/tests/postgres_package/compiler_upgrade.rs @@ -477,7 +477,7 @@ impl EarlierCompilerRegistry { }); assert_eq!( load_package(root.path(), &local_context()).err(), - Some(PackageError::Derivation), + Some(PackageError::GeneratedArtifactsMismatch), "this runtime refuses the concrete earlier-compiler boundary" ); let predecessor = load_predecessor_package(root.path(), &local_context()) diff --git a/crates/registry-breg/tests/postgres_package/derived_upgrade.rs b/crates/registry-breg/tests/postgres_package/derived_upgrade.rs index 7702256a0b..9ea4bafd55 100644 --- a/crates/registry-breg/tests/postgres_package/derived_upgrade.rs +++ b/crates/registry-breg/tests/postgres_package/derived_upgrade.rs @@ -96,7 +96,7 @@ async fn an_unchanged_successor_replaces_an_older_derived_wrapper() { }); assert_eq!( load_package(legacy_root.path(), &local_context()).err(), - Some(PackageError::Derivation), + Some(PackageError::GeneratedArtifactsMismatch), "the new runtime refuses an old package whose generated view no longer rederives" ); let predecessor = load_predecessor_package(legacy_root.path(), &local_context()) @@ -142,7 +142,9 @@ async fn an_unchanged_successor_replaces_an_older_derived_wrapper() { ) .await .err(), - Some(StartupError::PackageRefused(PackageError::Derivation)), + Some(StartupError::PackageRefused( + PackageError::GeneratedArtifactsMismatch + )), "the runtime refuses the old package before consulting or changing the database" ); drop(runtime); diff --git a/crates/registry-breg/tests/postgres_proposal.rs b/crates/registry-breg/tests/postgres_proposal.rs index 0bd6e257c4..c3468c6a0f 100644 --- a/crates/registry-breg/tests/postgres_proposal.rs +++ b/crates/registry-breg/tests/postgres_proposal.rs @@ -9063,11 +9063,11 @@ fn writable_inputs_source() -> Value { fn nullable_writable_inputs_registry() -> registry_breg::CompiledRegistry { let mut source = writable_inputs_source(); proposal_status::require_review(&mut source); - source["functions"] = json!({"nullable-note-plan": {"runtime":"rhai", "source":"plans/nullable-note.rhai", + source["actionPlans"] = json!({"nullable-note-plan": {"runtime":"rhai", "source":"plans/nullable-note.rhai", "entrypoint":"plan", "abi":"registry.action-plan/v1" }}); source["actions"]["correct-name"]["plan"] = json!({ - "type":"function", "function":"nullable-note-plan", "inputs":["target","value","note"], + "type":"scripted", "actionPlan":"nullable-note-plan", "inputs":["target","value","note"], "writes":[{"id":"name","target":{"fromInput":"target"},"operation":"patch","fields":["name"]}] }); let project = parse_project_json(&serde_json::to_vec(&source).unwrap()).unwrap(); diff --git a/crates/registry-breg/tests/registry_timezone.rs b/crates/registry-breg/tests/registry_timezone.rs index b67fb21058..4b7eb53ea3 100644 --- a/crates/registry-breg/tests/registry_timezone.rs +++ b/crates/registry-breg/tests/registry_timezone.rs @@ -159,11 +159,11 @@ fn a_current_date_requirement_requires_a_timezone() { #[test] fn a_plan_that_calls_today_requires_a_timezone() { let mut source = action_support::project(); - source["functions"] = json!({"dated-plan": {"runtime":"rhai", "source":"plans/dated.rhai", + source["actionPlans"] = json!({"dated-plan": {"runtime":"rhai", "source":"plans/dated.rhai", "entrypoint":"plan", "abi":"registry.action-plan/v1" }}); source["actions"]["register-child"]["plan"] = json!({ - "type":"function", "function":"dated-plan", "inputs":["parent"], + "type":"scripted", "actionPlan":"dated-plan", "inputs":["parent"], "writes":[{"id":"child","target":{"recordType":"child"},"operation":"create","fields":["parent","label"]}] }); let assets = || { @@ -223,11 +223,11 @@ fn plan(ctx) { #[test] fn a_user_defined_zero_argument_today_does_not_require_a_timezone() { let mut source = action_support::project(); - source["functions"] = json!({"dated-plan": {"runtime":"rhai", "source":"plans/dated.rhai", + source["actionPlans"] = json!({"dated-plan": {"runtime":"rhai", "source":"plans/dated.rhai", "entrypoint":"plan", "abi":"registry.action-plan/v1" }}); source["actions"]["register-child"]["plan"] = json!({ - "type":"function", "function":"dated-plan", "inputs":["parent"], + "type":"scripted", "actionPlan":"dated-plan", "inputs":["parent"], "writes":[{"id":"child","target":{"recordType":"child"},"operation":"create","fields":["parent","label"]}] }); let asset = ModuleAssetSource { diff --git a/crates/registry-breg/tests/review_context_package.rs b/crates/registry-breg/tests/review_context_package.rs index 6760c6a767..e0dc2abf4e 100644 --- a/crates/registry-breg/tests/review_context_package.rs +++ b/crates/registry-breg/tests/review_context_package.rs @@ -125,7 +125,7 @@ fn sealed_review_context_export_is_exact_and_cannot_be_omitted_or_rebound() { reseal(&missing); assert_eq!( inspect_package_integrity(&missing).err(), - Some(PackageError::Derivation) + Some(PackageError::GeneratedArtifactsMismatch) ); let rebound = temporary.path().join("rebound"); @@ -150,6 +150,6 @@ fn sealed_review_context_export_is_exact_and_cannot_be_omitted_or_rebound() { reseal(&rebound); assert_eq!( inspect_package_integrity(&rebound).err(), - Some(PackageError::Derivation) + Some(PackageError::GeneratedArtifactsMismatch) ); } diff --git a/crates/registry-breg/tests/script_baseline.rs b/crates/registry-breg/tests/script_baseline.rs index f881c8542d..0a5d2ef06c 100644 --- a/crates/registry-breg/tests/script_baseline.rs +++ b/crates/registry-breg/tests/script_baseline.rs @@ -22,7 +22,7 @@ fn action(script: &str) -> CompiledAction { "apiVersion":"id.registrystack.org/formats/breg/project/v1alpha1", "kind":"BRegProject", "project":{"id":"script-baseline","version":"1","defaultLanguage":"en","canonicalBaseIri":"https://example.test"}, "datasets":{"baseline": {}}, - "functions":{"baseline": {"runtime":"rhai","source":"handlers/baseline.rhai","entrypoint":"handle","abi":"registry.action-plan/v1"}}, + "actionPlans":{"baseline": {"runtime":"rhai","source":"handlers/baseline.rhai","entrypoint":"handle","abi":"registry.action-plan/v1"}}, "recordTypes":{"record": {"primaryDataset":"baseline","route":"records","mutationMode":"mutable","fields":[ {"id":"label","type":"string","maximumLength":160,"required":true,"classification":"restricted"}, {"id":"count","type":"int64","classification":"restricted"}, @@ -33,7 +33,7 @@ fn action(script: &str) -> CompiledAction { {"id":"count","type":"int64","required":true,"classification":"restricted"}, {"id":"amount","type":"decimal","precision":20,"scale":2,"required":true,"classification":"restricted"}, {"id":"note","type":"string","maximumLength":80,"classification":"restricted"} - ],"plan":{"type":"function","function":"baseline","inputs":["label","count","amount","note"], + ],"plan":{"type":"scripted","actionPlan":"baseline","inputs":["label","count","amount","note"], "refusals":[{"code":"blank-label","label":"A label is required."}], "writes":[{"id":"record","target":{"recordType":"record"},"operation":"create","fields":["label","count","amount"]}] }}}, diff --git a/crates/registry-breg/tests/support/proposal_required_attachment.rs b/crates/registry-breg/tests/support/proposal_required_attachment.rs index 302056838a..b05c5c88eb 100644 --- a/crates/registry-breg/tests/support/proposal_required_attachment.rs +++ b/crates/registry-breg/tests/support/proposal_required_attachment.rs @@ -350,8 +350,8 @@ async fn required_file_precedes_plan_evaluation() { let mut source = registry_source(false); source["actions"]["correct-name"]["execution"]["proposal"]["attachments"][0]["required"] = json!(true); - source["functions"] = json!({"failing-plan":{"runtime":"rhai","source":"plans/failing.rhai","entrypoint":"plan","abi":"registry.action-plan/v1"}}); - source["actions"]["correct-name"]["plan"] = json!({"type":"function","function":"failing-plan","inputs":["target","value"], + source["actionPlans"] = json!({"failing-plan":{"runtime":"rhai","source":"plans/failing.rhai","entrypoint":"plan","abi":"registry.action-plan/v1"}}); + source["actions"]["correct-name"]["plan"] = json!({"type":"scripted","actionPlan":"failing-plan","inputs":["target","value"], "writes":[{"id":"name","target":{"fromInput":"target"},"operation":"patch","fields":["name"]}]}); let registry = compile_project_with_assets( &parse_project_json(&serde_json::to_vec(&source).unwrap()).unwrap(), diff --git a/crates/registry-breg/tests/timer_authoring.rs b/crates/registry-breg/tests/timer_authoring.rs index f68f47597c..b971491a55 100644 --- a/crates/registry-breg/tests/timer_authoring.rs +++ b/crates/registry-breg/tests/timer_authoring.rs @@ -871,14 +871,14 @@ fn timer_refuses_public_invoke_and_non_immediate_actions() { #[test] fn timer_refuses_remote_function_and_evidence_capabilities() { let mut remote = timer_project_value(); - remote["functions"].as_object_mut().unwrap().insert( + remote["actionPlans"].as_object_mut().unwrap().insert( "timer-plan".to_owned(), json!({"runtime":"rhai","source":"plans/timer.rhai", "entrypoint":"plan","abi":"registry.action-plan/v1","capabilities":["evidence"] }), ); remote["actions"]["activate-contact"]["plan"] = json!({ - "type":"function","function":"timer-plan", + "type":"scripted","actionPlan":"timer-plan", "inputs":["contact","planned-at","operation-id"], "refusals":[], "writes":[{"id":"activated","target":{"fromInput":"contact"},"operation":"patch","fields":["active"]}] @@ -899,11 +899,11 @@ fn timer_refuses_remote_function_and_evidence_capabilities() { .all(|handler| handler.capabilities.is_empty())); let mut evidence = timer_project_value(); - evidence["functions"] = json!({"timer-plan": {"runtime":"rhai","source":"plans/timer.rhai", + evidence["actionPlans"] = json!({"timer-plan": {"runtime":"rhai","source":"plans/timer.rhai", "entrypoint":"plan","abi":"registry.action-plan/v1","capabilities":["evidence"] }}); evidence["actions"]["activate-contact"]["plan"] = json!({ - "type":"function","function":"timer-plan", + "type":"scripted","actionPlan":"timer-plan", "inputs":["contact","planned-at","operation-id"], "refusals":[], "writes":[{"id":"activated","target":{"fromInput":"contact"},"operation":"patch","fields":["active"]}] diff --git a/crates/registry-breg/tests/wasm_handler_admission.rs b/crates/registry-breg/tests/wasm_handler_admission.rs index 0c20619fba..b647799487 100644 --- a/crates/registry-breg/tests/wasm_handler_admission.rs +++ b/crates/registry-breg/tests/wasm_handler_admission.rs @@ -98,14 +98,14 @@ fn wasm_project() -> Value { {"id":"legal-name","apiName":"legalName","type":"string","maximumLength":160,"required":true,"classification":"restricted"} ] }}, - "functions":{"person-plan": {"runtime":"wasm","source":"wasm/handler.wasm","entrypoint":"handle","abi":"registry.action-plan/v1"}}, + "actionPlans":{"person-plan": {"runtime":"wasm","source":"wasm/handler.wasm","entrypoint":"handle","abi":"registry.action-plan/v1"}}, "actions":{"register-person": {"execution":{"mode":"immediate"}, "inputs":[ {"id":"person-code","apiName":"personCode","type":"string","maximumLength":64,"required":true,"classification":"restricted"}, {"id":"legal-name","apiName":"legalName","type":"string","maximumLength":160,"required":true,"classification":"restricted"} ], "plan":{ - "type":"function","function":"person-plan","inputs":["person-code","legal-name"], + "type":"scripted","actionPlan":"person-plan","inputs":["person-code","legal-name"], "writes":[{ "id":"person","target":{"recordType":"person"},"operation":"create", "fields":["person-code","legal-name"] @@ -240,7 +240,7 @@ fn a_missing_module_asset_reports_the_authored_path() { .map(|_| ()) .expect_err("a declared module without its asset is refused"); let diagnostic = first_code(&failure, "breg.action.handler-module-asset-missing"); - assert_eq!(diagnostic.path, "functions[id=person-plan].source"); + assert_eq!(diagnostic.path, "actionPlans[id=person-plan].source"); assert!( diagnostic.message.contains("wasm/handler.wasm"), "the diagnostic names the authored path: {}", @@ -255,7 +255,7 @@ fn a_module_over_the_structural_ceiling_is_refused_before_validation() { .map(|_| ()) .expect_err("a module beyond the structural ceiling is refused"); let diagnostic = first_code(&failure, "breg.action.handler-module-bound"); - assert_eq!(diagnostic.path, "functions[id=person-plan].source"); + assert_eq!(diagnostic.path, "actionPlans[id=person-plan].source"); // The refusal names the structural ceiling: the ceiling every build and // package enforces, not an operator's execution-time configuration. assert_eq!(MAXIMUM_WASM_MODULE_BYTES, 5 * 1024 * 1024); @@ -290,7 +290,7 @@ fn wat_text_is_not_admitted_as_a_module_binary() { .map(|_| ()) .expect_err("WebAssembly text is not a module binary"); let diagnostic = first_code(&failure, "breg.action.handler-module-invalid"); - assert_eq!(diagnostic.path, "functions[id=person-plan].source"); + assert_eq!(diagnostic.path, "actionPlans[id=person-plan].source"); } #[test] @@ -309,7 +309,7 @@ fn a_module_with_a_disallowed_import_is_refused_by_name() { .map(|_| ()) .expect_err("a module with an import is refused"); let diagnostic = first_code(&failure, "breg.action.handler-module-import-unsupported"); - assert_eq!(diagnostic.path, "functions[id=person-plan].source"); + assert_eq!(diagnostic.path, "actionPlans[id=person-plan].source"); assert!( diagnostic.message.contains("\"env\"") && diagnostic.message.contains("\"log\""), "the diagnostic names the disallowed import: {}", @@ -331,7 +331,7 @@ fn a_module_missing_a_required_export_is_refused_by_name() { .map(|_| ()) .expect_err("a module missing result_len is refused"); let diagnostic = first_code(&failure, "breg.action.handler-module-export-missing"); - assert_eq!(diagnostic.path, "functions[id=person-plan].source"); + assert_eq!(diagnostic.path, "actionPlans[id=person-plan].source"); assert!( diagnostic.message.contains("result_len"), "the diagnostic names the missing export: {}", @@ -390,7 +390,7 @@ fn wasm_handler_field_discipline_is_reported_per_backend() { // pairs the backend with its source reference, so the refusal arrives // while the project is read. let mut with_script = wasm_project(); - with_script["functions"]["person-plan"]["script"] = json!("scripts/handler.rhai"); + with_script["actionPlans"]["person-plan"]["script"] = json!("scripts/handler.rhai"); let failure = parse_project_json(&serde_json::to_vec(&with_script).unwrap()) .map(|_| ()) .expect_err("a WASM handler cannot declare a Rhai script"); @@ -403,12 +403,12 @@ fn wasm_handler_field_discipline_is_reported_per_backend() { // A non-.wasm module path never reaches the asset lookup. let mut bad_path = wasm_project(); - bad_path["functions"]["person-plan"]["source"] = json!("wasm/handler.txt"); + bad_path["actionPlans"]["person-plan"]["source"] = json!("wasm/handler.txt"); let failure = compile_with_module(bad_path, "wasm/handler.wasm", binary(MINIMAL_ABI_WAT)) .map(|_| ()) .expect_err("a non-wasm module path is refused"); let diagnostic = first_code(&failure, "breg.action.handler-module-source-invalid"); - assert_eq!(diagnostic.path, "functions[id=person-plan].source"); + assert_eq!(diagnostic.path, "actionPlans[id=person-plan].source"); } #[test] @@ -427,7 +427,7 @@ fn an_evidence_declaration_stays_refused_for_wasm_handlers_under_the_feature() { "outputs": ["active"], "maximumObservationAgeSeconds": 60 }]); - project["functions"]["person-plan"]["capabilities"] = json!(["evidence"]); + project["actionPlans"]["person-plan"]["capabilities"] = json!(["evidence"]); let contract = ModuleAssetSource { module: None, path: "evidence/farmer-contracts.json".to_owned(), @@ -479,7 +479,7 @@ fn an_evidence_declaration_stays_refused_for_wasm_handlers_under_the_feature() { })); // The same declared capability is admitted by an input-bound Rhai plan. - project["functions"]["person-plan"] = json!({ + project["actionPlans"]["person-plan"] = json!({ "runtime":"rhai", "source":"handlers/register.rhai", "entrypoint":"plan", "abi":ACTION_PLAN_ABI_V1, "capabilities":["evidence"] @@ -518,7 +518,7 @@ fn the_per_package_wasm_module_count_is_bounded() { {"id":"legal-name","type":"string","maximumLength":160,"required":true,"classification":"restricted"} ], "plan":{ - "type":"function","function":"person-plan","inputs":["person-code","legal-name"], + "type":"scripted","actionPlan":"person-plan","inputs":["person-code","legal-name"], "writes":[{"id":"person","target":{"recordType":"person"},"operation":"create","fields":["person-code","legal-name"]}] } })); @@ -534,7 +534,7 @@ fn the_per_package_wasm_module_count_is_bounded() { .map(|_| ()) .expect_err("a package beyond the module-count ceiling is refused"); let diagnostic = first_code(&failure, "breg.action.handler-modules-bound"); - assert_eq!(diagnostic.path, "functions[id=person-plan].source"); + assert_eq!(diagnostic.path, "actionPlans[id=person-plan].source"); } /// The package closure test needs the package module, which the runtime diff --git a/crates/registry-bregctl/src/action_handler_test.rs b/crates/registry-bregctl/src/action_handler_test.rs index ae1e2995a2..64b0ee3a33 100644 --- a/crates/registry-bregctl/src/action_handler_test.rs +++ b/crates/registry-bregctl/src/action_handler_test.rs @@ -744,7 +744,7 @@ recordTypes: fields: - {id: person-code, apiName: personCode, type: string, required: true, maximumLength: 64, classification: restricted} - {id: legal-name, apiName: legalName, type: string, required: true, maximumLength: 160, classification: restricted} -functions: +actionPlans: register-person-plan: runtime: wasm source: wasm/handler.wasm @@ -757,8 +757,8 @@ actions: - {id: legal-name, apiName: legalName, type: string, required: true, maximumLength: 160, classification: restricted} execution: {mode: immediate} plan: - type: function - function: register-person-plan + type: scripted + actionPlan: register-person-plan inputs: [person-code, legal-name] writes: - id: person diff --git a/crates/registry-bregctl/src/check.rs b/crates/registry-bregctl/src/check.rs index 4de44caf4d..5c2656dc1f 100644 --- a/crates/registry-bregctl/src/check.rs +++ b/crates/registry-bregctl/src/check.rs @@ -58,6 +58,7 @@ const ADD_READABLE_OR_REMOVE_PROCESSING: &str = const REVIEW_RELATED_DISCLOSURE: &str = "Remove fields that these readers should not see from this read path's readableFields, or remove the read path; use a direct permission on the related record type when its own row boundaries should apply."; const FIND_PROJECT: &str = "Point bregctl check at a readable project directory that holds registry.yaml, or create one with bregctl init."; const REBUILD_PACKAGE: &str = "Rebuild the package with bregctl package PROJECT --test-receipt RECEIPT --output BUILD; a package is checked as the build wrote it, unmodified."; +const REBUILD_SUCCESSOR: &str = "Keep the sealed package intact and verify its provenance. For an active registry, run this release's bregctl test and bregctl package with --baseline-package ACTIVE, then plan and apply the checked successor. For a new registry, build and check a package with this release."; const REDUCE_MIGRATION_STATEMENTS: &str = "For an initial activation, reduce the generated schema or policy inventory below the supported package migration bound, for example by consolidating equivalent access profiles. A baseline-derived successor is checked against its actual migration when the package is prepared."; /// What `bregctl check` was asked to check. @@ -1364,6 +1365,7 @@ fn package_code(error: &PackageError) -> &'static str { | PackageError::Derivation | PackageError::MigrationPlan | PackageError::ReviewedMigration(_) => "breg.package.integrity-refused", + PackageError::GeneratedArtifactsMismatch => "breg.package.generated-artifacts-refused", PackageError::PreviousReleaseSources(_) => "breg.package.predecessor-sources-refused", PackageError::EntityIdMember => "breg.package.entity-id-refused", PackageError::EngineFeatureUpgradeRequired => "breg.package.engine-upgrade-required", @@ -1397,6 +1399,7 @@ fn package_action(error: &PackageError) -> &'static str { PackageError::EngineFeatureUpgradeRequired | PackageError::PreviousReleaseSources(_) | PackageError::EntityIdMember => PREVIOUS_RELEASE_ACTION, + PackageError::GeneratedArtifactsMismatch => REBUILD_SUCCESSOR, _ => REBUILD_PACKAGE, } } diff --git a/crates/registry-bregctl/src/explain_report.rs b/crates/registry-bregctl/src/explain_report.rs index 93033c46fe..c6c7fe62fd 100644 --- a/crates/registry-bregctl/src/explain_report.rs +++ b/crates/registry-bregctl/src/explain_report.rs @@ -112,13 +112,13 @@ pub(crate) fn actions(value: &Value, lines: &mut Lines) { )); lines.pairs_at(2, &[("inputs", names(&action["inputs"], "id"))]); let plan = &action["plan"]; - if plan["type"] == "function" { - let function = &plan["function"]; - lines.pairs_at(2, &[("plan function", text(&function["source"]).into())]); - if let Some(module) = function["sourceModule"].as_str() { + if plan["type"] == "scripted" { + let action_plan = &plan["actionPlan"]; + lines.pairs_at(2, &[("Action Plan", text(&action_plan["source"]).into())]); + if let Some(module) = action_plan["sourceModule"].as_str() { lines.pairs_at(2, &[("source module", module.into())]); } - for write in items(&function["writes"]) { + for write in items(&action_plan["writes"]) { lines.listed( 2, &format!( diff --git a/crates/registry-bregctl/src/lib.rs b/crates/registry-bregctl/src/lib.rs index de3bfd24c5..2b8fd2239a 100644 --- a/crates/registry-bregctl/src/lib.rs +++ b/crates/registry-bregctl/src/lib.rs @@ -686,7 +686,7 @@ enum ProjectCommand { }, /// Compute and write module source digests in registry.yaml. Lock(ProjectLockArgs), - /// Test a named Action plan function with bounded synthetic JSON. + /// Test a named Action Plan with bounded synthetic JSON. ActionTest(ProjectActionTestArgs), } @@ -707,7 +707,7 @@ struct ProjectActionTestArgs { #[arg(value_name = "PROJECT")] project: PathBuf, - /// Compiled Action whose named plan function will run; pair with --input. + /// Compiled Action whose named Action Plan will run; pair with --input. #[arg(long, value_name = "ACTION", requires = "input", required = true)] action: Option, @@ -7958,14 +7958,18 @@ fn lifecycle_failure(command: &'static str, error: ApplyLifecycleError) -> Failu DiagnosticArtifact::VerifiedPackage, SuggestedAction::CorrectPackageBuild, ), - ApplyLifecycleError::TargetPackage(PackageError::Derivation) => ( + ApplyLifecycleError::TargetPackage( + PackageError::Derivation | PackageError::GeneratedArtifactsMismatch, + ) => ( "apply.package.build-mismatch", "package", PACKAGE_BUILD_MISMATCH, DiagnosticArtifact::VerifiedPackage, SuggestedAction::CorrectPackageBuild, ), - ApplyLifecycleError::CurrentPackage(PackageError::Derivation) => ( + ApplyLifecycleError::CurrentPackage( + PackageError::Derivation | PackageError::GeneratedArtifactsMismatch, + ) => ( "apply.package.build-mismatch", "package.root", PACKAGE_BUILD_MISMATCH, @@ -8919,7 +8923,9 @@ fn package_refusal_message( fallback: &'static str, ) -> std::borrow::Cow<'static, str> { match error { - PackageError::Derivation => PACKAGE_BUILD_MISMATCH.into(), + PackageError::Derivation | PackageError::GeneratedArtifactsMismatch => { + PACKAGE_BUILD_MISMATCH.into() + } PackageError::EngineFeatureUpgradeRequired | PackageError::EntityIdMember | PackageError::PreviousReleaseSources(_) => error.to_string().into(), @@ -8977,7 +8983,9 @@ fn package_refusal(error: &PackageError) -> (&'static str, SuggestedAction) { PackageError::Bounds | PackageError::Read => { ("package-refused", SuggestedAction::VerifyPackageIntegrity) } - PackageError::Derivation => ("build-mismatch", SuggestedAction::CorrectPackageBuild), + PackageError::Derivation | PackageError::GeneratedArtifactsMismatch => { + ("build-mismatch", SuggestedAction::CorrectPackageBuild) + } PackageError::EntityIdMember => ("entity-id-refused", SuggestedAction::CorrectPackageBuild), PackageError::PreviousReleaseSources(_) => ( "predecessor-sources-refused", @@ -11012,7 +11020,7 @@ fn load_project_planner_asset_files( ); } for function in &project.functions { - let location = format!("functions[{}].source", function.id); + let location = format!("actionPlans[{}].source", function.id); match function.runtime { registry_breg::contract::ActionHandlerKindSource::Rhai => { paths.insert(function.source.clone(), location); @@ -11166,7 +11174,7 @@ fn load_module_asset_files( ); } for function in &module.functions { - let location = format!("modules[{module_id}].functions[{}].source", function.id); + let location = format!("modules[{module_id}].actionPlans[{}].source", function.id); match function.runtime { registry_breg::contract::ActionHandlerKindSource::Rhai => { planner_paths.insert(function.source.clone(), location); @@ -17906,7 +17914,10 @@ mod tests { assert!(!actions.is_empty()); for action in actions { assert_eq!(action["dependencies"]["evidence"], json!([])); - assert_eq!(action["plan"]["function"]["abi"], "registry.action-plan/v1"); + assert_eq!( + action["plan"]["actionPlan"]["abi"], + "registry.action-plan/v1" + ); assert!(action["revision"].as_str().unwrap().starts_with("sha256:")); } } @@ -17928,7 +17939,10 @@ mod tests { let actions = explanation["actions"].as_array().unwrap(); assert!(!actions.is_empty()); for action in actions { - assert_eq!(action["plan"]["function"]["abi"], "registry.action-plan/v1"); + assert_eq!( + action["plan"]["actionPlan"]["abi"], + "registry.action-plan/v1" + ); let evidence = action["dependencies"]["evidence"].as_array().unwrap(); assert_eq!(evidence.len(), 2); assert!(evidence.iter().all(|binding| { @@ -17938,7 +17952,7 @@ mod tests { .starts_with("sha256:") && binding["provider"] == "farmer-registry" })); - assert!(action["plan"]["function"]["scriptSource"].is_null()); + assert!(action["plan"]["actionPlan"]["scriptSource"].is_null()); assert!(action["revision"].as_str().unwrap().starts_with("sha256:")); } } @@ -19376,7 +19390,7 @@ extendRecordTypes: - id: person-summary sql: sql/summary.sql key: id -functions: +actionPlans: person-plan: runtime: rhai source: planners/person.rhai diff --git a/crates/registry-bregctl/tests/cli.rs b/crates/registry-bregctl/tests/cli.rs index b6eb002235..590b2d284f 100644 --- a/crates/registry-bregctl/tests/cli.rs +++ b/crates/registry-bregctl/tests/cli.rs @@ -1442,7 +1442,7 @@ fn missing_action_script_identifies_action_and_safe_relative_path() { .find(|diagnostic| diagnostic["code"] == "breg.source.planner-asset-missing") .unwrap_or_else(|| panic!("the missing planner asset is reported: {report}")); assert_eq!(diagnostic["code"], "breg.source.planner-asset-missing"); - assert_eq!(diagnostic["path"], "/functions/register-person-plan/source"); + assert_eq!(diagnostic["path"], "/actionPlans/register-person-plan/source"); assert_eq!( diagnostic["source"]["file"], project.path().join("registry.yaml").display().to_string() @@ -1517,7 +1517,7 @@ fn capture_failure_shares_the_registry_warning_budget() { assert!(capture < 100, "{report}"); assert_eq!( diagnostics[capture]["path"], - "/functions/register-person-plan/source" + "/actionPlans/register-person-plan/source" ); let stopped = report["diagnostics"] .as_array() @@ -7050,8 +7050,8 @@ fn explain_actions_reports_reference_acceptance_conditions() { assert_eq!(requirement["recordType"], "register"); assert_eq!(requirement["field"], "active"); assert_eq!(requirement["equals"], true); - assert_eq!(action["plan"]["function"]["kind"], "rhai"); - assert!(action["plan"]["function"].get("scriptSource").is_none()); + assert_eq!(action["plan"]["actionPlan"]["kind"], "rhai"); + assert!(action["plan"]["actionPlan"].get("scriptSource").is_none()); assert!(!String::from_utf8(output.stdout) .expect("explanation is UTF-8") .contains("registry_data")); @@ -7179,7 +7179,7 @@ recordTypes: fields: - {id: person-code, apiName: personCode, type: string, required: true, maximumLength: 64, classification: restricted} - {id: legal-name, apiName: legalName, type: string, required: true, maximumLength: 160, classification: restricted} -functions: +actionPlans: register-person-plan: runtime: wasm source: wasm/handler.wasm @@ -7192,8 +7192,8 @@ actions: - {id: legal-name, apiName: legalName, type: string, required: true, maximumLength: 160, classification: restricted} execution: {mode: immediate} plan: - type: function - function: register-person-plan + type: scripted + actionPlan: register-person-plan inputs: [person-code, legal-name] writes: - id: person @@ -7238,7 +7238,7 @@ fn explain_actions_reports_wasm_handler_server_compatibility() { assert!(output.status.success(), "{output:?}"); let report = json_stdout(&output); - let function = &report["explanation"]["actions"][0]["plan"]["function"]; + let function = &report["explanation"]["actions"][0]["plan"]["actionPlan"]; assert_eq!(function["kind"], "wasm"); assert_eq!(function["abi"], "registry.action-plan/v1"); assert_eq!(function["entrypoint"], "handle"); diff --git a/crates/registry-bregctl/tests/explain_contract.rs b/crates/registry-bregctl/tests/explain_contract.rs index cf323b2aa7..387cee2d2d 100644 --- a/crates/registry-bregctl/tests/explain_contract.rs +++ b/crates/registry-bregctl/tests/explain_contract.rs @@ -1083,7 +1083,7 @@ fn native_proposal_inspection_pins_review_and_system_apply_scope_without_sources .unwrap(); assert_eq!(correction["display"]["label"], "Correct facility address"); assert_eq!( - correction["plan"]["function"]["abi"], + correction["plan"]["actionPlan"]["abi"], "registry.action-plan/v1" ); let policy = &correction["execution"]["proposal"]; @@ -1200,6 +1200,19 @@ fn format_registry(root: &Path) -> Value { .to_json_value() } +#[test] +fn human_actions_explanation_names_the_action_plan_and_write_ceiling() { + let project = fixture_path("products/breg/examples/facility"); + let output = bregctl(&["explain", "actions", project.to_str().unwrap()]); + assert!(output.status.success(), "{output:?}"); + let stdout = String::from_utf8(output.stdout).expect("bregctl writes UTF-8"); + assert!( + stdout.contains("Action Plan plans/correct-address.rhai"), + "{stdout}" + ); + assert!(stdout.contains("write ceiling: patch facility"), "{stdout}"); +} + #[test] fn registered_examples_match_current_formatter_bytes_and_schemas() { let root = repo_root(); diff --git a/crates/registry-bregctl/tests/project_lock_refusals.rs b/crates/registry-bregctl/tests/project_lock_refusals.rs index 16f353da5b..1221db5a73 100644 --- a/crates/registry-bregctl/tests/project_lock_refusals.rs +++ b/crates/registry-bregctl/tests/project_lock_refusals.rs @@ -87,7 +87,7 @@ recordTypes: type: string maximumLength: 16 classification: internal -functions: +actionPlans: update-record-plan: runtime: rhai source: plans/update-record.rhai @@ -100,8 +100,8 @@ actions: - {id: record, type: reference, target: record, required: true, classification: internal} - {id: code, type: string, maximumLength: 16, required: true, classification: internal} plan: - type: function - function: update-record-plan + type: scripted + actionPlan: update-record-plan inputs: [record, code] writes: - id: record diff --git a/crates/registry-bregctl/tests/wasm_test_lifecycle.rs b/crates/registry-bregctl/tests/wasm_test_lifecycle.rs index 61ddbc4702..5ab5d9e4c9 100644 --- a/crates/registry-bregctl/tests/wasm_test_lifecycle.rs +++ b/crates/registry-bregctl/tests/wasm_test_lifecycle.rs @@ -16,6 +16,11 @@ use std::sync::atomic::{AtomicU64, Ordering}; use std::time::{SystemTime, UNIX_EPOCH}; use registry_breg::postgres::{provision_managed_schemas, SqlIdentifier}; +use registry_platform_canonical_json::canonicalize_json; +use registry_platform_config::{ + package::{write_sum_file, PackageLimits}, + sha256_uri, +}; use registry_platform_crypto::PrivateJwk; use registry_platform_testing::{fixtures, jwks_from_private_jwk, MockIdp}; use serde_json::{json, Value}; @@ -95,22 +100,7 @@ fn public_bregctl_test_fingerprint_only_measures_the_schema_the_full_run_binds() let receipt_after_measure = project.receipt.exists(); // The full run installs on the same database, so it also proves the // measurement left nothing behind. - let full = Command::new(env!("CARGO_BIN_EXE_bregctl")) - .env_remove("REGISTRY_STACK_POSTURE") - .args([ - "--format", - "json", - "test", - path(&project.project_root), - "--runtime-config", - path(&project.runtime_config), - "--credentials", - path(&project.credentials), - "--output", - path(&project.receipt), - ]) - .output() - .expect("bregctl test starts in a fresh process"); + let full = project.schema_test(None); runtime.block_on(idp.stop()); runtime.block_on(database.cleanup()); @@ -128,6 +118,101 @@ fn public_bregctl_test_fingerprint_only_measures_the_schema_the_full_run_binds() assert_eq!(measured["registryRevision"], full["registryRevision"]); } +#[test] +#[ignore = "requires BREG_TEST_DATABASE_URL and a PostgreSQL administrator"] +fn public_bregctl_rehearses_and_packages_a_successor_over_historical_action_plans() { + let runtime = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .expect("test runtime builds"); + let idp = runtime.block_on(MockIdp::start()); + let mut initial_db = runtime.block_on(TestDatabase::create()); + let initial = ProjectFixture::write(&initial_db, &idp, FixtureAudit::File); + let initial_test = initial.schema_test(None); + runtime.block_on(initial_db.cleanup()); + assert_command_succeeded(&initial_test); + let initial_build = initial.project_root.join("initial-build"); + assert_command_succeeded(&initial.package(&initial_build, None)); + + let check_package = |package: &Path| { + Command::new(env!("CARGO_BIN_EXE_bregctl")) + .env_remove("REGISTRY_STACK_POSTURE") + .args(["--format", "json", "check", "--package", path(package)]) + .output() + .expect("strict check starts") + }; + let predecessor = initial_build.join("package"); + assert_command_succeeded(&check_package(&predecessor)); + let openapi = predecessor.join("openapi/openapi.json"); + let current_openapi = fs::read(&openapi).unwrap(); + seal_historical_vocabulary(&predecessor); + assert_eq!(fs::read(openapi).unwrap(), current_openapi); + let strict = check_package(&predecessor); + assert_eq!(strict.status.code(), Some(1), "{strict:?}"); + let refusal: Value = serde_json::from_slice(&strict.stdout).unwrap(); + let diagnostic = &refusal["diagnostics"][0]; + assert_eq!( + diagnostic["code"], + "breg.package.generated-artifacts-refused" + ); + assert!(diagnostic["suggestedAction"] + .as_str() + .unwrap() + .contains("bregctl test and bregctl package with --baseline-package ACTIVE")); + + let mut successor_db = runtime.block_on(TestDatabase::create()); + let successor = ProjectFixture::write(&successor_db, &idp, FixtureAudit::File); + let rehearsal = successor.schema_test(Some(&predecessor)); + runtime.block_on(idp.stop()); + runtime.block_on(successor_db.cleanup()); + assert_command_succeeded(&rehearsal); + let successor_build = successor.project_root.join("successor-build"); + assert_command_succeeded(&successor.package(&successor_build, Some(&predecessor))); + assert_command_succeeded(&check_package(&successor_build.join("package"))); +} + +fn seal_historical_vocabulary(root: &Path) { + let manifest = root.join("package.json"); + let mut envelope: Value = serde_json::from_slice(&fs::read(&manifest).unwrap()).unwrap(); + let relative = "source/registry.yaml"; + let file = root.join(relative); + let mut text = fs::read_to_string(&file).unwrap(); + for (current, historical) in [ + ("actionPlans:", "functions:"), + ("type: scripted", "type: function"), + ("actionPlan:", "function:"), + ] { + assert!(text.contains(current), "{relative} lacks {current}"); + text = text.replace(current, historical); + } + set_private(&file); + fs::write(file, &text).unwrap(); + let entry = envelope["manifest"]["files"] + .as_array_mut() + .unwrap() + .iter_mut() + .find(|entry| entry["path"] == relative) + .unwrap(); + entry["sha256"] = json!(sha256_uri(text.as_bytes())); + entry["size"] = json!(text.len()); + set_private(&manifest); + fs::write(manifest, canonicalize_json(&envelope).unwrap()).unwrap(); + fs::remove_file(root.join("SHA256SUMS")).unwrap(); + write_sum_file( + root, + None, + &PackageLimits { + max_files: 4096, + max_file_bytes: 64 * 1024 * 1024, + max_total_bytes: 256 * 1024 * 1024, + max_depth: 16, + max_path_bytes: 512, + }, + "test package", + ) + .unwrap(); +} + #[derive(Clone, Copy)] enum FixtureAudit { File, @@ -143,22 +228,7 @@ fn run_schema_test(audit: FixtureAudit) -> (Output, Option) { let idp = runtime.block_on(MockIdp::start()); let project = ProjectFixture::write(&database, &idp, audit); - let output = Command::new(env!("CARGO_BIN_EXE_bregctl")) - .env_remove("REGISTRY_STACK_POSTURE") - .args([ - "--format", - "json", - "test", - path(&project.project_root), - "--runtime-config", - path(&project.runtime_config), - "--credentials", - path(&project.credentials), - "--output", - path(&project.receipt), - ]) - .output() - .expect("bregctl test starts in a fresh process"); + let output = project.schema_test(None); let receipt = fs::read(&project.receipt) .ok() @@ -172,7 +242,7 @@ fn run_schema_test(audit: FixtureAudit) -> (Output, Option) { fn assert_command_succeeded(output: &Output) { assert!( output.status.success(), - "bregctl test failed\nstdout: {}\nstderr: {}", + "bregctl failed\nstdout: {}\nstderr: {}", String::from_utf8_lossy(&output.stdout), String::from_utf8_lossy(&output.stderr), ); @@ -187,6 +257,44 @@ struct ProjectFixture { } impl ProjectFixture { + fn schema_test(&self, baseline: Option<&Path>) -> Output { + let mut command = Command::new(env!("CARGO_BIN_EXE_bregctl")); + command.env_remove("REGISTRY_STACK_POSTURE").args([ + "--format", + "json", + "test", + path(&self.project_root), + "--runtime-config", + path(&self.runtime_config), + "--credentials", + path(&self.credentials), + "--output", + path(&self.receipt), + ]); + if let Some(baseline) = baseline { + command.args(["--baseline-package", path(baseline)]); + } + command.output().expect("bregctl test starts") + } + + fn package(&self, build: &Path, baseline: Option<&Path>) -> Output { + let mut command = Command::new(env!("CARGO_BIN_EXE_bregctl")); + command.env_remove("REGISTRY_STACK_POSTURE").args([ + "--format", + "json", + "package", + path(&self.project_root), + "--test-receipt", + path(&self.receipt), + "--output", + path(build), + ]); + if let Some(baseline) = baseline { + command.args(["--baseline-package", path(baseline)]); + } + command.output().expect("bregctl package starts") + } + fn write(database: &TestDatabase, idp: &MockIdp, audit: FixtureAudit) -> Self { let root = tempfile::tempdir().expect("fixture directory creates"); let root_path = root.path().canonicalize().expect("fixture path resolves"); @@ -317,7 +425,7 @@ recordTypes: classification: public fields: - {id: code, type: string, required: true, maximumLength: 32, classification: public} -functions: +actionPlans: fixed-output-plan: runtime: wasm source: handlers/fixed-output.wasm @@ -329,8 +437,8 @@ actions: inputs: - {id: request, type: string, required: true, maximumLength: 32, classification: public} plan: - type: function - function: fixed-output-plan + type: scripted + actionPlan: fixed-output-plan inputs: [request] writes: - id: record diff --git a/crates/registry-caseworkctl/src/provider_add.rs b/crates/registry-caseworkctl/src/provider_add.rs index e94e19ea44..df6c547350 100644 --- a/crates/registry-caseworkctl/src/provider_add.rs +++ b/crates/registry-caseworkctl/src/provider_add.rs @@ -604,7 +604,7 @@ fn used_inputs(action: &Value) -> Vec { .filter_map(|input| input["id"].as_str()) .map(str::to_owned) .collect::>(); - let mut found = strings(&action["plan"]["function"]["boundInputs"]); + let mut found = strings(&action["plan"]["actionPlan"]["boundInputs"]); // Only compiler-owned reference positions name inputs. Literal JSON values // may contain an unrelated member named `input` and must remain opaque. if action["plan"]["type"].as_str() == Some("fixed") { @@ -637,8 +637,8 @@ fn used_inputs(action: &Value) -> Vec { fn write_shapes(action: &Value) -> Vec { let mut writes = BTreeMap::<(String, String), BTreeSet>::new(); - if let Some(function_writes) = action["plan"]["function"]["writes"].as_array() { - for write in function_writes { + if let Some(scripted_writes) = action["plan"]["actionPlan"]["writes"].as_array() { + for write in scripted_writes { let Some(record_type) = write["targetRecordType"].as_str() else { continue; }; @@ -2276,15 +2276,24 @@ exit 1 used_inputs(&fixed), ["expected", "guard-target", "replacement", "target"] ); - let function = json!({ + let scripted = json!({ "inputs":declared, "commitGuards":guards, - "plan":{"type":"function","function":{ + "plan":{"type":"scripted","actionPlan":{ "boundInputs":["target","replacement","unknown"], + "writes":[{"targetRecordType":"facility","operation":"patch","fields":["address-line"]}], "display":{"input":"unused-literal"} }} }); - assert_eq!(used_inputs(&function), used_inputs(&fixed)); + assert_eq!(used_inputs(&scripted), used_inputs(&fixed)); + let writes = write_shapes(&scripted); + assert_eq!(writes.len(), 1); + assert_eq!(writes[0].record_type, "facility"); + assert_eq!(writes[0].operation, "patch"); + assert_eq!( + writes[0].fields, + BTreeSet::from(["address-line".to_owned()]) + ); } #[test] @@ -2386,7 +2395,7 @@ exit 1 {"id":"second-change","apiName":"changes"}, {"id":"generated-collision","apiName":"permitRecordChanges"} ], - "plan":{"function":{"boundInputs":[ + "plan":{"type":"scripted","actionPlan":{"boundInputs":[ "address-line", "first-change", "generated-collision", diff --git a/crates/registry-cli-docs/catalog.json b/crates/registry-cli-docs/catalog.json index 3c837cfc56..48d1e839a0 100644 --- a/crates/registry-cli-docs/catalog.json +++ b/crates/registry-cli-docs/catalog.json @@ -4579,7 +4579,7 @@ { "name": "action-test", "invocation": "bregctl project action-test", - "about": "Test a named Action plan function with bounded synthetic JSON", + "about": "Test a named Action Plan with bounded synthetic JSON", "long_about": null, "usage": "bregctl project action-test [OPTIONS] --input --action ", "arguments": [ @@ -4596,7 +4596,7 @@ "options": [ { "display": "--action ", - "description": "Compiled Action whose named plan function will run; pair with --input", + "description": "Compiled Action whose named Action Plan will run; pair with --input", "always_required": true, "repeatable": false, "default_values": [], @@ -22280,7 +22280,7 @@ "arguments": [ { "display": "[PROJECT]", - "description": "Evidence project directory; the draft is printed when this is absent. This command needs an editable project containing evidence.yaml and its named Function assets.", + "description": "Evidence project directory; the draft is printed when this is absent. This command needs an editable project containing evidence.yaml and its named Derivation assets.", "always_required": false, "repeatable": false, "default_values": [], @@ -22455,7 +22455,7 @@ "options": [ { "display": "--project ", - "description": "Evidence project directory; defaults to the current directory. This command needs an editable project containing evidence.yaml and its named Function assets.", + "description": "Evidence project directory; defaults to the current directory. This command needs an editable project containing evidence.yaml and its named Derivation assets.", "always_required": false, "repeatable": false, "default_values": [ @@ -22539,7 +22539,7 @@ "options": [ { "display": "--project ", - "description": "Evidence project directory; defaults to the current directory. This command needs an editable project containing evidence.yaml and its named Function assets.", + "description": "Evidence project directory; defaults to the current directory. This command needs an editable project containing evidence.yaml and its named Derivation assets.", "always_required": false, "repeatable": false, "default_values": [ @@ -22623,7 +22623,7 @@ "options": [ { "display": "--project ", - "description": "Evidence project directory; defaults to the current directory. This command needs an editable project containing evidence.yaml and its named Function assets.", + "description": "Evidence project directory; defaults to the current directory. This command needs an editable project containing evidence.yaml and its named Derivation assets.", "always_required": false, "repeatable": false, "default_values": [ @@ -22731,7 +22731,7 @@ "arguments": [ { "display": "[PROJECT]", - "description": "Evidence project directory; defaults to the current directory. This command needs an editable project containing evidence.yaml and its named Function assets.", + "description": "Evidence project directory; defaults to the current directory. This command needs an editable project containing evidence.yaml and its named Derivation assets.", "always_required": false, "repeatable": false, "default_values": [], @@ -22804,7 +22804,7 @@ "arguments": [ { "display": "[PROJECT]", - "description": "Evidence project directory; defaults to the current directory. This command needs an editable project containing evidence.yaml and its named Function assets.", + "description": "Evidence project directory; defaults to the current directory. This command needs an editable project containing evidence.yaml and its named Derivation assets.", "always_required": false, "repeatable": false, "default_values": [], @@ -22968,7 +22968,7 @@ "arguments": [ { "display": "[PROJECT]", - "description": "Evidence project directory; defaults to the current directory. This command needs an editable project containing evidence.yaml and its named Function assets.", + "description": "Evidence project directory; defaults to the current directory. This command needs an editable project containing evidence.yaml and its named Derivation assets.", "always_required": false, "repeatable": false, "default_values": [], @@ -23174,7 +23174,7 @@ }, { "display": "[PROJECT]", - "description": "Evidence project directory; defaults to the current directory. This command needs an editable project containing evidence.yaml and its named Function assets.", + "description": "Evidence project directory; defaults to the current directory. This command needs an editable project containing evidence.yaml and its named Derivation assets.", "always_required": false, "repeatable": false, "default_values": [ diff --git a/crates/registry-coordinator/tests/support/breg_service.rs b/crates/registry-coordinator/tests/support/breg_service.rs index 960b9f5294..6ebb639d7c 100644 --- a/crates/registry-coordinator/tests/support/breg_service.rs +++ b/crates/registry-coordinator/tests/support/breg_service.rs @@ -176,11 +176,11 @@ impl Breg { "fields":[{"id":"owner", "type":"string", "required":true, "maximumLength":80, "classification":"internal"}, {"id":"label", "type":"string", "required":true, "minimumLength":1, "maximumLength":80, "classification":"internal"}]}}, "datasets":{"synthetic-items": {}}, - "transforms":{"update-item-plan": {"runtime":"rhai","source":"scripts/update-item.rhai","entrypoint":"plan","abi":"registry.action-plan/v1"}}, + "actionPlans":{"update-item-plan": {"runtime":"rhai","source":"scripts/update-item.rhai","entrypoint":"plan","abi":"registry.action-plan/v1"}}, "actions":{"update-item": { "execution":{"mode":"immediate"}, "inputs":[ {"id":"target", "apiName":"targetId", "type":"reference", "target":"item", "required":true, "classification":"internal"}, {"id":"label", "type":"string", "required":true, "minimumLength":1, "maximumLength":80, "classification":"internal"}], - "plan":{"type":"transform", "transform":"update-item-plan", "inputs":["target","label"], + "plan":{"type":"scripted", "actionPlan":"update-item-plan", "inputs":["target","label"], "refusals":[{"code":"label-not-eligible", "label":"The label is not eligible."}], "writes":[{"id":"item", "target":{"fromInput":"target"}, "operation":"patch", "fields":["label"]}]}}}, "accessProfiles":{ diff --git a/crates/registry-evidence-authoring/src/compile.rs b/crates/registry-evidence-authoring/src/compile.rs index 65a2361eb0..151f9521f3 100644 --- a/crates/registry-evidence-authoring/src/compile.rs +++ b/crates/registry-evidence-authoring/src/compile.rs @@ -67,13 +67,13 @@ pub fn compile_with_pack_routes( let mut functions = Vec::new(); for (function_id, function) in &project.functions { let at = FieldPath::root() - .key("functions") + .key("derivations") .map_key(function_id.to_string()); let Some(script) = scripts.get(&function.source) else { findings.push(Finding::new( at.key("source"), - "function-asset-missing", - "the named Function asset was not supplied", + "derivation-asset-missing", + "the named Derivation asset was not supplied", )); continue; }; @@ -100,7 +100,7 @@ pub fn compile_with_pack_routes( project .functions .get(id) - .expect("validated Function reference") + .expect("validated Derivation reference") }; let mut sources = Map::new(); let mut source_facts = BTreeMap::new(); @@ -576,6 +576,7 @@ pub fn compile_with_pack_routes( .map(|(name, output)| (name.to_string(), output.concept.clone())) .collect(), ); + // This comment is part of the compiled artifact and its digest. let compiled_script = format!( "// Evidence Function {} interface assertion-derive/v1\n{compiled_script}", definition.derive.function @@ -588,7 +589,7 @@ pub fn compile_with_pack_routes( .key("assertionDefinitions") .map_key(id.to_string()) .key("derive") - .key("function"), + .key("derivation"), )?; let mut requirement = json!({"handle":id,"uri":definition.semantics.requirement,"question":definition.question,"kind":definition.semantics.kind,"grantCeiling":definition.grant_ceiling,"representations":definition.representations,"acquisition":definition.acquisition,"purposes":[definition.purpose],"subjectRoles":definition.subjects.iter().map(|subject| json!({"role":subject.role,"cardinality":"one","lookups":subject.selectors})).collect::>(),"referenceFrameworks":definition.semantics.reference_frameworks,"evidenceType":definition.semantics.evidence_type,"observationTimezone":definition.observation_timezone,"validitySeconds":definition.validity_seconds,"subjectBinding":definition.subject_binding,"derivation":{"script":derive_path,"parameters":definition.derive.parameters},"concepts":concepts,"disclosureGuard":definition.disclosure_guard.clone().unwrap_or_else(|| json!({"families":[definition.semantics.requirement]})),"existenceDisclosure":definition.existence_disclosure}); if !definition.derive.selector_inputs.is_empty() { @@ -1289,6 +1290,10 @@ pub fn definition_dependencies(project: &EvidenceProject, id: &str) -> Option) -> Vec { validate_entry_fact_reads(source, "derive", declared) diff --git a/crates/registry-evidence-authoring/src/formats.rs b/crates/registry-evidence-authoring/src/formats.rs index a8573e7600..dd8e59674c 100644 --- a/crates/registry-evidence-authoring/src/formats.rs +++ b/crates/registry-evidence-authoring/src/formats.rs @@ -309,7 +309,7 @@ pub fn finding_action(code: &str) -> &'static str { "acquisition-source" | "source-reference" => "Name a Source declared in this EvidenceProject and preserve the acquisition contract.", "output-type" | "output-bounds" | "output-concept" => "Declare one retained Output type with exactly its required constraints and an absolute concept URI.", "output-schema" | "codelist-asset" | "codelist-identity" => "Supply the reviewed project-relative schema or codelist asset and matching identity/version.", - "function-compile" | "function-signature" | "function-interface" | "function-source" => "Correct the named Function and its declared interface, then check its call sites.", + "derivation-compile" | "derivation-signature" | "derivation-interface" | "derivation-source" => "Correct the named Derivation and its declared interface, then check its call sites.", "derivation-fact-undeclared" => "Read only facts supplied to this definition's derivation by its acquisition plan.", "authority-ceiling" | "authority-definition" => "Declare complete grants using existing definitions and stay within every definition ceiling.", "authority-value-claims" | "authority-claim-path" | "authority-request-claims" => "Match valueClaims exactly to the selected profile for authenticated values, and omit them for request values.", @@ -319,7 +319,7 @@ pub fn finding_action(code: &str) -> &'static str { "public-check-entity-reference-output" => "Remove the entity-reference Outputs from a definition that has publicCheck; a public check has no relying party to scope them to.", "public-check-existence-disclosure" => "Remove existenceDisclosure or set it to collapse-unresolved.", "public-check-code-fact" => "Name a string fact the Source's facts schema declares, and keep it out of the Source's inputs.", - "public-check-facts-content" => "Keep only `type` on each fact and remove the required list, then check content in the derive Function. For a BReg Source, export it again with `bregctl generate evidence-source --public-check`.", + "public-check-facts-content" => "Keep only `type` on each fact and remove the required list, then check content in the Derivation. For a BReg Source, export it again with `bregctl generate evidence-source --public-check`.", "authority-public-check" => "Activate a definition that exists in the project and declares publicCheck.", "selector-field-bounds" => "Declare the closed selector field type and its required bounds or codelist reference.", "kebab-case" | "date-time" | "x-evidencectl-mock" | "x-evidencectl-recursive-ref" => "Correct the inspected OpenAPI description as the message describes.", diff --git a/crates/registry-evidence-authoring/src/project.rs b/crates/registry-evidence-authoring/src/project.rs index d04d024f05..e7eef8b831 100644 --- a/crates/registry-evidence-authoring/src/project.rs +++ b/crates/registry-evidence-authoring/src/project.rs @@ -38,6 +38,14 @@ pub const PROJECT: FormatSpec<'static> = FormatSpec { pointer: "/description", replacement: "Move description to project.description.", }, + RemovedKey { + pointer: "/functions", + replacement: "Rename functions to derivations.", + }, + RemovedKey { + pointer: "/assertionDefinitions/*/derive/function", + replacement: "Rename derive.function to derive.derivation.", + }, ], }; @@ -53,6 +61,7 @@ pub struct EvidenceProject { pub project: ProjectIdentity, #[serde(rename = "lookups")] pub selector_profiles: BTreeMap, + #[serde(rename = "derivations")] pub functions: BTreeMap, pub sources: BTreeMap, pub assertion_definitions: BTreeMap, @@ -93,6 +102,7 @@ pub struct SelectorProfile { #[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[cfg_attr(feature = "schema", schemars(rename = "Derivation"))] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Function { /// Optional presentation label. Stable references use the identifier. @@ -123,6 +133,7 @@ pub struct Function { #[derive(Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq, Hash)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[cfg_attr(feature = "schema", schemars(rename = "DerivationInterface"))] pub enum FunctionInterface { #[serde(rename = "assertion-derive/v1")] AssertionDerive, @@ -159,11 +170,13 @@ pub struct SelectorAlternative { #[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[cfg_attr(feature = "schema", schemars(rename = "DerivationCall"))] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FunctionCall { + #[serde(rename = "derivation")] pub function: LocalId, #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] - #[cfg_attr(feature = "schema", schemars(extend("x-registry-passthrough" = "Literal reviewed Function parameter bindings, checked at the named Function call site.")))] + #[cfg_attr(feature = "schema", schemars(extend("x-registry-passthrough" = "Literal reviewed Derivation parameter bindings, checked at the named Derivation call site.")))] pub parameters: BTreeMap, #[serde(default, skip_serializing_if = "Vec::is_empty")] pub selector_inputs: Vec, @@ -622,7 +635,7 @@ pub struct SourceInputSelector { } const RETIRED_ACQUISITION_CODE: &str = "evidence.project.source-acquisition-retired"; -const RETIRED_ACQUISITION_ACTION: &str = "Move preparation and extraction into a reviewed Adapter pack, retain assertion-derive/v1 Functions, and replace the Source with pack, route, connection and inputs. Import current exports with evidencectl source import EXPORT --project PROJECT; it does not convert retired projects. See https://docs.registrystack.org/products/registry-evidence/authoring-form/#migrate-a-retired-source-project."; +const RETIRED_ACQUISITION_ACTION: &str = "Move preparation and extraction into a reviewed Adapter pack, retain assertion-derive/v1 Derivations, and replace the Source with pack, route, connection and inputs. Import current exports with evidencectl source import EXPORT --project PROJECT; it does not convert retired projects. See https://docs.registrystack.org/products/registry-evidence/authoring-form/#migrate-a-retired-source-project."; const RETIRED_ACQUISITION_AGAIN: &str = "Migrate this site with the rest of the project, as the first evidence.project.source-acquisition-retired diagnostic describes."; /// Project-specific scalar refusals reuse the shared authored-file rules and @@ -641,7 +654,7 @@ impl ScalarHook for ProjectScalars { fn value(&mut self, site: &ScalarSite<'_>) -> Result, Refusal> { self.authored.value(site)?; - let message = if matches!(site.keys, ["functions", _, "interface"]) + let message = if matches!(site.keys, ["functions" | "derivations", _, "interface"]) && matches!(site.text, "source-prepare/v1" | "source-extract/v1") { Some("The source-prepare/v1 and source-extract/v1 interfaces are retired; reviewed Adapter pack routes own source acquisition.") @@ -735,9 +748,9 @@ fn project_id_namespaces(project: &EvidenceProject) -> Vec) -> Vec< .collect::>(), ), ( - "evidence.project.duplicate-function-label", - "functions", + "evidence.project.duplicate-derivation-label", + "derivations", project .functions .iter() .filter_map(|(id, item)| { item.label.as_ref().map(|label| { let pointer = format!( - "/functions/{}/label", + "/derivations/{}/label", registry_platform_yaml::escape_pointer_segment(id.as_str()) ); (id.as_str().to_owned(), label.clone(), pointer) @@ -1035,11 +1048,11 @@ fn validate_project_without_id_collisions(project: &EvidenceProject) -> Vec Vec MAX_OUTPUTS_PER_ASSERTION { @@ -1595,7 +1608,7 @@ fn validate_project_display_text(project: &EvidenceProject) -> Vec { validate_presentation( function.label.as_deref(), function.description.as_deref(), - &FieldPath::root().key("functions").map_key(id.to_string()), + &FieldPath::root().key("derivations").map_key(id.to_string()), &mut findings, ); } diff --git a/crates/registry-evidence-authoring/src/types.rs b/crates/registry-evidence-authoring/src/types.rs index 0b8e24ef8f..4aa6c743a4 100644 --- a/crates/registry-evidence-authoring/src/types.rs +++ b/crates/registry-evidence-authoring/src/types.rs @@ -473,11 +473,11 @@ pub fn typescript(project: &EvidenceProject, compiled: &CompiledProject) -> Stri } result.push_str("}\n"); } - result.push_str("export interface FunctionBindings {\n"); + result.push_str("export interface DerivationBindings {\n"); for (function_id, function) in &project.functions { let shape = function_shape(project, compiled, function_id, function); result.push_str(&format!( - " // evidence-function: {}\n {}: {};\n", + " // evidence-derivation: {}\n {}: {};\n", function_id, json!(function_id), ts(&shape, &shape, 0) @@ -556,13 +556,13 @@ pub fn python(project: &EvidenceProject, compiled: &CompiledProject) -> String { for (function_id, function) in &project.functions { let shape = function_shape(project, compiled, function_id, function); let name = renderer.shape(&shape, &shape, 0); - result.push_str(&format!("# evidence-function: {}\n", function_id)); + result.push_str(&format!("# evidence-derivation: {}\n", function_id)); result.push_str(&renderer.definitions); renderer.definitions.clear(); entries.push(format!(" {}: {name},\n", json!(function_id))); } result.push_str(&format!( - "FunctionBindings = TypedDict(\"FunctionBindings\", {{\n{}}})\n", + "DerivationBindings = TypedDict(\"DerivationBindings\", {{\n{}}})\n", entries.join("") )); result.push_str("ASSERTION_DEFINITIONS: dict[str, str] = {\n"); diff --git a/crates/registry-evidence-authoring/tests/acquisition_validation.rs b/crates/registry-evidence-authoring/tests/acquisition_validation.rs index 26c13ad56f..9908c98ad7 100644 --- a/crates/registry-evidence-authoring/tests/acquisition_validation.rs +++ b/crates/registry-evidence-authoring/tests/acquisition_validation.rs @@ -10,7 +10,7 @@ fn project_value() -> Value { "fields": {"person-id": {"type": "string", "minimumBytes": 1, "maximumBytes": 64}} } }, - "functions": { + "derivations": { "extract": {"interface": "source-extract/v1", "source": "functions/extract.rhai"}, "derive": {"interface": "assertion-derive/v1", "source": "functions/derive.rhai"} }, @@ -42,7 +42,7 @@ fn project_value() -> Value { "grantCeiling": {"authorities": ["organizational"], "actorKinds": ["service"], "valueOrigins": ["request"], "audiences": ["urn:example:audience"]}, "subjects": [{"role": "person", "selectors": ["person-by-id"]}], "acquisition": {"type": "single", "source": "search"}, - "derive": {"function": "derive"}, + "derive": {"derivation": "derive"}, "outputs": {"active": {"concept": "urn:example:active", "type": "boolean"}}, "validitySeconds": 300, "subjectBinding": "audience-scoped", diff --git a/crates/registry-evidence-authoring/tests/authoring_schema.rs b/crates/registry-evidence-authoring/tests/authoring_schema.rs index dbe1488919..7c4a7f4943 100644 --- a/crates/registry-evidence-authoring/tests/authoring_schema.rs +++ b/crates/registry-evidence-authoring/tests/authoring_schema.rs @@ -465,7 +465,7 @@ fn the_project_schema_closes_its_shape_and_requires_the_normalized_keys() { "kind", "project", "lookups", - "functions", + "derivations", "sources", "assertionDefinitions", ] { @@ -486,6 +486,12 @@ fn the_project_schema_closes_its_shape_and_requires_the_normalized_keys() { fn the_project_schema_exposes_pack_bindings_and_derivation_contracts() { let documents = documents().expect("the authoring schemas generate"); let document = &documents[PROJECT_SCHEMA_FILE]; + let value: Value = serde_json::from_str(document).expect("the project schema is JSON"); + assert!(value["properties"].get("functions").is_none()); + let call = &value["$defs"]["DerivationCall"]; + assert_eq!(call["required"], serde_json::json!(["derivation"])); + assert!(call["properties"].get("function").is_none()); + assert!(value["$defs"]["Derivation"].is_object()); for member in [ "assertionDefinitions", "lookups", @@ -1244,10 +1250,10 @@ fn project_check_refuses_separator_lookalikes_in_the_selector_profile_namespace( fn project_check_bounds_mixed_semantic_errors_and_duplicate_label_warnings_once() { let mut document = yaml_as_json(NORMALIZED_PROJECT); document["lookups"]["record-by-id"]["maximumAggregateBytes"] = serde_json::json!(32); - let template = document["functions"]["derive-adult-status"].clone(); - let functions = document["functions"] + let template = document["derivations"]["derive-adult-status"].clone(); + let functions = document["derivations"] .as_object_mut() - .expect("the canonical functions are a map"); + .expect("the canonical derivations are a map"); for index in 0..=MAXIMUM_DIAGNOSTICS_PER_FILE { let mut function = template.clone(); function["label"] = serde_json::json!("Repeated function label"); @@ -1268,7 +1274,7 @@ fn project_check_bounds_mixed_semantic_errors_and_duplicate_label_warnings_once( assert!(report .diagnostics() .iter() - .any(|diagnostic| diagnostic.code == "evidence.project.duplicate-function-label")); + .any(|diagnostic| diagnostic.code == "evidence.project.duplicate-derivation-label")); let marker = report .diagnostics() .iter() @@ -1311,8 +1317,8 @@ fn source_function_refs_are_closed_while_derivation_calls_expose_bindings() { .is_err()); let document = NORMALIZED_PROJECT.replacen( - "derive:\n function: derive-adult-status", - "derive:\n function: derive-adult-status\n parameters:\n threshold: 18\n selectorInputs: []", + "derive:\n derivation: derive-adult-status", + "derive:\n derivation: derive-adult-status\n parameters:\n threshold: 18\n selectorInputs: []", 1, ); assert!(schema(PROJECT_SCHEMA_FILE).is_valid(&yaml_as_json(&document))); diff --git a/crates/registry-evidence-authoring/tests/compiled_names.rs b/crates/registry-evidence-authoring/tests/compiled_names.rs index 6a66eb0e04..a4df55ec5f 100644 --- a/crates/registry-evidence-authoring/tests/compiled_names.rs +++ b/crates/registry-evidence-authoring/tests/compiled_names.rs @@ -18,7 +18,7 @@ fn normalized_document() -> Value { } } }, - "functions": { + "derivations": { "derive-adult-status": { "interface": "assertion-derive/v1", "source": "functions/derive.rhai" @@ -55,7 +55,7 @@ fn normalized_document() -> Value { }, "subjects": [{"role": "person", "selectors": ["record-by-id"]}], "acquisition": {"source": "person-record"}, - "derive": {"function": "derive-adult-status"}, + "derive": {"derivation": "derive-adult-status"}, "outputs": { "adult": {"concept": "urn:example:concept:adult", "type": "boolean"} }, @@ -100,15 +100,15 @@ fn function_id_and_presentation_label_are_separate() { "interface": "assertion-derive/v1", "source": "functions/unused-derive.rhai" }); - let functions = document["functions"].as_object_mut().unwrap(); + let functions = document["derivations"].as_object_mut().unwrap(); functions.insert("a".repeat(64), function.clone()); assert!(read_normalized(&document).is_ok()); - let functions = document["functions"].as_object_mut().unwrap(); + let functions = document["derivations"].as_object_mut().unwrap(); functions.remove(&"a".repeat(64)); functions.insert("a".repeat(65), function); let diagnostic = normalized_refusal(&document); - assert_eq!(diagnostic.path, format!("/functions/{}", "a".repeat(65))); + assert_eq!(diagnostic.path, format!("/derivations/{}", "a".repeat(65))); } #[test] diff --git a/crates/registry-evidence-authoring/tests/derivation_depth.rs b/crates/registry-evidence-authoring/tests/derivation_depth.rs index ef0b469f07..c273f8027b 100644 --- a/crates/registry-evidence-authoring/tests/derivation_depth.rs +++ b/crates/registry-evidence-authoring/tests/derivation_depth.rs @@ -36,7 +36,7 @@ fn assert_compiles(source: &str) { fn assert_depth_refused(source: &str) { let findings = validate_function(source, FunctionInterface::AssertionDerive); assert_eq!(findings.len(), 1); - assert_eq!(findings[0].code, "function-compile"); + assert_eq!(findings[0].code, "derivation-compile"); } #[test] diff --git a/crates/registry-evidence-authoring/tests/finding_messages.rs b/crates/registry-evidence-authoring/tests/finding_messages.rs index 4a4f3b280f..d9357770af 100644 --- a/crates/registry-evidence-authoring/tests/finding_messages.rs +++ b/crates/registry-evidence-authoring/tests/finding_messages.rs @@ -116,10 +116,10 @@ fn normalized_function_rule_reports_its_exact_sentence() { ); assert_case( "Function signature", - "Function must expose exactly one entry point with its declared interface signature", + "Derivation must expose exactly one entry point with its declared interface signature", &findings, ); - assert_eq!(first(&findings).code, "function-signature"); + assert_eq!(first(&findings).code, "derivation-signature"); } #[test] @@ -194,8 +194,8 @@ fn normalized_rule_codes_remain_machine_addressable() { "definition-count", "definition-question", "derive-selector-profile", - "function-interface", - "function-source", + "derivation-interface", + "derivation-source", "output-bounds", "output-concept", "output-type", @@ -510,12 +510,12 @@ fn normalized_references_report_the_retained_derivation_interface() { project.functions.clear(); }); assert!(findings.iter().any(|finding| { - finding.code == "function-interface" - && finding.message == "derive must name an assertion-derive/v1 Function" + finding.code == "derivation-interface" + && finding.message == "derive must name an assertion-derive/v1 Derivation" && finding .field .to_json_pointer() - .ends_with("/derive/function") + .ends_with("/derive/derivation") })); } @@ -534,9 +534,9 @@ fn normalized_project_and_semantic_diagnostics_keep_exact_sites() { }); assert_normalized_finding( &findings, - "function-source", - "/functions/derive-adult-status/source", - "name one project-relative .rhai function asset without traversal", + "derivation-source", + "/derivations/derive-adult-status/source", + "name one project-relative .rhai Derivation asset without traversal", ); let findings = normalized_findings(|project| { @@ -785,10 +785,10 @@ fn named_function_abi_reports_compile_signature_and_interface_failures() { let compile = validate_function("fn derive(", project::FunctionInterface::AssertionDerive); assert_case( "Function compile", - "Function does not compile as Rhai", + "Derivation does not compile as Rhai", &compile, ); - assert_eq!(first(&compile).code, "function-compile"); + assert_eq!(first(&compile).code, "derivation-compile"); let signature = validate_function( "fn derive(facts, selectors) { #{} }", @@ -796,10 +796,10 @@ fn named_function_abi_reports_compile_signature_and_interface_failures() { ); assert_case( "Function signature", - "Function must expose exactly one entry point with its declared interface signature", + "Derivation must expose exactly one entry point with its declared interface signature", &signature, ); - assert_eq!(first(&signature).code, "function-signature"); + assert_eq!(first(&signature).code, "derivation-signature"); let interface = validate_function( "fn derive(facts, selectors, context) { #{} } fn extract(response, context) { #{} }", @@ -807,10 +807,10 @@ fn named_function_abi_reports_compile_signature_and_interface_failures() { ); assert_case( "Function interface", - "Function cannot expose another interface entry point", + "Derivation cannot expose another interface entry point", &interface, ); - assert_eq!(first(&interface).code, "function-interface"); + assert_eq!(first(&interface).code, "derivation-interface"); assert!(validate_function( "fn derive(facts, selectors, context) { #{} }", diff --git a/crates/registry-evidence-authoring/tests/formats_readers.rs b/crates/registry-evidence-authoring/tests/formats_readers.rs index 0678ce179c..abf30703e4 100644 --- a/crates/registry-evidence-authoring/tests/formats_readers.rs +++ b/crates/registry-evidence-authoring/tests/formats_readers.rs @@ -86,6 +86,65 @@ fn project_lookup_spelling_is_closed() { assert_eq!((source.line, source.column), (Some(6), Some(1))); } +#[test] +fn derivation_keys_are_canonical_and_retired_spellings_name_their_replacements() { + let current = PROJECT_TEXT; + let decoded = project::read_project("evidence.yaml", current.as_bytes()) + .expect("the canonical derivation fields read"); + let serialized = serde_json::to_value(decoded.value).unwrap(); + assert!(serialized["derivations"]["derive-adult-status"].is_object()); + assert!(serialized.get("functions").is_none()); + let derive = &serialized["assertionDefinitions"]["adult-status"]["derive"]; + assert_eq!(derive["derivation"], "derive-adult-status"); + assert!(derive.get("function").is_none()); + + let cases = [ + ( + "derivations:\n", + "functions:\n", + "/functions", + "derivations", + 1, + ), + ( + "derivations:\n", + "functions: {}\nderivations:\n", + "/functions", + "derivations", + 1, + ), + ( + " derivation: derive-adult-status\n", + " function: derive-adult-status\n", + "/assertionDefinitions/adult-status/derive/function", + "derive.derivation", + 7, + ), + ( + " derivation: derive-adult-status\n", + " function: derive-adult-status\n derivation: derive-adult-status\n", + "/assertionDefinitions/adult-status/derive/function", + "derive.derivation", + 7, + ), + ]; + for (spelling, retired, path, replacement, column) in cases { + let authored = current.replacen(spelling, retired, 1); + assert_ne!(authored, current); + let report = project::read_project("evidence.yaml", authored.as_bytes()) + .expect_err("the obsolete key is refused"); + let diagnostic = report + .diagnostics() + .iter() + .find(|diagnostic| diagnostic.code == "config.removed-key" && diagnostic.path == path) + .expect("the retired key is diagnosed at its own path"); + assert!(diagnostic.suggested_action.contains(replacement)); + let source = diagnostic.source.as_ref().expect("a source position"); + assert_eq!(source.column, Some(column)); + assert!(source.line.is_some()); + } +} + #[test] fn authority_lookup_spelling_is_closed() { let project = project::read_project("evidence.yaml", PROJECT_TEXT.as_bytes()) @@ -168,7 +227,7 @@ fn functions_are_keyed_by_their_id_and_carry_no_inner_id() { assert!( report.diagnostics().iter().any(|diagnostic| { diagnostic.code == "config.unknown-key" - && diagnostic.path == "/functions/derive-adult-status/id" + && diagnostic.path == "/derivations/derive-adult-status/id" }), "{:?}", report.diagnostics() @@ -188,7 +247,7 @@ fn a_function_id_written_twice_is_refused_at_the_second_key() { assert!( report.diagnostics().iter().any(|diagnostic| { diagnostic.code == "yaml.duplicate-key" - && diagnostic.path == "/functions/derive-adult-status" + && diagnostic.path == "/derivations/derive-adult-status" }), "{:?}", report.diagnostics() @@ -356,8 +415,8 @@ fn finding_codes_name_their_area_once() { "evidence.authority.definition" ); assert_eq!( - finding_code("function", "function-compile"), - "evidence.function.compile" + finding_code("derivation", "derivation-compile"), + "evidence.derivation.compile" ); assert_eq!( finding_code("schema", "evidence.output-schema.open-object"), diff --git a/crates/registry-evidence-authoring/tests/normalized_project.rs b/crates/registry-evidence-authoring/tests/normalized_project.rs index 1383a03255..7925132970 100644 --- a/crates/registry-evidence-authoring/tests/normalized_project.rs +++ b/crates/registry-evidence-authoring/tests/normalized_project.rs @@ -11,9 +11,9 @@ use std::collections::BTreeMap; fn project() -> project::EvidenceProject { serde_json::from_value(json!({ "project":{"id":"synthetic-evidence","version":"1"}, "lookups":{"person-by-id":{"maximumAggregateBytes":64,"fields":{"person-id":{"type":"string","minimumBytes":1,"maximumBytes":64}}}}, - "functions":{"derive-status":{"interface":"assertion-derive/v1","source":"functions/derive.rhai"}}, + "derivations":{"derive-status":{"interface":"assertion-derive/v1","source":"functions/derive.rhai"}}, "sources":{"person":{"pack":{"id":"synthetic-register","version":"0.1.0"},"route":"evidence-person","connection":"population","inputs":{"personId":{"selector":{"role":"person","profile":"person-by-id","field":"person-id"}}},"acquisitionPosture":"record-transformed"}}, - "assertionDefinitions":{"active-status":{"question":"Is the person active?","semantics":{"requirement":"urn:example:requirement:active","kind":"criterion","evidenceType":"urn:example:evidence:active","referenceFrameworks":["urn:example:framework:status"]},"purpose":"status-verification","grantCeiling":{"authorities":["organizational"],"actorKinds":["service"],"valueOrigins":["request"],"audiences":["urn:example:audience:consumer"]},"subjects":[{"role":"person","selectors":["person-by-id"]}],"acquisition":{"source":"person"},"derive":{"function":"derive-status"},"outputs":{"active":{"concept":"urn:example:concept:active","type":"boolean"}},"validitySeconds":300,"subjectBinding":"audience-scoped","representations":["signed-jws"]}} + "assertionDefinitions":{"active-status":{"question":"Is the person active?","semantics":{"requirement":"urn:example:requirement:active","kind":"criterion","evidenceType":"urn:example:evidence:active","referenceFrameworks":["urn:example:framework:status"]},"purpose":"status-verification","grantCeiling":{"authorities":["organizational"],"actorKinds":["service"],"valueOrigins":["request"],"audiences":["urn:example:audience:consumer"]},"subjects":[{"role":"person","selectors":["person-by-id"]}],"acquisition":{"source":"person"},"derive":{"derivation":"derive-status"},"outputs":{"active":{"concept":"urn:example:concept:active","type":"boolean"}},"validitySeconds":300,"subjectBinding":"audience-scoped","representations":["signed-jws"]}} })).unwrap() } fn scripts() -> BTreeMap { @@ -96,6 +96,9 @@ fn normalized_project_compiles_sources_outputs_and_named_functions() { ); let script = String::from_utf8(compiled.artifacts["derivations/active-status.rhai"].clone()).unwrap(); + assert!( + script.starts_with("// Evidence Function derive-status interface assertion-derive/v1\n") + ); assert!(script.contains("fn authored_derive")); assert!(!script.contains("canary")); assert_eq!( @@ -185,9 +188,12 @@ fn constructed_presentation_fields_share_display_text_validation() { *label = Some(value.to_owned()); }, ), - ("/functions/derive-status/description", |project, value| { - project.functions.values_mut().next().unwrap().description = Some(value.to_owned()); - }), + ( + "/derivations/derive-status/description", + |project, value| { + project.functions.values_mut().next().unwrap().description = Some(value.to_owned()); + }, + ), ( "/assertionDefinitions/active-status/label", |project, value| { @@ -287,6 +293,9 @@ fn old_question_envelope_inline_source_and_disclosure_allow_are_rejected() { fn question_presentation_does_not_change_definition_dependencies() { let project = project(); let before = compile::definition_dependencies(&project, "active-status").unwrap(); + assert_eq!(before["definition"]["derive"]["function"], "derive-status"); + assert!(before["definition"]["derive"].get("derivation").is_none()); + assert_eq!(before["functions"][0]["id"], "derive-status"); let mut after = project.clone(); after .assertion_definitions @@ -495,7 +504,7 @@ fn missing_named_dependencies_have_exact_field_paths() { assert!(findings .iter() .any(|finding| finding.field.to_json_pointer() - == "/assertionDefinitions/active-status/derive/function")); + == "/assertionDefinitions/active-status/derive/derivation")); } #[test] @@ -570,7 +579,7 @@ fn presentation_metadata_does_not_change_compiled_semantics_or_behavior_dependen edited["project"]["description"] = json!("Explains the project"); edited["project"]["version"] = json!("2"); edited["sources"]["person"]["description"] = json!("Reviewed source explanation"); - edited["functions"]["derive-status"]["label"] = json!("Extract a person"); + edited["derivations"]["derive-status"]["label"] = json!("Extract a person"); edited["lookups"]["person-by-id"]["label"] = json!("Person identifier"); edited["assertionDefinitions"]["active-status"]["description"] = json!("Presentation only"); edited["assertionDefinitions"]["active-status"]["outputs"]["active"]["label"] = json!("Active"); @@ -628,7 +637,7 @@ fn retired_source_batch_and_acquisition_capability_wire_is_refused() { #[test] fn colliding_local_ids_retain_distinct_artifacts_and_deterministic_output() { let mut value = serde_json::to_value(project()).unwrap(); - value["functions"]["derive-extra"] = + value["derivations"]["derive-extra"] = json!({"interface":"assertion-derive/v1","source":"functions/derive-extra.rhai"}); value["assertionDefinitions"]["active-status"]["outputs"] = json!({ "active-extra":{ @@ -639,7 +648,7 @@ fn colliding_local_ids_retain_distinct_artifacts_and_deterministic_output() { }); let mut second_definition = value["assertionDefinitions"]["active-status"].clone(); second_definition["semantics"]["requirement"] = json!("urn:example:requirement:second"); - second_definition["derive"]["function"] = json!("derive-extra"); + second_definition["derive"]["derivation"] = json!("derive-extra"); second_definition["outputs"] = json!({ "extra":{ "concept":"urn:example:concept:second", @@ -768,7 +777,9 @@ fn generated_types_resolve_structured_schemas_and_exact_function_result_shapes() < ts.find("export interface AssertionOutputs").unwrap() ); let py = project::python(&project, &compiled); - assert!(py.contains("SourceFacts = TypedDict") && py.contains("FunctionBindings = TypedDict")); + assert!( + py.contains("SourceFacts = TypedDict") && py.contains("DerivationBindings = TypedDict") + ); assert!(py.contains("NotRequired[Literal[\"current\", \"expired\"]]")); assert!(py.contains("\"output\": Literal[\"details\"]")); let mut child=std::process::Command::new("python3").args(["-c","import ast,sys; source=sys.stdin.read(); ast.parse(source); exec(compile(source,'generated-evidence-types','exec'), {})"]).stdin(std::process::Stdio::piped()).stderr(std::process::Stdio::piped()).spawn().expect("python3 syntax checker"); @@ -797,7 +808,7 @@ fn checked_pack_facts_replace_retired_search_then_fetch_fact_closure() { value["sources"]["fetch"] = value["sources"]["person"].clone(); value["sources"]["person"]["facts"] = json!({"search_only":{"type":"boolean"}}); value["sources"]["fetch"]["facts"] = json!({"active":{"type":"boolean"}}); - value["functions"]["extract-fetch"] = + value["derivations"]["extract-fetch"] = json!({"interface":"source-extract/v1","source":"functions/fetch.rhai"}); value["sources"]["fetch"]["extract"] = json!({"function":"extract-fetch"}); value["assertionDefinitions"]["active-status"]["acquisition"] = @@ -907,7 +918,7 @@ fn retired_reused_source_functions_and_prior_fact_contexts_are_refused() { value["sources"]["search"] = value["sources"]["person"].clone(); value["sources"]["search"]["facts"] = json!({"reference":{"type":"string","maximumBytes":64}}); value["sources"]["search"]["extract"] = json!({"function":"extract-search"}); - value["functions"]["extract-search"] = + value["derivations"]["extract-search"] = json!({"interface":"source-extract/v1","source":"functions/search.rhai"}); value["assertionDefinitions"]["from-search"] = value["assertionDefinitions"]["active-status"].clone(); diff --git a/crates/registry-evidence-authoring/tests/pack_sources.rs b/crates/registry-evidence-authoring/tests/pack_sources.rs index ec3c059b03..b7b3630bd4 100644 --- a/crates/registry-evidence-authoring/tests/pack_sources.rs +++ b/crates/registry-evidence-authoring/tests/pack_sources.rs @@ -60,9 +60,9 @@ fn project() -> project::EvidenceProject { serde_json::from_value(json!({ "project":{"id":"family-evidence","version":"1"}, "lookups":{"person-by-id":{"maximumAggregateBytes":64,"fields":{"person-id":{"type":"string","minimumBytes":1,"maximumBytes":64}}}}, - "functions":{"derive-family":{"interface":"assertion-derive/v1","source":"functions/derive.rhai"}}, + "derivations":{"derive-family":{"interface":"assertion-derive/v1","source":"functions/derive.rhai"}}, "sources":{"family":{"pack":{"id":"synthetic-register","version":"0.1.0"},"route":"evidence-family","connection":"register","inputs":{"personId":{"selector":{"role":"person","profile":"person-by-id","field":"person-id"}}},"acquisitionPosture":"record-transformed"}}, - "assertionDefinitions":{"family-status":{"question":"Does the family record match?","semantics":{"requirement":"urn:example:requirement:family","kind":"criterion","evidenceType":"urn:example:evidence:family","referenceFrameworks":["urn:example:framework:family"]},"purpose":"family-check","grantCeiling":{"authorities":["organizational"],"actorKinds":["service"],"valueOrigins":["request"],"audiences":["urn:example:audience:consumer"]},"subjects":[{"role":"person","selectors":["person-by-id"]}],"acquisition":{"source":"family"},"derive":{"function":"derive-family"},"outputs":{"matched":{"concept":"urn:example:concept:matched","type":"boolean"}},"validitySeconds":300,"subjectBinding":"audience-scoped","representations":["signed-jws"]}} + "assertionDefinitions":{"family-status":{"question":"Does the family record match?","semantics":{"requirement":"urn:example:requirement:family","kind":"criterion","evidenceType":"urn:example:evidence:family","referenceFrameworks":["urn:example:framework:family"]},"purpose":"family-check","grantCeiling":{"authorities":["organizational"],"actorKinds":["service"],"valueOrigins":["request"],"audiences":["urn:example:audience:consumer"]},"subjects":[{"role":"person","selectors":["person-by-id"]}],"acquisition":{"source":"family"},"derive":{"derivation":"derive-family"},"outputs":{"matched":{"concept":"urn:example:concept:matched","type":"boolean"}},"validitySeconds":300,"subjectBinding":"audience-scoped","representations":["signed-jws"]}} })).expect("pack-source project") } diff --git a/crates/registry-evidence-authoring/tests/public_check.rs b/crates/registry-evidence-authoring/tests/public_check.rs index 23d3cb31b6..31b630948d 100644 --- a/crates/registry-evidence-authoring/tests/public_check.rs +++ b/crates/registry-evidence-authoring/tests/public_check.rs @@ -17,7 +17,7 @@ fn project_value() -> Value { json!({ "project": {"id": "certificate-check", "version": "1"}, "lookups": {"certificate-number": {"maximumAggregateBytes": 32, "fields": {"number": {"type": "string", "minimumBytes": 4, "maximumBytes": 32}}}}, - "functions": {"derive-certificate-check": {"interface": "assertion-derive/v1", "source": "functions/derive.rhai"}}, + "derivations": {"derive-certificate-check": {"interface": "assertion-derive/v1", "source": "functions/derive.rhai"}}, "sources": {"certificate-record": {"pack": {"id": "synthetic-register", "version": "1"}, "route": "certificate", "connection": "synthetic-register", "inputs": {"recordId": {"selector": {"role": "certificate", "profile": "certificate-number", "field": "number"}}}, "acquisitionPosture": "record-transformed"}}, "assertionDefinitions": {DEFINITION: { "question": "What is the current status of this certificate?", @@ -26,7 +26,7 @@ fn project_value() -> Value { "grantCeiling": {"authorities": ["organizational"], "actorKinds": ["service"], "valueOrigins": ["request"], "audiences": ["urn:example:audience:portal"]}, "subjects": [{"role": "certificate", "selectors": ["certificate-number"]}], "acquisition": {"source": "certificate-record"}, - "derive": {"function": "derive-certificate-check"}, + "derive": {"derivation": "derive-certificate-check"}, "outputs": { "status": {"concept": "urn:example:concept:certificate-status:v1", "type": "controlled-category", "values": ["valid", "suspended", "revoked", "expired"]}, "printed": {"concept": "urn:example:concept:certificate-printed:v1", "type": "reviewed-structured-value", "schema": "schemas/printed.json", "maximumSerializedBytes": 1024} diff --git a/crates/registry-evidence-authoring/tests/retired_source_diagnostics.rs b/crates/registry-evidence-authoring/tests/retired_source_diagnostics.rs index bc916d6dd7..5aeeaca043 100644 --- a/crates/registry-evidence-authoring/tests/retired_source_diagnostics.rs +++ b/crates/registry-evidence-authoring/tests/retired_source_diagnostics.rs @@ -22,7 +22,7 @@ fn retired_acquisition_functions_name_the_pack_migration_instead_of_a_derivation let diagnostic = report .diagnostics() .iter() - .find(|diagnostic| diagnostic.path == "/functions/derive-adult-status/interface") + .find(|diagnostic| diagnostic.path == "/derivations/derive-adult-status/interface") .expect("the exact retired function interface is addressed"); assert_eq!(diagnostic.code, RETIRED_CODE); assert!(diagnostic.message.contains("retired")); diff --git a/crates/registry-evidence/src/normalized_tests.rs b/crates/registry-evidence/src/normalized_tests.rs index a28b34e462..00aebe654a 100644 --- a/crates/registry-evidence/src/normalized_tests.rs +++ b/crates/registry-evidence/src/normalized_tests.rs @@ -1322,7 +1322,7 @@ fn normalized_project() -> EvidenceProject { "fields": {"record-id": {"type": "string", "minimumBytes": 1, "maximumBytes": 64}} } }, - "functions": { + "derivations": { "derive-active": {"interface": "assertion-derive/v1", "source": "functions/derive.rhai"}, "derive-classic": {"interface": "assertion-derive/v1", "source": "functions/derive-classic.rhai"}, "derive-members": {"interface": "assertion-derive/v1", "source": "functions/derive-members.rhai"} @@ -1408,7 +1408,7 @@ fn normalized_project() -> EvidenceProject { ["signed-jws"], ); classic["acquisition"] = json!({"source": "classic"}); - classic["derive"] = json!({"function": "derive-classic"}); + classic["derive"] = json!({"derivation": "derive-classic"}); document["assertionDefinitions"]["classic"] = classic; let mut fetch_set = definition( REQUIREMENT_SET, @@ -1419,7 +1419,7 @@ fn normalized_project() -> EvidenceProject { ["signed-jws"], ); fetch_set["acquisition"] = json!({"source": "members"}); - fetch_set["derive"] = json!({"function": "derive-members"}); + fetch_set["derive"] = json!({"derivation": "derive-members"}); document["assertionDefinitions"]["fetch-set"] = fetch_set; serde_json::from_value(document).expect("normalized project is structurally valid") } @@ -1714,7 +1714,7 @@ fn definition( }, "subjects": [{"role": "subject", "selectors": ["record-by-id"]}], "acquisition": {"source": "records"}, - "derive": {"function": "derive-active"}, + "derive": {"derivation": "derive-active"}, "outputs": {"active": {"concept": format!("urn:example:normalized:concept:active:{}", purpose.trim_end_matches("-check")), "type": "boolean"}}, "validitySeconds": 300, "subjectBinding": binding, diff --git a/crates/registry-evidence/src/public_check_tests.rs b/crates/registry-evidence/src/public_check_tests.rs index ea2bc0cb7b..c0d2b69a27 100644 --- a/crates/registry-evidence/src/public_check_tests.rs +++ b/crates/registry-evidence/src/public_check_tests.rs @@ -372,7 +372,7 @@ fn certificate_project() -> EvidenceProject { "fields": {"number": {"type": "string", "minimumBytes": 4, "maximumBytes": 32}} } }, - "functions": { + "derivations": { "derive-certificate-check": {"interface": "assertion-derive/v1", "source": "functions/derive.rhai"} }, "sources": { @@ -404,7 +404,7 @@ fn certificate_project() -> EvidenceProject { }, "subjects": [{"role": "certificate", "selectors": ["certificate-number"]}], "acquisition": {"source": "certificate-record"}, - "derive": {"function": "derive-certificate-check"}, + "derive": {"derivation": "derive-certificate-check"}, "outputs": { "status": {"concept": STATUS_CONCEPT, "type": "controlled-category", "values": ["valid", "suspended", "revoked", "expired"]}, "printed": {"concept": PRINTED_CONCEPT, "type": "reviewed-structured-value", "schema": "schemas/printed.json", "maximumSerializedBytes": 1024}, diff --git a/crates/registry-evidence/tests/authoring_output_forms.rs b/crates/registry-evidence/tests/authoring_output_forms.rs index ab7bbdf44c..fd34ded886 100644 --- a/crates/registry-evidence/tests/authoring_output_forms.rs +++ b/crates/registry-evidence/tests/authoring_output_forms.rs @@ -45,7 +45,7 @@ fn project_document() -> Value { } } }, - "functions": { + "derivations": { "derive-values": {"interface": "assertion-derive/v1", "source": "functions/derive.rhai"} }, "sources": { @@ -83,7 +83,7 @@ fn project_document() -> Value { }, "subjects": [{"role": "subject", "selectors": ["record-by-code"]}], "acquisition": {"source": "records"}, - "derive": {"function": "derive-values"}, + "derive": {"derivation": "derive-values"}, "outputs": { "boolean": {"concept": "urn:example:concept:boolean", "type": "boolean"}, "controlled-code": {"concept": "urn:example:concept:controlled-code", "type": "controlled-code", "codelist": "codelists/codes.yaml", "codelistVersion": "1", "maximumBytes": 8}, diff --git a/crates/registry-evidencectl/schemas/authoring/project.schema.json b/crates/registry-evidencectl/schemas/authoring/project.schema.json index cb70bcdf49..2027a500a0 100644 --- a/crates/registry-evidencectl/schemas/authoring/project.schema.json +++ b/crates/registry-evidencectl/schemas/authoring/project.schema.json @@ -51,7 +51,7 @@ "$ref": "#/$defs/Acquisition" }, "derive": { - "$ref": "#/$defs/FunctionCall" + "$ref": "#/$defs/DerivationCall" }, "description": { "anyOf": [ @@ -180,6 +180,73 @@ ], "type": "string" }, + "Derivation": { + "additionalProperties": false, + "properties": { + "description": { + "anyOf": [ + { + "$ref": "#/$defs/DisplayText" + }, + { + "type": "null" + } + ], + "description": "Human explanation for authors and reviewers; excluded from behavior revisions." + }, + "interface": { + "$ref": "#/$defs/DerivationInterface" + }, + "label": { + "anyOf": [ + { + "$ref": "#/$defs/DisplayText" + }, + { + "type": "null" + } + ], + "description": "Optional presentation label. Stable references use the identifier." + }, + "source": { + "type": "string" + } + }, + "required": [ + "interface", + "source" + ], + "type": "object" + }, + "DerivationCall": { + "additionalProperties": false, + "properties": { + "derivation": { + "$ref": "#/$defs/LocalId" + }, + "parameters": { + "additionalProperties": true, + "type": "object", + "x-registry-passthrough": "Literal reviewed Derivation parameter bindings, checked at the named Derivation call site." + }, + "selectorInputs": { + "items": { + "$ref": "#/$defs/DeriveSelectorInput" + }, + "type": "array" + } + }, + "required": [ + "derivation" + ], + "type": "object" + }, + "DerivationInterface": { + "enum": [ + "assertion-derive/v1" + ], + "type": "string" + }, "DeriveSelectorInput": { "additionalProperties": false, "properties": { @@ -460,73 +527,6 @@ } ] }, - "Function": { - "additionalProperties": false, - "properties": { - "description": { - "anyOf": [ - { - "$ref": "#/$defs/DisplayText" - }, - { - "type": "null" - } - ], - "description": "Human explanation for authors and reviewers; excluded from behavior revisions." - }, - "interface": { - "$ref": "#/$defs/FunctionInterface" - }, - "label": { - "anyOf": [ - { - "$ref": "#/$defs/DisplayText" - }, - { - "type": "null" - } - ], - "description": "Optional presentation label. Stable references use the identifier." - }, - "source": { - "type": "string" - } - }, - "required": [ - "interface", - "source" - ], - "type": "object" - }, - "FunctionCall": { - "additionalProperties": false, - "properties": { - "function": { - "$ref": "#/$defs/LocalId" - }, - "parameters": { - "additionalProperties": true, - "type": "object", - "x-registry-passthrough": "Literal reviewed Function parameter bindings, checked at the named Function call site." - }, - "selectorInputs": { - "items": { - "$ref": "#/$defs/DeriveSelectorInput" - }, - "type": "array" - } - }, - "required": [ - "function" - ], - "type": "object" - }, - "FunctionInterface": { - "enum": [ - "assertion-derive/v1" - ], - "type": "string" - }, "GrantCeiling": { "additionalProperties": false, "properties": { @@ -1182,9 +1182,9 @@ }, "type": "object" }, - "functions": { + "derivations": { "additionalProperties": { - "$ref": "#/$defs/Function" + "$ref": "#/$defs/Derivation" }, "propertyNames": { "$ref": "#/$defs/LocalId" @@ -1233,7 +1233,7 @@ "kind", "project", "lookups", - "functions", + "derivations", "sources", "assertionDefinitions" ], diff --git a/crates/registry-evidencectl/src/check.rs b/crates/registry-evidencectl/src/check.rs index a87fd2d303..642cee8937 100644 --- a/crates/registry-evidencectl/src/check.rs +++ b/crates/registry-evidencectl/src/check.rs @@ -354,7 +354,7 @@ fn refused(command: &str, project: &Path, target: Option<&Path>, found: &Report) crate::report::refused( command, status, - json!({"project":project,"target":target,"proof":"authoring","diagnostics":found.to_json_value(),"projectPresentation":null,"lookups":{},"capabilityCeilings":null,"assertionDefinitions":[],"sources":[],"functions":[],"authority":null,"offline":true,"networkAccess":false,"secretResolution":false,"fixtureExecution":false}), + json!({"project":project,"target":target,"proof":"authoring","diagnostics":found.to_json_value(),"projectPresentation":null,"lookups":{},"capabilityCeilings":null,"assertionDefinitions":[],"sources":[],"derivations":[],"authority":null,"offline":true,"networkAccess":false,"secretResolution":false,"fixtureExecution":false}), ) } @@ -520,8 +520,8 @@ pub(crate) fn render_human_with_settings( } writeln!( out, - " Derive: Function {}", - definition["derive"]["function"] + " Derivation: {}", + definition["derive"]["derivation"] .as_str() .unwrap_or("unknown") )?; @@ -544,10 +544,10 @@ pub(crate) fn render_human_with_settings( render_source(source, out)?; } } - for function in report["functions"].as_array().into_iter().flatten() { + for function in report["derivations"].as_array().into_iter().flatten() { writeln!( out, - "Function {} ({}): {}", + "Derivation {} ({}): {}", function["id"].as_str().unwrap_or("unknown"), function["interface"].as_str().unwrap_or("unknown"), function["digest"].as_str().unwrap_or("unknown") @@ -795,9 +795,9 @@ acceptances: let compilation = report .diagnostics() .iter() - .find(|diagnostic| diagnostic.code == "evidence.project.function-compile") + .find(|diagnostic| diagnostic.code == "evidence.project.derivation-compile") .expect("the Function compilation error is retained"); - assert_eq!(compilation.path, "/functions/derive-adult-status"); + assert_eq!(compilation.path, "/derivations/derive-adult-status"); let compilation_source = compilation.source.as_ref().expect("placed error"); assert_eq!(compilation_source.file, project_file.to_string_lossy()); assert_eq!( @@ -995,11 +995,11 @@ acceptances: assert_eq!(report.warning_count(), 100); assert_eq!( report.diagnostics()[0].code, - "evidence.project.function-compile" + "evidence.project.derivation-compile" ); assert_eq!( report.diagnostics()[0].path, - "/functions/derive-adult-status" + "/derivations/derive-adult-status" ); assert_eq!( report.diagnostics()[0].source.as_ref().unwrap().file, @@ -1014,14 +1014,14 @@ acceptances: let refused = refused_check_report(temporary.path(), None, report); let json = serde_json::to_string(&refused).unwrap(); - assert!(json.contains("evidence.project.function-compile")); - assert!(json.contains("evidence.project.duplicate-function-label")); + assert!(json.contains("evidence.project.derivation-compile")); + assert!(json.contains("evidence.project.duplicate-derivation-label")); assert!(!json.contains("Indistinguishable Function label")); let mut human = Vec::new(); render_human(&refused, report, &mut human).unwrap(); let human = String::from_utf8(human).unwrap(); - assert!(human.contains("evidence.project.function-compile")); - assert!(human.contains("evidence.project.duplicate-function-label")); + assert!(human.contains("evidence.project.derivation-compile")); + assert!(human.contains("evidence.project.duplicate-derivation-label")); assert!(!human.contains("Indistinguishable Function label")); } #[test] @@ -1059,7 +1059,7 @@ acceptances: .iter() .find(|diagnostic| diagnostic.code == "evidence.project.asset-path") .expect("the missing asset is refused"); - assert_eq!(asset.path, "/functions/derive-adult-status/source"); + assert_eq!(asset.path, "/derivations/derive-adult-status/source"); let asset_source = asset.source.as_ref().expect("placed asset refusal"); assert_eq!(asset_source.file, project_file.to_string_lossy()); assert_eq!( @@ -1135,7 +1135,7 @@ acceptances: "id":"eligible", "requirement":"urn:example:eligible", "acquisition":{"source":"records-search"}, - "derive":{"function":"derive-eligible"}, + "derive":{"derivation":"derive-eligible"}, "outputs":{"eligible":{"type":"boolean"},"reason":{"type":"string"}}, "grantCeiling":{"authorities":["organizational"]} }, @@ -1143,7 +1143,7 @@ acceptances: "id":"income", "requirement":"urn:example:income", "acquisition":{"source":"income-record"}, - "derive":{"function":"derive-income"}, + "derive":{"derivation":"derive-income"}, "outputs":{"income":{"type":"integer"}}, "grantCeiling":{"authorities":["organizational"]} }, @@ -1151,7 +1151,7 @@ acceptances: "id":"residence", "requirement":"urn:example:residence", "acquisition":{"source":"residence-record"}, - "derive":{"function":"derive-residence"}, + "derive":{"derivation":"derive-residence"}, "outputs":{"resident":{"type":"boolean"}}, "grantCeiling":{"authorities":["organizational"]} } @@ -1194,7 +1194,7 @@ acceptances: "facts":{"type":"object","properties":{"draft-id":{"type":"string"}}} } ], - "functions":[{"id":"derive-eligible","interface":"assertion-derive/v1","digest":"sha256:reviewed","callSites":["/assertionDefinitions/eligible/derive"],"bindings":{},"capabilities":["declared-outputs"]}], + "derivations":[{"id":"derive-eligible","interface":"assertion-derive/v1","digest":"sha256:reviewed","callSites":["/assertionDefinitions/eligible/derive"],"bindings":{},"capabilities":["declared-outputs"]}], "authority":{"authorityRevision":"sha256:active"} }); let mut output = Vec::new(); @@ -1218,13 +1218,13 @@ acceptances: "Source income-record: pack benefits-register@1; route income-record; connection benefits-api" )); assert!(output.contains("Facts: income (integer)")); - assert!(output.contains("Derive: Function derive-eligible")); + assert!(output.contains("Derivation: derive-eligible")); assert!(output.contains("Outputs: eligible, reason")); assert!(output.contains("Sources not referenced by definitions:")); assert!(output.contains( "Source draft-source: pack draft-register@1; route draft-record; connection draft-api" )); - assert!(output.contains("Function derive-eligible")); + assert!(output.contains("Derivation derive-eligible")); assert!(output.contains("authorityRevision")); assert!(!output.contains("Prepare:"), "{output}"); assert!(!output.contains("extract:"), "{output}"); diff --git a/crates/registry-evidencectl/src/normalized.rs b/crates/registry-evidencectl/src/normalized.rs index daa9f0a5f0..74da44f8b3 100644 --- a/crates/registry-evidencectl/src/normalized.rs +++ b/crates/registry-evidencectl/src/normalized.rs @@ -32,10 +32,10 @@ fn read_decoded(root: &Path) -> Result<(Decoded, BTreeMap Result<(Decoded, BTreeMap registry_evidence_authoring::layout::MAX_DERIVATION_BYTES as usize { - bail!("Function exceeds the authored script size limit"); + bail!("Derivation exceeds the authored script size limit"); } scripts.insert( function.source.clone(), - String::from_utf8(bytes).context("Function asset must be UTF-8")?, + String::from_utf8(bytes).context("Derivation asset must be UTF-8")?, ); } for source in decoded.value.sources.values() { @@ -422,10 +422,10 @@ pub(crate) fn inspect(root: &Path, target: Option<&Path>, command: &str) -> Resu for function in &mut compiled.functions { let path = function["source"] .as_str() - .context("compiled Function source")?; + .context("compiled Derivation source")?; let script = authored::read_authored_file( &safe_asset(snapshot.root(), path)?, - "reviewed Function asset", + "reviewed Derivation asset", )?; function["digest"] = json!(registry_platform_config::sha256_uri(&script)); } @@ -479,7 +479,7 @@ pub(crate) fn inspect(root: &Path, target: Option<&Path>, command: &str) -> Resu report: crate::report::success( command, "complete", - json!({"project":root,"target":target.as_deref(),"proof":"authoring","diagnostics":diagnostics.to_json_value(),"projectPresentation":{"id":project.project.id,"version":project.project.version,"label":project.project.label,"description":project.project.description},"lookups":project.selector_profiles,"capabilityCeilings":{"maximumHolderBoundBatchSize":project.maximum_holder_bound_batch_size},"assertionDefinitions":definitions,"sources":project.sources.iter().map(|(id,source)| json!({"id":id,"label":source.label,"description":source.description,"pack":source.pack,"route":source.route,"connection":source.connection,"inputs":source.inputs,"acquisitionPosture":source.acquisition_posture,"projection":source.projection.as_ref().map(|projection| json!({"source":projection.source,"entrypoint":projection.entrypoint,"schema":projection.schema,"digest":compiled.model["sources"][id.as_str()]["projection"]["digest"]})),"facts":compiled.source_facts.get(id.as_str())})).collect::>(),"functions":compiled.functions,"authority":authority,"offline":true,"networkAccess":false,"secretResolution":false,"fixtureExecution":false}), + json!({"project":root,"target":target.as_deref(),"proof":"authoring","diagnostics":diagnostics.to_json_value(),"projectPresentation":{"id":project.project.id,"version":project.project.version,"label":project.project.label,"description":project.project.description},"lookups":project.selector_profiles,"capabilityCeilings":{"maximumHolderBoundBatchSize":project.maximum_holder_bound_batch_size},"assertionDefinitions":definitions,"sources":project.sources.iter().map(|(id,source)| json!({"id":id,"label":source.label,"description":source.description,"pack":source.pack,"route":source.route,"connection":source.connection,"inputs":source.inputs,"acquisitionPosture":source.acquisition_posture,"projection":source.projection.as_ref().map(|projection| json!({"source":projection.source,"entrypoint":projection.entrypoint,"schema":projection.schema,"digest":compiled.model["sources"][id.as_str()]["projection"]["digest"]})),"facts":compiled.source_facts.get(id.as_str())})).collect::>(),"derivations":compiled.functions,"authority":authority,"offline":true,"networkAccess":false,"secretResolution":false,"fixtureExecution":false}), ), diagnostics, }) @@ -983,9 +983,9 @@ fn filesystem_pack_closure_reaches_the_checked_compiler_without_conversion() { let project: EvidenceProject = serde_json::from_value(json!({ "project":{"id":"pack-bridge","version":"1"}, "lookups":{"record-by-id":{"maximumAggregateBytes":64,"fields":{"record-id":{"type":"string","minimumBytes":1,"maximumBytes":64}}}}, - "functions":{"derive-record":{"interface":"assertion-derive/v1","source":"functions/derive.rhai"}}, + "derivations":{"derive-record":{"interface":"assertion-derive/v1","source":"functions/derive.rhai"}}, "sources":{"record":{"pack":{"id":"synthetic-register","version":"0.1.0"},"route":"evidence-record","connection":"register","inputs":{"recordId":{"selector":{"role":"subject","profile":"record-by-id","field":"record-id"}}},"acquisitionPosture":"record-transformed"}}, - "assertionDefinitions":{"record-match":{"question":"Does the record match?","semantics":{"requirement":"urn:example:requirement:record","kind":"criterion","evidenceType":"urn:example:evidence:record","referenceFrameworks":["urn:example:framework:record"]},"purpose":"record-check","grantCeiling":{"authorities":["organizational"],"actorKinds":["service"],"valueOrigins":["request"],"audiences":["urn:example:audience:consumer"]},"subjects":[{"role":"subject","selectors":["record-by-id"]}],"acquisition":{"source":"record"},"derive":{"function":"derive-record"},"outputs":{"matched":{"concept":"urn:example:concept:matched","type":"boolean"}},"validitySeconds":300,"subjectBinding":"audience-scoped","representations":["signed-jws"]}} + "assertionDefinitions":{"record-match":{"question":"Does the record match?","semantics":{"requirement":"urn:example:requirement:record","kind":"criterion","evidenceType":"urn:example:evidence:record","referenceFrameworks":["urn:example:framework:record"]},"purpose":"record-check","grantCeiling":{"authorities":["organizational"],"actorKinds":["service"],"valueOrigins":["request"],"audiences":["urn:example:audience:consumer"]},"subjects":[{"role":"subject","selectors":["record-by-id"]}],"acquisition":{"source":"record"},"derive":{"derivation":"derive-record"},"outputs":{"matched":{"concept":"urn:example:concept:matched","type":"boolean"}},"validitySeconds":300,"subjectBinding":"audience-scoped","representations":["signed-jws"]}} })) .unwrap(); let scripts = BTreeMap::from([( @@ -1030,3 +1030,24 @@ fn inspection_reports_the_governed_source_projection() { assert!(output.contains("projections/person-facts.rhai")); assert!(output.contains("schemas/person-facts.json")); } + +#[cfg(test)] +#[test] +fn inspection_reports_the_canonical_derivation_names() { + let root = + Path::new(env!("CARGO_MANIFEST_DIR")).join("../../products/evidence/examples/standalone"); + let checked = inspect(&root, None, "explain").unwrap(); + assert!(checked.report.get("functions").is_none()); + let derivations = checked.report["derivations"].as_array().unwrap(); + assert!(derivations.iter().any(|entry| { + entry["id"] == "derive-adult-status" && entry["interface"] == "assertion-derive/v1" + })); + let adult_status = checked.report["assertionDefinitions"] + .as_array() + .unwrap() + .iter() + .find(|entry| entry["id"] == "adult-status") + .unwrap(); + assert_eq!(adult_status["derive"]["derivation"], "derive-adult-status"); + assert!(adult_status["derive"].get("function").is_none()); +} diff --git a/crates/registry-evidencectl/src/scaffold.rs b/crates/registry-evidencectl/src/scaffold.rs index ab6e5f90da..920c40b372 100644 --- a/crates/registry-evidencectl/src/scaffold.rs +++ b/crates/registry-evidencectl/src/scaffold.rs @@ -268,7 +268,7 @@ fn create( args.directory.join("evidence.yaml").display() ); println!( - " functions: {}", + " derivation assets: {}", args.directory.join("functions").display() ); println!( @@ -668,7 +668,7 @@ fn write_normalized_starter(root: &Path, source: AuthoringSource<'_>) -> anyhow: "kind": registry_evidence_authoring::project::PROJECT_KIND, "project":{"id":"local-evidence","version":"1"}, "lookups":{"record-reference":{"maximumAggregateBytes":64,"fields":{"record-reference":{"type":"string","minimumBytes":1,"maximumBytes":64}}}}, - "functions":{"derive-record-status":{"interface":"assertion-derive/v1","source":"functions/derive-record-status.rhai"}}, + "derivations":{"derive-record-status":{"interface":"assertion-derive/v1","source":"functions/derive-record-status.rhai"}}, "sources":{"record-status":source_document}, "assertionDefinitions":{"record-status":{ "question":"Does the selected synthetic record satisfy the reviewed condition?", @@ -677,7 +677,7 @@ fn write_normalized_starter(root: &Path, source: AuthoringSource<'_>) -> anyhow: "grantCeiling":{"authorities":["organizational"],"actorKinds":["service"],"valueOrigins":["request"],"audiences":["urn:example:audience:local-evidence"]}, "subjects":[{"role":"subject","selectors":["record-reference"]}], "acquisition":{"source":"record-status"}, - "derive":{"function":"derive-record-status"}, + "derive":{"derivation":"derive-record-status"}, "outputs":{"satisfied":{"concept":"urn:example:concept:record-status:v1","type":"boolean"}}, "validitySeconds":300, "subjectBinding":"audience-scoped", diff --git a/crates/registry-evidencectl/src/source_cli.rs b/crates/registry-evidencectl/src/source_cli.rs index 1977fb8061..0bc6f3fee8 100644 --- a/crates/registry-evidencectl/src/source_cli.rs +++ b/crates/registry-evidencectl/src/source_cli.rs @@ -41,7 +41,7 @@ pub(crate) struct SourceImportArgs { /// Evidence project directory; defaults to the current directory. /// /// This command needs an editable project containing evidence.yaml and its - /// named Function assets. + /// named Derivation assets. #[arg(long, default_value = ".")] pub(crate) project: PathBuf, /// Closed versioned file choosing keep, adopt, or an explicitly resolved file. @@ -62,7 +62,7 @@ pub(crate) struct SourceDetachArgs { /// Evidence project directory; defaults to the current directory. /// /// This command needs an editable project containing evidence.yaml and its - /// named Function assets. + /// named Derivation assets. #[arg(value_name = "PROJECT", default_value = ".")] pub(crate) project: PathBuf, } @@ -457,7 +457,7 @@ lookups: baseline-reference: maximumAggregateBytes: 64 fields: {value: {type: string, minimumBytes: 1, maximumBytes: 64}} -functions: +derivations: baseline-derive: {interface: assertion-derive/v1, source: functions/baseline-derive.rhai} sources: baseline: @@ -475,7 +475,7 @@ assertionDefinitions: grantCeiling: {authorities: [organizational], actorKinds: [service], valueOrigins: [request], audiences: ["urn:test:audience"]} subjects: [{role: subject, selectors: [baseline-reference]}] acquisition: {source: baseline} - derive: {function: baseline-derive} + derive: {derivation: baseline-derive} outputs: {matched: {concept: "urn:test:concept:matched", type: boolean}} validitySeconds: 60 subjectBinding: audience-scoped @@ -604,7 +604,7 @@ assertionDefinitions: .expect("scan EvidenceProject") .expect("EvidenceProject document") .to_json_value(); - project["functions"]["record-active-derive"] = json!({"interface":"assertion-derive/v1","source":"functions/record-active-derive.rhai"}); + project["derivations"]["record-active-derive"] = json!({"interface":"assertion-derive/v1","source":"functions/record-active-derive.rhai"}); project["assertionDefinitions"]["record-active"] = json!({ "question":"Is the record active?", "semantics":{"requirement":"urn:test:record-active","kind":"criterion","evidenceType":"urn:test:evidence:record-active","referenceFrameworks":["urn:test:framework"]}, @@ -612,7 +612,7 @@ assertionDefinitions: "grantCeiling":{"authorities":["organizational"],"actorKinds":["service"],"valueOrigins":["request"],"audiences":["urn:test:audience"]}, "subjects":[{"role":"subject","selectors":["record-code"]}], "acquisition":{"source":"lookup"}, - "derive":{"function":"record-active-derive"}, + "derive":{"derivation":"record-active-derive"}, "outputs":{"active":{"concept":"urn:test:concept:active","type":"boolean"}}, "validitySeconds":60, "subjectBinding":"audience-scoped", diff --git a/crates/registry-evidencectl/src/source_import/files.rs b/crates/registry-evidencectl/src/source_import/files.rs index b9de5f1897..7ad4c56782 100644 --- a/crates/registry-evidencectl/src/source_import/files.rs +++ b/crates/registry-evidencectl/src/source_import/files.rs @@ -238,7 +238,7 @@ pub(super) fn artifact_path(value: &str) -> Result<()> { "functions" => ".rhai", "source-fragments" | "selector-fragments" => ".json", _ => bail!( - "source imports may contain only bounded source fragments, Functions, or verified public export artifacts" + "source imports may contain only bounded source fragments, Derivation assets, or verified public export artifacts" ), }; let stem = name diff --git a/crates/registry-evidencectl/src/source_import/mod.rs b/crates/registry-evidencectl/src/source_import/mod.rs index 116a57b1fb..201c94f911 100644 --- a/crates/registry-evidencectl/src/source_import/mod.rs +++ b/crates/registry-evidencectl/src/source_import/mod.rs @@ -603,13 +603,14 @@ fn current_artifact( else { return Ok(None); }; + // Virtual fragments in import state retain their existing key. let function_ids = template["functions"] .as_array() - .context("normalized Functions")? + .context("normalized Derivations")? .iter() .filter_map(|function| function["id"].as_str()) .collect::>(); - // A Source fragment lists its Functions as declarations that carry their + // A Source fragment lists its Derivations as declarations that carry their // id; the project keys the same declarations by that id. let functions = decoded .value @@ -620,7 +621,7 @@ fn current_artifact( let mut value = serde_json::to_value(function)?; value .as_object_mut() - .context("a Function declaration is an object")? + .context("a Derivation declaration is an object")? .insert("id".to_owned(), json!(id)); Ok(value) }) @@ -658,9 +659,9 @@ fn merge_normalized_fragments( .and_then(|value| value.as_object().cloned()) .context("EvidenceProject lookups")?; let mut functions = object - .remove("functions") + .remove("derivations") .and_then(|value| value.as_object().cloned()) - .context("EvidenceProject Functions")?; + .context("EvidenceProject derivations")?; let mut sources = object .remove("sources") .and_then(|value| value.as_object().cloned()) @@ -719,21 +720,21 @@ fn merge_normalized_fragments( .context("normalized sourceId")?; for function in fragment["functions"] .as_array() - .context("normalized Functions")? + .context("normalized Derivations")? { let mut function = function .as_object() - .context("a fragment Function is an object")? + .context("a fragment Derivation is an object")? .clone(); let id = function .remove("id") .and_then(|id| id.as_str().map(str::to_owned)) - .context("a fragment Function names its id")?; - // `functions` holds the project's own Functions and those of + .context("a fragment Derivation names its id")?; + // `derivations` holds the project's own Derivations and those of // the fragments merged so far; a repeated id would replace one. if functions.contains_key(&id) { bail!( - "source `{source_id}` declares Function `{id}`, which the project or another imported source already declares; give each Function a distinct id" + "source `{source_id}` declares Derivation `{id}`, which the project or another imported source already declares; give each Derivation a distinct id" ); } functions.insert(id, Value::Object(function)); @@ -742,7 +743,7 @@ fn merge_normalized_fragments( } } object.insert("lookups".to_owned(), Value::Object(selectors)); - object.insert("functions".to_owned(), Value::Object(functions)); + object.insert("derivations".to_owned(), Value::Object(functions)); object.insert("sources".to_owned(), Value::Object(sources)); object.insert( "apiVersion".to_owned(), @@ -757,7 +758,7 @@ fn merge_normalized_fragments( &document, [ ("/lookups", &value["lookups"]), - ("/functions", &value["functions"]), + ("/derivations", &value["derivations"]), ("/sources", &value["sources"]), ], )?; diff --git a/crates/registry-evidencectl/src/source_import/tests.rs b/crates/registry-evidencectl/src/source_import/tests.rs index 4bbe189c8e..fbf06b6cc5 100644 --- a/crates/registry-evidencectl/src/source_import/tests.rs +++ b/crates/registry-evidencectl/src/source_import/tests.rs @@ -24,7 +24,7 @@ lookups: other-reference: maximumAggregateBytes: 64 fields: {value: {type: string, minimumBytes: 1, maximumBytes: 64}} -functions: +derivations: other-derive: interface: assertion-derive/v1 source: functions/other-derive.rhai @@ -45,7 +45,7 @@ assertionDefinitions: grantCeiling: {authorities: [organizational], actorKinds: [service], valueOrigins: [request], audiences: ["urn:example:audience:test"]} subjects: [{role: subject, selectors: [other-reference]}] acquisition: {source: other} - derive: {function: other-derive} + derive: {derivation: other-derive} outputs: {matched: {concept: "urn:example:concept:matched", type: boolean}} validitySeconds: 60 subjectBinding: audience-scoped @@ -481,7 +481,7 @@ fn flow_and_empty_project_collections_import_without_partial_entries() { "\n {}", ] { let project = format!( - "apiVersion: {}\nkind: {}\nfunctions: {functions}\n# Preserve this comment and the unowned member.\nuntouched: true\n", + "apiVersion: {}\nkind: {}\nderivations: {functions}\n# Preserve this comment and the unowned member.\nuntouched: true\n", registry_evidence_authoring::project::PROJECT_API_VERSION, registry_evidence_authoring::project::PROJECT_KIND, ); @@ -498,7 +498,8 @@ fn flow_and_empty_project_collections_import_without_partial_entries() { "source": "functions/imported-derive.rhai" }}); let replaced = - replace_project_sections(&project, &document, [("/functions", &replacement)]).unwrap(); + replace_project_sections(&project, &document, [("/derivations", &replacement)]) + .unwrap(); registry_platform_yaml::Reader::new("evidence.yaml") .read( replaced.as_bytes(), diff --git a/crates/registry-evidencectl/src/source_mock/mod.rs b/crates/registry-evidencectl/src/source_mock/mod.rs index f62c931535..c9bbaf21aa 100644 --- a/crates/registry-evidencectl/src/source_mock/mod.rs +++ b/crates/registry-evidencectl/src/source_mock/mod.rs @@ -73,7 +73,7 @@ pub struct ServeArgs { /// Evidence project directory; defaults to the current directory. /// /// This command needs an editable project containing evidence.yaml and its - /// named Function assets. + /// named Derivation assets. #[arg(value_name = "PROJECT", conflicts_with_all = ["openapi", "config"])] project: Option, @@ -124,7 +124,7 @@ pub struct GenerateArgs { /// Evidence project directory; defaults to the current directory. /// /// This command needs an editable project containing evidence.yaml and its - /// named Function assets. + /// named Derivation assets. #[arg(value_name = "PROJECT", conflicts_with_all = ["openapi", "config"])] project: Option, @@ -162,7 +162,7 @@ pub struct CheckArgs { /// Evidence project directory; defaults to the current directory. /// /// This command needs an editable project containing evidence.yaml and its - /// named Function assets. + /// named Derivation assets. #[arg(value_name = "PROJECT", conflicts_with = "config")] project: Option, /// Exit 1 when a warning is reported. diff --git a/crates/registry-evidencectl/src/suggest/emit.rs b/crates/registry-evidencectl/src/suggest/emit.rs index d57bb39798..e6829df79a 100644 --- a/crates/registry-evidencectl/src/suggest/emit.rs +++ b/crates/registry-evidencectl/src/suggest/emit.rs @@ -578,7 +578,7 @@ fn validate_mapped_request_path(inputs: &EmitInputs) -> Result<()> { Ok(()) } -/// Write every named Function asset under `/`, creating parent +/// Write the draft assets under `/`, creating parent /// directories as needed. Refuses to overwrite any existing file: if any /// target already exists, nothing is written and the error lists every /// collision so the caller can resolve them all at once. diff --git a/crates/registry-evidencectl/src/suggest/mod.rs b/crates/registry-evidencectl/src/suggest/mod.rs index 7ec71886f3..da695d228d 100644 --- a/crates/registry-evidencectl/src/suggest/mod.rs +++ b/crates/registry-evidencectl/src/suggest/mod.rs @@ -106,7 +106,7 @@ pub struct SuggestArgs { /// Evidence project directory; the draft is printed when this is absent. /// /// This command needs an editable project containing evidence.yaml and its - /// named Function assets. + /// named Derivation assets. #[arg(value_name = "PROJECT")] pub project: Option, } @@ -599,7 +599,7 @@ fn parse_request_target(raw: &str) -> Result { "path" => Ok(RequestTarget::Path(value.to_owned())), "query" => Ok(RequestTarget::Query(value.to_owned())), "body" => { parse_body_pointer(value)?; Ok(RequestTarget::Body(value.to_owned())) } - "header" | "cookie" | "auth" | "authentication" => bail!("request target `{channel}:` is unsupported: authentication is target configuration, and generated Functions cannot set headers or cookies"), + "header" | "cookie" | "auth" | "authentication" => bail!("request target `{channel}:` is unsupported: suggestions map selectors to path, query, or body members, and authentication is target configuration"), _ => bail!("request target `{raw}` uses unknown channel `{channel}`; use path:, query:, or body:"), } } @@ -842,7 +842,7 @@ fn validate_selector_domain( ] { if schema.get(keyword).is_some() { bail!( - "request target `{}` declares `{keyword}`, so the mapped selector domain cannot be proven compatible without a reviewed Function or narrower selector profile", + "request target `{}` declares `{keyword}`, so the mapped selector domain cannot be proven compatible without a reviewed Adapter pack source route or narrower selector profile", display_target(target) ); } diff --git a/crates/registry-evidencectl/templates/openapi/README.md b/crates/registry-evidencectl/templates/openapi/README.md index 1e1b77df93..24f9f75bd1 100644 --- a/crates/registry-evidencectl/templates/openapi/README.md +++ b/crates/registry-evidencectl/templates/openapi/README.md @@ -6,10 +6,10 @@ | File | What it holds | | --- | --- | -| `evidence.yaml` | The single `EvidenceProject` with stable IDs for selector profiles, derive Functions, Source bindings, AssertionDefinitions, and outputs. | +| `evidence.yaml` | The single `EvidenceProject` with stable IDs for selector profiles, Derivations, Source bindings, AssertionDefinitions, and outputs. | | `source.openapi.yaml` | The retained API description used by `evidencectl source suggest`. | | `adapter-packs/` | Pinned source routes, schemas and source preparation or extraction programs. | -| `functions/` | Assertion derive Function assets referenced by `evidence.yaml`. | +| `functions/` | Rhai Derivation assets referenced by `evidence.yaml`. | | `fixtures/` | Synthetic offline cases for `evidencectl test`. | | `local-target.yaml` | The disposable normalized local target. | | `dev-authority.yaml` | Complete local AccessProfiles and grants. | diff --git a/crates/registry-evidencectl/templates/sqlite-extract/README.md b/crates/registry-evidencectl/templates/sqlite-extract/README.md index e2ef6efded..bf8f617e23 100644 --- a/crates/registry-evidencectl/templates/sqlite-extract/README.md +++ b/crates/registry-evidencectl/templates/sqlite-extract/README.md @@ -6,9 +6,9 @@ | File | What it holds | | --- | --- | -| `evidence.yaml` | The single `EvidenceProject`: stable selector profile, derive Function, Source binding, AssertionDefinition, output, and grant-ceiling IDs. | +| `evidence.yaml` | The single `EvidenceProject` with stable selector profile, Derivation, Source binding, AssertionDefinition, output, and grant-ceiling IDs. | | `adapter-packs/starter-source/` | The pinned SQLite route, fixed statement, closed schemas, and extraction program. Caller values bind as parameters and never become statement text. | -| `functions/derive-record-status.rhai` | The `assertion-derive/v1` Function that maps facts to declared outputs. | +| `functions/derive-record-status.rhai` | The `assertion-derive/v1` Derivation that maps facts to declared outputs. | | `fixtures/record-status.yaml` | Synthetic offline cases for `evidencectl test`. | | `local-target.yaml` | A disposable `EvidenceTarget` with local service, OIDC, source connection, signer, limits, and generated paths. | | `dev-authority.yaml` | Complete local AccessProfiles and grants bounded by the AssertionDefinition ceilings. | @@ -21,7 +21,7 @@ evidencectl check . --target local-target.yaml evidencectl test . --target local-target.yaml --explain ``` -Review the project, adapter pack, derive Function, fixtures, target, and authority together. Source acquisition produces private facts only. An AssertionDefinition grants no downstream write or review authority. +Review the project, adapter pack, Derivation, fixtures, target, and authority together. Source acquisition produces private facts only. An AssertionDefinition grants no downstream write or review authority. ## Documentation diff --git a/crates/registry-evidencectl/templates/starter/README.md b/crates/registry-evidencectl/templates/starter/README.md index 40ed863791..d12dafabc4 100644 --- a/crates/registry-evidencectl/templates/starter/README.md +++ b/crates/registry-evidencectl/templates/starter/README.md @@ -7,7 +7,7 @@ | File | What it holds | | --- | --- | | `evidence.yaml` | The single normalized `EvidenceProject`. | -| `functions/` | Named preparation, extraction, and derivation Functions. | +| `functions/` | Rhai Derivation assets. | | `queries/` | Fixed statements used by Sources when needed. | | `fixtures/` | Synthetic offline cases. | | `codelists/` | Bounded static lookup data when supplied. | diff --git a/crates/registry-evidencectl/tests/explain_sources.rs b/crates/registry-evidencectl/tests/explain_sources.rs index 416d7008f3..579aadd3ad 100644 --- a/crates/registry-evidencectl/tests/explain_sources.rs +++ b/crates/registry-evidencectl/tests/explain_sources.rs @@ -85,7 +85,7 @@ fn explain_connects_a_real_definition_to_its_source_operation_facts_and_output() assert!(stdout .contains("Inputs: coverageId <- selector coverage-record@coverage-by-id.coverage_id")); assert!(stdout.contains("Facts: beneficiary-reference (string), status (string)")); - assert!(stdout.contains("Derive: Function derive-coverage-status")); + assert!(stdout.contains("Derivation: derive-coverage-status")); assert!(stdout.contains("Outputs: coverage-record-reports-active")); } diff --git a/crates/registry-evidencectl/tests/production_build.rs b/crates/registry-evidencectl/tests/production_build.rs index 4cf75b0531..933bf685d1 100644 --- a/crates/registry-evidencectl/tests/production_build.rs +++ b/crates/registry-evidencectl/tests/production_build.rs @@ -1229,7 +1229,7 @@ fn unsafe_function_sources_refuse_inspection_before_missing_dependencies() { for (source, expected_code) in [ ( "missing/../outside.rhai", - "evidence.project.function-source", + "evidence.project.derivation-source", ), ("functions/linked.rhai", "evidence.project.asset-path"), ] { @@ -1240,8 +1240,8 @@ fn unsafe_function_sources_refuse_inspection_before_missing_dependencies() { symlink(&outside, fixture.project.join(source)).expect("linked Function asset"); } edit_json(&fixture.project.join("evidence.yaml"), |project| { - project["functions"]["answer"]["source"] = json!(source); - project["functions"]["missing"] = + project["derivations"]["answer"]["source"] = json!(source); + project["derivations"]["missing"] = json!({"interface":"assertion-derive/v1","source":"functions/missing.rhai"}); }); let project_before = fs::read(fixture.project.join("evidence.yaml")).unwrap(); @@ -1265,7 +1265,7 @@ fn unsafe_function_sources_refuse_inspection_before_missing_dependencies() { .iter() .any(|diagnostic| { diagnostic["code"] == expected_code - && diagnostic["path"] == "/functions/answer/source" + && diagnostic["path"] == "/derivations/answer/source" && diagnostic["source"]["file"] .as_str() .is_some_and(|file| file.ends_with("evidence.yaml")) @@ -2280,7 +2280,7 @@ fn project_document() -> Value { "apiVersion":"id.registrystack.org/formats/evidence/project/v1alpha1", "kind":"EvidenceProject", "project":{"id":"production-fixture","version":"1"}, "lookups":{"subject-reference-v1":{"maximumAggregateBytes":128,"fields":{"reference":{"type":"string","minimumBytes":1,"maximumBytes":128}}}}, - "functions":{ + "derivations":{ "answer":{"interface":"assertion-derive/v1","source":"functions/answer.rhai"} }, "sources":{"registry":{ @@ -2300,7 +2300,7 @@ fn definition_document(id: &str) -> Value { "purpose":"eligibility", "grantCeiling":{"authorities":["statutory"],"actorKinds":["service"],"valueOrigins":["request"],"audiences":["urn:example:audience:relying"]}, "subjects":[{"role":"subject","selectors":["subject-reference-v1"]}], - "acquisition":{"source":"registry"},"derive":{"function":"answer"}, + "acquisition":{"source":"registry"},"derive":{"derivation":"answer"}, "outputs":{"allowed":{"concept":"urn:example:concepts:allowed","type":"boolean"}}, "validitySeconds":300,"observationTimezone":"UTC","subjectBinding":"audience-scoped","representations":["signed-jws"], "disclosureGuard":{"families":["urn:example:disclosure-families:allowed"]}, diff --git a/crates/registry-evidencectl/tests/production_handoff.rs b/crates/registry-evidencectl/tests/production_handoff.rs index f5c1074953..071c12b87f 100644 --- a/crates/registry-evidencectl/tests/production_handoff.rs +++ b/crates/registry-evidencectl/tests/production_handoff.rs @@ -991,7 +991,7 @@ impl Fixture { "kind":"EvidenceProject", "project":{"id":"production-handoff","version":"1"}, "lookups":{"person-reference-v1":{"maximumAggregateBytes":200,"fields":{"person-id":{"type":"string","minimumBytes":1,"maximumBytes":200}}}}, - "functions":{ + "derivations":{ "adult-status-derive":{"interface":"assertion-derive/v1","source":"functions/adult-status-derive.rhai"} }, "sources":{"people": source_binding( @@ -1149,7 +1149,7 @@ privacyExpectation: "immunization-summary-derive", "parent-relationship-derive", ] { - project["functions"][function] = json!({"interface":"assertion-derive/v1","source":format!("functions/{function}.rhai")}); + project["derivations"][function] = json!({"interface":"assertion-derive/v1","source":format!("functions/{function}.rhai")}); } project["sources"]["immunizations"] = source_binding( "immunizations", @@ -1933,7 +1933,7 @@ fn assertion_definition(input: AssertionDefinitionInput<'_>) -> Value { json!({"role":role, "selectors":[profile]}) }).collect::>(), "acquisition":{"source":source}, - "derive":{"function":derive}, + "derive":{"derivation":derive}, "outputs":{output:governed_output}, "validitySeconds":300, "subjectBinding":"audience-scoped", diff --git a/crates/registry-language-server/README.md b/crates/registry-language-server/README.md index b608881372..8f9c56acb4 100644 --- a/crates/registry-language-server/README.md +++ b/crates/registry-language-server/README.md @@ -42,23 +42,23 @@ Former question envelopes and inline operation sources are rejected. |---|---|---| | `assertionDefinitions` | acquisition `source` and `holderPresented.source` | named `sources` | | definitions and sources | lookup references | `lookups` | -| definitions | `derive.function` | an `assertion-derive/v1` named Function | -| sources | `prepare.function`, `extract.function` | a Function with the matching interface | -| named Functions | `source` | the contained Rhai function asset | +| definitions | `derive.derivation` | a named `assertion-derive/v1` Derivation | +| `derivations` | `source` | the contained Rhai asset | | definition outputs | `schema` | the contained schema asset | | definitions | `fixtures` | the contained fixture asset | | target authority grants | `definition`, subject `lookup` | project definitions and lookups | -| derivation function release entries | `output` | the calling definition's declared outputs | -| generated TypeScript and Python project types | definition and output names | the same normalized declarations | +| Derivation release entries | `output` | the calling definition's declared outputs | +| generated TypeScript and Python project types | Source, Derivation, definition and output names | the same normalized declarations | -Navigation, references, completion and hover use these indexed names. Function completion offers +Navigation, references, completion and hover use these indexed names. Derivation completion offers only the matching interface. Output names are scoped to the calling assertion definition; private facts never become output candidates. Generated files are recognized by the shared generator's -header and per-definition markers, at any contained `.ts` or `.py` path. +header and entry markers, at any contained `.ts` or `.py` path. `evidencectl types` emits +`DerivationBindings` with `evidence-derivation:` markers in both languages. -File completion enumerates bounded contained siblings with the same extension. No function or -generated code is executed. Missing assets are reported at their path references. Function -signature diagnostics use the shared pure authoring check. +File completion enumerates bounded contained siblings with the same extension. The language server +indexes Rhai and generated code without executing it. Missing assets are reported at their path +references. Derivation signature diagnostics use the shared pure authoring check. A value slot that holds no scalar has no semantic completion yet. Hover on a reference names its resolved declaration and project-relative file. Symbolic links, multiply linked files, paths outside @@ -73,7 +73,7 @@ symbols, completion, and hover for their modeled local authoring edges. | Product | Indexed relationships | |---|---| | BReg | Authored modules, record types and extensions, value types, fields including implicit `id`, selectors, constraints, read paths, record and project access profiles, Action inputs/plans/commit guards, Proposal permissions/attachments/review context, review authorities, datasets, vocabularies, and governed function/hook/SQL files. Module assets resolve relative to the module. | -| Coordinator | Local workflow types, named Functions and source assets, generated contract import aliases and asset paths, Operation aliases, Step names/edges and preceding-step reads, declared outcomes and Review outcome keys, fixture step and outcome references, event triggers, and whole-schema aliases at declared signature/input/output positions. | +| Coordinator | Local workflow types, named Transforms and source assets, generated contract import aliases and asset paths, Operation aliases, Step names/edges and preceding-step reads, declared outcomes and Review outcome keys, fixture step and outcome references, event triggers, and whole-schema aliases at declared signature/input/output positions. | | Casework | Queues, access profiles, teams, review policies with policy-scoped stages, outcomes and inline routing fields, trusted producers and completion hook destinations, read-only context providers and runtime deployment bindings, clocks, calendars and holiday sets, task templates, current fixtures, schema files, and development directory clients. Source namespaces remain opaque external names. | | Scheduling | Services/offerings/openings/holiday sets, local location/pool/window records, exception reopening targets scoped to location, and fixture offering names. | | Messaging | Providers, sender profiles, template identities and version-specific metadata files, access profiles, runtime providers, locale and part names and their Jinja body files, provider scripts, and fixed template schema/sample file symbols. | @@ -115,7 +115,7 @@ Most diagnostics this server publishes have severity `Error`. A warning the shar Other products diagnose their explicitly modeled local authoring relationships. Indexing-ceiling diagnostics explain the editor's operational budgets and do not claim compiler validation. Shared Evidence parser diagnostics keep their own codes, such as `config.unknown-key` and -`evidence.project.function-interface`. Missing asset diagnostics use `evidence.project.missing-*`. +`evidence.project.derivation-interface`. Missing asset diagnostics use `evidence.project.missing-*`. ## Discovery diff --git a/crates/registry-language-server/src/evidence/index.rs b/crates/registry-language-server/src/evidence/index.rs index 0afa6155f9..c98c9383a7 100644 --- a/crates/registry-language-server/src/evidence/index.rs +++ b/crates/registry-language-server/src/evidence/index.rs @@ -11,7 +11,7 @@ use crate::{ }, yaml::{ParsedDocument, ScalarStyle, SourceMap, YamlScalar, YamlValue}, }; -use registry_evidence_authoring::{project, target}; +use registry_evidence_authoring::{formats::finding_code, project, target}; use std::{ collections::{BTreeMap, BTreeSet}, path::{Path, PathBuf}, @@ -77,7 +77,7 @@ pub(crate) fn build_index( &profile.key, ); } - for function in mapping(value.get("functions")) { + for function in mapping(value.get("derivations")) { let id = &function.key; let function = &function.value; builder.define( @@ -151,7 +151,7 @@ pub(crate) fn build_index( if let Some(function) = definition .value .get("derive") - .and_then(|x| x.get_scalar("function")) + .and_then(|x| x.get_scalar("derivation")) { derive_uses .entry(function.value.clone()) @@ -290,7 +290,7 @@ pub(crate) fn build_index( } } } - for function in mapping(value.get("functions")) { + for function in mapping(value.get("derivations")) { let id = &function.key; let Some(asset) = function.value.get_scalar("source") else { continue; @@ -316,7 +316,7 @@ pub(crate) fn build_index( path: root.join(&asset.value), range: DOCUMENT_START, severity: DiagnosticSeverity::ERROR, - code: Some(format!("evidence.function.{}", finding.code)), + code: Some(finding_code("derivation", &finding.code)), message: bounded_message(&finding.message), }); } @@ -379,13 +379,18 @@ pub(crate) fn build_index( catalog_kind = None; continue; } - if line.contains("evidence-source: ") || line.contains("evidence-function: ") { + // Existing generated declarations still use the function marker. + let kind = if line.contains("evidence-source: ") { + Some(EvidenceKind::Source) + } else if line.contains("evidence-derivation: ") || line.contains("evidence-function: ") + { + Some(EvidenceKind::Function) + } else { + None + }; + if let Some(kind) = kind { scope = None; - catalog_kind = Some(if line.contains("evidence-source: ") { - EvidenceKind::Source - } else { - EvidenceKind::Function - }); + catalog_kind = Some(kind); continue; } if line.contains("assertionDefinitions =") || line.starts_with("ASSERTION_DEFINITIONS:") @@ -498,7 +503,7 @@ impl Builder<'_> { } } fn function_call(&mut self, path: &Path, value: Option<&YamlValue>, interface: &str) { - if let Some(at) = value.and_then(|value| value.get_scalar("function")) { + if let Some(at) = value.and_then(|value| value.get_scalar("derivation")) { let offers = Arc::new( self.function_interfaces .iter() diff --git a/crates/registry-language-server/src/evidence/layout.rs b/crates/registry-language-server/src/evidence/layout.rs index c4b2025a00..af94e6707f 100644 --- a/crates/registry-language-server/src/evidence/layout.rs +++ b/crates/registry-language-server/src/evidence/layout.rs @@ -22,7 +22,7 @@ impl DocumentRole { Self::Project => "Evidence project", Self::Target => "Evidence target", Self::Authority => "target authority", - Self::Function => "Function", + Self::Function => "Rhai script", Self::Generated => "generated project types", Self::Schema => "schema", Self::Fixture => "fixture", diff --git a/crates/registry-language-server/src/products/catalog.rs b/crates/registry-language-server/src/products/catalog.rs index 7e3e19e550..b496484ac1 100644 --- a/crates/registry-language-server/src/products/catalog.rs +++ b/crates/registry-language-server/src/products/catalog.rs @@ -34,7 +34,7 @@ const BREG_DECLARATIONS: &[N] = &[ N::global("recipients/groups/*/id", "BReg recipient group"), N::global("datasets/$key", "BReg dataset"), N::global("valueTypes/$key", "BReg value type"), - N::global("functions/$key", "BReg function"), + N::global("actionPlans/$key", "BReg Action Plan"), N::global("reviewAuthorities/$key", "BReg review authority"), N { scope: Scope::BregAction, @@ -62,7 +62,7 @@ const BREG_REFERENCES: &[N] = &[ N::global("recordTypes/*/fields/*/typeRef", "BReg value type"), N::global("extendRecordTypes/*/fields/*/typeRef", "BReg value type"), N::global("actions/*/inputs/*/typeRef", "BReg value type"), - N::global("actions/*/plan/function", "BReg function"), + N::global("actions/*/plan/actionPlan", "BReg Action Plan"), N::global( "actions/*/execution/proposal/review/authority", "BReg review authority", @@ -412,7 +412,7 @@ const BREG_FILES: &[FileRule] = &[ relative_to_document: false, index_target: true, }, - FileRule::root("functions/*/source", false), + FileRule::root("actionPlans/*/source", false), FileRule::root("recordTypes/*/hooks/*/handler/script", false), FileRule::root("recordTypes/*/hooks/*/handler/module", false), FileRule::root("recordTypes/*/derived/*/sql", false), @@ -422,7 +422,7 @@ const BREG_FILES: &[FileRule] = &[ const BREG_MODULE_FILES: &[FileRule] = &[ FileRule { relative_to_document: true, - ..FileRule::root("functions/*/source", false) + ..FileRule::root("actionPlans/*/source", false) }, FileRule { relative_to_document: true, diff --git a/crates/registry-language-server/src/refs.rs b/crates/registry-language-server/src/refs.rs index ab6f403ba8..143fcc04f3 100644 --- a/crates/registry-language-server/src/refs.rs +++ b/crates/registry-language-server/src/refs.rs @@ -136,10 +136,10 @@ impl EvidenceKind { Self::Output => "output", Self::Source => "source", Self::SelectorProfile => "lookup", - Self::FunctionFile => "function file", + Self::FunctionFile => "derivation file", Self::SchemaFile => "schema file", Self::FixtureFile => "fixture file", - Self::Function => "function", + Self::Function => "derivation", Self::Requirement => "requirement", Self::Fact => "fact", } @@ -161,9 +161,7 @@ impl EvidenceKind { } } - /// The part of a diagnostic code that names this kind. It is [`Self::label`] without the - /// spaces, so `evidence.project.unknown-source` and `evidence.project.unknown-lookup` read as the - /// sentences they accompany. + /// The part of a diagnostic code that names this authoring kind. pub(crate) fn slug(self) -> &'static str { match self { Self::Project => "project", @@ -173,10 +171,10 @@ impl EvidenceKind { Self::Output => "output", Self::Source => "source", Self::SelectorProfile => "lookup", - Self::FunctionFile => "function-file", + Self::FunctionFile => "derivation-file", Self::SchemaFile => "schema-file", Self::FixtureFile => "fixture-file", - Self::Function => "function", + Self::Function => "derivation", Self::Requirement => "requirement", Self::Fact => "fact", } diff --git a/crates/registry-language-server/src/workspace.rs b/crates/registry-language-server/src/workspace.rs index d9108dd708..a045f84ffe 100644 --- a/crates/registry-language-server/src/workspace.rs +++ b/crates/registry-language-server/src/workspace.rs @@ -929,7 +929,7 @@ mod tests { use super::*; use std::fs; use tempfile::tempdir; - const PROJECT: &str = "apiVersion: id.registrystack.org/formats/evidence/project/v1alpha1\nkind: EvidenceProject\nproject: {id: synthetic, version: \"1\"}\nlookups: {}\nfunctions: {}\nsources: {}\nassertionDefinitions: {}\n"; + const PROJECT: &str = "apiVersion: id.registrystack.org/formats/evidence/project/v1alpha1\nkind: EvidenceProject\nproject: {id: synthetic, version: \"1\"}\nlookups: {}\nderivations: {}\nsources: {}\nassertionDefinitions: {}\n"; fn project(root: &Path) { fs::write(root.join("evidence.yaml"), PROJECT).unwrap(); } diff --git a/crates/registry-language-server/tests/breg_native_authoring.rs b/crates/registry-language-server/tests/breg_native_authoring.rs index 536263efd3..28342a1bb3 100644 --- a/crates/registry-language-server/tests/breg_native_authoring.rs +++ b/crates/registry-language-server/tests/breg_native_authoring.rs @@ -28,8 +28,8 @@ fn facility() -> Project { "source: <|source|>plans/correct-address.rhai", ), ( - "function: correct-address-plan", - "function: <|function|>correct-address-plan", + "actionPlan: correct-address-plan", + "actionPlan: <|function|>correct-address-plan", ), ( "typeRef: address-line", @@ -376,7 +376,10 @@ async fn canonical_function_reference_changes_are_visible_through_lsp() { .iter() .any(|item| item["label"] == "correct-address-plan") ); - let edited = source.replace("function: correct-address-plan", "function: missing-plan"); + let edited = source.replace( + "actionPlan: correct-address-plan", + "actionPlan: missing-plan", + ); session.notify("textDocument/didChange", json!({"textDocument":{"uri":uri(&path),"version":2},"contentChanges":[{"text":edited}]})).await; assert!(session .published_diagnostics(&path) @@ -410,8 +413,8 @@ fn retired_entities_handlers_and_change_request_paths_have_no_editor_fallback() fn module_value_types_extensions_functions_and_empty_input_plans_resolve() { let project = Project::new(&[ file("registry.yaml", "kind: BRegProject\nmodules: {core: {}, extra: {}}\naccessProfiles: {staff: {permissions: {actions: [{action: create, results: [<|result|>created]}]}}}\n"), - file("modules/core/module.yaml", "kind: BRegModule\nid: core\nvalueTypes: {bounded-name: {type: string, maximumLength: 64}}\nrecordTypes: {person: {fields: [{id: name, typeRef: bounded-name}]}}\nfunctions: {make-person: {source: <|asset|>plans/create.rhai}}\nactions: {create: {execution: {mode: immediate}, plan: {type: function, function: make-person, inputs: [], writes: [{id: <|effect|>created, target: {recordType: person}, fields: [name]}]}}}\n"), - file("modules/extra/module.yaml", "kind: BRegModule\nid: extra\ndependencies: [core]\nextendRecordTypes: {<|record|>person: {fields: [{id: alias, typeRef: <|type|>bounded-name}]}}\nactions: {update: {execution: {mode: immediate}, inputs: [{id: person, type: reference, target: person}], plan: {type: function, function: <|function|>make-person, inputs: [person], writes: [{id: changed, target: {fromInput: person}, fields: [<|field|>alias]}]}}}\n"), + file("modules/core/module.yaml", "kind: BRegModule\nid: core\nvalueTypes: {bounded-name: {type: string, maximumLength: 64}}\nrecordTypes: {person: {fields: [{id: name, typeRef: bounded-name}]}}\nactionPlans: {make-person: {source: <|asset|>plans/create.rhai}}\nactions: {create: {execution: {mode: immediate}, plan: {type: scripted, actionPlan: make-person, inputs: [], writes: [{id: <|effect|>created, target: {recordType: person}, fields: [name]}]}}}\n"), + file("modules/extra/module.yaml", "kind: BRegModule\nid: extra\ndependencies: [core]\nextendRecordTypes: {<|record|>person: {fields: [{id: alias, typeRef: <|type|>bounded-name}]}}\nactions: {update: {execution: {mode: immediate}, inputs: [{id: person, type: reference, target: person}], plan: {type: scripted, actionPlan: <|function|>make-person, inputs: [person], writes: [{id: changed, target: {fromInput: person}, fields: [<|field|>alias]}]}}}\n"), file("modules/core/plans/create.rhai", "fn plan(ctx) { #{} }\n"), ]); let index = ProjectIndex::load_product(project.root(), ProductKind::Breg).unwrap(); diff --git a/crates/registry-language-server/tests/evidence_cards_protocol.rs b/crates/registry-language-server/tests/evidence_cards_protocol.rs index 6ee7915900..f4186d039d 100644 --- a/crates/registry-language-server/tests/evidence_cards_protocol.rs +++ b/crates/registry-language-server/tests/evidence_cards_protocol.rs @@ -16,7 +16,7 @@ async fn every_completion_trigger_uses_the_same_interface_filtered_list() { session.open(&p.path(PROJECT), SOURCE, 1).await; let mut responses = Vec::new(); for trigger in [1, 2, 3] { - responses.push(session.request("textDocument/completion",json!({"textDocument":{"uri":uri(&p.path(PROJECT))},"position":after(SOURCE,"derive: {function: "),"context":{"triggerKind":trigger,"triggerCharacter":"-"}})).await); + responses.push(session.request("textDocument/completion",json!({"textDocument":{"uri":uri(&p.path(PROJECT))},"position":after(SOURCE,"derive: {derivation: "),"context":{"triggerKind":trigger,"triggerCharacter":"-"}})).await); } assert_eq!(responses[0], responses[1]); assert_eq!(responses[1], responses[2]); diff --git a/crates/registry-language-server/tests/evidence_completion.rs b/crates/registry-language-server/tests/evidence_completion.rs index 661347627f..25717e184d 100644 --- a/crates/registry-language-server/tests/evidence_completion.rs +++ b/crates/registry-language-server/tests/evidence_completion.rs @@ -18,8 +18,8 @@ fn sources_complete_with_the_declared_names() { #[test] fn functions_complete_only_the_matching_interface() { let source = SOURCE.replace( - "functions:\n", - "functions:\n retired-extract: {interface: source-extract/v1, source: functions/retired.rhai}\n", + "derivations:\n", + "derivations:\n retired-extract: {interface: source-extract/v1, source: functions/retired.rhai}\n", ); let p = Project::new(&source); p.write( @@ -31,7 +31,7 @@ fn functions_complete_only_the_matching_interface() { labels( &index, &p.path(PROJECT), - after(&source, "derive: {function: ") + after(&source, "derive: {derivation: ") ), vec!["derive-status"] ); @@ -40,8 +40,8 @@ fn functions_complete_only_the_matching_interface() { fn retired_acquisition_channels_offer_no_sources_or_functions() { let source = SOURCE .replace( - "functions:\n", - "functions:\n retired-extract: {interface: source-extract/v1, source: functions/retired.rhai}\n", + "derivations:\n", + "derivations:\n retired-extract: {interface: source-extract/v1, source: functions/retired.rhai}\n", ) .replace( " connection: population\n", @@ -108,7 +108,7 @@ fn selectors_complete_and_declarations_offer_no_references() { #[test] fn candidate_replaces_the_entire_written_value() { let p = Project::new(SOURCE); - let at = after(SOURCE, "derive: {function: "); + let at = after(SOURCE, "derive: {derivation: "); let candidates = p.index().completions_at(&p.path(PROJECT), at); assert_eq!(candidates[0].range.start, at); assert_eq!( diff --git a/crates/registry-language-server/tests/evidence_completion_adversarial.rs b/crates/registry-language-server/tests/evidence_completion_adversarial.rs index a629efadbe..d47c672225 100644 --- a/crates/registry-language-server/tests/evidence_completion_adversarial.rs +++ b/crates/registry-language-server/tests/evidence_completion_adversarial.rs @@ -19,15 +19,15 @@ fn asking_for_completion_does_not_change_diagnostics() { #[test] fn unresolved_function_completion_still_offers_the_correct_interface() { let source = SOURCE.replace( - "derive: {function: derive-status}", - "derive: {function: missing}", + "derive: {derivation: derive-status}", + "derive: {derivation: missing}", ); let p = Project::new(&source); assert_eq!( labels( &p.index(), &p.path(PROJECT), - after(&source, "derive: {function: ") + after(&source, "derive: {derivation: ") ), vec!["derive-status"] ); diff --git a/crates/registry-language-server/tests/evidence_diagnostics.rs b/crates/registry-language-server/tests/evidence_diagnostics.rs index 66d884fddd..64b520b7e4 100644 --- a/crates/registry-language-server/tests/evidence_diagnostics.rs +++ b/crates/registry-language-server/tests/evidence_diagnostics.rs @@ -57,7 +57,7 @@ fn named_function_interface_fault_is_reported_without_executing_code() { .diagnostics() .iter() .any(|x| x.path == p.path(DERIVE) - && x.code.as_ref().unwrap().starts_with("evidence.function."))); + && x.code.as_ref().unwrap().starts_with("evidence.derivation."))); } #[test] fn authority_diagnostics_use_the_shared_grant_reader() { diff --git a/crates/registry-language-server/tests/evidence_generated_navigation.rs b/crates/registry-language-server/tests/evidence_generated_navigation.rs index 6f4c91d4b8..f248bcf2aa 100644 --- a/crates/registry-language-server/tests/evidence_generated_navigation.rs +++ b/crates/registry-language-server/tests/evidence_generated_navigation.rs @@ -62,6 +62,9 @@ fn typescript_and_python_outputs_navigate_to_the_same_normalized_model() { registry_evidence_authoring::project::python(&project, &compiled), ), ] { + assert!(source.contains("DerivationBindings")); + assert!(source.contains("evidence-derivation: derive-status")); + assert!(!source.contains("evidence-function: ")); p.write(file, &source); let index = p.index(); assert!(index.diagnostics().is_empty(), "{:?}", index.diagnostics()); @@ -105,6 +108,25 @@ fn typescript_and_python_outputs_navigate_to_the_same_normalized_model() { ); } } + +#[test] +fn legacy_generated_markers_still_navigate_to_the_authored_derivation() { + let p = Project::new(SOURCE); + for (file, comment) in [("types/legacy.ts", "//"), ("types/legacy.py", "#")] { + let source = format!( + "{comment} Generated from the normalized EvidenceProject.\n{comment} evidence-function: derive-status\n\"derive-status\": unknown,\n" + ); + p.write(file, &source); + let index = p.index(); + assert_eq!( + index.definitions_at(&p.path(file), after(&source, "\""))[0] + .range + .start, + at(SOURCE, "derive-status: {interface:") + ); + } +} + #[test] fn ordinary_code_files_are_not_indexed_as_generated_types() { let p = Project::new(SOURCE); diff --git a/crates/registry-language-server/tests/evidence_index.rs b/crates/registry-language-server/tests/evidence_index.rs index fc9427bd3e..7dfb8b477c 100644 --- a/crates/registry-language-server/tests/evidence_index.rs +++ b/crates/registry-language-server/tests/evidence_index.rs @@ -32,13 +32,12 @@ fn named_sources_navigate_in_both_directions() { .any(|x| x.range.start == reference)); } #[test] -fn named_functions_and_their_assets_navigate() { +fn named_derivations_and_their_assets_navigate() { let p = Project::new(SOURCE); let index = p.index(); - let function = after(SOURCE, "derive: {function: "); - let declaration = after(SOURCE, " derive-status"); + let derivation = after(SOURCE, "derive: {derivation: "); assert_eq!( - index.definitions_at(&p.path(PROJECT), function)[0] + index.definitions_at(&p.path(PROJECT), derivation)[0] .range .start, at(SOURCE, "derive-status: {interface") @@ -48,7 +47,8 @@ fn named_functions_and_their_assets_navigate() { index.definitions_at(&p.path(PROJECT), asset)[0].path, p.path(DERIVE) ); - let _ = declaration; + assert_eq!(EvidenceKind::Function.label(), "derivation"); + assert_eq!(EvidenceKind::FunctionFile.label(), "derivation file"); } #[test] fn selector_profiles_resolve_subjects_and_source_inputs() { diff --git a/crates/registry-language-server/tests/support/normalized.rs b/crates/registry-language-server/tests/support/normalized.rs index 90f880c01b..cfddcbdf8a 100644 --- a/crates/registry-language-server/tests/support/normalized.rs +++ b/crates/registry-language-server/tests/support/normalized.rs @@ -14,7 +14,7 @@ project: version: "1" lookups: person-by-id: {maximumAggregateBytes: 64, fields: {person-id: {type: string, minimumBytes: 1, maximumBytes: 64}}} -functions: +derivations: derive-status: {interface: assertion-derive/v1, source: functions/derive.rhai} sources: person: @@ -32,7 +32,7 @@ assertionDefinitions: grantCeiling: {authorities: [organizational], actorKinds: [service], valueOrigins: [request], audiences: ['urn:example:audience:consumer']} subjects: [{role: person, selectors: [person-by-id]}] acquisition: {source: person} - derive: {function: derive-status} + derive: {derivation: derive-status} outputs: active: {concept: 'urn:example:concept:active', type: boolean} validitySeconds: 300 diff --git a/docs/site/.markdownlint-cli2.yaml b/docs/site/.markdownlint-cli2.yaml index 112de2b9d1..cdaeee0f8a 100644 --- a/docs/site/.markdownlint-cli2.yaml +++ b/docs/site/.markdownlint-cli2.yaml @@ -37,6 +37,7 @@ config: - AuthoringConfigurationReference - ConfigurationReference - ConfigurationFormatsTable + - PostureDiagnosticsTable - ConfigurationFormatChecks - EventReferenceTable - CoordinatorOperationsTable diff --git a/docs/site/astro.config.mjs b/docs/site/astro.config.mjs index 18e04bb609..b9abb56c4a 100644 --- a/docs/site/astro.config.mjs +++ b/docs/site/astro.config.mjs @@ -1075,6 +1075,7 @@ export default defineConfig({ items: [ { label: 'Overview', slug: 'reference' }, { label: 'Errors and status codes', slug: 'reference/errors' }, + { label: 'Posture diagnostic codes', slug: 'reference/posture-diagnostics' }, { label: 'Receive signed deliveries', slug: 'reference/delivery-signing' }, { label: 'TypeScript clients', slug: 'reference/typescript-clients' }, { label: 'Environment variables', slug: 'reference/environment-variables' }, diff --git a/docs/site/package.json b/docs/site/package.json index 9e8e8164a3..3070ff2318 100644 --- a/docs/site/package.json +++ b/docs/site/package.json @@ -21,6 +21,7 @@ "generate": "npm run generate:source && npm run generate:archive", "generate:source": "node scripts/generate-evidence-configuration.mjs && node scripts/generate-breg-configuration.mjs && node scripts/generate-scheduling-configuration.mjs && node scripts/generate-casework-configuration.mjs && node scripts/generate-render-configuration.mjs && node scripts/generate-messaging-configuration.mjs && node scripts/generate-coordinator-configuration.mjs && node scripts/generate-documents-configuration.mjs && node scripts/generate-configuration-formats.mjs && node scripts/generate-cli-reference.mjs && node scripts/generate-breg-evidence-starter.mjs && node scripts/generate-evidence-examples.mjs", "generate:archive": "node scripts/generate-data.mjs && node scripts/fetch-openapi.mjs && node scripts/sync-repo-docs.mjs && node scripts/generate-sidebar.mjs", + "generate:posture-diagnostics": "node scripts/generate-posture-diagnostics.mjs --write", "pretest": "npm run generate", "test": "node --test \"scripts/**/*.test.mjs\"", "check:llms:built": "node scripts/check-llms.mjs", @@ -34,6 +35,7 @@ "check:relative-links": "node scripts/check-relative-links.mjs", "check:content": "node scripts/check-doc-frontmatter.mjs", "check:cli-reference": "node scripts/generate-cli-reference.mjs --check", + "check:posture-diagnostics": "node scripts/generate-posture-diagnostics.mjs --check", "check:cutover": "node scripts/check-current-doc-cutover.mjs", "check:notary-surface": "node scripts/check-notary-surface.mjs", "check:svg": "node scripts/check-svg-a11y.mjs", @@ -65,7 +67,7 @@ "check:tutorial:scheduling:dry-run": "node scripts/run-tutorial.mjs --gate scheduling --dry-run", "check:links": "npm run build && npm run check:links:built", "check": "npm run check:source && npm run build && npm run check:built:current", - "check:source": "npm run generate && npm run check:cli-reference && npm run check:evidence-links && npm run check:evidence-anchors && npm run check:draft-links && npm run check:glossary-links && npm run check:relative-links && npm run check:docset && npm run check:release-manifests && npm run check:archive-lock && npm run check:content && npm run check:cutover && npm run check:notary-surface && npm run check:markdown && npm run check:style && npm run check:style:fixtures && npm run check:openapi && npm run check:config-vocabulary && npm run check:tutorial:evidence:dry-run && npm run check:tutorial:breg:dry-run && npm run check:tutorial:casework:dry-run && npm run check:tutorial:coordinator:dry-run && npm run check:tutorial:messaging:dry-run && npm run check:tutorial:discovery:dry-run && npm run check:tutorial:render:dry-run && npm run check:tutorial:documents:dry-run && npm run check:tutorial:scheduling:dry-run && npm run check:svg", + "check:source": "npm run generate && npm run check:cli-reference && npm run check:posture-diagnostics && npm run check:evidence-links && npm run check:evidence-anchors && npm run check:draft-links && npm run check:glossary-links && npm run check:relative-links && npm run check:docset && npm run check:release-manifests && npm run check:archive-lock && npm run check:content && npm run check:cutover && npm run check:notary-surface && npm run check:markdown && npm run check:style && npm run check:style:fixtures && npm run check:openapi && npm run check:config-vocabulary && npm run check:tutorial:evidence:dry-run && npm run check:tutorial:breg:dry-run && npm run check:tutorial:casework:dry-run && npm run check:tutorial:coordinator:dry-run && npm run check:tutorial:messaging:dry-run && npm run check:tutorial:discovery:dry-run && npm run check:tutorial:render:dry-run && npm run check:tutorial:documents:dry-run && npm run check:tutorial:scheduling:dry-run && npm run check:svg", "check:built:current": "npm run check:accessibility:built && npm run check:llms:built && npm run check:seo:current && npm run check:links:current", "check:production": "npm run check:source && npm run build:dev && npm run check:production:built", "check:production:built": "DOCS_DIST_DIR=$PWD/dist/dev DOCS_PUBLIC_BASE=/dev/ npm run check:accessibility:built && DOCS_DIST_DIR=$PWD/dist/dev DOCS_PUBLIC_BASE=/dev/ npm run check:llms:built && DOCS_DIST_DIR=$PWD/dist/dev DOCS_PUBLIC_BASE=/dev/ npm run check:seo:current && DOCS_DIST_DIR=$PWD/dist/dev DOCS_PUBLIC_BASE=/dev/ npm run check:links:current", diff --git a/docs/site/scripts/generate-posture-diagnostics.mjs b/docs/site/scripts/generate-posture-diagnostics.mjs new file mode 100644 index 0000000000..a17187324a --- /dev/null +++ b/docs/site/scripts/generate-posture-diagnostics.mjs @@ -0,0 +1,179 @@ +import { readdir, readFile } from 'node:fs/promises'; +import { join } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { parseArgs } from 'node:util'; + +import { publishJson } from './configuration-reference.mjs'; + +const root = fileURLToPath(new URL('../../../', import.meta.url)); +const output = 'docs/site/src/data/posture-diagnostics.json'; +const fields = ['code', 'key', 'summary', 'production']; +const identifier = /^[A-Za-z_]\w*$/u; + +// Keep literal strings intact and ignore comments so neither can introduce +// declaration tokens. A Rust block comment can itself contain block comments. +function rustTokens(source) { + const token = /\/\/[^\n]*|\/\*|r(#+)?"[\s\S]*?"\1|"(?:\\[\s\S]|[^"\\])*"|'(?:\\.|[^'\\\n])'|::|\w+|[^\s]/gu; + const comment = /\/\*|\*\//gu; + const tokens = []; + for (let match; (match = token.exec(source));) { + if (match[0] === '/*') { + comment.lastIndex = token.lastIndex; + let depth = 1; + while (depth) { + const boundary = comment.exec(source); + if (!boundary) throw new Error('unterminated Rust block comment'); + depth += boundary[0] === '/*' ? 1 : -1; + } + token.lastIndex = comment.lastIndex; + } else if (!match[0].startsWith('//')) { + tokens.push(match[0]); + } + } + return tokens; +} + +function skipTestItem(tokens, start) { + // Skip the following item, including other attributes and an optional body. + const closing = { '(': ')', '[': ']', '{': '}' }; + const stack = []; + for (let index = start; index < tokens.length; index++) { + const token = tokens[index]; + if (Object.hasOwn(closing, token)) { + stack.push(closing[token]); + } else if (token === stack.at(-1)) { + stack.pop(); + if (token === '}' && stack.length === 0) return index; + } else if (token === ';' && stack.length === 0) { + return index; + } + } + return tokens.length; +} + +function afterSettingType(tokens, index) { + while (tokens[index + 1] === '::' && identifier.test(tokens[index] ?? '')) { + index += 2; + } + return tokens[index] === 'DevelopmentSetting' ? index + 1 : -1; +} + +function readSetting(tokens, start, file, name) { + const fail = (message) => { + throw new Error(file + ' (' + name + '): ' + message); + }; + const open = afterSettingType(tokens, start); + if (tokens[open] !== '{') fail('expected a DevelopmentSetting struct literal'); + + const values = {}; + let index = open + 1; + while (tokens[index] !== '}') { + const field = tokens[index]; + if (!fields.includes(field) || Object.hasOwn(values, field) || tokens[index + 1] !== ':') { + fail('expected each field ' + fields.join(', ') + ' once'); + } + const literal = tokens[index + 2]; + if (!literal?.startsWith('"')) fail(field + ' must use a string literal'); + try { + values[field] = JSON.parse(literal); + } catch { + fail(field + ' must use a string literal with JSON-compatible escapes'); + } + if (!values[field].trim()) fail(field + ' must be nonempty'); + index += 3; + if (tokens[index] === ',') index++; + else if (tokens[index] !== '}') fail(field + ' must use a single string literal'); + } + if (fields.some((field) => !Object.hasOwn(values, field))) fail('missing required field'); + return { + code: values.code, + key: values.key, + condition: values.summary, + remedy: values.production, + }; +} + +function readDeclarations(source, file) { + const tokens = rustTokens(source); + const rows = []; + for (let index = 0; index < tokens.length; index++) { + if (tokens.slice(index, index + 7).join('') === '#[cfg(test)]') { + index = skipTestItem(tokens, index + 7); + continue; + } + if (tokens[index] !== 'static' && tokens[index] !== 'const') continue; + const name = tokens[index + 1]; + if (!identifier.test(name ?? '') || tokens[index + 2] !== ':') continue; + const end = afterSettingType(tokens, index + 3); + if (tokens[end] !== '=') continue; + rows.push(readSetting(tokens, end + 1, file, name)); + } + return rows; +} + +async function* rustFiles(directory, base) { + for (const entry of await readdir(join(directory, base), { withFileTypes: true })) { + const path = base + '/' + entry.name; + if (entry.isDirectory() && entry.name !== 'tests') yield* rustFiles(directory, path); + if (entry.isFile() && entry.name.endsWith('.rs') && !entry.name.endsWith('_tests.rs')) { + yield path; + } + } +} + +export async function generatePostureDiagnostics(directory) { + const byKey = new Map(); + const sources = []; + const crates = await readdir(join(directory, 'crates'), { withFileTypes: true }); + for (const crate of crates.filter((entry) => entry.isDirectory())) { + const cratePath = 'crates/' + crate.name; + const entries = await readdir(join(directory, cratePath), { withFileTypes: true }); + if (!entries.some((entry) => entry.name === 'src' && entry.isDirectory())) continue; + for await (const file of rustFiles(directory, cratePath + '/src')) { + const source = await readFile(join(directory, file), 'utf8'); + if (!source.includes('DevelopmentSetting')) continue; + const rows = readDeclarations(source, file); + if (rows.length) sources.push(file); + for (const row of rows) { + const id = JSON.stringify([row.code, row.key]); + const previous = byKey.get(id); + if (previous && JSON.stringify(previous.row) !== JSON.stringify(row)) { + throw new Error(file + ' and ' + previous.file + ': conflicting metadata for ' + row.code + ' (' + row.key + ')'); + } + byKey.set(id, { file, row }); + } + } + } + if (!byKey.size) throw new Error('no DevelopmentSetting declarations found'); + const diagnostics = [...byKey.keys()].sort().map((id) => byKey.get(id).row); + return { sources: sources.sort(), diagnostics }; +} + +async function main() { + const { values } = parseArgs({ + options: { check: { type: 'boolean' }, write: { type: 'boolean' }, root: { type: 'string' } }, + }); + if (Boolean(values.check) === Boolean(values.write)) { + throw new Error('pass either --check or --write'); + } + const directory = values.root ?? root; + const data = await generatePostureDiagnostics(directory); + const path = join(directory, output); + if (values.write) { + await publishJson(path, data); + } else { + const text = await readFile(path, 'utf8'); + if (text !== JSON.stringify(data, null, 2) + '\n') { + throw new Error(output + ' is out of date. Run npm run generate:posture-diagnostics in docs/site.'); + } + } +} + +if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) { + try { + await main(); + } catch (error) { + console.error(error.message); + process.exitCode = 1; + } +} diff --git a/docs/site/scripts/generate-posture-diagnostics.test.mjs b/docs/site/scripts/generate-posture-diagnostics.test.mjs new file mode 100644 index 0000000000..03646ec0b3 --- /dev/null +++ b/docs/site/scripts/generate-posture-diagnostics.test.mjs @@ -0,0 +1,97 @@ +import assert from 'node:assert/strict'; +import { execFile } from 'node:child_process'; +import { mkdtemp, mkdir, rm, writeFile } from 'node:fs/promises'; +import { tmpdir } from 'node:os'; +import { dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { promisify } from 'node:util'; +import test from 'node:test'; + +import { generatePostureDiagnostics } from './generate-posture-diagnostics.mjs'; + +const exec = promisify(execFile); +const script = fileURLToPath(new URL('./generate-posture-diagnostics.mjs', import.meta.url)); + +function setting(name, code, key = 'mode', condition = 'Development mode is selected.') { + return `static ${name}: DevelopmentSetting = registry_platform_config::DevelopmentSetting { + code: "${code}", + key: "${key}", + summary: "${condition}", + production: + "Set a production mode.", +};`; +} + +async function fixture(t, files) { + const directory = await mkdtemp(join(tmpdir(), 'posture-diagnostics-')); + t.after(() => rm(directory, { recursive: true })); + for (const [file, contents] of Object.entries(files)) { + const path = join(directory, file); + await mkdir(dirname(path), { recursive: true }); + await writeFile(path, contents); + } + return directory; +} + +test('collects live settings and preserves both keys for a shared code', async (t) => { + const code = 'example.posture.mode'; + const first = 'crates/example/src/config.rs'; + const second = 'crates/example/src/lib.rs'; + const directory = await fixture(t, { + [first]: ` + //! ${setting('DOCUMENTED', 'test.posture.doctest').replaceAll('\n', '\n//! ')} + /* nested comment /* ${setting('COMMENT', 'test.posture.comment')} */ */ + const TEXT: &str = r#"${setting('STRING', 'test.posture.string')}"#; + #[cfg(test)] + mod fixtures { ${setting('TEST', 'test.posture.inline')} } + #[cfg(feature = "native")] + fn discover() { + ${setting('SECOND', code, 'origin')} + } + `, + [second]: `pub(crate) ${setting('FIRST', code).replace('static', 'const')} + ${setting('DUPLICATE', code)}`, + 'crates/example/src/config_tests.rs': setting('TEST', 'test.posture.external'), + 'crates/example/tests/config.rs': setting('TEST', 'test.posture.integration'), + }); + const { sources, diagnostics } = await generatePostureDiagnostics(directory); + assert.deepEqual(sources, [first, second]); + assert.deepEqual(diagnostics, ['mode', 'origin'].map((key) => ({ + code, + key, + condition: 'Development mode is selected.', + remedy: 'Set a production mode.', + }))); +}); + +test('rejects conflicting metadata and unsupported field expressions', async (t) => { + const code = 'example.posture.mode'; + const path = 'crates/example/src/lib.rs'; + const directory = await fixture(t, { + [path]: [setting('FIRST', code), setting('SECOND', code, 'mode', 'Different condition.')].join('\n'), + }); + await assert.rejects(generatePostureDiagnostics(directory), /conflicting metadata.*example\.posture\.mode/); + await writeFile(join(directory, path), setting('FIRST', code).replace('"Set a production mode."', 'REMEDY')); + await assert.rejects(generatePostureDiagnostics(directory), /crates\/example\/src\/lib\.rs.*production.*string literal/); +}); + +test('check fails for stale committed input without rewriting it', async (t) => { + const path = 'crates/example/src/lib.rs'; + const code = 'example.posture.mode'; + const directory = await fixture(t, { [path]: setting('FIRST', code) }); + await exec(process.execPath, [script, '--root', directory, '--write']); + await exec(process.execPath, [script, '--root', directory, '--check']); + await writeFile(join(directory, path), setting('FIRST', code, 'mode', 'Changed condition.')); + for (let attempt = 0; attempt < 2; attempt++) { + await assert.rejects( + exec(process.execPath, [script, '--root', directory, '--check']), + /posture-diagnostics\.json is out of date/, + ); + } + await exec(process.execPath, [script, '--root', directory, '--write']); + await exec(process.execPath, [script, '--root', directory, '--check']); +}); + +test('committed lookup matches the owned declarations', async () => { + await exec(process.execPath, [script, '--check']); +}); diff --git a/docs/site/src/components/PostureDiagnosticsTable.astro b/docs/site/src/components/PostureDiagnosticsTable.astro new file mode 100644 index 0000000000..278d35a745 --- /dev/null +++ b/docs/site/src/components/PostureDiagnosticsTable.astro @@ -0,0 +1,24 @@ +--- +import { diagnostics } from '../data/posture-diagnostics.json'; +--- + + + + + + + + + + + + {diagnostics.map(({ code, key, condition, remedy }) => ( + + + + + + + ))} + +
CodeConfiguration keyConditionProduction remedy
{code}{key}{condition}{remedy}
diff --git a/docs/site/src/content/docs/configure/adapter-jobs.mdx b/docs/site/src/content/docs/configure/adapter-jobs.mdx index 2f32611da7..da220d4b74 100644 --- a/docs/site/src/content/docs/configure/adapter-jobs.mdx +++ b/docs/site/src/content/docs/configure/adapter-jobs.mdx @@ -317,7 +317,7 @@ There are exactly two destinations, chosen per job by what its items need. | --- | --- | --- | | Use when | The item maps to one BReg operation with no lookup: an immediate Action, or a Proposal start and submit | The item needs a lookup, a choice between operations, a wait, a person, or a write outside BReg | | Adapter holds | The BReg client behind the `direct-breg` feature, and a BReg credential | One signing key per trigger, no product client and no Coordinator crate | -| Mapping runs | In the job, as a Rhai script | In the workflow, as a Rhai Function on the same engine | +| Mapping runs | In the job, as a Rhai script | In the workflow, as a Rhai Transform | | Retry identity | Command keys derived from the job, the item key and its sequence | An event ID derived from the same three | | Accepted means | BReg committed the Action, or the Proposal is submitted | Coordinator admitted the event and opened a Run | | Follow-up | None in the job; review and application are seen in BReg and the review provider | The workflow follows the outcome with `wait-for` and reaches a person when needed | diff --git a/docs/site/src/content/docs/configure/adapter.mdx b/docs/site/src/content/docs/configure/adapter.mdx index 24b3211bb4..08e5bf8788 100644 --- a/docs/site/src/content/docs/configure/adapter.mdx +++ b/docs/site/src/content/docs/configure/adapter.mdx @@ -1023,7 +1023,7 @@ A field mapping does not establish programme membership or enable API operations - An ingestion direct destination mapping reads one source item and fills the destination BReg operation's input, or yields an item-scoped refusal. The generator wraps the mapped input in the job's destination shape (for a Proposal, `startInput` and `submitBody`). A failed required value, conversion or validation in an ingestion mapping becomes an item-scoped refusal under the profile's mapping problem, never a deployment-level stop. -Mapping for a Coordinator event destination runs in a Coordinator Function and is outside this format. +Mapping for a Coordinator event destination runs in a Coordinator Transform and is outside this format. The write direction (a record mapped to a source request body) uses the same model with the source request schema as the target, and is generated and checked only. ### Source fields diff --git a/docs/site/src/content/docs/configure/breg-actions.mdx b/docs/site/src/content/docs/configure/breg-actions.mdx index 93398c133c..540f192d72 100644 --- a/docs/site/src/content/docs/configure/breg-actions.mdx +++ b/docs/site/src/content/docs/configure/breg-actions.mdx @@ -143,7 +143,7 @@ these rules: or `fromEffect` into an existing Record, because a value the caller chose from a stale view would overwrite a concurrent update. A create effect can still take caller values. - A `revision: unchanged` guard is refused, because it needs the condition this mode removes. -- A function plan that writes an existing Record is refused. +- A scripted Action Plan that writes an existing Record is refused. - A Proposal cannot declare `concurrency`. Omit `concurrency` for the default, which asks the caller for a condition. Turning `current-revision` @@ -246,13 +246,13 @@ only the correlated result; ## Plans and Evidence -A [Plan](../../reference/glossary/#planner) is fixed, like `deactivate-facility`'s, or computed -by a Rhai Function. `correct-address` names its Function and bounds what it may write: +A [Plan](../../reference/glossary/#action-plan) is fixed, like `deactivate-facility`'s, or computed +by a Rhai script. `correct-address` names its Action Plan and bounds what it may write: ```yaml title="registry.yaml" test-excerpt="facility/registry.yaml" plan: - type: function - function: correct-address-plan + type: scripted + actionPlan: correct-address-plan inputs: [facility, address-line, city, postal-code] writes: - id: facility-address @@ -263,7 +263,7 @@ by a Rhai Function. `correct-address` names its Function and bounds what it may - {code: invalid-postal-code, label: Postal code is invalid} ``` -The project's `functions` entry names its script: +The project's `actionPlans` entry names its script: ```rhai title="plans/correct-address.rhai" test-excerpt="facility/plans/correct-address.rhai" fn plan(ctx) { @@ -338,9 +338,9 @@ Effect order is authored order, with explicit dependencies. A forward reference refuses compilation. Aliased writes to one target fold into one revision; conflicting writes or cycles refuse atomically. -For computed effects, declare a named Function and select `plan.type: function` with its `function`, `inputs`, `writes`, and declared `refusals`. +For computed effects, declare a named Action Plan and select `plan.type: scripted` with its `actionPlan`, `inputs`, `writes`, and declared `refusals`. The write ceiling remains governed configuration. -A Function's `writes` are a ceiling, not CRUD permission: a profile allowed to invoke the Action gains no ordinary create or patch on the Record types those writes name. +A scripted Action Plan's `writes` are a ceiling, not CRUD permission: a profile allowed to invoke the Action gains no ordinary create or patch on the Record types those writes name. Rhai uses `registry.action-plan/v1` and `ctx.inputs`, and returns exactly one of two map shapes: `#{effects: [...]}` or `#{refusal: #{code: "...", field: "..."}}`, where `field` is optional. [WASM handlers](../breg-wasm-action-handlers/) have their own admitted backend contract. @@ -353,12 +353,12 @@ The [person registration example project](https://github.com/registrystack/regis crates/registry-breg/src/action_handler.rs today evidence::resolve; products/breg/acceptance/person-registration-rhai/README.md */} -A Function accepts only declared scalar inputs, including Record reference IDs. +A scripted Action Plan accepts only declared scalar inputs, including Record reference IDs. A `decimal` input arrives as its canonical JSON string. Compilation refuses a `crs84-point`, `crs84-polygon`, or `structured` input with `breg.action.handler-input-type-unsupported`; use fixed effects for those values. A `string` or `text` input must declare a `maximumLength` of at most 4,096 Unicode scalar values, so every value fits the 16,384-byte UTF-8 string budget; a larger bound fails with `breg.action.handler-input-string-bound`. -Every Function input string, timestamps included, also has a 16,384-byte admission limit. -An HTTP request exceeding a declared bound or that byte limit returns `400 request.invalid` before the Function runs. +Every scripted Action Plan input string, timestamps included, also has a 16,384-byte admission limit. +An HTTP request exceeding a declared bound or that byte limit returns `400 request.invalid` before the script runs. An omitted optional input has no key in `ctx.inputs`; an explicit JSON `null` has a key whose value is the unit value `()`. Test membership with `in` when absence matters, and guard both cases before calling a string method: @@ -371,7 +371,7 @@ family.trim(); ``` Calling a string method on an unguarded missing or null value fails the handler. -Required inputs refuse omission and null before the Function runs, and fixed-effect Actions refuse an explicit null input. +Required inputs refuse omission and null before the script runs, and fixed-effect Actions refuse an explicit null input. When an optional input is absent or null, omit the corresponding field from an effect's `set` map. Copying `()` or `null` into a required, non-null field is a handler result failure; it does not clear the field. @@ -382,7 +382,7 @@ The Rhai Action ABI provides three bounded date-string helpers: - `add_months(date, months)` adds from -12,000 through 12,000 months, clamping to the target month's last day. Invalid dates, an out-of-range result, or an offset outside those bounds fails the handler without exposing the supplied value. -A Function that calls `today()` requires `project.timezone`. +A scripted Action Plan that calls `today()` requires `project.timezone`. A caller-selected business date remains a typed input such as `asOfDate` and is caller data. Plan logic runs only when that Action is invoked and is not a Record field-validation boundary. If a rule must not be bypassed, withhold the ordinary Create profile that could write the same state without the Action. @@ -416,7 +416,7 @@ See [Schedule Actions with Record timers](../breg-record-timers/). An Action grant uses `permissions.actions`, the Action ID, `operations: [invoke]`, explicit target row boundaries, and permitted result effects. It grants no ordinary CRUD. Its target row boundaries are runtime-enforced Action authority in addition to any ordinary Record grant held by the same profile. -Every existing reference target needs current target authority, including link-only references and targets chosen by a function. +Every existing reference target needs current target authority, including link-only references and targets chosen by a scripted Action Plan. `commitGuards` checks required current facts inside the mutation transaction. A Record type's `mutationPolicy` still prevents immediate writes to Proposal-required targets. @@ -577,8 +577,8 @@ A known failed guard takes precedence over missing guard input; correcting that No availability response names a guard ID or a Record value. Availability is an observation. -It does not run a Function, test SQL uniqueness or Evidence, mint a condition token, grant mutation authority, or reserve the observed revision. -Invoke remains responsible for current authority, concurrency, form completeness, every guard, Functions, and Evidence; all required checks must succeed before effects commit. +It does not run an Action Plan script, test SQL uniqueness or Evidence, mint a condition token, grant mutation authority, or reserve the observed revision. +Invoke remains responsible for current authority, concurrency, form completeness, every guard, scripted plans, and Evidence; all required checks must succeed before effects commit. `available: true` means only that this target's field guards are currently satisfied, including the case where it has no field guards. A safely disclosed field guard that fails at commit answers `412 action.guard-failed` after current-target admission checks pass. @@ -593,7 +593,7 @@ If it fails, BReg rolls back and re-observes disclosure before returning `guardR crates/registry-breg/tests/postgres_immediate_action_requirements.rs input-required; crates/registry-breg/tests/postgres_immediate_action_requirements.rs guardReason. */} -## Test a Plan function offline +## Test a scripted Action Plan offline ```sh test-skip="uses placeholder Action and input names" bregctl check ./registry @@ -601,7 +601,7 @@ bregctl --format json explain actions ./registry bregctl project action-test ./registry --action --input /path/to/input.json --evaluation-date 2026-01-31 ``` -`action-test` runs a named Plan function over bounded synthetic JSON using logical input IDs, without a wire envelope. +`action-test` runs the Action Plan script over bounded synthetic JSON using logical input IDs, without a wire envelope. A handler that calls `today()` requires the fixed `--evaluation-date`; the command never reads the workstation clock. Add `--expect /path/to/expected.json` to check exact effects, a declared refusal, or a handler failure. The public `action-plan-branches` fixture carries all three examples. diff --git a/docs/site/src/content/docs/configure/breg-evidence.mdx b/docs/site/src/content/docs/configure/breg-evidence.mdx index c2da95bc00..bca7813ee9 100644 --- a/docs/site/src/content/docs/configure/breg-evidence.mdx +++ b/docs/site/src/content/docs/configure/breg-evidence.mdx @@ -12,7 +12,7 @@ standards_referenced: [] --- Base Registry Engine (BReg) exports an explicitly selected compiled lookup as a reviewed Source contract. -Import merges that Source, its lookups, and named preparation and extraction Functions into an existing normalised EvidenceProject. +Import merges the Source and its lookups into an existing Evidence project. The pinned Adapter pack owns request preparation and extraction. Evidence owns the AssertionDefinitions those facts answer, caller grants, minimum disclosure, signing, and deployment configuration. Live acquisition uses BReg's ordinary HTTP lookup API. @@ -128,7 +128,7 @@ evidencectl check ./evidence evidencectl test ./evidence --target ./evidence/local-target.yaml ``` -Its `evidence.yaml` owns Sources, lookups, named Functions, and AssertionDefinitions. +Its `evidence.yaml` owns Sources, lookups, Derivations, and AssertionDefinitions. `local-target.yaml` binds local resources, and `dev-authority.yaml` supplies complete disposable caller authority. The tracked inputs contain secret references, and initialisation creates owner-only local keys. @@ -139,7 +139,7 @@ evidencectl source import ./exports/registry-status --project ./evidence ``` Import creates no assertion meaning or caller grant. -Merge the maintained `starter/definitions.yaml.fragment` Functions and AssertionDefinitions into the existing `evidence.yaml`, and copy its `functions/` and `fixtures/` files. +Merge the maintained `starter/definitions.yaml.fragment` Derivations and AssertionDefinitions into the existing `evidence.yaml`, and copy its `functions/` and `fixtures/` files. The fragment is ordinary authoring input, not a complete project or an `init --starter` template. Keep the independent SQLite definition and the imported Source declarations. The resulting project has three definitions and two Sources, with 35 synthetic fixture cases across the complete composition. @@ -216,7 +216,7 @@ Select a reviewed `request` lookup when the caller's authorised selector values The ordinary export uses Evidence's optional `extract(response, selectors, context)` form. It checks the returned selected identity's scalar type and exact value before returning matched facts. A missing, wrongly typed, or mismatched identity fails as a source protocol error. -No AssertionDefinition can skip that check by replacing its derive Function. +No AssertionDefinition can skip that check by replacing its Derivation. Only the explicit fact fields enter the fact set. A fact keeps the field's declared `pattern` in both generated schemas, and a decimal fact states its declared precision and scale as a pattern. diff --git a/docs/site/src/content/docs/configure/breg-journeys.mdx b/docs/site/src/content/docs/configure/breg-journeys.mdx index af5812bd52..740b78038b 100644 --- a/docs/site/src/content/docs/configure/breg-journeys.mdx +++ b/docs/site/src/content/docs/configure/breg-journeys.mdx @@ -54,7 +54,7 @@ bregctl explain actions facility ```text test-excerpt correct-address (proposal) inputs facility, address-line, city, postal-code - plan function plans/correct-address.rhai + Action Plan plans/correct-address.rhai write ceiling: patch facility, fields address-line, city, postal-code commit guard facility: revision unchanged ``` @@ -94,7 +94,7 @@ jurisdiction: Keep the success and the refusal; add a step for each invariant your change affects. -A plan Function has an offline loop, with input keyed by authored input ID: +A scripted Action Plan has an offline loop, with input keyed by authored input ID: ```json title="correction-input.json" test-file {"facility": "018f0c3e-7b1a-7c00-8000-000000000001", "address-line": "2 Corrected Road", "city": "Corrected city", "postal-code": "10300"} diff --git a/docs/site/src/content/docs/configure/breg-proposals.mdx b/docs/site/src/content/docs/configure/breg-proposals.mdx index 7e301f1c06..b5c1bbab57 100644 --- a/docs/site/src/content/docs/configure/breg-proposals.mdx +++ b/docs/site/src/content/docs/configure/breg-proposals.mdx @@ -16,7 +16,7 @@ Base Registry Engine (BReg) owns the draft, the frozen Plan, target authorisatio An external review authority owns review policy and decisions. The facility template declares generated CRUD for its directory, immediate registration of a facility and an assignment, and two Proposal Actions. -The reviewed-change example uses a fixed Plan when a named function is unnecessary. +The reviewed-change example uses a fixed Plan when the effects are known at authoring time. [Actions and Proposals](../breg-actions/) introduces both Action modes; this page is the Proposal reference for adopters and operators. {/* Evidence: crates/registry-breg/src/contract.rs ActionSource; @@ -99,10 +99,10 @@ mutationPolicy: ``` A direct Patch or immediate Action cannot bypass that rule. -The Action's `plan` is either `type: fixed` with ordered effects or `type: function` naming a project-local function and its write ceiling. +The Action's `plan` is either `type: fixed` with ordered effects or `type: scripted` naming a project-local `actionPlan` and its write ceiling. Effects use `fromInput`, `fromEffect`, literal `value`, and explicit clear operations. -Function code computes effects within that ceiling; it cannot invent authority or a review result. -The facility function uses `registry.action-plan/v1` and `ctx.inputs`. +The script computes effects within that ceiling. BReg retains mutation and review enforcement. +The facility Action Plan uses `registry.action-plan/v1` and `ctx.inputs`. A Proposal draft may omit an input declared `required: true` during Start, Edit, Revise, or Rebase. Every value that is present must still match its declared type, nullability, and the caller's `writableInputs` authority. diff --git a/docs/site/src/content/docs/configure/breg-record-timers.mdx b/docs/site/src/content/docs/configure/breg-record-timers.mdx index 3aa94ff481..5b023a06dc 100644 --- a/docs/site/src/content/docs/configure/breg-record-timers.mdx +++ b/docs/site/src/content/docs/configure/breg-record-timers.mdx @@ -78,7 +78,7 @@ timerGrants: The invoked Action is an ordinary immediate Action, and the timer must map every one of its inputs. The compiler refuses a timer that invokes a Proposal Action, a publicly invokable Action, or an -Action with remote Function, Evidence, commit-Evidence, or consent-issuance capability. +Action that depends on remote capabilities, Evidence checks, commit-Evidence checks, or consent issuance. A local bounded handler remains available when it needs none of those capabilities. {/* Evidence: crates/registry-breg/tests/timer_authoring.rs diff --git a/docs/site/src/content/docs/configure/breg-wasm-action-handlers.mdx b/docs/site/src/content/docs/configure/breg-wasm-action-handlers.mdx index 35e86845a4..2467facb5a 100644 --- a/docs/site/src/content/docs/configure/breg-wasm-action-handlers.mdx +++ b/docs/site/src/content/docs/configure/breg-wasm-action-handlers.mdx @@ -11,7 +11,7 @@ locale: en standards_referenced: [] --- -A Base Registry Engine (BReg) immediate Action can run a named WebAssembly Function instead of a +A Base Registry Engine (BReg) immediate Action can use a WebAssembly Action Plan instead of a Rhai script. You write the decision logic as a Rust function, compile it to a module, and name the module in your registry project. This page covers what a WASM handler can do, how to author and package one, the runtime configuration, and the upgrade and rollback paths. @@ -22,7 +22,7 @@ it is a function from the request inputs to one outcome document. ## What a WASM handler is -A WASM handler is one named Function with `runtime: wasm`, a project-local `source` path, +A Wasm Action Plan is one declaration under `actionPlans` with `runtime: wasm`, a project-local `source` path, `entrypoint: plan` and `abi: registry.action-plan/v1`. An immediate Action selects it from its bounded Plan. @@ -186,10 +186,10 @@ the ceilings: ## Package it into a BReg project -Declare a named Function, then select it from an immediate Action's bounded Plan: +Declare the Wasm Action Plan and select it from the immediate Action: ```yaml -functions: +actionPlans: normalize-phone-plan: runtime: wasm source: wasm/handler.wasm @@ -201,8 +201,8 @@ functions: execution: mode: immediate plan: - type: function - function: normalize-phone-plan + type: scripted + actionPlan: normalize-phone-plan inputs: [phone, region] refusals: - code: invalid-phone diff --git a/docs/site/src/content/docs/configure/breg.mdx b/docs/site/src/content/docs/configure/breg.mdx index 77b04a0d7e..c34dee5331 100644 --- a/docs/site/src/content/docs/configure/breg.mdx +++ b/docs/site/src/content/docs/configure/breg.mdx @@ -93,7 +93,7 @@ project: `project` gives the registry its identity. The rest of the file follows in this order: `package` (the source revision a production package records), `datasets`, `reviewAuthorities`, -`recordTypes`, `valueTypes`, `functions`, `actions`, `accessProfiles`, and `vocabularies`. A +`recordTypes`, `valueTypes`, `actionPlans`, `actions`, `accessProfiles`, and `vocabularies`. A project may also declare `modules`, `statisticalDatasets`, `recipients`, and `evidenceProviders`. The [configuration reference](../../reference/breg-configuration/) lists every key with its type and bounds. @@ -147,8 +147,8 @@ row boundaries to four separate kinds of grant: `permissions.records`, `permissi ## Declare Actions and plan code An [Action](../../reference/glossary/#action) is a named change with typed inputs. A -[Function](../../reference/glossary/#function) declares its runtime, source, entrypoint, ABI, -capabilities, and limits, and the Action that calls it fixes what it may write. Record hooks +[scripted Action Plan](../../reference/glossary/#action-plan) declares its runtime, source, entrypoint, ABI, +capabilities, and limits. The Action that selects it fixes what it may write. Record hooks announce committed changes; [Bind webhook receivers](../../operate/breg-webhooks/) covers delivery. @@ -256,7 +256,7 @@ History erasure removes Proposal links to erased revisions even when the current The UUID in each Record envelope remains the stable Record identity. Use a generated `string` field for an institution-facing number or code. It reads like an ordinary field, but callers and Actions cannot set or patch it. -Do not grant it in `writableFields` or a Function write ceiling. +Do not grant it in `writableFields` or a scripted Action Plan write ceiling. Add `generate` to a stored `string` field: diff --git a/docs/site/src/content/docs/configure/coordinator.mdx b/docs/site/src/content/docs/configure/coordinator.mdx index f645206293..35703533cb 100644 --- a/docs/site/src/content/docs/configure/coordinator.mdx +++ b/docs/site/src/content/docs/configure/coordinator.mdx @@ -235,11 +235,11 @@ A project separates reusable assets from the one workflow that uses them: - `project` supplies an ID, a human version label, and an optional `label` and `description`. - `contracts` optionally imports generated local product contracts. - `types` optionally names reusable JSON Schemas. -- `functions` optionally names typed pure computations, their source assets, and entrypoints. +- `transforms` optionally names typed pure computations, their source assets, and entrypoints. - `operations` names local aliases for exact versioned host operations and logical connections. - `workflow` contains the input, the deadline, the start step, the steps, and the declared outcomes. -A project can omit functions when no mapping needs one. +A project can omit `transforms` when no mapping needs one. Imported contracts are local generated artifacts the compiler reads, not runtime discovery. Schema positions accept a JSON Schema or one of `typeRef`, `operationInput`, `operationOutput`, `operationRefusal`, or `completionOutput`; a completion output names its operation and completion. `check` resolves those references locally, verifies that every incoming route provides the data a step reads, and fits mappings to the input and result contracts before anything runs. diff --git a/docs/site/src/content/docs/explanation/how-evidence-works.mdx b/docs/site/src/content/docs/explanation/how-evidence-works.mdx index 004f686292..43fe8ba834 100644 --- a/docs/site/src/content/docs/explanation/how-evidence-works.mdx +++ b/docs/site/src/content/docs/explanation/how-evidence-works.mdx @@ -30,10 +30,10 @@ file and the scripts it names, kept in version control. It declares four things. - **Lookups.** A [lookup](../../reference/glossary/#lookup) bounds what a caller may send to identify a subject. `record-by-id` admits one string field of 1 to 64 bytes, and a route input takes its value only from that field. -- **Functions.** A [Function](../../reference/glossary/#function) is a small +- **Derivations.** A [Derivation](../../reference/glossary/#derivation) is a small [Rhai](../../reference/glossary/#rhai) script with the `assertion-derive/v1` interface. It turns the route's validated facts into declared outputs. Provider response normalisation belongs to - the pack. Functions run under fixed operation and size limits and cannot import code. + the pack. Derivations run under fixed operation and size limits and cannot import code. Evidence has no built-in domain: adult status exists only because a project declares it. @@ -126,7 +126,7 @@ file, and a compiled authority; `evidence authority activate` records the author process serves them as read at startup, so a change means a new package or activation and a restart. -Each request passes five stages: the selectors are checked, the source is read, the Functions +Each request passes five stages: the selectors are checked, the source is read, the Derivations run, only declared outputs are accepted, and the assertion is signed with its definition's [`configurationRevision`](../../reference/glossary/#configuration-revision). An unsigned JSON answer, where the definition permits one, carries the revision without a signature. @@ -176,7 +176,7 @@ a retained response afterwards; the [`evidencectl` reference](../../reference/cli/evidencectl/) lists each command. Relying services pin the `configurationRevision`. It moves when you edit what a definition does, -such as its source, lookups, Functions, codelists, or outputs, and stays put for +such as its source, lookups, Derivations, codelists, or outputs, and stays put for `question` text, fixtures, credentials, grants, and signing keys. Changing the address of a source connection the definition uses also moves it. A change in meaning gets a new Requirement URI, published beside the old one for an announced period; a clarification keeps the diff --git a/docs/site/src/content/docs/explanation/where-each-rule-lives.mdx b/docs/site/src/content/docs/explanation/where-each-rule-lives.mdx index af28f5ea6a..163b7f4579 100644 --- a/docs/site/src/content/docs/explanation/where-each-rule-lives.mdx +++ b/docs/site/src/content/docs/explanation/where-each-rule-lives.mdx @@ -41,18 +41,20 @@ products hold what happens around a record. | Preconditions on current data | BReg Action `commitGuards`, with `targets` and `evidence` entries, checked when the Action commits | Guard entries on the Action | `bregctl explain actions` | | Derived values | BReg generated identifiers (`generate` on a string field) and live derived fields (reviewed SQL compiled to a read-only view) | The field's `generate` entry, or the Record type's `derived` block | `registry-project.schema.json` | | Rates, thresholds and other parameters that change over time | BReg Record type with `temporal` validity and a `temporal-non-overlap` constraint, so that one record holds each period, changed through an Action (a Proposal Action when a change needs review). A plan cannot read stored records, so a workflow reads the record in force with `breg.read-in-force/v1` and passes the values to the Action as inputs. | The Record type and the Action that changes it | `registry-project.schema.json`; `generated/operations/catalog.json` | -| Calculation and branching in an Action | BReg Action `plan`: `fixed`, a Rhai Function, or a Wasm Function | Typed Action `inputs`, declared write slots and declared refusal codes; Function ABI `registry.action-plan/v1` | `bregctl generate actions` writes the `action-contracts/v1` document | +| Calculation and branching in an Action | BReg Action `plan`: `fixed` or `scripted` with a Rhai or Wasm Action Plan | Typed Action `inputs`, declared write slots and declared refusal codes; Action Plan ABI `registry.action-plan/v1` | `bregctl generate actions` writes the `action-contracts/v1` document | | Record timers | BReg Record type `timers`, enabled by the root project's `timerGrants`; each timer invokes one non-public immediate Action | The timer declaration on the Record type | `registry-project.schema.json`; a timer-only Action has no portable Action contract | | Events and webhooks | BReg `hooks`: a `url`, `rhai` or `wasm` handler that runs after commit; local handlers use ABI `registry.hook-handler/v1` | `trigger`, `projection` and optional `when` on the hook | `bregctl explain events`; one schema for each hook in `generated/event-schemas/`, and `proposal-lifecycle.schema.json` there | | Review, then apply | BReg Proposal Action (`execution.mode: proposal`); Casework supplies the review | The Action's `review` and `application` declarations | `bregctl generate actions` | -| Multi-step or cross-product process | Registry Coordinator `workflow.yaml`: `call`, `choose`, `wait-until`, `wait-for` and `finish` steps, with pure Rhai Functions | Typed workflow input and named finishes | `generated/operations/catalog.json` and the generated project schema | +| Multi-step or cross-product process | Registry Coordinator `workflow.yaml`: `call`, `choose`, `wait-until`, `wait-for` and `finish` steps, with pure Rhai Transforms | Typed workflow input and named finishes | `generated/operations/catalog.json` and the generated project schema | | Calls to systems outside the stack | Adapter pack routes (reviewed, in Camel route YAML, with Rhai mapping scripts), bound to a profile by a project and served as a facade | The profile's operations | The Adapter effective contract | -| Answering a question about a person or record for another service | Registry Evidence: an AssertionDefinition, a Source bound to an Adapter pack route, and a derivation Function | The public Requirement URI, purpose and subject selectors | `generated/evidence-definitions-v1.schema.json` and the generated OpenAPI | +| Answering a question about a person or record for another service | Registry Evidence: an AssertionDefinition, a Source bound to an Adapter pack route, and a Derivation | The public Requirement URI, purpose and subject selectors | `generated/evidence-definitions-v1.schema.json` and the generated OpenAPI | | Documents and certificates | Registry Render (Typst template bundle, byte-stable PDF) and the Registry Document Store (custody and release of a verified version) | Render: template bundle and record data. Document Store: document policy and grants | `render/schemas/project.schema.json`; the Document Store project schema and event schemas | | Case steps | Registry Casework `ReviewPolicy`: stages, queues, outcomes and routing rules | The policy in `casework.yaml` | `generated/project/project.schema.json`; `caseworkctl explain` | | Notifications | Registry Messaging: versioned templates with a JSON Schema each, providers and sender profiles | The template's input schema | `generated/authoring/template.schema.json`; `messagingctl generate templates` | | Appointments | Registry Scheduling policy: offerings, holds and bookings, with four observer triggers | The policy | `generated/project/project.schema.json`; `schedulingctl explain` | +A [service function](../../reference/glossary/#service-function) can call product APIs within one request. Each product verifies the authority for its own calls. + {/* Evidence: crates/registry-breg/tests/native_patterns.rs; crates/registry-breg/src/immediate_actions.rs; crates/registry-breg/src/generated_identifiers.rs; crates/registry-breg/src/derived_sql.rs (live derived fields); crates/registry-breg/src/postgres/history_read.rs (temporal); @@ -71,7 +73,7 @@ products hold what happens around a record. A plan runs only when its Action is invoked. It reads no stored record and no clock. The one date a Rhai plan can read is `today()`, the registry-local date captured once for the evaluation, and a -Function that calls `today()` requires `project.timezone`. Where the Action declares Evidence, a +scripted Action Plan that calls `today()` requires `project.timezone`. Where the Action declares Evidence, a Rhai plan can also call `evidence::resolve`. A Wasm plan reads its inputs only. [Actions and Proposals](../../configure/breg-actions/) has the details. diff --git a/docs/site/src/content/docs/reference/breg-api.mdx b/docs/site/src/content/docs/reference/breg-api.mdx index 8176d48b6b..d08f96a91b 100644 --- a/docs/site/src/content/docs/reference/breg-api.mdx +++ b/docs/site/src/content/docs/reference/breg-api.mdx @@ -717,10 +717,10 @@ nonempty set of declared API input names in `missingInputs`. `not-disclosed` car `observedRevision: null` and no missing-input names because the selected profile cannot safely inspect the guard or boundary. A known failed guard takes precedence over missing guard input. No availability response names a guard ID or a Record value. -The route evaluates only field guards for that one target. It does not run a Function, test SQL +The route evaluates only field guards for that one target. It does not run an Action Plan script, test SQL uniqueness or Evidence, inspect other targets, supply a condition token, or grant mutation authority. A true answer means only that the selected target's field guards are currently satisfied, -including when it has none. Form completeness, Functions, Evidence, other targets, and SQL +including when it has none. Form completeness, scripted plans, Evidence, other targets, and SQL constraints may still refuse. Invoke checks authority, concurrency, and every guard in the commit transaction. diff --git a/docs/site/src/content/docs/reference/evidence-request-adapter-api.mdx b/docs/site/src/content/docs/reference/evidence-request-adapter-api.mdx index b8213c7d2b..ae16583752 100644 --- a/docs/site/src/content/docs/reference/evidence-request-adapter-api.mdx +++ b/docs/site/src/content/docs/reference/evidence-request-adapter-api.mdx @@ -28,9 +28,9 @@ are not alternate forms of `derive`. crates/registry-evidence/src/rhai_runtime.rs compile_derivation, derive. */} This page describes the compiled assertion ABI under Evidence bundle Version 1. -For the Functions you write in an Evidence project, use the +For the Derivations you write in an Evidence project, use the [authoring form](../../products/registry-evidence/authoring-form/). -An authored `assertion-derive/v1` Function returns local `{output, value}` entries; the authoring +An authored `assertion-derive/v1` Derivation returns local `{output, value}` entries; the authoring compiler translates them into compiled `{concept_id, value}` entries. The host helpers and resource limits apply to both authored and compiled assertion derivations. `evidencectl package` compiles authoring inputs and delegates execution to the real `evidence` diff --git a/docs/site/src/content/docs/reference/glossary.mdx b/docs/site/src/content/docs/reference/glossary.mdx index d0cf3c90f0..2732c13d8d 100644 --- a/docs/site/src/content/docs/reference/glossary.mdx +++ b/docs/site/src/content/docs/reference/glossary.mdx @@ -33,7 +33,10 @@ Product names are always in English, including on future translated pages.
The protected record Registry Casework keeps of who made a Decision and their private reason, held for the pinned policy's `accountabilityRetentionDays` and never sent to the producer. See Retention in Casework.
Action
-
A BReg typed operation with one bounded Plan and a fixed execution mode. An `immediate` Action commits its effects atomically and returns an ActionReceipt; a `proposal` Action starts a durable Proposal.
+
A BReg typed operation with one bounded Action Plan and a fixed execution mode. An `immediate` Action commits its effects atomically and returns an ActionReceipt; a `proposal` Action starts a durable Proposal.
+ +
Action Plan
+
The effects an Action makes, authored under `plan`. A `type: fixed` plan lists the effects in order. A `type: scripted` plan selects an `actionPlan` declared under `actionPlans`. It computes effects within the Action's declared `writes`. BReg authorizes and commits those effects.
ActionReceipt
The response to a successful immediate Action: its `applicationId` and, under `results`, the Record type, `recordId`, and new revision of each effect the caller may see. A refused invocation leaves no partial change.
@@ -66,7 +69,7 @@ Product names are always in English, including on future translated pages.
A pinned Casework policy rule that measures a subject or a stage against a deadline, in elapsed time or working days on a calendar. It can send a reminder or move a due task to another queue, and never decides an outcome.
`configurationRevision`
-
The `sha256:` digest a Registry Evidence assertion carries for what its assertion definition does, which relying services pin. It moves with the source request or response shape, lookups, Functions, codelists, schemas, outputs, or validity, and stays put for question text, fixtures, endpoints, credentials, grants, and signing keys.
+
The `sha256:` digest a Registry Evidence assertion carries for what its assertion definition does, which relying services pin. It moves with the source request or response shape, lookups, Derivations, codelists, schemas, outputs, or validity, and stays put for question text, fixtures, endpoints, credentials, grants, and signing keys.
content verification
The Registry Document Store's check of every stored document version by an operator-configured verifier, which receives the bytes and answers approved or rejected. Only an approval bound to the version's digest, media type, and the current verifier releases it; a rejection keeps it from ever being released. Base Registry Engine applies the same check to Proposal attachments.
@@ -83,6 +86,9 @@ Product names are always in English, including on future translated pages.
deployment candidate
The directory `evidencectl package` writes from an Evidence project and one target: an immutable `bundle/`, a runtime file, and a compiled authority. Its package digest identifies the bundle.
+
Derivation
+
A bounded Rhai computation in an Evidence project. It uses `assertion-derive/v1` to turn validated source facts into declared outputs. Evidence validates those outputs and constructs the assertion. The reviewed Adapter pack normalizes the source response.
+
directory
Registry Casework's runtime record of teams, their staff and supervisors, and the queues they serve, maintained by an administrator through the directory API under revisions. See Staff the directory.
@@ -108,10 +114,7 @@ Product names are always in English, including on future translated pages.
The minimum-disclosure assertion product: it answers one predefined question from a fixed read of your system with a signed assertion, never the source record. Binaries `evidence` and `evidencectl`.
Evidence project
-
An `evidence.yaml` file and the scripts it names, kept in version control, declaring assertion definitions, sources, lookups, and Functions. `evidencectl` checks, tests, and packages it with a target into a deployment candidate.
- -
Function
-
A project-local typed implementation asset. In BReg, an Action's Plan uses one to compute effects within the Action's declared write ceiling; it cannot grant authority or invent a review decision. In an Evidence project, a Rhai script with the `assertion-derive/v1` interface that turns a source route's validated facts into declared outputs, under fixed operation and size limits. Provider response normalisation belongs to the reviewed Adapter pack.
+
An `evidence.yaml` file and the scripts it names, kept in version control, declaring assertion definitions, sources, lookups, and Derivations. `evidencectl` checks, tests, and packages it with a target into a deployment candidate.
grant ceiling
The widest authority a Registry Evidence assertion definition lets any grant give for it: the authorities, actor kinds, value origins, and audiences a grant may name. A target authority's grant may only narrow it; Registry Evidence refuses to activate one that widens it.
@@ -141,7 +144,7 @@ Product names are always in English, including on future translated pages.
The rule that one Registry Evidence response carries the smallest sufficient answer to one requirement and never the source record. The assertion payload is closed against additional properties, and its output gate admits only the concept identifiers and value forms the requirement declares.
module
-
A reusable `modules//module.yaml` file that contributes Record types, value types, Functions, Actions, and additive extensions to a Base Registry Engine registry project.
+
A reusable `modules//module.yaml` file that contributes Record types, value types, Action Plans, Actions, and additive extensions to a Base Registry Engine registry project.
offering
One bookable Registry Scheduling service at one location, in exact-time or arrival-window mode, drawing on a resource pool or on published windows.
@@ -167,9 +170,6 @@ Product names are always in English, including on future translated pages.
package digest
The `sha256:` digest of a package's `SHA256SUMS` file, reported by every product that serves a package and accepted as `package.expectedDigest`. It is an integrity digest, not an authenticity proof: packages are unsigned.
-
Plan
-
The effects an Action makes, authored under `plan`: a `type: fixed` Plan lists them in order, and a `type: function` Plan names a Function that computes them within the Action's declared `writes`.
-
policy package
The directory `caseworkctl package` writes from a checked Casework project, with its exact `SHA256SUMS`. The runtime verifies that closure before serving and refuses a changed, missing, or extra file.
@@ -249,7 +249,7 @@ Product names are always in English, including on future translated pages.
One human contribution to a ReviewRequest, created when a stage becomes active, with its queue, revision, holder, and Decision.
Rhai
-
The bounded scripting language for adopter-authored Functions, run under fixed operation and size limits. Registry Evidence Functions extract facts and derive outputs; Base Registry Engine Functions compute an Action's effects; Registry Coordinator Functions route a `choose` step or compute a mapped call input.
+
A scripting language used by Evidence Derivations, BReg scripted Action Plans, and Coordinator Transforms. Each product runs the script under fixed operation and size limits.
role
An authored job identifier under `roles` in an `RStackService` `service.yaml`. A role names an actor kind, holder claim names, and the access profiles the job uses in each product. Products own the permissions and state the scopes and purposes in their identity facts.
@@ -272,6 +272,9 @@ Product names are always in English, including on future translated pages.
seal (document)
A PAdES signature made with an institution's own key over a document a stack product produced, so a relying party can check which institution issued the document and that it has not changed since. Registry Render applies one, at PAdES baseline level B-B or B-T, to a PDF it rendered from a verified package in the same request, when the document type names a seal in its manifest. It never seals bytes a caller sends. A document seal is an electronic seal in the PAdES format. Other uses of "seal" in the stack do not mean a document seal: `sealed_value::seal` and `seal_field` in `registry-platform-crypto` mean authenticated encryption of a stored value, and a sealed audit segment is a rotated audit file the shared writer has closed. See Seal documents.
+
Service function
+
Application code declared under `functions` in `service.yaml`. The private App Kit uses these entries for code that can call product APIs within one request. Each product verifies the authority for the requests it receives.
+
source
An Evidence project binding that selects a reviewed Adapter pack route, one named connection and explicit authorised selector inputs. The route acquires and normalises facts within bounded read authority. Registry Evidence supplies the credential its target binds to the connection, never the caller's.
diff --git a/docs/site/src/content/docs/reference/posture-diagnostics.mdx b/docs/site/src/content/docs/reference/posture-diagnostics.mdx new file mode 100644 index 0000000000..a870e45c67 --- /dev/null +++ b/docs/site/src/content/docs/reference/posture-diagnostics.mdx @@ -0,0 +1,26 @@ +--- +title: Posture diagnostic codes +description: Look up a development-only configuration diagnostic by code and find the change to make for production. +status: draft +owner: registry-docs +source_repos: + - registry-stack +last_reviewed: unreviewed +doc_type: reference +locale: en +standards_referenced: [] +wide: true +--- + +import PostureDiagnosticsTable from '../../../components/PostureDiagnosticsTable.astro'; + +Search for the code in your diagnostic. If it appears twice, match the configuration key named in +the diagnostic's JSON pointer. Apply the production remedy to that setting before deploying. + +The table covers development-only settings declared by the products and shared configuration +readers in this source tree. See [Deployment posture](../../operate/deployment-posture/) for the +rules that choose a posture and the settings that require an explicit production choice. + +{/* Evidence: crates/registry-platform-config/src/posture.rs, DevelopmentSetting, FoundSetting. */} + + diff --git a/docs/site/src/content/docs/security/evidence.mdx b/docs/site/src/content/docs/security/evidence.mdx index 1229548ba5..32f996dfa1 100644 --- a/docs/site/src/content/docs/security/evidence.mdx +++ b/docs/site/src/content/docs/security/evidence.mdx @@ -143,7 +143,7 @@ connection policies fix the endpoints, authentication, and TLS a route may use. That closes off server-side request forgery (SSRF), credential forwarding, and script-directed networking. The route returns one closed lookup result, and the requirement's -[Function](../../reference/glossary/#function) returns declared typed values +[Derivation](../../reference/glossary/#derivation) returns declared typed values only. The core validates both and assembles the public evidence itself. Absence does not leak. Missing facts, script failures, audit failures, and @@ -213,7 +213,7 @@ evaluation time, and nothing else. stored code, and the other unresolved cases return the same `404`, with the same headers and body apart from the fresh trace identifier. - **Code confinement.** The code is compared in constant time and removed from the facts before any - Function runs, on every route that reads that source. It is never a source input, and it appears in + Derivation runs, on every route that reads that source. It is never a source input, and it appears in no log, audit record, or answer. - **Timing.** Evidence adds no delay, so a response can take longer when the number exists than when it does not. That can reveal whether a number exists. It reveals nothing about the code. The diff --git a/docs/site/src/content/docs/start/coordinator.mdx b/docs/site/src/content/docs/start/coordinator.mdx index 22ce72f66b..d36c2c47dd 100644 --- a/docs/site/src/content/docs/start/coordinator.mdx +++ b/docs/site/src/content/docs/start/coordinator.mdx @@ -39,7 +39,7 @@ cannot restore that definition holds the run. A workflow is built from five step types: - `call` runs one product operation. -- `choose` routes on one typed value, on a pure [Transform](../../reference/glossary/#function) +- `choose` routes on one typed value, on a pure [Transform](../../reference/glossary/#transform) written in bounded [Rhai](../../reference/glossary/#rhai), or on a `compare` of typed values that needs no Transform. In a `compare`, a value that is missing or of the wrong type fails the run instead of routing to `unmatched`. The `present` test is the exception, because it reads absence. diff --git a/docs/site/src/content/docs/tutorials/assert-a-role-bound-relationship.mdx b/docs/site/src/content/docs/tutorials/assert-a-role-bound-relationship.mdx index 991ed8baf9..5613e37fc6 100644 --- a/docs/site/src/content/docs/tutorials/assert-a-role-bound-relationship.mdx +++ b/docs/site/src/content/docs/tutorials/assert-a-role-bound-relationship.mdx @@ -68,7 +68,7 @@ subjects: Each role selects a record through the `record-by-id` [lookup](../../reference/glossary/#lookup). The `parent-record` source fetches the parent set with the `child` selector alone, and its response shape requires `complete: true`, so an -incomplete set is refused before any Function runs. `outputs` declares one Boolean, `is-parent`, so +incomplete set is refused before the Derivation runs. `outputs` declares one Boolean, `is-parent`, so the parent list never enters the assertion. {/* Evidence: products/evidence/examples/standalone/evidence.yaml, selectorInputs; diff --git a/docs/site/src/content/docs/tutorials/build-and-deploy-evidence-project.mdx b/docs/site/src/content/docs/tutorials/build-and-deploy-evidence-project.mdx index f087b38057..4179d742eb 100644 --- a/docs/site/src/content/docs/tutorials/build-and-deploy-evidence-project.mdx +++ b/docs/site/src/content/docs/tutorials/build-and-deploy-evidence-project.mdx @@ -53,7 +53,7 @@ The deployment you build here does not need the run from your first assertion; s ## Write the deployment target -The assertion provider owns the Evidence project: `assertionDefinitions`, `sources`, `functions`, +The assertion provider owns the Evidence project: `assertionDefinitions`, `sources`, `derivations`, `lookups`, `outputs`, and each `grantCeiling`. You own the environment, in a [deployment target](../../reference/glossary/#target) kept beside the project. Step out of `adult-status` and create one from the project's local settings: diff --git a/docs/site/src/content/docs/tutorials/change-a-registry-with-an-action.mdx b/docs/site/src/content/docs/tutorials/change-a-registry-with-an-action.mdx index adc99e17bf..af3aa901ef 100644 --- a/docs/site/src/content/docs/tutorials/change-a-registry-with-an-action.mdx +++ b/docs/site/src/content/docs/tutorials/change-a-registry-with-an-action.mdx @@ -71,7 +71,7 @@ actions: ``` `update-contact-email` takes a contact and an email address. Its `plan` is its -[Plan](../../reference/glossary/#planner): the one effect it has, a patch of that contact's +[Action Plan](../../reference/glossary/#action-plan): the one effect it has, a patch of that contact's `email`. `execution: {mode: immediate}` means the registry makes the change in the same request that invokes the Action. diff --git a/docs/site/src/content/docs/tutorials/connect-an-institution-source.mdx b/docs/site/src/content/docs/tutorials/connect-an-institution-source.mdx index c7f54aa775..c55349f3ac 100644 --- a/docs/site/src/content/docs/tutorials/connect-an-institution-source.mdx +++ b/docs/site/src/content/docs/tutorials/connect-an-institution-source.mdx @@ -123,14 +123,14 @@ Definition fhir-coverage-status: urn:example:requirement:coverage-record:v1 Posture: record-transformed Inputs: coverageId <- selector coverage-record@coverage-by-id.coverage_id Facts: beneficiary-reference (string), status (string) - Derive: Function derive-coverage-status + Derivation: derive-coverage-status Outputs: coverage-record-reports-active ``` The Source is the project's thin acquisition binding. It selects one route from the reviewed `fhir-read-through@1` pack, supplies `coverageId` from the fixed lookup, and names the -target-owned connection. The route returns only the two private Facts shown before the derivation -Function produces the Boolean Output. +target-owned connection. The route returns the two private Facts shown. The Derivation uses +those Facts to produce the Boolean Output. ## Read the operation from its OpenAPI description diff --git a/docs/site/src/content/docs/tutorials/evidence-from-breg.mdx b/docs/site/src/content/docs/tutorials/evidence-from-breg.mdx index e2fbfd3065..31490bbac2 100644 --- a/docs/site/src/content/docs/tutorials/evidence-from-breg.mdx +++ b/docs/site/src/content/docs/tutorials/evidence-from-breg.mdx @@ -113,22 +113,21 @@ rstack evidence source import ./registry-status-export --project ./evidence ``` The import checks every artifact's checksum, then adds the `registry-status` Source, its selector -profiles, and two Functions. It adds no assertion definition and no caller grant: the registry's -profile does not become an Evidence permission. +profiles, and its pinned Adapter pack. It grants no Evidence permission. The AssertionDefinitions and their Derivations come from the fragment in the next step. {/* Evidence: crates/registry-breg/src/evidence_source.rs; crates/registry-evidencectl/src/source_import/mod.rs, replace_project_sections. */} ## Add the assertion definitions -Copy the fragment's Functions and fixtures, then merge its definitions with +Copy the fragment's Derivation scripts and fixtures, then merge its definitions with [yq](https://github.com/mikefarah/yq) version 4: ```sh cp teaching-inputs/starter/functions/*.rhai evidence/functions/ cp teaching-inputs/starter/fixtures/*.yaml evidence/fixtures/ yq --inplace ' - .functions += load("teaching-inputs/starter/definitions.yaml.fragment").functions + .derivations += load("teaching-inputs/starter/definitions.yaml.fragment").derivations | .assertionDefinitions += load("teaching-inputs/starter/definitions.yaml.fragment").assertionDefinitions ' evidence/evidence.yaml yq '.assertionDefinitions | keys' evidence/evidence.yaml diff --git a/docs/site/src/content/docs/tutorials/first-evidence-assertion.mdx b/docs/site/src/content/docs/tutorials/first-evidence-assertion.mdx index 301f13da4a..e651226e6b 100644 --- a/docs/site/src/content/docs/tutorials/first-evidence-assertion.mdx +++ b/docs/site/src/content/docs/tutorials/first-evidence-assertion.mdx @@ -110,7 +110,7 @@ Definition adult-status: urn:example:requirement:adult-status:v1 Projection: projections/person-facts.rhai::project_facts; schema schemas/person-facts.json; digest sha256:e203f7570ea7e625e36fa155bf0b4060865b26043b8ba1dce6bcc606fca01696 Inputs: recordId <- selector subject@record-by-id.record-id Facts: birth-date (string), residence-region (string) - Derive: Function derive-adult-status + Derivation: derive-adult-status Outputs: adult ``` diff --git a/docs/site/src/content/docs/tutorials/query-breg-client.mdx b/docs/site/src/content/docs/tutorials/query-breg-client.mdx index ede2462d97..2057324b7d 100644 --- a/docs/site/src/content/docs/tutorials/query-breg-client.mdx +++ b/docs/site/src/content/docs/tutorials/query-breg-client.mdx @@ -333,7 +333,7 @@ node change_email.mjs "$contact_id" ada@analytical.example.test The registry answered each call with an ActionReceipt. It names the Action, gives the change an `applicationId`, and lists under each effect of the Action's -[Plan](../../reference/glossary/#planner), here the single effect `contact-email`, the Record it +[Action Plan](../../reference/glossary/#action-plan), here the single effect `contact-email`, the Record it changed and that Record's new revision. When the registry refuses, the client raises `BaseRegistryClientError`, and its `kind` says what diff --git a/docs/site/src/content/docs/tutorials/return-a-governed-value.mdx b/docs/site/src/content/docs/tutorials/return-a-governed-value.mdx index f1ba9d28c7..6a33e57489 100644 --- a/docs/site/src/content/docs/tutorials/return-a-governed-value.mdx +++ b/docs/site/src/content/docs/tutorials/return-a-governed-value.mdx @@ -122,7 +122,7 @@ outputs: - south ``` -A [Function](../../reference/glossary/#function) that computed any other value would not get it +A [Derivation](../../reference/glossary/#derivation) that computed any other value would not get it past Registry Evidence. One fixture case proves that by returning a value outside the list; run the region fixtures with their trace: diff --git a/docs/site/src/data/posture-diagnostics.json b/docs/site/src/data/posture-diagnostics.json new file mode 100644 index 0000000000..e868dad39d --- /dev/null +++ b/docs/site/src/data/posture-diagnostics.json @@ -0,0 +1,161 @@ +{ + "sources": [ + "crates/registry-adapter/src/payments/config.rs", + "crates/registry-breg-mcp/src/config.rs", + "crates/registry-breg-review/src/config.rs", + "crates/registry-breg-review/src/lib.rs", + "crates/registry-breg/src/compiler.rs", + "crates/registry-breg/src/field_encryption.rs", + "crates/registry-breg/src/runtime_config.rs", + "crates/registry-casework/src/config/issuers.rs", + "crates/registry-discovery/src/model.rs", + "crates/registry-documents/src/config.rs", + "crates/registry-evidence-oid4vci/src/config.rs", + "crates/registry-evidence/src/bundle.rs", + "crates/registry-evidencectl/src/check.rs", + "crates/registry-mcp-edge/src/config.rs", + "crates/registry-platform-config/src/blocks.rs", + "crates/registry-render/src/runtime.rs", + "crates/registry-session/src/config.rs" + ], + "diagnostics": [ + { + "code": "adapter.posture.payment-simulator", + "key": "provider", + "condition": "Collections are sent to a synthetic simulator", + "remedy": "Remove the simulator collection connection from the production configuration." + }, + { + "code": "breg.posture.http-public-origin", + "key": "publicOrigin", + "condition": "The registry publishes links with a plain HTTP origin", + "remedy": "Set listener.publicOrigin to an HTTPS origin." + }, + { + "code": "breg.posture.local-key-custody", + "key": "provider", + "condition": "The field-encryption data key is stored in a local file", + "remedy": "Configure the transit provider for field encryption." + }, + { + "code": "breg.posture.placeholder-identity", + "key": "canonicalBaseIri", + "condition": "The package uses a reserved placeholder registry identity", + "remedy": "Replace canonicalBaseIri and rebuild the package." + }, + { + "code": "breg.posture.review-http-authorization-endpoint", + "key": "issuer", + "condition": "The authorization endpoint discovered from signIn.issuer is plain http", + "remedy": "Publish an https authorization_endpoint in the issuer's discovery document." + }, + { + "code": "breg.posture.review-http-public-origin", + "key": "publicOrigin", + "condition": "The review page's public origin is plain http", + "remedy": "Use an https public origin." + }, + { + "code": "breg.posture.review-http-public-origin", + "key": "reviewBaseUrl", + "condition": "The review base URL is plain http", + "remedy": "Use an https review base URL." + }, + { + "code": "casework.posture.unrestricted-clients", + "key": "allowedClients", + "condition": "admits a token from every client this issuer signs for", + "remedy": "List the OAuth clients whose access tokens this issuer entry admits." + }, + { + "code": "discovery.posture.loopback-catalog-url", + "key": "catalogUrl", + "condition": "the index advertises an address on the reader's own machine", + "remedy": "Publish HTTPS URLs on non-loopback hosts." + }, + { + "code": "documents.posture.content-verification-disabled", + "key": "contentVerification", + "condition": "Finalized document versions are approved without content verification.", + "remedy": "Configure an HTTP content verifier." + }, + { + "code": "evidence.posture.credential-free-source", + "key": "authentication", + "condition": "a credential-free source connection provides no client authentication", + "remedy": "Bind an mtlsIdentity or configure an authenticated endpoint." + }, + { + "code": "evidence.posture.local-assurance", + "key": "assuranceProfile", + "condition": "local assurance permits locally held signing keys", + "remedy": "Build a production or evidence-grade package with a Transit signer." + }, + { + "code": "evidence.posture.supervised-validation", + "key": "validationMode", + "condition": "supervised validation permits a published loopback HTTP credential issuer", + "remedy": "Use validationMode: strict and publish an HTTPS credential issuer." + }, + { + "code": "evidence.posture.unrestricted-offer-gate", + "key": "allowedClients", + "condition": "an unrestricted offer gate admits all values vouched for by the issuer", + "remedy": "List the required clients and scopes explicitly." + }, + { + "code": "platform.posture.database-private-plaintext", + "key": "transport", + "condition": "The database connection is not encrypted and reaches a private network", + "remedy": "Write database.transport: verified-tls, and give the database a certificate the runtime trusts." + }, + { + "code": "platform.posture.generated-audit-key", + "key": "hashKeyCustody", + "condition": "The audit hash key was generated by a development tool", + "remedy": "Provision an audit hash key, reference it in audit.hashKeyRef, and write audit.hashKeyCustody: operator-provisioned." + }, + { + "code": "platform.posture.insecure-issuer-http", + "key": "allowInsecureHttp", + "condition": "Plain http is permitted to an issuer beyond loopback", + "remedy": "Delete allowInsecureHttp and use an https issuer." + }, + { + "code": "platform.posture.mcp-http-published-issuer", + "key": "issuer", + "condition": "The published resource server issuer is plain http", + "remedy": "Use an https issuer." + }, + { + "code": "platform.posture.mcp-http-resource", + "key": "resource", + "condition": "The protected resource identifier is plain http", + "remedy": "Use an https resource identifier." + }, + { + "code": "platform.posture.session-development-loopback", + "key": "tlsTermination", + "condition": "The session listener admits loopback HTTP in the browser and issuer endpoints", + "remedy": "Use operator-controlled-upstream TLS termination and HTTPS endpoints." + }, + { + "code": "platform.posture.test-issuer", + "key": "type", + "condition": "The issuer's signing keys come from a test issuer", + "remedy": "Write jwksSource: {type: discovery}, or a static or uri source for the real issuer." + }, + { + "code": "render.posture.local-assurance", + "key": "assuranceProfile", + "condition": "seals use a local key file and are marked as test seals", + "remedy": "Configure assuranceProfile: production and sign through Transit." + }, + { + "code": "render.posture.seals-not-served", + "key": "signing", + "condition": "the bundle declares seals, but this runtime has no signing block and renders those document types unsealed", + "remedy": "Configure signing.seals for the bundle's seals, or deploy a bundle whose documents do not declare seals." + } + ] +} diff --git a/products/adapter/examples/kobotoolbox-breg/registry.yaml b/products/adapter/examples/kobotoolbox-breg/registry.yaml index d51b709c28..4ad091a02f 100644 --- a/products/adapter/examples/kobotoolbox-breg/registry.yaml +++ b/products/adapter/examples/kobotoolbox-breg/registry.yaml @@ -44,7 +44,7 @@ recordTypes: lookups: - {id: by-source-submission, fields: [source-submission-id]} -functions: +actionPlans: register-household-plan: runtime: rhai source: scripts/register-household.rhai @@ -70,8 +70,8 @@ actions: - {id: respondent-name, apiName: respondentName, type: string, required: true, minimumLength: 1, maximumLength: 256, classification: internal} - {id: household-size, apiName: householdSize, type: int64, required: true, classification: internal} plan: - type: function - function: register-household-plan + type: scripted + actionPlan: register-household-plan inputs: [source-submission-id, respondent-name, household-size] writes: - {id: household, target: {recordType: household}, operation: create, fields: [owner, source-submission-id, respondent-name, household-size]} diff --git a/products/adapter/examples/qfield-postgis/registry/README.md b/products/adapter/examples/qfield-postgis/registry/README.md index 2643cb816d..844af3552e 100644 --- a/products/adapter/examples/qfield-postgis/registry/README.md +++ b/products/adapter/examples/qfield-postgis/registry/README.md @@ -12,7 +12,7 @@ The `ingestion` profile accepts only the `adapter-field-ingestion` service client with the `registry:write` scope. It grants no ordinary Record CRUD. Each Plan fixes `owner` to that synthetic client identity, and target authority requires the resulting owner to equal the verified `sub` claim. The two Plans -are deliberately duplicated because `registry.action-plan/v1` function inputs +are deliberately duplicated because `registry.action-plan/v1` Action Plan inputs accept scalar values, not the geometry and structured values used here. ## Inputs diff --git a/products/breg/AGENTS.md b/products/breg/AGENTS.md index d9150593bf..78f5fb1a10 100644 --- a/products/breg/AGENTS.md +++ b/products/breg/AGENTS.md @@ -36,6 +36,11 @@ BReg does not inherit its publication contract or serve as a generic replacement The build posture never enters the package. A development-only property of a package must be derivable from its content and refused by production load, as the placeholder identity is. +Verified package closure reads translate historical Action Plan keys for +predecessor planning and rehearsal. Authored projects and modules accept only +the current keys. Remove the translation when no supported predecessor carries +the old spelling. + ## Source neutrality `products/breg/scripts/check_source_neutrality.py` forbids fixture-specific diff --git a/products/breg/CHANGELOG.md b/products/breg/CHANGELOG.md index f805182b82..7fe9919540 100644 --- a/products/breg/CHANGELOG.md +++ b/products/breg/CHANGELOG.md @@ -7,6 +7,22 @@ explicit fields. - The Evidence provider `trustedJwksRef` key set is read as a public document and refused when it holds a private or symmetric member. +- BREAKING: BReg uses Action Plans for scripted Action logic. In `registry.yaml` + and `module.yaml`, rename `functions` to `actionPlans`. In an Action's + `plan`, change `type: function` to `type: scripted` and rename `function` to + `actionPlan`. Keep the existing IDs, script or Wasm sources, input and write + declarations, and `registry.action-plan/v1` ABI. Update `bregctl` explanation + consumers to read `plan.type: scripted` and the `plan.actionPlan` details. + +- BREAKING: BReg Action Plan diagnostics use `breg.action-plan.id-collision` + and `breg.action-plan.contract-invalid` in place of `breg.function.*`. + Replace `breg.action.function-unknown`, `breg.action.function-contract-invalid`, + and `breg.action.function-input-unknown` with `breg.action.plan-unknown`, + `breg.action.plan-contract-invalid`, and `breg.action.plan-input-unknown`. + Replace `breg.action.plan-function-unavailable` with `breg.action.plan-unavailable`. + Expect diagnostic paths under `/actionPlans/` and the human explain label + `Action Plan` in place of `plan function`. + - BReg Record, history, relationship and External View list contracts use `limit` and `cursor`. Update first-page requests and continue on the same route with the returned cursor and access profile. The server still reads earlier query @@ -14,6 +30,23 @@ takes `limit=`, and clients write `cursor` in persisted continuations. They still read prior `skiptoken` continuations. +- BREAKING: v0.51 `bregctl check --package` refuses sealed v0.49 packages whose + generated OpenAPI uses `$top`, with `breg.package.generated-artifacts-refused`. + Keep the old package intact and use its + matching v0.49 tools and runtime until cutover. Update the authored Action + Plan keys, then use v0.51 `bregctl test` on a disposable database and + `bregctl package` to build the successor. Pass the active old package as + `--baseline-package` to both commands. Check the new package, run + `bregctl plan` and the reviewed `bregctl apply`, then serve the successor + with the matching v0.51 runtime. + +- BREAKING: A generated artifact that was changed and then resealed with + matching digests now reports `breg.package.generated-artifacts-refused` + instead of `breg.package.integrity-refused`. Update alerts for that refusal. + Strict checks use the same code for historical Action Plan spelling, even + when the generated artifacts match. A predecessor may use one spelling + per source file. + ## 0.49.0 - 2026-12-01 - BREAKING: `bregctl data export` JSONL uses `recordId` and `revisionId` in place of v0.48.0's `recordIdentifier` and `revisionIdentifier`. Migration: Update export file consumers for both keys. Finish an in-progress export with the matching v0.48.0 `bregctl`, serving runtime, and compiled package before upgrading, or start a fresh output and checkpoint pair after upgrading. Convert archived exports on a separate copy to preserve any checkpoint digest. diff --git a/products/breg/acceptance/farmer-landholding-evidence/evidence/provider/evidence.yaml b/products/breg/acceptance/farmer-landholding-evidence/evidence/provider/evidence.yaml index 62679b2dcd..d8b623fe9f 100644 --- a/products/breg/acceptance/farmer-landholding-evidence/evidence/provider/evidence.yaml +++ b/products/breg/acceptance/farmer-landholding-evidence/evidence/provider/evidence.yaml @@ -11,7 +11,7 @@ lookups: type: string minimumBytes: 3 maximumBytes: 77 -functions: +derivations: derive-status: interface: assertion-derive/v1 source: functions/status.rhai @@ -62,7 +62,7 @@ assertionDefinitions: acquisition: source: source-status derive: - function: derive-status + derivation: derive-status outputs: active: concept: urn:example:farmer:active @@ -95,7 +95,7 @@ assertionDefinitions: acquisition: source: source-category derive: - function: derive-category + derivation: derive-category outputs: category: concept: urn:example:farmer:category diff --git a/products/breg/acceptance/farmer-landholding-evidence/registry.yaml b/products/breg/acceptance/farmer-landholding-evidence/registry.yaml index b207c56245..b652c3e5d2 100644 --- a/products/breg/acceptance/farmer-landholding-evidence/registry.yaml +++ b/products/breg/acceptance/farmer-landholding-evidence/registry.yaml @@ -127,8 +127,8 @@ "mode": "immediate" }, "plan": { - "type": "function", - "function": "register-landholding-plan", + "type": "scripted", + "actionPlan": "register-landholding-plan", "inputs": [ "farmer-prefix", "farmer-number", @@ -229,8 +229,8 @@ "mode": "immediate" }, "plan": { - "type": "function", - "function": "check-procedure-plan", + "type": "scripted", + "actionPlan": "check-procedure-plan", "inputs": [ "farmer-prefix", "farmer-number", @@ -404,7 +404,7 @@ ] } }, - "functions": { + "actionPlans": { "register-landholding-plan": { "runtime": "rhai", "source": "scripts/register-landholding.rhai", diff --git a/products/breg/acceptance/person-registration-rhai/registry.yaml b/products/breg/acceptance/person-registration-rhai/registry.yaml index fc0ef23bcc..b225d326a2 100644 --- a/products/breg/acceptance/person-registration-rhai/registry.yaml +++ b/products/breg/acceptance/person-registration-rhai/registry.yaml @@ -197,7 +197,7 @@ ] } }, - "functions": { + "actionPlans": { "register-person-plan": { "runtime": "rhai", "source": "scripts/register-person.rhai", @@ -242,8 +242,8 @@ } ], "plan": { - "type": "function", - "function": "register-person-plan", + "type": "scripted", + "actionPlan": "register-person-plan", "inputs": [ "identifier", "given-name", @@ -339,8 +339,8 @@ ] }, "plan": { - "type": "function", - "function": "register-with-registration-plan", + "type": "scripted", + "actionPlan": "register-with-registration-plan", "inputs": [ "identifier", "given-name", diff --git a/products/breg/acceptance/reviewed-evidence-journey/tests/run_live.py b/products/breg/acceptance/reviewed-evidence-journey/tests/run_live.py index d4698e1976..fd357fd762 100644 --- a/products/breg/acceptance/reviewed-evidence-journey/tests/run_live.py +++ b/products/breg/acceptance/reviewed-evidence-journey/tests/run_live.py @@ -479,16 +479,15 @@ def activate_evidence(h, source_project, source, origin): h.ctl("evidencectl", "source-import", "source", "import", exported, "--project", project) model = yaml.safe_load((project / "evidence.yaml").read_text()) fragment = yaml.safe_load((ROOT / "products/breg/evidence/starter/definitions.yaml.fragment").read_text()) - # Import starts from a valid standalone project. Only the imported HTTP - # Source and its Functions remain in this composition's final model. + # Keep the imported HTTP Source and the teaching fragment's Derivation. model["sources"].pop("record-status") model["lookups"].pop("record-by-code-v1") - model["functions"] = { - id: function - for id, function in model["functions"].items() + model["derivations"] = { + id: derivation + for id, derivation in model["derivations"].items() if id not in ("record-status-extract", "extract-record-active") } - model["functions"]["record-active"] = fragment["functions"]["record-active"] + model["derivations"]["record-active"] = fragment["derivations"]["record-active"] model["assertionDefinitions"] = {"record-active": fragment["assertionDefinitions"]["record-active"]} yaml_write(project / "evidence.yaml", model) for directory, name in [("functions", "record-active.rhai"), ("fixtures", "record-active.yaml")]: diff --git a/products/breg/contracts/explain/ActionsExplanation.schema.json b/products/breg/contracts/explain/ActionsExplanation.schema.json index cd27d8e423..b4bf49b3ba 100644 --- a/products/breg/contracts/explain/ActionsExplanation.schema.json +++ b/products/breg/contracts/explain/ActionsExplanation.schema.json @@ -380,13 +380,13 @@ "additionalProperties": false, "required": [ "type", - "function" + "actionPlan" ], "properties": { "type": { - "const": "function" + "const": "scripted" }, - "function": { + "actionPlan": { "type": "object", "additionalProperties": false, "required": [ @@ -430,7 +430,7 @@ }, "limits": { "type": "object", - "x-registry-passthrough": "Compiled function resource ceilings, owned and bounded by the engine." + "x-registry-passthrough": "Compiled Action Plan resource ceilings, owned and bounded by the engine." }, "writes": { "type": "array" @@ -476,7 +476,7 @@ } } ], - "description": "Fixed plans expose exact authored mutations and execution order. Function plans expose reviewed source identity and write ceilings, never placeholder mutations." + "description": "Fixed plans expose exact authored mutations and execution order. Scripted plans expose reviewed source identity and write ceilings, never placeholder mutations." }, "commitGuards": { "type": "array" diff --git a/products/breg/contracts/explain/LifecycleExplanation.schema.json b/products/breg/contracts/explain/LifecycleExplanation.schema.json index f717446a5e..011fe15223 100644 --- a/products/breg/contracts/explain/LifecycleExplanation.schema.json +++ b/products/breg/contracts/explain/LifecycleExplanation.schema.json @@ -61,7 +61,7 @@ "id": "exact-receipt-recovery" }, { - "description": "Submission validates the typed Action input and runs the shared bounded plan evaluator. Function execution and external Evidence acquisition hold no database transaction or row lock. The controller rechecks the observed revision before freezing the submission.", + "description": "Submission validates the typed Action input and runs the shared bounded plan evaluator. Action Plan execution and external Evidence acquisition hold no database transaction or row lock. The controller rechecks the observed revision before freezing the submission.", "events": [ "submit" ], diff --git a/products/breg/contracts/explain/ProposalsExplanation.schema.json b/products/breg/contracts/explain/ProposalsExplanation.schema.json index 7535acee3c..a731d95ea5 100644 --- a/products/breg/contracts/explain/ProposalsExplanation.schema.json +++ b/products/breg/contracts/explain/ProposalsExplanation.schema.json @@ -204,13 +204,13 @@ "additionalProperties": false, "required": [ "type", - "function" + "actionPlan" ], "properties": { "type": { - "const": "function" + "const": "scripted" }, - "function": { + "actionPlan": { "type": "object", "additionalProperties": false, "required": [ @@ -254,7 +254,7 @@ }, "limits": { "type": "object", - "x-registry-passthrough": "Compiled function resource ceilings, owned and bounded by the engine." + "x-registry-passthrough": "Compiled Action Plan resource ceilings, owned and bounded by the engine." }, "writes": { "type": "array" @@ -300,7 +300,7 @@ } } ], - "description": "Fixed plans expose exact authored mutations and execution order. Function plans expose reviewed source identity and write ceilings, never placeholder mutations." + "description": "Fixed plans expose exact authored mutations and execution order. Scripted plans expose reviewed source identity and write ceilings, never placeholder mutations." }, "commitGuards": { "type": "array" diff --git a/products/breg/contracts/security-invariant-matrix.yaml b/products/breg/contracts/security-invariant-matrix.yaml index f2fcaf4178..2316d0aea8 100644 --- a/products/breg/contracts/security-invariant-matrix.yaml +++ b/products/breg/contracts/security-invariant-matrix.yaml @@ -205,7 +205,7 @@ invariants: - {"id": "BREG-SEC-194", "state": "enforced", "targetWave": "W5", "threat": "A successor package leaves pending Proposals with inspection and cancellation grants that cannot produce a usable profile-bound condition.", "enforcementPoint": "Successor activation recovery guard requires Get inspection and one Proposal grant with Cancel plus Get or List; ordinary profile-bound ETags remain enforced.", "refusal": "Refuse activation before changing the ledger or pending work when no complete recovery permission exists. Retain same-profile Get+Cancel and List+Cancel recovery.", "negativeId": "BREG-NEG-194", "negativeTest": {"path": "crates/registry-breg/tests/postgres_proposal_recovery_permissions.rs", "name": "refused_split_recovery_successor_preserves_activation_and_pending_work"}} - {"id": "BREG-SEC-195", "state": "enforced", "targetWave": "W5", "threat": "A module enables autonomous Record timer work, or a contributed timer becomes active without an exact root-project grant.", "enforcementPoint": "Compiler admission of root-project timerGrants after module composition, with exact Record type and timer identity matching.", "refusal": "Refuse module-contributed grants, missing or dangling root grants, duplicate authority, and every composed timer without its exact root grant before package compilation.", "negativeId": "BREG-NEG-195", "negativeTest": {"path": "crates/registry-breg/tests/timer_authoring.rs", "name": "module_timer_definition_requires_and_uses_root_enablement"}} - {"id": "BREG-SEC-196", "state": "enforced", "targetWave": "W5", "threat": "An autonomous timer Action is also caller-invokable or enters the Proposal lifecycle, creating a second authority path or unattended review decision.", "enforcementPoint": "Timer compiler binds only an immediate Action that has no public Invoke permission, route, or access entry.", "refusal": "Refuse a timer whose Action is publicly invokable or Proposal-based before emitting the compiled timer or system grant.", "negativeId": "BREG-NEG-196", "negativeTest": {"path": "crates/registry-breg/tests/timer_authoring.rs", "name": "timer_refuses_public_invoke_and_non_immediate_actions"}} - - {"id": "BREG-SEC-197", "state": "enforced", "targetWave": "W5", "threat": "A timer invokes remote Function or Evidence capability and performs autonomous work outside the exact local compiled mutation plan.", "enforcementPoint": "Timer Action compilation rejects Function planning, Evidence declarations, commit Evidence, and their capabilities before deriving system authority.", "refusal": "Refuse every timer Action that declares Function, Evidence, or commit-Evidence capability; emit no runnable timer binding.", "negativeId": "BREG-NEG-197", "negativeTest": {"path": "crates/registry-breg/tests/timer_authoring.rs", "name": "timer_refuses_remote_function_and_evidence_capabilities"}} + - {"id": "BREG-SEC-197", "state": "enforced", "targetWave": "W5", "threat": "A timer uses a remote Action Plan capability or Evidence to perform autonomous work outside the exact local compiled mutation plan.", "enforcementPoint": "Timer Action compilation checks resolved Action Plan capabilities and Evidence and commit-Evidence declarations before deriving system authority.", "refusal": "Refuse a timer Action with a resolved remote capability, Evidence, or commit Evidence. Emit no runnable timer binding.", "negativeId": "BREG-NEG-197", "negativeTest": {"path": "crates/registry-breg/tests/timer_authoring.rs", "name": "timer_refuses_remote_function_and_evidence_capabilities"}} - {"id": "BREG-SEC-198", "state": "enforced", "targetWave": "W5", "threat": "An autonomous timer issues or changes consent without a caller or institution-controlled consent decision at execution time.", "enforcementPoint": "Timer Action compilation rejects consent-issuance capability before deriving system authority.", "refusal": "Refuse a timer Action that issues consent and emit no runnable timer binding.", "negativeId": "BREG-NEG-198", "negativeTest": {"path": "crates/registry-breg/tests/timer_authoring.rs", "name": "timer_refuses_consent_issuance_capability"}} # Runtime Proposal-policy backstop: crates/registry-breg/tests/postgres_record_timers.rs::timer_runtime_refuses_a_compiler_unreachable_proposal_required_target - {"id": "BREG-SEC-199", "state": "enforced", "targetWave": "W5", "threat": "A timer reads beyond its exact anchor and declared secondary-Get facts, mutates another existing Record, bypasses Proposal-required mutation policy, or exceeds the ordinary Action target or snapshot ceilings through compiler-added authority.", "enforcementPoint": "Timer-specific system-grant derivation and post-derivation Action bounds count the exact anchor Get and materialized fields once, preserve each declared secondary Get's exact Record type and read-field ceiling, preserve bounded create effects, and retain controlled-target admission.", "refusal": "Refuse another existing-Record mutation target, a Proposal-required target, an extra exact target beyond the ceiling, or reads beyond the snapshot ceiling; grant only exact anchor control, predicate, and mapped-input reads, declared secondary Gets, the admitted anchor mutation, and bounded creates.", "negativeId": "BREG-NEG-199", "negativeTest": {"path": "crates/registry-breg/tests/timer_authoring.rs", "name": "timer_system_authority_is_anchor_and_create_bounded"}} diff --git a/products/breg/evidence/offline-starter/evidence.yaml b/products/breg/evidence/offline-starter/evidence.yaml index 4a56613412..921c164ef3 100644 --- a/products/breg/evidence/offline-starter/evidence.yaml +++ b/products/breg/evidence/offline-starter/evidence.yaml @@ -11,7 +11,7 @@ lookups: type: string minimumBytes: 4 maximumBytes: 64 -functions: +derivations: extract-record-active: interface: assertion-derive/v1 source: functions/extract-record-active.rhai @@ -53,7 +53,7 @@ assertionDefinitions: acquisition: source: record-status derive: - function: extract-record-active + derivation: extract-record-active outputs: active: concept: urn:example:concept:extract-record-active:active diff --git a/products/breg/evidence/public-check/definitions.yaml.fragment b/products/breg/evidence/public-check/definitions.yaml.fragment index b6d9748904..dfcaf5fe41 100644 --- a/products/breg/evidence/public-check/definitions.yaml.fragment +++ b/products/breg/evidence/public-check/definitions.yaml.fragment @@ -1,4 +1,4 @@ -functions: +derivations: record-check: interface: assertion-derive/v1 source: functions/record-check.rhai @@ -28,7 +28,7 @@ assertionDefinitions: acquisition: source: registry-check derive: - function: record-check + derivation: record-check outputs: status: concept: urn:example:concept:record-check:status diff --git a/products/breg/evidence/starter/definitions.yaml.fragment b/products/breg/evidence/starter/definitions.yaml.fragment index 67308d1c45..c136bd8ec4 100644 --- a/products/breg/evidence/starter/definitions.yaml.fragment +++ b/products/breg/evidence/starter/definitions.yaml.fragment @@ -1,4 +1,4 @@ -functions: +derivations: record-active: interface: assertion-derive/v1 source: functions/record-active.rhai @@ -32,7 +32,7 @@ assertionDefinitions: acquisition: source: registry-status derive: - function: record-active + derivation: record-active outputs: active: concept: urn:example:concept:record-active:active @@ -71,7 +71,7 @@ assertionDefinitions: acquisition: source: registry-status derive: - function: record-status-pair + derivation: record-status-pair outputs: currently_active: concept: urn:example:concept:record-status-pair:currently_active diff --git a/products/breg/evidence/tests/verify-composition.py b/products/breg/evidence/tests/verify-composition.py index 7167397bc2..eba59427e9 100644 --- a/products/breg/evidence/tests/verify-composition.py +++ b/products/breg/evidence/tests/verify-composition.py @@ -159,7 +159,7 @@ def author_public_check(project: Path, export: Path, binaries: dict[str, Path], environment=environment) authored = read(project / "evidence.yaml") fragment = read(PUBLIC_CHECK / "definitions.yaml.fragment") - authored["functions"].update(fragment["functions"]) + authored["derivations"].update(fragment["derivations"]) authored["assertionDefinitions"].update(fragment["assertionDefinitions"]) write(project / "evidence.yaml", authored) for name in ["functions", "fixtures", "schemas"]: @@ -387,7 +387,7 @@ def verify_live_public_check(workspace: Path, binaries: dict[str, Path]) -> dict project_path = project / "evidence.yaml" authored = read(project_path) authored["assertionDefinitions"].pop("extract-record-active") - authored["functions"].pop("extract-record-active") + authored["derivations"].pop("extract-record-active") authored["lookups"].pop("record-by-code-v1") authored["sources"].pop("record-status") write(project_path, authored) @@ -569,7 +569,7 @@ def verify(workspace: Path, binaries: dict[str, Path]) -> dict: "source import must create no assertion meaning or caller grant" ) assert not (project / "sources").exists(), "Sources belong to EvidenceProject" - assert not any(name.startswith("registry-status-") for name in imported["functions"]), ( + assert not any(name.startswith("registry-status-") for name in imported["derivations"]), ( "source preparation and extraction remain in the pinned pack closure" ) assert (project / "adapter-packs/registry-status/pack.yaml").is_file() @@ -577,7 +577,7 @@ def verify(workspace: Path, binaries: dict[str, Path]) -> dict: # Ordinary authoring follows import. This fragment is never passed as a project. fragment = read(INPUTS / "starter/definitions.yaml.fragment") - imported["functions"].update(fragment["functions"]) + imported["derivations"].update(fragment["derivations"]) imported["assertionDefinitions"].update(fragment["assertionDefinitions"]) write(project / "evidence.yaml", imported) for directory in ["functions", "fixtures"]: diff --git a/products/breg/examples/facility/registry.yaml b/products/breg/examples/facility/registry.yaml index bbf78f0153..9862655b18 100644 --- a/products/breg/examples/facility/registry.yaml +++ b/products/breg/examples/facility/registry.yaml @@ -89,7 +89,7 @@ valueTypes: city: {type: string, minimumLength: 1, maximumLength: 120} postal-code: {type: string, minimumLength: 1, maximumLength: 24} -functions: +actionPlans: correct-address-plan: runtime: rhai source: plans/correct-address.rhai @@ -171,8 +171,8 @@ actions: - {id: city, typeRef: city, required: true, classification: internal} - {id: postal-code, apiName: postalCode, typeRef: postal-code, required: true, classification: internal} plan: - type: function - function: correct-address-plan + type: scripted + actionPlan: correct-address-plan inputs: [facility, address-line, city, postal-code] writes: - id: facility-address diff --git a/products/breg/examples/formats/ctl-report.json b/products/breg/examples/formats/ctl-report.json index 8218066a3f..dca536846a 100644 --- a/products/breg/examples/formats/ctl-report.json +++ b/products/breg/examples/formats/ctl-report.json @@ -446,7 +446,7 @@ } ], "plan": { - "function": { + "actionPlan": { "abi": "registry.action-plan/v1", "boundInputs": [ "address-line", @@ -513,7 +513,7 @@ } ] }, - "type": "function" + "type": "scripted" }, "revision": "sha256:efb20d40704ae6c133b660f2fe3d556b4a00ee5478a5871cf1fd026e7d7b6b7a" }, @@ -1664,13 +1664,13 @@ "protocol": "id.registrystack.org/protocols/review/v1" } ], - "revision": "sha256:1299e3136c3c836bd427f50c437dc505ef83a5bcc7fba275bd92c68cf2a0daf0", + "revision": "sha256:06542eaf3a1889e945ffcf40177281b530dddd9636bebd93d396d920d5468fef", "statisticalDatasets": [] }, "kind": "BRegCtlReport", "ok": true, "profile": "authoring", - "revision": "sha256:1299e3136c3c836bd427f50c437dc505ef83a5bcc7fba275bd92c68cf2a0daf0", + "revision": "sha256:06542eaf3a1889e945ffcf40177281b530dddd9636bebd93d396d920d5468fef", "status": "complete", "version": "0.51.0-dev" } diff --git a/products/breg/examples/formats/explain/access-explanation.json b/products/breg/examples/formats/explain/access-explanation.json index a3f78f3aa2..f22a71b2e6 100644 --- a/products/breg/examples/formats/explain/access-explanation.json +++ b/products/breg/examples/formats/explain/access-explanation.json @@ -462,7 +462,7 @@ } ], "plan": { - "function": { + "actionPlan": { "abi": "registry.action-plan/v1", "boundInputs": [ "address-line", @@ -529,7 +529,7 @@ } ] }, - "type": "function" + "type": "scripted" }, "revision": "sha256:efb20d40704ae6c133b660f2fe3d556b4a00ee5478a5871cf1fd026e7d7b6b7a" }, diff --git a/products/breg/examples/formats/explain/actions-explanation.json b/products/breg/examples/formats/explain/actions-explanation.json index d495ab4ca7..a1e699b4db 100644 --- a/products/breg/examples/formats/explain/actions-explanation.json +++ b/products/breg/examples/formats/explain/actions-explanation.json @@ -423,7 +423,7 @@ } ], "plan": { - "function": { + "actionPlan": { "abi": "registry.action-plan/v1", "boundInputs": [ "address-line", @@ -490,7 +490,7 @@ } ] }, - "type": "function" + "type": "scripted" }, "revision": "sha256:efb20d40704ae6c133b660f2fe3d556b4a00ee5478a5871cf1fd026e7d7b6b7a" }, @@ -1641,6 +1641,6 @@ "protocol": "id.registrystack.org/protocols/review/v1" } ], - "revision": "sha256:1299e3136c3c836bd427f50c437dc505ef83a5bcc7fba275bd92c68cf2a0daf0", + "revision": "sha256:06542eaf3a1889e945ffcf40177281b530dddd9636bebd93d396d920d5468fef", "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 00460b5132..0ea8cd4259 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:3e6e9c8b87b447c38fd9cb691552ea3b6cbda66603fc02242a0c74a1d4053a5c", + "revision": "sha256:8cf1cb766e3f797a09c318be409416e4c8b87a17681ef0143bfc45cd11146cbd", "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 06fcf8f6e0..19498c4969 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:3e6e9c8b87b447c38fd9cb691552ea3b6cbda66603fc02242a0c74a1d4053a5c", + "revision": "sha256:8cf1cb766e3f797a09c318be409416e4c8b87a17681ef0143bfc45cd11146cbd", "statisticalDatasets": [ { "accessProfiles": { diff --git a/products/breg/examples/formats/explain/model-explanation.json b/products/breg/examples/formats/explain/model-explanation.json index 975e227b1b..2963ee0e0f 100644 --- a/products/breg/examples/formats/explain/model-explanation.json +++ b/products/breg/examples/formats/explain/model-explanation.json @@ -424,7 +424,7 @@ } ], "plan": { - "function": { + "actionPlan": { "abi": "registry.action-plan/v1", "boundInputs": [ "address-line", @@ -491,7 +491,7 @@ } ] }, - "type": "function" + "type": "scripted" }, "revision": "sha256:efb20d40704ae6c133b660f2fe3d556b4a00ee5478a5871cf1fd026e7d7b6b7a" }, @@ -1275,16 +1275,16 @@ "/valueTypes/postal-code/type", "/valueTypes/postal-code/minimumLength", "/valueTypes/postal-code/maximumLength", - "/functions", - "/functions/correct-address-plan", - "/functions/correct-address-plan/runtime", - "/functions/correct-address-plan/source", - "/functions/correct-address-plan/entrypoint", - "/functions/correct-address-plan/abi", - "/functions/correct-address-plan/capabilities", - "/functions/correct-address-plan/limits", - "/functions/correct-address-plan/limits/maximumOperations", - "/functions/correct-address-plan/limits/maximumOutputBytes", + "/actionPlans", + "/actionPlans/correct-address-plan", + "/actionPlans/correct-address-plan/runtime", + "/actionPlans/correct-address-plan/source", + "/actionPlans/correct-address-plan/entrypoint", + "/actionPlans/correct-address-plan/abi", + "/actionPlans/correct-address-plan/capabilities", + "/actionPlans/correct-address-plan/limits", + "/actionPlans/correct-address-plan/limits/maximumOperations", + "/actionPlans/correct-address-plan/limits/maximumOutputBytes", "/actions", "/actions/register-facility", "/actions/register-facility/display", @@ -1463,7 +1463,7 @@ "/actions/correct-address/inputs/3/classification", "/actions/correct-address/plan", "/actions/correct-address/plan/type", - "/actions/correct-address/plan/function", + "/actions/correct-address/plan/actionPlan", "/actions/correct-address/plan/inputs", "/actions/correct-address/plan/inputs/0", "/actions/correct-address/plan/inputs/1", @@ -2602,7 +2602,7 @@ "protocol": "id.registrystack.org/protocols/review/v1" } ], - "revision": "sha256:1299e3136c3c836bd427f50c437dc505ef83a5bcc7fba275bd92c68cf2a0daf0", + "revision": "sha256:06542eaf3a1889e945ffcf40177281b530dddd9636bebd93d396d920d5468fef", "statisticalDatasets": [], "version": "0.1.0" } diff --git a/products/breg/examples/formats/explain/proposals-explanation.json b/products/breg/examples/formats/explain/proposals-explanation.json index 4569798f4e..dbadcdbc76 100644 --- a/products/breg/examples/formats/explain/proposals-explanation.json +++ b/products/breg/examples/formats/explain/proposals-explanation.json @@ -389,7 +389,7 @@ } ], "plan": { - "function": { + "actionPlan": { "abi": "registry.action-plan/v1", "boundInputs": [ "address-line", @@ -456,7 +456,7 @@ } ] }, - "type": "function" + "type": "scripted" }, "revision": "sha256:efb20d40704ae6c133b660f2fe3d556b4a00ee5478a5871cf1fd026e7d7b6b7a" }, diff --git a/products/breg/fixtures/action-plan-branches/registry.yaml b/products/breg/fixtures/action-plan-branches/registry.yaml index 7cbb8cd479..535333490b 100644 --- a/products/breg/fixtures/action-plan-branches/registry.yaml +++ b/products/breg/fixtures/action-plan-branches/registry.yaml @@ -17,7 +17,7 @@ recordTypes: - {id: effective-on, type: date, classification: internal} - {id: expires-on, type: date, classification: internal} - {id: renewal-on, type: date, classification: internal} -functions: +actionPlans: create-entry-plan: {runtime: rhai, source: plans/create.rhai, entrypoint: plan, abi: registry.action-plan/v1} invalid-copy-plan: {runtime: rhai, source: plans/invalid-copy.rhai, entrypoint: plan, abi: registry.action-plan/v1} create-dated-entry-plan: {runtime: rhai, source: plans/create-dated-entry.rhai, entrypoint: plan, abi: registry.action-plan/v1} @@ -27,8 +27,8 @@ actions: inputs: - {id: label, type: string, required: true, maximumLength: 64, classification: internal} plan: - type: function - function: create-entry-plan + type: scripted + actionPlan: create-entry-plan inputs: [label] writes: - {id: entry, target: {recordType: entry}, operation: create, fields: [label]} @@ -39,8 +39,8 @@ actions: inputs: - {id: note, type: string, maximumLength: 64, classification: internal} plan: - type: function - function: invalid-copy-plan + type: scripted + actionPlan: invalid-copy-plan inputs: [note] writes: - {id: entry, target: {recordType: entry}, operation: create, fields: [label]} @@ -49,8 +49,8 @@ actions: inputs: - {id: label, type: string, required: true, maximumLength: 64, classification: internal} plan: - type: function - function: create-dated-entry-plan + type: scripted + actionPlan: create-dated-entry-plan inputs: [label] writes: - {id: entry, target: {recordType: entry}, operation: create, fields: [label, effective-on, expires-on, renewal-on]} diff --git a/products/breg/generated/authoring/registry-module.schema.json b/products/breg/generated/authoring/registry-module.schema.json index 2ae04de68e..7f55675f08 100644 --- a/products/breg/generated/authoring/registry-module.schema.json +++ b/products/breg/generated/authoring/registry-module.schema.json @@ -634,6 +634,32 @@ } ] }, + "ActionPlanCapabilitySource": { + "enum": [ + "evidence" + ], + "type": "string" + }, + "ActionPlanLimitsSource": { + "additionalProperties": false, + "properties": { + "maximumOperations": { + "default": 10000, + "format": "uint64", + "maximum": 100000, + "minimum": 1, + "type": "integer" + }, + "maximumOutputBytes": { + "default": 8192, + "format": "uint32", + "maximum": 2097152, + "minimum": 1, + "type": "integer" + } + }, + "type": "object" + }, "ActionPlanSource": { "oneOf": [ { @@ -659,7 +685,7 @@ { "additionalProperties": false, "properties": { - "function": { + "actionPlan": { "type": "string" }, "inputs": { @@ -676,7 +702,7 @@ "type": "array" }, "type": { - "const": "function", + "const": "scripted", "type": "string" }, "writes": { @@ -688,7 +714,7 @@ }, "required": [ "type", - "function", + "actionPlan", "inputs", "writes" ], @@ -2590,32 +2616,6 @@ } ] }, - "FunctionCapabilitySource": { - "enum": [ - "evidence" - ], - "type": "string" - }, - "FunctionLimitsSource": { - "additionalProperties": false, - "properties": { - "maximumOperations": { - "default": 10000, - "format": "uint64", - "maximum": 100000, - "minimum": 1, - "type": "integer" - }, - "maximumOutputBytes": { - "default": 8192, - "format": "uint32", - "maximum": 2097152, - "minimum": 1, - "type": "integer" - } - }, - "type": "object" - }, "GeoJsonSource": { "additionalProperties": false, "properties": { @@ -4419,6 +4419,54 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "properties": { + "actionPlans": { + "additionalProperties": { + "additionalProperties": false, + "properties": { + "abi": { + "const": "registry.action-plan/v1", + "type": "string" + }, + "capabilities": { + "default": [], + "items": { + "$ref": "#/$defs/ActionPlanCapabilitySource" + }, + "type": "array", + "uniqueItems": true + }, + "entrypoint": { + "type": "string" + }, + "limits": { + "$ref": "#/$defs/ActionPlanLimitsSource", + "default": { + "maximumOperations": 10000, + "maximumOutputBytes": 8192 + } + }, + "runtime": { + "$ref": "#/$defs/ActionHandlerKindSource" + }, + "source": { + "type": "string" + } + }, + "required": [ + "runtime", + "source", + "entrypoint", + "abi" + ], + "type": "object" + }, + "default": {}, + "description": "Written as a mapping from each Action Plan id to the rest of the plan\n(CFG-ID-5) and held sorted by id.", + "propertyNames": { + "$ref": "#/$defs/LocalId" + }, + "type": "object" + }, "actions": { "additionalProperties": { "additionalProperties": false, @@ -4726,54 +4774,6 @@ }, "type": "object" }, - "functions": { - "additionalProperties": { - "additionalProperties": false, - "properties": { - "abi": { - "const": "registry.action-plan/v1", - "type": "string" - }, - "capabilities": { - "default": [], - "items": { - "$ref": "#/$defs/FunctionCapabilitySource" - }, - "type": "array", - "uniqueItems": true - }, - "entrypoint": { - "type": "string" - }, - "limits": { - "$ref": "#/$defs/FunctionLimitsSource", - "default": { - "maximumOperations": 10000, - "maximumOutputBytes": 8192 - } - }, - "runtime": { - "$ref": "#/$defs/ActionHandlerKindSource" - }, - "source": { - "type": "string" - } - }, - "required": [ - "runtime", - "source", - "entrypoint", - "abi" - ], - "type": "object" - }, - "default": {}, - "description": "Written as a mapping from each function id to the rest of the function\n(CFG-ID-5) and held sorted by id.", - "propertyNames": { - "$ref": "#/$defs/LocalId" - }, - "type": "object" - }, "id": { "$ref": "#/$defs/LocalId", "description": "Stable module identifier, referenced by the project's module lock." diff --git a/products/breg/generated/authoring/registry-project.schema.json b/products/breg/generated/authoring/registry-project.schema.json index d660e07e08..a23f45bdfa 100644 --- a/products/breg/generated/authoring/registry-project.schema.json +++ b/products/breg/generated/authoring/registry-project.schema.json @@ -670,6 +670,32 @@ ], "type": "object" }, + "ActionPlanCapabilitySource": { + "enum": [ + "evidence" + ], + "type": "string" + }, + "ActionPlanLimitsSource": { + "additionalProperties": false, + "properties": { + "maximumOperations": { + "default": 10000, + "format": "uint64", + "maximum": 100000, + "minimum": 1, + "type": "integer" + }, + "maximumOutputBytes": { + "default": 8192, + "format": "uint32", + "maximum": 2097152, + "minimum": 1, + "type": "integer" + } + }, + "type": "object" + }, "ActionPlanSource": { "oneOf": [ { @@ -695,7 +721,7 @@ { "additionalProperties": false, "properties": { - "function": { + "actionPlan": { "type": "string" }, "inputs": { @@ -712,7 +738,7 @@ "type": "array" }, "type": { - "const": "function", + "const": "scripted", "type": "string" }, "writes": { @@ -724,7 +750,7 @@ }, "required": [ "type", - "function", + "actionPlan", "inputs", "writes" ], @@ -2978,32 +3004,6 @@ } ] }, - "FunctionCapabilitySource": { - "enum": [ - "evidence" - ], - "type": "string" - }, - "FunctionLimitsSource": { - "additionalProperties": false, - "properties": { - "maximumOperations": { - "default": 10000, - "format": "uint64", - "maximum": 100000, - "minimum": 1, - "type": "integer" - }, - "maximumOutputBytes": { - "default": 8192, - "format": "uint32", - "maximum": 2097152, - "minimum": 1, - "type": "integer" - } - }, - "type": "object" - }, "GeoJsonSource": { "additionalProperties": false, "properties": { @@ -6083,6 +6083,54 @@ }, "type": "object" }, + "actionPlans": { + "additionalProperties": { + "additionalProperties": false, + "properties": { + "abi": { + "const": "registry.action-plan/v1", + "type": "string" + }, + "capabilities": { + "default": [], + "items": { + "$ref": "#/$defs/ActionPlanCapabilitySource" + }, + "type": "array", + "uniqueItems": true + }, + "entrypoint": { + "type": "string" + }, + "limits": { + "$ref": "#/$defs/ActionPlanLimitsSource", + "default": { + "maximumOperations": 10000, + "maximumOutputBytes": 8192 + } + }, + "runtime": { + "$ref": "#/$defs/ActionHandlerKindSource" + }, + "source": { + "type": "string" + } + }, + "required": [ + "runtime", + "source", + "entrypoint", + "abi" + ], + "type": "object" + }, + "default": {}, + "description": "Written as a mapping from each Action Plan id to the rest of the plan\n(CFG-ID-5) and held sorted by id.", + "propertyNames": { + "$ref": "#/$defs/LocalId" + }, + "type": "object" + }, "actions": { "additionalProperties": { "additionalProperties": false, @@ -6301,54 +6349,6 @@ }, "type": "object" }, - "functions": { - "additionalProperties": { - "additionalProperties": false, - "properties": { - "abi": { - "const": "registry.action-plan/v1", - "type": "string" - }, - "capabilities": { - "default": [], - "items": { - "$ref": "#/$defs/FunctionCapabilitySource" - }, - "type": "array", - "uniqueItems": true - }, - "entrypoint": { - "type": "string" - }, - "limits": { - "$ref": "#/$defs/FunctionLimitsSource", - "default": { - "maximumOperations": 10000, - "maximumOutputBytes": 8192 - } - }, - "runtime": { - "$ref": "#/$defs/ActionHandlerKindSource" - }, - "source": { - "type": "string" - } - }, - "required": [ - "runtime", - "source", - "entrypoint", - "abi" - ], - "type": "object" - }, - "default": {}, - "description": "Written as a mapping from each function id to the rest of the function\n(CFG-ID-5) and held sorted by id.", - "propertyNames": { - "$ref": "#/$defs/LocalId" - }, - "type": "object" - }, "kind": { "const": "BRegProject", "type": "string" diff --git a/products/breg/scripts/test_generated_gates.py b/products/breg/scripts/test_generated_gates.py index 376ff48367..a68b4bc672 100755 --- a/products/breg/scripts/test_generated_gates.py +++ b/products/breg/scripts/test_generated_gates.py @@ -223,13 +223,22 @@ def test_editor_schemas_expose_native_breg_without_retired_aliases(self) -> None for name in ("registry-project.schema.json", "registry-module.schema.json"): schema = json.loads((authoring / name).read_text()) properties = schema["properties"] - self.assertTrue({"recordTypes", "valueTypes", "functions", "actions"} <= properties.keys(), name) + self.assertTrue({"recordTypes", "valueTypes", "actionPlans", "actions"} <= properties.keys(), name) + self.assertNotIn("functions", properties) self.assertNotIn("entities", properties) self.assertNotIn("extendEntities", properties) action = properties["actions"]["additionalProperties"]["properties"] self.assertLessEqual({"plan", "execution", "commitGuards"}, action.keys()) self.assertNotIn("handler", action) self.assertNotIn("effects", action) + plan_variants = { + variant["properties"]["type"]["const"]: variant + for variant in schema["$defs"]["ActionPlanSource"]["oneOf"] + } + self.assertEqual(set(plan_variants), {"fixed", "scripted"}) + scripted = plan_variants["scripted"] + self.assertIn("actionPlan", scripted["required"]) + self.assertNotIn("function", scripted["properties"]) if name == "registry-project.schema.json": permissions = schema["$defs"]["ProposalPermissionSource"]["properties"] self.assertLessEqual( diff --git a/products/breg/wasm-handler-sdk/admission/src/lib.rs b/products/breg/wasm-handler-sdk/admission/src/lib.rs index c0de468730..0857ed4ea0 100644 --- a/products/breg/wasm-handler-sdk/admission/src/lib.rs +++ b/products/breg/wasm-handler-sdk/admission/src/lib.rs @@ -24,10 +24,10 @@ use std::path::PathBuf; -use registry_breg::compiler::{CompileProfile, compile_project_with_assets}; -use registry_breg::contract::{ModuleAssetSource, parse_project_json}; +use registry_breg::compiler::{compile_project_with_assets, CompileProfile}; +use registry_breg::contract::{parse_project_json, ModuleAssetSource}; use registry_platform_script::wasm::{Backend, Budgets, Executor}; -use serde_json::{Value, json}; +use serde_json::{json, Value}; /// Every module produced by `scripts/build.sh`, as `(file name, bytes)`. /// Fails with instructions when no artifact exists. @@ -109,14 +109,14 @@ pub fn phone_project() -> Value { {"id":"phone","apiName":"phone","type":"string","maximumLength":32,"required":true,"classification":"restricted"} ] }}, - "functions":{"phone-plan": {"runtime":"wasm","source":"wasm/handler.wasm","entrypoint":"handle","abi":"registry.action-plan/v1"}}, + "actionPlans":{"phone-plan": {"runtime":"wasm","source":"wasm/handler.wasm","entrypoint":"handle","abi":"registry.action-plan/v1"}}, "actions":{"normalize-phone": {"execution":{"mode":"immediate"}, "inputs":[ {"id":"raw-phone","apiName":"rawPhone","type":"string","maximumLength":64,"required":true,"classification":"restricted"}, {"id":"default-region","apiName":"defaultRegion","type":"string","maximumLength":64,"required":true,"classification":"restricted"} ], "plan":{ - "type":"function","function":"phone-plan","inputs":["raw-phone","default-region"], + "type":"scripted","actionPlan":"phone-plan","inputs":["raw-phone","default-region"], "refusals":[ {"code":"invalid-phone","label":"The phone number is not a valid phone number."}, {"code":"invalid-region","label":"The region is not a usable phone region."} diff --git a/products/coordinator/examples/applications-registry/registry.yaml b/products/coordinator/examples/applications-registry/registry.yaml index 63e1f91383..ea5aa8fbb4 100644 --- a/products/coordinator/examples/applications-registry/registry.yaml +++ b/products/coordinator/examples/applications-registry/registry.yaml @@ -18,7 +18,7 @@ recordTypes: - {id: owner, type: string, required: true, maximumLength: 80, classification: internal} - {id: information-requested, apiName: informationRequested, type: boolean, required: true, classification: internal} - {id: reason, type: string, required: false, minimumLength: 1, maximumLength: 256, classification: internal} -functions: +actionPlans: request-information-plan: runtime: rhai source: scripts/request-information.rhai @@ -31,8 +31,8 @@ actions: - {id: application, apiName: applicationId, type: reference, target: application, required: true, classification: internal} - {id: reason, type: string, required: true, minimumLength: 1, maximumLength: 256, classification: internal} plan: - type: function - function: request-information-plan + type: scripted + actionPlan: request-information-plan inputs: [application, reason] refusals: - {code: invalid-reason, label: The information request requires a nonblank reason.} diff --git a/products/evidence/CHANGELOG.md b/products/evidence/CHANGELOG.md index cd68a88dda..d650c956e4 100644 --- a/products/evidence/CHANGELOG.md +++ b/products/evidence/CHANGELOG.md @@ -6,6 +6,21 @@ `secretProviders.file.mountPolicy`, keeping the Version 1 rule that a key file is never readable by other users. `evidencectl doctor` reports the same refusal, and the store-provision document does not accept the member. +- BREAKING: Rename EvidenceProject `functions` to `derivations` and each + `derive.function` reference to `derive.derivation`. Apply the same names + when reading `evidencectl check` and `explain` JSON reports. Existing Rhai + `assertion-derive/v1` scripts and their asset paths carry over. Run + `evidencectl check PROJECT` after updating the authored project. Regenerate + TypeScript and Python with `evidencectl types` and replace imports of + `FunctionBindings` with `DerivationBindings`. + +- BREAKING: Replace `evidence.project.function-*` authoring codes with + `evidence.project.derivation-*` and `evidence.project.duplicate-function-label` + with `evidence.project.duplicate-derivation-label`. Editor asset checks now + use `evidence.derivation.*`, for example `evidence.derivation.compile`. + Replace `function` and `function-file` in editor reference codes with + `derivation` and `derivation-file`. + - BREAKING: Generated OID4VP clients use `sessionReference` and `requestId` in `path` arguments. Replace `reference` for session status and `request_id` for wallet requests and responses. Operation names and concrete HTTP URLs stay the same. diff --git a/products/evidence/README.md b/products/evidence/README.md index 4370f566cc..df9f38cfe8 100644 --- a/products/evidence/README.md +++ b/products/evidence/README.md @@ -8,7 +8,7 @@ source effects. One `evidence` process serves one operator-controlled trust domain. The immutable bundle contains compiled definitions, digest-pinned Adapter packs, thin Source -bindings, reviewed derivation Functions, schemas, signing identity and target +bindings, reviewed Derivations, schemas, signing identity and target bindings. A separate runtime file binds process resources, secret mounts, signer transport, audit storage and TLS trust. Complete target authority is activated separately with durable history. Its @@ -16,10 +16,10 @@ grants stay inside the package ceilings; a running process retains its activated snapshot until restart. Rust owns authentication, complete-grant authorization, selector minimization, -bounded Adapter pack execution, bounded derivation Function execution, output +bounded Adapter pack execution, bounded Derivation evaluation, output validation, signing and audit. One reviewed Adapter pack route owns each complete provider acquisition and returns a schema-validated private FactSet. The only -authored Evidence Function interface is `assertion-derive/v1`; it derives only +authored Evidence Derivation interface is `assertion-derive/v1`; it derives only declared outputs from those facts and its explicitly declared selector inputs. Authorization and selector checks precede secret resolution and source access. Durable access audit precedes acquisition, and the terminal disclosure audit @@ -43,7 +43,7 @@ approval or downstream write authority. The maintained runtime contracts include the [operator contract](OPERATOR-CONTRACT.md), [wire and security contracts](contracts/README.md) and the -[trusted derivation Function ABI](https://docs.registrystack.org/reference/evidence-request-adapter-api/). Generated +[trusted Derivation ABI](https://docs.registrystack.org/reference/evidence-request-adapter-api/). Generated contracts and authoring schemas are reproduced by their documented generators. ## Start a development run @@ -103,7 +103,7 @@ Checks resolve no secrets and make no dependency request. `explain` shows each definition's Source, pinned pack and route, named connection, acquisition posture, minimized selector-to-input bindings, typed private fact -names, derivation Function and declared output names. The JSON report's +names, Derivation and declared output names. The JSON report's `assertionDefinitions` entries also carry each definition's `validitySeconds`. `evidencectl check --file ` checks one tooling file offline, including a diff --git a/products/evidence/examples/fhir/evidence.yaml b/products/evidence/examples/fhir/evidence.yaml index 86b1e819e3..3fba266ed6 100644 --- a/products/evidence/examples/fhir/evidence.yaml +++ b/products/evidence/examples/fhir/evidence.yaml @@ -25,7 +25,7 @@ lookups: type: string minimumBytes: 1 maximumBytes: 64 -functions: +derivations: derive-coverage-status: interface: assertion-derive/v1 source: functions/derive-coverage-status.rhai @@ -78,7 +78,7 @@ assertionDefinitions: acquisition: source: coverage-record derive: - function: derive-coverage-status + derivation: derive-coverage-status selectorInputs: - role: patient alternatives: @@ -120,7 +120,7 @@ assertionDefinitions: acquisition: source: organization-record derive: - function: derive-healthcare-establishment + derivation: derive-healthcare-establishment outputs: healthcare-provider-record-active: concept: urn:example:concept:healthcare-provider-record-active:v1 diff --git a/products/evidence/examples/operator-active/evidence.yaml b/products/evidence/examples/operator-active/evidence.yaml index e41892edae..f7a0714c40 100644 --- a/products/evidence/examples/operator-active/evidence.yaml +++ b/products/evidence/examples/operator-active/evidence.yaml @@ -11,7 +11,7 @@ lookups: type: string minimumBytes: 1 maximumBytes: 64 -functions: +derivations: derive-operator: interface: assertion-derive/v1 source: functions/derive-operator.rhai @@ -50,7 +50,7 @@ assertionDefinitions: acquisition: source: operator-register derive: - function: derive-operator + derivation: derive-operator outputs: operator-active: concept: urn:example:concept:operator-active:v1 diff --git a/products/evidence/examples/public-check/evidence.yaml b/products/evidence/examples/public-check/evidence.yaml index 2433dfc189..8fae30618b 100644 --- a/products/evidence/examples/public-check/evidence.yaml +++ b/products/evidence/examples/public-check/evidence.yaml @@ -11,7 +11,7 @@ lookups: type: string minimumBytes: 4 maximumBytes: 32 -functions: +derivations: derive-certificate-check: interface: assertion-derive/v1 source: functions/derive-certificate-check.rhai @@ -50,7 +50,7 @@ assertionDefinitions: acquisition: source: certificate-record derive: - function: derive-certificate-check + derivation: derive-certificate-check outputs: status: concept: urn:example:concept:certificate-status:v1 diff --git a/products/evidence/examples/standalone/evidence.yaml b/products/evidence/examples/standalone/evidence.yaml index a5122fe64e..49fd215d71 100644 --- a/products/evidence/examples/standalone/evidence.yaml +++ b/products/evidence/examples/standalone/evidence.yaml @@ -11,7 +11,7 @@ lookups: type: string minimumBytes: 1 maximumBytes: 64 -functions: +derivations: derive-adult-status: interface: assertion-derive/v1 source: functions/derive-adult-status.rhai @@ -79,7 +79,7 @@ assertionDefinitions: acquisition: source: person-record derive: - function: derive-adult-status + derivation: derive-adult-status outputs: adult: concept: urn:example:concept:adult-status:v1 @@ -115,7 +115,7 @@ assertionDefinitions: acquisition: source: person-record derive: - function: derive-residence-region + derivation: derive-residence-region outputs: region: concept: urn:example:concept:residence-region:v1 @@ -154,7 +154,7 @@ assertionDefinitions: acquisition: source: licence-record derive: - function: derive-licence-status + derivation: derive-licence-status outputs: licence-status: concept: urn:example:concept:licence-status:v1 @@ -197,7 +197,7 @@ assertionDefinitions: acquisition: source: parent-record derive: - function: derive-parent-relationship + derivation: derive-parent-relationship selectorInputs: - role: candidate-parent alternatives: diff --git a/products/evidence/examples/wallet-presentation/evidence.yaml b/products/evidence/examples/wallet-presentation/evidence.yaml index 56513124be..8e0baacd7d 100644 --- a/products/evidence/examples/wallet-presentation/evidence.yaml +++ b/products/evidence/examples/wallet-presentation/evidence.yaml @@ -38,7 +38,7 @@ lookups: type: string minimumBytes: 1 maximumBytes: 256 -functions: +derivations: derive-credential-possession: interface: assertion-derive/v1 source: functions/derive-credential-possession.rhai @@ -99,7 +99,7 @@ assertionDefinitions: lookups: - wallet-session derive: - function: derive-credential-possession + derivation: derive-credential-possession outputs: credential-presented: concept: urn:example:concept:credential-presented:v1 @@ -136,7 +136,7 @@ assertionDefinitions: lookups: - wallet-session-with-name derive: - function: derive-name-match + derivation: derive-name-match selectorInputs: - role: subject alternatives: diff --git a/products/evidence/fuzz/corpus/authoring_project/project.yaml b/products/evidence/fuzz/corpus/authoring_project/project.yaml index ab6804001e..341499153c 100644 --- a/products/evidence/fuzz/corpus/authoring_project/project.yaml +++ b/products/evidence/fuzz/corpus/authoring_project/project.yaml @@ -11,7 +11,7 @@ lookups: type: string minimumBytes: 1 maximumBytes: 64 -functions: +derivations: derive-operator: interface: assertion-derive/v1 source: functions/derive-operator.rhai @@ -55,7 +55,7 @@ assertionDefinitions: acquisition: source: operator-register derive: - function: derive-operator + derivation: derive-operator outputs: operator-active: concept: urn:example:concept:operator-active:v1 diff --git a/products/evidence/reference/authoring-projects/CONFIG.md b/products/evidence/reference/authoring-projects/CONFIG.md index b85d8026b7..512aca1475 100644 --- a/products/evidence/reference/authoring-projects/CONFIG.md +++ b/products/evidence/reference/authoring-projects/CONFIG.md @@ -1,6 +1,6 @@ # Evidence authoring reference -Author one `EvidenceProject` in `evidence.yaml`, with named Sources and Functions. +Author one `EvidenceProject` in `evidence.yaml`, with named Sources and Derivations. A separate `EvidenceTarget` binds that project to one environment, and an `EvidenceTargetAuthority` supplies complete grants for that target. These closed v1alpha1 formats are adopter tooling, generated from the same pure Rust model @@ -18,7 +18,7 @@ Keys are case-sensitive, and unknown keys are refused. The current formats are: | Input | `kind` | Owns | | --- | --- | --- | -| `evidence.yaml` | `EvidenceProject` | Definitions, named Sources and Functions, selectors, Outputs and package ceilings | +| `evidence.yaml` | `EvidenceProject` | Definitions, named Sources and Derivations, selectors, Outputs and package ceilings | | `.yaml` | `EvidenceTarget` | Project selection, target authority reference, connections and process bindings | | `-authority.yaml` | `EvidenceTargetAuthority` | Identity profiles and complete target grants | | `access/clients/.yaml` | `EvidenceAccessClient` | Local caller registration and access-profile membership | @@ -27,11 +27,11 @@ Keys are case-sensitive, and unknown keys are refused. The current formats are: The schemas state each format's complete envelope. There are no separate question, source, selector or access-policy document formats. Sources, -lookups and Functions are members of `evidence.yaml`. +lookups and Derivations are members of `evidence.yaml`. -Keep reviewed Function programs under `functions/`, fixture documents under +Keep reviewed Derivation scripts under `functions/`, fixture documents under `fixtures/`, and referenced codelists, JSON Schemas and SQL statements as plain -project assets. Function programs are bounded to 64 KiB. Referenced assets stay +project assets. Derivation scripts are bounded to 64 KiB. Referenced assets stay inside the project and cannot traverse symbolic links. `.generated/` and `.evidence/` hold disposable local runtime material and request artifacts. A project contains no deployment credential values. @@ -44,7 +44,7 @@ that check and inspect reports show. The optional `project.label` and `project.description` name and explain the project for readers; a top-level `label` or `description` is refused. The compiled bundle carries only the id. Stable identifiers connect `assertionDefinitions`, `sources`, -`lookups` and `functions`, each a map keyed by its identifier. +`lookups` and `derivations`, each a map keyed by its identifier. Optional `label` and `description` fields are presentation metadata. They do not change a definition's behavior revision; presentation bytes included in a package remain covered by its integrity digest. @@ -60,7 +60,7 @@ credentials or source calls. URI-only requests still carry the resolved revision in their signed assertion. The revision covers this definition's behavior and transitive Source, -Function, selector, Output, asset and package-ceiling dependencies. Unrelated +Derivation, selector, Output, asset and package-ceiling dependencies. Unrelated definitions, presentation and target bindings do not churn it. Existing issued assertions keep their original revision and trust bindings. @@ -97,13 +97,13 @@ rejects a fact or an item. Evidence compares the check code only after the Source returns a record, so a record that failed a bound, a pattern, a vocabulary or a required member would answer `source.unavailable` to a caller without the code and show that the record exists. Check content in the derive -Function, which runs after the comparison. The rule reads the schema, not the +Derivation, which runs after the comparison. The rule reads the schema, not the Source script: a hand-written script must also omit a value whose type differs from the schema and must not throw on one record's content. Each rule has its own diagnostic in `evidencectl check`. Declaring `publicCheck` opens nothing on its own; the target authority's `publicCheck` activation does. -## Sources, acquisition and Functions +## Sources, acquisition and Derivations Each Source selects one reviewed Adapter `pack` by id and version, one `route` and one named `connection`. Its `inputs` map route input names to explicit @@ -157,9 +157,9 @@ finite operation budget and absolute deadline. The retired tagged acquisition kinds and Source `request`, `response`, `prepare`, `extract` and `batch` fields are refused rather than converted into packs. -Each `functions` entry is keyed by its stable identifier and has a reviewed -`source` asset and the `assertion-derive/v1` interface. `derive.function` -selects that Function and `derive.parameters` carries reviewed requirement +Each `derivations` entry is keyed by its stable identifier and has a reviewed +`source` asset and the `assertion-derive/v1` interface. `derive.derivation` +selects that Derivation and `derive.parameters` carries reviewed requirement parameters. A completed matched lookup supplies its private facts; other lookup outcomes stop before derivation. Derivation receives only its separately declared authorized selector inputs and returns the declared Outputs. It cannot authorize, choose @@ -171,14 +171,14 @@ pack scripts use the separate Adapter exchange ABI. package disclosure ceiling, independently constrained by complete grants. It does not create a provider-side batching interface. -An authored `assertion-derive/v1` Function returns an array whose entries each +An authored `assertion-derive/v1` Derivation returns an array whose entries each have exactly `output` and `value`. `output` names a local Output declared by the calling definition, for example `#{output: "region", value: facts["residence-region"]}`. The compiler maps those names to the declared public concept identifiers in the compiled runtime ABI. Do not return runtime `concept_id` entries from an authored -Function. Unknown, duplicate, missing or malformed outputs are refused. +Derivation. Unknown, duplicate, missing or malformed outputs are refused. -`explain` exposes Function interfaces, typed call sites, capabilities, digests +`explain` exposes Derivation interfaces, typed call sites, capabilities, digests and the Source-to-Fact-to-Output flow without source values or secrets. `types` generates TypeScript or Python declarations from that same model. A scalar FactSet value does not become public merely because its type is visible. @@ -238,9 +238,10 @@ Function to `assertion-derive/v1` does not migrate its behavior. `connection` and explicit selector `inputs`. Replace each definition's acquisition program with `acquisition: {source: }`. Keep the Requirement URI, selector authority, Outputs and derivation meaning. -3. Remove acquisition Functions from the authored `functions` list after their - behavior is represented in the pack. Keep requirement derivations under - `assertion-derive/v1`. Update the named target connection's endpoints to +3. Replace the legacy `functions` list with a `derivations` map keyed by each + retained `assertion-derive/v1` Derivation's identifier. Rename each + `derive.function` reference to `derive.derivation`. Keep acquisition logic + in the reviewed pack. Update the named target connection's endpoints to match the pack; credentials remain target secret references. A 0.44.0 flat connection moves its endpoint members under one entry per pack endpoint: @@ -355,8 +356,7 @@ Only explicitly mapped fields enter the generated request. The generated request bounds. Unsupported shapes and bounds need an explicitly reviewed pack route. The generated preparation and extraction files belong to the owned Adapter -pack and each receives the Adapter `exchange` argument. They are not Evidence -Functions. A run +pack and each receives the Adapter `exchange` argument. A run without `--map-selector` keeps the incomplete mechanical draft workflow. ## Selector and Output fields @@ -380,10 +380,10 @@ fit that ceiling. Codelist paths name plain YAML or JSON assets under `codelists/`, and the declared version must match the reviewed asset. An assertion's `derive.selectorInputs` explicitly exposes selector fields to -its named derive Function. Each entry names a subject `role` and an +its named Derivation. Each entry names a subject `role` and an `alternatives` list. Each alternative names a declared selector `profile` and a nonempty unique `fields` list from that profile. The role and profile must -also belong to the definition's subjects. This reference grants the Function +also belong to the definition's subjects. This reference gives the Derivation access to those fields during derivation; it does not grant a caller access or include those private fields in the public assertion. @@ -590,7 +590,7 @@ contract. ### `evidence.yaml` -The normalized project document owns stable source, selector-profile, function, +The normalized project document owns stable source, selector-profile, derivation, assertion-definition, and output identifiers. Presentation labels and descriptions remain optional metadata. @@ -606,7 +606,7 @@ assertionDefinitions.*.acquisition.holderPresented.lookups[] assertionDefinitions.*.acquisition.holderPresented.source assertionDefinitions.*.acquisition.source assertionDefinitions.*.derive -assertionDefinitions.*.derive.function +assertionDefinitions.*.derive.derivation assertionDefinitions.*.derive.parameters assertionDefinitions.*.derive.selectorInputs assertionDefinitions.*.derive.selectorInputs[] @@ -679,12 +679,12 @@ assertionDefinitions.*.subjects[].role assertionDefinitions.*.subjects[].selectors assertionDefinitions.*.subjects[].selectors[] assertionDefinitions.*.validitySeconds -functions -functions.* -functions.*.description -functions.*.interface -functions.*.label -functions.*.source +derivations +derivations.* +derivations.*.description +derivations.*.interface +derivations.*.label +derivations.*.source kind lookups lookups.* diff --git a/products/evidence/reference/authoring-projects/SOURCE-EXPORT.md b/products/evidence/reference/authoring-projects/SOURCE-EXPORT.md index a483cd0a03..b93bc937a0 100644 --- a/products/evidence/reference/authoring-projects/SOURCE-EXPORT.md +++ b/products/evidence/reference/authoring-projects/SOURCE-EXPORT.md @@ -128,7 +128,7 @@ existing definitions without requiring a target, local credentials, or a first definition. It includes each existing derivation's fact reads, so a next fact schema that no longer declares a fact a derivation reads fails structural validation with `evidence.project.derivation-fact-undeclared` -([CONFIG.md](CONFIG.md#sources-acquisition-and-functions)). The report identifies its +([CONFIG.md](CONFIG.md#sources-acquisition-and-derivations)). The report identifies its validation kind explicitly. Target validation runs the ordinary compiled-bundle and fixture checks. If the current project cannot yet compile with that target, as before an initial source diff --git a/products/evidence/reference/deployment-targets/shared/evidence-project/README.md b/products/evidence/reference/deployment-targets/shared/evidence-project/README.md index 78cf528daf..5502e56791 100644 --- a/products/evidence/reference/deployment-targets/shared/evidence-project/README.md +++ b/products/evidence/reference/deployment-targets/shared/evidence-project/README.md @@ -1,7 +1,7 @@ # Shared Evidence project Place the ordinary editable EvidenceProject here: selectors, fixed -Sources, named Functions, schemas, AssertionDefinitions, derivations, codelists, and synthetic +Sources, named Derivations, schemas, AssertionDefinitions, codelists, and synthetic fixtures. Keep environment identities, endpoints, public service keys, Transit versions, runtime paths, and secret references in the complete environment targets beside this directory. The template target and authority use project diff --git a/products/evidence/reference/request-adapter/deployment-projects/CONFIG.md b/products/evidence/reference/request-adapter/deployment-projects/CONFIG.md index e4090ae3cd..2545c46ece 100644 --- a/products/evidence/reference/request-adapter/deployment-projects/CONFIG.md +++ b/products/evidence/reference/request-adapter/deployment-projects/CONFIG.md @@ -1008,7 +1008,7 @@ credentials to another authority. ## Authoring and production-build workflow Treat the editable `EvidenceProject` as reviewed source code. -It contains `evidence.yaml`, owned Adapter packs, derivation Functions, schemas, +It contains `evidence.yaml`, owned Adapter packs, named Derivations, schemas, codelists, and sanitized fixtures. The OpenAPI form of `evidencectl init` retains a provider description for pack authoring, and `source suggest` emits an incomplete pack and Source binding for diff --git a/products/evidence/source-recipes/dhis2-tracker/fixture-validation/assertion-definitions.yaml b/products/evidence/source-recipes/dhis2-tracker/fixture-validation/assertion-definitions.yaml index 379cac9186..34c62f27d1 100644 --- a/products/evidence/source-recipes/dhis2-tracker/fixture-validation/assertion-definitions.yaml +++ b/products/evidence/source-recipes/dhis2-tracker/fixture-validation/assertion-definitions.yaml @@ -15,7 +15,7 @@ - role: subject selectors: [dhis2-tracked-entity-id-v1] acquisition: {source: dhis2-tracker} - derive: {function: derive-active-status} + derive: {derivation: derive-active-status} outputs: active: concept: urn:example:concept:dhis2-recipe-active-status:v1 diff --git a/products/evidence/source-recipes/dhis2-tracker/fixture-validation/evidence.yaml b/products/evidence/source-recipes/dhis2-tracker/fixture-validation/evidence.yaml index 11f70dac9c..eb4e11a6a5 100644 --- a/products/evidence/source-recipes/dhis2-tracker/fixture-validation/evidence.yaml +++ b/products/evidence/source-recipes/dhis2-tracker/fixture-validation/evidence.yaml @@ -8,7 +8,7 @@ lookups: maximumAggregateBytes: 8 fields: id: {type: string, minimumBytes: 1, maximumBytes: 8} -functions: +derivations: derive-active-status: interface: assertion-derive/v1 source: functions/derive-active-status.rhai @@ -39,7 +39,7 @@ assertionDefinitions: audiences: [urn:example:audience:source-recipe-validator] subjects: [{role: seed, selectors: [validation-seed]}] acquisition: {source: validation-seed} - derive: {function: validation-seed-derive} + derive: {derivation: validation-seed-derive} outputs: matched: {concept: 'urn:example:concept:source-recipe-validation-seed:v1', type: boolean} validitySeconds: 60 diff --git a/products/evidence/source-recipes/opencrvs-event-search/fixture-validation/assertion-definitions.yaml b/products/evidence/source-recipes/opencrvs-event-search/fixture-validation/assertion-definitions.yaml index 08fc9ca5a0..36161b03b0 100644 --- a/products/evidence/source-recipes/opencrvs-event-search/fixture-validation/assertion-definitions.yaml +++ b/products/evidence/source-recipes/opencrvs-event-search/fixture-validation/assertion-definitions.yaml @@ -15,7 +15,7 @@ - role: child selectors: [opencrvs-tracking-id-v1] acquisition: {source: opencrvs-event-search} - derive: {function: derive-registered-parent} + derive: {derivation: derive-registered-parent} outputs: registered-parent-present: concept: urn:example:concept:opencrvs-recipe-registered-parent:v1 diff --git a/products/evidence/source-recipes/opencrvs-event-search/fixture-validation/evidence.yaml b/products/evidence/source-recipes/opencrvs-event-search/fixture-validation/evidence.yaml index 6eca91351d..7cbfe31683 100644 --- a/products/evidence/source-recipes/opencrvs-event-search/fixture-validation/evidence.yaml +++ b/products/evidence/source-recipes/opencrvs-event-search/fixture-validation/evidence.yaml @@ -8,7 +8,7 @@ lookups: maximumAggregateBytes: 8 fields: id: {type: string, minimumBytes: 1, maximumBytes: 8} -functions: +derivations: derive-registered-parent: interface: assertion-derive/v1 source: functions/derive-registered-parent.rhai @@ -39,7 +39,7 @@ assertionDefinitions: audiences: [urn:example:audience:source-recipe-validator] subjects: [{role: seed, selectors: [validation-seed]}] acquisition: {source: validation-seed} - derive: {function: validation-seed-derive} + derive: {derivation: validation-seed-derive} outputs: matched: {concept: 'urn:example:concept:source-recipe-validation-seed:v1', type: boolean} validitySeconds: 60 diff --git a/products/identifiers/generated/catalog.v1.json b/products/identifiers/generated/catalog.v1.json index c00e98e06a..a8f7431a3d 100644 --- a/products/identifiers/generated/catalog.v1.json +++ b/products/identifiers/generated/catalog.v1.json @@ -5850,11 +5850,11 @@ "description": "Base Registry Engine bregctl explain output JSON Schemas, written by hand and held to bregctl's output by its contract test.", "source": { "path": "products/breg/contracts/explain/LifecycleExplanation.schema.json", - "sha256": "56f3cb89b5feaa96796bcd575dc25776cd4251d58f4f6621e11676907838f952" + "sha256": "6b1e7b817a6d38a99de07315432a0ad883f6a0675fc15d4602a4d596a58cf555" }, "artifact": { "path": "products/breg/contracts/explain/LifecycleExplanation.schema.json", - "sha256": "56f3cb89b5feaa96796bcd575dc25776cd4251d58f4f6621e11676907838f952", + "sha256": "6b1e7b817a6d38a99de07315432a0ad883f6a0675fc15d4602a4d596a58cf555", "mediaType": "application/schema+json" } }, diff --git a/products/platform/config-conventions-exceptions.yaml b/products/platform/config-conventions-exceptions.yaml index ae22d72693..710c2414cf 100644 --- a/products/platform/config-conventions-exceptions.yaml +++ b/products/platform/config-conventions-exceptions.yaml @@ -37,6 +37,12 @@ # # The entries were seeded from the lint's `--list --format json` output and # classified by rule, format stability, and schema origin; edit them by hand. +# +# CFG-CHANGE-1 sealed package compatibility for breg/project and breg/module: +# The integrity-verified package closure reader translates the old Action Plan +# keys for predecessor planning and rehearsal. The public authoring readers +# still accept one spelling. Remove the translation when no supported +# predecessor package carries the old keys. apiVersion: id.registrystack.org/formats/platform/config-conventions-exceptions/v1alpha1 kind: PlatformConfigConventionsExceptions diff --git a/products/platform/config-formats.yaml b/products/platform/config-formats.yaml index d97c85b1f9..4609123107 100644 --- a/products/platform/config-formats.yaml +++ b/products/platform/config-formats.yaml @@ -2895,7 +2895,7 @@ formats: idList: none set: /assertionDefinitions/adult-status/representations reference: /assertionDefinitions/adult-status/acquisition/source - relativePath: /functions/derive-adult-status/source + relativePath: /derivations/derive-adult-status/source securityMembers: - pointer: /assertionDefinitions/*/grantCeiling/authorities whenOmitted: refused diff --git a/release/scripts/rehearse-upgrade.py b/release/scripts/rehearse-upgrade.py index ab14064de7..fca61e2a07 100644 --- a/release/scripts/rehearse-upgrade.py +++ b/release/scripts/rehearse-upgrade.py @@ -1795,7 +1795,12 @@ def stage_upgrade(self) -> Evidence: current.move_project_to_current_shape() project_path = current.project / "evidence.yaml" project = load_yaml(project_path) - if move_evidence_key(project, "selectorProfiles", "lookups"): + changed = move_evidence_key(project, "selectorProfiles", "lookups") + changed |= move_evidence_key(project, "functions", "derivations") + for definition in project.get("assertionDefinitions", {}).values(): + if "derive" in definition: + changed |= move_evidence_key(definition["derive"], "function", "derivation") + if changed: dump_yaml(project_path, project) target_path = current.target / "target.yaml" diff --git a/release/scripts/test_rehearse_upgrade.py b/release/scripts/test_rehearse_upgrade.py index a5cad536a2..6723045090 100644 --- a/release/scripts/test_rehearse_upgrade.py +++ b/release/scripts/test_rehearse_upgrade.py @@ -1232,6 +1232,11 @@ def authored(self, evidence: Any, legacy: bool) -> tuple[dict, dict, dict]: {"subjects": [{"role": "subject", profile: "record-reference"}]}]}}} project = {**self.CURRENT_PROJECT, ("selectorProfiles" if legacy else "lookups"): { "record-reference": {}}} + if not legacy: + project["derivations"] = project.pop("functions") + reference = "function" if legacy else "derivation" + project["assertionDefinitions"] = {"record-status": {"derive": { + reference: "derive-record-status", "parameters": {"mode": "read"}}}} dump_json(evidence.target / "target.yaml", target) dump_json(evidence.target / "authority.yaml", authority) dump_json(evidence.project / "evidence.yaml", project) @@ -1249,6 +1254,12 @@ def test_stage_copies_authoring_migrates_legacy_and_leaves_current_shape_alone(s migrated_project = MODULE.load_yaml(current.project / "evidence.yaml") self.assertEqual(migrated_project["lookups"], {"record-reference": {}}) self.assertNotIn("selectorProfiles", migrated_project) + self.assertEqual(migrated_project["derivations"], { + "derive-record-status": {"source": "functions/derive.rhai"}}) + self.assertNotIn("functions", migrated_project) + self.assertEqual(migrated_project["assertionDefinitions"], { + "record-status": {"derive": {"derivation": "derive-record-status", + "parameters": {"mode": "read"}}}}) migrated_target = MODULE.load_yaml(current.target / "target.yaml") oidc = migrated_target["authentication"]["oidc"] self.assertEqual(oidc["requiredScopes"], ["evidence:request"]) @@ -1275,14 +1286,21 @@ def test_stage_copies_authoring_migrates_legacy_and_leaves_current_shape_alone(s self.assertEqual((current.target / "authority.yaml").read_bytes(), (evidence.target / "authority.yaml").read_bytes()) - def test_dual_lookup_or_issuer_keys_are_refused(self) -> None: - for section in ("project", "target", "authority"): + def test_dual_migration_keys_are_refused(self) -> None: + for section in ("project", "derivation-map", "derivation-reference", "target", "authority"): with self.subTest(section=section): evidence = self.deployment() project, target, authority = self.authored(evidence, True) if section == "project": project["lookups"] = {} dump_json(evidence.project / "evidence.yaml", project) + if section == "derivation-map": + project["derivations"] = {} + dump_json(evidence.project / "evidence.yaml", project) + if section == "derivation-reference": + derive = project["assertionDefinitions"]["record-status"]["derive"] + derive["derivation"] = "ambiguous" + dump_json(evidence.project / "evidence.yaml", project) if section == "target": target["authentication"]["oidc"]["issuers"] = {} dump_json(evidence.target / "target.yaml", target) From 6e91cd7b8513f3f788b469eb2aaba450d3fcd490 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 41/55] feat(platform): refuse retired configuration spellings in formats and docs Folds these reviewed commits: - feat(platform): refuse retired configuration spellings in formats and docs - fix(render): call apiKeyRef the shared API key and state its lifecycle - feat(release): report approaching advisory expiry dates - ci: surface advisory expiry reminders in nightly security - fix(ci): run the Dockerfile guard after reminder failure Signed-off-by: Jeremi Joslin --- .github/workflows/nightly-security.yml | 9 + clients/typescript/generated/render.ts | 2 +- crates/registry-render/src/auth.rs | 4 +- crates/registry-render/src/runtime.rs | 14 +- crates/registry-render/src/server.rs | 42 ++--- .../tests/golden/authentication_refusals.json | 58 +++---- crates/registry-render/tests/serve_seal.rs | 2 +- docs/site/docs/style-guide.md | 1 + .../scripts/check-stale-config-vocabulary.sh | 84 ++++++++- .../check-stale-config-vocabulary.test.mjs | 94 +++++++++- .../generate-identity-configuration.mdx | 2 +- .../src/content/docs/operate/breg-data.mdx | 6 +- .../content/docs/operate/registry-render.mdx | 16 +- .../docs/reference/render-configuration.mdx | 13 +- .../reference/scheduling-configuration.mdx | 9 +- .../src/content/docs/security/casework.mdx | 5 +- products/platform/CONFIG-CONVENTIONS.md | 54 +++++- .../scripts/check-config-conventions.py | 164 +++++++++++++++++- .../scripts/test_check_config_conventions.py | 110 ++++++++++++ products/render/CHANGELOG.md | 3 +- products/render/README.md | 4 +- products/render/generated/README.md | 1 + .../generated/registry-render.openapi.json | 2 +- products/render/schemas/runtime.schema.json | 2 +- release/scripts/nightly_release.py | 85 ++++++++- release/scripts/test_nightly_release.py | 105 +++++++++++ 26 files changed, 787 insertions(+), 104 deletions(-) create mode 100644 products/render/generated/README.md diff --git a/.github/workflows/nightly-security.yml b/.github/workflows/nightly-security.yml index 851e7a82c2..d3290b0017 100644 --- a/.github/workflows/nightly-security.yml +++ b/.github/workflows/nightly-security.yml @@ -18,12 +18,21 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout + id: checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with: persist-credentials: false submodules: false + - name: Remind of image advisory exception expiries + shell: bash + run: | + set -euo pipefail + python3 release/scripts/nightly_release.py advisory-expiry \ + --today "$(date -u +%F)" >>"${GITHUB_STEP_SUMMARY}" + - name: Release and adopter image Dockerfile checks + if: ${{ !cancelled() && steps.checkout.outcome == 'success' }} run: | python3 - <<'PY' import re diff --git a/clients/typescript/generated/render.ts b/clients/typescript/generated/render.ts index e86a890fb7..117e7d106a 100644 --- a/clients/typescript/generated/render.ts +++ b/clients/typescript/generated/render.ts @@ -1,5 +1,5 @@ // Generated for Stack version 0.50.0, client version 0.50.0. -// Source SHA-256 7414daee20f3e26f759964b090d3159496bb7d2b9f6bce32119ce670fd493acf +// Source SHA-256 85dc9ff6fb9916c30953de360ee95e8c90fdc331088aed2ac2e61018e92897cf import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" diff --git a/crates/registry-render/src/auth.rs b/crates/registry-render/src/auth.rs index 576c3fc5eb..bd30d0fd5d 100644 --- a/crates/registry-render/src/auth.rs +++ b/crates/registry-render/src/auth.rs @@ -271,7 +271,7 @@ impl Callers { .get(client) .is_none_or(|owner| owner.as_str() == &*caller.issuer_id) }); - // Correlate the exact verified credential, as in legacy API-key mode. + // Correlate the exact verified credential, as in shared API-key mode. // Issuer, subject, and client claims are never written into the audit event. Ok(Authenticated { caller_fingerprint, @@ -281,7 +281,7 @@ impl Callers { } /// The callers of a runtime that configures OIDC authentication. `None` for -/// the legacy API key. +/// the shared API key. pub(crate) async fn callers( runtime: &RenderRuntime, witness: Option<®istry_platform_config::DevelopmentWitness>, diff --git a/crates/registry-render/src/runtime.rs b/crates/registry-render/src/runtime.rs index 99c298cdad..835f60bc1e 100644 --- a/crates/registry-render/src/runtime.rs +++ b/crates/registry-render/src/runtime.rs @@ -340,8 +340,12 @@ fn default_shutdown_grace( #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[serde(deny_unknown_fields, rename_all = "camelCase")] pub struct AuthenticationRuntime { - /// Secret reference to the caller API key, under a declared provider. - /// Omit when OIDC authentication is configured. + /// Secret reference to the shared API key, under a declared provider: one + /// static bearer credential that every request presents. It is supported for a + /// single trusted caller where no OIDC issuer is available. It never seals. + /// Every request carries the same key, so the audit records one fingerprint + /// for all calls and cannot tell callers apart. Omit when OIDC authentication + /// is configured. #[cfg_attr( feature = "schema", schemars(with = "registry_platform_config::SecretReference") @@ -1536,7 +1540,7 @@ fn findings( (None, Some(api_key_ref)) => { if let Err(error) = runtime.secret_providers.check_reference("authentication.apiKeyRef", api_key_ref) { findings.push(block_finding(&error)); } } - _ => findings.push(Finding { code: "render.runtime.authentication", pointer: "/authentication".to_owned(), message: "authentication must configure exactly one of oidc or apiKeyRef".to_owned(), action: "Configure authentication.oidc or set authentication.apiKeyRef to a shared API key reference. Omit the other member.".to_owned() }), + _ => findings.push(Finding { code: "render.runtime.authentication", pointer: "/authentication".to_owned(), message: "authentication must configure exactly one of oidc or apiKeyRef".to_owned(), action: "Configure authentication.oidc for the Render resource, or one shared API key in apiKeyRef; remove the other mode.".to_owned() }), } if let Err(error) = runtime.audit.settings() { findings.push(audit_finding(&error)); @@ -2778,7 +2782,7 @@ mod tests { } #[test] - fn oidc_is_an_explicit_alternative_to_the_legacy_key() { + fn oidc_is_an_explicit_alternative_to_the_shared_key() { let (_dir, home) = home(); let oidc = OIDC_ONE_ISSUER; let text = minimal(&home).replace("apiKeyRef: secret:file/api.key", oidc); @@ -4345,7 +4349,7 @@ mod tests { } #[test] - fn signing_needs_oidc_and_refuses_the_legacy_key() { + fn signing_needs_oidc_and_refuses_the_shared_key() { let (_dir, home) = home(); let text = format!("{}signing:\n seals:\n{SEAL}", minimal(&home)); let problem = refused(&home, &text); diff --git a/crates/registry-render/src/server.rs b/crates/registry-render/src/server.rs index 5669aa5dea..fc6f19bf23 100644 --- a/crates/registry-render/src/server.rs +++ b/crates/registry-render/src/server.rs @@ -498,7 +498,7 @@ fn seal_scope_guidance(service: &Service) -> &'static str { } } /// The caller guidance the shared API key receives on the seal route. -const LEGACY_KEY_GUIDANCE: &str = +const SHARED_KEY_GUIDANCE: &str = "The shared API key cannot seal; present an OIDC resource credential with the render:seal scope."; async fn require_render_bearer( @@ -604,7 +604,7 @@ async fn require_bearer( // block without OIDC, so this holds even if that check is bypassed. if route == Route::Seal && service.oidc.is_none() { let problem = RenderProblem::new(ProblemKind::Forbidden, "the shared API key cannot seal") - .with_public_detail(LEGACY_KEY_GUIDANCE); + .with_public_detail(SHARED_KEY_GUIDANCE); let (path, headers) = (request.uri().path(), request.headers()); return refuse_access( &service, @@ -2800,7 +2800,7 @@ pub(crate) mod tests { /// that loaded a seal without OIDC: the bearer layer refuses it before /// the handler, with the guidance it needs, as one refusal entry. #[tokio::test] - async fn the_legacy_api_key_is_refused_on_the_seal_route_at_request_time() { + async fn the_shared_api_key_is_refused_on_the_seal_route_at_request_time() { use axum::body::to_bytes; use registry_platform_crypto::document_signature::test_support::TestPki; let pki = TestPki::generate().expect("test PKI"); @@ -2833,7 +2833,7 @@ pub(crate) mod tests { let body = to_bytes(response.into_body(), 16384).await.unwrap(); let body: serde_json::Value = serde_json::from_slice(&body).unwrap(); assert_eq!(body["code"], "render.forbidden"); - assert_eq!(body["detail"], LEGACY_KEY_GUIDANCE); + assert_eq!(body["detail"], SHARED_KEY_GUIDANCE); let accepted = lines.accepted(); assert_eq!(accepted.len(), 1, "{accepted:?}"); assert_eq!(accepted[0]["phase"], "response"); @@ -2939,13 +2939,13 @@ pub(crate) mod tests { #[derive(Clone, Copy)] enum Mode { /// The shared API key. - Legacy, + SharedKey, /// An OIDC verifier over a static key set. Oidc, /// An OIDC verifier whose issuer declares service actor kind. OidcDeclaredService, /// The shared API key on a service that loaded a seal. - LegacySealed, + SharedKeySealed, /// An OIDC verifier and a seal that allows a different client. OidcSealed, /// An OIDC verifier whose key source answers 503. @@ -3003,7 +3003,7 @@ pub(crate) mod tests { ), ))); } - if matches!(mode, Mode::LegacySealed | Mode::OidcSealed) { + if matches!(mode, Mode::SharedKeySealed | Mode::OidcSealed) { let pki = TestPki::generate().expect("test PKI"); let test_seal = pki .issue_seal(registry_platform_crypto::SigningAlgorithm::Es256) @@ -3074,11 +3074,11 @@ pub(crate) mod tests { /// Every refusal the access layers and the seal handler make, with the /// check each one must record. fn refusal_cases() -> Vec { - let legacy = |key: &str| Some(format!("Bearer {key}")); + let shared_key = |key: &str| Some(format!("Bearer {key}")); vec![ RefusalCase::new( "no-authorization-header", - Mode::Legacy, + Mode::SharedKey, Method::GET, "/v1/document-types", None, @@ -3086,7 +3086,7 @@ pub(crate) mod tests { ), RefusalCase::new( "scheme-not-bearer", - Mode::Legacy, + Mode::SharedKey, Method::GET, "/v1/document-types", Some("Basic dXNlcjpwYXNz".to_owned()), @@ -3094,7 +3094,7 @@ pub(crate) mod tests { ), RefusalCase::new( "empty-bearer-token", - Mode::Legacy, + Mode::SharedKey, Method::GET, "/v1/document-types", Some("Bearer ".to_owned()), @@ -3102,7 +3102,7 @@ pub(crate) mod tests { ), RefusalCase::new( "value-shorter-than-the-scheme", - Mode::Legacy, + Mode::SharedKey, Method::GET, "/v1/document-types", Some("Basic".to_owned()), @@ -3110,7 +3110,7 @@ pub(crate) mod tests { ), RefusalCase::new( "repeated-authorization-header", - Mode::Legacy, + Mode::SharedKey, Method::GET, "/v1/document-types", None, @@ -3119,7 +3119,7 @@ pub(crate) mod tests { .raw(vec![b"Bearer first".to_vec(), b"Bearer second".to_vec()]), RefusalCase::new( "non-ascii-authorization-header", - Mode::Legacy, + Mode::SharedKey, Method::GET, "/v1/document-types", None, @@ -3127,11 +3127,11 @@ pub(crate) mod tests { ) .raw(vec![b"Bearer caf\xe9".to_vec()]), RefusalCase::new( - "legacy-key-mismatch", - Mode::Legacy, + "shared-key-mismatch", + Mode::SharedKey, Method::GET, "/v1/document-types", - legacy("canary-wrong-key-0123456789abcdef0123456789"), + shared_key("canary-wrong-key-0123456789abcdef0123456789"), "shared-secret", ), RefusalCase::new( @@ -3217,11 +3217,11 @@ pub(crate) mod tests { "scope", ), RefusalCase::new( - "legacy-key-on-seal-route", - Mode::LegacySealed, + "shared-key-on-seal-route", + Mode::SharedKeySealed, Method::POST, "/v1/seal/receipt", - legacy(TEST_API_KEY), + shared_key(TEST_API_KEY), "operation", ), RefusalCase::new( @@ -3752,7 +3752,7 @@ pub(crate) mod tests { #[tokio::test] async fn the_refusal_counter_is_exposed_from_zero_for_every_check() { - let service = refusal_service(Mode::Legacy).await; + let service = refusal_service(Mode::SharedKey).await; let text = scraped(&service, &Arc::new(Metrics::default())).await; assert!(text.contains( "# HELP render_request_refusals_total Requests refused, by the check that failed.\n# TYPE render_request_refusals_total counter\n" diff --git a/crates/registry-render/tests/golden/authentication_refusals.json b/crates/registry-render/tests/golden/authentication_refusals.json index c7ef5280ca..3828c262dd 100644 --- a/crates/registry-render/tests/golden/authentication_refusals.json +++ b/crates/registry-render/tests/golden/authentication_refusals.json @@ -86,35 +86,6 @@ }, "status": 503 }, - "legacy-key-mismatch": { - "body": { - "code": "render.unauthorized", - "detail": "Present a valid bearer credential for this Render resource.", - "status": 401, - "title": "unauthorized", - "type": "https://render.registrystack.org/problems/unauthorized" - }, - "headers": { - "cache-control": "no-store", - "content-type": "application/problem+json", - "www-authenticate": "Bearer" - }, - "status": 401 - }, - "legacy-key-on-seal-route": { - "body": { - "code": "render.forbidden", - "detail": "The legacy API key cannot seal; present an OIDC resource credential with the render:seal scope.", - "status": 403, - "title": "forbidden", - "type": "https://render.registrystack.org/problems/forbidden" - }, - "headers": { - "cache-control": "no-store", - "content-type": "application/problem+json" - }, - "status": 403 - }, "no-authorization-header": { "body": { "code": "render.unauthorized", @@ -217,6 +188,35 @@ }, "status": 403 }, + "shared-key-mismatch": { + "body": { + "code": "render.unauthorized", + "detail": "Present a valid bearer credential for this Render resource.", + "status": 401, + "title": "unauthorized", + "type": "https://render.registrystack.org/problems/unauthorized" + }, + "headers": { + "cache-control": "no-store", + "content-type": "application/problem+json", + "www-authenticate": "Bearer" + }, + "status": 401 + }, + "shared-key-on-seal-route": { + "body": { + "code": "render.forbidden", + "detail": "The shared API key cannot seal; present an OIDC resource credential with the render:seal scope.", + "status": 403, + "title": "forbidden", + "type": "https://render.registrystack.org/problems/forbidden" + }, + "headers": { + "cache-control": "no-store", + "content-type": "application/problem+json" + }, + "status": 403 + }, "token-audience": { "body": { "code": "render.unauthorized", diff --git a/crates/registry-render/tests/serve_seal.rs b/crates/registry-render/tests/serve_seal.rs index 25b6f41c32..5cd8d64db8 100644 --- a/crates/registry-render/tests/serve_seal.rs +++ b/crates/registry-render/tests/serve_seal.rs @@ -1861,7 +1861,7 @@ fn each_authorization_refusal_has_its_own_problem() { } #[test] -fn the_legacy_api_key_never_seals() { +fn the_shared_api_key_never_seals() { let pki = seal_pki(); let fixture = deployment(Some(SealSpec { tsa_url: None, diff --git a/docs/site/docs/style-guide.md b/docs/site/docs/style-guide.md index 1ad1f7b453..2d80f963dd 100644 --- a/docs/site/docs/style-guide.md +++ b/docs/site/docs/style-guide.md @@ -178,6 +178,7 @@ Preferred terms. | Legacy repo paths | `registry_relay` and `decentralized-evidence-demo` appear only in historical pages or `rename_status` fields. Never in prose on a `current` page without explicit rename context. | | Standards | Use the official acronym after spelling on first use. `DCAT`, `SHACL`, `OGC API Records`, `SD-JWT VC`, `CCCEV`. Never translate. | | Base Registry Engine nouns | Six nouns, capitalised as the product prints them: `Record type` (`recordType` in a project file), `Record`, `Action`, `Plan`, `Proposal`, and `ActionReceipt`. Retired and refused by `check:config-vocabulary` on Base Registry Engine pages: entity and entities as registry nouns, change request, change control, lifecycle action and lifecycle authority. Manifest names and other products' own vocabulary are not affected. | +| Retired configuration spellings | `check:config-vocabulary` refuses each spelling in the Retired spellings table of `products/platform/CONFIG-CONVENTIONS.md` on every page. A line may name one only as a migration note. That line names the replacement in code marks, or says renamed, removed, retired or replaced before the spelling. | ## Choosing examples diff --git a/docs/site/scripts/check-stale-config-vocabulary.sh b/docs/site/scripts/check-stale-config-vocabulary.sh index 555c954b30..885f10fe48 100755 --- a/docs/site/scripts/check-stale-config-vocabulary.sh +++ b/docs/site/scripts/check-stale-config-vocabulary.sh @@ -4,6 +4,10 @@ set -euo pipefail # CONFIG_VOCABULARY_ROOT points the check at another docs-site tree; its tests # use it to run against fixture trees. The default is this site. ROOT="${CONFIG_VOCABULARY_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}" +# The Retired spellings table under CFG-CHANGE-2 in the configuration +# conventions lists the spellings both this check and the convention lint +# refuse. CONFIG_CONVENTIONS_FILE points the check at a fixture copy. +CONVENTIONS="${CONFIG_CONVENTIONS_FILE:-$ROOT/../../products/platform/CONFIG-CONVENTIONS.md}" PATTERN='registry\.validation\.report\.v1|schema:\s*registry\.validation|checks\[\]\.(product_report|findings)|YAML parsed successfully|auth\.oidc\.(jwks_uri|allowed_typ|leeway_seconds)|(extendE|e)ntities\[\]\.events\[\]|webhook\.destinationId' PATHS=( "$ROOT/README.md" @@ -90,6 +94,36 @@ if [[ ! -f "$BASELINE" ]]; then echo "pending-rewrite baseline not found: $BASELINE" >&2 exit 2 fi +if [[ ! -f "$CONVENTIONS" ]]; then + echo "configuration conventions not found: $CONVENTIONS" >&2 + exit 2 +fi + +# One line per retired spelling: the spelling, a tab, then its replacements +# separated by tabs. Read from the first table after "**Retired spellings.**". +retired_list="$( + awk ' + index($0, "**Retired spellings.**") == 1 { found = 1; next } + found && /^\|/ { table = 1 } + found && table && !/^\|/ { exit } + found && table && /^\| `/ { + n = split($0, cells, "|") + spelling = cells[2] + if (!match(spelling, /`[^`]+`/)) next + line = substr(spelling, RSTART + 1, RLENGTH - 2) + rest = cells[3] + while (match(rest, /`[^`]+`/)) { + line = line "\t" substr(rest, RSTART + 1, RLENGTH - 2) + rest = substr(rest, RSTART + RLENGTH) + } + print line + } + ' "$CONVENTIONS" +)" +if [[ -z "$retired_list" ]]; then + echo "no Retired spellings table found in $CONVENTIONS" >&2 + exit 2 +fi # Each page is preceded by an awk assignment naming its pattern set. pages=() @@ -107,7 +141,15 @@ done < <( find "$ROOT/src/data" -maxdepth 1 -type f -name '*.yaml' -print0 ) -# The awk program reads the BReg baseline first, then every page. +# The awk program reads the retired-spelling list and the BReg baseline +# first, then every page. Retired Evidence and Casework terminology fails on +# every page. Any other retired spelling on a baselined page is counted and +# reported; anywhere else it fails the check. A Retired spellings table entry +# is allowed on a line that is a migration note: it names the replacement in +# code marks, or says renamed, removed, retired or replaced before the +# spelling. The convention lint (products/platform/scripts/ +# check-config-conventions.py, MIGRATION_WORDS) uses the same words, and its +# test holds the two alternations equal. retired_status=0 ROOT="$ROOT" CROSS_PRODUCT_RETIRED="$CROSS_PRODUCT_RETIRED" BREG_RETIRED="$BREG_RETIRED" \ EVIDENCE_CASEWORK_RETIRED="$EVIDENCE_CASEWORK_RETIRED" ALLOWED="$ALLOWED" \ @@ -121,6 +163,36 @@ ROOT="$ROOT" CROSS_PRODUCT_RETIRED="$CROSS_PRODUCT_RETIRED" BREG_RETIRED="$BREG_ pending = 0 failures = 0 } + function literal(text, out, i, c) { + out = "" + for (i = 1; i <= length(text); i++) { + c = substr(text, i, 1) + out = out (index(".$*+?()[]{}|/", c) ? "[" c "]" : c) + } + return out + } + function whole(text) { + return "(^|[^A-Za-z0-9_-])" literal(text) "([^A-Za-z0-9_-]|$)" + } + function coded(text) { + return "`([^`]*[^A-Za-z0-9_`-])?" literal(text) "([^A-Za-z0-9_`-][^`]*)?`" + } + function migration(line, index_, spelling_at, i) { + for (i = 1; i <= replacement_count[index_]; i++) { + if (line ~ replacement[index_, i]) return 1 + } + match(line, retired_pattern[index_]) + spelling_at = RSTART + return match(tolower(line), /renamed|removed|retired|replac/) && RSTART < spelling_at + } + mode == "retired" { + count_fields = split($0, fields, "\t") + retired_count++ + retired_pattern[retired_count] = whole(fields[1]) + replacement_count[retired_count] = count_fields - 1 + for (i = 2; i <= count_fields; i++) replacement[retired_count, i - 1] = coded(fields[i]) + next + } mode == "baseline" { entry = $0 sub(/#.*/, "", entry) @@ -139,10 +211,14 @@ ROOT="$ROOT" CROSS_PRODUCT_RETIRED="$CROSS_PRODUCT_RETIRED" BREG_RETIRED="$BREG_ text = $0 gsub(allowed, "", text) retired = (mode == "breg") ? broad : narrow - if (text ~ evidence_casework || (text ~ retired && !(page in baselined))) { + renamed = 0 + for (i = 1; i <= retired_count; i++) { + if ($0 ~ retired_pattern[i] && !migration($0, i)) renamed = 1 + } + if (text ~ evidence_casework || ((text ~ retired || renamed) && !(page in baselined))) { print page ":" FNR ": " $0 failures++ - } else if (text ~ retired) { + } else if (text ~ retired || renamed) { count[page]++ } } @@ -159,7 +235,7 @@ ROOT="$ROOT" CROSS_PRODUCT_RETIRED="$CROSS_PRODUCT_RETIRED" BREG_RETIRED="$BREG_ } exit (failures > 0) } - ' mode=baseline "$BASELINE" ${pages[@]+"${pages[@]}"} || retired_status=$? + ' mode=retired - mode=baseline "$BASELINE" ${pages[@]+"${pages[@]}"} <<<"$retired_list" || retired_status=$? if [[ "$retired_status" -eq 1 ]]; then echo "retired vocabulary found (BReg exceptions: $BASELINE)" >&2 diff --git a/docs/site/scripts/check-stale-config-vocabulary.test.mjs b/docs/site/scripts/check-stale-config-vocabulary.test.mjs index 91d853d16f..a45d10ff13 100644 --- a/docs/site/scripts/check-stale-config-vocabulary.test.mjs +++ b/docs/site/scripts/check-stale-config-vocabulary.test.mjs @@ -11,10 +11,28 @@ const execFileAsync = promisify(execFile); const scriptDir = dirname(fileURLToPath(import.meta.url)); const gate = resolve(scriptDir, 'check-stale-config-vocabulary.sh'); -async function runGate(root) { +// A fixture copy of the Retired spellings table the gate reads from the +// configuration conventions. +const conventions = `# Conventions + +**Retired spellings.** Both checks refuse these. + +| Retired spelling | Replacement | Retired by | +|---|---|---| +| \`selectorProfiles\` | \`lookups\` | CFG-NAME-5 | +| \`bregctl dev\` | \`rstack dev\` | Platform | +| \`databaseInitializationEnvironment\` | none: delete the key | BReg | +| \`requestTimeoutSeconds\` | \`requestTimeoutMilliseconds\` | CFG-NAME-5 | +| \`retainDays\` | \`retentionDays\` | CFG-NAME-5 | +| \`selectorProfile\` | \`lookup\` | CFG-NAME-5 | + +**Not refused.** +`; + +async function runGate(root, conventionsFile = join(root, 'CONFIG-CONVENTIONS.md')) { try { const { stdout, stderr } = await execFileAsync('bash', [gate], { - env: { ...process.env, CONFIG_VOCABULARY_ROOT: root }, + env: { ...process.env, CONFIG_VOCABULARY_ROOT: root, CONFIG_CONVENTIONS_FILE: conventionsFile }, }); return { code: 0, output: `${stdout}${stderr}` }; } catch (error) { @@ -31,6 +49,7 @@ async function withFixture({ pages = {}, baseline = [] }, check) { await mkdir(join(root, 'src/data'), { recursive: true }); await mkdir(join(root, 'scripts'), { recursive: true }); await writeFile(join(root, 'README.md'), '# Fixture\n'); + await writeFile(join(root, 'CONFIG-CONVENTIONS.md'), conventions); await writeFile( join(root, 'scripts/check-stale-config-vocabulary.baseline'), `# fixture baseline\n${baseline.map((page) => `${page} # PR 2\n`).join('')}`, @@ -216,3 +235,74 @@ test('the existing stale configuration patterns still fail', async () => { }, ); }); + +test('a retired spelling from the conventions table fails on any page', async () => { + const page = 'src/content/docs/operate/run.mdx'; + await withFixture( + { pages: { [page]: 'Run `bregctl dev start demo`.\nDeclare `selectorProfiles` in the project.\n' } }, + async (root) => { + const result = await runGate(root); + assert.equal(result.code, 1, result.output); + assert.match(result.output, /operate\/run\.mdx:1: Run `bregctl dev start demo`\./u); + assert.match(result.output, /operate\/run\.mdx:2: Declare `selectorProfiles` in the project\./u); + }, + ); +}); + +test('a migration note may name a retired spelling', async () => { + const page = 'src/content/docs/operate/upgrade.mdx'; + const text = [ + 'Rename `selectorProfiles` to `lookups`.', + 'Delete the retired `databaseInitializationEnvironment` key.', + 'The removed `bregctl dev` command has no flags.', + '- `audit.retainDays`, now `audit.retentionDays`', + 'Use `rstack dev` where you used `bregctl dev`.', + 'A `bregctl dev-state` file and `selectorProfilesUsed` are other words.', + '', + ].join('\n'); + await withFixture({ pages: { [page]: text } }, async (root) => { + const result = await runGate(root); + assert.equal(result.code, 0, result.output); + }); +}); + +test('a retired spelling on a baselined page is counted, not refused', async () => { + const page = 'src/content/docs/operate/old.mdx'; + await withFixture( + { pages: { [page]: 'Declare `selectorProfiles`.\n' }, baseline: [page] }, + async (root) => { + const result = await runGate(root); + assert.equal(result.code, 0, result.output); + assert.match(result.output, /pending rewrite: src\/content\/docs\/operate\/old\.mdx: 1 line\(s\)/u); + }, + ); +}); + +test('the gate refuses to run without the conventions table', async () => { + await withFixture({}, async (root) => { + const missing = await runGate(root, join(root, 'absent.md')); + assert.equal(missing.code, 2, missing.output); + assert.match(missing.output, /configuration conventions not found/u); + await writeFile(join(root, 'CONFIG-CONVENTIONS.md'), '# Conventions\n'); + const empty = await runGate(root); + assert.equal(empty.code, 2, empty.output); + assert.match(empty.output, /no Retired spellings table found/u); + }); +}); + +test('teaching prose with a migration word after the spelling still fails', async () => { + const page = 'src/content/docs/operate/probe.mdx'; + const lines = [ + 'Requests that run past `requestTimeoutSeconds` are refused with `504`.', + 'Declare a `selectorProfile` for each lookup the definition needs.', + 'Set `retainDays: 30`, older audit files are removed at rotation.', + '`bregctl dev start` replaces any running stack.', + ]; + await withFixture({ pages: { [page]: `${lines.join('\n')}\n` } }, async (root) => { + const result = await runGate(root); + assert.equal(result.code, 1, result.output); + for (const [index, line] of lines.entries()) { + assert.ok(result.output.includes(`operate/probe.mdx:${index + 1}: ${line}`), result.output); + } + }); +}); diff --git a/docs/site/src/content/docs/operate/advanced/generate-identity-configuration.mdx b/docs/site/src/content/docs/operate/advanced/generate-identity-configuration.mdx index 3c9fdd7b16..d44c2897cc 100644 --- a/docs/site/src/content/docs/operate/advanced/generate-identity-configuration.mdx +++ b/docs/site/src/content/docs/operate/advanced/generate-identity-configuration.mdx @@ -101,7 +101,7 @@ file, and renders the result. on its curve is not checked. {/* Evidence: crates/registry-thunderid-tooling/src/identity_generate.rs, generate(), and key_file_refusal(); - crates/registry-casework/src/config.rs authentication.oidc.humanIdentity and representedHuman. */} + crates/registry-casework/src/config.rs, the removed authentication.oidc.humanIdentity and representedHuman. */} ## Check a saved BReg identity-facts report diff --git a/docs/site/src/content/docs/operate/breg-data.mdx b/docs/site/src/content/docs/operate/breg-data.mdx index 3a98590c67..840f3fb5af 100644 --- a/docs/site/src/content/docs/operate/breg-data.mdx +++ b/docs/site/src/content/docs/operate/breg-data.mdx @@ -357,9 +357,9 @@ and `domainData` containing the fields you named. {"domainData":{"operatorCode":"OP-001","status":"active"},"recordId":"00000000-0000-4000-8000-000000000001","revisionId":"1"} ``` -When upgrading from v0.48.0, update consumers of export files to read `recordId` and -`revisionId` in place of `recordIdentifier` and `revisionIdentifier`. Finish any -in-progress export with the matching v0.48.0 `bregctl`, serving runtime, and compiled +When upgrading from v0.48.0, update consumers of export files to read +`recordId` and `revisionId` in place of `recordIdentifier` and `revisionIdentifier`. +Finish any in-progress export with the matching v0.48.0 `bregctl`, serving runtime, and compiled package before cutover, or start a fresh output and checkpoint pair after upgrading. Keep the original output and checkpoint together. If you convert an archived export for downstream use, convert a separate copy to preserve the checkpoint's digest. diff --git a/docs/site/src/content/docs/operate/registry-render.mdx b/docs/site/src/content/docs/operate/registry-render.mdx index da1e6b70d9..a4ac2189f7 100644 --- a/docs/site/src/content/docs/operate/registry-render.mdx +++ b/docs/site/src/content/docs/operate/registry-render.mdx @@ -28,9 +28,9 @@ compatibility promise. - **One package directory, mounted read-only.** Serve verifies it at startup and in the worker on every request, and refuses a package that changes while it runs. -- **One API key in an owner-only file.** At least 32 bytes of ASCII. Serve trims one trailing line - ending and refuses any other whitespace, because a mis-read key would reject every caller while - health stays green. +- **Either OIDC issuer settings or one shared API key in an owner-only file.** A shared API key is + at least 32 bytes of ASCII. Serve trims one trailing line ending and refuses any other whitespace, + because a mis-read key would reject every caller while health stays green. - **A writable audit directory, or a log collector on standard output.** Serve refuses a directory that group or others can write. - **A TLS proxy in front.** The listener serves plain HTTP, reads no forwarded header, and accepts @@ -239,8 +239,8 @@ Give each replica its own audit path. ## Answer callers -Callers POST one JSON body to `/v1/render/` with the API key. Keep the key off the -command line: write the header to a file only the caller reads, as +Callers POST one JSON body to `/v1/render/` with their bearer credential. Keep it +off the command line: write the header to a file only the caller reads, as [the tutorial](../../tutorials/first-render-document/) does, and pass the file. ```sh @@ -273,9 +273,9 @@ and `audit-failed` (503). ### Authenticate callers with OIDC tokens -Choose one non-null authentication mode. Use `authentication.oidc` for OIDC or -`authentication.apiKeyRef` for shared API key authentication. A shared key must pass the -secret-provider and entropy checks. Omit the other member. For OIDC, configure this block. +Choose exactly one non-null authentication mode: `authentication.oidc` or the shared API key in +`authentication.apiKeyRef`, which keeps its secret-provider and entropy checks. Do not configure both, +and do not use null as an absent member. For OIDC, the block is: ```yaml authentication: diff --git a/docs/site/src/content/docs/reference/render-configuration.mdx b/docs/site/src/content/docs/reference/render-configuration.mdx index 43ecf96de7..f1b7588b6c 100644 --- a/docs/site/src/content/docs/reference/render-configuration.mdx +++ b/docs/site/src/content/docs/reference/render-configuration.mdx @@ -30,9 +30,12 @@ locales, version, and PDF standard. Each `labels/.yaml` holds one label table must carry the same keys. `runtime.yaml` is what `registry-render serve` reads: listener, package, secret providers, authentication, limits, and audit. -`authentication.apiKeyRef` selects shared API key authentication for unsigned rendering and -document type discovery. Set it to a secret reference under a declared provider and send the key -as a bearer credential. To serve seals, configure `authentication.oidc`. +`authentication` takes exactly one mode. `oidc` admits resource-bound access tokens and names each +client. `apiKeyRef` names a shared API key: one static bearer credential that every request +presents. The shared API key is a supported mode for a single trusted caller where no OIDC issuer +is available. It never seals. Every request carries the same key, so the audit records one +fingerprint for all calls and cannot tell callers apart. Use `oidc` when more than one system calls +Render or when a deployment seals. The JSON Schema a document type names for its data is yours to write; Render applies it to every request and has no schema of its own for it. A schema-valid file still needs `registry-render @@ -46,7 +49,9 @@ Two rules are written as exclusions the tables do not show: each document's `ent {/* Evidence: crates/registry-render/src/manifest.rs, Manifest; crates/registry-render/src/labels.rs; - crates/registry-render/src/runtime.rs, RenderRuntime; + crates/registry-render/src/runtime.rs, RenderRuntime, AuthenticationRuntime; + crates/registry-render/src/server.rs, SHARED_KEY_GUIDANCE, fingerprint_api_key at service build + and the bearer check; crates/registry-render/src/check.rs, run; docs/site/scripts/generate-render-configuration.mjs. */} diff --git a/docs/site/src/content/docs/reference/scheduling-configuration.mdx b/docs/site/src/content/docs/reference/scheduling-configuration.mdx index ba29e47666..bb1cebe0c9 100644 --- a/docs/site/src/content/docs/reference/scheduling-configuration.mdx +++ b/docs/site/src/content/docs/reference/scheduling-configuration.mdx @@ -92,9 +92,12 @@ kind: SchedulingRuntimeConfig The earlier `registry.registrystack.org/scheduling-runtime/v1alpha1` envelope is refused with a diagnostic naming the current one. -So are the renamed keys `audit.retainDays`, `retention.attemptReceiptDays`, -`retention.attemptReceiptRetentionDays`, `retention.hookPayloadDays`, and `caseworkResource` in a -`taskGrantStatus` entry, each naming the key that replaced it. +So are these renamed keys, each with a diagnostic naming the key that replaced it: + +- `audit.retainDays`, now `audit.retentionDays` +- `retention.attemptReceiptDays` and `retention.attemptReceiptRetentionDays`, now `retention.receiptRetentionDays` +- `retention.hookPayloadDays`, now `retention.hookPayloadRetentionDays` +- `caseworkResource` in a `taskGrantStatus` entry, now `statusResource` String values in `runtime.yaml` may take a deployment value from the environment when the runtime starts: `${VAR}` requires `VAR`, `${VAR:-default}` falls back to `default`, and `${VAR:?message}` diff --git a/docs/site/src/content/docs/security/casework.mdx b/docs/site/src/content/docs/security/casework.mdx index 9015f7ac80..aa90faadea 100644 --- a/docs/site/src/content/docs/security/casework.mdx +++ b/docs/site/src/content/docs/security/casework.mdx @@ -166,8 +166,9 @@ grants in [Registry Casework task grants](../../reference/casework-task-grants/) is decided as without the pair, by the primary bearer, profile and ordinary authorisation. Before looking up the target's policy, Casework refuses malformed source bearers and repeated authorisation or source profile headers. It also refuses a source bearer without a valid - `Registry-Source-Profile` and requests from a requester. Casework refuses either retired header, - `Registry-Casework-Profile` or `Registry-Review-Profile`, even if it appears only once. + `Registry-Source-Profile` and requests from a requester. + Casework refuses the retired `Registry-Casework-Profile` and `Registry-Review-Profile` headers, + even if one appears only once. A repeated `accessProfile` query parameter or an invalid selector value is a separate refusal. Both selector checks return `400` `request.invalid`. Source-free routes still reject the source header. diff --git a/products/platform/CONFIG-CONVENTIONS.md b/products/platform/CONFIG-CONVENTIONS.md index 9c6beaa095..6d898bdb73 100644 --- a/products/platform/CONFIG-CONVENTIONS.md +++ b/products/platform/CONFIG-CONVENTIONS.md @@ -1049,6 +1049,56 @@ the migration guide; it stays until the format's next stable version. A format with no stable version yet may drop or rename a key with only the CHANGELOG entry CFG-CHANGE-3 requires, and the old key is then refused as unknown. +**Retired spellings.** A retired spelling stays out of every format file and +every docs page once its product refuses it, so no example, fixture, journey +or page teaches it again. The table is the one list both checks read: the +convention lint sweeps the YAML and JSON files under `products/` (generated +schemas, OpenAPI documents, the format registry and the exceptions register +excepted), and `check:config-vocabulary` in `docs/site` sweeps the docs pages. +A line or string value may still name a retired spelling as a migration note: +it names the replacement in code marks, or says renamed, removed, retired or +replaced before the spelling. A retired spelling used as a key is refused +outright. Changelogs, decision records and approved specifications are not +swept. Each exact key in the CFG-NAME-5 refused column +appears here or in the list after the table. + +| Retired spelling | Replacement | Retired by | +|---|---|---| +| `requestTimeoutSeconds` | `requestTimeoutMilliseconds` | CFG-NAME-5 | +| `retrySeconds` | `retryDelaySeconds` | CFG-NAME-5 | +| `maxAttempts` | `maximumAttempts` | CFG-NAME-5 | +| `shutdownTimeoutSeconds` | `shutdownGraceMilliseconds` | CFG-NAME-5 | +| `maxTokenLifetimeSeconds` | `maximumTokenLifetimeSeconds` | CFG-NAME-5 | +| `retainDays` | `retentionDays` | CFG-NAME-5 | +| `attemptReceiptRetentionDays` | `receiptRetentionDays` | CFG-NAME-5 | +| `submissionReceiptRetentionDays` | `receiptRetentionDays` | CFG-NAME-5 | +| `eventDestinations` | `destinations.hooks` | CFG-NAME-5 | +| `selectorProfiles` | `lookups` | CFG-NAME-5 | +| `selectorProfile` | `lookup` | CFG-NAME-5 | +| `authentication.policies` | `accessProfiles` | CFG-NAME-5 | +| `recordIdentifier` | `recordId` | CFG-NAME-5 | +| `recordIdentifiers` | `recordIds` | CFG-NAME-5 | +| `--selector-profile` | `--lookup` | BReg, v0.49.0 | +| `loopback-development-http` | `loopback-http` | BReg, v0.49.0 | +| `databaseInitializationEnvironment` | none: delete the key | BReg, v0.49.0 | +| `Registry-Casework-Profile` | `accessProfile` | Casework, v0.49.0 | +| `Registry-Review-Profile` | `accessProfile` | Casework, v0.49.0 | +| `humanIdentity` | `actorKind` | Casework, v0.49.0 | +| `bregctl dev` | `rstack dev` | Platform, v0.49.0 | +| `messagingctl dev` | `rstack dev` | Platform, v0.49.0 | + +**Not refused.** These spellings look retired but are not, so neither check +refuses them. Do not add them to the table. + +| Spelling | Why it is not refused | +|---|---| +| `title` | A CFG-NAME-5 refused key, but the word is ordinary prose and a member of other contracts. Review enforces `label`. | +| `timeoutMilliseconds` | A CFG-NAME-5 refused key only outside its recorded Adapter pack exception, and a member of client and pack contracts. | +| `attemptTimeoutSeconds` | A member of client contracts: the Coordinator operations catalog `limits`, the `registry-platform-httputil` exchange configuration, and `attempt_timeout_seconds` in the BReg, Casework, Scheduling, Coordinator, Evidence, Messaging and Discovery Python clients. Messaging still refuses it under `providers`. | +| `development-loopback` | A live `tlsTermination` value in Casework, Documents, Messaging, the Adapter job host and Session, distinct from `loopback-plaintext`. | +| `$skiptoken` | A live BReg collection read parameter (OData), with `$top`. | +| `publicService` | The single member of the service preview `service.yaml`, a different format from the Manifest's `publicServices`. | + **CFG-CHANGE-3 (MUST). Before 1.0, an alpha format may change in place.** Each breaking change ships in one change with: a `BREAKING:` entry and exact migration steps in the product CHANGELOG and the stack release note; updated @@ -1106,6 +1156,8 @@ format. | CFG-VAL-6 | Scheduling `admissionHash` | Released API member. | | CFG-VAL-6 | platform-audit `prevHash` and `recordHash` | Members of the audit record whose bytes are hashed in sequence; renaming changes the record. | | CFG-VAL-6 | BReg `schemaFingerprint` | A fingerprint of a schema, named for what it identifies rather than as a digest. | +| CFG-NAME-5 | `attemptTimeoutSeconds` in `products/coordinator/generated/operations/catalog.json` limits, the `registry-platform-httputil` exchange configuration, and `attempt_timeout_seconds` in the BReg, Casework, Scheduling, Coordinator, Evidence, Messaging and Discovery Python clients | Released client and catalog API. Renaming it breaks every binding. Rename or record at the 1.0 wire cut (#2104, v0.52.0). | +| CFG-NAME-3; CFG-NAME-5 | `maxBytes` client options: TypeScript `maxMetadataBytes`, Python `max_metadata_bytes` | Released client API that callers set. Rename or record at the 1.0 wire cut (#2104, v0.52.0). | ## Enforcement summary @@ -1113,7 +1165,7 @@ Each MUST rule appears once; SHOULD rules are in the last row. | Rules | Gate | |---|---| -| CFG-ENV-1, 4; CFG-YAML-2 to 8; CFG-VAL-1 to 3; CFG-EMPTY-1; CFG-SEC-2, 3; CFG-DIAG-1, 2, 5; CFG-CHANGE-2 | reader unit tests named with the rule ID; the conformance corpus; for CFG-ENV-1 also the convention lint (`const` envelope) | +| CFG-ENV-1, 4; CFG-YAML-2 to 8; CFG-VAL-1 to 3; CFG-EMPTY-1; CFG-SEC-2, 3; CFG-DIAG-1, 2, 5; CFG-CHANGE-2 | reader unit tests named with the rule ID; the conformance corpus; for CFG-ENV-1 also the convention lint (`const` envelope); for CFG-CHANGE-2 also the convention lint's retired-spelling sweep and `check:config-vocabulary` in `docs/site` | | CFG-VAL-11 | shared reader and comparison-helper unit tests; generated product schemas; product check tests for structured warnings and `--deny-warnings` | | CFG-DIAG-7 | shared acceptance parser, matcher, schema drift, and file-boundary tests; consuming product check tests for exact matching, refusal preservation, and `--deny-warnings` | | CFG-YAML-1 | `disallowed-methods` in every `clippy.toml` in the repository, with `check-yaml-reader-boundary.sh`; the conformance corpus | diff --git a/products/platform/scripts/check-config-conventions.py b/products/platform/scripts/check-config-conventions.py index 2cfd646502..efa9adfd0f 100644 --- a/products/platform/scripts/check-config-conventions.py +++ b/products/platform/scripts/check-config-conventions.py @@ -4,7 +4,8 @@ The lint reads three files: - products/platform/CONFIG-CONVENTIONS.md, for the CFG-NAME-5 table of - refused spellings and the Enforcement summary; + refused spellings, the Retired spellings and Not refused tables, and the + Enforcement summary; - products/platform/config-formats.yaml, the format registry (CFG-SCHEMA-1); - products/platform/config-conventions-exceptions.yaml, the exceptions register. @@ -19,7 +20,12 @@ registered schema and the shared runtime blocks; and a source lint over each reader type's closure (CFG-SCHEMA-8, CFG-CHANGE-1, CFG-ID-6). A deviation recorded in the exceptions register passes; an unrecorded one fails, and so -does a recorded one that no longer deviates. Pending entries are counted per +does a recorded one that no longer deviates. The retired-spelling sweep +(CFG-CHANGE-2) refuses each spelling of the Retired spellings table in the +YAML and JSON files under `products/`: as a key outright, and in a string +value outside a migration note. A hit is an error, never exceptable through +the register. +Pending entries are counted per product and work package, and `--strict` refuses them. CFG-CHANGE-5 compares the register, entry by entry (rule, format, location), with the merge base of `origin/main` (or `--base`): an entry may be added only in the @@ -410,11 +416,20 @@ class Name5Row: refused: list[Name5Item] +@dataclass +class RetiredSpelling: + spelling: str + replacements: list[str] + pattern: re.Pattern[str] + + @dataclass class Convention: rules: dict[str, str] name5: list[Name5Row] summary: list[tuple[str, list[str], str]] + retired: list[RetiredSpelling] = field(default_factory=list) + not_refused: list[str] = field(default_factory=list) RULE_DECLARATION = re.compile(r"\*\*(CFG-[A-Z]+-[0-9]+) \((MUST|SHOULD)\)") @@ -471,6 +486,70 @@ def items(cell: str) -> list[Name5Item]: return rows if header is not None else None +# Text is a migration note for a retired spelling when one of these words +# comes before the spelling, or when it names the replacement in code marks. +# The docs check (docs/site/scripts/check-stale-config-vocabulary.sh) uses the +# same alternation, and a lint test holds the two equal. +MIGRATION_WORDS = "renamed|removed|retired|replac" +MIGRATION_NOTE = re.compile(MIGRATION_WORDS, re.IGNORECASE) +RETIRED_FILE_SUFFIXES = (".yaml", ".yml", ".json") + + +def markdown_table(text: str, marker: str, first_header: str) -> list[list[str]] | None: + """The body rows of the first table after `marker` whose first header is `first_header`.""" + start = text.find(marker) + if start == -1: + return None + rows: list[list[str]] = [] + header = None + for line in text[start:].splitlines()[1:]: + if not line.startswith("|"): + if header is not None: + break + continue + cells = [cell.strip() for cell in line.strip().strip("|").split("|")] + if header is None: + if cells[0] != first_header: + return None + header = cells + continue + if set(line.replace("|", "").strip()) <= {"-", " "}: + continue + rows.append(cells) + return rows if header is not None else None + + +def spelling_pattern(spelling: str) -> re.Pattern[str]: + return re.compile(r"(? re.Pattern[str]: + return re.compile(r"`[^`]*?(? bool: + """True when `text` uses the retired spelling outside a migration note.""" + if any(code_marked(replacement).search(text) for replacement in item.replacements): + return False + note = MIGRATION_NOTE.search(text) + return any(note is None or note.start() > match.start() for match in item.pattern.finditer(text)) + + +def parse_retired(text: str) -> tuple[list[RetiredSpelling], list[str]] | None: + retired_rows = markdown_table(text, "**Retired spellings.**", "Retired spelling") + kept_rows = markdown_table(text, "**Not refused.**", "Spelling") + if retired_rows is None or kept_rows is None: + return None + retired = [] + for cells in retired_rows: + spelling = re.findall(r"`([^`]+)`", cells[0]) + if len(spelling) != 1 or len(cells) < 2: + return None + retired.append(RetiredSpelling(spelling[0], re.findall(r"`([^`]+)`", cells[1]), spelling_pattern(spelling[0]))) + kept = [token for cells in kept_rows for token in re.findall(r"`([^`]+)`", cells[0])[:1]] + return retired, kept + + def expand_rules(cell: str) -> list[str]: rules: list[str] = [] for group in cell.replace("(SHOULD)", "").split(";"): @@ -524,7 +603,13 @@ def load_convention(root: Path, report: Report) -> Convention | None: if summary is None: report.errors.append(f"{CONVENTION}: the Enforcement summary is missing") summary = [] - return Convention(rules, name5, summary) + retired = parse_retired(text) + if retired is None: + report.errors.append( + f"{CONVENTION}: the Retired spellings and Not refused tables under CFG-CHANGE-2 are missing or malformed" + ) + retired = ([], []) + return Convention(rules, name5, summary, retired[0], retired[1]) # -------------------------------------------------------------------------- @@ -2126,6 +2211,78 @@ def restricting(self, entry: dict, path: str, document: dict) -> None: self.find("CFG-EMPTY-2", entry["id"], path, at, f"the restricting member {member} accepts {problem}", "Refuse empty: declare minItems: 1 (or minProperties: 1) and no empty default") + def retired_spellings(self) -> None: + """CFG-CHANGE-2: no format file under products/ teaches a retired spelling.""" + convention = self.convention + if convention is None: + return + retired = {item.spelling for item in convention.retired} + kept = set(convention.not_refused) + for spelling in sorted(retired & kept): + self.report.errors.append(f"{CONVENTION}: {spelling} is both retired and not refused") + for row in convention.name5: + for item in row.refused: + if item.context is not None or "<" in item.text: + continue + spelling = f"{item.parent}.{item.text}" if item.parent else item.text + if spelling not in retired and spelling not in kept: + self.report.errors.append( + f"{CONVENTION}: the CFG-NAME-5 refused key {spelling} is in neither the Retired spellings " + "nor the Not refused table" + ) + for path in sorted(self.root.glob("products/**/*")): + relative = path.relative_to(self.root).as_posix() + if ( + not path.is_file() + or not relative.endswith(RETIRED_FILE_SUFFIXES) + or relative.endswith(".schema.json") + or "openapi" in path.name + or relative in (REGISTRY, REGISTER) + or "/node_modules/" in relative + ): + continue + text = path.read_text(encoding="utf-8", errors="replace") + # A dotted spelling is a key path, so look for its last key. + if not any(item.spelling.rsplit(".", 1)[-1] in text for item in convention.retired): + continue + try: + documents = list(yaml.safe_load_all(text)) + except yaml.YAMLError: + # A deliberately malformed fixture still may not teach a + # retired spelling: scan its lines instead. + for number, line in enumerate(text.splitlines(), 1): + for item in convention.retired: + if teaches(line, item): + self.retired_spelling(f"{relative}:{number}", item) + continue + for index, document in enumerate(documents): + prefix = (str(index),) if len(documents) > 1 else () + self.retired_in(relative, document, prefix, convention.retired) + + def retired_in(self, file: str, node: object, tokens: tuple[str, ...], retired: list[RetiredSpelling]) -> None: + if isinstance(node, dict): + for key, value in node.items(): + path = (*tokens, str(key)) + for item in retired: + segments = tuple(item.spelling.split(".")) + if path[-len(segments):] == segments: + self.retired_spelling(f"{file}#{pointer(path)}", item) + self.retired_in(file, value, path, retired) + elif isinstance(node, list): + for index, value in enumerate(node): + self.retired_in(file, value, (*tokens, str(index)), retired) + elif isinstance(node, str): + for item in retired: + if teaches(node, item): + self.retired_spelling(f"{file}#{pointer(tokens)}", item) + + def retired_spelling(self, where: str, item: RetiredSpelling) -> None: + replacement = ", ".join(item.replacements) or "the replacement" + self.report.errors.append( + f"{where}: retired spelling {item.spelling}; write {replacement} " + f"(CFG-CHANGE-2, Retired spellings in {CONVENTION})" + ) + def quantity_units(self) -> None: stems: dict[str, list[tuple[str, str, str, str]]] = defaultdict(list) seen = set() @@ -2603,6 +2760,7 @@ def run(root: Path, base: str | None = None, strict: bool = False) -> Report: if isinstance(document, dict): lint.schema_rules(str(item.get("id")), None, str(item.get("path")), document) lint.quantity_units() + lint.retired_spellings() lint.source_rules() entries = lint.load_register() lint.reconcile(entries, strict) diff --git a/products/platform/scripts/test_check_config_conventions.py b/products/platform/scripts/test_check_config_conventions.py index bd0f0b4987..9bb795a855 100644 --- a/products/platform/scripts/test_check_config_conventions.py +++ b/products/platform/scripts/test_check_config_conventions.py @@ -69,6 +69,24 @@ **CFG-ENV-5 (SHOULD). Files are named after the format.** +**Retired spellings.** Refused in format files outside migration notes. + +| Retired spelling | Replacement | Retired by | +|---|---|---| +| `requestTimeoutSeconds` | `requestTimeoutMilliseconds` | CFG-NAME-5 | +| `attemptTimeoutSeconds` | `attemptTimeoutMilliseconds` | CFG-NAME-5 | +| `maxAttempts` | `maximumAttempts` | CFG-NAME-5 | +| `retainDays` | `retentionDays` | CFG-NAME-5 | +| `bregctl dev` | `rstack dev` | Platform | +| `authentication.policies` | `accessProfiles` | CFG-NAME-5 | + +**Not refused.** + +| Spelling | Why it is not refused | +|---|---| +| `timeoutMilliseconds` | A member of other contracts. | +| `maxSize` | A pool bound. | + ## Exceptions | Class | Meaning | Resolution | @@ -964,6 +982,9 @@ def test_cfg_name_5_follows_the_convention_table(self) -> None: CONVENTION_TEXT.replace( "| Cache | `cacheTtlSeconds` | |", "| Cache | `cacheTtlSeconds` | |\n| Window | `deliveryWindowMinutes` | `deliveryWindowHours` |", + ).replace( + "| `bregctl dev` | `rstack dev` | Platform |", + "| `bregctl dev` | `rstack dev` | Platform |\n| `deliveryWindowHours` | `deliveryWindowMinutes` | CFG-NAME-5 |", ), ) self.assertFinding( @@ -1002,6 +1023,95 @@ def test_cfg_name_5_refuses_to_run_without_the_table(self) -> None: self.assertError(self.repo.run(), "CFG-NAME-5 table") +class RetiredSpellingTests(ConventionsTestCase): + def retired_errors(self) -> list[str]: + return [error for error in self.repo.run().errors if "retired spelling" in error] + + def test_cfg_change_2_refuses_a_retired_spelling_in_a_format_file(self) -> None: + self.repo.write("products/casework/examples/demo/queue.yaml", "queue:\n maxAttempts: 3\n") + self.repo.write("products/casework/fixtures/run.json", '{"command": "bregctl dev start demo"}\n') + report = self.repo.run() + self.assertError(report, "products/casework/examples/demo/queue.yaml#/queue/maxAttempts: retired spelling " + "maxAttempts; write maximumAttempts") + self.assertError(report, "products/casework/fixtures/run.json#/command: retired spelling bregctl dev") + self.assertTrue(report.failed) + + def test_cfg_change_2_refuses_a_retired_key_whatever_its_comment_or_siblings_say(self) -> None: + self.repo.write( + "products/casework/examples/demo/audit.yaml", + "audit:\n retainDays: 30 # rotated files are removed after this\n", + ) + self.repo.write( + "products/casework/fixtures/minified.json", + '{"queue":{"maxAttempts":3},"expect":{"error":"an unknown key is refused"}}', + ) + self.repo.write( + "products/casework/examples/demo/auth.yaml", + "authentication:\n policies: {}\n", + ) + errors = self.retired_errors() + self.assertEqual(len(errors), 3, errors) + self.assertIn("products/casework/examples/demo/audit.yaml#/audit/retainDays:", " ".join(errors)) + self.assertIn("products/casework/fixtures/minified.json#/queue/maxAttempts:", " ".join(errors)) + self.assertIn("products/casework/examples/demo/auth.yaml#/authentication/policies:", " ".join(errors)) + + def test_cfg_change_2_refuses_teaching_prose_that_only_mentions_a_migration_word(self) -> None: + self.repo.write( + "products/casework/fixtures/prose.json", + '{"a": "Requests that run past `requestTimeoutSeconds` are refused with 504.", ' + '"b": "`bregctl dev start` replaces any running stack.", ' + '"c": "Set `retainDays: 30`, older audit files are removed at rotation.", ' + '"d": "Set `maxAttempts` before maximumAttempts is read."}\n', + ) + self.assertEqual(len(self.retired_errors()), 4) + + def test_cfg_change_2_matches_whole_spellings_only(self) -> None: + self.repo.write( + "products/casework/examples/demo/queue.yaml", + "queue:\n maxAttemptsTotal: 3\n command: bregctl dev-state\n other: rstack dev\n", + ) + self.assertEqual(self.retired_errors(), []) + + def test_cfg_change_2_accepts_a_migration_note_in_a_string(self) -> None: + self.repo.write( + "products/casework/fixtures/refusals.json", + '{"a": "The renamed maxAttempts is now maximumAttempts", ' + '"b": "write `maximumAttempts` in place of maxAttempts", ' + '"c": "Replace retainDays with `retentionDays`"}\n', + ) + self.assertEqual(self.retired_errors(), []) + + def test_cfg_change_2_scans_the_lines_of_a_file_that_does_not_parse(self) -> None: + self.repo.write("products/casework/fixtures/broken.yaml", "queue: [\n maxAttempts: 3\n") + self.assertEqual( + self.retired_errors(), + ["products/casework/fixtures/broken.yaml:2: retired spelling maxAttempts; write maximumAttempts " + "(CFG-CHANGE-2, Retired spellings in products/platform/CONFIG-CONVENTIONS.md)"], + ) + + def test_cfg_change_2_skips_schemas_and_openapi_documents(self) -> None: + self.repo.write("products/casework/generated/old.schema.json", '{"maxAttempts": 1}\n') + self.repo.write("products/casework/generated/casework.openapi.json", '{"maxAttempts": 1}\n') + self.assertEqual(self.retired_errors(), []) + + def test_cfg_change_2_needs_each_refused_key_in_one_table(self) -> None: + self.repo.write(CONVENTION, CONVENTION_TEXT.replace("| `retainDays` | `retentionDays` | CFG-NAME-5 |\n", "")) + self.assertError(self.repo.run(), "refused key retainDays is in neither") + self.repo.write( + CONVENTION, + CONVENTION_TEXT.replace("| `maxSize` | A pool bound. |", "| `maxSize` | A pool bound. |\n| `maxAttempts` | No. |"), + ) + self.assertError(self.repo.run(), "maxAttempts is both retired and not refused") + + def test_cfg_change_2_refuses_to_run_without_the_tables(self) -> None: + self.repo.write(CONVENTION, CONVENTION_TEXT.replace("**Not refused.**", "**Kept.**")) + self.assertError(self.repo.run(), "Retired spellings and Not refused tables") + + def test_cfg_change_2_docs_check_uses_the_same_migration_words(self) -> None: + script = SCRIPT.parents[3] / "docs/site/scripts/check-stale-config-vocabulary.sh" + self.assertIn(f"/{lint.MIGRATION_WORDS}/", script.read_text(encoding="utf-8")) + + class IdentifierTests(ConventionsTestCase): def test_cfg_id_1_reports_an_id_without_the_local_id_type(self) -> None: self.repo.project["$defs"]["Queue"]["properties"]["id"] = {"type": "string"} diff --git a/products/render/CHANGELOG.md b/products/render/CHANGELOG.md index 738351d265..e5c5a91365 100644 --- a/products/render/CHANGELOG.md +++ b/products/render/CHANGELOG.md @@ -5,8 +5,7 @@ - BREAKING: Generated Render clients use `documentType` in `path` arguments for rendering and sealing. Replace `type` when calling those operations. Operation names and concrete HTTP URLs stay the same. -- Render help and configuration docs call `authentication.apiKeyRef` a shared - API key for document discovery and unsigned rendering. +- Render calls `authentication.apiKeyRef` the shared API key instead of the legacy API key, and states its lifecycle: a supported mode for a single trusted caller with no OIDC issuer, which never seals and whose audit entries all carry the same key fingerprint. The key name and behaviour are unchanged. The `render.forbidden` detail on the seal route, the `render.runtime.authentication` action and the `render.runtime.signing-requires-oidc` message now say shared API key. The problem and finding codes are unchanged, so only a reader that matches the old text exactly needs updating. ## 0.49.0 - 2026-12-01 diff --git a/products/render/README.md b/products/render/README.md index 9dc0975ce3..ef4e2c4487 100644 --- a/products/render/README.md +++ b/products/render/README.md @@ -11,14 +11,14 @@ library. Render is a **pure function**: data in, PDF out, with no database. The optional HTTP adapter validates resource-bound access tokens through the shared OIDC -verifier or uses an explicit legacy API key. Only the adapter fetches issuer +verifier or accepts one configured shared API key. Only the adapter fetches issuer metadata and keys; CLI and library rendering remain offline. It runs three ways with the same rendering guarantees: - **CLI** — `registry-render compile --bundle … --data … --issued-at … --output …`, offline, zero config: branch printing, template authoring, CI. - **Service** — `registry-render serve`: one POST endpoint (`/v1/render/{documentType}`), - resource-token or legacy API-key auth, supervised workers, and value-free audit entries + resource-token or shared API-key auth, supervised workers, and value-free audit entries written before every render and before every response. - **Seal** (optional): with a `signing` block in the runtime file, `serve` adds `POST /v1/seal/{documentType}`, which returns the rendered document with a PAdES diff --git a/products/render/generated/README.md b/products/render/generated/README.md new file mode 100644 index 0000000000..83859aab7f --- /dev/null +++ b/products/render/generated/README.md @@ -0,0 +1 @@ +`registry-render.openapi.json` is the hand-maintained HTTP contract, not generator output: edit it directly. `crates/registry-render/tests/serve_seal.rs` pins the served document to these bytes. diff --git a/products/render/generated/registry-render.openapi.json b/products/render/generated/registry-render.openapi.json index 4877602257..2f1c8b8855 100644 --- a/products/render/generated/registry-render.openapi.json +++ b/products/render/generated/registry-render.openapi.json @@ -285,7 +285,7 @@ } }, "securitySchemes": { - "bearerAuth": { "type": "http", "scheme": "bearer", "description": "Resource-bound OIDC access token with the route's scope: render:render for documents and rendering, render:seal for sealing. For document type discovery and unsigned rendering, clients can also send the shared API key configured in authentication.apiKeyRef as a bearer credential." } + "bearerAuth": { "type": "http", "scheme": "bearer", "description": "Resource-bound OIDC access token with the route's scope: render:render for documents and rendering, render:seal for sealing. Or the configured shared API key, which never seals." } } } } diff --git a/products/render/schemas/runtime.schema.json b/products/render/schemas/runtime.schema.json index 2d93323b55..36e0185a32 100644 --- a/products/render/schemas/runtime.schema.json +++ b/products/render/schemas/runtime.schema.json @@ -139,7 +139,7 @@ "properties": { "apiKeyRef": { "$ref": "#/$defs/SecretReference", - "description": "Secret reference to the caller API key, under a declared provider.\nOmit when OIDC authentication is configured." + "description": "Secret reference to the shared API key, under a declared provider: one\nstatic bearer credential that every request presents. It is supported for a\nsingle trusted caller where no OIDC issuer is available. It never seals.\nEvery request carries the same key, so the audit records one fingerprint\nfor all calls and cannot tell callers apart. Omit when OIDC authentication\nis configured." }, "oidc": { "$ref": "#/$defs/OidcRuntime" diff --git a/release/scripts/nightly_release.py b/release/scripts/nightly_release.py index 98a9ee6c56..88f826b819 100644 --- a/release/scripts/nightly_release.py +++ b/release/scripts/nightly_release.py @@ -31,6 +31,7 @@ SCHEMA_V2 = "registry-stack.nightly.v2" SCHEMA = SCHEMA_V2 CHANNEL = "nightly-channel" +ADVISORY_REMINDER_DAYS = 30 TAG = re.compile( r"^v((?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*))-nightly\.([0-9]{8})\.([0-9a-f]{40})$" ) @@ -419,6 +420,15 @@ def channel_metadata() -> tuple[dict | None, str | None]: return read_manifest(path), head +def workspace_version() -> str: + # Import locally so native builders that only read the nightly identity do + # not need an interpreter that carries tomllib. + import tomllib + + with (ROOT / "Cargo.toml").open("rb") as handle: + return tomllib.load(handle)["workspace"]["package"]["version"] + + def plan(output: Path) -> None: if ( os.environ.get("GITHUB_REPOSITORY") != REPOSITORY @@ -435,13 +445,7 @@ def plan(output: Path) -> None: raise NightlyError( "main advanced before selection; dispatch again from current main" ) - # Imported here because the native arm64 builder imports this module only - # to check the nightly identity, which must not depend on the interpreter - # carrying tomllib; only the plan reads TOML. - import tomllib - - with (ROOT / "Cargo.toml").open("rb") as handle: - version = tomllib.load(handle)["workspace"]["package"]["version"] + version = workspace_version() today = dt.datetime.now(dt.timezone.utc).strftime("%Y%m%d") tag = f"v{version}-nightly.{today}.{sha}" identity(tag) @@ -504,7 +508,7 @@ def plan(output: Path) -> None: def advisory_checker(): - """Load the release advisory checker, which only the scan needs.""" + """Load the release advisory checker for commands that read baselines.""" spec = importlib.util.spec_from_file_location( "check_advisory_baselines", SCRIPT_DIR / "check-advisory-baselines.py" @@ -515,6 +519,63 @@ def advisory_checker(): return checker +def advisory_expiry_report(today: dt.date) -> str: + """Read the release image baselines and report dates without judging exposure.""" + checker = advisory_checker() + suffix = "-advisory-baseline.json" + images = set(image_names(workspace_version())) + # Include baselines kept in the release inventory outside the current image roster. + images.update( + path.name.removesuffix(suffix) + for path in (ROOT / "release/security").glob(f"*{suffix}") + ) + by_expiry: dict[dt.date, list[tuple[str, str]]] = {} + for image in sorted(images): + path = release_candidate.advisory_baseline_path(ROOT, image) + release_candidate._require_regular_file(path, f"{image} advisory baseline") + baseline = checker.load_baseline(path) + if baseline["service"] != image: + raise NightlyError(f"{path.name} service must equal {image}") + for exception in checker.baseline_exceptions(baseline): + reviewed = checker.parse_date(exception["reviewed_at"], "reviewed_at") + if reviewed <= today: + expiry = checker.parse_date(exception["expires_at"], "expires_at") + by_expiry.setdefault(expiry, []).append((image, exception["package"])) + + expiries = sorted(by_expiry) + earliest = next((expiry for expiry in expiries if expiry >= today), None) + lines = [ + "## Image advisory exception expiries", + "", + f"Inventory as of {today} UTC. Baselines checked: {len(images)}. " + f"Advance reminder window is {ADVISORY_REMINDER_DAYS} days.", + "", + f"Earliest active expiry is {earliest}." if earliest else "No active image advisory exceptions.", + "", + ] + for expiry in expiries: + days = (expiry - today).days + span = f"{abs(days)} {'day' if abs(days) == 1 else 'days'}" + if days < 0: + timing = f"expired {span} ago" + elif days == 0: + timing = "expires today" + elif days <= ADVISORY_REMINDER_DAYS: + timing = f"review due in {span}" + else: + timing = f"expires in {span}" + entries = by_expiry[expiry] + count = len(entries) + image_count = len({image for image, _ in entries}) + packages = sorted({package for _, package in entries}) + lines.append( + f"- **{expiry} ({timing}).** {count} {'exception' if count == 1 else 'exceptions'} " + f"across {image_count} {'image' if image_count == 1 else 'images'}. " + f"{'Package' if len(packages) == 1 else 'Packages'} {', '.join(packages)}." + ) + return "\n".join(lines).rstrip() + + def reviewed_advisories(baseline: Path | None) -> dict[tuple[str, str, str], str]: """Return the severity each current release advisory exception was reviewed at. @@ -977,6 +1038,12 @@ def main() -> int: scan_parser = subparsers.add_parser("check-scan") scan_parser.add_argument("report", type=Path) scan_parser.add_argument("--baseline", type=Path) + reminder_parser = subparsers.add_parser( + "advisory-expiry", help="report approaching image advisory exception expiries" + ) + reminder_parser.add_argument( + "--today", required=True, type=dt.date.fromisoformat, metavar="YYYY-MM-DD" + ) assemble_parser = subparsers.add_parser("assemble") assemble_parser.add_argument("--plan", required=True, type=Path) assemble_parser.add_argument("--binaries", required=True, type=Path, nargs="+") @@ -995,6 +1062,8 @@ def main() -> int: plan(args.output) elif args.command == "check-scan": check_scan(args.report, args.baseline) + elif args.command == "advisory-expiry": + print(advisory_expiry_report(args.today)) elif args.command == "assemble": assemble(args.plan, args.binaries, args.images, args.output) elif args.command == "smoke": diff --git a/release/scripts/test_nightly_release.py b/release/scripts/test_nightly_release.py index f1c958abca..3f8d1e4d6f 100644 --- a/release/scripts/test_nightly_release.py +++ b/release/scripts/test_nightly_release.py @@ -639,6 +639,111 @@ def test_nightly_advisory_policy_and_database_age(self): ): nightly.check_scan(report) + def test_advisory_expiry_reports_all_dates_and_the_advance_window(self): + today = dt.date(2026, 12, 1) + paths = [] + for image, exceptions in ( + ( + "breg", + [ + self.exception( + package="libssl3t64", reviewed_at="2026-11-30", + expires_at="2026-12-31", + ), + self.exception( + package="libother", reviewed_at="2026-11-30", + expires_at="2027-01-26", + ), + ], + ), + ( + "evidence", + [ + self.exception( + package="libssl3t64", reviewed_at="2026-11-30", + expires_at="2026-12-31", + ), + self.exception( + package="libfuture", reviewed_at="2026-12-02", + expires_at="2027-01-09", + ), + ], + ), + ): + path = release_candidate.advisory_baseline_path(self.root, image) + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(self.baseline(*exceptions, service=image).read_bytes()) + paths.append(path) + before = [path.read_bytes() for path in paths] + with ( + patch.object(nightly, "ROOT", self.root), + patch.object(nightly, "workspace_version", return_value="0.49.0"), + patch.object(nightly, "image_names", return_value=["breg"]), + ): + report = nightly.advisory_expiry_report(today) + self.assertIn("Earliest active expiry is 2026-12-31.", report) + self.assertIn( + "**2026-12-31 (review due in 30 days).** 2 exceptions across 2 images. Package libssl3t64.", + report, + ) + self.assertIn( + "**2027-01-26 (expires in 56 days).** 1 exception across 1 image. Package libother.", + report, + ) + self.assertNotIn("libfuture", report) + self.assertLess(report.index("libssl3t64"), report.index("libother")) + self.assertIn( + "2026-12-31 (expires in 31 days)", + nightly.advisory_expiry_report(today - dt.timedelta(days=1)), + ) + self.assertIn( + "2026-12-31 (expires today)", + nightly.advisory_expiry_report(dt.date(2026, 12, 31)), + ) + overdue = nightly.advisory_expiry_report(dt.date(2027, 1, 1)) + self.assertIn("2026-12-31 (expired 1 day ago)", overdue) + self.assertIn("Earliest active expiry is 2027-01-09.", overdue) + self.assertIn( + "No active image advisory exceptions.", + nightly.advisory_expiry_report(dt.date(2027, 1, 27)), + ) + self.assertEqual(before, [path.read_bytes() for path in paths]) + + def test_advisory_expiry_refuses_a_missing_or_mismatched_roster_baseline(self): + path = release_candidate.advisory_baseline_path(self.root, "breg") + mismatched = self.baseline(service="evidence").read_bytes() + with ( + patch.object(nightly, "ROOT", self.root), + patch.object(nightly, "workspace_version", return_value="0.49.0"), + patch.object(nightly, "image_names", return_value=["breg"]), + ): + with self.assertRaisesRegex(ValueError, "breg advisory baseline is missing"): + nightly.advisory_expiry_report(dt.date(2026, 12, 1)) + path.parent.mkdir(parents=True) + path.write_bytes(mismatched) + with self.assertRaisesRegex(nightly.NightlyError, "breg.*service"): + nightly.advisory_expiry_report(dt.date(2026, 12, 1)) + + def test_advisory_expiry_command_uses_the_explicit_date(self): + output = io.StringIO() + with ( + patch.object(sys, "argv", ["nightly_release.py", "advisory-expiry", "--today", "2026-12-01"]), + patch.object(nightly, "advisory_expiry_report", return_value="expiry report") as report, + contextlib.redirect_stdout(output), + ): + self.assertEqual(nightly.main(), 0) + report.assert_called_once_with(dt.date(2026, 12, 1)) + self.assertEqual(output.getvalue(), "expiry report\n") + for arguments in ([], ["--today", "2026-02-30"]): + with ( + self.subTest(arguments=arguments), + patch.object(sys, "argv", ["nightly_release.py", "advisory-expiry", *arguments]), + contextlib.redirect_stderr(io.StringIO()), + self.assertRaises(SystemExit) as result, + ): + nightly.main() + self.assertEqual(result.exception.code, 2) + def test_nightly_admits_a_finding_the_release_baseline_reviewed(self): exception = self.exception() baseline = self.baseline(exception) From 3c0366a891d3c822d8d0a23fe82538e80eec60fb Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 42/55] fix(breg): refuse mixed Action Plan spellings as package integrity Folds these reviewed commits: - fix(breg): refuse mixed Action Plan spellings as package integrity - fix(render): name apiKeyRef in the shared API key bearer description - fix(breg): explain Action Plan execution in the Proposal lifecycle - docs(coordinator): record the generated client path argument names - fix(ci): route explicit production setting declarations to docs - docs(config): complete the posture diagnostic lookup Signed-off-by: Jeremi Joslin --- .github/scripts/ci_changes.py | 19 +- .github/scripts/test_ci_changes.py | 32 +++ clients/typescript/generated/render.ts | 2 +- crates/registry-breg/src/lifecycle.rs | 2 +- crates/registry-breg/src/package.rs | 12 +- .../src/package/tests/immediate_actions.rs | 79 +++++++ .../tests/actions_functions_map.rs | 26 +-- .../PROVENANCE.md | 9 + .../historical-action-plan-module/module.yaml | 27 +++ .../scripts/request-information.rhai | 8 + .../registry-casework/src/config/issuers.rs | 2 +- crates/registry-documents/src/config.rs | 2 +- .../scripts/generate-posture-diagnostics.mjs | 78 ++++--- .../generate-posture-diagnostics.test.mjs | 37 +++- .../components/PostureDiagnosticsTable.astro | 34 ++- .../docs/operate/deployment-posture.mdx | 3 +- .../site/src/content/docs/reference/index.mdx | 1 + .../docs/reference/posture-diagnostics.mdx | 64 +++++- docs/site/src/data/posture-diagnostics.json | 197 +++++++++++++++--- products/breg/CHANGELOG.md | 4 +- .../explain/lifecycle-explanation.json | 2 +- products/coordinator/CHANGELOG.md | 3 + .../generated/registry-render.openapi.json | 2 +- 23 files changed, 536 insertions(+), 109 deletions(-) create mode 100644 crates/registry-breg/tests/fixtures/historical-action-plan-module/PROVENANCE.md create mode 100644 crates/registry-breg/tests/fixtures/historical-action-plan-module/module.yaml create mode 100644 crates/registry-breg/tests/fixtures/historical-action-plan-module/scripts/request-information.rhai diff --git a/.github/scripts/ci_changes.py b/.github/scripts/ci_changes.py index d52ff6e54a..af53de7870 100644 --- a/.github/scripts/ci_changes.py +++ b/.github/scripts/ci_changes.py @@ -1380,8 +1380,16 @@ def repo_docs_sources(root: Path = REPO_ROOT) -> frozenset[str]: ) +# A static or const typed as the platform's ExplicitProductionSetting, not a +# product's own type of the same name. +EXPLICIT_SETTING_DECLARATION = re.compile( + r"\b(?:static|const)\s+\w+\s*:\s*(?:\w+::)*ExplicitProductionSetting\s*=" +) + + def has_development_setting(path: str) -> bool: - # Match the posture generator's Rust source scope and text prefilter. + # Match the posture generator's Rust source scope and text prefilter, + # which reads development and explicit production settings. source = Path(path) parts = source.parts if ( @@ -1394,11 +1402,10 @@ def has_development_setting(path: str) -> bool: ): return False source = REPO_ROOT / source - return ( - not source.is_symlink() - and source.is_file() - and "DevelopmentSetting" in source.read_text(encoding="utf-8") - ) + if source.is_symlink() or not source.is_file(): + return False + text = source.read_text(encoding="utf-8") + return "DevelopmentSetting" in text or bool(EXPLICIT_SETTING_DECLARATION.search(text)) CONFIG_FORMATS = "products/platform/config-formats.yaml" diff --git a/.github/scripts/test_ci_changes.py b/.github/scripts/test_ci_changes.py index 261f00b138..147ac6f5c6 100644 --- a/.github/scripts/test_ci_changes.py +++ b/.github/scripts/test_ci_changes.py @@ -4365,6 +4365,38 @@ def test_new_posture_declaration_routes_to_docs_before_lookup_changes(self) -> N self.assertIs(selected["docs"], expected) self.assertTrue(selected["rust"]) + def test_new_explicit_production_declaration_routes_to_docs(self) -> None: + lookup = Path("docs/site/src/data/posture-diagnostics.json") + source = "crates/registry-breg/src/compiler/explicit_example.rs" + self.assertNotIn(source, json.loads(lookup.read_text(encoding="utf-8"))["sources"]) + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + (root / lookup).parent.mkdir(parents=True) + (root / lookup).write_bytes(lookup.read_bytes()) + file = root / source + file.parent.mkdir(parents=True) + file.write_text( + "static NEW_SETTING: ExplicitProductionSetting = example();\n", + encoding="utf-8", + ) + with patch("ci_changes.REPO_ROOT", root): + selected = classify(self.workspace, (source,), pull_request=True) + self.assertTrue(selected["docs"]) + self.assertTrue(selected["rust"]) + + # A product's own struct of the same name is not a declaration. + file.write_text( + "struct ExplicitProductionSetting { code: String }\n" + "fn found() -> ExplicitProductionSetting {\n" + " ExplicitProductionSetting { code: String::new() }\n" + "}\n", + encoding="utf-8", + ) + with patch("ci_changes.REPO_ROOT", root): + selected = classify(self.workspace, (source,), pull_request=True) + self.assertFalse(selected["docs"]) + self.assertTrue(selected["rust"]) + def test_every_published_openapi_description_runs_docs(self) -> None: """Whatever description the site fetches, a change to it rebuilds the docs.""" fetcher = Path("docs/site/scripts/fetch-openapi.mjs").read_text( diff --git a/clients/typescript/generated/render.ts b/clients/typescript/generated/render.ts index 117e7d106a..32be4d5db5 100644 --- a/clients/typescript/generated/render.ts +++ b/clients/typescript/generated/render.ts @@ -1,5 +1,5 @@ // Generated for Stack version 0.50.0, client version 0.50.0. -// Source SHA-256 85dc9ff6fb9916c30953de360ee95e8c90fdc331088aed2ac2e61018e92897cf +// Source SHA-256 f55f36da7de7a0417c2085878f09ee28cc47f6b0649b81901780a629722fa0b7 import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" diff --git a/crates/registry-breg/src/lifecycle.rs b/crates/registry-breg/src/lifecycle.rs index 98524cfa5b..d2c8b21ad2 100644 --- a/crates/registry-breg/src/lifecycle.rs +++ b/crates/registry-breg/src/lifecycle.rs @@ -597,7 +597,7 @@ fn proposal_enforcement() -> Vec { EnforcementLayer { id: "plan-preparation", events: &["submit"], - description: "Submission validates the typed Action input and runs the shared bounded plan evaluator. Function execution and external Evidence acquisition hold no database transaction or row lock. The controller rechecks the observed revision before freezing the submission.", + description: "Submission validates the typed Action input and runs the shared bounded plan evaluator. Action Plan execution and external Evidence acquisition hold no database transaction or row lock. The controller rechecks the observed revision before freezing the submission.", }, EnforcementLayer { id: "explicit-contract-rebase", diff --git a/crates/registry-breg/src/package.rs b/crates/registry-breg/src/package.rs index 5d7ffd0333..3de0ad7e37 100644 --- a/crates/registry-breg/src/package.rs +++ b/crates/registry-breg/src/package.rs @@ -4846,10 +4846,20 @@ fn load_closure( /// The refusal for stored sources that do not parse. A package closure holds /// sources an earlier release may have written, so the refusal carries the -/// reader's diagnostics for the operator to act on. +/// reader's diagnostics for the operator to act on. No release seals a file +/// that mixes or doubles the Action Plan spellings, so such a file is a +/// modified package rather than an earlier release's sources. fn source_refusal(failure: &CompileFailure) -> PackageError { const SHOWN: usize = 3; let diagnostics = failure.diagnostics(); + if diagnostics.iter().any(|diagnostic| { + diagnostic.code == "breg.action-plan.mixed-spelling" + || (diagnostic.code == "yaml.duplicate-key" + && (diagnostic.path.ends_with(".functions") + || diagnostic.path.ends_with(".function"))) + }) { + return PackageError::Integrity; + } let mut detail = diagnostics .iter() .take(SHOWN) diff --git a/crates/registry-breg/src/package/tests/immediate_actions.rs b/crates/registry-breg/src/package/tests/immediate_actions.rs index 3f808b2386..789155762b 100644 --- a/crates/registry-breg/src/package/tests/immediate_actions.rs +++ b/crates/registry-breg/src/package/tests/immediate_actions.rs @@ -1129,6 +1129,85 @@ fn sealed_package_sources_require_one_action_plan_spelling_per_file() { ); } +/// The closure of a prepared package with one scripted Action Plan, and the +/// same project bytes in the historical Action Plan spelling. +fn scripted_action_package() -> (PackageManifest, BTreeMap>, Vec) { + let mut request = package_capacity_request("scripted-source"); + let mut value: Value = serde_json::from_slice(&request.project.bytes).unwrap(); + value["actionPlans"] = json!({"rename-plan": {"runtime": "rhai", + "source": "handlers/rename.rhai", + "entrypoint": "plan", + "abi": "registry.action-plan/v1", + }}); + value["actions"]["rename-item"]["plan"] = json!({ + "type": "scripted", + "actionPlan": "rename-plan", + "inputs": ["item", "label"], + "writes": [{ + "id": "renamed", + "target": {"fromInput": "item"}, + "operation": "patch", + "fields": ["label"], + }], + }); + request.project.bytes = serde_json::to_vec(&value).unwrap(); + let historical = String::from_utf8(request.project.bytes.clone()) + .unwrap() + .replace("\"actionPlans\":", "\"functions\":") + .replace("\"type\":\"scripted\"", "\"type\":\"function\"") + .replace("\"actionPlan\":", "\"function\":") + .into_bytes(); + let prepared = prepare_package_with_project_assets( + request, + vec![PackageSourceFile { + path: "handlers/rename.rhai".to_owned(), + bytes: b"fn plan(ctx) { #{effects: []} }".to_vec(), + }], + ) + .expect("the scripted package prepares"); + (prepared.manifest, prepared.files, historical) +} + +#[test] +fn strict_package_sources_refuse_translated_action_plan_spelling() { + let (manifest, mut loaded, historical) = scripted_action_package(); + let (current, _) = compile_package_sources(&manifest, &loaded, PackageSourceMode::Strict) + .expect("the current spelling compiles strictly"); + + loaded.insert(manifest.sources.project.clone(), historical); + assert_eq!( + compile_package_sources(&manifest, &loaded, PackageSourceMode::Strict).err(), + Some(PackageError::GeneratedArtifactsMismatch) + ); + let (predecessor, _) = + compile_package_sources(&manifest, &loaded, PackageSourceMode::Predecessor) + .expect("a predecessor reads the historical spelling"); + assert_eq!(predecessor.registry_id(), current.registry_id()); + assert_eq!(predecessor.artifacts(), current.artifacts()); +} + +#[test] +fn package_sources_mixing_action_plan_spellings_are_integrity_refusals() { + let (manifest, mut loaded, historical) = scripted_action_package(); + let project = manifest.sources.project.clone(); + let mixed = String::from_utf8(historical.clone()) + .unwrap() + .replace("\"functions\":", "\"actionPlans\":"); + let doubled = String::from_utf8(historical).unwrap().replace( + "\"function\":", + "\"actionPlan\":\"rename-plan\",\"function\":", + ); + for source in [mixed, doubled] { + loaded.insert(project.clone(), source.into_bytes()); + for mode in [PackageSourceMode::Strict, PackageSourceMode::Predecessor] { + assert_eq!( + compile_package_sources(&manifest, &loaded, mode).err(), + Some(PackageError::Integrity) + ); + } + } +} + fn commit_evidence_source() -> Value { let mut value = source(); value["evidenceProviders"] = json!({"provider": {"contracts": "evidence/contracts.json", diff --git a/crates/registry-breg/tests/actions_functions_map.rs b/crates/registry-breg/tests/actions_functions_map.rs index b71dc1d09f..d2c3acb2b6 100644 --- a/crates/registry-breg/tests/actions_functions_map.rs +++ b/crates/registry-breg/tests/actions_functions_map.rs @@ -7,7 +7,6 @@ use registry_breg::compiler::module_digest_with_assets; use registry_breg::contract::{parse_module_yaml, parse_project_yaml, ModuleAssetSource}; -use serde_json::json; const PROJECT_HEAD: &str = "apiVersion: id.registrystack.org/formats/breg/project/v1alpha1 kind: BRegProject @@ -106,26 +105,17 @@ fn retired_action_plan_spellings_name_their_replacements() { #[test] fn a_scripted_action_keeps_the_historical_module_digest() { - let project = registry_platform_yaml::Reader::new("registry.yaml") - .scan(include_bytes!( - "../../../products/coordinator/examples/applications-registry/registry.yaml" - )) - .unwrap() - .unwrap() - .to_json_value(); - let source = json!({ - "apiVersion": "id.registrystack.org/formats/breg/module/v1alpha1", - "kind": "BRegModule", - "id": "extension", - "version": "0.1.0", - "actionPlans": project["actionPlans"], - "actions": project["actions"], - }); - let module = parse_module_yaml(&serde_json::to_vec(&source).unwrap()).unwrap(); + let module = parse_module_yaml(include_bytes!( + "fixtures/historical-action-plan-module/module.yaml" + )) + .unwrap(); let asset = ModuleAssetSource { module: Some("extension".into()), path: "scripts/request-information.rhai".into(), - bytes: include_bytes!("../../../products/coordinator/examples/applications-registry/scripts/request-information.rhai").to_vec(), + bytes: include_bytes!( + "fixtures/historical-action-plan-module/scripts/request-information.rhai" + ) + .to_vec(), }; // Recorded by the released v0.49 `bregctl project lock` on the same // module and asset with the historical authored spellings. diff --git a/crates/registry-breg/tests/fixtures/historical-action-plan-module/PROVENANCE.md b/crates/registry-breg/tests/fixtures/historical-action-plan-module/PROVENANCE.md new file mode 100644 index 0000000000..686eeec435 --- /dev/null +++ b/crates/registry-breg/tests/fixtures/historical-action-plan-module/PROVENANCE.md @@ -0,0 +1,9 @@ +# Module whose digest a released v0.49 lock recorded + +The `actionPlans` and `actions` of the Coordinator applications registry +example, as a module, with its Rhai asset kept byte for byte. The released +v0.49 `bregctl project lock` recorded the module digest that +`actions_functions_map.rs` pins, over the same module written with the +historical `functions`, `type: function` and `function` spellings. The copy +keeps the pin independent of later edits to the example. Do not edit these +files: a change breaks the pinned digest. diff --git a/crates/registry-breg/tests/fixtures/historical-action-plan-module/module.yaml b/crates/registry-breg/tests/fixtures/historical-action-plan-module/module.yaml new file mode 100644 index 0000000000..5d415f9bd1 --- /dev/null +++ b/crates/registry-breg/tests/fixtures/historical-action-plan-module/module.yaml @@ -0,0 +1,27 @@ +apiVersion: id.registrystack.org/formats/breg/module/v1alpha1 +kind: BRegModule +id: extension +version: 0.1.0 +actionPlans: + request-information-plan: + runtime: rhai + source: scripts/request-information.rhai + entrypoint: plan + abi: registry.action-plan/v1 +actions: + request-information: + execution: {mode: immediate} + inputs: + - {id: application, apiName: applicationId, type: reference, target: application, required: true, classification: internal} + - {id: reason, type: string, required: true, minimumLength: 1, maximumLength: 256, classification: internal} + plan: + type: scripted + actionPlan: request-information-plan + inputs: [application, reason] + refusals: + - {code: invalid-reason, label: The information request requires a nonblank reason.} + writes: + - id: application + target: {fromInput: application} + operation: patch + fields: [information-requested, reason] diff --git a/crates/registry-breg/tests/fixtures/historical-action-plan-module/scripts/request-information.rhai b/crates/registry-breg/tests/fixtures/historical-action-plan-module/scripts/request-information.rhai new file mode 100644 index 0000000000..7f2a08c5dd --- /dev/null +++ b/crates/registry-breg/tests/fixtures/historical-action-plan-module/scripts/request-information.rhai @@ -0,0 +1,8 @@ +fn plan(ctx) { + let reason = ctx.inputs.reason; + reason.trim(); + if reason == "" { + return #{refusal: #{code: "invalid-reason", field: "reason"}}; + } + #{effects: [#{id: "application", set: #{"information-requested": true, reason: reason}}]} +} diff --git a/crates/registry-casework/src/config/issuers.rs b/crates/registry-casework/src/config/issuers.rs index d2e025fa87..47e9766849 100644 --- a/crates/registry-casework/src/config/issuers.rs +++ b/crates/registry-casework/src/config/issuers.rs @@ -26,7 +26,7 @@ pub const ISSUERS_POINTER: &str = "/authentication/oidc/issuers"; pub static UNRESTRICTED_CLIENTS: DevelopmentSetting = DevelopmentSetting { code: "casework.posture.unrestricted-clients", key: "allowedClients", - summary: "admits a token from every client this issuer signs for", + summary: "this issuer entry admits a token from every client the issuer signs for", production: "List the OAuth clients whose access tokens this issuer entry admits.", }; diff --git a/crates/registry-documents/src/config.rs b/crates/registry-documents/src/config.rs index defeeba877..041501ebbf 100644 --- a/crates/registry-documents/src/config.rs +++ b/crates/registry-documents/src/config.rs @@ -436,7 +436,7 @@ registry_platform_yaml::tagged_union!(ContentVerificationConfig); static DOCUMENTS_CONTENT_VERIFICATION_DISABLED: DevelopmentSetting = DevelopmentSetting { code: "documents.posture.content-verification-disabled", key: "contentVerification", - summary: "Finalized document versions are approved without content verification.", + summary: "Finalized document versions are approved without content verification", production: "Configure an HTTP content verifier.", }; diff --git a/docs/site/scripts/generate-posture-diagnostics.mjs b/docs/site/scripts/generate-posture-diagnostics.mjs index a17187324a..090ec9a4f6 100644 --- a/docs/site/scripts/generate-posture-diagnostics.mjs +++ b/docs/site/scripts/generate-posture-diagnostics.mjs @@ -7,7 +7,11 @@ import { publishJson } from './configuration-reference.mjs'; const root = fileURLToPath(new URL('../../../', import.meta.url)); const output = 'docs/site/src/data/posture-diagnostics.json'; -const fields = ['code', 'key', 'summary', 'production']; +// Each declaration type and the fields its struct literal must give. +const declarations = { + DevelopmentSetting: ['code', 'key', 'summary', 'production'], + ExplicitProductionSetting: ['code', 'key', 'summary'], +}; const identifier = /^[A-Za-z_]\w*$/u; // Keep literal strings intact and ignore comments so neither can introduce @@ -51,19 +55,22 @@ function skipTestItem(tokens, start) { return tokens.length; } -function afterSettingType(tokens, index) { +// The declaration type named at `index`, after any path qualifier. +function settingType(tokens, index) { while (tokens[index + 1] === '::' && identifier.test(tokens[index] ?? '')) { index += 2; } - return tokens[index] === 'DevelopmentSetting' ? index + 1 : -1; + return Object.hasOwn(declarations, tokens[index]) ? { type: tokens[index], end: index + 1 } : null; } -function readSetting(tokens, start, file, name) { +function readSetting(tokens, start, file, name, type) { const fail = (message) => { throw new Error(file + ' (' + name + '): ' + message); }; - const open = afterSettingType(tokens, start); - if (tokens[open] !== '{') fail('expected a DevelopmentSetting struct literal'); + const fields = declarations[type]; + const literal = settingType(tokens, start); + const open = literal?.type === type ? literal.end : -1; + if (tokens[open] !== '{') fail('expected a ' + type + ' struct literal'); const values = {}; let index = open + 1; @@ -85,17 +92,17 @@ function readSetting(tokens, start, file, name) { else if (tokens[index] !== '}') fail(field + ' must use a single string literal'); } if (fields.some((field) => !Object.hasOwn(values, field))) fail('missing required field'); - return { - code: values.code, - key: values.key, - condition: values.summary, - remedy: values.production, - }; + // The runtime appends to the summary, so a final period breaks its message. + if (values.summary.endsWith('.')) fail('summary is a message fragment and must not end with a period'); + const crate = file.split('/')[1]; + return type === 'DevelopmentSetting' + ? { code: values.code, key: values.key, condition: values.summary, remedy: values.production, crate } + : { code: values.code, key: values.key, condition: values.summary, crate }; } function readDeclarations(source, file) { const tokens = rustTokens(source); - const rows = []; + const rows = { DevelopmentSetting: [], ExplicitProductionSetting: [] }; for (let index = 0; index < tokens.length; index++) { if (tokens.slice(index, index + 7).join('') === '#[cfg(test)]') { index = skipTestItem(tokens, index + 7); @@ -104,9 +111,9 @@ function readDeclarations(source, file) { if (tokens[index] !== 'static' && tokens[index] !== 'const') continue; const name = tokens[index + 1]; if (!identifier.test(name ?? '') || tokens[index + 2] !== ':') continue; - const end = afterSettingType(tokens, index + 3); - if (tokens[end] !== '=') continue; - rows.push(readSetting(tokens, end + 1, file, name)); + const declared = settingType(tokens, index + 3); + if (!declared || tokens[declared.end] !== '=') continue; + rows[declared.type].push(readSetting(tokens, declared.end + 1, file, name, declared.type)); } return rows; } @@ -122,7 +129,7 @@ async function* rustFiles(directory, base) { } export async function generatePostureDiagnostics(directory) { - const byKey = new Map(); + const byKey = { DevelopmentSetting: new Map(), ExplicitProductionSetting: new Map() }; const sources = []; const crates = await readdir(join(directory, 'crates'), { withFileTypes: true }); for (const crate of crates.filter((entry) => entry.isDirectory())) { @@ -131,22 +138,35 @@ export async function generatePostureDiagnostics(directory) { if (!entries.some((entry) => entry.name === 'src' && entry.isDirectory())) continue; for await (const file of rustFiles(directory, cratePath + '/src')) { const source = await readFile(join(directory, file), 'utf8'); - if (!source.includes('DevelopmentSetting')) continue; - const rows = readDeclarations(source, file); - if (rows.length) sources.push(file); - for (const row of rows) { - const id = JSON.stringify([row.code, row.key]); - const previous = byKey.get(id); - if (previous && JSON.stringify(previous.row) !== JSON.stringify(row)) { - throw new Error(file + ' and ' + previous.file + ': conflicting metadata for ' + row.code + ' (' + row.key + ')'); + if (!Object.keys(declarations).some((type) => source.includes(type))) continue; + const found = readDeclarations(source, file); + if (Object.values(found).some((rows) => rows.length)) sources.push(file); + for (const [type, rows] of Object.entries(found)) { + for (const row of rows) { + // Every declaration of a code and key carries the same metadata; + // the row lists each crate that declares it. + const { crate, ...metadata } = row; + const id = JSON.stringify([row.code, row.key]); + const previous = byKey[type].get(id); + if (previous && JSON.stringify(previous.metadata) !== JSON.stringify(metadata)) { + throw new Error(file + ' and ' + previous.file + ': conflicting metadata for ' + row.code + ' (' + row.key + ')'); + } + const crates = new Set(previous?.crates).add(crate); + byKey[type].set(id, { file: previous?.file ?? file, metadata, crates }); } - byKey.set(id, { file, row }); } } } - if (!byKey.size) throw new Error('no DevelopmentSetting declarations found'); - const diagnostics = [...byKey.keys()].sort().map((id) => byKey.get(id).row); - return { sources: sources.sort(), diagnostics }; + if (!byKey.DevelopmentSetting.size) throw new Error('no DevelopmentSetting declarations found'); + const sorted = (rows) => [...rows.keys()].sort().map((id) => { + const { metadata, crates } = rows.get(id); + return { ...metadata, crates: [...crates].sort() }; + }); + return { + sources: sources.sort(), + diagnostics: sorted(byKey.DevelopmentSetting), + explicit: sorted(byKey.ExplicitProductionSetting), + }; } async function main() { diff --git a/docs/site/scripts/generate-posture-diagnostics.test.mjs b/docs/site/scripts/generate-posture-diagnostics.test.mjs index 03646ec0b3..84ee9740cb 100644 --- a/docs/site/scripts/generate-posture-diagnostics.test.mjs +++ b/docs/site/scripts/generate-posture-diagnostics.test.mjs @@ -12,7 +12,7 @@ import { generatePostureDiagnostics } from './generate-posture-diagnostics.mjs'; const exec = promisify(execFile); const script = fileURLToPath(new URL('./generate-posture-diagnostics.mjs', import.meta.url)); -function setting(name, code, key = 'mode', condition = 'Development mode is selected.') { +function setting(name, code, key = 'mode', condition = 'development mode is selected') { return `static ${name}: DevelopmentSetting = registry_platform_config::DevelopmentSetting { code: "${code}", key: "${key}", @@ -54,25 +54,52 @@ test('collects live settings and preserves both keys for a shared code', async ( 'crates/example/src/config_tests.rs': setting('TEST', 'test.posture.external'), 'crates/example/tests/config.rs': setting('TEST', 'test.posture.integration'), }); - const { sources, diagnostics } = await generatePostureDiagnostics(directory); + const { sources, diagnostics, explicit } = await generatePostureDiagnostics(directory); assert.deepEqual(sources, [first, second]); assert.deepEqual(diagnostics, ['mode', 'origin'].map((key) => ({ code, key, - condition: 'Development mode is selected.', + condition: 'development mode is selected', remedy: 'Set a production mode.', + crates: ['example'], }))); + assert.deepEqual(explicit, []); +}); + +test('lists explicit production settings and every crate that declares a code', async (t) => { + const explicitSetting = (name, code) => `static ${name}: registry_platform_config::ExplicitProductionSetting = ExplicitProductionSetting { + code: "${code}", + key: "allowedClients", + summary: "admits every client the issuer signs for", +};`; + const directory = await fixture(t, { + 'crates/first/src/lib.rs': setting('FIRST', 'example.posture.mode') + explicitSetting('OPEN', 'platform.posture.open'), + 'crates/second/src/lib.rs': setting('SECOND', 'example.posture.mode'), + // A product's own type of the same name is not a declaration. + 'crates/third/src/check.rs': 'struct ExplicitProductionSetting { code: String }\nfn f() -> ExplicitProductionSetting { ExplicitProductionSetting { code: String::new() } }\n', + }); + const { sources, diagnostics, explicit } = await generatePostureDiagnostics(directory); + assert.deepEqual(sources, ['crates/first/src/lib.rs', 'crates/second/src/lib.rs']); + assert.deepEqual(diagnostics.map(({ code, crates }) => [code, crates]), [['example.posture.mode', ['first', 'second']]]); + assert.deepEqual(explicit, [{ + code: 'platform.posture.open', + key: 'allowedClients', + condition: 'admits every client the issuer signs for', + crates: ['first'], + }]); }); test('rejects conflicting metadata and unsupported field expressions', async (t) => { const code = 'example.posture.mode'; const path = 'crates/example/src/lib.rs'; const directory = await fixture(t, { - [path]: [setting('FIRST', code), setting('SECOND', code, 'mode', 'Different condition.')].join('\n'), + [path]: [setting('FIRST', code), setting('SECOND', code, 'mode', 'different condition')].join('\n'), }); await assert.rejects(generatePostureDiagnostics(directory), /conflicting metadata.*example\.posture\.mode/); await writeFile(join(directory, path), setting('FIRST', code).replace('"Set a production mode."', 'REMEDY')); await assert.rejects(generatePostureDiagnostics(directory), /crates\/example\/src\/lib\.rs.*production.*string literal/); + await writeFile(join(directory, path), setting('FIRST', code, 'mode', 'Development mode is selected.')); + await assert.rejects(generatePostureDiagnostics(directory), /summary is a message fragment/); }); test('check fails for stale committed input without rewriting it', async (t) => { @@ -81,7 +108,7 @@ test('check fails for stale committed input without rewriting it', async (t) => const directory = await fixture(t, { [path]: setting('FIRST', code) }); await exec(process.execPath, [script, '--root', directory, '--write']); await exec(process.execPath, [script, '--root', directory, '--check']); - await writeFile(join(directory, path), setting('FIRST', code, 'mode', 'Changed condition.')); + await writeFile(join(directory, path), setting('FIRST', code, 'mode', 'changed condition')); for (let attempt = 0; attempt < 2; attempt++) { await assert.rejects( exec(process.execPath, [script, '--root', directory, '--check']), diff --git a/docs/site/src/components/PostureDiagnosticsTable.astro b/docs/site/src/components/PostureDiagnosticsTable.astro index 278d35a745..1060a4059f 100644 --- a/docs/site/src/components/PostureDiagnosticsTable.astro +++ b/docs/site/src/components/PostureDiagnosticsTable.astro @@ -1,23 +1,41 @@ --- -import { diagnostics } from '../data/posture-diagnostics.json'; +import { diagnostics, explicit } from '../data/posture-diagnostics.json'; + +interface Props { + /** `development` lists the settings production refuses; `explicit` lists the ones it accepts. */ + kind?: 'development' | 'explicit'; + /** Only rows declared by these crates. */ + only?: string[]; + /** Leave out rows declared only by these crates. */ + except?: string[]; +} + +const { kind = 'development', only, except = [] } = Astro.props; +const rows = (kind === 'explicit' ? explicit : diagnostics).filter(({ crates }) => + only ? crates.some((crate) => only.includes(crate)) : crates.some((crate) => !except.includes(crate)), +); +// Declarations write the condition as a message fragment; show it as a sentence. +const sentence = (text: string) => text.charAt(0).toUpperCase() + text.slice(1); --- - + - + {kind === 'development' && } + - {diagnostics.map(({ code, key, condition, remedy }) => ( + {rows.map((row) => ( - - - - + + + + {kind === 'development' && } + ))} diff --git a/docs/site/src/content/docs/operate/deployment-posture.mdx b/docs/site/src/content/docs/operate/deployment-posture.mdx index 4527e1587a..373e784a53 100644 --- a/docs/site/src/content/docs/operate/deployment-posture.mdx +++ b/docs/site/src/content/docs/operate/deployment-posture.mdx @@ -71,7 +71,8 @@ Examples include non-loopback plain HTTP issuers (`allowInsecureHttp: true`), field-encryption key custody, disabled document content verification, and Registry Evidence `assuranceProfile: local`. -Each development-only setting carries a stable `.posture.` code: +Each development-only setting carries a stable `.posture.` code. Look up a code in +[Posture diagnostic codes](../../reference/posture-diagnostics/). - In `production`, `check` and startup refuse every development-only setting as an error diagnostic. Each diagnostic names the configuration pointer and the production replacement. diff --git a/docs/site/src/content/docs/reference/index.mdx b/docs/site/src/content/docs/reference/index.mdx index fd0ee2599c..69d1e5ec75 100644 --- a/docs/site/src/content/docs/reference/index.mdx +++ b/docs/site/src/content/docs/reference/index.mdx @@ -20,6 +20,7 @@ from the task section that uses them. ## Configuration and commands - [Configuration files](configuration-files/) +- [Posture diagnostic codes](posture-diagnostics/) The generated command-line reference is published only after its exact source version receives a recorded human review. diff --git a/docs/site/src/content/docs/reference/posture-diagnostics.mdx b/docs/site/src/content/docs/reference/posture-diagnostics.mdx index a870e45c67..43e8e89148 100644 --- a/docs/site/src/content/docs/reference/posture-diagnostics.mdx +++ b/docs/site/src/content/docs/reference/posture-diagnostics.mdx @@ -1,11 +1,11 @@ --- title: Posture diagnostic codes description: Look up a development-only configuration diagnostic by code and find the change to make for production. -status: draft +status: current owner: registry-docs source_repos: - registry-stack -last_reviewed: unreviewed +last_reviewed: "2026-12-01" doc_type: reference locale: en standards_referenced: [] @@ -14,13 +14,59 @@ wide: true import PostureDiagnosticsTable from '../../../components/PostureDiagnosticsTable.astro'; -Search for the code in your diagnostic. If it appears twice, match the configuration key named in -the diagnostic's JSON pointer. Apply the production remedy to that setting before deploying. +A posture diagnostic reports a configuration setting that is safe only on a workstation or in a +test. Its code has the form `.posture.`, and it names the JSON pointer of the +setting. In production, `check` and startup report it as an error and the process refuses to +start. In development, the same code is a warning: `--deny-warnings` does not fail on it, and the +process lists it in its startup log and in the `developmentSettings` member of `/ready`. -The table covers development-only settings declared by the products and shared configuration -readers in this source tree. See [Deployment posture](../../operate/deployment-posture/) for the -rules that choose a posture and the settings that require an explicit production choice. +To fix a production error, find the code below and apply its production remedy. On a laptop or in +a test run, declare development instead: start the project with `rstack dev`, or set +`REGISTRY_STACK_POSTURE=development` or pass `--posture development`. Most remedies change the +runtime file. Some change something the runtime reads, such as the package, the discovery index +or the identity provider's discovery document, and the remedy says so. -{/* Evidence: crates/registry-platform-config/src/posture.rs, DevelopmentSetting, FoundSetting. */} +This page covers the posture codes the Registry Stack products in this release declare. See +[Deployment posture](../../operate/deployment-posture/) for how a process chooses its posture. - +{/* Evidence: crates/registry-platform-config/src/posture.rs, PostureReport::diagnostics, PostureReport::ready_member, DevelopmentSetting, ExplicitProductionSetting; docs/site/scripts/generate-posture-diagnostics.mjs. */} + +## Development-only settings + +Production refuses each of these. The Setting column names the configuration member that holds +the value; match it against the pointer in the diagnostic when a code appears twice. Where names +the component that reports the code. + + + +`breg.posture.review-http-authorization-endpoint` is detected only at startup, after the review +page reads the issuer's discovery document, so `check` cannot report it. + + + + + + + +## Explicit production settings + +These codes report a setting that production accepts because you chose it explicitly. No action +is needed. Startup logs each one, and `check --format json` lists it under +`explicitProductionSettings`. See +[Explicit production settings](../../operate/deployment-posture/#explicit-production-settings). +`platform.posture.unrestricted-clients` is one of these, and is different from +`casework.posture.unrestricted-clients` above, which production refuses. + + + +## Other posture refusals + +These codes are refusals about the posture itself rather than a development-only setting. + +| Code | Meaning | Remedy | +|---|---|---| +| `platform.posture.invalid-value` | The declared posture is empty, unknown or differently cased. It must be exactly `production` or `development`. | Declare a valid posture. See [Production is the default](../../operate/deployment-posture/#production-is-the-default). | +| `platform.posture.conflict` | `--posture` (or a tool's `--production` alias) and `REGISTRY_STACK_POSTURE` declare different postures, or `--posture` is given more than once. | Declare the posture once, or make both inputs agree. See [Production is the default](../../operate/deployment-posture/#production-is-the-default). | +| `evidence.posture.assurance-profile-conflict` | A development process was given an Evidence package built for production assurance. | Build the package with `assuranceProfile: local` for development, or run the package in production. | +| `render.posture.assurance-profile-conflict` | A development Render process is configured with `assuranceProfile: production`. | Write `assuranceProfile: local` and use a local key file, or start the deployment as production. See [Render configuration](../render-configuration/). | +| `render.posture.test-signing` | `registry-render test-seal` ran without declaring development. | Declare development for the test seal. See [Use a test seal in development](../../operate/registry-render/#use-a-test-seal-in-development). | diff --git a/docs/site/src/data/posture-diagnostics.json b/docs/site/src/data/posture-diagnostics.json index e868dad39d..7a05acc531 100644 --- a/docs/site/src/data/posture-diagnostics.json +++ b/docs/site/src/data/posture-diagnostics.json @@ -1,5 +1,6 @@ { "sources": [ + "crates/registry-adapter-core/src/runtime.rs", "crates/registry-adapter/src/payments/config.rs", "crates/registry-breg-mcp/src/config.rs", "crates/registry-breg-review/src/config.rs", @@ -15,6 +16,8 @@ "crates/registry-evidencectl/src/check.rs", "crates/registry-mcp-edge/src/config.rs", "crates/registry-platform-config/src/blocks.rs", + "crates/registry-platform-config/src/caller_issuers.rs", + "crates/registry-platform-config/src/destination.rs", "crates/registry-render/src/runtime.rs", "crates/registry-session/src/config.rs" ], @@ -23,139 +26,283 @@ "code": "adapter.posture.payment-simulator", "key": "provider", "condition": "Collections are sent to a synthetic simulator", - "remedy": "Remove the simulator collection connection from the production configuration." + "remedy": "Remove the simulator collection connection from the production configuration.", + "crates": [ + "registry-adapter" + ] }, { "code": "breg.posture.http-public-origin", "key": "publicOrigin", "condition": "The registry publishes links with a plain HTTP origin", - "remedy": "Set listener.publicOrigin to an HTTPS origin." + "remedy": "Set listener.publicOrigin to an HTTPS origin.", + "crates": [ + "registry-breg" + ] }, { "code": "breg.posture.local-key-custody", "key": "provider", "condition": "The field-encryption data key is stored in a local file", - "remedy": "Configure the transit provider for field encryption." + "remedy": "Configure the transit provider for field encryption.", + "crates": [ + "registry-breg" + ] }, { "code": "breg.posture.placeholder-identity", "key": "canonicalBaseIri", "condition": "The package uses a reserved placeholder registry identity", - "remedy": "Replace canonicalBaseIri and rebuild the package." + "remedy": "Replace canonicalBaseIri and rebuild the package.", + "crates": [ + "registry-breg" + ] }, { "code": "breg.posture.review-http-authorization-endpoint", "key": "issuer", "condition": "The authorization endpoint discovered from signIn.issuer is plain http", - "remedy": "Publish an https authorization_endpoint in the issuer's discovery document." + "remedy": "Publish an https authorization_endpoint in the issuer's discovery document.", + "crates": [ + "registry-breg-review" + ] }, { "code": "breg.posture.review-http-public-origin", "key": "publicOrigin", "condition": "The review page's public origin is plain http", - "remedy": "Use an https public origin." + "remedy": "Use an https public origin.", + "crates": [ + "registry-breg-review" + ] }, { "code": "breg.posture.review-http-public-origin", "key": "reviewBaseUrl", "condition": "The review base URL is plain http", - "remedy": "Use an https review base URL." + "remedy": "Use an https review base URL.", + "crates": [ + "registry-breg-mcp" + ] }, { "code": "casework.posture.unrestricted-clients", "key": "allowedClients", - "condition": "admits a token from every client this issuer signs for", - "remedy": "List the OAuth clients whose access tokens this issuer entry admits." + "condition": "this issuer entry admits a token from every client the issuer signs for", + "remedy": "List the OAuth clients whose access tokens this issuer entry admits.", + "crates": [ + "registry-casework" + ] }, { "code": "discovery.posture.loopback-catalog-url", "key": "catalogUrl", "condition": "the index advertises an address on the reader's own machine", - "remedy": "Publish HTTPS URLs on non-loopback hosts." + "remedy": "Publish HTTPS URLs on non-loopback hosts.", + "crates": [ + "registry-discovery" + ] }, { "code": "documents.posture.content-verification-disabled", "key": "contentVerification", - "condition": "Finalized document versions are approved without content verification.", - "remedy": "Configure an HTTP content verifier." + "condition": "Finalized document versions are approved without content verification", + "remedy": "Configure an HTTP content verifier.", + "crates": [ + "registry-documents" + ] }, { "code": "evidence.posture.credential-free-source", "key": "authentication", "condition": "a credential-free source connection provides no client authentication", - "remedy": "Bind an mtlsIdentity or configure an authenticated endpoint." + "remedy": "Bind an mtlsIdentity or configure an authenticated endpoint.", + "crates": [ + "registry-evidence" + ] }, { "code": "evidence.posture.local-assurance", "key": "assuranceProfile", "condition": "local assurance permits locally held signing keys", - "remedy": "Build a production or evidence-grade package with a Transit signer." + "remedy": "Build a production or evidence-grade package with a Transit signer.", + "crates": [ + "registry-evidence", + "registry-evidencectl" + ] }, { "code": "evidence.posture.supervised-validation", "key": "validationMode", "condition": "supervised validation permits a published loopback HTTP credential issuer", - "remedy": "Use validationMode: strict and publish an HTTPS credential issuer." + "remedy": "Use validationMode: strict and publish an HTTPS credential issuer.", + "crates": [ + "registry-evidence-oid4vci" + ] }, { "code": "evidence.posture.unrestricted-offer-gate", "key": "allowedClients", "condition": "an unrestricted offer gate admits all values vouched for by the issuer", - "remedy": "List the required clients and scopes explicitly." + "remedy": "List the required clients and scopes explicitly.", + "crates": [ + "registry-evidence-oid4vci" + ] }, { "code": "platform.posture.database-private-plaintext", "key": "transport", "condition": "The database connection is not encrypted and reaches a private network", - "remedy": "Write database.transport: verified-tls, and give the database a certificate the runtime trusts." + "remedy": "Write database.transport: verified-tls, and give the database a certificate the runtime trusts.", + "crates": [ + "registry-platform-config" + ] }, { "code": "platform.posture.generated-audit-key", "key": "hashKeyCustody", "condition": "The audit hash key was generated by a development tool", - "remedy": "Provision an audit hash key, reference it in audit.hashKeyRef, and write audit.hashKeyCustody: operator-provisioned." + "remedy": "Provision an audit hash key, reference it in audit.hashKeyRef, and write audit.hashKeyCustody: operator-provisioned.", + "crates": [ + "registry-platform-config" + ] }, { "code": "platform.posture.insecure-issuer-http", "key": "allowInsecureHttp", "condition": "Plain http is permitted to an issuer beyond loopback", - "remedy": "Delete allowInsecureHttp and use an https issuer." + "remedy": "Delete allowInsecureHttp and use an https issuer.", + "crates": [ + "registry-platform-config" + ] }, { "code": "platform.posture.mcp-http-published-issuer", "key": "issuer", "condition": "The published resource server issuer is plain http", - "remedy": "Use an https issuer." + "remedy": "Use an https issuer.", + "crates": [ + "registry-platform-config" + ] }, { "code": "platform.posture.mcp-http-resource", "key": "resource", "condition": "The protected resource identifier is plain http", - "remedy": "Use an https resource identifier." + "remedy": "Use an https resource identifier.", + "crates": [ + "registry-mcp-edge" + ] }, { "code": "platform.posture.session-development-loopback", "key": "tlsTermination", "condition": "The session listener admits loopback HTTP in the browser and issuer endpoints", - "remedy": "Use operator-controlled-upstream TLS termination and HTTPS endpoints." + "remedy": "Use operator-controlled-upstream TLS termination and HTTPS endpoints.", + "crates": [ + "registry-session" + ] }, { "code": "platform.posture.test-issuer", "key": "type", "condition": "The issuer's signing keys come from a test issuer", - "remedy": "Write jwksSource: {type: discovery}, or a static or uri source for the real issuer." + "remedy": "Write jwksSource: {type: discovery}, or a static or uri source for the real issuer.", + "crates": [ + "registry-platform-config" + ] }, { "code": "render.posture.local-assurance", "key": "assuranceProfile", "condition": "seals use a local key file and are marked as test seals", - "remedy": "Configure assuranceProfile: production and sign through Transit." + "remedy": "Configure assuranceProfile: production and sign through Transit.", + "crates": [ + "registry-render" + ] }, { "code": "render.posture.seals-not-served", "key": "signing", "condition": "the bundle declares seals, but this runtime has no signing block and renders those document types unsealed", - "remedy": "Configure signing.seals for the bundle's seals, or deploy a bundle whose documents do not declare seals." + "remedy": "Configure signing.seals for the bundle's seals, or deploy a bundle whose documents do not declare seals.", + "crates": [ + "registry-render" + ] + } + ], + "explicit": [ + { + "code": "adapter.posture.anonymous-https", + "key": "anonymousHttps", + "condition": "a fixed HTTPS source is reached without an application credential", + "crates": [ + "registry-adapter-core" + ] + }, + { + "code": "breg.posture.scopeless-without-subject-rule", + "key": "accessProfiles", + "condition": "a profile admits declared-kind tokens with no scope and no row rule keyed on the subject", + "crates": [ + "registry-breg" + ] + }, + { + "code": "platform.posture.client-actor-kinds", + "key": "clientActorKinds", + "condition": "tokens from the named clients are treated as the declared kinds", + "crates": [ + "registry-platform-config" + ] + }, + { + "code": "platform.posture.destination-private-plaintext", + "key": "transport", + "condition": "An outbound destination is reached without TLS, inside declared private ranges", + "crates": [ + "registry-platform-config" + ] + }, + { + "code": "platform.posture.issuer-actor-kind", + "key": "actorKind", + "condition": "every token from this issuer is treated as the declared kind", + "crates": [ + "registry-platform-config" + ] + }, + { + "code": "platform.posture.issuer-loopback-plaintext", + "key": "issuer", + "condition": "An issuer endpoint uses plain HTTP on loopback", + "crates": [ + "registry-platform-config" + ] + }, + { + "code": "platform.posture.jwt-access-token", + "key": "accessTokenType", + "condition": "admits access tokens typed JWT. ID tokens stay refused", + "crates": [ + "registry-platform-config" + ] + }, + { + "code": "platform.posture.scope-claim", + "key": "scopeClaim", + "condition": "reads scopes from a claim other than scope", + "crates": [ + "registry-platform-config" + ] + }, + { + "code": "platform.posture.unrestricted-clients", + "key": "allowedClients", + "condition": "admits a token from every client this issuer signs for", + "crates": [ + "registry-platform-config" + ] } ] } diff --git a/products/breg/CHANGELOG.md b/products/breg/CHANGELOG.md index 7fe9919540..56c8341fc3 100644 --- a/products/breg/CHANGELOG.md +++ b/products/breg/CHANGELOG.md @@ -45,7 +45,9 @@ instead of `breg.package.integrity-refused`. Update alerts for that refusal. Strict checks use the same code for historical Action Plan spelling, even when the generated artifacts match. A predecessor may use one spelling - per source file. + per source file. A sealed source file that mixes the historical and current + spellings, or declares both for one key, is refused as + `breg.package.integrity-refused`, because no release writes one. ## 0.49.0 - 2026-12-01 diff --git a/products/breg/examples/formats/explain/lifecycle-explanation.json b/products/breg/examples/formats/explain/lifecycle-explanation.json index 0171369703..2d164cdd38 100644 --- a/products/breg/examples/formats/explain/lifecycle-explanation.json +++ b/products/breg/examples/formats/explain/lifecycle-explanation.json @@ -44,7 +44,7 @@ "id": "exact-receipt-recovery" }, { - "description": "Submission validates the typed Action input and runs the shared bounded plan evaluator. Function execution and external Evidence acquisition hold no database transaction or row lock. The controller rechecks the observed revision before freezing the submission.", + "description": "Submission validates the typed Action input and runs the shared bounded plan evaluator. Action Plan execution and external Evidence acquisition hold no database transaction or row lock. The controller rechecks the observed revision before freezing the submission.", "events": [ "submit" ], diff --git a/products/coordinator/CHANGELOG.md b/products/coordinator/CHANGELOG.md index 6a68751c72..cd876287d2 100644 --- a/products/coordinator/CHANGELOG.md +++ b/products/coordinator/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +- BREAKING: Generated Coordinator clients use `workflowId`, `triggerId`, and `runId` in + `path` arguments. Replace `workflow`, `trigger`, and `run` when calling the generated + methods. Operation names and concrete HTTP URLs stay the same. - BREAKING: Name the bounded Rhai computations in a Coordinator workflow Transforms. Rename `functions` to `transforms` and use `type: transform` with a `transform` member in mappings. Use `coordinatorctl explain transforms` for the interpreter helpers and update diagnostic consumers from `coordinator.function.*` to `coordinator.transform.*`. Retained definition snapshots keep their reader and revision format. - Add `service.invoke-function/v1`, which calls one service function. The workflow names it with `serviceFunction`. A `type: service-function` runtime connection binds the function host, that one function and one credential for the host alone: an OAuth `authorization` or a `hostKeyRef` key. `check` refuses a missing name and a name the connection does not bind. The runtime refuses a function credential whose resource, client or key matches a product, external or task authority credential or the Coordinator's own audience, and compares resolved key material at startup. Calls follow external command recovery and require an `interpret` Transform. diff --git a/products/render/generated/registry-render.openapi.json b/products/render/generated/registry-render.openapi.json index 2f1c8b8855..eaf6380bbc 100644 --- a/products/render/generated/registry-render.openapi.json +++ b/products/render/generated/registry-render.openapi.json @@ -285,7 +285,7 @@ } }, "securitySchemes": { - "bearerAuth": { "type": "http", "scheme": "bearer", "description": "Resource-bound OIDC access token with the route's scope: render:render for documents and rendering, render:seal for sealing. Or the configured shared API key, which never seals." } + "bearerAuth": { "type": "http", "scheme": "bearer", "description": "Resource-bound OIDC access token with the route's scope: render:render for documents and rendering, render:seal for sealing. Or the shared API key configured in authentication.apiKeyRef, which never seals." } } } } From 2ad312ec1316ec4880614bd8a65cabafd9442bd3 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:17 +0000 Subject: [PATCH 43/55] fix(render): reach the timestamp authority through the selected destination Folds these reviewed commits: - fix(render): reach the timestamp authority through the selected destination - refactor(adapter): select source transport through the shared selector - test(adapter): pin risky literals and drop the unreachable range remedy - style: format the files the replay left unformatted - fix(render): report a refused timestamp destination as a refusal - fix(release): fail the build when the release roster fails Signed-off-by: Jeremi Joslin --- crates/registry-adapter-core/src/checks.rs | 54 +++-- .../registry-adapter-engine/src/auth/plan.rs | 7 +- crates/registry-adapter-engine/src/egress.rs | 208 +++++++++--------- crates/registry-adapterctl/src/verify/mod.rs | 74 +++++-- crates/registry-breg-mcp/src/gateway.rs | 4 +- crates/registry-bregctl/tests/cli.rs | 5 +- crates/registry-render/src/runtime.rs | 52 ++++- crates/registry-render/src/seal.rs | 169 +++++++++++--- crates/registry-render/src/server.rs | 3 +- crates/registry-render/tests/serve_seal.rs | 36 ++- .../docs/reference/render-configuration.mdx | 8 + .../site/src/content/docs/security/render.mdx | 4 +- products/render/CHANGELOG.md | 14 ++ release/scripts/build-nightly-linux-arm64.sh | 6 +- release/scripts/build-release-binaries.sh | 18 +- .../scripts/build-release-native-platform.sh | 10 +- release/scripts/test_release_roster.py | 19 ++ 17 files changed, 483 insertions(+), 208 deletions(-) diff --git a/crates/registry-adapter-core/src/checks.rs b/crates/registry-adapter-core/src/checks.rs index 4412adaa50..dc8596dbf2 100644 --- a/crates/registry-adapter-core/src/checks.rs +++ b/crates/registry-adapter-core/src/checks.rs @@ -7083,30 +7083,21 @@ fn literal_origin_address(url: ®istry_platform_yaml::Url) -> Option().ok() } -/// Whether the origin's host text explicitly denotes loopback: the name -/// `localhost` or a loopback address literal, the same admission rule -/// egress applies when it freezes the destination profile, so check and -/// load cannot disagree about the exception. -#[must_use] -pub fn loopback_exception_origin(url: ®istry_platform_yaml::Url) -> bool { - url.to_url() - .host_str() - .is_some_and(|host| registry_platform_httputil::loopback::loopback_host(host).is_some()) -} - /// The one fix for a source origin the Adapter refuses. const SOURCE_ORIGIN_FIX: &str = "Serve the source over https, or reach it on loopback through a sidecar that carries the connection over TLS."; /// The one plain-HTTP rule: Adapter sources are https or loopback only. -/// Plain HTTP is admitted inside the loopback exception and refused -/// everywhere else, for every authentication kind; a declared private -/// range admits an https answer, never plain HTTP. A source a deployment -/// reaches only over a private network is reached through a loopback -/// sidecar that holds the TLS or the tunnel. +/// The shared outbound selector decides it without a declared transport: +/// https is admitted, and plain HTTP only to an origin that explicitly +/// denotes loopback (the name `localhost` or a loopback literal), for +/// every authentication kind; a declared private range admits an https +/// answer, never plain HTTP. A source a deployment reaches only over a +/// private network is reached through a loopback sidecar that holds the +/// TLS or the tunnel. #[must_use] pub fn plain_http_origin_admitted(url: ®istry_platform_yaml::Url) -> bool { - url.is_https() || loopback_exception_origin(url) + select_destination(&url.to_url(), None, &[]).is_ok() } /// Whether a bound origin is plain HTTP on a non-loopback host. @@ -7356,6 +7347,35 @@ mod tests { }; use std::collections::BTreeMap; + /// The plain-HTTP rule: HTTPS anywhere, and plain HTTP only to an + /// origin that explicitly denotes loopback, the name `localhost` or a + /// loopback literal. A private range never admits plain HTTP. + #[test] + fn plain_http_is_admitted_only_for_explicit_loopback() { + for (spelled, admitted) in [ + ("https://records.example.invalid/", true), + ("https://10.0.0.7:8443/", true), + ("https://127.0.0.1:8443/", true), + ("http://127.0.0.1:8080/", true), + ("http://127.0.0.2/", true), + ("http://[::1]:8080/", true), + ("http://[::ffff:127.0.0.1]/", true), + ("http://localhost:8080/", true), + ("http://LOCALHOST/", true), + ("http://10.0.0.7:8080/", false), + ("http://[::ffff:10.0.0.7]/", false), + ("http://169.254.169.254/", false), + ("http://[fe80::1]/", false), + ("http://[fd00:ec2::254]/", false), + ("http://records.example.invalid/", false), + ("http://a.localhost/", false), + ("http://localhost./", false), + ] { + let url = Url::new(spelled).expect("url"); + assert_eq!(plain_http_origin_admitted(&url), admitted, "{spelled}"); + } + } + fn digest() -> Digest { Digest::new("sha256:678260a56715cba21db1f0687e5a2c5e5efb2ea0b8eea687b5f3ee8723c5f6c9") .expect("digest") diff --git a/crates/registry-adapter-engine/src/auth/plan.rs b/crates/registry-adapter-engine/src/auth/plan.rs index c715ea36dc..df5c0c3209 100644 --- a/crates/registry-adapter-engine/src/auth/plan.rs +++ b/crates/registry-adapter-engine/src/auth/plan.rs @@ -110,7 +110,8 @@ pub enum AuthPlanFault { HeaderNameOutOfBounds, /// The fixed token endpoint is not an absolute `http`/`https` URI in /// ASCII bytes with complete percent escapes and without userinfo, - /// query, or fragment, with plain HTTP confined to numeric loopback. + /// query, or fragment, with plain HTTP confined to loopback (numeric + /// loopback at authoring). TokenEndpointNotUsable, /// `resource` is not a valid RFC 8707 resource indicator. ResourceInvalid, @@ -667,9 +668,7 @@ fn validate_token_endpoint(endpoint: ®istry_platform_yaml::Url) -> Result<(), && parsed.fragment().is_none() && parsed.username().is_empty() && parsed.password().is_none() - && crate::egress::profile_admits_token_endpoints(crate::egress::destination_profile( - &parsed, - )); + && crate::egress::token_destination_profile(&parsed).is_some(); if usable { Ok(()) } else { diff --git a/crates/registry-adapter-engine/src/egress.rs b/crates/registry-adapter-engine/src/egress.rs index ee6899d35c..8435d094cc 100644 --- a/crates/registry-adapter-engine/src/egress.rs +++ b/crates/registry-adapter-engine/src/egress.rs @@ -47,6 +47,7 @@ use registry_platform_httputil::destination::{ MAX_DESTINATION_REQUEST_BODY_BYTES, MAX_DESTINATION_REQUEST_HEADERS, MAX_DESTINATION_REQUEST_HEADER_BYTES, MAX_DESTINATION_TARGET_BYTES, }; +use registry_platform_httputil::select::{select_credential_destination, select_destination}; use registry_platform_httputil::{TransportKind, MAXIMUM_TOKEN_RESPONSE_BYTES}; use registry_platform_yaml::{BoundedU64, ExternalId, SecretReference, Url}; use serde_json::Value; @@ -1202,7 +1203,9 @@ impl EndpointEgress { cidrs: &[Cidr], material: Option, ) -> Result { - let profile = destination_profile(parsed_base); + let profile = destination_profile(parsed_base).ok_or(EgressFault::Auth( + AuthError::Plan(AuthPlanFault::CredentialRequiresProtectedTransport), + ))?; let origin_id = binding.endpoint.as_str().to_ascii_lowercase(); let networks: Vec<_> = cidrs.iter().map(Cidr::network).collect(); let policy = @@ -2137,49 +2140,50 @@ fn script_template( ) } -/// The destination profile one pinned origin freezes: HTTPS carries the -/// production address controls; plain HTTP is development on loopback -/// and one private service hop everywhere else. Under the postgres-test -/// feature an https loopback origin takes the platform's pinned -/// loopback test profile, so the TLS suites can drive the same -/// frozen-policy send against a locally terminated certificate; a -/// build without the feature serves the same origin as production. -pub(crate) fn destination_profile(parsed_base: &url::Url) -> DestinationProfile { +/// The destination profile one pinned origin freezes, chosen by the +/// shared outbound selector with no declared transport: HTTPS carries the +/// production address controls, and plain HTTP is admitted only to an +/// origin that explicitly denotes loopback. `None` refuses every other +/// origin; the binding's authentication policy has already refused it +/// before the freeze, so this is the fail-closed runtime side. Under the +/// postgres-test feature an https loopback origin takes the platform's +/// pinned loopback test profile, so the TLS suites can drive the same +/// frozen-policy send against a locally terminated certificate; a build +/// without the feature serves the same origin as production. +pub(crate) fn destination_profile(parsed_base: &url::Url) -> Option { #[cfg(feature = "postgres-test")] - if parsed_base.scheme() == "https" && denotes_loopback(parsed_base) { - return DestinationProfile::PinnedLoopbackHttpsTest; - } - match parsed_base.scheme() { - "https" => DestinationProfile::ProductionHttps, - _ if denotes_loopback(parsed_base) => DestinationProfile::LoopbackHttp, - _ => DestinationProfile::PrivateServiceHttp, + if let Some(profile) = pinned_loopback_test_profile(parsed_base) { + return Some(profile); } + select_destination(parsed_base, None, &[]) + .ok() + .map(|selected| selected.profile()) } -/// Whether the origin's host explicitly denotes loopback: the name -/// `localhost` or a loopback address literal, the platform's own -/// admission rule for the development profile. The destination policy pins -/// the name to loopback addresses when it connects. -pub(crate) fn denotes_loopback(origin: &url::Url) -> bool { - origin - .host_str() - .is_some_and(|host| registry_platform_httputil::loopback::loopback_host(host).is_some()) +/// The profile a fixed token endpoint freezes. It carries the client's +/// credential, so it takes the credential selection: HTTPS or explicit +/// loopback plain HTTP, the same profiles the data path serves, decided +/// for the plan-level compile and the frozen credential policy alike so +/// they can never disagree about one endpoint. +pub(crate) fn token_destination_profile(token_endpoint: &url::Url) -> Option { + #[cfg(feature = "postgres-test")] + if let Some(profile) = pinned_loopback_test_profile(token_endpoint) { + return Some(profile); + } + select_credential_destination(token_endpoint, None, &[]) + .ok() + .map(|selected| selected.profile()) } -/// Whether a destination profile admits a token endpoint: the same -/// profiles the data path serves, decided by the same predicate the -/// plan-level compile applies, so a load refusal and the frozen -/// credential policy can never disagree about one endpoint. Plain HTTP -/// stays development-only loopback, the private service hop never -/// carries a credential request, and the pinned loopback test profile -/// is admitted only under the feature that enables it. -pub(crate) fn profile_admits_token_endpoints(profile: DestinationProfile) -> bool { - match profile { - DestinationProfile::ProductionHttps | DestinationProfile::LoopbackHttp => true, - #[cfg(feature = "postgres-test")] - DestinationProfile::PinnedLoopbackHttpsTest => true, - _ => false, - } +/// The pinned loopback test profile for an https origin whose host +/// explicitly denotes loopback, the name `localhost` or a loopback +/// literal; the destination policy pins the name to loopback addresses. +#[cfg(feature = "postgres-test")] +fn pinned_loopback_test_profile(origin: &url::Url) -> Option { + let loopback = origin + .host_str() + .is_some_and(|host| registry_platform_httputil::loopback::loopback_host(host).is_some()); + (origin.scheme() == "https" && loopback).then_some(DestinationProfile::PinnedLoopbackHttpsTest) } /// One endpoint's wired token transport, compiled once at startup: the @@ -2300,10 +2304,9 @@ fn freeze_token_send( // the authoring checks, failing closed. let refused_plan = || EgressFault::Auth(AuthError::Plan(AuthPlanFault::TokenEndpointNotUsable)); let parsed = url::Url::parse(token_plan.url()).map_err(|_| refused_plan())?; - let profile = destination_profile(&parsed); - if !profile_admits_token_endpoints(profile) { + let Some(profile) = token_destination_profile(&parsed) else { return Err(refused_plan()); - } + }; // The token endpoint is a fixed credential destination: its origin // is the endpoint the policy pins, its fixed path is the path the // declared endpoint carries. Clearing the parts the pin refuses @@ -3735,100 +3738,89 @@ mod tests { } } - /// The destination profile follows the pinned origin: HTTPS is - /// production, plain HTTP is development on loopback and a private - /// service hop everywhere else, matching the platform's own - /// loopback admission rule. + /// The shared outbound selector chooses the profile a pinned origin + /// freezes: HTTPS is production and plain HTTP is admitted only to an + /// origin that explicitly denotes loopback. Every other plain-HTTP + /// origin is refused here, as the binding's authentication policy + /// already refused it before the freeze. #[test] - fn the_destination_profile_follows_the_pinned_origin() { - let https = url::Url::parse("https://records.example.internal:8443/").expect("parsed"); - let loopback = url::Url::parse("http://127.0.0.1:8080/").expect("parsed"); - let localhost = url::Url::parse("http://localhost:8080/").expect("parsed"); - let private = url::Url::parse("http://10.0.0.7:8080/").expect("parsed"); - let public_name = url::Url::parse("http://upstream.example.invalid:80/").expect("parsed"); + fn the_destination_profile_follows_the_selector() { + let profile = + |spelled: &str| destination_profile(&url::Url::parse(spelled).expect("parsed")); assert_eq!( - destination_profile(&https), - DestinationProfile::ProductionHttps - ); - assert_eq!( - destination_profile(&loopback), - DestinationProfile::LoopbackHttp - ); - assert_eq!( - destination_profile(&localhost), - DestinationProfile::LoopbackHttp - ); - assert_eq!( - destination_profile(&private), - DestinationProfile::PrivateServiceHttp - ); - assert_eq!( - destination_profile(&public_name), - DestinationProfile::PrivateServiceHttp + profile("https://records.example.internal:8443/"), + Some(DestinationProfile::ProductionHttps) ); for spelled in [ + "http://127.0.0.1:8080/", + "http://localhost:8080/", "http://127.0.0.2:8080/", "http://[::1]:8080/", "http://[::ffff:127.0.0.1]:8080/", ] { - let origin = url::Url::parse(spelled).expect("parsed"); assert_eq!( - destination_profile(&origin), - DestinationProfile::LoopbackHttp, + profile(spelled), + Some(DestinationProfile::LoopbackHttp), "{spelled}" ); } - for spelled in ["http://a.localhost:8080/", "http://localhost.:8080/"] { - let origin = url::Url::parse(spelled).expect("parsed"); - assert_eq!( - destination_profile(&origin), - DestinationProfile::PrivateServiceHttp, - "{spelled}" - ); + for spelled in [ + "http://10.0.0.7:8080/", + "http://upstream.example.invalid:80/", + "http://a.localhost:8080/", + "http://localhost.:8080/", + ] { + assert_eq!(profile(spelled), None, "{spelled}"); + } + } + + /// A token endpoint carries a credential, so it takes the credential + /// selection: HTTPS and explicit loopback plain HTTP, the profiles + /// the token transport freezes, and nothing else. + #[test] + fn the_token_endpoint_takes_the_credential_selection() { + let profile = + |spelled: &str| token_destination_profile(&url::Url::parse(spelled).expect("parsed")); + assert_eq!( + profile("https://token.example.invalid/token"), + Some(DestinationProfile::ProductionHttps) + ); + assert_eq!( + profile("http://127.0.0.1:9/token"), + Some(DestinationProfile::LoopbackHttp) + ); + for spelled in [ + "http://10.0.0.7/token", + "http://token.example.invalid/token", + "http://a.localhost/token", + ] { + assert_eq!(profile(spelled), None, "{spelled}"); } } /// Under the postgres-test feature an https loopback origin takes - /// the platform's pinned loopback test profile, so the TLS suites - /// drive the same frozen-policy send against locally terminated - /// certificates; a named https origin stays production even under - /// the feature, and without the feature the loopback origin would - /// be production too. + /// the platform's pinned loopback test profile, for data and token + /// sends alike, so the TLS suites drive the same frozen-policy send + /// against locally terminated certificates; a named https origin + /// stays production even under the feature, and without the feature + /// the loopback origin would be production too. #[cfg(feature = "postgres-test")] #[test] fn the_pinned_loopback_https_profile_serves_only_under_its_feature() { let loopback = url::Url::parse("https://127.0.0.1:8443/").expect("parsed"); assert_eq!( destination_profile(&loopback), - DestinationProfile::PinnedLoopbackHttpsTest + Some(DestinationProfile::PinnedLoopbackHttpsTest) + ); + assert_eq!( + token_destination_profile(&loopback), + Some(DestinationProfile::PinnedLoopbackHttpsTest) ); let named = url::Url::parse("https://records.example.internal:8443/").expect("parsed"); assert_eq!( destination_profile(&named), - DestinationProfile::ProductionHttps + Some(DestinationProfile::ProductionHttps) ); - assert!(profile_admits_token_endpoints( - DestinationProfile::PinnedLoopbackHttpsTest - )); - } - - /// The token endpoint admission is the profile predicate the - /// egress layer serves: the profiles the token transport freezes - /// admit, every other profile refuses, fail-closed. - #[test] - fn the_profile_predicate_admits_exactly_the_served_profiles() { - assert!(profile_admits_token_endpoints( - DestinationProfile::ProductionHttps - )); - assert!(profile_admits_token_endpoints( - DestinationProfile::LoopbackHttp - )); - assert!(!profile_admits_token_endpoints( - DestinationProfile::PrivateServiceHttp - )); - assert!(!profile_admits_token_endpoints( - DestinationProfile::LocalPrivateDevelopmentHttp - )); } /// The declared-scheme slots a static authorization freezes: the diff --git a/crates/registry-adapterctl/src/verify/mod.rs b/crates/registry-adapterctl/src/verify/mod.rs index 860f055879..f32518eb23 100644 --- a/crates/registry-adapterctl/src/verify/mod.rs +++ b/crates/registry-adapterctl/src/verify/mod.rs @@ -48,6 +48,7 @@ use registry_platform_httputil::destination::{ DataDestinationPolicy, DestinationPolicyError, DestinationProfile, DestinationTlsMaterial, MAX_DESTINATION_CA_BUNDLE_BYTES, }; +use registry_platform_httputil::select::select_destination; use registry_platform_yaml::{Diagnostic, Report, SecretReference, Url}; use serde_json::{json, Value}; use std::collections::BTreeMap; @@ -830,7 +831,9 @@ fn destination_policy( "the destination is not admitted by the frozen policy".to_owned(), )); } - let profile = destination_profile(base); + let profile = destination_profile(base).ok_or_else(|| { + EgressFault::Refused("the destination is not admitted by the frozen policy".to_owned()) + })?; let mut origin = parsed.clone(); origin.set_path("/"); origin.set_query(None); @@ -867,27 +870,26 @@ fn destination_policy( Ok(policy) } -/// The report text for a refused destination. An empty private range list -/// keeps the platform's own text, which says how to fix it. Any other refusal -/// is a fixed sentence, so the report never repeats an origin. -fn destination_refusal(error: &DestinationPolicyError) -> String { - match error { - DestinationPolicyError::PrivateServiceRequiresPrivateCidr => error.to_string(), - _ => "the destination is not admitted by the frozen policy".to_owned(), - } +/// The report text for a refused destination: a fixed sentence, so the +/// report never repeats an origin. Verification never selects the private +/// service profile, so no refusal asks for a private range for plain HTTP. +fn destination_refusal(_error: &DestinationPolicyError) -> String { + "the destination is not admitted by the frozen policy".to_owned() } -fn destination_profile(base: &Url) -> DestinationProfile { +/// The profile the shared outbound selector chooses with no declared +/// transport, as the runtime engine freezes it: HTTPS, or plain HTTP to an +/// origin that explicitly denotes loopback. `None` refuses any other +/// origin, which the offline checks have already refused. +fn destination_profile(base: &Url) -> Option { let parsed = base.to_url(); #[cfg(feature = "tls-test")] if parsed.scheme() == "https" && denotes_loopback(base) { - return DestinationProfile::PinnedLoopbackHttpsTest; - } - match parsed.scheme() { - "https" => DestinationProfile::ProductionHttps, - _ if denotes_loopback(base) => DestinationProfile::LoopbackHttp, - _ => DestinationProfile::PrivateServiceHttp, + return Some(DestinationProfile::PinnedLoopbackHttpsTest); } + select_destination(&parsed, None, &[]) + .ok() + .map(|selected| selected.profile()) } fn denotes_loopback(origin: &Url) -> bool { @@ -1038,7 +1040,7 @@ fn drive( "path": format!("/bindings/{index}"), "message": message, "suggestedAction": - "Bind the endpoint to an https origin, a loopback address, or a range allowedPrivateCidrs admits.", + "Serve the source over https, or reach it on loopback through a sidecar that carries the connection over TLS.", })], }); } @@ -1191,15 +1193,41 @@ mod tests { ); } + /// Verification freezes the profile the runtime engine freezes: the + /// shared selector's HTTPS or explicit loopback plain HTTP, and no + /// profile for any other plain-HTTP origin. + #[cfg(not(feature = "tls-test"))] #[test] - fn an_empty_private_range_list_keeps_the_platform_remedy() { - let message = - destination_refusal(&DestinationPolicyError::PrivateServiceRequiresPrivateCidr); - assert!(message.contains("name the range"), "{message}"); + fn the_verified_profile_follows_the_selector() { + let profile = |spelled: &str| destination_profile(&Url::new(spelled).expect("url")); + assert_eq!( + profile("https://records.example.invalid/"), + Some(DestinationProfile::ProductionHttps) + ); + assert_eq!( + profile("http://127.0.0.1:8080/"), + Some(DestinationProfile::LoopbackHttp) + ); assert_eq!( - destination_refusal(&DestinationPolicyError::OriginMissingPort), - "the destination is not admitted by the frozen policy" + profile("http://localhost:8080/"), + Some(DestinationProfile::LoopbackHttp) ); + for spelled in ["http://10.0.0.7:8080/", "http://records.example.invalid/"] { + assert_eq!(profile(spelled), None, "{spelled}"); + } + } + + #[test] + fn every_destination_refusal_is_the_fixed_sentence() { + for error in [ + DestinationPolicyError::PrivateServiceRequiresPrivateCidr, + DestinationPolicyError::OriginMissingPort, + ] { + assert_eq!( + destination_refusal(&error), + "the destination is not admitted by the frozen policy" + ); + } } #[test] diff --git a/crates/registry-breg-mcp/src/gateway.rs b/crates/registry-breg-mcp/src/gateway.rs index 5fd096078b..b02a7af997 100644 --- a/crates/registry-breg-mcp/src/gateway.rs +++ b/crates/registry-breg-mcp/src/gateway.rs @@ -214,7 +214,9 @@ impl Gateway { /// The citizen's own record, through the registry's linked lookup under /// the delegated token. Anything but exactly one record is a refusal. async fn resolve_own(&self, session: &Session) -> Result { - let request = BRegListRequest::default().options(self.options()?).limit(2)?; + let request = BRegListRequest::default() + .options(self.options()?) + .limit(2)?; let page = session .client .list_records(&session.contract.details_route, &request) diff --git a/crates/registry-bregctl/tests/cli.rs b/crates/registry-bregctl/tests/cli.rs index 590b2d284f..31a8c718a0 100644 --- a/crates/registry-bregctl/tests/cli.rs +++ b/crates/registry-bregctl/tests/cli.rs @@ -1442,7 +1442,10 @@ fn missing_action_script_identifies_action_and_safe_relative_path() { .find(|diagnostic| diagnostic["code"] == "breg.source.planner-asset-missing") .unwrap_or_else(|| panic!("the missing planner asset is reported: {report}")); assert_eq!(diagnostic["code"], "breg.source.planner-asset-missing"); - assert_eq!(diagnostic["path"], "/actionPlans/register-person-plan/source"); + assert_eq!( + diagnostic["path"], + "/actionPlans/register-person-plan/source" + ); assert_eq!( diagnostic["source"]["file"], project.path().join("registry.yaml").display().to_string() diff --git a/crates/registry-render/src/runtime.rs b/crates/registry-render/src/runtime.rs index 835f60bc1e..6df7d6ad28 100644 --- a/crates/registry-render/src/runtime.rs +++ b/crates/registry-render/src/runtime.rs @@ -1770,10 +1770,12 @@ fn signing_findings( _ => {} } if let Some(authority) = &seal.timestamp_authority { - if !registry_platform_httputil::client::transport_protects_the_credential( - &authority.url.to_url(), - ) { - findings.push(finding( + // The same selection the seal's timestamp client is built on, so + // check refuses what serve would refuse at startup. + let url = authority.url.to_url(); + match registry_platform_httputil::select::select_credential_destination(&url, None, &[]) + { + Err(_) => findings.push(finding( "render.runtime.insecure-timestamp-url", format!("{base}/timestampAuthority/url"), format!( @@ -1782,7 +1784,34 @@ fn signing_findings( ), "Use the https URL of the timestamp authority; use http only for a test \ authority on localhost.", - )); + )), + Ok(selected) => { + if selected.validate_literal_host().is_err() { + findings.push(finding( + "render.runtime.timestamp-address-refused", + format!("{base}/timestampAuthority/url"), + format!( + "signing.seals.{id}.timestampAuthority.url names an address \ + Render does not dial: link-local, multicast, unspecified or a \ + cloud metadata address" + ), + "Use the URL of the timestamp authority on a routable or private \ + address.", + )); + } + if authority.ca_bundle_ref.is_some() && url.scheme() != "https" { + findings.push(finding( + "render.runtime.seal-timestamp-ca-bundle-requires-https", + format!("{base}/timestampAuthority/url"), + format!( + "signing.seals.{id}.timestampAuthority.caBundleRef applies only \ + to an https timestampAuthority.url" + ), + "Use the https URL of the timestamp authority, or remove \ + caBundleRef.", + )); + } + } } } let clients_pointer = format!("{base}/allowedClients"); @@ -4090,6 +4119,19 @@ mod tests { "render.runtime.insecure-timestamp-url", "/signing/seals/ministry/timestampAuthority/url", ), + ( + SEAL.replace("https://tsa.example.test", "https://169.254.169.254"), + "render.runtime.timestamp-address-refused", + "/signing/seals/ministry/timestampAuthority/url", + ), + ( + SEAL.replace( + " url: https://tsa.example.test/tsr\n", + " url: http://127.0.0.1:8318/tsr\n caBundleRef: secret:file/tsa-ca.pem\n", + ), + "render.runtime.seal-timestamp-ca-bundle-requires-https", + "/signing/seals/ministry/timestampAuthority/url", + ), ( SEAL.replace(ts_url, &format!("{ts_url} attemptTimeoutMilliseconds: 999\n")), "config.out-of-range", diff --git a/crates/registry-render/src/seal.rs b/crates/registry-render/src/seal.rs index f02ff67847..fee712349d 100644 --- a/crates/registry-render/src/seal.rs +++ b/crates/registry-render/src/seal.rs @@ -1179,7 +1179,7 @@ impl TimestampFailure { struct TimestampAuthority { seal_id: String, url: reqwest::Url, - client: reqwest::Client, + client: registry_platform_httputil::DestinationClient, peer_policy: registry_platform_httputil::PeerPolicy, } @@ -1238,26 +1238,51 @@ impl TimestampAuthority { ) }; let url = reqwest::Url::parse(authority.url.to_url().as_str()).map_err(|_| unusable())?; + // The request carries no credential, but the authority answers for + // the institution's seal, so it takes the same protected selection + // the runtime check applies: https, or plain http to loopback. + let selected = + registry_platform_httputil::select::select_credential_destination(&url, None, &[]) + .map_err(|_| unusable())?; + selected.validate_literal_host().map_err(|_| unusable())?; let attempt_timeout = authority.attempt_timeout(); - let client = registry_platform_httputil::client::build_client( - registry_platform_httputil::client::OutboundOptions { - request_timeout: attempt_timeout, - connect_timeout: attempt_timeout, - user_agent: Some("registry-render"), - trusted_root_certificates, - }, - ) - .map_err(|reason| match trusted_root_certificates { - None => unusable(), - Some(_) => refusal( - seal_id, - "timestampAuthority/caBundleRef", - "render.runtime.seal-timestamp-ca-bundle-invalid", - format!("signing.seals.{seal_id}.timestampAuthority.caBundleRef: {reason}"), - "Store the PEM certificates of the authorities that issue the timestamp \ + let mut builder = registry_platform_httputil::OutboundClientBuilder::new() + .timeout(attempt_timeout) + .connect_timeout(attempt_timeout) + .user_agent("registry-render") + .destination(&selected); + if let Some(pem) = trusted_root_certificates { + builder = builder.trusted_root_certificates(pem); + } + let client = builder + .try_build() + .map_err(|error| match (error, trusted_root_certificates) { + ( + registry_platform_httputil::OutboundClientBuildError::ConfiguredRootsRequireHttps, + _, + ) => refusal( + seal_id, + "timestampAuthority/url", + "render.runtime.seal-timestamp-ca-bundle-requires-https", + format!( + "signing.seals.{seal_id}.timestampAuthority.caBundleRef applies only to \ + an https timestampAuthority.url" + ), + "Use the https URL of the timestamp authority, or remove caBundleRef.", + ), + (_, None) => unusable(), + (error, Some(_)) => refusal( + seal_id, + "timestampAuthority/caBundleRef", + "render.runtime.seal-timestamp-ca-bundle-invalid", + format!( + "signing.seals.{seal_id}.timestampAuthority.caBundleRef: {}", + error.reason() + ), + "Store the PEM certificates of the authorities that issue the timestamp \ authority's TLS certificate under the reference.", - ), - })?; + ), + })?; Ok(Self { seal_id: seal_id.to_owned(), url, @@ -1297,16 +1322,33 @@ impl TimestampAuthority { }; let nonce = random_timestamp_nonce().map_err(|_| internal())?; let query = timestamp_request(signature_value, nonce).map_err(|_| internal())?; + let mut request = reqwest::Request::new(reqwest::Method::POST, self.url.clone()); + let headers = request.headers_mut(); + headers.insert( + reqwest::header::CONTENT_TYPE, + reqwest::header::HeaderValue::from_static(TIMESTAMP_QUERY), + ); + headers.insert( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static(TIMESTAMP_REPLY), + ); + *request.body_mut() = Some(query.into()); let response = self .client - .post(self.url.clone()) - .header(reqwest::header::CONTENT_TYPE, TIMESTAMP_QUERY) - .header(reqwest::header::ACCEPT, TIMESTAMP_REPLY) - .body(query) - .send() + .execute(request) .await - .map_err(|error| { - self.failure(TimestampFailure::Unreachable, transport_reason(&error)) + .map_err(|error| match error { + registry_platform_httputil::DestinationClientError::Request(error) + if destination_refused(&error) => + { + self.failure(TimestampFailure::Refused, "destination-refused") + } + registry_platform_httputil::DestinationClientError::Request(error) => { + self.failure(TimestampFailure::Unreachable, transport_reason(&error)) + } + // The request URL is the selected one, so the client never + // refuses its origin or host. + _ => internal(), })?; registry_platform_httputil::validate_response_headers(response.headers(), self.peer_policy) .map_err(|_| self.failure(TimestampFailure::Refused, "response-headers"))?; @@ -1340,6 +1382,23 @@ impl TimestampAuthority { /// The reason for a transport failure: the attempt timeout, or any other /// connection failure. +/// Whether the selected client refused the address the authority's host +/// resolved to, rather than failing to reach it: retrying cannot help, so +/// it is reported as a refusal, not as unreachable. +fn destination_refused(error: &reqwest::Error) -> bool { + let mut source = std::error::Error::source(error); + while let Some(cause) = source { + if cause + .downcast_ref::() + .is_some() + { + return true; + } + source = cause.source(); + } + false +} + fn transport_reason(error: &reqwest::Error) -> &'static str { if error.is_timeout() { "timed-out" @@ -1392,6 +1451,64 @@ mod tests { .expect("a free place") } + /// The timestamp authority client is confined to the destination the + /// shared selector chooses: https, or plain http to an explicit + /// loopback host. A cloud metadata address is never dialled, and plain + /// http elsewhere never builds a client, whatever the runtime check + /// said first. + #[test] + fn the_timestamp_authority_client_follows_the_selector() { + let authority = |url: &str| -> TimestampAuthorityRuntime { + serde_json::from_value(serde_json::json!({ "url": url })).expect("authority") + }; + let built = |url: &str| { + TimestampAuthority::new( + "ministry", + &authority(url), + None, + registry_platform_httputil::PeerPolicy::RefuseDevelopmentPeer, + ) + }; + for admitted in [ + "https://tsa.example.test/tsr", + "https://10.0.0.7/tsr", + "http://127.0.0.1:8080/tsr", + ] { + assert!(built(admitted).is_ok(), "{admitted}"); + } + for refused in ["https://169.254.169.254/tsr", "http://10.0.0.7/tsr"] { + let Err(problem) = built(refused) else { + panic!("{refused} builds a timestamp client"); + }; + assert!( + format!("{problem:?}").contains("render.runtime.seal-timestamp-client"), + "{refused}: {problem:?}" + ); + } + } + + /// A host name whose answer the selected client refuses, here an https + /// name resolving to loopback, fails the seal as a refusal the operator + /// must fix, never as an unreachable authority to retry later. + #[tokio::test] + async fn a_refused_answer_is_a_destination_refusal_not_unreachable() { + let authority: TimestampAuthorityRuntime = + serde_json::from_value(serde_json::json!({ "url": "https://localhost.:9/tsr" })) + .expect("authority"); + let authority = TimestampAuthority::new( + "ministry", + &authority, + None, + registry_platform_httputil::PeerPolicy::RefuseDevelopmentPeer, + ) + .expect("a name builds a client; its answer is checked at send"); + let problem = authority + .stamp(b"signature value") + .await + .expect_err("a loopback answer is refused"); + assert_eq!(problem.reason(), Some("destination-refused"), "{problem:?}"); + } + #[test] fn the_seconds_until_expiry_count_down_and_go_negative() { let pki = TestPki::generate().expect("test PKI"); diff --git a/crates/registry-render/src/server.rs b/crates/registry-render/src/server.rs index fc6f19bf23..ef1f0e7475 100644 --- a/crates/registry-render/src/server.rs +++ b/crates/registry-render/src/server.rs @@ -3510,7 +3510,8 @@ pub(crate) mod tests { assert!(documents_responses.get("403").is_some()); assert!(documents_responses.get("503").is_some()); assert!( - openapi["paths"]["/v1/render/{documentType}"]["post"]["responses"]["403"]["description"] + openapi["paths"]["/v1/render/{documentType}"]["post"]["responses"]["403"] + ["description"] .as_str() .unwrap() .contains("admitted") diff --git a/crates/registry-render/tests/serve_seal.rs b/crates/registry-render/tests/serve_seal.rs index 5cd8d64db8..610491397c 100644 --- a/crates/registry-render/tests/serve_seal.rs +++ b/crates/registry-render/tests/serve_seal.rs @@ -99,6 +99,8 @@ struct Tsa { tls: bool, requests: Arc, content_types: Arc>>, + /// For each request: its request line, `Accept` and `User-Agent`. + wire: Arc>>, /// The root certificate the authority's timestamp chain leads to. root_pem: String, } @@ -199,7 +201,9 @@ fn start_tsa_over(mode: TsaMode, tls: Option answer_timestamp_request(stream, mode, &pki, &seen), + None => answer_timestamp_request(stream, mode, &pki, &seen, &seen_wire), Some(config) => { let Ok(connection) = tokio_rustls::rustls::ServerConnection::new(Arc::clone(config)) @@ -221,7 +225,7 @@ fn start_tsa_over(mode: TsaMode, tls: Option>, + wire: &Mutex>, ) { let (head, query) = read_http_request(&mut stream); - let content_type = head - .lines() - .filter_map(|line| line.split_once(':')) - .find(|(name, _)| name.trim().eq_ignore_ascii_case("content-type")) - .map(|(_, value)| value.trim().to_owned()) - .unwrap_or_default(); - seen.lock().unwrap().push(content_type); + let header = |wanted: &str| { + head.lines() + .filter_map(|line| line.split_once(':')) + .find(|(name, _)| name.trim().eq_ignore_ascii_case(wanted)) + .map(|(_, value)| value.trim().to_owned()) + .unwrap_or_default() + }; + seen.lock().unwrap().push(header("content-type")); + wire.lock().unwrap().push(format!( + "{} accept={} user-agent={}", + head.lines().next().unwrap_or_default(), + header("accept"), + header("user-agent") + )); if matches!(mode, TsaMode::Silent) { std::thread::sleep(Duration::from_secs(10)); return; @@ -1034,6 +1047,11 @@ fn a_b_t_seal_verifies_over_its_byte_ranges_and_carries_its_timestamp() { tsa.content_types.lock().unwrap().as_slice(), ["application/timestamp-query"] ); + assert_eq!( + tsa.wire.lock().unwrap().as_slice(), + ["POST /tsr HTTP/1.1 accept=application/timestamp-reply user-agent=registry-render"], + "the exact RFC 3161 request" + ); // The first revision is byte-stable on the seal route. let again = seal_json(&fixture, &server); diff --git a/docs/site/src/content/docs/reference/render-configuration.mdx b/docs/site/src/content/docs/reference/render-configuration.mdx index f1b7588b6c..5fe7361e33 100644 --- a/docs/site/src/content/docs/reference/render-configuration.mdx +++ b/docs/site/src/content/docs/reference/render-configuration.mdx @@ -94,6 +94,13 @@ rules are not in the tables. `withoutTimestamp: seal-stops-validating-when-certificate-expires` (B-B). - `timestampAuthority.url` is `https`; `http` is accepted only for `localhost`, `127.0.0.0/8`, and `[::1]`. `attemptTimeoutMilliseconds` is 1000 to 60000 and defaults to 10000. +- Render resolves only the authority's host. It refuses an answer that is loopback for a host name, + link-local, multicast, unspecified, or a cloud metadata address, and accepts a private address. + The name `localhost` and a loopback address literal stay accepted. A refused address literal + stops `check` and `serve` with `render.runtime.timestamp-address-refused`, and a refused answer + for a host name fails each seal with reason `destination-refused`. +- `caBundleRef` needs an `https` URL; on `http` it is refused with + `render.runtime.seal-timestamp-ca-bundle-requires-https`. - `timestampAuthority.caBundleRef` is a secret reference to a PEM CA bundle that verifies the authority's TLS certificate in place of the platform's trusted roots. Omitted, the platform's trusted roots verify it. @@ -288,6 +295,7 @@ A `timestamp-failed` response entry adds `reason`, the failing check, and the lo | `reason` | Piece | |---|---| | `connection-failed`, `timed-out` | The authority could not be reached within the attempt timeout. | +| `destination-refused` | The authority's host name resolved to an address Render does not dial. Retrying does not help. | | `response-headers` | The reply exceeds the header limits or declares development to a production caller. | | `http-status`, `not-granted` | The authority answered with an HTTP error, or a status that grants no token. | | `not-a-timestamp-reply`, `malformed-response`, `missing-token`, `not-tst-info`, `malformed-tst-info` | The answer is not a DER timestamp reply carrying a token. | diff --git a/docs/site/src/content/docs/security/render.mdx b/docs/site/src/content/docs/security/render.mdx index c12bdc61b1..3caa227f76 100644 --- a/docs/site/src/content/docs/security/render.mdx +++ b/docs/site/src/content/docs/security/render.mdx @@ -126,7 +126,9 @@ creation, is what would close it. Render reaches the authority over TLS with the host's root certificates, or with only the CA bundle `timestampAuthority.caBundleRef` names, and accepts a token that matches the signature, nonce and -key usage; it does not pin the authority's certificate or decide whether it is trusted. +key usage; it does not pin the authority's certificate or decide whether it is trusted. It resolves +only the authority's host and never dials a cloud metadata, link-local, multicast or unspecified +address, nor a loopback answer for a host name. Validators decide trust in the seal certificate and the timestamp authority. {/* Evidence: crates/registry-render/src/runtime.rs ca_bundle_ref; diff --git a/products/render/CHANGELOG.md b/products/render/CHANGELOG.md index e5c5a91365..2199d713e8 100644 --- a/products/render/CHANGELOG.md +++ b/products/render/CHANGELOG.md @@ -2,6 +2,20 @@ ## Unreleased +- BREAKING: Render reaches a seal's timestamp authority only at the + destination the shared outbound selector chooses for its URL. Render + resolves only the authority's host and refuses an answer that is + loopback for a host name, link-local, multicast, unspecified or a + cloud metadata address. A private address, the name `localhost` and a + loopback address literal stay accepted. An address literal Render + refuses fails `registry-render check` and stops `serve` at startup + with `render.runtime.timestamp-address-refused`. A refused answer for + a host name fails each seal as `timestamp-failed` with reason + `destination-refused`. A `caBundleRef` on an `http` URL is reported as + `render.runtime.seal-timestamp-ca-bundle-requires-https`. Migration: + point `timestampAuthority.url` at a name that does not resolve to + loopback, or use `localhost`, `127.0.0.1` or `[::1]` for a test + authority on the same machine, and use https with `caBundleRef`. - BREAKING: Generated Render clients use `documentType` in `path` arguments for rendering and sealing. Replace `type` when calling those operations. Operation names and concrete HTTP URLs stay the same. diff --git a/release/scripts/build-nightly-linux-arm64.sh b/release/scripts/build-nightly-linux-arm64.sh index d9638ecb2f..98e169586a 100644 --- a/release/scripts/build-nightly-linux-arm64.sh +++ b/release/scripts/build-nightly-linux-arm64.sh @@ -47,10 +47,12 @@ cargo build --release --locked -p registry-bregctl --target "${target}" cargo build --release --locked -p registry-casework --bin casework --target "${target}" cargo build --release --locked -p registry-caseworkctl --target "${target}" cargo build --release --locked -p registry-schedulingctl --bin schedulingctl --target "${target}" -if [[ "$(python3 release/scripts/release_roster.py rstack-in-release "${version}")" == true ]]; then +rstack_in_release="$(python3 release/scripts/release_roster.py rstack-in-release "${version}")" +if [[ "${rstack_in_release}" == true ]]; then cargo build --release --locked -p registry-rstack --bin rstack --target "${target}" fi -if [[ "$(python3 release/scripts/release_roster.py breg-services-in-release "${version}")" == true ]]; then +breg_services_in_release="$(python3 release/scripts/release_roster.py breg-services-in-release "${version}")" +if [[ "${breg_services_in_release}" == true ]]; then cargo build --release --locked -p registry-breg-mcp --bin breg-mcp --target "${target}" cargo build --release --locked -p registry-breg-review --bin breg-review --target "${target}" fi diff --git a/release/scripts/build-release-binaries.sh b/release/scripts/build-release-binaries.sh index 778eed9208..c30e8f5ed9 100755 --- a/release/scripts/build-release-binaries.sh +++ b/release/scripts/build-release-binaries.sh @@ -86,13 +86,15 @@ if [[ "${discoveryctl_in_release}" == true ]]; then include_discoveryctl=1 fi include_rstack=0 -if [[ "$(python3 "${script_dir}/release_roster.py" \ - rstack-in-release "${version}")" == true ]]; then +rstack_in_release="$(python3 "${script_dir}/release_roster.py" \ + rstack-in-release "${version}")" +if [[ "${rstack_in_release}" == true ]]; then include_rstack=1 fi include_language_server=0 -if [[ "$(python3 "${script_dir}/release_roster.py" \ - language-server-in-release "${version}")" == true ]]; then +language_server_in_release="$(python3 "${script_dir}/release_roster.py" \ + language-server-in-release "${version}")" +if [[ "${language_server_in_release}" == true ]]; then include_language_server=1 fi include_breg=0 @@ -162,7 +164,9 @@ if [[ "${coordinator_in_release}" == true ]]; then include_coordinator=1 fi include_coordinator_image=0 -if [[ "$(python3 "${script_dir}/release_roster.py" coordinator-in-release "${version}")" == true ]]; then +coordinator_image_in_release="$(python3 "${script_dir}/release_roster.py" \ + coordinator-in-release "${version}")" +if [[ "${coordinator_image_in_release}" == true ]]; then include_coordinator_image=1 fi include_session=0 @@ -177,7 +181,9 @@ if [[ "${adapter_in_release}" == true ]]; then include_adapter=1 fi include_adapter_image=0 -if [[ "$(python3 "${script_dir}/release_roster.py" adapter-image-in-release "${version}")" == true ]]; then +adapter_image_in_release="$(python3 "${script_dir}/release_roster.py" \ + adapter-image-in-release "${version}")" +if [[ "${adapter_image_in_release}" == true ]]; then include_adapter_image=1 fi diff --git a/release/scripts/build-release-native-platform.sh b/release/scripts/build-release-native-platform.sh index fac430bf27..ee047a392c 100755 --- a/release/scripts/build-release-native-platform.sh +++ b/release/scripts/build-release-native-platform.sh @@ -134,13 +134,15 @@ if ((version_major > 0 || version_minor >= 36)); then include_schedulingctl=1 fi include_rstack=0 -if [[ "$(python3 "${script_dir}/release_roster.py" \ - rstack-in-release "${version}")" == true ]]; then +rstack_in_release="$(python3 "${script_dir}/release_roster.py" \ + rstack-in-release "${version}")" +if [[ "${rstack_in_release}" == true ]]; then include_rstack=1 fi include_language_server=0 -if [[ "$(python3 "${script_dir}/release_roster.py" \ - language-server-in-release "${version}")" == true ]]; then +language_server_in_release="$(python3 "${script_dir}/release_roster.py" \ + language-server-in-release "${version}")" +if [[ "${language_server_in_release}" == true ]]; then include_language_server=1 fi diff --git a/release/scripts/test_release_roster.py b/release/scripts/test_release_roster.py index f98e3871bd..bdc630107c 100644 --- a/release/scripts/test_release_roster.py +++ b/release/scripts/test_release_roster.py @@ -2,6 +2,7 @@ from __future__ import annotations import io +import re import sys from contextlib import redirect_stderr, redirect_stdout from pathlib import Path @@ -307,5 +308,23 @@ def test_cli_reports_the_version_selected_roster(self) -> None: self.assertEqual(expected, stdout.getvalue()) + def test_shell_scripts_assign_roster_output_before_comparing(self) -> None: + # set -e does not abort on a failing command substitution inside a + # test, so `[[ "$(release_roster.py ...)" == true ]]` reads a roster + # failure as "not in this release". An assignment fails the script. + assignment = re.compile(r'^[A-Za-z_][A-Za-z0-9_]*="\$\(python3 [^ ]*release_roster\.py"? ') + found = 0 + for script in sorted(SCRIPT_DIR.glob("*.sh")): + logical = re.sub(r"\\\n\s*", " ", script.read_text(encoding="utf-8")) + for line in logical.splitlines(): + line = line.strip() + if line.startswith("#") or not re.search(r"\$\(python3 [^ ]*release_roster\.py", line): + continue + found += 1 + with self.subTest(script=script.name, line=line): + self.assertRegex(line, assignment) + self.assertGreater(found, 0) + + if __name__ == "__main__": main() From 9e5d765373fb2b7ce58438373a9399f1b274f337 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:18 +0000 Subject: [PATCH 44/55] test: fix the contracts and diagnostics checks hosted CI found Folds these reviewed commits: - fix(language-server): pass the Derivation finding code without a borrow - test(breg): pin fixture revisions after the limit and failedCheck contracts - test(coordinator-client): track the development failedCheck Problem member - fix(render): name the documentType seal route in the retired seal command - test(evidence): expect Derivation rule codes in sorted order - test(breg): widen the Python fixture at the limit parameter - fix(breg): pass limit from generated project SDK list calls - docs(evidence): show the derivation assets line in the SQLite starter output - docs(evidence): declare production for the closure check over the page's development posture - fix(platform): use the Action Plan spelling in the service preview projects - test(typescript): assign live test people roles declared in service.yaml - style(breg): format the project SDK limit test - test(breg): regenerate the registered examples that carry the registry revision - test(bregctl): expect the cursor continuation on resumed exports - test(language-server): author module Action Plans in the navigation fixture - test(oid4vp): look up served routes by their published parameter names - test(client-node): page the facade type check with limit, not top - docs(breg): name limit and cursor as the list paging options Signed-off-by: Jeremi Joslin --- clients/typescript/tests/live/harness.ts | 159 +++++------------- crates/registry-breg/src/project_sdk.rs | 46 +++-- .../registry-breg/tests/compiled_ddl_pins.rs | 14 +- crates/registry-bregctl/src/data_lifecycle.rs | 8 +- crates/registry-coordinator-client/src/lib.rs | 5 +- .../registry-coordinator-client/tests/http.rs | 1 + .../tests/finding_messages.rs | 2 +- .../tests/endpoints.rs | 11 +- .../src/evidence/index.rs | 2 +- .../tests/runtime_product_navigation.rs | 4 +- crates/registry-render/src/cli.rs | 2 +- .../__test__/facade.test-d.ts | 2 +- .../build-and-deploy-evidence-project.mdx | 2 +- .../tutorials/connect-a-sqlite-extract.mdx | 2 +- docs/site/src/data/breg-api.yaml | 8 +- products/breg/CHANGELOG.md | 4 +- .../breg/examples/formats/ctl-report.json | 4 +- .../formats/explain/actions-explanation.json | 2 +- .../authored-display-actions-explanation.json | 2 +- .../authored-display-model-explanation.json | 2 +- .../formats/explain/model-explanation.json | 2 +- .../breg/examples/formats/odrl-coverage.json | 2 +- .../examples/formats/odrl-policies.jsonld | 2 +- .../breg/examples/formats/source-export.json | 2 +- .../facility/generated/sdk/project.py | 16 +- .../facility/generated/sdk/project.ts | 6 +- .../minimal/generated/sdk/project.py | 6 +- .../minimal/generated/sdk/project.ts | 6 +- .../scripts/test_check_client_capabilities.py | 6 +- .../project/registry.yaml | 6 +- .../medical-renewal/project/registry.yaml | 10 +- 31 files changed, 158 insertions(+), 188 deletions(-) diff --git a/clients/typescript/tests/live/harness.ts b/clients/typescript/tests/live/harness.ts index 39ff568a45..0386db3d99 100644 --- a/clients/typescript/tests/live/harness.ts +++ b/clients/typescript/tests/live/harness.ts @@ -883,6 +883,30 @@ function stageMainPlan(root: string, dhis2Origin: string): string { '', ].join('\n')) + // People name roles, and the sibling service.yaml declares each role once. + // The run derives scopes and purposes from the selected profiles. + const serviceRoles = { + apiVersion: 'id.registrystack.org/formats/rstack/service/v1alpha1', + kind: 'RStackService', + roles: { + 'directory-editor': { actorKind: 'human', claims: ['jurisdiction'], accessProfiles: { breg: ['directory-editor'] } }, + 'casework-administrator': { actorKind: 'human', accessProfiles: { casework: ['administrator'] } }, + 'casework-staff': { actorKind: 'human', accessProfiles: { casework: ['staff'] } }, + 'casework-requester': { actorKind: 'service', accessProfiles: { casework: ['requester'] } }, + 'coordinator-starter': { actorKind: 'service', accessProfiles: { coordinator: ['starter-reader'] } }, + 'documents-custodian': { actorKind: 'service', accessProfiles: { documents: ['custodian-app'] } }, + 'documents-citizen': { actorKind: 'human', accessProfiles: { documents: ['citizen'] } }, + 'documents-staff': { actorKind: 'human', accessProfiles: { documents: ['staff'] } }, + 'documents-reader': { actorKind: 'human', accessProfiles: { documents: ['reader'] } }, + 'messaging-case-notices': { actorKind: 'service', accessProfiles: { messaging: ['case-notices'] } }, + 'messaging-operations': { actorKind: 'human', accessProfiles: { messaging: ['operations'] } }, + 'scheduling-reader': { actorKind: 'service', accessProfiles: { scheduling: ['reads'] } }, + 'render-caller': { actorKind: 'service', accessProfiles: { render: ['render'] } }, + 'adapter-records-reader': { actorKind: 'service', accessProfiles: { adapter: ['records-reader'] } }, + 'adapter-records-writer': { actorKind: 'service', accessProfiles: { adapter: ['records-writer'] } }, + }, + } + const devPlan = { apiVersion: 'id.registrystack.org/formats/rstack/dev/v1alpha1', kind: 'RStackDev', @@ -902,180 +926,86 @@ function stageMainPlan(root: string, dhis2Origin: string): string { editor: { subject: 'synthetic-directory-editor', client: 'directory-editor', - grants: { - breg: { - profile: 'directory-editor', - scopes: ['registry:directory:write'], - claims: { - registry_actor_kind: 'human', - registry_purpose: 'directory-administration', - jurisdiction: 'zone-a', - }, - }, - }, + roles: ['directory-editor'], + claims: { breg: { jurisdiction: 'zone-a' } }, + purposes: { breg: 'directory-administration' }, }, 'foreign-editor': { subject: 'synthetic-foreign-editor', client: 'directory-editor', - grants: { - breg: { - profile: 'directory-editor', - scopes: ['registry:directory:write'], - claims: { - registry_actor_kind: 'human', - registry_purpose: 'directory-administration', - jurisdiction: 'zone-b', - }, - }, - }, + roles: ['directory-editor'], + claims: { breg: { jurisdiction: 'zone-b' } }, + purposes: { breg: 'directory-administration' }, }, administrator: { subject: 'administrator', client: 'standalone-workbench', - grants: { - casework: { - profile: 'administrator', - scopes: ['casework:admin'], - claims: { registry_actor_kind: 'human' }, - }, - }, + roles: ['casework-administrator'], }, staff: { subject: 'staff', client: 'standalone-workbench', - grants: { - casework: { - profile: 'staff', - scopes: ['casework:staff'], - claims: { registry_actor_kind: 'human' }, - }, - }, + roles: ['casework-staff'], }, requester: { subject: 'requester', client: 'standalone-requester', - grants: { - casework: { - profile: 'requester', - scopes: ['casework:request'], - }, - }, + roles: ['casework-requester'], }, 'coordinator-caller': { subject: 'starter-reader', client: 'starter-reader', - grants: { - coordinator: { - profile: 'starter-reader', - scopes: ['coordinator:start'], - }, - }, + roles: ['coordinator-starter'], }, custodian: { subject: 'starter-reader', client: 'civil-registry-app', - grants: { - documents: { - profile: 'custodian-app', - scopes: ['documents:custody'], - claims: { registry_actor_kind: 'service' }, - }, - }, + roles: ['documents-custodian'], }, 'doc-citizen': { subject: 'starter-citizen', client: 'citizen-portal', - grants: { - documents: { - profile: 'citizen', - scopes: ['documents:own'], - claims: { registry_actor_kind: 'human' }, - }, - }, + roles: ['documents-citizen'], }, 'doc-staff': { subject: 'starter-staff', client: 'case-portal', - grants: { - documents: { - profile: 'staff', - scopes: ['documents:staff'], - claims: { registry_actor_kind: 'human' }, - }, - }, + roles: ['documents-staff'], }, 'doc-partner': { subject: 'starter-partner', client: 'partner-portal', - grants: { - documents: { - profile: 'reader', - scopes: ['documents:read'], - claims: { registry_actor_kind: 'human' }, - }, - }, + roles: ['documents-reader'], }, 'case-system': { subject: 'case-system', client: 'case-system', - grants: { - messaging: { - profile: 'case-notices', - scopes: ['messaging:send'], - claims: { registry_actor_kind: 'service' }, - }, - }, + roles: ['messaging-case-notices'], }, 'messaging-operator': { subject: 'operator', client: 'operations-console', - grants: { - messaging: { - profile: 'operations', - scopes: ['messaging:operate'], - }, - }, + roles: ['messaging-operations'], }, 'scheduling-reader': { subject: 'starter-reader', client: 'starter-client', - grants: { - scheduling: { - profile: 'reader', - scopes: ['scheduling:read'], - claims: { registry_actor_kind: 'service' }, - }, - }, + roles: ['scheduling-reader'], }, 'render-caller': { subject: 'starter-reader', client: 'render-client', - grants: { - render: { - profile: 'reader', - scopes: ['render:render'], - }, - }, + roles: ['render-caller'], }, 'adapter-reader': { subject: 'adapter-reader', client: 'adapter-reader-client', - grants: { - adapter: { - profile: 'records-reader', - scopes: ['records.read'], - }, - }, + roles: ['adapter-records-reader'], }, 'adapter-writer': { subject: 'adapter-writer', client: 'adapter-writer-client', - grants: { - adapter: { - profile: 'records-writer', - scopes: ['records.write'], - }, - }, + roles: ['adapter-records-writer'], }, }, schemaTestPeople: { @@ -1094,6 +1024,7 @@ function stageMainPlan(root: string, dhis2Origin: string): string { } writeFileSync(join(planDir, 'dev.yaml'), JSON.stringify(devPlan, null, 2) + '\n') + writeFileSync(join(planDir, 'service.yaml'), JSON.stringify(serviceRoles, null, 2) + '\n') writeFileSync(join(planDir, 'dev-journeys.yaml'), JSON.stringify({ apiVersion: 'id.registrystack.org/formats/rstack/journeys/v1alpha1', kind: 'RStackJourneys', diff --git a/crates/registry-breg/src/project_sdk.rs b/crates/registry-breg/src/project_sdk.rs index 1811b3236d..7c20352d5a 100644 --- a/crates/registry-breg/src/project_sdk.rs +++ b/crates/registry-breg/src/project_sdk.rs @@ -231,11 +231,11 @@ pub(super) fn generate( crate::model::RelationshipCardinality::OptionalOne => format!("{value} | None"), crate::model::RelationshipCardinality::Many => format!("Page[{value}]"), }; - related_signatures.push(format!("def related(self, record_type: Literal[{}], identifier: str, relationship: Literal[{}], top: int = 50) -> {shape}:", quote(&entity.id), quote(&relationship.name))); + related_signatures.push(format!("def related(self, record_type: Literal[{}], identifier: str, relationship: Literal[{}], limit: int = 50) -> {shape}:", quote(&entity.id), quote(&relationship.name))); } for path in entity.read_paths.values() { let target = &entities[&path.to]; - related_signatures.push(format!("def related(self, record_type: Literal[{}], identifier: str, relationship: Literal[{}], top: int = 50) -> Page[RecordView[{}Projection]]:", quote(&entity.id), quote(&path.id), target.api_name)); + related_signatures.push(format!("def related(self, record_type: Literal[{}], identifier: str, relationship: Literal[{}], limit: int = 50) -> Page[RecordView[{}Projection]]:", quote(&entity.id), quote(&path.id), target.api_name)); } } let mut client = PYTHON_CLIENT.to_owned(); @@ -254,7 +254,7 @@ pub(super) fn generate( let mut related_overloads = String::new(); if let [signature] = related_signatures.as_slice() { client = client.replace( - "def related(self, record_type: str, identifier: str, relationship: str, top: int = 50) -> Any:", + "def related(self, record_type: str, identifier: str, relationship: str, limit: int = 50) -> Any:", signature, ); } else { @@ -530,7 +530,7 @@ export class ProjectClient { const result = await this.native.getRecord(definitions.records[recordType].route, id, {accessProfile: this.profile}); return this.view(recordType, result.value.data); } - async related(recordType: K, id: string, relationship: R, top = 50): Promise { + async related(recordType: K, id: string, relationship: R, limit = 50): Promise { const relation = definitions.relationships[recordType]?.[String(relationship)]; if (!relation) throw new TypeError('Relationship is not in the compiled project contract'); const source = await this.read(recordType as keyof ProjectRecords, id); @@ -550,8 +550,8 @@ export class ProjectClient { next: result.continuation ? async () => page(await resume(result.continuation!), resume) : undefined, }); const result = relation.kind === 'join' - ? page(await this.native.listRelationshipRecords(definitions.records[recordType].route, id, relation.path!, {accessProfile: this.profile, top}), continuation => this.native.continueRelationshipList(continuation)) - : page(await this.native.listRecords(definitions.records[relation.target].route, {accessProfile: this.profile, top, filter: `${relation.field} eq '${id}'`}), continuation => this.native.continueList(continuation)); + ? page(await this.native.listRelationshipRecords(definitions.records[recordType].route, id, relation.path!, {accessProfile: this.profile, limit}), continuation => this.native.continueRelationshipList(continuation)) + : page(await this.native.listRecords(definitions.records[relation.target].route, {accessProfile: this.profile, limit, filter: `${relation.field} eq '${id}'`}), continuation => this.native.continueList(continuation)); if (relation.cardinality === 'one') { if (result.items.length !== 1 || result.next) throw new TypeError('Required relationship did not resolve exactly one readable record'); return result.items[0] as ProjectRelationships[K][R]; @@ -665,7 +665,7 @@ class ProjectClient: result = self._native.get_record(_definitions['records'][record_type]['route'], identifier, access_profile=self._profile) return self._view(record_type, result['value']['data']) # RELATED_OVERLOADS - def related(self, record_type: str, identifier: str, relationship: str, top: int = 50) -> Any: + def related(self, record_type: str, identifier: str, relationship: str, limit: int = 50) -> Any: relation = _definitions['relationships'][record_type][relationship] source = self._read(record_type, identifier) if relation['kind'] == 'forward': @@ -677,9 +677,9 @@ class ProjectClient: if str(UUID(identifier)) != identifier: raise ValueError('Record identifier is invalid') if relation['kind'] == 'join': - result = self._native.list_relationship_records(_definitions['records'][record_type]['route'], identifier, relation['path'], access_profile=self._profile, top=top) + result = self._native.list_relationship_records(_definitions['records'][record_type]['route'], identifier, relation['path'], access_profile=self._profile, limit=limit) else: - result = self._native.list_records(_definitions['records'][relation['target']]['route'], access_profile=self._profile, top=top, filter=f"{relation['field']} eq '{identifier}'") + result = self._native.list_records(_definitions['records'][relation['target']]['route'], access_profile=self._profile, limit=limit, filter=f"{relation['field']} eq '{identifier}'") def page(result: Any) -> Page[RecordView[Any]]: value: Page[RecordView[Any]] = {'items': [cast(RecordView[Any], self._view(relation['target'], item)) for item in result['value']['items']]} continuation = result.get('continuation') @@ -814,11 +814,11 @@ mod tests { #[test] fn python_related_overloads_are_only_emitted_for_multiple_relationship_variants() { let python = python_sdk(&minimal_entities(false)); - assert!(python.contains("def related(self, record_type: str, identifier: str, relationship: str, top: int = 50) -> Any:\n")); + assert!(python.contains("def related(self, record_type: str, identifier: str, relationship: str, limit: int = 50) -> Any:\n")); assert!(!python.contains(" @overload\n def related(")); let mut entities = minimal_entities(true); - let parent = "def related(self, record_type: Literal[\"contact\"], identifier: str, relationship: Literal[\"parent\"], top: int = 50) -> RecordView[ContactProjection] | None:"; + let parent = "def related(self, record_type: Literal[\"contact\"], identifier: str, relationship: Literal[\"parent\"], limit: int = 50) -> RecordView[ContactProjection] | None:"; let python = python_sdk(&entities); assert!(python.contains(&format!("{parent}\n relation = _definitions"))); assert!(!python.contains("overload")); @@ -838,7 +838,7 @@ mod tests { assert!(python.contains(", overload, cast\n")); assert_eq!(python.matches(" @overload\n def related(").count(), 2); assert!(python.contains(&format!(" @overload\n {parent} pass\n"))); - let contacts = "def related(self, record_type: Literal[\"contact\"], identifier: str, relationship: Literal[\"contacts\"], top: int = 50) -> Page[RecordView[ContactProjection]]:"; + let contacts = "def related(self, record_type: Literal[\"contact\"], identifier: str, relationship: Literal[\"contacts\"], limit: int = 50) -> Page[RecordView[ContactProjection]]:"; assert!(python.contains(&format!(" @overload\n {contacts} pass\n"))); entities.get_mut("contact").unwrap().relationships.clear(); @@ -865,6 +865,28 @@ mod tests { } } + #[test] + fn related_list_calls_send_limit_to_the_native_client() { + let python = python_sdk(&minimal_entities(false)); + for call in [ + "access_profile=self._profile, limit=limit)", + "access_profile=self._profile, limit=limit, filter=", + ] { + assert!(python.contains(call), "missing {call}"); + } + assert!(!python.contains("top="), "Python still sends top"); + for call in [ + "{accessProfile: this.profile, limit})", + "{accessProfile: this.profile, limit, filter: ", + ] { + assert!(TYPESCRIPT_CLIENT.contains(call), "missing {call}"); + } + assert!( + !TYPESCRIPT_CLIENT.contains("top"), + "TypeScript still sends top" + ); + } + #[test] fn recovery_vocabulary_names_rebase_and_omits_terminal() { for contract in [ diff --git a/crates/registry-breg/tests/compiled_ddl_pins.rs b/crates/registry-breg/tests/compiled_ddl_pins.rs index c9ae286944..374bd2e89d 100644 --- a/crates/registry-breg/tests/compiled_ddl_pins.rs +++ b/crates/registry-breg/tests/compiled_ddl_pins.rs @@ -98,6 +98,12 @@ //! Selection by fit, `profile.not-authorized`, and `access-profile.ambiguous` //! in the generated OpenAPI document likewise move artifact revisions only. //! SQL and Action pins stay fixed. +//! The `limit` and `cursor` list query parameters, and the development-only +//! `failedCheck` Problem member, likewise change only the generated OpenAPI +//! document and artifact revisions. SQL and Action pins stay fixed. +//! The generated project SDK passes `limit` to the native list calls, which +//! changes the packaged SDK and artifact revisions. SQL and Action pins stay +//! fixed. use registry_breg::compiler::{compile_project, CompileProfile}; use registry_breg::contract::{parse_module_yaml, parse_project_yaml}; @@ -120,7 +126,7 @@ const FIXTURES: &[Fixture] = &[ ), module: None, ddl_sha256: "6d6431e3e4fb3eb254ef8f3b2e895aed2c09ed4ee7ca506627e1d063359f4578", - revision: "sha256:bae0a8d7f49ab9959743b39c1dacee918540abde36cfbabf065657d2cf13c1e4", + revision: "sha256:6ce101a4824207e4feaaca9c790de8580c07d280ca913937e6a643eb1ee48860", }, Fixture { name: "asset-registration-actions", @@ -131,7 +137,7 @@ const FIXTURES: &[Fixture] = &[ "../../../products/breg/fixtures/asset-registration-actions/modules/asset-registration-actions-core/module.yaml" )), ddl_sha256: "43acdae956eb2f932fb22a2cccc5cee5ed19cf806f2f28bbc677eff219d00b99", - revision: "sha256:991cd3ce2af7111942b7b023d1ffd98b0ec14bf6d6c82c82f1f5549620169e95", + revision: "sha256:6d9e4da6a98799e51faf07bf39ac5bd741d0bdb7086d9f0281ffed4ef36d6706", }, Fixture { name: "facility-registry-actions", @@ -142,7 +148,7 @@ const FIXTURES: &[Fixture] = &[ "../../../products/breg/fixtures/facility-registry-actions/modules/facility-registry-actions-core/module.yaml" )), ddl_sha256: "6439a877ee6508b999a77242542695d8ccddc6d80518699d90eddc32b305780b", - revision: "sha256:a32c551ddb61f7d47e79772919c0691b49c38b7015a6c3920f1ca946540bf9e5", + revision: "sha256:a0f2d6ba534425b7f1ce68af3e76ed44ee2938232c6c6db1e07818e818eda863", }, Fixture { name: "household-contact-actions", @@ -153,7 +159,7 @@ const FIXTURES: &[Fixture] = &[ "../../../products/breg/fixtures/household-contact-actions/modules/household-contact-actions-core/module.yaml" )), ddl_sha256: "f82f2f8376df97fb184c04d31c8e42c291f7a03dbd909828e1bf61612106de35", - revision: "sha256:d7a4350437701f38952f9bccac4bc2fb4cba8bc9afca0144afe0652b97d54958", + revision: "sha256:7513e3f517649641bfda36027e5ff437c5a6139ec5ec7224913dcd1c34a5e43a", }, ]; diff --git a/crates/registry-bregctl/src/data_lifecycle.rs b/crates/registry-bregctl/src/data_lifecycle.rs index 1183ee1ef6..22d49d9419 100644 --- a/crates/registry-bregctl/src/data_lifecycle.rs +++ b/crates/registry-bregctl/src/data_lifecycle.rs @@ -3982,9 +3982,7 @@ mod tests { &resumed.output_state, &resumed.resume_state, |request| async move { - assert!(request - .path_and_query() - .contains("$skiptoken=SERVER-CURSOR")); + assert!(request.path_and_query().contains("cursor=SERVER-CURSOR")); Ok::<_, ()>(export_response("BB", None)) }, )) @@ -4177,9 +4175,7 @@ mod tests { &recovered.output_state, &recovered.resume_state, |request| async move { - assert!(request - .path_and_query() - .contains("$skiptoken=SERVER-CURSOR")); + assert!(request.path_and_query().contains("cursor=SERVER-CURSOR")); Ok::<_, ()>(export_response("BB", None)) }, )) diff --git a/crates/registry-coordinator-client/src/lib.rs b/crates/registry-coordinator-client/src/lib.rs index d1fcf24db8..b58e90f4ca 100644 --- a/crates/registry-coordinator-client/src/lib.rs +++ b/crates/registry-coordinator-client/src/lib.rs @@ -18,12 +18,13 @@ //! //! Every Coordinator refusal is an RFC 9457 `application/problem+json` //! document with required `type`, `title`, `status`, `detail`, `code` and -//! `traceId` members and an optional `pointer`. The client accepts one as +//! `traceId` members, an optional `pointer`, and in development an optional +//! `failedCheck`. The client accepts one as //! `CoordinatorClientError::Problem` only //! when its status equals the answer's, its `traceId` equals the answer's //! `traceparent` trace, and its `type` is its `family.reason` code under //! `https://id.registrystack.org/problems/registry-coordinator/`; anything else -//! is a protocol failure. The client discards the title, detail and pointer. Redirects +//! is a protocol failure. The client discards the title, detail, pointer and failed check. Redirects //! and ambient proxies are disabled by the shared transport, and //! JSON/header/body bounds are enforced on every response. diff --git a/crates/registry-coordinator-client/tests/http.rs b/crates/registry-coordinator-client/tests/http.rs index 717ed310c9..101a2b584d 100644 --- a/crates/registry-coordinator-client/tests/http.rs +++ b/crates/registry-coordinator-client/tests/http.rs @@ -1921,6 +1921,7 @@ fn dto_contract_tracks_the_runtime_generated_schema() { }; let mut event_problem = problem_document(400, "event.invalid"); event_problem["pointer"] = json!("/subject"); + event_problem["failedCheck"] = json!("sensitive-canary check"); for (schema, value) in [ (&schemas["RunStatus"], status()), (&schemas["RunInspection"], inspection()), diff --git a/crates/registry-evidence-authoring/tests/finding_messages.rs b/crates/registry-evidence-authoring/tests/finding_messages.rs index d9357770af..2d186bd23a 100644 --- a/crates/registry-evidence-authoring/tests/finding_messages.rs +++ b/crates/registry-evidence-authoring/tests/finding_messages.rs @@ -193,9 +193,9 @@ fn normalized_rule_codes_remain_machine_addressable() { [ "definition-count", "definition-question", - "derive-selector-profile", "derivation-interface", "derivation-source", + "derive-selector-profile", "output-bounds", "output-concept", "output-type", diff --git a/crates/registry-evidence-oid4vp/tests/endpoints.rs b/crates/registry-evidence-oid4vp/tests/endpoints.rs index a8dc83a2da..c6e3ea7ad8 100644 --- a/crates/registry-evidence-oid4vp/tests/endpoints.rs +++ b/crates/registry-evidence-oid4vp/tests/endpoints.rs @@ -871,8 +871,17 @@ async fn every_published_route_is_served_and_every_served_route_is_published() { let harness = Harness::new(&Options::default()).await; let (server, _) = harness.server().await; let document = openapi_document(); + assert_eq!( + document["paths"].as_object().unwrap().len(), + ROUTES.len(), + "every published path is a served route" + ); for path in ROUTES { - let method = document["paths"][path] + // The contract publishes descriptive parameter names for the same routes. + let published = path + .replace("{reference}", "{sessionReference}") + .replace("{request_id}", "{requestId}"); + let method = document["paths"][published.as_str()] .as_object() .unwrap() .keys() diff --git a/crates/registry-language-server/src/evidence/index.rs b/crates/registry-language-server/src/evidence/index.rs index c98c9383a7..505e09e78e 100644 --- a/crates/registry-language-server/src/evidence/index.rs +++ b/crates/registry-language-server/src/evidence/index.rs @@ -316,7 +316,7 @@ pub(crate) fn build_index( path: root.join(&asset.value), range: DOCUMENT_START, severity: DiagnosticSeverity::ERROR, - code: Some(finding_code("derivation", &finding.code)), + code: Some(finding_code("derivation", finding.code)), message: bounded_message(&finding.message), }); } diff --git a/crates/registry-language-server/tests/runtime_product_navigation.rs b/crates/registry-language-server/tests/runtime_product_navigation.rs index 2a6a56be81..157eadd81f 100644 --- a/crates/registry-language-server/tests/runtime_product_navigation.rs +++ b/crates/registry-language-server/tests/runtime_product_navigation.rs @@ -373,8 +373,8 @@ async fn disappearing_module_keeps_unsaved_buffer_until_file_returns() { fn module_assets_named_constraints_and_action_results_keep_their_own_scope() { let project=Project::new(&[ file("registry.yaml","apiVersion: id.registrystack.org/formats/breg/project/v1alpha1\nkind: BRegProject\nproject: {id: example}\nmodules: {core: {}, extra: {}}\naccessProfiles: {staff: {permissions: {actions: [{action: register, results: [<|result|>created-record]}]}}}\n"), - file("modules/core/module.yaml","apiVersion: id.registrystack.org/formats/breg/module/v1alpha1\nkind: BRegModule\nid: core\nrecordTypes:\n person:\n fields: [{id: <|field|>name, type: string}]\n constraints: [{type: unique, id: named-rule, fields: [<|constraint|>name]}]\nactions:\n register:\n inputs: []\n execution: {mode: immediate}\n plan: {type: fixed, effects: [{id: <|effect|>created-record}]}\nfunctions: {core-plan: {source: <|script|>scripts/action.rhai}}\n"), - file("modules/extra/module.yaml","apiVersion: id.registrystack.org/formats/breg/module/v1alpha1\nkind: BRegModule\nid: extra\nfunctions: {extra-plan: {source: scripts/action.rhai}}\n"), + file("modules/core/module.yaml","apiVersion: id.registrystack.org/formats/breg/module/v1alpha1\nkind: BRegModule\nid: core\nrecordTypes:\n person:\n fields: [{id: <|field|>name, type: string}]\n constraints: [{type: unique, id: named-rule, fields: [<|constraint|>name]}]\nactions:\n register:\n inputs: []\n execution: {mode: immediate}\n plan: {type: fixed, effects: [{id: <|effect|>created-record}]}\nactionPlans: {core-plan: {source: <|script|>scripts/action.rhai}}\n"), + file("modules/extra/module.yaml","apiVersion: id.registrystack.org/formats/breg/module/v1alpha1\nkind: BRegModule\nid: extra\nactionPlans: {extra-plan: {source: scripts/action.rhai}}\n"), file("modules/core/scripts/action.rhai","// core\n"), file("modules/extra/scripts/action.rhai","// extra\n"), ]); diff --git a/crates/registry-render/src/cli.rs b/crates/registry-render/src/cli.rs index 5f6457ad5e..c90f7f4505 100644 --- a/crates/registry-render/src/cli.rs +++ b/crates/registry-render/src/cli.rs @@ -623,7 +623,7 @@ fn run_inner(cli: Cli) -> Result { Command::Seal { bundle } => Err(RenderProblem::new( crate::problem::ProblemKind::InvalidArgument, format!( - "`seal` was the old name for `package`: build a deployment package with `registry-render package --bundle {} --output `. To seal documents with a PAdES signature, declare `signing.seals` in the runtime file and call `POST /v1/seal/{{type}}`.", + "`seal` was the old name for `package`: build a deployment package with `registry-render package --bundle {} --output `. To seal documents with a PAdES signature, declare `signing.seals` in the runtime file and call `POST /v1/seal/{{documentType}}`.", bundle.display() ), )), diff --git a/crates/registry-stack-client-node/__test__/facade.test-d.ts b/crates/registry-stack-client-node/__test__/facade.test-d.ts index 49cda74e0a..b92b34157f 100644 --- a/crates/registry-stack-client-node/__test__/facade.test-d.ts +++ b/crates/registry-stack-client-node/__test__/facade.test-d.ts @@ -38,7 +38,7 @@ new scheduling.SchedulingClient({ baseUrl: 'https://scheduling.example.invalid/' // @ts-expect-error null is not an omission in JavaScript configuration new scheduling.SchedulingClient({ baseUrl: 'https://scheduling.example.invalid/', userAgent: null }) -bregClient.listRecords('people', { top: 25 }) +bregClient.listRecords('people', { limit: 25 }) void bregClient.registryContract('reader').then((metadata) => { const datasets: ReadonlyArray | null = metadata.statisticalDatasets diff --git a/docs/site/src/content/docs/tutorials/build-and-deploy-evidence-project.mdx b/docs/site/src/content/docs/tutorials/build-and-deploy-evidence-project.mdx index 4179d742eb..6c391dde29 100644 --- a/docs/site/src/content/docs/tutorials/build-and-deploy-evidence-project.mdx +++ b/docs/site/src/content/docs/tutorials/build-and-deploy-evidence-project.mdx @@ -157,7 +157,7 @@ Access profiles: 1 Run the production closure check with production declared for this command. The remaining commands run in development. ```sh test-exit="1" -rstack evidence check adult-status --target deploy-target/target.yaml --posture production --require-deployment-closure +REGISTRY_STACK_POSTURE=production rstack evidence check adult-status --target deploy-target/target.yaml --require-deployment-closure ``` ```text test-expect diff --git a/docs/site/src/content/docs/tutorials/connect-a-sqlite-extract.mdx b/docs/site/src/content/docs/tutorials/connect-a-sqlite-extract.mdx index 1bc4d47e44..efa3ef3ad4 100644 --- a/docs/site/src/content/docs/tutorials/connect-a-sqlite-extract.mdx +++ b/docs/site/src/content/docs/tutorials/connect-a-sqlite-extract.mdx @@ -54,7 +54,7 @@ rstack evidence init registry-status \ Created an editable SQLite-extract authoring project in registry-status README: registry-status/README.md (what each file holds, and what comes next) project: registry-status/evidence.yaml - functions: registry-status/functions + derivation assets: registry-status/functions adapter packs: registry-status/adapter-packs target: registry-status/local-target.yaml authority: registry-status/dev-authority.yaml diff --git a/docs/site/src/data/breg-api.yaml b/docs/site/src/data/breg-api.yaml index 33691428b5..1e0858a69c 100644 --- a/docs/site/src/data/breg-api.yaml +++ b/docs/site/src/data/breg-api.yaml @@ -58,9 +58,9 @@ - ['`$select`', 'Collection reads', 'Comma-separated domain fields to return. Envelope members are never selectable.', '128 fields.'] - ['`$filter`', 'Collection reads', 'Predicate over `filterableFields`: `eq`, `ne`, `lt`, `le`, `gt`, `ge`, `in`, `startswith()`, `contains()`, combined with `and`, `or`, `not`.', '32 predicates, depth 16, 128 nodes, 100 `in` values, 1024-byte literals.'] - ['`$orderby`', 'Collection reads', 'One field from `sortableFields`, ascending. A `desc` direction is refused with `query.invalid`.', 'One field.'] - - ['`$top`', 'Collection reads', 'Page size.', '100.'] + - ['`limit`', 'Collection reads', 'Page size.', '100.'] - ['`$count`', 'Collection reads', 'Adds the matching count. Refused unless the grant sets `allowCount`.', 'Grant flag.'] - - ['`$skiptoken`', 'Collection reads', 'Continuation from `pageInfo.nextCursor`. It carries the original query, so repeating `snapshot` or `validAt` beside it is refused.', 'Expires after `cursor.maximumAgeSeconds`.'] + - ['`cursor`', 'Collection reads', 'Continuation from `pageInfo.nextCursor`. It carries the original query, so repeating `snapshot` or `validAt` beside it is refused.', 'Expires after `cursor.maximumAgeSeconds`.'] - ['`bbox`', '`list` on Record types with a `crs84-point` or `crs84-polygon` field', '`west,south,east,north` in CRS84 degrees, permitted by `spatialQueries.bbox` on the grant. Edges are inclusive; Polygon and MultiPolygon values match by actual intersection, not envelope overlap alone.', '256 bytes, plus the span limits on the grant.'] - ['`asOf`', '`:as-of`', 'The valid-time instant to evaluate, in the type of the Record type''s valid-time fields.', 'One value.'] - ['`snapshot`', '`:snapshot`', 'A `snapshot` value from a Batch response or an earlier `:snapshot` read.', '4096 bytes.'] @@ -78,7 +78,7 @@ - ['`lookup.unresolved`', '404', 'A lookup matched zero records or more than one.'] - ['`request.invalid`', '400', 'The body, headers, or path did not match the compiled contract. `fieldPath` names the body member or header at fault when one is, and never a field name the grant does not admit. A lookup against a selector whose values come from a verified claim answers `fieldPath` `/values` when the body sends `values`.'] - ['`query.invalid`', '400', 'A query option was malformed, over a bound, or not permitted by the grant. `fieldPath` names the query parameter, such as `$select`, when one is at fault.'] - - ['`query.cursor-invalid`', '400', 'A `$skiptoken` that is malformed, was issued for a different query, or has expired.'] + - ['`query.cursor-invalid`', '400', 'A `cursor` that is malformed, was issued for a different query, or has expired.'] - ['`request.access-reason-required`', '400', 'The selected access profile sets `requireAccessReason`, and the request carried no `Registry-Access-Reason` header, more than one, or one that is not unpadded base64url of a non-blank UTF-8 text of at most 512 bytes without control characters.'] - ['`query.filter-required`', '400', 'A `list` under a grant with `requiredFilters` did not pin one of the listed field sets with top-level `eq` filters. `requiredFilters` carries the acceptable sets as API field names, and `detail` is fixed text.'] - ['`action.refused`', '422', 'An Action function intentionally refused the operation. `refusalCode` identifies a declared reason, `detail` contains its static label, and optional `fieldPath` names an input. No effects commit.'] @@ -124,7 +124,7 @@ 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.'] + - ['Collection, `:snapshot`, `$count`, or `cursor` 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`.'] - ['A compiled `GET /v1/records/{route}/{record_id}/{read_path}` route without an admitting read-path grant', '403 `profile.not-authorized`. An unknown route returns 404 `resource.not-found`.'] diff --git a/products/breg/CHANGELOG.md b/products/breg/CHANGELOG.md index 56c8341fc3..496b471e97 100644 --- a/products/breg/CHANGELOG.md +++ b/products/breg/CHANGELOG.md @@ -28,7 +28,9 @@ the returned cursor and access profile. The server still reads earlier query spellings during upgrades. Rust and Node list clients use `limit`, Python takes `limit=`, and clients write `cursor` in persisted continuations. They - still read prior `skiptoken` continuations. + still read prior `skiptoken` continuations. A generated project SDK's + `related()` takes `limit` in place of `top`. Regenerate the SDK and rename + the argument where a caller passes it by name. - BREAKING: v0.51 `bregctl check --package` refuses sealed v0.49 packages whose generated OpenAPI uses `$top`, with `breg.package.generated-artifacts-refused`. diff --git a/products/breg/examples/formats/ctl-report.json b/products/breg/examples/formats/ctl-report.json index dca536846a..8d0449f56a 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:06542eaf3a1889e945ffcf40177281b530dddd9636bebd93d396d920d5468fef", + "revision": "sha256:164298649ea88ba9ce13697b513f4c2dc8028c77b5bbeff20a3daa3508824f9e", "statisticalDatasets": [] }, "kind": "BRegCtlReport", "ok": true, "profile": "authoring", - "revision": "sha256:06542eaf3a1889e945ffcf40177281b530dddd9636bebd93d396d920d5468fef", + "revision": "sha256:164298649ea88ba9ce13697b513f4c2dc8028c77b5bbeff20a3daa3508824f9e", "status": "complete", "version": "0.51.0-dev" } diff --git a/products/breg/examples/formats/explain/actions-explanation.json b/products/breg/examples/formats/explain/actions-explanation.json index a1e699b4db..edbb0ad61b 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:06542eaf3a1889e945ffcf40177281b530dddd9636bebd93d396d920d5468fef", + "revision": "sha256:164298649ea88ba9ce13697b513f4c2dc8028c77b5bbeff20a3daa3508824f9e", "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 0ea8cd4259..597db92247 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:8cf1cb766e3f797a09c318be409416e4c8b87a17681ef0143bfc45cd11146cbd", + "revision": "sha256:c605b88ee0dd6158d870c23ac41a6c3822e13173a840a488986439ca276fef50", "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 19498c4969..d3e93dd588 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:8cf1cb766e3f797a09c318be409416e4c8b87a17681ef0143bfc45cd11146cbd", + "revision": "sha256:c605b88ee0dd6158d870c23ac41a6c3822e13173a840a488986439ca276fef50", "statisticalDatasets": [ { "accessProfiles": { diff --git a/products/breg/examples/formats/explain/model-explanation.json b/products/breg/examples/formats/explain/model-explanation.json index 2963ee0e0f..e9443eadec 100644 --- a/products/breg/examples/formats/explain/model-explanation.json +++ b/products/breg/examples/formats/explain/model-explanation.json @@ -2602,7 +2602,7 @@ "protocol": "id.registrystack.org/protocols/review/v1" } ], - "revision": "sha256:06542eaf3a1889e945ffcf40177281b530dddd9636bebd93d396d920d5468fef", + "revision": "sha256:164298649ea88ba9ce13697b513f4c2dc8028c77b5bbeff20a3daa3508824f9e", "statisticalDatasets": [], "version": "0.1.0" } diff --git a/products/breg/examples/formats/odrl-coverage.json b/products/breg/examples/formats/odrl-coverage.json index 572d10a733..25fdef6253 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:4a4d5cd68f89d7842a50b0b4c981cfad14b6741a4bd1d52e82b5ac430a1b819f","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:a8f3b5081ccbaa0243b7e36131a56fae4ef25f8b2c01ccd8afbcfc7c1386620b","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 de2673adc8..c8d612b39d 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%3A3e6e9c8b87b447c38fd9cb691552ea3b6cbda66603fc02242a0c74a1d4053a5c: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%3A3e6e9c8b87b447c38fd9cb691552ea3b6cbda66603fc02242a0c74a1d4053a5c: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%3A3e6e9c8b87b447c38fd9cb691552ea3b6cbda66603fc02242a0c74a1d4053a5c: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%3A3e6e9c8b87b447c38fd9cb691552ea3b6cbda66603fc02242a0c74a1d4053a5c: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%3A3e6e9c8b87b447c38fd9cb691552ea3b6cbda66603fc02242a0c74a1d4053a5c: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%3A3e6e9c8b87b447c38fd9cb691552ea3b6cbda66603fc02242a0c74a1d4053a5c:odrl:profiles:directory-editor:policy"}}],"@id":"urn:registrystack:breg:labelled-directory:revision:sha256%3A3e6e9c8b87b447c38fd9cb691552ea3b6cbda66603fc02242a0c74a1d4053a5c: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%3Ac605b88ee0dd6158d870c23ac41a6c3822e13173a840a488986439ca276fef50: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%3Ac605b88ee0dd6158d870c23ac41a6c3822e13173a840a488986439ca276fef50: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%3Ac605b88ee0dd6158d870c23ac41a6c3822e13173a840a488986439ca276fef50: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%3Ac605b88ee0dd6158d870c23ac41a6c3822e13173a840a488986439ca276fef50: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%3Ac605b88ee0dd6158d870c23ac41a6c3822e13173a840a488986439ca276fef50: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%3Ac605b88ee0dd6158d870c23ac41a6c3822e13173a840a488986439ca276fef50:odrl:profiles:directory-editor:policy"}}],"@id":"urn:registrystack:breg:labelled-directory:revision:sha256%3Ac605b88ee0dd6158d870c23ac41a6c3822e13173a840a488986439ca276fef50: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 9c249f3f3b..5fb1f383e6 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:0826d14b40402918b088d23d14aab1ed1d9e0cc904721b3c34f93bd784025ca9"},"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:240d65cde1c90ca61d9c363be04815b1736290031e815e34186195851e31cb6c"},"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/facility/generated/sdk/project.py b/products/breg/generated/facility/generated/sdk/project.py index 9a56171f44..f57efa2b5e 100644 --- a/products/breg/generated/facility/generated/sdk/project.py +++ b/products/breg/generated/facility/generated/sdk/project.py @@ -197,17 +197,17 @@ def _read(self, record_type: str, identifier: str) -> RecordView[Any]: result = self._native.get_record(_definitions['records'][record_type]['route'], identifier, access_profile=self._profile) return self._view(record_type, result['value']['data']) @overload - def related(self, record_type: Literal["facility"], identifier: str, relationship: Literal["assignments"], top: int = 50) -> Page[RecordView[FacilityAssignmentProjection]]: pass + def related(self, record_type: Literal["facility"], identifier: str, relationship: Literal["assignments"], limit: int = 50) -> Page[RecordView[FacilityAssignmentProjection]]: pass @overload - def related(self, record_type: Literal["facility"], identifier: str, relationship: Literal["operators"], top: int = 50) -> Page[RecordView[OperatorProjection]]: pass + def related(self, record_type: Literal["facility"], identifier: str, relationship: Literal["operators"], limit: int = 50) -> Page[RecordView[OperatorProjection]]: pass @overload - def related(self, record_type: Literal["facility-assignment"], identifier: str, relationship: Literal["facility"], top: int = 50) -> RecordView[FacilityProjection]: pass + def related(self, record_type: Literal["facility-assignment"], identifier: str, relationship: Literal["facility"], limit: int = 50) -> RecordView[FacilityProjection]: pass @overload - def related(self, record_type: Literal["facility-assignment"], identifier: str, relationship: Literal["operator"], top: int = 50) -> RecordView[OperatorProjection]: pass + def related(self, record_type: Literal["facility-assignment"], identifier: str, relationship: Literal["operator"], limit: int = 50) -> RecordView[OperatorProjection]: pass @overload - def related(self, record_type: Literal["operator"], identifier: str, relationship: Literal["facilityAssignments"], top: int = 50) -> Page[RecordView[FacilityAssignmentProjection]]: pass + def related(self, record_type: Literal["operator"], identifier: str, relationship: Literal["facilityAssignments"], limit: int = 50) -> Page[RecordView[FacilityAssignmentProjection]]: pass - def related(self, record_type: str, identifier: str, relationship: str, top: int = 50) -> Any: + def related(self, record_type: str, identifier: str, relationship: str, limit: int = 50) -> Any: relation = _definitions['relationships'][record_type][relationship] source = self._read(record_type, identifier) if relation['kind'] == 'forward': @@ -219,9 +219,9 @@ def related(self, record_type: str, identifier: str, relationship: str, top: int if str(UUID(identifier)) != identifier: raise ValueError('Record identifier is invalid') if relation['kind'] == 'join': - result = self._native.list_relationship_records(_definitions['records'][record_type]['route'], identifier, relation['path'], access_profile=self._profile, top=top) + result = self._native.list_relationship_records(_definitions['records'][record_type]['route'], identifier, relation['path'], access_profile=self._profile, limit=limit) else: - result = self._native.list_records(_definitions['records'][relation['target']]['route'], access_profile=self._profile, top=top, filter=f"{relation['field']} eq '{identifier}'") + result = self._native.list_records(_definitions['records'][relation['target']]['route'], access_profile=self._profile, limit=limit, filter=f"{relation['field']} eq '{identifier}'") def page(result: Any) -> Page[RecordView[Any]]: value: Page[RecordView[Any]] = {'items': [cast(RecordView[Any], self._view(relation['target'], item)) for item in result['value']['items']]} continuation = result.get('continuation') diff --git a/products/breg/generated/facility/generated/sdk/project.ts b/products/breg/generated/facility/generated/sdk/project.ts index 4811c95cee..f2b5814813 100644 --- a/products/breg/generated/facility/generated/sdk/project.ts +++ b/products/breg/generated/facility/generated/sdk/project.ts @@ -125,7 +125,7 @@ export class ProjectClient { const result = await this.native.getRecord(definitions.records[recordType].route, id, {accessProfile: this.profile}); return this.view(recordType, result.value.data); } - async related(recordType: K, id: string, relationship: R, top = 50): Promise { + async related(recordType: K, id: string, relationship: R, limit = 50): Promise { const relation = definitions.relationships[recordType]?.[String(relationship)]; if (!relation) throw new TypeError('Relationship is not in the compiled project contract'); const source = await this.read(recordType as keyof ProjectRecords, id); @@ -145,8 +145,8 @@ export class ProjectClient { next: result.continuation ? async () => page(await resume(result.continuation!), resume) : undefined, }); const result = relation.kind === 'join' - ? page(await this.native.listRelationshipRecords(definitions.records[recordType].route, id, relation.path!, {accessProfile: this.profile, top}), continuation => this.native.continueRelationshipList(continuation)) - : page(await this.native.listRecords(definitions.records[relation.target].route, {accessProfile: this.profile, top, filter: `${relation.field} eq '${id}'`}), continuation => this.native.continueList(continuation)); + ? page(await this.native.listRelationshipRecords(definitions.records[recordType].route, id, relation.path!, {accessProfile: this.profile, limit}), continuation => this.native.continueRelationshipList(continuation)) + : page(await this.native.listRecords(definitions.records[relation.target].route, {accessProfile: this.profile, limit, filter: `${relation.field} eq '${id}'`}), continuation => this.native.continueList(continuation)); if (relation.cardinality === 'one') { if (result.items.length !== 1 || result.next) throw new TypeError('Required relationship did not resolve exactly one readable record'); return result.items[0] as ProjectRelationships[K][R]; diff --git a/products/breg/generated/minimal/generated/sdk/project.py b/products/breg/generated/minimal/generated/sdk/project.py index d4f92d8bba..93d7f20442 100644 --- a/products/breg/generated/minimal/generated/sdk/project.py +++ b/products/breg/generated/minimal/generated/sdk/project.py @@ -112,7 +112,7 @@ def _read(self, record_type: str, identifier: str) -> RecordView[Any]: result = self._native.get_record(_definitions['records'][record_type]['route'], identifier, access_profile=self._profile) return self._view(record_type, result['value']['data']) - def related(self, record_type: str, identifier: str, relationship: str, top: int = 50) -> Any: + def related(self, record_type: str, identifier: str, relationship: str, limit: int = 50) -> Any: relation = _definitions['relationships'][record_type][relationship] source = self._read(record_type, identifier) if relation['kind'] == 'forward': @@ -124,9 +124,9 @@ def related(self, record_type: str, identifier: str, relationship: str, top: int if str(UUID(identifier)) != identifier: raise ValueError('Record identifier is invalid') if relation['kind'] == 'join': - result = self._native.list_relationship_records(_definitions['records'][record_type]['route'], identifier, relation['path'], access_profile=self._profile, top=top) + result = self._native.list_relationship_records(_definitions['records'][record_type]['route'], identifier, relation['path'], access_profile=self._profile, limit=limit) else: - result = self._native.list_records(_definitions['records'][relation['target']]['route'], access_profile=self._profile, top=top, filter=f"{relation['field']} eq '{identifier}'") + result = self._native.list_records(_definitions['records'][relation['target']]['route'], access_profile=self._profile, limit=limit, filter=f"{relation['field']} eq '{identifier}'") def page(result: Any) -> Page[RecordView[Any]]: value: Page[RecordView[Any]] = {'items': [cast(RecordView[Any], self._view(relation['target'], item)) for item in result['value']['items']]} continuation = result.get('continuation') diff --git a/products/breg/generated/minimal/generated/sdk/project.ts b/products/breg/generated/minimal/generated/sdk/project.ts index 9952cf9da4..15d1340665 100644 --- a/products/breg/generated/minimal/generated/sdk/project.ts +++ b/products/breg/generated/minimal/generated/sdk/project.ts @@ -66,7 +66,7 @@ export class ProjectClient { const result = await this.native.getRecord(definitions.records[recordType].route, id, {accessProfile: this.profile}); return this.view(recordType, result.value.data); } - async related(recordType: K, id: string, relationship: R, top = 50): Promise { + async related(recordType: K, id: string, relationship: R, limit = 50): Promise { const relation = definitions.relationships[recordType]?.[String(relationship)]; if (!relation) throw new TypeError('Relationship is not in the compiled project contract'); const source = await this.read(recordType as keyof ProjectRecords, id); @@ -86,8 +86,8 @@ export class ProjectClient { next: result.continuation ? async () => page(await resume(result.continuation!), resume) : undefined, }); const result = relation.kind === 'join' - ? page(await this.native.listRelationshipRecords(definitions.records[recordType].route, id, relation.path!, {accessProfile: this.profile, top}), continuation => this.native.continueRelationshipList(continuation)) - : page(await this.native.listRecords(definitions.records[relation.target].route, {accessProfile: this.profile, top, filter: `${relation.field} eq '${id}'`}), continuation => this.native.continueList(continuation)); + ? page(await this.native.listRelationshipRecords(definitions.records[recordType].route, id, relation.path!, {accessProfile: this.profile, limit}), continuation => this.native.continueRelationshipList(continuation)) + : page(await this.native.listRecords(definitions.records[relation.target].route, {accessProfile: this.profile, limit, filter: `${relation.field} eq '${id}'`}), continuation => this.native.continueList(continuation)); if (relation.cardinality === 'one') { if (result.items.length !== 1 || result.next) throw new TypeError('Required relationship did not resolve exactly one readable record'); return result.items[0] as ProjectRelationships[K][R]; diff --git a/products/breg/scripts/test_check_client_capabilities.py b/products/breg/scripts/test_check_client_capabilities.py index 8cf088e32d..3043e56840 100644 --- a/products/breg/scripts/test_check_client_capabilities.py +++ b/products/breg/scripts/test_check_client_capabilities.py @@ -61,9 +61,11 @@ def test_bbox_is_refused_on_shared_temporal_and_relationship_options(self): "export interface CollectionOptions extends RecordProjectionOptions {\n bbox?: BoundingBox | null", ) widened_python = python.replace( - " path_route: str,\n *,\n top: int | None = None,", - " path_route: str,\n *,\n bbox: tuple[str, str, str, str] | None = None,\n top: int | None = None,", + " path_route: str,\n *,\n limit: int | None = None,", + " path_route: str,\n *,\n bbox: tuple[str, str, str, str] | None = None,\n limit: int | None = None,", ) + self.assertNotEqual(node, widened_node, "the Node fixture edit must apply") + self.assertNotEqual(python, widened_python, "the Python fixture edit must apply") errors = CHECK.check_query_option_bindings( inventory, rust, widened_node, widened_python ) diff --git a/products/platform/examples/service-previews/business-registration/project/registry.yaml b/products/platform/examples/service-previews/business-registration/project/registry.yaml index 59fb5a2145..25fc3c387b 100644 --- a/products/platform/examples/service-previews/business-registration/project/registry.yaml +++ b/products/platform/examples/service-previews/business-registration/project/registry.yaml @@ -40,7 +40,7 @@ recordTypes: - {id: by-registration-number, fields: [registration-number]} - {id: by-legal-name, fields: [legal-name]} -functions: +actionPlans: register-business-plan: runtime: rhai source: plans/register-business.rhai @@ -59,8 +59,8 @@ actions: - {id: legal-name, apiName: legalName, type: string, required: true, minimumLength: 1, maximumLength: 160, classification: internal} - {id: registration-number, apiName: registrationNumber, type: string, required: true, minimumLength: 1, maximumLength: 32, classification: internal} plan: - type: function - function: register-business-plan + type: scripted + actionPlan: register-business-plan inputs: [legal-name, registration-number] writes: - id: business diff --git a/products/platform/examples/service-previews/medical-renewal/project/registry.yaml b/products/platform/examples/service-previews/medical-renewal/project/registry.yaml index a527e427af..c93a98ecaf 100644 --- a/products/platform/examples/service-previews/medical-renewal/project/registry.yaml +++ b/products/platform/examples/service-previews/medical-renewal/project/registry.yaml @@ -53,7 +53,7 @@ recordTypes: - {id: by-jurisdiction, fields: [jurisdiction]} - {id: by-holder, fields: [holder-ref]} -functions: +actionPlans: issue-plan: runtime: rhai source: plans/issue.rhai @@ -84,8 +84,8 @@ actions: - {id: issued-on, apiName: issuedOn, type: date, required: true, classification: internal} - {id: expires-on, apiName: expiresOn, type: date, required: true, classification: internal} plan: - type: function - function: issue-plan + type: scripted + actionPlan: issue-plan inputs: [licence-number, holder-ref, holder-name, profession, jurisdiction, issued-on, expires-on] writes: - id: licence @@ -108,8 +108,8 @@ actions: - {input: licence, field: expires-on, atMostFromInput: new-expires-on, reason: renewal-shortens-validity} - {input: licence, field: renewable-until, atLeastFromInput: new-expires-on, reason: renewal-exceeds-three-years} plan: - type: function - function: renew-plan + type: scripted + actionPlan: renew-plan inputs: [licence, new-expires-on] writes: - id: licence From f734d36efa1e9042d6d7fd7678d76f60d5321da4 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:08:18 +0000 Subject: [PATCH 45/55] chore: integrate the v0.51 lanes and regenerate shared outputs Folds these reviewed commits: - fix(dev): pass the completion destination in the offline Messaging facts test - chore: regenerate the Coordinator client and CLI catalog for the integrated contracts - chore(identifiers): regenerate the catalog for the integrated schemas Signed-off-by: Jeremi Joslin --- clients/typescript/generated/coordinator.ts | 6 +-- crates/registry-cli-docs/catalog.json | 8 ---- crates/registry-rstack-dev/src/dev_facts.rs | 1 + .../identifiers/generated/catalog.v1.json | 40 +++++++++---------- 4 files changed, 24 insertions(+), 31 deletions(-) diff --git a/clients/typescript/generated/coordinator.ts b/clients/typescript/generated/coordinator.ts index 09874f473c..7f70cf6e54 100644 --- a/clients/typescript/generated/coordinator.ts +++ b/clients/typescript/generated/coordinator.ts @@ -1,5 +1,5 @@ // Generated for Stack version 0.50.0, client version 0.50.0. -// Source SHA-256 2e480154f09b6a6df9cba0be8e049690f37e69003b55000c30295540fc7eba28 +// Source SHA-256 406bb41312ff42f8b40b68ddd1cf02b898034f122752eddad4f28430e3a8f308 // Unconstrained JSON /components/schemas/HookEnvelope/properties/data // Unconstrained JSON /components/schemas/RunStatus/properties/output // Unconstrained JSON /components/schemas/Start/properties/input @@ -21,7 +21,7 @@ export type Schema_HeldRuns = (Array) export type Schema_Hold = ({ "restoreHold": (boolean) }) export type Schema_HookEnvelope = ({ "causation": ({ "hop": (number); "parent"?: (string); "root": (string) }); "data": JsonValue; "dataschema": (string); "id": (string); "source": (string); "subject": (({ "recordReference": (string); "recordRevision": (number) }) | ({ "proposalReference": (string); "proposalRevision": (number) })); "time": (string); "type": (string) }) export type Schema_OperationIdentity = ({ "effect": ("read" | "mutation" | "evaluation") & (string); "id": ("breg.read-record/v1" | "messaging.submit-message/v1" | "scheduling.read-service/v1" | "scheduling.read-availability/v1" | "scheduling.create-appointment/v1" | "scheduling.read-appointment/v1" | "scheduling.create-hold/v1" | "scheduling.release-hold/v1" | "scheduling.confirm-hold/v1" | "scheduling.reschedule-appointment/v1" | "scheduling.cancel-appointment/v1" | "breg.invoke-action/v1" | "external.get/v1" | "evaluation.evaluate/v1" | "casework.submit-review-request/v1" | "casework.cancel-review-request/v1" | "scheduling.preview-availability/v1" | "external.command/v1" | "breg.read-in-force/v1" | "breg.read-proposal/v1" | "breg.start-proposal/v1" | "breg.submit-proposal/v1" | "breg.cancel-proposal/v1" | "breg.lookup-record/v1" | "breg.read-record/v2" | "payments.request-collection/v1" | "payments.read-collection/v1" | "payments.record-receipt/v1" | "payments.request-disbursement/v1" | "payments.read-disbursement/v1" | "payments.record-provider-confirmation/v1" | "service.invoke-function/v1") & (string); "keyRequirement": ("none" | "required") & (string); "product": (string); "readReceipt": (boolean); "recovery": ("read-again" | "same-command-and-receipt" | "same-command" | "hold-after-dispatch") & (string); "requiresPreparation": (boolean); "version": (number) }) -export type Schema_Problem = ({ "code": ("admission.held" | "admission.recovery-only" | "audit.response-unavailable" | "authentication.refused" | "binding.conflict" | "binding.live-conflict" | "check.not-waiting" | "definition.refused" | "deployment.activation-changed" | "deployment.refused" | "evaluation.uncertain" | "event.invalid" | "event.too-large" | "event.unauthenticated" | "execution.held" | "idempotency.key-invalid" | "idempotency.key-reused" | "input.invalid" | "mutation.uncertain" | "operation.not-authorized" | "receipt.expired" | "reconcile.raced" | "reconcile.refused" | "reconcile.unsupported" | "request.body-too-large" | "request.invalid" | "request.limit-out-of-range" | "request.method-not-allowed" | "request.not-found" | "request.reason-invalid" | "request.retention-invalid" | "request.unprocessable" | "request.unsupported-media-type" | "restore.hold-required" | "restore.lease-incompatible" | "restore.review-required" | "restore.unresolved" | "retry.refused" | "run.definition-incompatible" | "run.not-visible" | "run.payload-erased" | "runtime.failure" | "service.unavailable" | "workflow.not-served" | "workflow.revision-mismatch") & (string); "detail": (string); "pointer"?: (string); "status": (number); "title": (string); "traceId": (string); "type": ("https://id.registrystack.org/problems/registry-coordinator/admission/held" | "https://id.registrystack.org/problems/registry-coordinator/admission/recovery-only" | "https://id.registrystack.org/problems/registry-coordinator/audit/response-unavailable" | "https://id.registrystack.org/problems/registry-coordinator/authentication/refused" | "https://id.registrystack.org/problems/registry-coordinator/binding/conflict" | "https://id.registrystack.org/problems/registry-coordinator/binding/live-conflict" | "https://id.registrystack.org/problems/registry-coordinator/check/not-waiting" | "https://id.registrystack.org/problems/registry-coordinator/definition/refused" | "https://id.registrystack.org/problems/registry-coordinator/deployment/activation-changed" | "https://id.registrystack.org/problems/registry-coordinator/deployment/refused" | "https://id.registrystack.org/problems/registry-coordinator/evaluation/uncertain" | "https://id.registrystack.org/problems/registry-coordinator/event/invalid" | "https://id.registrystack.org/problems/registry-coordinator/event/too-large" | "https://id.registrystack.org/problems/registry-coordinator/event/unauthenticated" | "https://id.registrystack.org/problems/registry-coordinator/execution/held" | "https://id.registrystack.org/problems/registry-coordinator/idempotency/key-invalid" | "https://id.registrystack.org/problems/registry-coordinator/idempotency/key-reused" | "https://id.registrystack.org/problems/registry-coordinator/input/invalid" | "https://id.registrystack.org/problems/registry-coordinator/mutation/uncertain" | "https://id.registrystack.org/problems/registry-coordinator/operation/not-authorized" | "https://id.registrystack.org/problems/registry-coordinator/receipt/expired" | "https://id.registrystack.org/problems/registry-coordinator/reconcile/raced" | "https://id.registrystack.org/problems/registry-coordinator/reconcile/refused" | "https://id.registrystack.org/problems/registry-coordinator/reconcile/unsupported" | "https://id.registrystack.org/problems/registry-coordinator/request/body-too-large" | "https://id.registrystack.org/problems/registry-coordinator/request/invalid" | "https://id.registrystack.org/problems/registry-coordinator/request/limit-out-of-range" | "https://id.registrystack.org/problems/registry-coordinator/request/method-not-allowed" | "https://id.registrystack.org/problems/registry-coordinator/request/not-found" | "https://id.registrystack.org/problems/registry-coordinator/request/reason-invalid" | "https://id.registrystack.org/problems/registry-coordinator/request/retention-invalid" | "https://id.registrystack.org/problems/registry-coordinator/request/unprocessable" | "https://id.registrystack.org/problems/registry-coordinator/request/unsupported-media-type" | "https://id.registrystack.org/problems/registry-coordinator/restore/hold-required" | "https://id.registrystack.org/problems/registry-coordinator/restore/lease-incompatible" | "https://id.registrystack.org/problems/registry-coordinator/restore/review-required" | "https://id.registrystack.org/problems/registry-coordinator/restore/unresolved" | "https://id.registrystack.org/problems/registry-coordinator/retry/refused" | "https://id.registrystack.org/problems/registry-coordinator/run/definition-incompatible" | "https://id.registrystack.org/problems/registry-coordinator/run/not-visible" | "https://id.registrystack.org/problems/registry-coordinator/run/payload-erased" | "https://id.registrystack.org/problems/registry-coordinator/runtime/failure" | "https://id.registrystack.org/problems/registry-coordinator/service/unavailable" | "https://id.registrystack.org/problems/registry-coordinator/workflow/not-served" | "https://id.registrystack.org/problems/registry-coordinator/workflow/revision-mismatch") & (string) }) +export type Schema_Problem = ({ "code": ("admission.held" | "admission.recovery-only" | "audit.response-unavailable" | "authentication.refused" | "binding.conflict" | "binding.live-conflict" | "check.not-waiting" | "definition.refused" | "deployment.activation-changed" | "deployment.refused" | "evaluation.uncertain" | "event.invalid" | "event.too-large" | "event.unauthenticated" | "execution.held" | "idempotency.key-invalid" | "idempotency.key-reused" | "input.invalid" | "mutation.uncertain" | "operation.not-authorized" | "receipt.expired" | "reconcile.raced" | "reconcile.refused" | "reconcile.unsupported" | "request.body-too-large" | "request.invalid" | "request.limit-out-of-range" | "request.method-not-allowed" | "request.not-found" | "request.reason-invalid" | "request.retention-invalid" | "request.unprocessable" | "request.unsupported-media-type" | "restore.hold-required" | "restore.lease-incompatible" | "restore.review-required" | "restore.unresolved" | "retry.refused" | "run.definition-incompatible" | "run.not-visible" | "run.payload-erased" | "runtime.failure" | "service.unavailable" | "workflow.not-served" | "workflow.revision-mismatch") & (string); "detail": (string); "failedCheck"?: (string); "pointer"?: (string); "status": (number); "title": (string); "traceId": (string); "type": ("https://id.registrystack.org/problems/registry-coordinator/admission/held" | "https://id.registrystack.org/problems/registry-coordinator/admission/recovery-only" | "https://id.registrystack.org/problems/registry-coordinator/audit/response-unavailable" | "https://id.registrystack.org/problems/registry-coordinator/authentication/refused" | "https://id.registrystack.org/problems/registry-coordinator/binding/conflict" | "https://id.registrystack.org/problems/registry-coordinator/binding/live-conflict" | "https://id.registrystack.org/problems/registry-coordinator/check/not-waiting" | "https://id.registrystack.org/problems/registry-coordinator/definition/refused" | "https://id.registrystack.org/problems/registry-coordinator/deployment/activation-changed" | "https://id.registrystack.org/problems/registry-coordinator/deployment/refused" | "https://id.registrystack.org/problems/registry-coordinator/evaluation/uncertain" | "https://id.registrystack.org/problems/registry-coordinator/event/invalid" | "https://id.registrystack.org/problems/registry-coordinator/event/too-large" | "https://id.registrystack.org/problems/registry-coordinator/event/unauthenticated" | "https://id.registrystack.org/problems/registry-coordinator/execution/held" | "https://id.registrystack.org/problems/registry-coordinator/idempotency/key-invalid" | "https://id.registrystack.org/problems/registry-coordinator/idempotency/key-reused" | "https://id.registrystack.org/problems/registry-coordinator/input/invalid" | "https://id.registrystack.org/problems/registry-coordinator/mutation/uncertain" | "https://id.registrystack.org/problems/registry-coordinator/operation/not-authorized" | "https://id.registrystack.org/problems/registry-coordinator/receipt/expired" | "https://id.registrystack.org/problems/registry-coordinator/reconcile/raced" | "https://id.registrystack.org/problems/registry-coordinator/reconcile/refused" | "https://id.registrystack.org/problems/registry-coordinator/reconcile/unsupported" | "https://id.registrystack.org/problems/registry-coordinator/request/body-too-large" | "https://id.registrystack.org/problems/registry-coordinator/request/invalid" | "https://id.registrystack.org/problems/registry-coordinator/request/limit-out-of-range" | "https://id.registrystack.org/problems/registry-coordinator/request/method-not-allowed" | "https://id.registrystack.org/problems/registry-coordinator/request/not-found" | "https://id.registrystack.org/problems/registry-coordinator/request/reason-invalid" | "https://id.registrystack.org/problems/registry-coordinator/request/retention-invalid" | "https://id.registrystack.org/problems/registry-coordinator/request/unprocessable" | "https://id.registrystack.org/problems/registry-coordinator/request/unsupported-media-type" | "https://id.registrystack.org/problems/registry-coordinator/restore/hold-required" | "https://id.registrystack.org/problems/registry-coordinator/restore/lease-incompatible" | "https://id.registrystack.org/problems/registry-coordinator/restore/review-required" | "https://id.registrystack.org/problems/registry-coordinator/restore/unresolved" | "https://id.registrystack.org/problems/registry-coordinator/retry/refused" | "https://id.registrystack.org/problems/registry-coordinator/run/definition-incompatible" | "https://id.registrystack.org/problems/registry-coordinator/run/not-visible" | "https://id.registrystack.org/problems/registry-coordinator/run/payload-erased" | "https://id.registrystack.org/problems/registry-coordinator/runtime/failure" | "https://id.registrystack.org/problems/registry-coordinator/service/unavailable" | "https://id.registrystack.org/problems/registry-coordinator/workflow/not-served" | "https://id.registrystack.org/problems/registry-coordinator/workflow/revision-mismatch") & (string) }) export type Schema_ProposalWaitsByTurn = ({ "nobody": (number); "official": (number); "party": (number); "unobserved": (number) }) export type Schema_Reason = ({ "reason": (string) }) export type Schema_Retention = ({ "before": (string); "limit": (number) }) @@ -74,7 +74,7 @@ const rules: Record = Object.fromEntries([ ["/components/schemas/HookEnvelope/$defs/Causation", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"hop\":{\"maximum\":8,\"minimum\":0,\"type\":\"integer\"},\"parent\":{\"type\":\"string\"},\"root\":{\"type\":\"string\"}},\"required\":[\"root\",\"hop\"],\"type\":\"object\"}")], ["/components/schemas/HookEnvelope/$defs/EventSubject", JSON.parse("{\"anyOf\":[{\"additionalProperties\":false,\"properties\":{\"recordReference\":{\"type\":\"string\"},\"recordRevision\":{\"maximum\":9007199254740991,\"minimum\":1,\"type\":\"integer\"}},\"required\":[\"recordReference\",\"recordRevision\"],\"type\":\"object\"},{\"additionalProperties\":false,\"properties\":{\"proposalReference\":{\"type\":\"string\"},\"proposalRevision\":{\"maximum\":9007199254740991,\"minimum\":1,\"type\":\"integer\"}},\"required\":[\"proposalReference\",\"proposalRevision\"],\"type\":\"object\"}]}")], ["/components/schemas/OperationIdentity", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"effect\":{\"enum\":[\"read\",\"mutation\",\"evaluation\"],\"type\":\"string\"},\"id\":{\"enum\":[\"breg.read-record/v1\",\"messaging.submit-message/v1\",\"scheduling.read-service/v1\",\"scheduling.read-availability/v1\",\"scheduling.create-appointment/v1\",\"scheduling.read-appointment/v1\",\"scheduling.create-hold/v1\",\"scheduling.release-hold/v1\",\"scheduling.confirm-hold/v1\",\"scheduling.reschedule-appointment/v1\",\"scheduling.cancel-appointment/v1\",\"breg.invoke-action/v1\",\"external.get/v1\",\"evaluation.evaluate/v1\",\"casework.submit-review-request/v1\",\"casework.cancel-review-request/v1\",\"scheduling.preview-availability/v1\",\"external.command/v1\",\"breg.read-in-force/v1\",\"breg.read-proposal/v1\",\"breg.start-proposal/v1\",\"breg.submit-proposal/v1\",\"breg.cancel-proposal/v1\",\"breg.lookup-record/v1\",\"breg.read-record/v2\",\"payments.request-collection/v1\",\"payments.read-collection/v1\",\"payments.record-receipt/v1\",\"payments.request-disbursement/v1\",\"payments.read-disbursement/v1\",\"payments.record-provider-confirmation/v1\",\"service.invoke-function/v1\"],\"type\":\"string\"},\"keyRequirement\":{\"enum\":[\"none\",\"required\"],\"type\":\"string\"},\"product\":{\"type\":\"string\"},\"readReceipt\":{\"type\":\"boolean\"},\"recovery\":{\"enum\":[\"read-again\",\"same-command-and-receipt\",\"same-command\",\"hold-after-dispatch\"],\"type\":\"string\"},\"requiresPreparation\":{\"type\":\"boolean\"},\"version\":{\"minimum\":1,\"type\":\"integer\"}},\"required\":[\"id\",\"version\",\"product\",\"effect\",\"keyRequirement\",\"requiresPreparation\",\"recovery\",\"readReceipt\"],\"type\":\"object\"}")], - ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"code\":{\"enum\":[\"admission.held\",\"admission.recovery-only\",\"audit.response-unavailable\",\"authentication.refused\",\"binding.conflict\",\"binding.live-conflict\",\"check.not-waiting\",\"definition.refused\",\"deployment.activation-changed\",\"deployment.refused\",\"evaluation.uncertain\",\"event.invalid\",\"event.too-large\",\"event.unauthenticated\",\"execution.held\",\"idempotency.key-invalid\",\"idempotency.key-reused\",\"input.invalid\",\"mutation.uncertain\",\"operation.not-authorized\",\"receipt.expired\",\"reconcile.raced\",\"reconcile.refused\",\"reconcile.unsupported\",\"request.body-too-large\",\"request.invalid\",\"request.limit-out-of-range\",\"request.method-not-allowed\",\"request.not-found\",\"request.reason-invalid\",\"request.retention-invalid\",\"request.unprocessable\",\"request.unsupported-media-type\",\"restore.hold-required\",\"restore.lease-incompatible\",\"restore.review-required\",\"restore.unresolved\",\"retry.refused\",\"run.definition-incompatible\",\"run.not-visible\",\"run.payload-erased\",\"runtime.failure\",\"service.unavailable\",\"workflow.not-served\",\"workflow.revision-mismatch\"],\"type\":\"string\"},\"detail\":{\"type\":\"string\"},\"pointer\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"title\":{\"type\":\"string\"},\"traceId\":{\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-coordinator/admission/held\",\"https://id.registrystack.org/problems/registry-coordinator/admission/recovery-only\",\"https://id.registrystack.org/problems/registry-coordinator/audit/response-unavailable\",\"https://id.registrystack.org/problems/registry-coordinator/authentication/refused\",\"https://id.registrystack.org/problems/registry-coordinator/binding/conflict\",\"https://id.registrystack.org/problems/registry-coordinator/binding/live-conflict\",\"https://id.registrystack.org/problems/registry-coordinator/check/not-waiting\",\"https://id.registrystack.org/problems/registry-coordinator/definition/refused\",\"https://id.registrystack.org/problems/registry-coordinator/deployment/activation-changed\",\"https://id.registrystack.org/problems/registry-coordinator/deployment/refused\",\"https://id.registrystack.org/problems/registry-coordinator/evaluation/uncertain\",\"https://id.registrystack.org/problems/registry-coordinator/event/invalid\",\"https://id.registrystack.org/problems/registry-coordinator/event/too-large\",\"https://id.registrystack.org/problems/registry-coordinator/event/unauthenticated\",\"https://id.registrystack.org/problems/registry-coordinator/execution/held\",\"https://id.registrystack.org/problems/registry-coordinator/idempotency/key-invalid\",\"https://id.registrystack.org/problems/registry-coordinator/idempotency/key-reused\",\"https://id.registrystack.org/problems/registry-coordinator/input/invalid\",\"https://id.registrystack.org/problems/registry-coordinator/mutation/uncertain\",\"https://id.registrystack.org/problems/registry-coordinator/operation/not-authorized\",\"https://id.registrystack.org/problems/registry-coordinator/receipt/expired\",\"https://id.registrystack.org/problems/registry-coordinator/reconcile/raced\",\"https://id.registrystack.org/problems/registry-coordinator/reconcile/refused\",\"https://id.registrystack.org/problems/registry-coordinator/reconcile/unsupported\",\"https://id.registrystack.org/problems/registry-coordinator/request/body-too-large\",\"https://id.registrystack.org/problems/registry-coordinator/request/invalid\",\"https://id.registrystack.org/problems/registry-coordinator/request/limit-out-of-range\",\"https://id.registrystack.org/problems/registry-coordinator/request/method-not-allowed\",\"https://id.registrystack.org/problems/registry-coordinator/request/not-found\",\"https://id.registrystack.org/problems/registry-coordinator/request/reason-invalid\",\"https://id.registrystack.org/problems/registry-coordinator/request/retention-invalid\",\"https://id.registrystack.org/problems/registry-coordinator/request/unprocessable\",\"https://id.registrystack.org/problems/registry-coordinator/request/unsupported-media-type\",\"https://id.registrystack.org/problems/registry-coordinator/restore/hold-required\",\"https://id.registrystack.org/problems/registry-coordinator/restore/lease-incompatible\",\"https://id.registrystack.org/problems/registry-coordinator/restore/review-required\",\"https://id.registrystack.org/problems/registry-coordinator/restore/unresolved\",\"https://id.registrystack.org/problems/registry-coordinator/retry/refused\",\"https://id.registrystack.org/problems/registry-coordinator/run/definition-incompatible\",\"https://id.registrystack.org/problems/registry-coordinator/run/not-visible\",\"https://id.registrystack.org/problems/registry-coordinator/run/payload-erased\",\"https://id.registrystack.org/problems/registry-coordinator/runtime/failure\",\"https://id.registrystack.org/problems/registry-coordinator/service/unavailable\",\"https://id.registrystack.org/problems/registry-coordinator/workflow/not-served\",\"https://id.registrystack.org/problems/registry-coordinator/workflow/revision-mismatch\"],\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], + ["/components/schemas/Problem", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"code\":{\"enum\":[\"admission.held\",\"admission.recovery-only\",\"audit.response-unavailable\",\"authentication.refused\",\"binding.conflict\",\"binding.live-conflict\",\"check.not-waiting\",\"definition.refused\",\"deployment.activation-changed\",\"deployment.refused\",\"evaluation.uncertain\",\"event.invalid\",\"event.too-large\",\"event.unauthenticated\",\"execution.held\",\"idempotency.key-invalid\",\"idempotency.key-reused\",\"input.invalid\",\"mutation.uncertain\",\"operation.not-authorized\",\"receipt.expired\",\"reconcile.raced\",\"reconcile.refused\",\"reconcile.unsupported\",\"request.body-too-large\",\"request.invalid\",\"request.limit-out-of-range\",\"request.method-not-allowed\",\"request.not-found\",\"request.reason-invalid\",\"request.retention-invalid\",\"request.unprocessable\",\"request.unsupported-media-type\",\"restore.hold-required\",\"restore.lease-incompatible\",\"restore.review-required\",\"restore.unresolved\",\"retry.refused\",\"run.definition-incompatible\",\"run.not-visible\",\"run.payload-erased\",\"runtime.failure\",\"service.unavailable\",\"workflow.not-served\",\"workflow.revision-mismatch\"],\"type\":\"string\"},\"detail\":{\"type\":\"string\"},\"failedCheck\":{\"type\":\"string\"},\"pointer\":{\"type\":\"string\"},\"status\":{\"type\":\"integer\"},\"title\":{\"type\":\"string\"},\"traceId\":{\"type\":\"string\"},\"type\":{\"enum\":[\"https://id.registrystack.org/problems/registry-coordinator/admission/held\",\"https://id.registrystack.org/problems/registry-coordinator/admission/recovery-only\",\"https://id.registrystack.org/problems/registry-coordinator/audit/response-unavailable\",\"https://id.registrystack.org/problems/registry-coordinator/authentication/refused\",\"https://id.registrystack.org/problems/registry-coordinator/binding/conflict\",\"https://id.registrystack.org/problems/registry-coordinator/binding/live-conflict\",\"https://id.registrystack.org/problems/registry-coordinator/check/not-waiting\",\"https://id.registrystack.org/problems/registry-coordinator/definition/refused\",\"https://id.registrystack.org/problems/registry-coordinator/deployment/activation-changed\",\"https://id.registrystack.org/problems/registry-coordinator/deployment/refused\",\"https://id.registrystack.org/problems/registry-coordinator/evaluation/uncertain\",\"https://id.registrystack.org/problems/registry-coordinator/event/invalid\",\"https://id.registrystack.org/problems/registry-coordinator/event/too-large\",\"https://id.registrystack.org/problems/registry-coordinator/event/unauthenticated\",\"https://id.registrystack.org/problems/registry-coordinator/execution/held\",\"https://id.registrystack.org/problems/registry-coordinator/idempotency/key-invalid\",\"https://id.registrystack.org/problems/registry-coordinator/idempotency/key-reused\",\"https://id.registrystack.org/problems/registry-coordinator/input/invalid\",\"https://id.registrystack.org/problems/registry-coordinator/mutation/uncertain\",\"https://id.registrystack.org/problems/registry-coordinator/operation/not-authorized\",\"https://id.registrystack.org/problems/registry-coordinator/receipt/expired\",\"https://id.registrystack.org/problems/registry-coordinator/reconcile/raced\",\"https://id.registrystack.org/problems/registry-coordinator/reconcile/refused\",\"https://id.registrystack.org/problems/registry-coordinator/reconcile/unsupported\",\"https://id.registrystack.org/problems/registry-coordinator/request/body-too-large\",\"https://id.registrystack.org/problems/registry-coordinator/request/invalid\",\"https://id.registrystack.org/problems/registry-coordinator/request/limit-out-of-range\",\"https://id.registrystack.org/problems/registry-coordinator/request/method-not-allowed\",\"https://id.registrystack.org/problems/registry-coordinator/request/not-found\",\"https://id.registrystack.org/problems/registry-coordinator/request/reason-invalid\",\"https://id.registrystack.org/problems/registry-coordinator/request/retention-invalid\",\"https://id.registrystack.org/problems/registry-coordinator/request/unprocessable\",\"https://id.registrystack.org/problems/registry-coordinator/request/unsupported-media-type\",\"https://id.registrystack.org/problems/registry-coordinator/restore/hold-required\",\"https://id.registrystack.org/problems/registry-coordinator/restore/lease-incompatible\",\"https://id.registrystack.org/problems/registry-coordinator/restore/review-required\",\"https://id.registrystack.org/problems/registry-coordinator/restore/unresolved\",\"https://id.registrystack.org/problems/registry-coordinator/retry/refused\",\"https://id.registrystack.org/problems/registry-coordinator/run/definition-incompatible\",\"https://id.registrystack.org/problems/registry-coordinator/run/not-visible\",\"https://id.registrystack.org/problems/registry-coordinator/run/payload-erased\",\"https://id.registrystack.org/problems/registry-coordinator/runtime/failure\",\"https://id.registrystack.org/problems/registry-coordinator/service/unavailable\",\"https://id.registrystack.org/problems/registry-coordinator/workflow/not-served\",\"https://id.registrystack.org/problems/registry-coordinator/workflow/revision-mismatch\"],\"type\":\"string\"}},\"required\":[\"type\",\"title\",\"status\",\"detail\",\"code\",\"traceId\"],\"type\":\"object\"}")], ["/components/schemas/ProposalWaitsByTurn", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"nobody\":{\"minimum\":0,\"type\":\"integer\"},\"official\":{\"minimum\":0,\"type\":\"integer\"},\"party\":{\"minimum\":0,\"type\":\"integer\"},\"unobserved\":{\"minimum\":0,\"type\":\"integer\"}},\"required\":[\"party\",\"official\",\"nobody\",\"unobserved\"],\"type\":\"object\"}")], ["/components/schemas/Reason", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"reason\":{\"maxLength\":256,\"minLength\":1,\"type\":\"string\"}},\"required\":[\"reason\"],\"type\":\"object\"}")], ["/components/schemas/Retention", JSON.parse("{\"additionalProperties\":false,\"properties\":{\"before\":{\"type\":\"string\"},\"limit\":{\"maximum\":100,\"minimum\":1,\"type\":\"integer\"}},\"required\":[\"before\",\"limit\"],\"type\":\"object\"}")], diff --git a/crates/registry-cli-docs/catalog.json b/crates/registry-cli-docs/catalog.json index 48d1e839a0..c90af04500 100644 --- a/crates/registry-cli-docs/catalog.json +++ b/crates/registry-cli-docs/catalog.json @@ -19556,14 +19556,6 @@ "[PROJECT]" ] }, - { - "kind": "mutually-exclusive", - "when": null, - "arguments": [ - "--production", - "--store-provision-config " - ] - }, { "kind": "mutually-exclusive", "when": null, diff --git a/crates/registry-rstack-dev/src/dev_facts.rs b/crates/registry-rstack-dev/src/dev_facts.rs index 3a16ec90c3..675cf38f3f 100644 --- a/crates/registry-rstack-dev/src/dev_facts.rs +++ b/crates/registry-rstack-dev/src/dev_facts.rs @@ -1127,6 +1127,7 @@ mod tests { "https://issuer.example.test", None, &BTreeSet::new(), + None, &AtomicBool::new(false), true, ) diff --git a/products/identifiers/generated/catalog.v1.json b/products/identifiers/generated/catalog.v1.json index a8f7431a3d..5d0404501e 100644 --- a/products/identifiers/generated/catalog.v1.json +++ b/products/identifiers/generated/catalog.v1.json @@ -5706,7 +5706,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": "c520ecb0fa494f0d49d63d34b8cc45f6ec4744f77285401b884cece3320690c6" + "sha256": "586b4e3da54bad07e5b750e67ef9e5a872a454f779de5ea6ca56692c798749ea" }, "artifact": { "path": "products/breg/generated/facility/generated/action-contracts.schema.json", @@ -5724,11 +5724,11 @@ "description": "Base Registry Engine bregctl explain output JSON Schemas, written by hand and held to bregctl's output by its contract test.", "source": { "path": "products/breg/contracts/explain/ActionsExplanation.schema.json", - "sha256": "37bb80468191278addfb3e107ec55b4db49c7ea8c6e991947612597c7e1c2b11" + "sha256": "32f926563b4c55846fada9168951e2227507ab01d725637d293dae1f881815ca" }, "artifact": { "path": "products/breg/contracts/explain/ActionsExplanation.schema.json", - "sha256": "37bb80468191278addfb3e107ec55b4db49c7ea8c6e991947612597c7e1c2b11", + "sha256": "32f926563b4c55846fada9168951e2227507ab01d725637d293dae1f881815ca", "mediaType": "application/schema+json" } }, @@ -5944,7 +5944,7 @@ }, "artifact": { "path": "products/breg/generated/authoring/registry-module.schema.json", - "sha256": "135e6f4fb68281ce84ad8a15ad87ad464d96722e37a89ad2bd697fc382bcbca9", + "sha256": "a6c426f05687fce0775f6a4690189de9d2826675f86fe094dbd06671fd31b513", "mediaType": "application/schema+json" } }, @@ -5962,7 +5962,7 @@ }, "artifact": { "path": "products/breg/generated/authoring/registry-project.schema.json", - "sha256": "cc701340565561324fb44b9db9f65b0f08f137e4a0754ba86c19ef9502fb9c76", + "sha256": "712e989a790b9c4fc59b1a1f14a32437f158b9fd7d405909274a641556173f76", "mediaType": "application/schema+json" } }, @@ -5976,11 +5976,11 @@ "description": "Base Registry Engine bregctl explain output JSON Schemas, written by hand and held to bregctl's output by its contract test.", "source": { "path": "products/breg/contracts/explain/ProposalsExplanation.schema.json", - "sha256": "66a3237b675edbc300df9526a9abe2420c4d34d594736960539234473cd051b5" + "sha256": "536e5f5250a05f43f9a7662ae0aea9ecc8b74ef652a81cab81ca23ff526d4d27" }, "artifact": { "path": "products/breg/contracts/explain/ProposalsExplanation.schema.json", - "sha256": "66a3237b675edbc300df9526a9abe2420c4d34d594736960539234473cd051b5", + "sha256": "536e5f5250a05f43f9a7662ae0aea9ecc8b74ef652a81cab81ca23ff526d4d27", "mediaType": "application/schema+json" } }, @@ -5994,11 +5994,11 @@ "description": "Base Registry Engine bregctl explain output JSON Schemas, written by hand and held to bregctl's output by its contract test.", "source": { "path": "products/breg/contracts/explain/QueriesExplanation.schema.json", - "sha256": "c30a70ce60b1946e6eb3cd0ebf1267841c97be81115f61e0bbf713262bfd59a3" + "sha256": "6352d107687d7dabdb85faad440c2fda3d272e1816174bb951a3188057483d89" }, "artifact": { "path": "products/breg/contracts/explain/QueriesExplanation.schema.json", - "sha256": "c30a70ce60b1946e6eb3cd0ebf1267841c97be81115f61e0bbf713262bfd59a3", + "sha256": "6352d107687d7dabdb85faad440c2fda3d272e1816174bb951a3188057483d89", "mediaType": "application/schema+json" } }, @@ -6300,7 +6300,7 @@ "description": "Registry Document Store event data JSON Schemas, one per event family.", "source": { "path": "crates/registry-documents/src/schema.rs", - "sha256": "639160259116646ee57f1193bab60be8e0c35843eecd62b4c767e55edf44dca4" + "sha256": "a6a9376ed04286fa8798dc5b48f7a86351080e069d6efa9ea9858984aac88b2c" }, "artifact": { "path": "products/documents/generated/events/document-grant-changed.schema.json", @@ -6318,7 +6318,7 @@ "description": "Registry Document Store event data JSON Schemas, one per event family.", "source": { "path": "crates/registry-documents/src/schema.rs", - "sha256": "639160259116646ee57f1193bab60be8e0c35843eecd62b4c767e55edf44dca4" + "sha256": "a6a9376ed04286fa8798dc5b48f7a86351080e069d6efa9ea9858984aac88b2c" }, "artifact": { "path": "products/documents/generated/events/document-version-ready.schema.json", @@ -6336,7 +6336,7 @@ "description": "Registry Document Store event data JSON Schemas, one per event family.", "source": { "path": "crates/registry-documents/src/schema.rs", - "sha256": "639160259116646ee57f1193bab60be8e0c35843eecd62b4c767e55edf44dca4" + "sha256": "a6a9376ed04286fa8798dc5b48f7a86351080e069d6efa9ea9858984aac88b2c" }, "artifact": { "path": "products/documents/generated/events/document-version-rejected.schema.json", @@ -6354,7 +6354,7 @@ "description": "Registry Document Store project JSON Schema.", "source": { "path": "crates/registry-documents/src/schema.rs", - "sha256": "639160259116646ee57f1193bab60be8e0c35843eecd62b4c767e55edf44dca4" + "sha256": "a6a9376ed04286fa8798dc5b48f7a86351080e069d6efa9ea9858984aac88b2c" }, "artifact": { "path": "products/documents/generated/project/project.schema.json", @@ -6372,7 +6372,7 @@ "description": "Registry Document Store runtime configuration JSON Schema.", "source": { "path": "crates/registry-documents/src/schema.rs", - "sha256": "639160259116646ee57f1193bab60be8e0c35843eecd62b4c767e55edf44dca4" + "sha256": "a6a9376ed04286fa8798dc5b48f7a86351080e069d6efa9ea9858984aac88b2c" }, "artifact": { "path": "products/documents/generated/runtime/runtime.schema.json", @@ -6574,7 +6574,7 @@ }, "artifact": { "path": "crates/registry-evidencectl/schemas/authoring/project.schema.json", - "sha256": "e5ad46aace0be445b0a89f19eb3a36a4e178db8bce8b25bdd89e1f3c697cd558", + "sha256": "da730f25e370c6d9cbf4dd5755f6a32c5c65c60d07d9af4a04bf10f8ff155266", "mediaType": "application/schema+json" } }, @@ -6750,7 +6750,7 @@ "description": "Registry Messaging project, template, and HTTP provider authoring JSON Schema.", "source": { "path": "crates/registry-messaging/src/schema.rs", - "sha256": "3655690b7a2ed2f28fb3314568193a6b5328f7030a418618770d219f78e0d494" + "sha256": "5e58191869e1be749bd5d07aa9236975835ff0430cafa999d1306da92b4b8900" }, "artifact": { "path": "products/messaging/generated/authoring/project.schema.json", @@ -6768,7 +6768,7 @@ "description": "Registry Messaging project, template, and HTTP provider authoring JSON Schema.", "source": { "path": "crates/registry-messaging/src/schema.rs", - "sha256": "3655690b7a2ed2f28fb3314568193a6b5328f7030a418618770d219f78e0d494" + "sha256": "5e58191869e1be749bd5d07aa9236975835ff0430cafa999d1306da92b4b8900" }, "artifact": { "path": "products/messaging/generated/authoring/provider.schema.json", @@ -6786,7 +6786,7 @@ "description": "Registry Messaging runtime configuration JSON Schema.", "source": { "path": "crates/registry-messaging/src/schema.rs", - "sha256": "3655690b7a2ed2f28fb3314568193a6b5328f7030a418618770d219f78e0d494" + "sha256": "5e58191869e1be749bd5d07aa9236975835ff0430cafa999d1306da92b4b8900" }, "artifact": { "path": "products/messaging/generated/runtime/runtime.schema.json", @@ -6804,7 +6804,7 @@ "description": "Registry Messaging project, template, and HTTP provider authoring JSON Schema.", "source": { "path": "crates/registry-messaging/src/schema.rs", - "sha256": "3655690b7a2ed2f28fb3314568193a6b5328f7030a418618770d219f78e0d494" + "sha256": "5e58191869e1be749bd5d07aa9236975835ff0430cafa999d1306da92b4b8900" }, "artifact": { "path": "products/messaging/generated/authoring/template.schema.json", @@ -7078,7 +7078,7 @@ }, "artifact": { "path": "products/render/schemas/runtime.schema.json", - "sha256": "f2d3e0cb18bae70a57b1d6e85b03bdbb0ed8712d06e68744747666b10fff806a", + "sha256": "bee49b33f6ce372948d096d55424f59cfb65823d4e44a2fc5cd4561335aae77b", "mediaType": "application/schema+json" } }, From 45c8f276dc78218a0dcade91a5b7f8cff94f0922 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 11:40:01 +0000 Subject: [PATCH 46/55] chore(client): regenerate the TypeScript clients for the 0.51.0 development line Signed-off-by: Jeremi Joslin --- clients/typescript/generated/adapter-dhis2-tracker.ts | 4 ++-- clients/typescript/generated/breg-facility.ts | 4 ++-- clients/typescript/generated/breg-minimal.ts | 4 ++-- clients/typescript/generated/casework.ts | 4 ++-- clients/typescript/generated/coordinator.ts | 6 +++--- clients/typescript/generated/documents.ts | 4 ++-- clients/typescript/generated/evidence-oid4vci.ts | 4 ++-- clients/typescript/generated/evidence-oid4vp.ts | 4 ++-- clients/typescript/generated/evidence.ts | 6 +++--- clients/typescript/generated/messaging.ts | 4 ++-- clients/typescript/generated/render.ts | 4 ++-- clients/typescript/generated/scheduling.ts | 4 ++-- 12 files changed, 26 insertions(+), 26 deletions(-) diff --git a/clients/typescript/generated/adapter-dhis2-tracker.ts b/clients/typescript/generated/adapter-dhis2-tracker.ts index 8abc93e04f..6a1f4558c2 100644 --- a/clients/typescript/generated/adapter-dhis2-tracker.ts +++ b/clients/typescript/generated/adapter-dhis2-tracker.ts @@ -1,4 +1,4 @@ -// Generated for Stack version 0.50.0, client version 0.50.0. +// Generated for Stack version 0.51.0, client version 0.51.0. // Source SHA-256 26140d808406cbf4fa0e31596a1c2ea44acb9c68465c415ad382dc4538f42b46 import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -106,7 +106,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.50.0") + assertClientVersion("0.51.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/breg-facility.ts b/clients/typescript/generated/breg-facility.ts index 0ec11fb015..1c2abbaf20 100644 --- a/clients/typescript/generated/breg-facility.ts +++ b/clients/typescript/generated/breg-facility.ts @@ -1,4 +1,4 @@ -// Generated for Stack version 0.50.0, client version 0.50.0. +// Generated for Stack version 0.51.0, client version 0.51.0. // Source SHA-256 a29f66c2bbff96fab6003672e8e13f9a958c6ed04ebd6c55a6c5bb762b472187 // Unconstrained JSON /paths/~1v1~1records~1directory-entries~1{record_id}/patch/requestBody/content/application~1json-patch+json/schema/items/properties/value // Unconstrained JSON /paths/~1v1~1records~1operators~1{record_id}/patch/requestBody/content/application~1json-patch+json/schema/items/properties/value @@ -489,7 +489,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Pick constructor(transport: Pick) { - assertClientVersion("0.50.0") + assertClientVersion("0.51.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/breg-minimal.ts b/clients/typescript/generated/breg-minimal.ts index f68b4fd3b8..308c004aea 100644 --- a/clients/typescript/generated/breg-minimal.ts +++ b/clients/typescript/generated/breg-minimal.ts @@ -1,4 +1,4 @@ -// Generated for Stack version 0.50.0, client version 0.50.0. +// Generated for Stack version 0.51.0, client version 0.51.0. // Source SHA-256 bce07d69a8eed5bb72b32568719f0ad0dc4ed711148c6f57735cc64e379193f1 // Unconstrained JSON /paths/~1v1~1records~1contacts~1{record_id}/patch/requestBody/content/application~1json-patch+json/schema/items/properties/value import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" @@ -247,7 +247,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Pick constructor(transport: Pick) { - assertClientVersion("0.50.0") + assertClientVersion("0.51.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/casework.ts b/clients/typescript/generated/casework.ts index 0c6fa8dad9..df79eb57ff 100644 --- a/clients/typescript/generated/casework.ts +++ b/clients/typescript/generated/casework.ts @@ -1,4 +1,4 @@ -// Generated for Stack version 0.50.0, client version 0.50.0. +// Generated for Stack version 0.51.0, client version 0.51.0. // Source SHA-256 095bdd1b45a0e8031bb3d6cff6b2223514c250f14c985ca177abe6f8d18d9277 // Unconstrained JSON /components/schemas/ReviewHistoryEntry/properties/detail // Unconstrained JSON /components/schemas/ReviewPolicy/properties/displaySchema @@ -1305,7 +1305,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.50.0") + assertClientVersion("0.51.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/coordinator.ts b/clients/typescript/generated/coordinator.ts index 7f70cf6e54..cb769d4cf7 100644 --- a/clients/typescript/generated/coordinator.ts +++ b/clients/typescript/generated/coordinator.ts @@ -1,5 +1,5 @@ -// Generated for Stack version 0.50.0, client version 0.50.0. -// Source SHA-256 406bb41312ff42f8b40b68ddd1cf02b898034f122752eddad4f28430e3a8f308 +// Generated for Stack version 0.51.0, client version 0.51.0. +// Source SHA-256 50858afdf646b0abfabef1591fa0dc4061d0dc8a25b53355ec1fccf09b8faa81 // Unconstrained JSON /components/schemas/HookEnvelope/properties/data // Unconstrained JSON /components/schemas/RunStatus/properties/output // Unconstrained JSON /components/schemas/Start/properties/input @@ -281,7 +281,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.50.0") + assertClientVersion("0.51.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/documents.ts b/clients/typescript/generated/documents.ts index f23fe04f7f..d88c7eca47 100644 --- a/clients/typescript/generated/documents.ts +++ b/clients/typescript/generated/documents.ts @@ -1,4 +1,4 @@ -// Generated for Stack version 0.50.0, client version 0.50.0. +// Generated for Stack version 0.51.0, client version 0.51.0. // Source SHA-256 3ae4d3cb2bdd8a07d034758175ecea78c67d4ae87b2b34ad6886187a26647ae6 import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -184,7 +184,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.50.0") + assertClientVersion("0.51.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/evidence-oid4vci.ts b/clients/typescript/generated/evidence-oid4vci.ts index 6dc1cedcc7..d553a16d6d 100644 --- a/clients/typescript/generated/evidence-oid4vci.ts +++ b/clients/typescript/generated/evidence-oid4vci.ts @@ -1,4 +1,4 @@ -// Generated for Stack version 0.50.0, client version 0.50.0. +// Generated for Stack version 0.51.0, client version 0.51.0. // Source SHA-256 218dc077f5442dd03c2f4f2b802413b3a9fd908ac01d3d838aafcacd73963c46 import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -50,7 +50,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.50.0") + assertClientVersion("0.51.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/evidence-oid4vp.ts b/clients/typescript/generated/evidence-oid4vp.ts index ac4caed5a7..11f5386bdd 100644 --- a/clients/typescript/generated/evidence-oid4vp.ts +++ b/clients/typescript/generated/evidence-oid4vp.ts @@ -1,4 +1,4 @@ -// Generated for Stack version 0.50.0, client version 0.50.0. +// Generated for Stack version 0.51.0, client version 0.51.0. // Source SHA-256 6da3ab9720fa5323564d9b5536aa5b75f1475b915dd8b111e16dabc26c6c0efa import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -122,7 +122,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.50.0") + assertClientVersion("0.51.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/evidence.ts b/clients/typescript/generated/evidence.ts index 59d8c792c0..976d7953c0 100644 --- a/clients/typescript/generated/evidence.ts +++ b/clients/typescript/generated/evidence.ts @@ -1,5 +1,5 @@ -// Generated for Stack version 0.50.0, client version 0.50.0. -// Source SHA-256 e3c836a65b95052a3f6e25ef207018f6870eaeaaaa626a3253ba7eb7c730f5f3 +// Generated for Stack version 0.51.0, client version 0.51.0. +// Source SHA-256 c9030b5f6512fd438bd645ceea0e3f5fcea8676b4646a9d613c668d84ed1531a import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -173,7 +173,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.50.0") + assertClientVersion("0.51.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/messaging.ts b/clients/typescript/generated/messaging.ts index 9321523282..28183caa5e 100644 --- a/clients/typescript/generated/messaging.ts +++ b/clients/typescript/generated/messaging.ts @@ -1,4 +1,4 @@ -// Generated for Stack version 0.50.0, client version 0.50.0. +// Generated for Stack version 0.51.0, client version 0.51.0. // Source SHA-256 d10408f03ccad14c266036ab45c0cf1c5b45d21269c04a2e459e7d6b4f1b92e0 // Unconstrained JSON /components/schemas/SubmitMessageRequest/properties/data // Unconstrained JSON /components/schemas/TemplatePreviewRequest/properties/data @@ -140,7 +140,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.50.0") + assertClientVersion("0.51.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/render.ts b/clients/typescript/generated/render.ts index 32be4d5db5..4f88a07691 100644 --- a/clients/typescript/generated/render.ts +++ b/clients/typescript/generated/render.ts @@ -1,4 +1,4 @@ -// Generated for Stack version 0.50.0, client version 0.50.0. +// Generated for Stack version 0.51.0, client version 0.51.0. // Source SHA-256 f55f36da7de7a0417c2085878f09ee28cc47f6b0649b81901780a629722fa0b7 import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" import { validator } from "../schema.ts" @@ -68,7 +68,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.50.0") + assertClientVersion("0.51.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { diff --git a/clients/typescript/generated/scheduling.ts b/clients/typescript/generated/scheduling.ts index d50a134da0..ac7070192b 100644 --- a/clients/typescript/generated/scheduling.ts +++ b/clients/typescript/generated/scheduling.ts @@ -1,4 +1,4 @@ -// Generated for Stack version 0.50.0, client version 0.50.0. +// Generated for Stack version 0.51.0, client version 0.51.0. // Source SHA-256 5ac404c37885cc668f9a21f9e591ee8cfd20ea1aa0b97056a004a95fa2e69571 // Unconstrained JSON /components/schemas/AppointmentHistoryEntryDocument/properties/detail import { assertClientVersion, type Transport, type Answer, type CallOptions, type JsonValue, type Operation, type Page, type RequestValues, type ResponseVariant, type WireBytes, type WireText } from "../core.ts" @@ -451,7 +451,7 @@ for (const [id, definition] of Object.entries(definitions)) { export class Client { readonly #transport: Transport constructor(transport: Transport) { - assertClientVersion("0.50.0") + assertClientVersion("0.51.0") this.#transport = transport } async call(operation: K, ...args: Operations[K]["required"] extends true ? [Operations[K]["input"]] : [Operations[K]["input"]?]): Promise> { From 659547fb3be60a46dc6fa18fab8dacbd6eb77bed Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 14:02:13 +0000 Subject: [PATCH 47/55] test: resolve the CodeQL findings in the v0.51 test harnesses The Render transit TSA test server requires TLS 1.2 or later, and the Render runtime file and OpenBao AppRole fixtures are created owner-only. The composition public check pops observedAt before asserting, so the check survives python -O. The first-hour receipt tests join their bash script fragments explicitly. Signed-off-by: Jeremi Joslin --- products/breg/evidence/tests/verify-composition.py | 3 ++- products/platform/journeys/test_journey_tables.py | 4 ++-- products/render/scripts/test_signed_delivery.py | 8 +++++++- products/render/scripts/test_transit_delivery.py | 6 ++++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/products/breg/evidence/tests/verify-composition.py b/products/breg/evidence/tests/verify-composition.py index eba59427e9..bef825f13a 100644 --- a/products/breg/evidence/tests/verify-composition.py +++ b/products/breg/evidence/tests/verify-composition.py @@ -483,7 +483,8 @@ def check(document_number: str, **fields: str) -> tuple[int, dict]: return error.code, json.load(error) status, result = check(number, checkCode=code) - assert status == 200 and result.pop("observedAt"), (status, result) + observed_at = result.pop("observedAt", None) + assert status == 200 and observed_at, (status, observed_at, result) assert result == {"schema": "registry.evidence.public-check/v1alpha1", "status": "valid", "fields": {"recordStatus": "active"}} missing_status, missing = check(number) diff --git a/products/platform/journeys/test_journey_tables.py b/products/platform/journeys/test_journey_tables.py index 205ed2ad4c..35c7697687 100644 --- a/products/platform/journeys/test_journey_tables.py +++ b/products/platform/journeys/test_journey_tables.py @@ -2032,7 +2032,7 @@ def project(self, receipt, path): return subprocess.run( ["bash", "-eu", "-c", 'source "$1/lib.sh"; journey__first_hour_rule "$1/first-hour-pass-rule.yaml"; ' - 'journey__first_hour_receipt "$2" /dev/stdin', + + 'journey__first_hour_receipt "$2" /dev/stdin', "bash", str(HERE), path], input=receipt, capture_output=True, text=True, ) @@ -2091,7 +2091,7 @@ def test_comparison_code_error_is_visible(self): result = subprocess.run( ["bash", "-eu", "-c", 'source "$1/lib.sh"; journey__first_hour_rule "$1/first-hour-pass-rule.yaml"; ' - 'JOURNEY_LIB_DIR="$2"; journey__first_hour_receipt own-provider /dev/stdin', + + 'JOURNEY_LIB_DIR="$2"; journey__first_hour_receipt own-provider /dev/stdin', "bash", str(HERE), temp], input="{}", capture_output=True, text=True, ) diff --git a/products/render/scripts/test_signed_delivery.py b/products/render/scripts/test_signed_delivery.py index b571ee3b54..6efbcd2eac 100644 --- a/products/render/scripts/test_signed_delivery.py +++ b/products/render/scripts/test_signed_delivery.py @@ -88,6 +88,12 @@ def issue_certificate(public_key, name, issuer, issuer_key, *, purpose=None, nam return builder.sign(issuer_key, hashes.SHA256()) +def write_private(path, text): + """Create a fixture file only its owner can read.""" + with os.fdopen(os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600), "w") as file: + file.write(text) + + def write_fixture(binary, directory, *, transit_socket=None): def run(*args): subprocess.run([binary, *args], check=True, stdout=subprocess.DEVNULL, timeout=30) @@ -223,7 +229,7 @@ def delivery( " attemptTimeoutMilliseconds: 2000" ) expected_warnings = [] - runtime.write_text(f"""\ + write_private(runtime, f"""\ apiVersion: id.registrystack.org/formats/render/runtime/v1alpha1 kind: RenderRuntimeConfig listener: diff --git a/products/render/scripts/test_transit_delivery.py b/products/render/scripts/test_transit_delivery.py index 68646662cc..1f6023e92d 100644 --- a/products/render/scripts/test_transit_delivery.py +++ b/products/render/scripts/test_transit_delivery.py @@ -30,6 +30,7 @@ timestamp_authority, verify_delivery, write_fixture, + write_private, ) OPENBAO = "ghcr.io/openbao/openbao@sha256:09f1eaaee351c329d75a5a89654d6e1ad4792998650c3cbf0c3513a76d9d9b6e" @@ -154,8 +155,8 @@ def health(): }) role = request("GET", "auth/approle/role/render-seal/role-id", 200) secret = request("POST", "auth/approle/role/render-seal/secret-id", 200) - (directory / "role-id").write_text(role["data"]["role_id"]) - (directory / "secret-id").write_text(secret["data"]["secret_id"]) + write_private(directory / "role-id", role["data"]["role_id"]) + write_private(directory / "secret-id", secret["data"]["secret_id"]) unix_socket = directory / "bao.sock" agent = directory / "agent.hcl" agent.write_text(f""" @@ -214,6 +215,7 @@ def tsa_tls(directory): serialization.Encoding.PEM, serialization.PrivateFormat.PKCS8, serialization.NoEncryption() )) context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) + context.minimum_version = ssl.TLSVersion.TLSv1_2 context.load_cert_chain(chain, private) return context, root.public_bytes(serialization.Encoding.PEM) From 3be130a81a6b5f1ca4a2e7b9cc1e3f96a9e36ede Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 14:41:50 +0000 Subject: [PATCH 48/55] fix: reconcile the v0.51 lanes at the docs and release tooling seams The BReg tool-schema test now expects the bregctl report schema once, because the reference generator covers it as a tool contract. The posture diagnostics data is regenerated from its sources. The release binary build assigns the Session roster answer before testing it, like every other roster call, and the release workflow structure tests read the assigned Coordinator image gate and set the Coordinator answer the rstack smoke step reads. Signed-off-by: Jeremi Joslin --- docs/site/scripts/generate-breg-configuration.test.mjs | 5 +---- docs/site/src/data/posture-diagnostics.json | 8 ++++++++ release/scripts/build-release-binaries.sh | 4 +++- release/scripts/test_release_workflow_structure.py | 6 ++++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/docs/site/scripts/generate-breg-configuration.test.mjs b/docs/site/scripts/generate-breg-configuration.test.mjs index 783cae898e..ddbf48e288 100644 --- a/docs/site/scripts/generate-breg-configuration.test.mjs +++ b/docs/site/scripts/generate-breg-configuration.test.mjs @@ -59,13 +59,10 @@ test('BReg reference includes module extensions, hook conditions, and runtime de test('BReg covers every committed tool schema, in the order an adopter meets the files', async () => { const committed = async (directory) => (await readdir(new URL(`../../../${directory}/`, import.meta.url))) .map((name) => `${directory}/${name}`); - // Report formats bregctl writes. An adopter reads them and never authors one, so the - // configuration reference leaves them out; every other tool schema must be a contract. - const reportSchemas = ['products/breg/generated/tools/ctl-report.v1alpha1.schema.json']; assert.deepEqual([ ...await committed('products/breg/generated/tools'), ...await committed('products/platform/generated/dev'), - ].sort(), [...TOOL_CONTRACTS.map((entry) => entry.file), ...reportSchemas].sort()); + ].sort(), TOOL_CONTRACTS.map((entry) => entry.file).sort()); assert.deepEqual(TOOL_CONTRACTS.map((entry) => entry.id), ['rstack-dev', 'rstack-service', 'rstack-journeys', 'example-scenarios', 'journeys', 'schema-test-credentials', 'migration-descriptor', 'backup-binding', 'model-selection', 'ctl-report']); }); diff --git a/docs/site/src/data/posture-diagnostics.json b/docs/site/src/data/posture-diagnostics.json index 7a05acc531..5ecaea67b9 100644 --- a/docs/site/src/data/posture-diagnostics.json +++ b/docs/site/src/data/posture-diagnostics.json @@ -256,6 +256,14 @@ "registry-platform-config" ] }, + { + "code": "platform.posture.compose-native-secret-mount", + "key": "mountPolicy", + "condition": "The file secret provider accepts root-owned, mode 0444 Compose mounts", + "crates": [ + "registry-platform-config" + ] + }, { "code": "platform.posture.destination-private-plaintext", "key": "transport", diff --git a/release/scripts/build-release-binaries.sh b/release/scripts/build-release-binaries.sh index c30e8f5ed9..430cda0290 100755 --- a/release/scripts/build-release-binaries.sh +++ b/release/scripts/build-release-binaries.sh @@ -170,7 +170,9 @@ if [[ "${coordinator_image_in_release}" == true ]]; then include_coordinator_image=1 fi include_session=0 -if [[ -z "${nightly_tag}" && "$(python3 "${script_dir}/release_roster.py" session-in-release "${version}")" == true ]]; then +session_in_release="$(python3 "${script_dir}/release_roster.py" \ + session-in-release "${version}")" +if [[ -z "${nightly_tag}" && "${session_in_release}" == true ]]; then include_session=1 fi # Adapter binaries have an independent boundary from image publication. diff --git a/release/scripts/test_release_workflow_structure.py b/release/scripts/test_release_workflow_structure.py index 59b8b9c174..90b3e5efa6 100644 --- a/release/scripts/test_release_workflow_structure.py +++ b/release/scripts/test_release_workflow_structure.py @@ -793,8 +793,9 @@ def test_canonical_binary_shards_are_exact_source_inputs_to_one_consumer( self.assertIn(coordinator_gate, merge) coordinator_smoke = merge.split(coordinator_gate, 1)[1].split("\nfi\n", 1)[0] image_gate = ( - 'if [[ "$(python3 release/scripts/release_roster.py coordinator-in-release ' - '"${{ needs.validate.outputs.version }}")" == true ]]; then\n' + 'coordinator_image_in_release="$(python3 release/scripts/release_roster.py \\\n' + ' coordinator-in-release "${{ needs.validate.outputs.version }}")"\n' + ' if [[ "${coordinator_image_in_release}" == true ]]; then\n' ) self.assertIn(image_gate, coordinator_smoke) binary_smoke, image_smoke = coordinator_smoke.split(image_gate, 1) @@ -1081,6 +1082,7 @@ def test_release_pinned_rstack_smoke_reuses_custom_installation_paths( post_install = ( 'set -euo pipefail\nversion="0.44.0"\n' 'destination="${RUNNER_TEMP}/rstack-install-smoke"\n' + 'coordinator_in_release=false\n' + 'test -L ' + smoke.split("test -L ", 1)[1] ) From 5500d570ba93700b49891bce754278ff52e179a1 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 14:23:33 +0000 Subject: [PATCH 49/55] fix(rstack): report a child exit before a missed readiness deadline A product or application that exited during the last readiness probe was reported as not ready when the deadline had passed by the time the probe returned. Check the children once more before reporting the deadline, so an exit before it always reports as an exit. Signed-off-by: Jeremi Joslin --- crates/registry-rstack-dev/src/guard.rs | 17 ++++++ crates/registry-rstack-dev/src/products.rs | 60 ++++++++++++++++++++++ 2 files changed, 77 insertions(+) diff --git a/crates/registry-rstack-dev/src/guard.rs b/crates/registry-rstack-dev/src/guard.rs index b2389b4e5d..1173cf44d2 100644 --- a/crates/registry-rstack-dev/src/guard.rs +++ b/crates/registry-rstack-dev/src/guard.rs @@ -608,6 +608,23 @@ impl Child { direct_child_exited(&self.guard) } + /// Block until the guard has exited, without reaping it, so `exited` + /// still observes the exit. + #[cfg(test)] + pub(super) fn guard_exit_waiter(&self) -> impl FnOnce() + Send + 'static { + let guard = direct_child_pid(&self.guard).unwrap(); + move || loop { + match waitid( + WaitId::Pid(guard), + WaitIdOptions::EXITED | WaitIdOptions::NOWAIT, + ) { + Ok(_) => return, + Err(rustix::io::Errno::INTR) => continue, + Err(error) => panic!("cannot wait for the process guard: {error}"), + } + } + } + pub(super) fn stop(&mut self) -> Result { drop(self.controller.take()); let status = self.guard.wait()?; diff --git a/crates/registry-rstack-dev/src/products.rs b/crates/registry-rstack-dev/src/products.rs index caf5cdbd65..23351fb033 100644 --- a/crates/registry-rstack-dev/src/products.rs +++ b/crates/registry-rstack-dev/src/products.rs @@ -2128,6 +2128,9 @@ impl<'a> ProductRunner<'a> { return Ok(()); } if Instant::now() >= end { + // A child that exited during the last probe exited before the + // deadline was observed: report the exit, not a missed deadline. + self.ensure_alive(kind)?; return Err(operational(anyhow::anyhow!( "{} did not become ready{}", kind.name(), @@ -6986,6 +6989,63 @@ printf '%s' '{"ok":true,"explanation":{"deliveries":[{"destinationId":"declared" ); } + #[test] + fn an_exit_during_the_last_readiness_probe_is_reported_as_an_exit() { + use std::io::Write as _; + + let scratch = tempfile::tempdir().unwrap(); + let root = scratch.path().join("run"); + super::super::private_directory(&root).unwrap(); + let terminate = AtomicBool::new(false); + let mut runner = + ProductRunner::new(Arc::new(breg_input(false)), &root, &terminate).unwrap(); + + // The workload exits only once the readiness probe has connected. + let release = scratch.path().join("release"); + let mut command = guard::Command::new(&root, "breg", Path::new("/bin/sh")).unwrap(); + command.args([ + "-c", + &format!( + "while [ ! -e '{}' ]; do sleep 0.01; done", + release.display() + ), + ]); + let child = command.spawn().unwrap(); + let exited = child.guard_exit_waiter(); + runner + .children + .push((RuntimeKind::Product(Product::Breg), child)); + + // The probe is answered with a failure only after the child has exited, + // and the readiness deadline has already passed by then. + let listener = TcpListener::bind((Ipv4Addr::LOCALHOST, 0)).unwrap(); + let port = listener.local_addr().unwrap().port(); + let server = thread::spawn(move || { + let (mut stream, _) = listener.accept().unwrap(); + fs::write(&release, "").unwrap(); + exited(); + stream + .write_all(b"HTTP/1.1 503 Service Unavailable\r\ncontent-length: 0\r\nconnection: close\r\n\r\n") + .unwrap(); + }); + + let failed = runner + .ready( + RuntimeKind::Product(Product::Breg), + &format!("http://127.0.0.1:{port}"), + "/ready", + Duration::ZERO, + ) + .unwrap_err(); + server.join().unwrap(); + assert!( + failed + .to_string() + .starts_with("breg exited before readiness"), + "{failed:#}" + ); + } + #[test] fn missed_readiness_and_start_deadlines_are_operational() { let class = From 606af3975d10e5b93a779b3fd6dedaa65e51d622 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 16:34:01 +0000 Subject: [PATCH 50/55] fix(rstack-dev): declare Scheduling hook destinations in the owner facts runtime The runtime rstack dev renders for the owning tool's identity facts gave Scheduling no destinations.hooks, so schedulingctl refused any project with a URL observer as scheduling.runtime.unbound-hook-destination and no hooked Scheduling project could start. The facts runtime now declares one destination per observer destination the project names, built by the same helpers start uses to bind them to its signed hook sink. Signed-off-by: Jeremi Joslin --- crates/registry-rstack-dev/src/dev_facts.rs | 66 ++++++++++++++++ crates/registry-rstack-dev/src/products.rs | 88 ++++++++++++--------- 2 files changed, 117 insertions(+), 37 deletions(-) diff --git a/crates/registry-rstack-dev/src/dev_facts.rs b/crates/registry-rstack-dev/src/dev_facts.rs index 675cf38f3f..afb4da4022 100644 --- a/crates/registry-rstack-dev/src/dev_facts.rs +++ b/crates/registry-rstack-dev/src/dev_facts.rs @@ -670,6 +670,13 @@ fn runtime_for_facts( .remove("destination"); config["taskGrantStatus"] = json!("unchecked-final-fifteen-minutes"); config["retention"] = json!({}); + // The run binds each URL observer to its signed hook sink, so the + // facts runtime declares the same destinations as the run will. + for id in super::products::signed_hook_destinations(product, project)? { + let reference = format!("secret:file/{}-hook-{id}", product.name()); + config["destinations"]["hooks"][id.as_str()] = + super::products::signed_hook_destination("http://127.0.0.1:1", &id, &reference); + } } Product::Adapter => { let template = read_project_document(&project.join("runtime.example.yaml"))?; @@ -1248,6 +1255,65 @@ mod tests { } } + #[test] + fn scheduling_facts_declare_each_hook_destination_start_binds() { + let root = tempfile::tempdir().unwrap(); + let plan: ProductPlan = serde_json::from_value(json!({ + "product": "scheduling", "project": ".", "audience": "urn:scheduling", + })) + .unwrap(); + let facts = |scheduling: Value| { + std::fs::write( + root.path().join("scheduling.yaml"), + serde_json::to_vec(&scheduling).unwrap(), + ) + .unwrap(); + runtime_for_facts( + &plan, + root.path(), + root.path(), + &root.path().join("package"), + "https://issuer.example.test", + &BTreeSet::new(), + None, + ) + .unwrap() + }; + + let config = facts(json!({"hooks": { + "appointment-observer": {"handler": {"type": "url", "destinationId": "appointment-events"}}, + "cancellation-observer": {"handler": {"type": "url", "destinationId": "appointment-events"}}, + "reminder-observer": {"handler": {"type": "url", "destinationId": "reminder-events"}}, + }})); + let hooks = config["destinations"]["hooks"].as_object().unwrap(); + let bound = + super::super::products::signed_hook_destinations(Product::Scheduling, root.path()) + .unwrap(); + assert_eq!( + hooks.keys().map(String::as_str).collect::>(), + bound.iter().map(String::as_str).collect::>(), + ); + assert_eq!( + ["appointment-events", "reminder-events"] + .into_iter() + .collect::>(), + hooks.keys().map(String::as_str).collect::>(), + ); + for (id, destination) in hooks { + assert!(destination["url"] + .as_str() + .unwrap() + .ends_with(&format!("/events/{id}"))); + assert!(destination["hmacSha256KeyRef"] + .as_str() + .unwrap() + .starts_with("secret:file/")); + } + + let unhooked = facts(json!({"services": {}})); + assert!(unhooked.get("destinations").is_none(), "{unhooked}"); + } + #[test] fn evidence_facts_projection_uses_the_run_issuer_and_matching_claim_names() { let root = tempfile::tempdir().unwrap(); diff --git a/crates/registry-rstack-dev/src/products.rs b/crates/registry-rstack-dev/src/products.rs index 23351fb033..35fca0986d 100644 --- a/crates/registry-rstack-dev/src/products.rs +++ b/crates/registry-rstack-dev/src/products.rs @@ -284,6 +284,52 @@ fn node_warnings(node: &Path) -> Result> { Ok(warnings) } +/// The URL observer destinations the checked project declares. A development +/// run binds each to its signed hook sink, and the owner facts check declares +/// the same set, so the two runtime documents agree. +pub(super) fn signed_hook_destinations( + product: Product, + project: &Path, +) -> Result> { + use registry_platform_yaml::LocalId; + + let project_file = match product { + Product::Documents => "documents.yaml", + Product::Scheduling => "scheduling.yaml", + _ => return Ok(BTreeSet::new()), + }; + // The product has already validated and packaged the authored policy. + // Read only the URL destination names the development runtime must bind. + let document = authored_document(&project.join(project_file))?; + let hooks = match &document["hooks"] { + Value::Null => Vec::new(), + Value::Array(hooks) if product == Product::Documents => hooks.iter().collect(), + Value::Object(hooks) if product == Product::Scheduling => hooks.values().collect(), + _ => anyhow::bail!("unexpected observer hook inventory in the checked project"), + }; + hooks + .into_iter() + .filter(|hook| hook["handler"]["type"] == "url") + .map(|hook| { + let id = hook["handler"]["destinationId"] + .as_str() + .context("the URL observer must name a destination")?; + LocalId::new(id).context("invalid URL observer destination identifier")?; + Ok(id.to_owned()) + }) + .collect() +} + +/// The runtime destination of one URL observer bound to a signed hook sink. +pub(super) fn signed_hook_destination(origin: &str, id: &str, key_reference: &str) -> Value { + json!({ + "url": format!("{origin}/events/{id}"), + "hmacSha256KeyRef": key_reference, + "attemptTimeoutMilliseconds": 2000, + "maximumAttempts": 5, + }) +} + #[cfg(test)] fn preflight_application_with_node( root: &Path, @@ -1371,33 +1417,8 @@ impl<'a> ProductRunner<'a> { runtime: &mut Value, ) -> Result<()> { use registry_platform_crypto::delivery_signature::{DeliveryKey, DeliveryKeys}; - use registry_platform_yaml::LocalId; - let project_file = match product { - Product::Documents => "documents.yaml", - Product::Scheduling => "scheduling.yaml", - _ => return Ok(()), - }; - // The product has already validated and packaged the authored policy. - // Read only the URL destination names the development runtime must bind. - let document = authored_document(&project.join(project_file))?; - let hooks = match &document["hooks"] { - Value::Null => Vec::new(), - Value::Array(hooks) if product == Product::Documents => hooks.iter().collect(), - Value::Object(hooks) if product == Product::Scheduling => hooks.values().collect(), - _ => anyhow::bail!("unexpected observer hook inventory in the checked project"), - }; - let destinations = hooks - .into_iter() - .filter(|hook| hook["handler"]["type"] == "url") - .map(|hook| { - let id = hook["handler"]["destinationId"] - .as_str() - .context("the URL observer must name a destination")?; - LocalId::new(id).context("invalid URL observer destination identifier")?; - Ok::<_, anyhow::Error>(id) - }) - .collect::>>()?; + let destinations = signed_hook_destinations(product, project)?; if destinations.is_empty() { return Ok(()); } @@ -1408,25 +1429,18 @@ impl<'a> ProductRunner<'a> { let key = random_key_bytes()?; let reference = self.secret(&format!("{}-hook-{id}", product.name()), key.as_slice())?; - references.insert(id, reference); keys.insert( - id.to_owned(), + id.clone(), DeliveryKeys::new(DeliveryKey::new(key.as_slice())?, None)?, ); + references.insert(id, reference); } let sink = GatewayServer::start_signed_hooks(keys)?; let configs: serde_json::Map = references .into_iter() .map(|(id, reference)| { - ( - id.to_owned(), - json!({ - "url": format!("{}/events/{id}", sink.origin), - "hmacSha256KeyRef": reference, - "attemptTimeoutMilliseconds": 2000, - "maximumAttempts": 5, - }), - ) + let destination = signed_hook_destination(&sink.origin, &id, &reference); + (id, destination) }) .collect(); runtime["destinations"]["hooks"] = json!(configs); From b5eeadc717eb916f2b80e64dcb6da9d167e940f1 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 16:36:52 +0000 Subject: [PATCH 51/55] test(journeys): write the managed Scheduling plan in the v0.51 roles model rstack dev refuses a person's grants and a products list, so the managed Scheduling journey stopped at its own plan. The task agent now holds a reader role that the service inventory declares for Scheduling, and the plan names its products and audiences as mappings. The binding check reads the audience from the new place. Signed-off-by: Jeremi Joslin --- products/platform/journeys/own-provider.sh | 2 +- .../journeys/projects/composed_fixtures.py | 11 ++++++++--- products/platform/journeys/test_journey_tables.py | 14 ++++++++++---- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/products/platform/journeys/own-provider.sh b/products/platform/journeys/own-provider.sh index b78bda8c99..54bfa29d68 100755 --- a/products/platform/journeys/own-provider.sh +++ b/products/platform/journeys/own-provider.sh @@ -2888,7 +2888,7 @@ JSON jq -e --slurpfile plan "$bound_plan" ' $plan[0].externalScheduling.taskGrant as $binding | .authentication.oidc.issuers.main as $issuer | - $issuer.issuer == $plan[0].issuer and $issuer.audience == $plan[0].products[0].audience and + $issuer.issuer == $plan[0].issuer and $issuer.audience == $plan[0].audiences.scheduling and $issuer.allowedClients == [$binding.assertionClient] and $issuer.assertionIssuers == {($binding.assertionClient): [$binding.sourceIssuer]} and (.taskGrantStatus | type == "array" and length == 1) and diff --git a/products/platform/journeys/projects/composed_fixtures.py b/products/platform/journeys/projects/composed_fixtures.py index 5e1ab947c2..c501a2126d 100644 --- a/products/platform/journeys/projects/composed_fixtures.py +++ b/products/platform/journeys/projects/composed_fixtures.py @@ -783,15 +783,20 @@ def cmd_scheduling_managed_plan(args: argparse.Namespace) -> None: "apiVersion": "id.registrystack.org/formats/rstack/journeys/v1alpha1", "kind": "RStackJourneys", "journeys": [], }) + write_json(root / "service.yaml", { + "apiVersion": "id.registrystack.org/formats/rstack/service/v1alpha1", + "kind": "RStackService", + "roles": {"reader": {"actorKind": "service", "accessProfiles": {"scheduling": ["reads"]}}}, + }) write_json(root / "dev.yaml", { "apiVersion": "id.registrystack.org/formats/rstack/dev/v1alpha1", "kind": "RStackDev", "issuer": args.issuer, "externalJwksUri": args.jwks, - "products": [{"product": "scheduling", "project": ".", "audience": SCHEDULING_RESOURCE}], + "products": {"scheduling": {"path": "."}}, + "audiences": {"scheduling": SCHEDULING_RESOURCE}, "people": {"task-agent": { - "subject": args.agent_subject, "client": "task-agent", - "grants": {"scheduling": {"profile": "reader", "scopes": ["scheduling:read"]}}, + "subject": args.agent_subject, "client": "task-agent", "roles": ["reader"], }}, "journeyFile": "dev-journeys.yaml", "externalScheduling": {"taskGrant": { diff --git a/products/platform/journeys/test_journey_tables.py b/products/platform/journeys/test_journey_tables.py index 35c7697687..24fc980d49 100644 --- a/products/platform/journeys/test_journey_tables.py +++ b/products/platform/journeys/test_journey_tables.py @@ -1851,11 +1851,17 @@ def test_managed_scheduling_fixture_names_one_grant_and_live_status_client(self) subprocess.run(command, check=True, capture_output=True) plan = json.loads((project / "dev.yaml").read_text(encoding="utf-8")) self.assertEqual(plan["externalJwksUri"], jwks) - self.assertEqual(plan["products"], [{"product": "scheduling", "project": ".", - "audience": "urn:example:journey:scheduling"}]) + self.assertEqual(plan["products"], {"scheduling": {"path": "."}}) + self.assertEqual(plan["audiences"], {"scheduling": "urn:example:journey:scheduling"}) + # The task agent holds only the reader role, which the service + # inventory declares as Scheduling's read profile. self.assertEqual(plan["people"], {"task-agent": { - "subject": "fixture-agent", "client": "task-agent", - "grants": {"scheduling": {"profile": "reader", "scopes": ["scheduling:read"]}}, + "subject": "fixture-agent", "client": "task-agent", "roles": ["reader"], + }}) + service = json.loads((project / "service.yaml").read_text(encoding="utf-8")) + self.assertEqual(service["kind"], "RStackService") + self.assertEqual(service["roles"], {"reader": { + "actorKind": "service", "accessProfiles": {"scheduling": ["reads"]}, }}) self.assertEqual(plan["externalScheduling"], {"taskGrant": { "sourceIssuer": "https://casework.journey.example", "assertionClient": "task-agent", From d8cafa3935ef4981ed5448d73a17f6a95ddd8221 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 19:53:03 +0000 Subject: [PATCH 52/55] test(ci): check the classifier in repository checks Signed-off-by: Jeremi Joslin --- release/scripts/test_check_gates_inventory.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/release/scripts/test_check_gates_inventory.py b/release/scripts/test_check_gates_inventory.py index 464e85a702..9fa748ea33 100644 --- a/release/scripts/test_check_gates_inventory.py +++ b/release/scripts/test_check_gates_inventory.py @@ -357,7 +357,7 @@ def test_ci_classifier_and_its_tests_are_wired(self) -> None: self.workflow, ) workflow = yaml.safe_load(self.workflow) - steps = workflow["jobs"]["changes"]["steps"] + steps = workflow["jobs"]["repository-checks"]["steps"] selected = [step for step in steps if self.is_classifier_test(step)] self.assertEqual(len(selected), 1) self.assertTrue(self.classifier_tests_are_required(workflow)) @@ -382,17 +382,17 @@ def is_classifier_test(step: dict) -> bool: ] def classifier_tests_are_required(self, workflow: dict) -> bool: - changes = workflow["jobs"]["changes"] - defaults = workflow.get("defaults", {}).get("run", {}) | changes.get("defaults", {}).get("run", {}) + repository_checks = workflow["jobs"]["repository-checks"] + defaults = workflow.get("defaults", {}).get("run", {}) | repository_checks.get("defaults", {}).get("run", {}) return ( - changes.get("continue-on-error", False) is False - and changes.get("if", "success()") in ("success()", "${{ success() }}") + repository_checks.get("continue-on-error", False) is False + and repository_checks.get("if", "success()") in ("success()", "${{ success() }}") and any( self.is_classifier_test(step) and step.get("if", "success()") in ("success()", "${{ success() }}") and step.get("continue-on-error", False) is False and Path(step.get("working-directory", defaults.get("working-directory", "."))) == Path(".") - for step in changes["steps"] + for step in repository_checks["steps"] ) ) From fadf9fa1cea2f3205c1c5b9619d129ba1100571c Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 19:14:19 +0000 Subject: [PATCH 53/55] fix(breg): preserve ingestion pagination filters Signed-off-by: Jeremi Joslin --- clients/typescript/generate.ts | 8 ++-- clients/typescript/tests/generator.test.ts | 56 ++++++++++++++++++++++ 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/clients/typescript/generate.ts b/clients/typescript/generate.ts index 93fd6b4fc5..5139f788b7 100644 --- a/clients/typescript/generate.ts +++ b/clients/typescript/generate.ts @@ -168,6 +168,7 @@ const bregRoutes = [ 'review-completions', ] const bregRoute = new RegExp('^/v1/(?:' + bregRoutes.join('|') + ')$') +const bregIngestionRunList = new RegExp('^/v1/records/' + record + '/ingestion-runs$') // BReg leaves patch values open because they can target fields of different types. const bregPatchValue = new RegExp( @@ -826,10 +827,11 @@ export function generate(source: string, settings: Settings = {}): string { pageNames.add(name) const rest = requiredOptions ? 'options: Operations[' + quote(id) + ']["input"], cursor?: string' : 'options: Operations[' + quote(id) + ']["input"] = {}, cursor?: string' - // A BReg cursor carries the query, so a continuation sends only the access profile, - // where the route takes one, and the cursor. + // Record and external-view cursors carry the query. Ingestion cursors carry only + // the run ID, so ingestion continuations also send the selection and page size. const cursorOnly = cursorName === '$skiptoken' - || (breg && (path.startsWith('/v1/records/') || path.startsWith('/v1/external-views/'))) + || (breg && ((path.startsWith('/v1/records/') && !bregIngestionRunList.test(path)) + || path.startsWith('/v1/external-views/'))) const query = !cursorOnly ? '{ ...options.query, cursor }' : '{ ' + (parameterMap.has('query:accessProfile') ? 'accessProfile: options.query?.accessProfile, ' : '') + quote(cursorName) + ': cursor }' diff --git a/clients/typescript/tests/generator.test.ts b/clients/typescript/tests/generator.test.ts index 3d8798023a..fc8d51b2a0 100644 --- a/clients/typescript/tests/generator.test.ts +++ b/clients/typescript/tests/generator.test.ts @@ -639,6 +639,62 @@ test('BReg statistics continuation keeps the profile and effective limit', async assert.match(urls[1]!.search, /cursor=opaque%2B%2F%3D/u) }) +test('BReg ingestion continuations keep the selection and requested limit', async t => { + const path = '/v1/records/enrolments/ingestion-runs' + const page = { + type: 'object', + required: ['runs', 'hasMore', 'nextCursor'], + properties: { + runs: { type: 'array', items: { type: 'string' } }, + hasMore: { type: 'boolean' }, + nextCursor: { type: ['string', 'null'], format: 'uuid' }, + }, + } + const source = { + ...document({ type: 'string' }), + paths: { [path]: { get: { + operationId: 'enrolments.ingestion.listRuns', + 'x-registry-operation': 'ingestionListRuns', + parameters: [ + { in: 'query', name: 'accessProfile', schema: { type: 'string' } }, + { in: 'query', name: 'limit', schema: { type: 'integer', minimum: 1 } }, + { in: 'query', name: 'cursor', schema: { type: 'string', format: 'uuid' } }, + { in: 'query', name: 'status', schema: { type: 'string', enum: ['open', 'complete', 'cancelled', 'blocked'] } }, + { in: 'query', name: 'inputDigest', schema: { type: 'string', pattern: '^[0-9a-f]{64}$' } }, + ], + responses: { 200: { description: 'Ingestion runs', content: { 'application/json': { schema: page } } } }, + } } }, + } + const dir = realpathSync(mkdtempSync(join(tmpdir(), 'registry-ingestion-'))) + t.after(() => rmSync(dir, { recursive: true, force: true })) + const root = dirname(fileURLToPath(new URL('../generate.ts', import.meta.url))) + const file = join(dir, 'client.ts') + writeFileSync(file, generate(JSON.stringify(source), { + breg: true, coreImport: join(root, 'core.ts'), schemaImport: join(root, 'schema.ts'), + })) + const { Client } = await import(file) + const { Transport, allPages } = await import('../core.ts') + const urls: URL[] = [] + const nextCursor = '00000000-0000-4000-8000-000000000001' + const client = new Client(new Transport({ + baseUrl: 'https://registry.example/tenant', token: () => 'fixture', + fetch: async url => { + urls.push(new URL(String(url))) + const hasMore = urls.length === 1 + return Response.json({ runs: [hasMore ? 'first' : 'second'], hasMore, nextCursor: hasMore ? nextCursor : null }) + }, + })) + const inputDigest = 'a'.repeat(64) + const options = { query: { accessProfile: 'operator', status: 'complete', inputDigest, limit: 7 } } + const runs = await allPages(cursor => client.enrolments_ingestion_listRunsPage(options, cursor)) + assert.deepEqual(runs, ['first', 'second']) + assert.deepEqual(urls.map(url => url.pathname), ['/tenant' + path, '/tenant' + path]) + const query = { ...options.query, limit: '7' } + assert.deepEqual(urls.map(url => Object.fromEntries(url.searchParams)), [ + query, { ...query, cursor: nextCursor }, + ]) +}) + for (const status of ['200', '401', '403', 'default']) { test('refuses the empty refusal marker on ' + status, () => { const input = endpoint({ responses: { From 90d6b109dd18bf5f084946e3d76fb41734b48e04 Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 19:36:59 +0000 Subject: [PATCH 54/55] fix(preview): resume interrupted permit submissions Signed-off-by: Jeremi Joslin --- .../permit-review/web/public/index.html | 1 + .../permit-review/web/src/page.ts | 103 +++++++++++++----- .../scripts/test-service-previews.mjs | 98 +++++++++++++++++ 3 files changed, 177 insertions(+), 25 deletions(-) diff --git a/products/platform/examples/service-previews/permit-review/web/public/index.html b/products/platform/examples/service-previews/permit-review/web/public/index.html index b1f0960431..2e222aca03 100644 --- a/products/platform/examples/service-previews/permit-review/web/public/index.html +++ b/products/platform/examples/service-previews/permit-review/web/public/index.html @@ -39,6 +39,7 @@

Application under review

Outcome
Assessment
+

Decide a review task

diff --git a/products/platform/examples/service-previews/permit-review/web/src/page.ts b/products/platform/examples/service-previews/permit-review/web/src/page.ts index 69647d6e17..247dfeae2c 100644 --- a/products/platform/examples/service-previews/permit-review/web/src/page.ts +++ b/products/platform/examples/service-previews/permit-review/web/src/page.ts @@ -40,11 +40,41 @@ async function call(path: string, init: { method?: string; body?: unknown; heade const alert = element('error') const status = element('status') +type ApplicationAttempt = { + applicationKey: string + startKey: string + recordId?: string + startBody?: { workflow: string; workflowRevision: string; input: { applicationId: string } } +} + async function applicant() { element('applicant').hidden = false const form = element('application') + const submit = element('submit') + const retryStatus = element('retry-status') + // Editing the form and returning to the same details resumes the original attempt. + const attempts = new Map() + let submitting = false + let runId: string | undefined + + async function showRun(currentRunId: string) { + retryStatus.hidden = true + alert.textContent = '' + try { + await follow(currentRunId) + } catch { + alert.textContent = 'We could not check the review status. Try again.' + retryStatus.hidden = false + } + } + + retryStatus.addEventListener('click', () => { + if (runId && !retryStatus.hidden) void showRun(runId) + }) + form.addEventListener('submit', async (event) => { event.preventDefault() + if (submitting || runId !== undefined) return alert.textContent = '' const data = new FormData(form) const activity = text(data.get('activity'), 160) @@ -53,38 +83,60 @@ async function applicant() { alert.textContent = 'Enter an activity and a site within the stated limits.' return } - element('submit').disabled = true - status.textContent = 'Submitting the application.' + + const input = { activity, site } + const submission = JSON.stringify(input) + let attempt = attempts.get(submission) + if (!attempt) { + attempt = { applicationKey: crypto.randomUUID(), startKey: crypto.randomUUID() } + attempts.set(submission, attempt) + } + submitting = true + submit.disabled = true try { - const submitted = await call('/registry/permits/v1/actions/submit-application', { - method: 'POST', headers: { 'Idempotency-Key': crypto.randomUUID() }, - body: { input: { activity, site } }, - }) - const recordId = field(submitted.body, 'results', 'application', 'recordId') - if (submitted.status !== 200 || typeof recordId !== 'string') throw new Error('submit') - element('application-id').textContent = recordId - - const contract = await call('/registry/permit-flow/v1/workflows/permit-flow') - const workflowRevision = field(contract.body, 'workflowRevision') - if (contract.status !== 200 || typeof workflowRevision !== 'string') throw new Error('workflow') - // The run names only the application. The Coordinator reads it under - // its own profile and reviews and decides only what it read. + if (attempt.recordId === undefined) { + status.textContent = 'Submitting the application.' + const submitted = await call('/registry/permits/v1/actions/submit-application', { + method: 'POST', headers: { 'Idempotency-Key': attempt.applicationKey }, + body: { input }, + }) + const recordId = field(submitted.body, 'results', 'application', 'recordId') + if (submitted.status !== 200 || typeof recordId !== 'string' || !recordId) throw new Error('submit') + attempt.recordId = recordId + } + + status.textContent = 'Starting the review.' + // A retry after an ambiguous start must replay the selected revision. + if (attempt.startBody === undefined) { + const contract = await call('/registry/permit-flow/v1/workflows/permit-flow') + const workflowRevision = field(contract.body, 'workflowRevision') + if (contract.status !== 200 || typeof workflowRevision !== 'string' || !workflowRevision) throw new Error('workflow') + // The run names only the application. The Coordinator reads it under + // its own profile and reviews and decides only what it read. + attempt.startBody = { workflow: 'permit-flow', workflowRevision, input: { applicationId: attempt.recordId } } + } const started = await call('/registry/permit-flow/v1/runs', { - method: 'POST', headers: { 'Idempotency-Key': crypto.randomUUID() }, - body: { workflow: 'permit-flow', workflowRevision, input: { applicationId: recordId } }, + method: 'POST', headers: { 'Idempotency-Key': attempt.startKey }, body: attempt.startBody, }) - const runId = field(started.body, 'runId') - if (started.status !== 200 || typeof runId !== 'string') throw new Error('start') + const startedRunId = field(started.body, 'runId') + if (started.status !== 200 || typeof startedRunId !== 'string' || !startedRunId) throw new Error('start') + runId = startedRunId + + element('application-id').textContent = attempt.recordId element('run-id').textContent = runId element('submitted').hidden = false form.hidden = true - status.textContent = '' - await follow(runId) + attempts.clear() } catch { - alert.textContent = 'We could not submit the application and start its review.' + alert.textContent = attempt.recordId === undefined + ? 'We could not confirm the application submission. Submit the same details to retry.' + : 'We could not confirm the review started. Submit the same details to retry the review.' + } finally { status.textContent = '' - element('submit').disabled = false + submitting = false + submit.disabled = runId !== undefined } + if (runId !== undefined) await showRun(runId) }) // The applicant's own attempt to decide: Casework, not the page, refuses it. @@ -107,10 +159,11 @@ async function follow(runId: string) { for (;;) { const run = await call('/registry/permit-flow/v1/runs/' + runId) const state = field(run.body, 'state') + if (run.status !== 200 || typeof state !== 'string' || !state) throw new Error('poll') element('run-step').textContent = String(field(run.body, 'step') ?? '') - element('run-state').textContent = String(state ?? '') + element('run-state').textContent = state // Every state but these two is terminal or needs an operator. - if (typeof state === 'string' && state !== 'running' && state !== 'cancel-requested') { + if (state !== 'running' && state !== 'cancel-requested') { element('run-outcome').textContent = String(field(run.body, 'outcome') ?? '') element('run-assessment').textContent = String(field(run.body, 'output', 'assessment') ?? '') return diff --git a/products/platform/scripts/test-service-previews.mjs b/products/platform/scripts/test-service-previews.mjs index 9d4e2ce9ae..5b6fd12213 100644 --- a/products/platform/scripts/test-service-previews.mjs +++ b/products/platform/scripts/test-service-previews.mjs @@ -211,6 +211,98 @@ async function actorCall(origin, path, init = {}) { return { status: response.status, body: await response.json().catch(() => null) } } +async function permitRetry(page, applicantUrl) { + const calls = { application: [], workflow: [], start: [], poll: [] } + const route = (path, stage, respond) => page.route('**/registry/' + path, async requestRoute => { + const request = requestRoute.request() + const headers = await request.allHeaders() + assert.equal(headers.authorization, undefined) + assert.equal(headers['registry-client'], 'page') + calls[stage].push({ key: headers['idempotency-key'], body: request.postData() }) + await respond(requestRoute, calls[stage].length) + }) + let releaseApplication + const applicationPending = new Promise(resolve => { releaseApplication = resolve }) + await route('permits/v1/actions/submit-application', 'application', async (r, count) => { + if (count === 3) await applicationPending + if (count <= 2) await r.abort() + else await r.fulfill({ json: { results: { application: { recordId: 'application-1' } } } }) + }) + await route('permit-flow/v1/workflows/permit-flow', 'workflow', (r, count) => + count <= 2 ? r.fulfill({ status: 503 }) : r.fulfill({ json: { workflowRevision: 'revision-' + count } })) + await route('permit-flow/v1/runs', 'start', (r, count) => + count <= 2 ? r.abort() : r.fulfill({ json: { runId: 'run-1' } })) + await route('permit-flow/v1/runs/run-1', 'poll', (r, count) => { + if (count === 1) return r.abort() + if (count === 2) return r.fulfill({ status: 503, json: { state: 'finished' } }) + if (count === 3) return r.fulfill({ json: {} }) + return r.fulfill({ json: { state: 'finished', step: 'record', outcome: 'approved', output: { assessment: 'standard' } } }) + }) + + await page.goto(applicantUrl.href) + await page.getByLabel('Activity').fill('Evening survey') + await page.getByLabel('Site').fill('South road') + const submit = page.getByRole('button', { name: 'Submit application' }) + const error = page.locator('#error') + const waitForError = () => error.filter({ hasText: /could not/i }).waitFor() + await submit.click() + await waitForError() + await page.getByLabel('Activity').fill(' Evening survey ') + await submit.click() + await waitForError() + assert.equal(calls.application[1].key, calls.application[0].key, 'Application retry changed the attempt key.') + + try { + await Promise.all([ + page.waitForRequest('**/registry/permits/v1/actions/submit-application'), + submit.click(), + ]) + // Synthetic submit events can bypass a disabled button. + await page.locator('#application').dispatchEvent('submit') + } finally { + releaseApplication() + } + await waitForError() + for (let retry = 0; retry < 3; retry++) { + await submit.click() + await waitForError() + } + assert.equal(calls.application.length, 3) + assert.match(calls.application[0].key, uuid) + assert.ok(calls.application.every(call => call.key === calls.application[0].key && call.body === calls.application[0].body)) + assert.deepEqual(JSON.parse(calls.application[0].body), { input: { activity: 'Evening survey', site: 'South road' } }) + assert.equal(calls.workflow.length, 3) + assert.equal(calls.start.length, 2) + + await submit.click() + await page.getByRole('heading', { name: 'Application under review' }).waitFor() + await waitForError() + assert.equal(await page.locator('#application-id').textContent(), 'application-1') + assert.equal(await page.locator('#run-id').textContent(), 'run-1') + await page.locator('#application').dispatchEvent('submit') + const refresh = page.getByRole('button', { name: 'Retry status' }) + for (let retry = 0; retry < 2; retry++) { + await refresh.click() + await waitForError() + } + await refresh.click() + await page.locator('#run-outcome').getByText('approved', { exact: true }).waitFor() + assert.equal(await error.textContent(), '') + assert.equal(await page.locator('#run-assessment').textContent(), 'standard') + assert.equal(await submit.isVisible(), false) + assert.equal(await refresh.isVisible(), false) + assert.equal(calls.application.length, 3) + assert.equal(calls.workflow.length, 3) + assert.equal(calls.start.length, 3) + assert.match(calls.start[0].key, uuid) + assert.notEqual(calls.start[0].key, calls.application[0].key) + assert.ok(calls.start.every(call => call.key === calls.start[0].key && call.body === calls.start[0].body)) + assert.deepEqual(JSON.parse(calls.start[0].body), { + workflow: 'permit-flow', workflowRevision: 'revision-3', input: { applicationId: 'application-1' }, + }) + assert.equal(calls.poll.length, 4) +} + // The applicant and the officer on two browser contexts, each on its own // actor origin over the same built page. The applicant starts a Coordinator // run that names only its application; the Coordinator reads it, Casework @@ -253,6 +345,12 @@ async function permitReview(browser, url, report) { }) return { context, page } } + const retry = await open() + try { + await permitRetry(retry.page, applicantUrl) + } finally { + await retry.context.close() + } const applicant = await open() const officer = await open() const submit = async (activity, site) => { From 72e81931481184a9a626d978e8398140b0e0b54e Mon Sep 17 00:00:00 2001 From: Jeremi Joslin Date: Wed, 2 Dec 2026 20:13:45 +0000 Subject: [PATCH 55/55] test(preview): verify request headers before closing Chromium contexts Signed-off-by: Jeremi Joslin --- .../scripts/test-service-previews.mjs | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/products/platform/scripts/test-service-previews.mjs b/products/platform/scripts/test-service-previews.mjs index 5b6fd12213..1350a80d32 100644 --- a/products/platform/scripts/test-service-previews.mjs +++ b/products/platform/scripts/test-service-previews.mjs @@ -333,8 +333,8 @@ async function permitReview(browser, url, report) { assert.equal(neighbourApplication?.domainData.status, 'submitted') const errors = [] - const requests = [] const open = async () => { + const requests = [] const context = await browser.newContext({ viewport: { width: 390, height: 900 } }) const page = await context.newPage() page.setDefaultTimeout(8_000) @@ -343,11 +343,22 @@ async function permitReview(browser, url, report) { const path = new URL(request.url()).pathname if (path.startsWith('/registry/') || path.startsWith('/_rstack/actor')) requests.push(request) }) - return { context, page } + return { context, page, requests } + } + async function checkHeaders(requests) { + for (const request of requests) { + const headers = await request.allHeaders() + assert.equal(Boolean(headers.authorization), false, 'The browser sent an Authorization header.') + assert.equal(headers['registry-client'], 'page') + } } const retry = await open() try { await permitRetry(retry.page, applicantUrl) + assert.ok(retry.requests.some(request => new URL(request.url()).pathname === '/_rstack/actor')) + assert.ok(retry.requests.some(request => new URL(request.url()).pathname.startsWith('/registry/permit-flow/'))) + // Playwright needs the owning context to read full request headers. + await checkHeaders(retry.requests) } finally { await retry.context.close() } @@ -481,13 +492,10 @@ async function permitReview(browser, url, report) { assert.deepEqual([untouched.activity, untouched.status], ['Night works', 'submitted']) assert.deepEqual(errors, []) + const requests = [...applicant.requests, ...officer.requests] assert.ok(requests.some(request => new URL(request.url()).pathname.startsWith('/registry/casework/'))) assert.ok(requests.some(request => new URL(request.url()).pathname.startsWith('/registry/permit-flow/'))) - for (const request of requests) { - const headers = await request.allHeaders() - assert.equal(Boolean(headers.authorization), false, 'The browser sent an Authorization header.') - assert.equal(headers['registry-client'], 'page') - } + await checkHeaders(requests) return { actors: 3, identicalPages: true, applicantDecisionStatus: 403, forgedCompletionStatus: 401, foreignRunStatus: 404, contentStartRefused: true, outcome: 'approved', assessment: 'conditions', registerStatus: 'approved',
CodeConfiguration keySetting ConditionProduction remedyProduction remedyWhere
{code}{key}{condition}{remedy}{row.code}{row.key}{sentence(row.condition)}{'remedy' in row ? row.remedy : ''}{row.crates.map((crate, index) => <>{index > 0 && ', '}{crate})}