From 780de1c7e3b76e02f43f0a594991e3cf7fe874f8 Mon Sep 17 00:00:00 2001 From: Andrew Peris Date: Sat, 31 Oct 2026 09:50:36 -0400 Subject: [PATCH] feat: add unreleased no-output build-result candidate --- CHANGELOG.md | 7 + CONSTITUTION_CONFORMANCE.md | 13 + ...mic-build-result-v1.1-candidate-cases.json | 151 ++ .../comic-build-result-v1.1-candidate.json | 293 ++++ rfcs/0012-no-output-failed-build-results.md | 10 + .../v1.1/comic-build-result.schema.json | 1413 +++++++++++++++++ specs/comic-build-result-1.1-candidate.md | 81 + tests/comic-result-candidate.test.cjs | 28 + 8 files changed, 1996 insertions(+) create mode 100644 fixtures/comic-build-result-v1.1-candidate-cases.json create mode 100644 fixtures/comic-build-result-v1.1-candidate.json create mode 100644 schemas/json/comic-manifest/v1.1/comic-build-result.schema.json create mode 100644 specs/comic-build-result-1.1-candidate.md create mode 100644 tests/comic-result-candidate.test.cjs diff --git a/CHANGELOG.md b/CHANGELOG.md index b2a4aba..6cefd33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## Local candidate — 2026-10-31 + +Add an opt-in Comic build result 1.1.0 candidate for confirmed no-output +rate-limit failures and bounded synthetic retry conformance. Released v1 +artifacts and default behavior are preserved. No publication or production +adoption is declared. + ## Unreleased — Context Builder publication preparation (#86) - Add an explicit independent release catalog, deterministic artifact tests and diff --git a/CONSTITUTION_CONFORMANCE.md b/CONSTITUTION_CONFORMANCE.md index 41c1301..1d7dcfa 100644 --- a/CONSTITUTION_CONFORMANCE.md +++ b/CONSTITUTION_CONFORMANCE.md @@ -1,5 +1,18 @@ # Constitution conformance record +## O02/O03 local retry candidate — 2026-10-31 + +Owner/reviewer: @andrewperis. Constitution 1.0.0 at +`a9cc8a503aa30e17820edc62ac95f7cbe10e0564`. Profiles: universal, +RFC/specification and runtime implementation. Bounded synthetic, in-memory-only +rate-limit retry candidate; exact version negotiation, actual provenance, +protected outcome evidence, immutable terminal readback, original budgets and +explicit caller authority. No new dependencies, private data, creative work or +exception. Tests and candidate decision documents provide technical evidence; +owner normative acceptance, production adoption and publication remain pending. +Released v1 artifacts remain unchanged. Re-review on any provider, storage, +identity, authority, retention or scope expansion. + ## Stable record ID proposal — 2026-10-24 Owner and required decision reviewer: @andrewperis. Constitution 1.0.0 at diff --git a/fixtures/comic-build-result-v1.1-candidate-cases.json b/fixtures/comic-build-result-v1.1-candidate-cases.json new file mode 100644 index 0000000..a634984 --- /dev/null +++ b/fixtures/comic-build-result-v1.1-candidate-cases.json @@ -0,0 +1,151 @@ +[ + { + "name": "complete cannot have no output", + "path": [ + "status" + ], + "value": "complete" + }, + { + "name": "partial cannot have no output", + "path": [ + "status" + ], + "value": "partial" + }, + { + "name": "diagnostic []", + "path": [ + "diagnostics" + ], + "value": [] + }, + { + "name": "diagnostic ['CANCELLED']", + "path": [ + "diagnostics" + ], + "value": [ + "CANCELLED" + ] + }, + { + "name": "diagnostic ['VALIDATION_FAILED']", + "path": [ + "diagnostics" + ], + "value": [ + "VALIDATION_FAILED" + ] + }, + { + "name": "diagnostic ['OUTPUT_MISSING', 'CANCELLED']", + "path": [ + "diagnostics" + ], + "value": [ + "OUTPUT_MISSING", + "CANCELLED" + ] + }, + { + "name": "input_digests", + "path": [ + "execution", + "transformations", + 0, + "input_digests" + ], + "value": [] + }, + { + "name": "private_inputs_withheld", + "path": [ + "execution", + "transformations", + 0, + "private_inputs_withheld" + ], + "value": true + }, + { + "name": "private_outputs_withheld", + "path": [ + "execution", + "transformations", + 0, + "private_outputs_withheld" + ], + "value": true + }, + { + "name": "missing transformation", + "path": [ + "execution", + "transformations" + ], + "value": [] + }, + { + "name": "multiple transformations", + "path": [ + "execution", + "transformations" + ], + "value": [ + { + "step_id": "mock", + "input_digests": [ + "sha256:a8198524f58e72b56283ab71ebddada22840f108b46ef7165bb3fca9919c5558", + "sha256:7d127a76b06a3db563f2935dc0f0d03efa2fcb5d8fe4a13492860497ee6b9064" + ], + "output_digests": [], + "private_inputs_withheld": false, + "private_outputs_withheld": false + }, + { + "step_id": "second", + "input_digests": [ + "sha256:a8198524f58e72b56283ab71ebddada22840f108b46ef7165bb3fca9919c5558", + "sha256:7d127a76b06a3db563f2935dc0f0d03efa2fcb5d8fe4a13492860497ee6b9064" + ], + "output_digests": [], + "private_inputs_withheld": false, + "private_outputs_withheld": false + } + ] + }, + { + "name": "produced output", + "path": [ + "outputs" + ], + "value": [ + { + "rendition_id": "transcript", + "artifact": { + "artifact_uri": "https://example.invalid/synthetic/transcript.txt", + "media_type": "text/plain", + "byte_size": 36, + "sha256": "sha256:5aa128a0dd0945b00ba3d71a5f7b5916e06f40c53048c31d74432eb03f4e764d" + }, + "dimensions": null, + "rights_notice": "Synthetic conformance fixture; Apache-2.0.", + "alt_text": "A blue cube, followed by a red sphere.", + "transcript": "Panel 1: A cube.\nPanel 2: A sphere.", + "profile": { + "profile_id": "comic-accessible-transcript", + "profile_version": "1.0.0" + }, + "max_bytes": 131072 + } + ] + }, + { + "name": "unsupported exact version", + "path": [ + "spec_version" + ], + "value": "1.2.0" + } +] diff --git a/fixtures/comic-build-result-v1.1-candidate.json b/fixtures/comic-build-result-v1.1-candidate.json new file mode 100644 index 0000000..eac404e --- /dev/null +++ b/fixtures/comic-build-result-v1.1-candidate.json @@ -0,0 +1,293 @@ +{ + "production": { + "kind": "comic-production", + "spec_version": "1.0.0", + "production_id": "urn:uuid:10000000-0000-4000-8000-000000000001", + "revision": 1, + "previous": null, + "classification": "internal", + "title": "Synthetic Shapes", + "intent": "Offline conformance only; no Studio canon.", + "inputs": { + "canon": { + "repository": "synthetic/canon", + "version": "1.0.0", + "tag": "canon/v1.0.0", + "commit": "1111111111111111111111111111111111111111", + "artifact": { + "artifact_uri": "https://example.invalid/synthetic/canon", + "media_type": "application/json", + "byte_size": 18, + "sha256": "sha256:a8198524f58e72b56283ab71ebddada22840f108b46ef7165bb3fca9919c5558" + } + }, + "dependencies": [ + { + "repository": "synthetic/mock-tool", + "version": "1.0.0", + "tag": "mock-tool/v1.0.0", + "commit": "1111111111111111111111111111111111111111", + "artifact": { + "artifact_uri": "https://example.invalid/synthetic/mock-tool", + "media_type": "application/json", + "byte_size": 22, + "sha256": "sha256:b5b94381f12f81d18bc1fc6fed0b04254162f21361e4d999ab356cc14cc464cf" + } + }, + { + "repository": "synthetic/comic-manifest", + "version": "1.0.0", + "tag": "comic-manifest/v1.0.0", + "commit": "1111111111111111111111111111111111111111", + "artifact": { + "artifact_uri": "https://example.invalid/synthetic/comic-manifest", + "media_type": "application/json", + "byte_size": 29, + "sha256": "sha256:836b922aa06e1e4759a9ee86412b96b8502bfe992092a10bfc08d97e390ffa47" + } + } + ], + "prompts": [ + { + "binding_id": "description", + "definition": { + "repository": "synthetic/prompt", + "version": "1.0.0", + "tag": "prompt/v1.0.0", + "commit": "1111111111111111111111111111111111111111", + "artifact": { + "artifact_uri": "https://example.invalid/synthetic/prompt", + "media_type": "application/json", + "byte_size": 2629, + "sha256": "sha256:7d127a76b06a3db563f2935dc0f0d03efa2fcb5d8fe4a13492860497ee6b9064" + } + }, + "prompt_id": "prompt.reference.context-builder", + "prompt_version": "1.0.0", + "identity": { + "canonicalization": "studio-json-v1", + "byte_size": 2629, + "sha256": "sha256:7d127a76b06a3db563f2935dc0f0d03efa2fcb5d8fe4a13492860497ee6b9064" + }, + "context": { + "contract_version": "1.0.0", + "package_id": "context-package.reference.builder", + "package_version": "1.0.0", + "instance_id": "urn:uuid:00000000-0000-4000-8000-000000000064", + "manifest_identity": { + "canonicalization": "studio-json-v1", + "byte_size": 1769, + "sha256": "sha256:a287bcbe601550c2a4df68b296c64d622591fc91aa5713e8ea6e2e6119f04eab" + }, + "classification": "internal", + "purpose": "Prepare synthetic context for contract conformance.", + "sections": [ + "approved_notes", + "context_facts" + ], + "builder_result_identity": { + "canonicalization": "studio-json-v1", + "byte_size": 2848, + "sha256": "sha256:729ce7ad380821185cecb4166e6bdd681048097450aa9256505f18c3dafa48b4" + }, + "preparation_reference": "urn:uuid:00000000-0000-4000-8000-000000000063", + "use_authorization_reference": "urn:uuid:00000000-0000-4000-8000-000000000071" + } + } + ], + "assets": [] + }, + "panels": [ + { + "panel_id": "first", + "description": "A synthetic blue cube.", + "text": [ + { + "text_id": "caption-one", + "kind": "caption", + "speaker": null, + "text": "A cube." + } + ], + "asset_ids": [], + "prompt_bindings": [ + "description" + ] + }, + { + "panel_id": "second", + "description": "A synthetic red sphere.", + "text": [ + { + "text_id": "caption-two", + "kind": "caption", + "speaker": null, + "text": "A sphere." + } + ], + "asset_ids": [], + "prompt_bindings": [] + } + ], + "renditions": [ + { + "rendition_id": "transcript", + "required": true, + "media_type": "text/plain", + "dimensions": null, + "alt_text": "A blue cube, followed by a red sphere.", + "transcript": "Panel 1: A cube.\nPanel 2: A sphere.", + "rights_notice": "Synthetic conformance fixture; Apache-2.0.", + "profile": { + "profile_id": "comic-accessible-transcript", + "profile_version": "1.0.0" + }, + "max_bytes": 131072 + } + ] + }, + "result": { + "kind": "comic-build-result", + "spec_version": "1.1.0", + "result_id": "urn:uuid:10000000-0000-4000-8000-000000000002", + "attempt_id": "urn:uuid:10000000-0000-4000-8000-000000000003", + "production": { + "production_id": "urn:uuid:10000000-0000-4000-8000-000000000001", + "revision": 1, + "identity": { + "canonicalization": "studio-json-v1", + "byte_size": 3459, + "sha256": "sha256:9250217ad23125b0356a9e7002f57a55dacf9d982f069caa403b89f8c6c234dc" + } + }, + "classification": "internal", + "inputs": { + "canon": { + "repository": "synthetic/canon", + "version": "1.0.0", + "tag": "canon/v1.0.0", + "commit": "1111111111111111111111111111111111111111", + "artifact": { + "artifact_uri": "https://example.invalid/synthetic/canon", + "media_type": "application/json", + "byte_size": 18, + "sha256": "sha256:a8198524f58e72b56283ab71ebddada22840f108b46ef7165bb3fca9919c5558" + } + }, + "dependencies": [ + { + "repository": "synthetic/mock-tool", + "version": "1.0.0", + "tag": "mock-tool/v1.0.0", + "commit": "1111111111111111111111111111111111111111", + "artifact": { + "artifact_uri": "https://example.invalid/synthetic/mock-tool", + "media_type": "application/json", + "byte_size": 22, + "sha256": "sha256:b5b94381f12f81d18bc1fc6fed0b04254162f21361e4d999ab356cc14cc464cf" + } + }, + { + "repository": "synthetic/comic-manifest", + "version": "1.0.0", + "tag": "comic-manifest/v1.0.0", + "commit": "1111111111111111111111111111111111111111", + "artifact": { + "artifact_uri": "https://example.invalid/synthetic/comic-manifest", + "media_type": "application/json", + "byte_size": 29, + "sha256": "sha256:836b922aa06e1e4759a9ee86412b96b8502bfe992092a10bfc08d97e390ffa47" + } + } + ], + "prompts": [ + { + "binding_id": "description", + "definition": { + "repository": "synthetic/prompt", + "version": "1.0.0", + "tag": "prompt/v1.0.0", + "commit": "1111111111111111111111111111111111111111", + "artifact": { + "artifact_uri": "https://example.invalid/synthetic/prompt", + "media_type": "application/json", + "byte_size": 2629, + "sha256": "sha256:7d127a76b06a3db563f2935dc0f0d03efa2fcb5d8fe4a13492860497ee6b9064" + } + }, + "prompt_id": "prompt.reference.context-builder", + "prompt_version": "1.0.0", + "identity": { + "canonicalization": "studio-json-v1", + "byte_size": 2629, + "sha256": "sha256:7d127a76b06a3db563f2935dc0f0d03efa2fcb5d8fe4a13492860497ee6b9064" + }, + "context": { + "contract_version": "1.0.0", + "package_id": "context-package.reference.builder", + "package_version": "1.0.0", + "instance_id": "urn:uuid:00000000-0000-4000-8000-000000000064", + "manifest_identity": { + "canonicalization": "studio-json-v1", + "byte_size": 1769, + "sha256": "sha256:a287bcbe601550c2a4df68b296c64d622591fc91aa5713e8ea6e2e6119f04eab" + }, + "classification": "internal", + "purpose": "Prepare synthetic context for contract conformance.", + "sections": [ + "approved_notes", + "context_facts" + ], + "builder_result_identity": { + "canonicalization": "studio-json-v1", + "byte_size": 2848, + "sha256": "sha256:729ce7ad380821185cecb4166e6bdd681048097450aa9256505f18c3dafa48b4" + }, + "preparation_reference": "urn:uuid:00000000-0000-4000-8000-000000000063", + "use_authorization_reference": "urn:uuid:00000000-0000-4000-8000-000000000071" + } + } + ], + "assets": [] + }, + "status": "failed", + "outputs": [], + "gates": [], + "execution": { + "tool": { + "repository": "synthetic/mock-tool", + "version": "1.0.0", + "tag": "mock-tool/v1.0.0", + "commit": "1111111111111111111111111111111111111111", + "artifact": { + "artifact_uri": "https://example.invalid/synthetic/mock-tool", + "media_type": "application/json", + "byte_size": 22, + "sha256": "sha256:b5b94381f12f81d18bc1fc6fed0b04254162f21361e4d999ab356cc14cc464cf" + } + }, + "workflow_id": "synthetic-offline", + "run_uri": null, + "started_at": "2026-09-15T12:00:00Z", + "finished_at": "2026-09-15T12:00:01Z", + "transformations": [ + { + "step_id": "mock", + "input_digests": [ + "sha256:a8198524f58e72b56283ab71ebddada22840f108b46ef7165bb3fca9919c5558", + "sha256:7d127a76b06a3db563f2935dc0f0d03efa2fcb5d8fe4a13492860497ee6b9064" + ], + "output_digests": [], + "private_inputs_withheld": false, + "private_outputs_withheld": false + } + ], + "generation": [], + "reproducibility": "exact", + "limitations": "Fixed synthetic text only; no external generation." + }, + "diagnostics": [ + "OUTPUT_MISSING" + ] + } +} diff --git a/rfcs/0012-no-output-failed-build-results.md b/rfcs/0012-no-output-failed-build-results.md index 14764c1..b5ede53 100644 --- a/rfcs/0012-no-output-failed-build-results.md +++ b/rfcs/0012-no-output-failed-build-results.md @@ -14,6 +14,16 @@ - Conformance evidence: [Studio issue #103](https://github.com/DefinitelySecureStudio/studio/issues/103), [Studio issue #104](https://github.com/DefinitelySecureStudio/studio/issues/104), and finite synthetic fixtures proposed below - Decision owner and required A4 reviewers: `@andrewperis`; Codex and Platform maintainers +## Local implementation candidate — 2026-10-31 + +The authorized bounded implementation now selects result version 1.1.0 and +a distinct result-only schema, excluding cancellation. See the +[candidate decision and lifecycle](../specs/comic-build-result-1.1-candidate.md) +for the exact technical choices and executed-fixture scope. The original +proposal below records the earlier alternatives; its undecided wording is +historical to that proposal. Normative acceptance, publication and production +adoption remain separate review gates. + ## Summary This draft proposes one narrowly versioned `comic-build-result` representation diff --git a/schemas/json/comic-manifest/v1.1/comic-build-result.schema.json b/schemas/json/comic-manifest/v1.1/comic-build-result.schema.json new file mode 100644 index 0000000..554f5e1 --- /dev/null +++ b/schemas/json/comic-manifest/v1.1/comic-build-result.schema.json @@ -0,0 +1,1413 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "urn:definitely-secure:contract:comic-manifest:1.1.0:comic-build-result", + "title": "Comic build result 1.1.0 candidate (unreleased)", + "$defs": { + "uuid": { + "type": "string", + "pattern": "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + }, + "digest": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + }, + "name": { + "type": "string", + "pattern": "^[a-z][a-z0-9-]{0,63}$" + }, + "time": { + "type": "string", + "format": "date-time", + "pattern": "Z$", + "maxLength": 32 + }, + "size": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "revision": { + "type": "integer", + "minimum": 1, + "maximum": 9007199254740991 + }, + "classification": { + "enum": [ + "public", + "internal", + "confidential", + "restricted" + ] + }, + "uri": { + "type": "string", + "format": "uri", + "pattern": "^https://", + "maxLength": 2048 + }, + "identity": { + "type": "object", + "additionalProperties": false, + "required": [ + "canonicalization", + "byte_size", + "sha256" + ], + "properties": { + "canonicalization": { + "const": "studio-json-v1" + }, + "byte_size": { + "$ref": "#/$defs/size" + }, + "sha256": { + "$ref": "#/$defs/digest" + } + } + }, + "artifact": { + "type": "object", + "additionalProperties": false, + "required": [ + "artifact_uri", + "media_type", + "byte_size", + "sha256" + ], + "properties": { + "artifact_uri": { + "$ref": "#/$defs/uri" + }, + "media_type": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "byte_size": { + "$ref": "#/$defs/size" + }, + "sha256": { + "$ref": "#/$defs/digest" + } + } + }, + "dependency": { + "type": "object", + "additionalProperties": false, + "required": [ + "repository", + "version", + "tag", + "commit", + "artifact" + ], + "properties": { + "repository": { + "type": "string", + "pattern": "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$", + "maxLength": 200 + }, + "version": { + "type": "string", + "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" + }, + "tag": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "commit": { + "type": "string", + "pattern": "^[0-9a-f]{40}$" + }, + "artifact": { + "$ref": "#/$defs/artifact" + } + } + }, + "productionRef": { + "type": "object", + "additionalProperties": false, + "required": [ + "production_id", + "revision", + "identity" + ], + "properties": { + "production_id": { + "$ref": "#/$defs/uuid" + }, + "revision": { + "$ref": "#/$defs/revision" + }, + "identity": { + "$ref": "#/$defs/identity" + } + } + }, + "releaseRef": { + "type": "object", + "additionalProperties": false, + "required": [ + "release_id", + "episode_id", + "revision", + "identity" + ], + "properties": { + "release_id": { + "$ref": "#/$defs/uuid" + }, + "episode_id": { + "type": "string", + "pattern": "^DS-(?!0000)[0-9]{4}$" + }, + "revision": { + "$ref": "#/$defs/revision" + }, + "identity": { + "$ref": "#/$defs/identity" + } + } + }, + "context": { + "type": "object", + "additionalProperties": false, + "required": [ + "contract_version", + "package_id", + "package_version", + "instance_id", + "manifest_identity", + "classification", + "purpose", + "sections", + "builder_result_identity", + "preparation_reference", + "use_authorization_reference" + ], + "properties": { + "contract_version": { + "const": "1.0.0" + }, + "package_id": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "package_version": { + "type": "string", + "minLength": 1, + "maxLength": 32 + }, + "instance_id": { + "$ref": "#/$defs/uuid" + }, + "manifest_identity": { + "$ref": "#/$defs/identity" + }, + "classification": { + "$ref": "#/$defs/classification" + }, + "purpose": { + "type": "string", + "minLength": 1, + "maxLength": 4096 + }, + "sections": { + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "minItems": 1, + "maxItems": 256 + }, + "builder_result_identity": { + "$ref": "#/$defs/identity" + }, + "preparation_reference": { + "$ref": "#/$defs/uuid" + }, + "use_authorization_reference": { + "$ref": "#/$defs/uuid" + } + } + }, + "prompt": { + "type": "object", + "additionalProperties": false, + "required": [ + "binding_id", + "definition", + "prompt_id", + "prompt_version", + "identity", + "context" + ], + "properties": { + "binding_id": { + "$ref": "#/$defs/name" + }, + "definition": { + "$ref": "#/$defs/dependency" + }, + "prompt_id": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "prompt_version": { + "type": "string", + "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" + }, + "identity": { + "$ref": "#/$defs/identity" + }, + "context": { + "anyOf": [ + { + "$ref": "#/$defs/context" + }, + { + "type": "null" + } + ] + } + } + }, + "asset": { + "type": "object", + "additionalProperties": false, + "required": [ + "asset_id", + "classification", + "reference", + "rights_notice" + ], + "properties": { + "asset_id": { + "$ref": "#/$defs/name" + }, + "classification": { + "$ref": "#/$defs/classification" + }, + "reference": { + "oneOf": [ + { + "type": "object", + "additionalProperties": false, + "required": [ + "kind", + "dependency" + ], + "properties": { + "kind": { + "const": "public" + }, + "dependency": { + "$ref": "#/$defs/dependency" + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "kind", + "handle", + "media_type", + "byte_size", + "sha256" + ], + "properties": { + "kind": { + "const": "protected" + }, + "handle": { + "$ref": "#/$defs/uuid" + }, + "media_type": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "byte_size": { + "$ref": "#/$defs/size" + }, + "sha256": { + "$ref": "#/$defs/digest" + } + } + } + ] + }, + "rights_notice": { + "type": "string", + "minLength": 1, + "maxLength": 4096 + } + } + }, + "inputs": { + "type": "object", + "additionalProperties": false, + "required": [ + "canon", + "dependencies", + "prompts", + "assets" + ], + "properties": { + "canon": { + "$ref": "#/$defs/dependency" + }, + "dependencies": { + "type": "array", + "items": { + "$ref": "#/$defs/dependency" + }, + "minItems": 1, + "maxItems": 256 + }, + "prompts": { + "type": "array", + "items": { + "$ref": "#/$defs/prompt" + }, + "minItems": 0, + "maxItems": 256 + }, + "assets": { + "type": "array", + "items": { + "$ref": "#/$defs/asset" + }, + "minItems": 0, + "maxItems": 256 + } + } + }, + "panel": { + "type": "object", + "additionalProperties": false, + "required": [ + "panel_id", + "description", + "text", + "asset_ids", + "prompt_bindings" + ], + "properties": { + "panel_id": { + "$ref": "#/$defs/name" + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 4096 + }, + "text": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "text_id", + "kind", + "speaker", + "text" + ], + "properties": { + "text_id": { + "$ref": "#/$defs/name" + }, + "kind": { + "enum": [ + "dialogue", + "caption" + ] + }, + "speaker": { + "anyOf": [ + { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string", + "minLength": 1, + "maxLength": 4096 + } + } + }, + "minItems": 0, + "maxItems": 256 + }, + "asset_ids": { + "type": "array", + "items": { + "$ref": "#/$defs/name" + }, + "minItems": 0, + "maxItems": 256 + }, + "prompt_bindings": { + "type": "array", + "items": { + "$ref": "#/$defs/name" + }, + "minItems": 0, + "maxItems": 256 + } + } + }, + "dimensions": { + "anyOf": [ + { + "type": "object", + "additionalProperties": false, + "required": [ + "width", + "height" + ], + "properties": { + "width": { + "type": "integer", + "minimum": 1, + "maximum": 32768 + }, + "height": { + "type": "integer", + "minimum": 1, + "maximum": 32768 + } + } + }, + { + "type": "null" + } + ] + }, + "renditionProfile": { + "type": "object", + "additionalProperties": false, + "required": [ + "profile_id", + "profile_version" + ], + "properties": { + "profile_id": { + "enum": [ + "comic-page-image", + "comic-portable-document", + "comic-accessible-transcript" + ] + }, + "profile_version": { + "const": "1.0.0" + } + } + }, + "rendition": { + "type": "object", + "additionalProperties": false, + "required": [ + "rendition_id", + "required", + "profile", + "media_type", + "dimensions", + "max_bytes", + "alt_text", + "transcript", + "rights_notice" + ], + "properties": { + "rendition_id": { + "$ref": "#/$defs/name" + }, + "required": { + "type": "boolean" + }, + "profile": { + "$ref": "#/$defs/renditionProfile" + }, + "media_type": { + "enum": [ + "image/png", + "image/jpeg", + "image/webp", + "application/pdf", + "text/plain" + ] + }, + "dimensions": { + "$ref": "#/$defs/dimensions" + }, + "max_bytes": { + "type": "integer", + "minimum": 1, + "maximum": 50000000 + }, + "alt_text": { + "type": "string", + "minLength": 1, + "maxLength": 4096 + }, + "transcript": { + "type": "string", + "minLength": 1, + "maxLength": 32768 + }, + "rights_notice": { + "type": "string", + "minLength": 1, + "maxLength": 4096 + } + } + }, + "production": { + "type": "object", + "additionalProperties": false, + "required": [ + "kind", + "spec_version", + "production_id", + "revision", + "previous", + "classification", + "title", + "intent", + "inputs", + "panels", + "renditions" + ], + "properties": { + "kind": { + "const": "comic-production" + }, + "spec_version": { + "const": "1.0.0" + }, + "production_id": { + "$ref": "#/$defs/uuid" + }, + "revision": { + "$ref": "#/$defs/revision" + }, + "previous": { + "anyOf": [ + { + "$ref": "#/$defs/productionRef" + }, + { + "type": "null" + } + ] + }, + "classification": { + "$ref": "#/$defs/classification" + }, + "title": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "intent": { + "type": "string", + "minLength": 1, + "maxLength": 4096 + }, + "inputs": { + "$ref": "#/$defs/inputs" + }, + "panels": { + "type": "array", + "items": { + "$ref": "#/$defs/panel" + }, + "minItems": 1, + "maxItems": 256 + }, + "renditions": { + "type": "array", + "items": { + "$ref": "#/$defs/rendition" + }, + "minItems": 1, + "maxItems": 32 + } + } + }, + "output": { + "type": "object", + "additionalProperties": false, + "required": [ + "rendition_id", + "artifact", + "profile", + "dimensions", + "max_bytes", + "rights_notice", + "alt_text", + "transcript" + ], + "properties": { + "rendition_id": { + "$ref": "#/$defs/name" + }, + "artifact": { + "$ref": "#/$defs/artifact" + }, + "profile": { + "$ref": "#/$defs/renditionProfile" + }, + "dimensions": { + "$ref": "#/$defs/dimensions" + }, + "max_bytes": { + "type": "integer", + "minimum": 1, + "maximum": 50000000 + }, + "rights_notice": { + "type": "string", + "minLength": 1, + "maxLength": 4096 + }, + "alt_text": { + "type": "string", + "minLength": 1, + "maxLength": 4096 + }, + "transcript": { + "type": "string", + "minLength": 1, + "maxLength": 32768 + } + } + }, + "buildOutput": { + "type": "object", + "additionalProperties": false, + "required": [ + "rendition_id", + "artifact", + "profile", + "dimensions", + "max_bytes", + "rights_notice", + "alt_text", + "transcript" + ], + "properties": { + "rendition_id": { + "$ref": "#/$defs/name" + }, + "artifact": { + "type": "object", + "additionalProperties": false, + "required": [ + "artifact_uri", + "media_type", + "byte_size", + "sha256" + ], + "properties": { + "artifact_uri": { + "oneOf": [ + { + "$ref": "#/$defs/uri" + }, + { + "$ref": "#/$defs/uuid" + } + ] + }, + "media_type": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "byte_size": { + "$ref": "#/$defs/size" + }, + "sha256": { + "$ref": "#/$defs/digest" + } + } + }, + "profile": { + "$ref": "#/$defs/renditionProfile" + }, + "dimensions": { + "$ref": "#/$defs/dimensions" + }, + "max_bytes": { + "type": "integer", + "minimum": 1, + "maximum": 50000000 + }, + "rights_notice": { + "type": "string", + "minLength": 1, + "maxLength": 4096 + }, + "alt_text": { + "type": "string", + "minLength": 1, + "maxLength": 4096 + }, + "transcript": { + "type": "string", + "minLength": 1, + "maxLength": 32768 + } + } + }, + "gate": { + "type": "object", + "additionalProperties": false, + "required": [ + "gate", + "disposition", + "evidence_reference", + "rationale" + ], + "properties": { + "gate": { + "enum": [ + "editorial", + "canon-continuity", + "visual-text", + "integrity", + "provenance", + "security-privacy", + "rights", + "accessibility", + "packaging" + ] + }, + "disposition": { + "enum": [ + "pass", + "fail", + "inconclusive", + "not-run", + "not-applicable" + ] + }, + "evidence_reference": { + "$ref": "#/$defs/uuid" + }, + "rationale": { + "type": "string", + "minLength": 1, + "maxLength": 4096 + } + } + }, + "generation": { + "type": "object", + "additionalProperties": false, + "required": [ + "provider", + "model", + "parameters", + "evidence_state", + "limitations" + ], + "properties": { + "provider": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "model": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "parameters": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "name", + "value" + ], + "properties": { + "name": { + "$ref": "#/$defs/name" + }, + "value": { + "type": "string", + "minLength": 1, + "maxLength": 1024 + } + } + }, + "minItems": 0, + "maxItems": 256 + }, + "evidence_state": { + "enum": [ + "recorded", + "unavailable", + "withheld" + ] + }, + "limitations": { + "type": "string", + "minLength": 1, + "maxLength": 4096 + } + } + }, + "execution": { + "type": "object", + "additionalProperties": false, + "required": [ + "tool", + "workflow_id", + "run_uri", + "started_at", + "finished_at", + "transformations", + "generation", + "reproducibility", + "limitations" + ], + "properties": { + "tool": { + "$ref": "#/$defs/dependency" + }, + "workflow_id": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "run_uri": { + "anyOf": [ + { + "$ref": "#/$defs/uri" + }, + { + "type": "null" + } + ] + }, + "started_at": { + "$ref": "#/$defs/time" + }, + "finished_at": { + "$ref": "#/$defs/time" + }, + "transformations": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "step_id", + "input_digests", + "output_digests", + "private_inputs_withheld", + "private_outputs_withheld" + ], + "properties": { + "step_id": { + "$ref": "#/$defs/name" + }, + "input_digests": { + "type": "array", + "items": { + "$ref": "#/$defs/digest" + }, + "minItems": 0, + "maxItems": 256 + }, + "output_digests": { + "type": "array", + "items": { + "$ref": "#/$defs/digest" + }, + "minItems": 0, + "maxItems": 256 + }, + "private_inputs_withheld": { + "type": "boolean" + }, + "private_outputs_withheld": { + "type": "boolean" + } + } + }, + "minItems": 1, + "maxItems": 256 + }, + "generation": { + "type": "array", + "items": { + "$ref": "#/$defs/generation" + }, + "minItems": 0, + "maxItems": 256 + }, + "reproducibility": { + "enum": [ + "exact", + "partial", + "audit-only" + ] + }, + "limitations": { + "type": "string", + "minLength": 1, + "maxLength": 4096 + } + } + }, + "result": { + "type": "object", + "additionalProperties": false, + "required": [ + "kind", + "spec_version", + "result_id", + "attempt_id", + "production", + "classification", + "inputs", + "status", + "outputs", + "gates", + "execution", + "diagnostics" + ], + "properties": { + "kind": { + "const": "comic-build-result" + }, + "spec_version": { + "const": "1.1.0" + }, + "result_id": { + "$ref": "#/$defs/uuid" + }, + "attempt_id": { + "$ref": "#/$defs/uuid" + }, + "production": { + "$ref": "#/$defs/productionRef" + }, + "classification": { + "$ref": "#/$defs/classification" + }, + "inputs": { + "$ref": "#/$defs/inputs" + }, + "status": { + "enum": [ + "complete", + "partial", + "failed" + ] + }, + "outputs": { + "type": "array", + "items": { + "$ref": "#/$defs/buildOutput" + }, + "minItems": 0, + "maxItems": 32 + }, + "gates": { + "type": "array", + "items": { + "$ref": "#/$defs/gate" + }, + "minItems": 0, + "maxItems": 9 + }, + "execution": { + "$ref": "#/$defs/execution" + }, + "diagnostics": { + "type": "array", + "items": { + "enum": [ + "INPUT_MISMATCH", + "OUTPUT_MISSING", + "OUTPUT_INTEGRITY", + "AUTHORITY_DENIED", + "VALIDATION_FAILED", + "CANCELLED" + ] + }, + "minItems": 0, + "maxItems": 32 + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "const": "complete" + } + } + }, + "then": { + "properties": { + "outputs": { + "minItems": 1 + }, + "diagnostics": { + "maxItems": 0 + } + } + }, + "else": { + "properties": { + "diagnostics": { + "minItems": 1 + } + } + } + }, + { + "if": { + "properties": { + "execution": { + "properties": { + "transformations": { + "contains": { + "properties": { + "output_digests": { + "maxItems": 0 + } + } + } + } + } + } + } + }, + "then": { + "properties": { + "status": { + "const": "failed" + }, + "outputs": { + "maxItems": 0 + }, + "diagnostics": { + "const": [ + "OUTPUT_MISSING" + ] + }, + "execution": { + "properties": { + "transformations": { + "minItems": 1, + "maxItems": 1, + "items": { + "properties": { + "input_digests": { + "minItems": 1 + }, + "output_digests": { + "maxItems": 0 + }, + "private_inputs_withheld": { + "const": false + }, + "private_outputs_withheld": { + "const": false + } + } + } + } + } + } + } + } + } + ] + }, + "scope": { + "type": "object", + "additionalProperties": false, + "required": [ + "destination", + "audience", + "purpose", + "publication_time" + ], + "properties": { + "destination": { + "$ref": "#/$defs/uri" + }, + "audience": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "purpose": { + "type": "string", + "minLength": 1, + "maxLength": 4096 + }, + "publication_time": { + "$ref": "#/$defs/time" + } + } + }, + "approver": { + "type": "object", + "additionalProperties": false, + "required": [ + "decision_id", + "role", + "actor", + "decided_at" + ], + "properties": { + "decision_id": { + "$ref": "#/$defs/uuid" + }, + "role": { + "enum": [ + "publisher", + "canon-editor", + "disclosure-reviewer" + ] + }, + "actor": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "decided_at": { + "$ref": "#/$defs/time" + } + } + }, + "release": { + "type": "object", + "additionalProperties": false, + "required": [ + "kind", + "spec_version", + "release_id", + "episode_id", + "revision", + "previous", + "classification", + "title", + "production_credit", + "canon_scope", + "scope", + "input_canon", + "dependencies", + "outputs", + "gates", + "execution", + "approvers", + "private_context" + ], + "properties": { + "kind": { + "const": "comic-public-release" + }, + "spec_version": { + "const": "1.0.0" + }, + "release_id": { + "$ref": "#/$defs/uuid" + }, + "episode_id": { + "type": "string", + "pattern": "^DS-(?!0000)[0-9]{4}$" + }, + "revision": { + "$ref": "#/$defs/revision" + }, + "previous": { + "anyOf": [ + { + "$ref": "#/$defs/releaseRef" + }, + { + "type": "null" + } + ] + }, + "classification": { + "const": "public" + }, + "title": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "production_credit": { + "const": "A Definitely Secure Studio production." + }, + "canon_scope": { + "type": "string", + "minLength": 1, + "maxLength": 4096 + }, + "scope": { + "$ref": "#/$defs/scope" + }, + "input_canon": { + "$ref": "#/$defs/dependency" + }, + "dependencies": { + "type": "array", + "items": { + "$ref": "#/$defs/dependency" + }, + "minItems": 1, + "maxItems": 256 + }, + "outputs": { + "type": "array", + "items": { + "$ref": "#/$defs/output" + }, + "minItems": 1, + "maxItems": 32 + }, + "gates": { + "type": "array", + "items": { + "$ref": "#/$defs/gate" + }, + "minItems": 9, + "maxItems": 9 + }, + "execution": { + "$ref": "#/$defs/execution" + }, + "approvers": { + "type": "array", + "items": { + "$ref": "#/$defs/approver" + }, + "minItems": 2, + "maxItems": 16 + }, + "private_context": { + "oneOf": [ + { + "type": "object", + "additionalProperties": false, + "required": [ + "influenced" + ], + "properties": { + "influenced": { + "const": false + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "influenced", + "attestation_reference" + ], + "properties": { + "influenced": { + "const": true + }, + "attestation_reference": { + "$ref": "#/$defs/uuid" + } + } + } + ] + } + } + }, + "approval": { + "type": "object", + "additionalProperties": false, + "required": [ + "kind", + "spec_version", + "decision_id", + "role", + "actor", + "subject", + "artifact_digests", + "scope", + "decided_at", + "expires_at", + "authority_reference" + ], + "properties": { + "kind": { + "const": "comic-approval-binding" + }, + "spec_version": { + "const": "1.0.0" + }, + "decision_id": { + "$ref": "#/$defs/uuid" + }, + "role": { + "enum": [ + "production-reviewer", + "publisher", + "canon-editor", + "disclosure-reviewer" + ] + }, + "actor": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "subject": { + "$ref": "#/$defs/identity" + }, + "artifact_digests": { + "type": "array", + "items": { + "$ref": "#/$defs/digest" + }, + "minItems": 0, + "maxItems": 256 + }, + "scope": { + "$ref": "#/$defs/scope" + }, + "decided_at": { + "$ref": "#/$defs/time" + }, + "expires_at": { + "$ref": "#/$defs/time" + }, + "authority_reference": { + "$ref": "#/$defs/uuid" + } + } + } + }, + "$ref": "#/$defs/result" +} diff --git a/specs/comic-build-result-1.1-candidate.md b/specs/comic-build-result-1.1-candidate.md new file mode 100644 index 0000000..da1a511 --- /dev/null +++ b/specs/comic-build-result-1.1-candidate.md @@ -0,0 +1,81 @@ +# Comic build result 1.1.0 local candidate + +Status: unreleased implementation candidate, 2026-10-31. Owner: @andrewperis. +Related: [RFC 0012](../rfcs/0012-no-output-failed-build-results.md), Studio +[O02](https://github.com/DefinitelySecureStudio/studio/issues/103) and +[O03](https://github.com/DefinitelySecureStudio/studio/issues/104). + +This bounded implementation selects **1.1.0**, an additive result representation, +with schema ID `urn:definitely-secure:contract:comic-manifest:1.1.0:comic-build-result`. +Its [schema](../schemas/json/comic-manifest/v1.1/comic-build-result.schema.json) +has a result-only root. Its referenced definitions retain existing record +constraints; they do not advertise new production, release or approval support. +The released 1.0.0 schema, specification, fixtures and artifacts are immutable. +The candidate remains subject to contract-owner review before normative adoption. +Local implementation authorization does not publish a contract or enable a +production consumer. No release tuple or adoption date is invented. + +## Exact capability and compatibility choice + +This is an additive minor candidate: all previously valid build-result shapes +remain supported when explicitly emitted with result version 1.1.0, and the +new representation adds one truthful failed-result case. Consumers negotiate the +**exact result capability** `1.1.0` before this form is emitted. Existing v1 +consumers continue to reject the new version. A result can refer to the exact +unchanged v1 production identity; changing result version does not rewrite the +production. Successful prototype results continue to use 1.0.0. This bounded +consumer implements no 1.1 production, publication or approval workflow. + +## No-output representation + +A transformation with empty `output_digests` requires all of the following: + +- `status: failed`, `outputs: []`, `diagnostics: [OUTPUT_MISSING]`; +- exactly one transformation, with nonempty actual verified `input_digests`; +- both withheld flags false; no invented digest or omitted provider output; +- existing inputs, production reference, distinct result/attempt identities, + execution time order, tool linkage, classification and gate rules preserved. + +The bounded mock path records the consumed canon and rendered prompt identities, +in that order. Schema validation cannot prove that output bytes never existed. +The host MUST independently retain and verify protected proof of rejection +before acceptance/action and absence of output. Unknown or inaccessible output, +cancellation, validation failure and timeout cannot use the no-output form. +Existing failed results with verified output digests retain their prior meaning. +This version introduces no cancellation mapping, new diagnostic or public proof +field. Provider detail and retry timing remain protected host metadata. + +## Lifecycle and retry decision + +| Transition | Required evidence | Failure behavior | +|---|---|---| +| admitted → prepared | exact synthetic v1 production and prompt bytes pinned; original ceilings/deadline reserved | no dispatch | +| prepared → dispatch-started | confirmed append; one mock call per attempt | unconfirmed append blocks execution | +| outcome → result-prepared | immutable normalized Provider Execution v1 outcome; rate-limit category, retryable true, finite delay 1–86,400,000 ms, `RATE_LIMITED_BEFORE_ACCEPTANCE`, no output; exact 1.1 capability | preserve outcome; mapping blocked | +| result-prepared → persisting → terminal | freeze result identity, write once, exact readback, confirm terminal link | reconciliation required; no replay or replacement IDs | +| terminal → explicit retry | caller `authorizeRetry: true`; elapsed delay; original deadline/material budget; maximum two attempts; prior result, outcome, input/prompt bytes and terminal links all reverified | no retry dispatch | +| retry → terminal | new attempt/execution/result IDs; `retry_of_attempt_id`; unchanged production and old records | no third attempt | +| restart → inspect | read-only integrity verification | no automatic finalization or retry | + +The first failed terminal result is not a closed job while retry remains open. +The caller may explicitly decline it. The second result closes the job regardless +of outcome. The five-minute deadline and material ledger are never reset. Delay +is conservatively measured from the first terminal result, so persistence time +cannot shorten the provider delay. Adapters perform no hidden retry. + +## Migration and review boundary + +No historical record is rewritten, relabeled or replayed. Keep v1 available for +the entire unreleased candidate evaluation; there is no scheduled removal. +Platform uses a separate experimental validator and `noOutputResultVersion: +'1.1.0'` submission option. Omission preserves the prior blocked behavior. +Production adoption still requires the reviewed Codex source commit and schema +identity, coordinated consumer provenance, conformance, explicit acceptance and +separate release authorization. O02/O03 remain open pending those owner verdicts. + +The finite synthetic [fixture](../fixtures/comic-build-result-v1.1-candidate.json) +and [negative matrix](../fixtures/comic-build-result-v1.1-candidate-cases.json) +cover shape and exact-version compatibility. Platform adds actual-input, +protected-proof, delay, authorization, budgets, immutable-write/link, one-retry, +cancellation and restart cases. No real providers, persistent storage, daemon, +access/security changes, creative content or production readiness are included. diff --git a/tests/comic-result-candidate.test.cjs b/tests/comic-result-candidate.test.cjs new file mode 100644 index 0000000..07c38ec --- /dev/null +++ b/tests/comic-result-candidate.test.cjs @@ -0,0 +1,28 @@ +const { readFileSync } = require('node:fs'); +const { resolve } = require('node:path'); +const assert = require('node:assert/strict'); +const test = require('node:test'); +const Ajv = require('ajv/dist/2020'); +const addFormats = require('ajv-formats'); +const read = p => JSON.parse(readFileSync(resolve(__dirname, '..', p))); +const schema = read('schemas/json/comic-manifest/v1.1/comic-build-result.schema.json'); +const ajv = new Ajv({ strict: true, strictRequired: false, strictTypes: false }); addFormats(ajv); +const validate = ajv.compile(schema); +const base = read('fixtures/comic-build-result-v1.1-candidate.json'); +const old = ajv.compile(read('schemas/json/comic-manifest/v1/comic-manifest.schema.json')); +test('candidate schema accepts truthful no-output shape; v1 rejects exact new version', () => { + assert.equal(validate(base.result), true, JSON.stringify(validate.errors)); + assert.equal(old(base.result), false); + assert.equal(schema.$id, 'urn:definitely-secure:contract:comic-manifest:1.1.0:comic-build-result'); + assert.deepEqual(base.result.execution.transformations[0].input_digests, + [base.production.inputs.canon.artifact.sha256, base.production.inputs.prompts[0].identity.sha256]); +}); +for (const c of read('fixtures/comic-build-result-v1.1-candidate-cases.json')) test(`candidate rejects ${c.name}`, () => { + const r = structuredClone(base.result); + const parent = c.path.slice(0, -1).reduce((x, k) => x[k], r); parent[c.path.at(-1)] = c.value; + assert.equal(validate(r), false); +}); +test('existing result representations remain structurally supported under explicit 1.1 result capability', () => { + const r = read('fixtures/comic-manifest-v1.json').result; + r.spec_version = '1.1.0'; assert.equal(validate(r), true); +});