@oxdeai/conformance 1.3.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/LICENSE +213 -0
  3. package/README.md +217 -5
  4. package/dist/evidence-metadata.json +3489 -0
  5. package/dist/scripts/build-evidence-metadata.d.mts +1 -0
  6. package/dist/scripts/build-evidence-metadata.mjs +7 -0
  7. package/dist/scripts/build-evidence-metadata.mjs.map +1 -0
  8. package/dist/scripts/extract-vectors.js +228 -22
  9. package/dist/scripts/extract-vectors.js.map +1 -1
  10. package/dist/src/evidenceScope.d.mts +68 -0
  11. package/dist/src/evidenceScope.mjs +127 -0
  12. package/dist/src/evidenceScope.mjs.map +1 -0
  13. package/dist/src/fixtures/conformance-engine-secret.fixture.d.ts +5 -0
  14. package/dist/src/fixtures/conformance-engine-secret.fixture.js +7 -0
  15. package/dist/src/fixtures/conformance-engine-secret.fixture.js.map +1 -0
  16. package/dist/src/fixtures/ed25519.test-only.fixture.d.ts +1 -1
  17. package/dist/src/fixtures/ed25519.test-only.fixture.js +2 -1
  18. package/dist/src/fixtures/ed25519.test-only.fixture.js.map +1 -1
  19. package/dist/src/fixtures/krl-ed25519.test-only.fixture.d.ts +13 -0
  20. package/dist/src/fixtures/krl-ed25519.test-only.fixture.js +19 -0
  21. package/dist/src/fixtures/krl-ed25519.test-only.fixture.js.map +1 -0
  22. package/dist/src/trustedTimeConformance.d.ts +32 -0
  23. package/dist/src/trustedTimeConformance.js +484 -0
  24. package/dist/src/trustedTimeConformance.js.map +1 -0
  25. package/dist/src/validate-trusted-time.d.ts +1 -0
  26. package/dist/src/validate-trusted-time.js +14 -0
  27. package/dist/src/validate-trusted-time.js.map +1 -0
  28. package/dist/src/validate.d.ts +1 -0
  29. package/dist/src/validate.js +723 -31
  30. package/dist/src/validate.js.map +1 -1
  31. package/package.json +38 -8
  32. package/vectors/audit-chain.json +2 -2
  33. package/vectors/authorization-payload.json +46 -34
  34. package/vectors/authorization-signature-verification.json +39 -1
  35. package/vectors/authorization-verification.json +54 -1
  36. package/vectors/clock-semantics-verification.json +136 -0
  37. package/vectors/delegation-chain-verification.json +366 -0
  38. package/vectors/delegation-parent-hash.json +54 -0
  39. package/vectors/delegation-signature-verification.json +317 -0
  40. package/vectors/delegation-verification.json +252 -0
  41. package/vectors/envelope-verification.json +3 -3
  42. package/vectors/key-lifecycle-verification.json +131 -0
  43. package/vectors/profile-c-state-verification.json +217 -0
  44. package/vectors/signed-krl-verification.json +103 -0
  45. package/vectors/trusted-time.json +50 -0
  46. package/dist/extract-vectors.js +0 -416
  47. package/scripts/extract-vectors.ts +0 -466
  48. package/src/fixtures/README.md +0 -11
  49. package/src/fixtures/ed25519.test-only.fixture.ts +0 -14
  50. package/src/validate.ts +0 -828
  51. package/tsconfig.json +0 -14
package/CHANGELOG.md CHANGED
@@ -7,6 +7,94 @@ This project follows Semantic Versioning.
7
7
 
8
8
  ---
9
9
 
10
+ ## [2.0.0] - Unreleased
11
+
12
+ **Baseline for this entry:** the published `@oxdeai/conformance@1.3.1` npm artifact
13
+ (2026-03-08).
14
+
15
+ > ⚠️ `1.5.0` appears in this changelog and as the Git tag `conformance-v1.5.0` but
16
+ > **was never published to npm**. `1.3.1` is the last released artifact and is the
17
+ > baseline used here. The `1.5.0` entry below is retained as historical record of
18
+ > the source change, not of a release.
19
+
20
+ The vector corpus is this package's public contract, and it has roughly doubled
21
+ since the last published artifact.
22
+
23
+ ### Breaking
24
+
25
+ - **The suite now targets the `@oxdeai/core` 2.0 line.** The dependency is an exact
26
+ pin, so a build of this package validates the 2.0 protocol surface and cannot be
27
+ used to validate a `core@1.x` implementation. Implementers tracking the 1.x line
28
+ must stay on `@oxdeai/conformance@1.3.1`.
29
+ - Vector regeneration under the trusted-time engine changed expected values wherever
30
+ a vector's evaluation depended on time. Existing vector expectations captured
31
+ against the 1.3.1 engine will not match.
32
+
33
+ ### Added
34
+
35
+ Nine vector families that did not exist in the published `1.3.1` artifact:
36
+
37
+ - `trusted-time.json` — trusted-time freshness semantics
38
+ - `clock-semantics-verification.json`
39
+ - `delegation-verification.json`, `delegation-chain-verification.json`,
40
+ `delegation-parent-hash.json`, `delegation-signature-verification.json`
41
+ - `signed-krl-verification.json` — `SignedKRLV1`
42
+ - `key-lifecycle-verification.json`
43
+ - `profile-c-state-verification.json`
44
+
45
+ Also added: the `validate:trusted-time` entry point and the trusted-time conformance
46
+ runner.
47
+
48
+ ### Changed
49
+
50
+ - The validator no longer reads `OXDEAI_ENGINE_SECRET` from the environment; both
51
+ `extract-vectors` and `validate` use `CONFORMANCE_ENGINE_SECRET` unconditionally,
52
+ so the suite is deterministic regardless of shell environment.
53
+ - Delegation chain and signature verification run on an independent recomputation
54
+ path rather than through an engine call.
55
+
56
+ ### Packaging
57
+
58
+ - An explicit `files` field is declared. The artifact now ships `vectors/`, the
59
+ compiled validator, README, CHANGELOG and LICENSE only. It no longer ships
60
+ TypeScript sources, `tsconfig.json`, the Go/Python harness directory, or compiled
61
+ test files — the harnesses remain in the repository and are run from source.
62
+ - `prepack` now rebuilds before packing.
63
+ - `repository` (with `directory`), `homepage` and `bugs` are declared for npm
64
+ provenance.
65
+
66
+ ---
67
+
68
+ ## [1.5.0] - 2026-03-30
69
+
70
+ ### Changed
71
+
72
+ - Secret constant made deterministic; `engine_secret` env var override removed from validator.
73
+ - Conformance vectors regenerated with 32-char secret to meet enforced minimum-length requirement.
74
+ - `envelope-001` hashes updated after `deepMerge` non-mutation correction in `@oxdeai/core`.
75
+ - DelegationV1 chain and signature verification moved to independent recomputation path (no engine call).
76
+
77
+ ### Notes
78
+
79
+ - Protocol vector behavior has changed from `1.4.0` — vectors are not backward-compatible with the `1.4.x` line.
80
+ - Protocol stack alignment: `@oxdeai/core@1.6.1`, `@oxdeai/sdk@1.3.2`.
81
+
82
+ ---
83
+
84
+ ## [1.4.0] - 2026-03-25
85
+
86
+ ### Changed
87
+
88
+ - Version-line release alignment for `@oxdeai/conformance@1.4.0`.
89
+ - Package metadata updated for the `1.4.x` publication line.
90
+
91
+ ### Notes
92
+
93
+ - No conformance vector or validator semantic changes from `1.3.1`.
94
+ - Frozen protocol behavior remains unchanged; this release keeps the package line current with the published metadata.
95
+
96
+ ---
97
+
10
98
  ## [1.3.1] - 2026-03-08
11
99
 
12
100
  ### Changed
package/LICENSE ADDED
@@ -0,0 +1,213 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+
9
+ 1. Definitions.
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+ "License" shall mean the terms and conditions for use, reproduction,
13
+ and distribution as defined by Sections 1 through 9 of this document.
14
+
15
+ "Licensor" shall mean the copyright owner or entity authorized by
16
+ the copyright owner that is granting the License.
17
+
18
+ "Legal Entity" shall mean the union of the acting entity and all
19
+ other entities that control, are controlled by, or are under common
20
+ control with that entity. For the purposes of this definition,
21
+ "control" means (i) the power, direct or indirect, to cause the
22
+ direction or management of such entity, whether by contract or
23
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
24
+ outstanding shares, or (iii) beneficial ownership of such entity.
25
+
26
+ "You" (or "Your") shall mean an individual or Legal Entity
27
+ exercising permissions granted by this License.
28
+
29
+ "Source" form shall mean the preferred form for making modifications,
30
+ including but not limited to software source code, documentation
31
+ source, and configuration files.
32
+
33
+ "Object" form shall mean any form resulting from mechanical
34
+ transformation or translation of a Source form, including but
35
+ not limited to compiled object code, generated documentation,
36
+ and conversions to other media types.
37
+
38
+ "Work" shall mean the work of authorship, whether in Source or
39
+ Object form, made available under the License, as indicated by a
40
+ copyright notice that is included in or attached to the work
41
+ (an example is provided in the Appendix below).
42
+
43
+ "Derivative Works" shall mean any work, whether in Source or Object
44
+ form, that is based on (or derived from) the Work and for which the
45
+ editorial revisions, annotations, elaborations, or other modifications
46
+ represent, as a whole, an original work of authorship. For the purposes
47
+ of this License, Derivative Works shall not include works that remain
48
+ separable from, or merely link (or bind by name) to the interfaces of,
49
+ the Work and Derivative Works thereof.
50
+
51
+ "Contribution" shall mean any work of authorship, including
52
+ the original version of the Work and any modifications or additions
53
+ to that Work or Derivative Works thereof, that is intentionally
54
+ submitted to Licensor for inclusion in the Work by the copyright owner
55
+ or by an individual or Legal Entity authorized to submit on behalf of
56
+ the copyright owner. For the purposes of this definition, "submitted"
57
+ means any form of electronic, verbal, or written communication sent
58
+ to the Licensor or its representatives, including but not limited to
59
+ communication on electronic mailing lists, source code control systems,
60
+ and issue tracking systems that are managed by, or on behalf of, the
61
+ Licensor for the purpose of discussing and improving the Work, but
62
+ excluding communication that is conspicuously marked or otherwise
63
+ designated in writing by the copyright owner as "Not a Contribution."
64
+
65
+ "Contributor" shall mean Licensor and any individual or Legal Entity
66
+ on behalf of whom a Contribution has been received by Licensor and
67
+ subsequently incorporated within the Work.
68
+
69
+ 2. Grant of Copyright License. Subject to the terms and conditions of
70
+ this License, each Contributor hereby grants to You a perpetual,
71
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
72
+ copyright license to reproduce, prepare Derivative Works of,
73
+ publicly display, publicly perform, sublicense, and distribute the
74
+ Work and such Derivative Works in Source or Object form.
75
+
76
+ 3. Grant of Patent License. Subject to the terms and conditions of
77
+ this License, each Contributor hereby grants to You a perpetual,
78
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
79
+ (except as stated in this section) patent license to make, have made,
80
+ use, offer to sell, sell, import, and otherwise transfer the Work,
81
+ where such license applies only to those patent claims licensable
82
+ by such Contributor that are necessarily infringed by their
83
+ Contribution(s) alone or by combination of their Contribution(s)
84
+ with the Work to which such Contribution(s) was submitted. If You
85
+ institute patent litigation against any entity (including a
86
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
87
+ or a Contribution incorporated within the Work constitutes direct
88
+ or contributory patent infringement, then any patent licenses
89
+ granted to You under this License for that Work shall terminate
90
+ as of the date such litigation is filed.
91
+
92
+ 4. Redistribution. You may reproduce and distribute copies of the
93
+ Work or Derivative Works thereof in any medium, with or without
94
+ modifications, and in Source or Object form, provided that You
95
+ meet the following conditions:
96
+
97
+ (a) You must give any other recipients of the Work or
98
+ Derivative Works a copy of this License; and
99
+
100
+ (b) You must cause any modified files to carry prominent notices
101
+ stating that You changed the files; and
102
+
103
+ (c) You must retain, in the Source form of any Derivative Works
104
+ that You distribute, all copyright, patent, trademark, and
105
+ attribution notices from the Source form of the Work,
106
+ excluding those notices that do not pertain to any part of
107
+ the Derivative Works; and
108
+
109
+ (d) If the Work includes a "NOTICE" text file as part of its
110
+ distribution, then any Derivative Works that You distribute must
111
+ include a readable copy of the attribution notices contained
112
+ within such NOTICE file, excluding those notices that do not
113
+ pertain to any part of the Derivative Works, in at least one
114
+ of the following places: within a NOTICE text file distributed
115
+ as part of the Derivative Works; within the Source form or
116
+ documentation, if provided along with the Derivative Works; or,
117
+ within a display generated by the Derivative Works, if and
118
+ wherever such third-party notices normally appear. The contents
119
+ of the NOTICE file are for informational purposes only and
120
+ do not modify the License. You may add Your own attribution
121
+ notices within Derivative Works that You distribute, alongside
122
+ or as an addendum to the NOTICE text from the Work, provided
123
+ that such additional attribution notices cannot be construed
124
+ as modifying the License.
125
+
126
+ You may add Your own copyright statement to Your modifications and
127
+ may provide additional or different license terms and conditions
128
+ for use, reproduction, or distribution of Your modifications, or
129
+ for any such Derivative Works as a whole, provided Your use,
130
+ reproduction, and distribution of the Work otherwise complies with
131
+ the conditions stated in this License.
132
+
133
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
134
+ any Contribution intentionally submitted for inclusion in the Work
135
+ by You to the Licensor shall be under the terms and conditions of
136
+ this License, without any additional terms or conditions.
137
+ Notwithstanding the above, nothing herein shall supersede or modify
138
+ the terms of any separate license agreement you may have executed
139
+ with Licensor regarding such Contributions.
140
+
141
+ 6. Trademarks. This License does not grant permission to use the trade
142
+ names, trademarks, service marks, or product names of the Licensor,
143
+ except as required for reasonable and customary use in describing the
144
+ origin of the Work and reproducing the content of the NOTICE file.
145
+
146
+ 7. Disclaimer of Warranty. Unless required by applicable law or
147
+ agreed to in writing, Licensor provides the Work (and each
148
+ Contributor provides its Contributions) on an "AS IS" BASIS,
149
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
150
+ implied, including, without limitation, any warranties or conditions
151
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
152
+ PARTICULAR PURPOSE. You are solely responsible for determining the
153
+ appropriateness of using or redistributing the Work and assume any
154
+ risks associated with Your exercise of permissions under this License.
155
+
156
+ 8. Limitation of Liability. In no event and under no legal theory,
157
+ whether in tort (including negligence), contract, or otherwise,
158
+ unless required by applicable law (such as deliberate and grossly
159
+ negligent acts) or agreed to in writing, shall any Contributor be
160
+ liable to You for damages, including any direct, indirect, special,
161
+ incidental, or consequential damages of any character arising as a
162
+ result of this License or out of the use or inability to use the
163
+ Work (including but not limited to damages for loss of goodwill,
164
+ work stoppage, computer failure or malfunction, or any and all
165
+ other commercial damages or losses), even if such Contributor
166
+ has been advised of the possibility of such damages.
167
+
168
+ 9. Accepting Warranty or Additional Liability. While redistributing
169
+ the Work or Derivative Works thereof, You may choose to offer,
170
+ and charge a fee for, acceptance of support, warranty, indemnity,
171
+ or other liability obligations and/or rights consistent with this
172
+ License. However, in accepting such obligations, You may act only
173
+ on Your own behalf and on Your sole responsibility, not on behalf
174
+ of any other Contributor, and only if You agree to indemnify,
175
+ defend, and hold each Contributor harmless for any liability
176
+ incurred by, or claims asserted against, such Contributor by reason
177
+ of your accepting any such warranty or additional liability.
178
+
179
+ END OF TERMS AND CONDITIONS
180
+
181
+ APPENDIX: How to apply the Apache License to your work.
182
+
183
+ To apply the Apache License to your work, attach the following
184
+ boilerplate notice, with the fields enclosed by brackets "[]"
185
+ replaced with your own identifying information. (Don't include
186
+ the brackets!) The text should be enclosed in the appropriate
187
+ comment syntax for the file format. We also recommend that a
188
+ file or class name and description of purpose be included on the
189
+ same "printed page" as the copyright notice for easier
190
+ identification within third-party archives.
191
+
192
+ Copyright [yyyy] [name of copyright owner]
193
+
194
+ Licensed under the Apache License, Version 2.0 (the "License");
195
+ you may not use this file except in compliance with the License.
196
+ You may obtain a copy of the License at
197
+
198
+ http://www.apache.org/licenses/LICENSE-2.0
199
+
200
+ Unless required by applicable law or agreed to in writing, software
201
+ distributed under the License is distributed on an "AS IS" BASIS,
202
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
203
+ See the License for the specific language governing permissions and
204
+ limitations under the License.
205
+
206
+
207
+ OxDeAI
208
+ Copyright 2026 OxDeAI contributors
209
+
210
+ This product includes software developed by the OxDeAI project
211
+ (https://github.com/oxdeai/oxdeai).
212
+
213
+
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @oxdeai/conformance
2
-
3
- Conformance vectors and validator for the OxDeAI protocol.
2
+ Conformance vectors and validator for the OxDeAI execution-time authorization protocol.
3
+ Ensures implementations reproduce deterministic AuthorizationV1 artifacts and boundary verification (fail-closed).
4
4
 
5
5
  ## Purpose
6
6
  `@oxdeai/conformance` verifies that an implementation matches the frozen protocol behavior for a specific version.
@@ -8,10 +8,12 @@ Conformance vectors and validator for the OxDeAI protocol.
8
8
  Passing validation means the implementation reproduces expected deterministic artifacts (hashes, statuses, and verification outputs) from frozen vectors.
9
9
 
10
10
  ## Version Coupling
11
- - `@oxdeai/conformance@1.3.x` targets protocol/core `1.3.x` behavior.
11
+ - `@oxdeai/conformance@2.0.0` targets `@oxdeai/core@2.0.0` behavior.
12
12
  - Use matching major/minor protocol versions when validating.
13
13
 
14
14
  ## Included Vector Sets
15
+
16
+ ### Core protocol (pre-v1.3)
15
17
  - `intent-hash.json`
16
18
  - `authorization-payload.json`
17
19
  - `snapshot-hash.json`
@@ -22,7 +24,142 @@ Passing validation means the implementation reproduces expected deterministic ar
22
24
  - `authorization-signature-verification.json`
23
25
  - `envelope-signature-verification.json`
24
26
 
25
- Current validator assertion count: `94`.
27
+ ### DelegationV1 (v1.3+)
28
+ - `delegation-parent-hash.json` - `delegation_parent_hash = SHA256(canonical_json(AuthorizationV1))`; key-order invariance (I1)
29
+ - `delegation-verification.json` - `verifyDelegation()` field-level checks: expiry, scope narrowing, delegatee, policy, replay, trust-missing
30
+ - `delegation-chain-verification.json` - `verifyDelegationChain()` chain checks: hash binding, delegator, parent expiry, expiry ceiling, single-hop, policy binding
31
+ - `delegation-signature-verification.json` - Ed25519 signature path: valid, tampered sig, wrong kid, tampered field, expired
32
+
33
+ ### Profile C - Semantic State Verification (v1.5+)
34
+
35
+ - `profile-c-state-verification.json` - models selected Profile-C state-hash comparisons (guard step 10), separately from actual guard integration: `computeStateHash(liveState)` compared against the committed `state_hash` in the authorization.
36
+
37
+ Eight vectors covering:
38
+
39
+ | Vector | Mode | Expected outcome |
40
+ |--------|------|-----------------|
41
+ | `profile-c-001` | `live-state-match` | `ok` - same state at signing and verification |
42
+ | `profile-c-002` | `live-state-mismatch` | `state-hash-mismatch` - state advanced between signing and execution |
43
+ | `profile-c-003` | `hash-strategy-mismatch` | `state-hash-mismatch` - provider hash committed, Core algorithm at verification |
44
+ | `profile-c-004` | `compute-throws` | `compute-error` - `computeStateHash` throws; execution blocked fail-closed |
45
+ | `profile-c-005` | `toctou-stale-state` | `state-hash-mismatch` - TOCTOU: state advanced since authorization was issued |
46
+ | `profile-c-006` | `encoding-b-live-state-match` | `ok` - Encoding B (Sift-compatible) + matching state |
47
+ | `profile-c-007` | `encoding-b-live-state-mismatch` | `state-hash-mismatch` - Encoding B + stale state |
48
+ | `profile-c-008` | `encoding-b-hash-strategy-mismatch` | `state-hash-mismatch` - Encoding B + strategy mismatch |
49
+
50
+ Two hash strategies modelled:
51
+
52
+ | Strategy | Algorithm |
53
+ |----------|-----------|
54
+ | `core` | `sha256HexFromJson` (Core-native) |
55
+ | `provider` | SHA-256 of `"PROVIDER:" + canonicalJson(state)` (simulates external provider hash) |
56
+
57
+ Encoding B vectors (`profile-c-006` through `profile-c-008`) exercise the Sift-compatible wire format (`alg="ed25519"`, `expires_at`, base64url signature) combined with live-state semantic verification.
58
+
59
+ ### Key Lifecycle (v1.5+)
60
+
61
+ - `key-lifecycle-verification.json` - exercises `keyIsActiveAt`, `findKeyInKeySets`, and `AUTH_KEY_INACTIVE` / `AUTH_KID_UNKNOWN` enforcement across all key status and time-window states.
62
+
63
+ Ten vectors covering:
64
+
65
+ | Vector | Mode | Expected outcome |
66
+ |--------|------|-----------------|
67
+ | `key-lifecycle-001` | `key-active` | `ok` - active key, no time constraints |
68
+ | `key-lifecycle-002` | `key-revoked` | `AUTH_KEY_INACTIVE` - revoked key rejected |
69
+ | `key-lifecycle-003` | `key-not-before-future` | `AUTH_KEY_INACTIVE` - key not yet active |
70
+ | `key-lifecycle-004` | `key-not-after-past` | `AUTH_KEY_INACTIVE` - validity window expired |
71
+ | `key-lifecycle-005` | `key-valid-window` | `ok` - explicit `not_before`/`not_after` window active |
72
+ | `key-lifecycle-006` | `key-expired-window` | `AUTH_KEY_INACTIVE` - `not_after` in the past |
73
+ | `key-lifecycle-007` | `key-retired-within-window` | `ok` - retired key accepted during dual-sign overlap window |
74
+ | `key-lifecycle-008` | `key-retired-past-window` | `AUTH_KEY_INACTIVE` - retired key, window closed |
75
+ | `key-lifecycle-009` | `key-revoked-valid-window` | `AUTH_KEY_INACTIVE` - revocation overrides valid time window |
76
+ | `key-lifecycle-010` | `wrong-kid-known-issuer` | `AUTH_KID_UNKNOWN` - correct issuer, unknown kid |
77
+
78
+ ### Clock Semantics (v1.5+)
79
+
80
+ - `clock-semantics-verification.json` - exercises strict zero-tolerance expiry enforcement (`now < expiry`) and `issued_at` informational-only semantics for both wire encodings.
81
+
82
+ Five vectors covering:
83
+
84
+ | Vector | Mode | Expected outcome |
85
+ |--------|------|-----------------|
86
+ | `clock-001` | `last-valid-second` | `ok` - `now = expiry - 1`, last valid second |
87
+ | `clock-002` | `one-past-expiry` | `AUTH_EXPIRED` - `now = expiry + 1`, no grace period |
88
+ | `clock-003` | `verifier-clock-behind` | `ok` - `now < issued_at`, `issued_at` not enforced as lower bound |
89
+ | `clock-004` | `encoding-b-last-valid-second` | `ok` - Encoding B (`expires_at`), `now = expires_at - 1` |
90
+ | `clock-005` | `encoding-b-verifier-clock-behind` | `ok` - Encoding B, `now < issued_at` |
91
+
92
+ Clock model: **strict zero tolerance**. Valid iff `now < expiry`. No skew parameter, no grace period. Issuers must build delivery latency into the expiry window. See `authorization-v1.md §17`.
93
+
94
+ ### SignedKRLV1 Verification (v1.6+)
95
+
96
+ - `signed-krl-verification.json` - exercises `verifySignedKrl` across all verification paths for the `SignedKRLV1` protocol artifact.
97
+
98
+ Nine vectors covering:
99
+
100
+ | Vector | Mode | Expected outcome |
101
+ |--------|------|-----------------|
102
+ | `krl-001` | `valid` | `ok` - signature verifies, not expired |
103
+ | `krl-002` | `invalid-signature` | `KRL_SIG_INVALID` - tampered signature |
104
+ | `krl-003` | `expired` | `KRL_EXPIRED` - `now >= not_after` (strict zero-tolerance) |
105
+ | `krl-004` | `malformed-revoked-kids` | `KRL_MALFORMED` - `revoked_kids` is a string, not an array |
106
+ | `krl-005` | `duplicate-revoked-kids` | `KRL_MALFORMED` - duplicate entries in `revoked_kids` |
107
+ | `krl-006` | `unknown-signing-kid` | `KRL_UNKNOWN_SIGNING_KID` - kid not in trusted KRL signing key set |
108
+ | `krl-007` | `signing-key-inactive` | `KRL_SIGNING_KEY_INACTIVE` - key found but `keyIsActiveAt` returns false |
109
+ | `krl-008` | `unsupported-alg` | `KRL_UNSUPPORTED_ALG` - `signature.alg != "Ed25519"` |
110
+ | `krl-009` | `version-regression` | `KRL_VERSION_REGRESSION` - `krl_version` less than previous accepted value |
111
+
112
+ Signing domain: `OXDEAI_KRL_V1`. KRL signing fixture key (`krl-2026-01`, issuer `krl.issuer`) is distinct from the AuthorizationV1 / DelegationV1 signing fixture key to exercise trust-domain separation.
113
+
114
+ **Coverage scope:** TypeScript / `@oxdeai/core` conformance runner. The separate docs SignedKRL corpus is consumed by the root Go/Python harnesses. These are distinct corpora, not a projection or mirror.
115
+
116
+ ### Trusted-Time Semantics (v2.0+)
117
+
118
+ - `trusted-time.json` - exercises the trusted-time freshness gate (`docs/spec/core/trusted-time-v1.md`) end to end: issuance, velocity, tool-window, and replay evaluation under trusted `evaluationTime`, plus protocol-domain and malformed-input rejection.
119
+
120
+ 44 vectors, 1 assertion each, run via a dedicated `runTrustedTimeConformance` harness (`src/trustedTimeConformance.ts`) rather than the generic vector-comparison path used by the sets above.
121
+
122
+ Current validator assertion count: `262` (re-run `pnpm -C packages/conformance validate` for the live figure before relying on this number).
123
+
124
+ ### Adapter ops required for DelegationV1
125
+
126
+ | Op | Input | Output | Independence |
127
+ |----|-------|--------|--------------|
128
+ | `delegation_parent_hash` | `{ parent: AuthorizationV1 }` | `{ parent_auth_hash: hex }` | Full - SHA256 + canonical JSON |
129
+ | `verify_delegation` | `{ delegation: DelegationV1, opts }` | `{ status, violations, policyId }` | Full - no crypto required |
130
+ | `verify_delegation_chain` | `{ parent, delegation, opts }` (inline) | `{ status, violations }` | Full - hash recomputation + structural checks |
131
+ | `verify_delegation_signature` | `{ parent, delegation, opts }` (inline) | `{ status, violations }` | Full - chain checks + Ed25519 via test key material |
132
+ | `verify_delegation_chain_case` | `{ id: string }` | `{ status, violations }` | Lookup (frozen) |
133
+ | `verify_delegation_signature_case` | `{ id: string }` | `{ status, violations }` | Lookup (frozen) |
134
+
135
+ The optional `packages/conformance/go-harness` driver (not root vector CI; Python adapter blocked by #306) uses `verify_delegation_chain` and `verify_delegation_signature`
136
+ with inline `input` from the vector files. Those operations are designed to recompute
137
+ `SHA256(canonical_json(parent))`, perform the chain-level structural checks,
138
+ and (for signature cases) perform Ed25519 verification using the test key
139
+ material embedded in `opts.trustedKeySets`. Lookup ops are retained for
140
+ compatibility but not used by the harness runners.
141
+
142
+ ### Coverage distinction
143
+
144
+ The `Cross-language?` column reports what `pnpm test:vectors:go` and
145
+ `pnpm test:vectors:py` actually execute, not what is portable in principle.
146
+ Those commands exercise three corpora: canonicalization-v1 (11 vectors),
147
+ Profile-C state verification (8), and SignedKRLV1 (9) - 28 assertions per
148
+ language. Everything else is TypeScript-only today.
149
+
150
+ | Layer | What it covers | Cross-language? |
151
+ |-------|---------------|-----------------|
152
+ | `delegation-parent-hash.json` | Hash stability, I1 key-order invariance | TypeScript only - portable in principle (SHA256 + canonical JSON), but not exercised by `test:vectors:go` |
153
+ | `delegation-verification.json` | Field checks, expiry, scope, replay, trust-missing | TypeScript only - portable in principle (no crypto required), but not exercised by `test:vectors:go` |
154
+ | `delegation-chain-verification.json` | Chain structural checks (hash binding, delegator, expiry ceiling, policy) | TypeScript only - Go and Python adapters exist in `go-harness/` but are not exercised by `test:vectors:go`; the Python adapter fails at import (#306) |
155
+ | `delegation-signature-verification.json` | Ed25519 verification path | TypeScript only - Go and Python adapters exist in `go-harness/` but are not exercised by `test:vectors:go`; the Python adapter fails at import (#306) |
156
+ | `key-lifecycle-verification.json` | Key status (active/revoked/retired), `not_before`/`not_after` windows, wrong-kid rejection | TypeScript only - portable across any `verifyAuthorization` implementation, but `validate.ts` is its only consumer |
157
+ | `clock-semantics-verification.json` | Strict zero-tolerance expiry, `issued_at` informational, Encoding A + B boundary pins | TypeScript only - portable, no crypto required, but `validate.ts` is its only consumer |
158
+ | `trusted-time.json` | Trusted-time freshness gate: issuance, velocity, tool-window, replay under `evaluationTime`; protocol-domain and malformed-input rejection | TypeScript only (dedicated `runTrustedTimeConformance` harness) |
159
+ | `profile-c-state-verification.json` | Generated Profile-C representation; preserved signed fixtures and expected-result projection | TypeScript consumes this projection; Go/Python consume the docs authority. Same eight cases, not independent corpora. |
160
+ | `delegation.property.test.ts` (D-P1–D-P5) | PBT over scope / hash / mutation | TypeScript only |
161
+ | `guard.delegation.property.test.ts` (G-D1–G-D3) | Guard PEP delegation path | TypeScript only |
162
+ | `cross-adapter.test.ts` (CA-1–CA-10) | Cross-adapter equivalence, I6 | TypeScript only |
26
163
 
27
164
  ## Usage
28
165
  From repo root:
@@ -35,9 +172,12 @@ pnpm -C packages/conformance validate
35
172
  Expected success output includes:
36
173
 
37
174
  ```text
38
- Conformance passed: 94 assertions
175
+ Conformance passed: 262 assertions
39
176
  ```
40
177
 
178
+ (This figure moves as vectors are added. Treat the live `pnpm validate` output
179
+ as authoritative, not this number.)
180
+
41
181
  ## Adapter Contract
42
182
  The validator is built around a pluggable adapter (`ConformanceAdapter`) so non-TypeScript runtimes can be checked against the same vectors.
43
183
 
@@ -50,9 +190,81 @@ An adapter must provide deterministic implementations for:
50
190
 
51
191
  Reference adapter: `@oxdeai/core` (implemented in `src/validate.ts`).
52
192
 
193
+ ## Verification Artifact Scope
194
+
195
+ ![Verification envelope flow](../../docs/diagrams/verification-envelope-flow.svg)
196
+
197
+ Conformance checks deterministic behavior for artifacts and verifiers used in this flow (snapshot, audit, authorization, envelope, and verification status outputs).
198
+
199
+ Diagram source/editing policy:
200
+ - [`docs/diagrams/README.md`](../../docs/diagrams/README.md)
201
+
202
+ ## Profile-C authority and generated representation
203
+
204
+ `vectors/profile-c-state-verification.json` is generated solely from
205
+ `docs/spec/test-vectors/profile-c-state-verification.json`. Edit the authority,
206
+ then run `pnpm project:profile-c` from the repository root.
207
+ `pnpm verify:corpus-authority` checks semantic and exact-byte consistency without
208
+ writing files. Build/prepack use the committed projection and do not copy either
209
+ vector tree. See [corpus authority](../../docs/conformance/corpus-authority.md).
210
+ The remaining package corpora retain their own frozen authorities.
211
+
53
212
  ## Freeze Policy
54
213
  Vectors are frozen per protocol version.
55
214
 
56
215
  - Do not regenerate vectors for the same protocol version after behavior changes.
57
216
  - Any behavior-impacting change requires a new protocol/versioned vector release.
58
217
  - Regeneration is allowed only when intentionally producing a new version baseline.
218
+
219
+ ## Interoperability Profiles
220
+
221
+ OxDeAI defines three interoperability profiles. Conformance coverage maps directly to profile requirements:
222
+
223
+ | Profile | Description | Vector sets required |
224
+ |---------|-------------|----------------------|
225
+ | A | Core-native `AuthorizationV1` | Core protocol + DelegationV1 |
226
+ | B | External provider wire-compatible (Encoding A and Encoding B accepted) | Core + authorization-signature vectors |
227
+ | C | Semantic state verification via `computeStateHash` | Core + DelegationV1 + Profile C state vectors (selected cases, not full deployment proof) |
228
+
229
+ Profile C now has **executable conformance coverage** via `profile-c-state-verification.json` (15 assertions).
230
+
231
+ Key lifecycle enforcement (Profile A/B/C) is covered by `key-lifecycle-verification.json` (20 assertions): active, revoked, retired (within/past window), `not_before`/`not_after` time windows, and wrong-kid rejection.
232
+
233
+ Clock semantics (all profiles) are covered by `clock-semantics-verification.json` (10 assertions): strict zero-tolerance expiry, `issued_at` informational-only, Encoding A and Encoding B boundary pins.
234
+
235
+ See [External Provider Interoperability Profile](../../docs/spec/interoperability/external-provider-profile.md) for the full profile specification, wire encoding reference, and fail-closed rules.
236
+
237
+ ## Using OxDeAI Conformance from Other Languages
238
+
239
+ Conformance vectors are the behavioral truth source for protocol compatibility.
240
+
241
+ Rust, Go, and Python implementations should validate their verifier/engine behavior against these vectors.
242
+ Passing conformance means the implementation is behaviorally aligned with the OxDeAI protocol profile for that version line, including executable interoperability coverage where applicable.
243
+
244
+ Profile C vectors (`profile-c-state-verification.json`) require a `computeStateHash` integration point. Cross-language harnesses must supply a compatible hash function to exercise those vectors.
245
+
246
+ Related implementer docs:
247
+
248
+ - [`docs/verification/multi-language.md`](../../docs/verification/multi-language.md)
249
+ - [`docs/conformance/conformance-vectors.md`](../../docs/conformance/conformance-vectors.md)
250
+ - [`docs/spec/interoperability/external-provider-profile.md`](../../docs/spec/interoperability/external-provider-profile.md)
251
+ - [`packages/conformance/go-harness`](./go-harness)
252
+
253
+ ## Scoped results
254
+
255
+ Conformance PASS is limited to the declared `evidenceScope`. The package validator
256
+ emits `{ result, passed, failures, evidenceScope }`; after building, run
257
+ `node dist/src/validate.js --json` for JSON-only stdout. The dedicated trusted-time
258
+ CLI also accepts `--json`, and `runTrustedTimeConformance` adds `evidenceScope` to
259
+ its returned summary. Existing counts and failure exit codes are unchanged.
260
+
261
+ Coverage uses exact registry evidence mappings and actual passing cases;
262
+ `excludedClaims` is the registry complement, not a handwritten list. Coverage
263
+ means only the listed `supports` statements, never whole-protocol conformance or
264
+ proof of all claim obligations. Reference-generated expectations remain bounded
265
+ by the #325 provenance audit. No assurance class or signed attestation is added.
266
+
267
+ Builds bundle a metadata snapshot so installed packages can report explicit
268
+ exclusions and source identifiers without the repository checkout. See
269
+ [the schema and limitations](../../docs/conformance/evidence-scope.md), including
270
+ snapshot freshness, direct diagnostic harnesses and deployment exclusions.