|
| 1 | +# Petal JSON Contract |
| 2 | + |
| 3 | +**Status**: DRAFT / STRUCTURAL REFERENCE |
| 4 | +**Scope**: required and optional fields for a Gold petal manifest |
| 5 | +**Registry mutation**: NONE |
| 6 | + |
| 7 | +## Purpose |
| 8 | + |
| 9 | +Every Gold petal in the Riverbraid constellation should be able to declare itself in a machine-readable form. |
| 10 | + |
| 11 | +The `petal.json` file is not the verifier. It is the petal's self-declaration: what it claims to check, what it explicitly does not check, and how to run it. |
| 12 | + |
| 13 | +## File location |
| 14 | + |
| 15 | +Each Gold petal repository should contain: |
| 16 | + |
| 17 | +```text |
| 18 | +petal.json |
| 19 | +CLAIMS.md |
| 20 | +NON_CLAIMS.md |
| 21 | +KNOWN_LIMITATIONS.md |
| 22 | +``` |
| 23 | + |
| 24 | +This document defines the `petal.json` contract. The markdown files provide human-readable claim, non-claim, and limitation boundaries. |
| 25 | + |
| 26 | +## Required fields |
| 27 | + |
| 28 | +### `id` |
| 29 | + |
| 30 | +Type: string |
| 31 | +Format: `[OrganizationName]-[PetalName]-Gold` |
| 32 | +Example: `Riverbraid-Refusal-Gold` |
| 33 | + |
| 34 | +The canonical identifier for this petal. It must match the GitHub repository name exactly. |
| 35 | + |
| 36 | +### `domain` |
| 37 | + |
| 38 | +Type: string |
| 39 | +Example: `refusal` |
| 40 | + |
| 41 | +The bounded behavioral domain this petal covers. |
| 42 | + |
| 43 | +### `version` |
| 44 | + |
| 45 | +Type: string |
| 46 | +Format: semver |
| 47 | +Example: `1.0.0` |
| 48 | + |
| 49 | +The version of this petal manifest. It is independent of Core versioning. |
| 50 | + |
| 51 | +### `claim_level` |
| 52 | + |
| 53 | +Type: string |
| 54 | + |
| 55 | +Allowed values: |
| 56 | + |
| 57 | +```text |
| 58 | +PRESENCE_CHECK |
| 59 | +SCHEMA_CHECK |
| 60 | +DETERMINISTIC_VECTOR_CHECK |
| 61 | +NEGATIVE_FAIL_CLOSED_CHECK |
| 62 | +DOMAIN_INVARIANT_CHECK |
| 63 | +CROSS_REPO_CONSISTENCY_CHECK |
| 64 | +CRYPTOGRAPHIC_PROVENANCE_CHECK |
| 65 | +``` |
| 66 | + |
| 67 | +This field declares the deepest level of verification the petal actually performs. |
| 68 | + |
| 69 | +Do not claim a higher level than the verifier implements. When in doubt, claim lower. |
| 70 | + |
| 71 | +### `verifier` |
| 72 | + |
| 73 | +Type: object |
| 74 | + |
| 75 | +Example: |
| 76 | + |
| 77 | +```json |
| 78 | +{ |
| 79 | + "command": "npm test", |
| 80 | + "entry_point": "verifier.mjs", |
| 81 | + "exit_zero_means": "boundary satisfied", |
| 82 | + "exit_nonzero_means": "boundary violated or check could not complete" |
| 83 | +} |
| 84 | +``` |
| 85 | + |
| 86 | +The `command` field must be the exact command used in CI. The `entry_point` identifies the file that performs the check. |
| 87 | + |
| 88 | +### `failure_behavior` |
| 89 | + |
| 90 | +Type: string |
| 91 | + |
| 92 | +Plain-language description of what the verifier does when it fails. This must confirm fail-closed behavior. |
| 93 | + |
| 94 | +### `scope` |
| 95 | + |
| 96 | +Type: array of strings |
| 97 | + |
| 98 | +What this petal checks. Be specific. Do not use vague language like `verifies AI safety`. |
| 99 | + |
| 100 | +### `non_scope` |
| 101 | + |
| 102 | +Type: array of strings |
| 103 | + |
| 104 | +What this petal explicitly does not check. This field is required. |
| 105 | + |
| 106 | +A petal without `non_scope` is overclaiming by omission. |
| 107 | + |
| 108 | +### `maintainer` |
| 109 | + |
| 110 | +Type: string |
| 111 | + |
| 112 | +For canonical Golds, use `Riverbraid`. For adapted or third-party petals, use the actual maintainer. |
| 113 | + |
| 114 | +## Optional fields |
| 115 | + |
| 116 | +### `dependencies` |
| 117 | + |
| 118 | +Type: array of strings |
| 119 | + |
| 120 | +Other Riverbraid repositories this petal depends on for its verifier to run. |
| 121 | + |
| 122 | +### `execution_evidence` |
| 123 | + |
| 124 | +Type: string |
| 125 | + |
| 126 | +Allowed values: |
| 127 | + |
| 128 | +```text |
| 129 | +EXECUTION_EVIDENCED |
| 130 | +PATCHED_UNVERIFIED |
| 131 | +SCAFFOLD_ONLY |
| 132 | +ABSENT |
| 133 | +``` |
| 134 | + |
| 135 | +This is the current execution-evidence status. It is not a guarantee. |
| 136 | + |
| 137 | +### `registry_status` |
| 138 | + |
| 139 | +Type: string |
| 140 | + |
| 141 | +Examples: |
| 142 | + |
| 143 | +```text |
| 144 | +pinned |
| 145 | +not_in_registry |
| 146 | +candidate |
| 147 | +unknown |
| 148 | +``` |
| 149 | + |
| 150 | +Informational only. Do not modify this field to force inclusion. |
| 151 | + |
| 152 | +### `known_limitations` |
| 153 | + |
| 154 | +Type: array of strings |
| 155 | + |
| 156 | +Current limitations of this petal's verification. Limitations are part of the trust surface. |
| 157 | + |
| 158 | +### `adaptation_note` |
| 159 | + |
| 160 | +Type: string or null |
| 161 | + |
| 162 | +For third-party or adapted petals only. Describes the relationship to any canonical petal. |
| 163 | + |
| 164 | +## Validation rules |
| 165 | + |
| 166 | +A valid `petal.json`: |
| 167 | + |
| 168 | +1. contains all required fields |
| 169 | +2. has `id` matching the repository name |
| 170 | +3. has non-empty `non_scope` |
| 171 | +4. has `claim_level` matching actual verifier depth |
| 172 | +5. has `failure_behavior` confirming fail-closed behavior |
| 173 | +6. has `verifier.command` matching the command used in CI |
| 174 | + |
| 175 | +A `petal.json` that claims a higher `claim_level` than its verifier implements is a claim-boundary violation, not a minor inconsistency. |
| 176 | + |
| 177 | +## What `petal.json` is not |
| 178 | + |
| 179 | +- not a security audit |
| 180 | +- not a certification |
| 181 | +- not execution evidence |
| 182 | +- not a registry entry |
| 183 | +- not a guarantee of correctness |
| 184 | + |
| 185 | +## Schema reference |
| 186 | + |
| 187 | +See `schemas/petal-contract.schema.json`. |
| 188 | + |
| 189 | +## Example |
| 190 | + |
| 191 | +See `examples/petal.json`. |
| 192 | + |
| 193 | +## Non-claim |
| 194 | + |
| 195 | +This contract does not admit any petal to the registry and does not upgrade verifier depth. |
0 commit comments