@fourier-labs/harbour-contracts 0.6.0 → 0.9.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 (107) hide show
  1. package/README.md +44 -4
  2. package/contract-release.json +134 -0
  3. package/dist/gen-ts/ai-budget-ledger-event.d.ts +21 -0
  4. package/dist/gen-ts/ai-budget-ledger-event.js +3 -0
  5. package/dist/gen-ts/ai-classification-stamp.d.ts +25 -0
  6. package/dist/gen-ts/ai-classification-stamp.js +3 -0
  7. package/dist/gen-ts/ai-composite-policy-digest-helper.d.ts +5 -0
  8. package/dist/gen-ts/ai-composite-policy-digest-helper.js +13 -0
  9. package/dist/gen-ts/ai-composite-policy-digest.d.ts +12 -0
  10. package/dist/gen-ts/ai-composite-policy-digest.js +3 -0
  11. package/dist/gen-ts/ai-deployment-gate-decision.d.ts +27 -0
  12. package/dist/gen-ts/ai-deployment-gate-decision.js +3 -0
  13. package/dist/gen-ts/ai-gateway-key-lifecycle-event.d.ts +49 -0
  14. package/dist/gen-ts/ai-gateway-key-lifecycle-event.js +16 -0
  15. package/dist/gen-ts/ai-governance-decision.d.ts +12 -0
  16. package/dist/gen-ts/ai-metering-policy.d.ts +16 -0
  17. package/dist/gen-ts/ai-metering-policy.js +3 -0
  18. package/dist/gen-ts/ai-pricing-revision.d.ts +29 -0
  19. package/dist/gen-ts/ai-pricing-revision.js +3 -0
  20. package/dist/gen-ts/ai-runtime-binding.d.ts +14 -0
  21. package/dist/gen-ts/ai-runtime-binding.js +3 -0
  22. package/dist/gen-ts/ai-runtime-contract.d.ts +15 -0
  23. package/dist/gen-ts/ai-trace-event-v2.d.ts +31 -0
  24. package/dist/gen-ts/ai-trace-event-v2.js +3 -0
  25. package/dist/gen-ts/ai-verification-evidence.d.ts +1 -0
  26. package/dist/gen-ts/contract-release.d.ts +7 -0
  27. package/dist/gen-ts/contract-release.js +9 -0
  28. package/dist/gen-ts/index.d.ts +11 -0
  29. package/dist/gen-ts/index.js +11 -0
  30. package/fixtures/ai/valid-blocked-trace-event.json +31 -0
  31. package/fixtures/ai/valid-budget-ledger-event.json +15 -0
  32. package/fixtures/ai/valid-classification-stamp.json +19 -0
  33. package/fixtures/ai/valid-composite-policy-digest.json +11 -0
  34. package/fixtures/ai/valid-deployment-gate-decision.json +18 -0
  35. package/fixtures/ai/valid-failed-trace-event.json +50 -0
  36. package/fixtures/ai/valid-gateway-key-lifecycle-event.json +16 -0
  37. package/fixtures/ai/valid-gateway-key-lookup.json +14 -0
  38. package/fixtures/ai/valid-governance-decision.json +53 -0
  39. package/fixtures/ai/valid-inventory.json +30 -0
  40. package/fixtures/ai/valid-metering-policy.json +8 -0
  41. package/fixtures/ai/valid-policy-snapshot.json +117 -0
  42. package/fixtures/ai/valid-pricing-revision.json +14 -0
  43. package/fixtures/ai/valid-runtime-binding.json +7 -0
  44. package/fixtures/ai/valid-runtime-contract.json +24 -0
  45. package/fixtures/ai/valid-trace-event-v2.json +24 -0
  46. package/fixtures/ai/valid-trace-event.json +41 -0
  47. package/fixtures/ai/valid-transform-event.json +32 -0
  48. package/fixtures/ai/valid-transform-result.json +23 -0
  49. package/fixtures/ai/valid-verification-evidence.json +33 -0
  50. package/gen-ts/ai-budget-ledger-event.ts +25 -0
  51. package/gen-ts/ai-callsite-inventory.ts +64 -0
  52. package/gen-ts/ai-classification-stamp.ts +28 -0
  53. package/gen-ts/ai-composite-policy-digest-helper.ts +18 -0
  54. package/gen-ts/ai-composite-policy-digest.ts +16 -0
  55. package/gen-ts/ai-deployment-gate-decision.ts +30 -0
  56. package/gen-ts/ai-gateway-key-lifecycle-event.ts +81 -0
  57. package/gen-ts/ai-gateway-key-lookup.ts +23 -0
  58. package/gen-ts/ai-gateway-key-token.ts +7 -0
  59. package/gen-ts/ai-governance-decision.ts +90 -0
  60. package/gen-ts/ai-metering-policy.ts +20 -0
  61. package/gen-ts/ai-policy-snapshot.ts +169 -0
  62. package/gen-ts/ai-pricing-revision.ts +33 -0
  63. package/gen-ts/ai-runtime-binding.ts +18 -0
  64. package/gen-ts/ai-runtime-contract.ts +46 -0
  65. package/gen-ts/ai-trace-event-v2.ts +35 -0
  66. package/gen-ts/ai-trace-event.ts +72 -0
  67. package/gen-ts/ai-transform-event.ts +51 -0
  68. package/gen-ts/ai-transform-result.ts +36 -0
  69. package/gen-ts/ai-verification-evidence.ts +54 -0
  70. package/gen-ts/api-error-response.ts +16 -0
  71. package/gen-ts/artifact-contract.ts +81 -0
  72. package/gen-ts/contract-release.ts +10 -0
  73. package/gen-ts/data-dependency.ts +46 -0
  74. package/gen-ts/data-grant.ts +71 -0
  75. package/gen-ts/data-source.ts +78 -0
  76. package/gen-ts/deploy-request.ts +66 -0
  77. package/gen-ts/deploy-response.ts +25 -0
  78. package/gen-ts/deployment-environment.ts +7 -0
  79. package/gen-ts/deployment-source.ts +16 -0
  80. package/gen-ts/deployment-status-failure.ts +12 -0
  81. package/gen-ts/deployment-status-request.ts +11 -0
  82. package/gen-ts/deployment-status-response.ts +39 -0
  83. package/gen-ts/env-bindings.ts +64 -0
  84. package/gen-ts/error-category-registry.ts +108 -0
  85. package/gen-ts/error-category.ts +7 -0
  86. package/gen-ts/error-envelope.ts +49 -0
  87. package/gen-ts/index.ts +47 -0
  88. package/gen-ts/kvs-routing-entry.ts +30 -0
  89. package/gen-ts/promotion-request.ts +43 -0
  90. package/gen-ts/promotion-response.ts +20 -0
  91. package/gen-ts/secret-reference.ts +40 -0
  92. package/gen-ts/transform-report.ts +105 -0
  93. package/gen-ts/version-state-machine.ts +52 -0
  94. package/gen-ts/version-state.ts +19 -0
  95. package/package.json +8 -4
  96. package/schema/ai-budget-ledger-event.schema.json +29 -0
  97. package/schema/ai-classification-stamp.schema.json +40 -0
  98. package/schema/ai-composite-policy-digest.schema.json +27 -0
  99. package/schema/ai-deployment-gate-decision.schema.json +38 -0
  100. package/schema/ai-gateway-key-lifecycle-event.schema.json +61 -0
  101. package/schema/ai-governance-decision.schema.json +23 -2
  102. package/schema/ai-metering-policy.schema.json +18 -0
  103. package/schema/ai-pricing-revision.schema.json +38 -0
  104. package/schema/ai-runtime-binding.schema.json +26 -0
  105. package/schema/ai-runtime-contract.schema.json +24 -2
  106. package/schema/ai-trace-event-v2.schema.json +41 -0
  107. package/schema/ai-verification-evidence.schema.json +1 -0
package/README.md CHANGED
@@ -13,6 +13,7 @@ exist here first.
13
13
  | `schema/*.json` | JSON Schema (draft-07). The only files you hand-edit. |
14
14
  | `gen-go/` | Generated Go package `contracts` (import `github.com/Fourier-Labs-AI/harbour-contracts/gen-go`). |
15
15
  | `gen-ts/` | Generated TS sources; published as `@fourier-labs/harbour-contracts`. |
16
+ | `contract-release.json` | Generated release/version plus aggregate and per-file schema, AI-fixture, Go-source and TypeScript-source digests for strict consumer pins. |
16
17
  | `tools/gen/gen.mjs` | The single codegen driver (Node). Validates every schema, then emits Go + TS. |
17
18
  | `docs/adr/` | Decision records (e.g. `0001-t1-ratified.md`). |
18
19
 
@@ -27,6 +28,12 @@ exist here first.
27
28
  | `version-state.schema.json` | State machine T1a — states, legal transitions, versionId format | §1 |
28
29
  | `env-bindings.schema.json` | `EnvBindings` / `Target` / `Binding` (BYOC-complete) | §4.2.2 |
29
30
  | `kvs-routing-entry.schema.json` | CloudFront KVS routing value (`{static, api}`) | §8 |
31
+ | `ai-composite-policy-digest.schema.json` | Ordered composite-policy digest identity and generated Go/TS helpers | AI governance §5.1 |
32
+ | `ai-classification-stamp.schema.json` | Immutable exact-version classification evidence | AI governance §5.2 |
33
+ | `ai-deployment-gate-decision.schema.json` | Append-only explicit deployment gate decision | AI governance §5.2 |
34
+ | `ai-gateway-key-lifecycle-event.schema.json` | Value-free version-key lifecycle evidence | AI governance §7 |
35
+ | `ai-runtime-binding.schema.json` | Platform-neutral workload identity/secret binding | AI governance §5.8 |
36
+ | `ai-pricing-revision`, `ai-metering-policy`, `ai-budget-ledger-event`, `ai-trace-event-v2` | Additive metering v2 records; v1 records remain readable | AI governance §9 |
30
37
 
31
38
  Two schemas carry logic beyond structural types, generated into helpers:
32
39
 
@@ -57,16 +64,49 @@ used solely to *compile-check* the output (`make build`), not to generate it.
57
64
  3. CI (`make verify`) fails any PR whose committed generated code does not match its schema.
58
65
  4. A shape change is a `(contracts)` change: it lands via `/review` + `/code-review ultra` → `/ship`.
59
66
 
67
+ Consumers should pin both the three-part publish version and the
68
+ `schemasDigest`/`aiFixturesDigest` in `contract-release.json`. Their CI should
69
+ validate the canonical fixtures against the pinned generated types or schemas;
70
+ it must not silently skip validation when the contracts checkout is absent.
71
+ The npm artifact contains `schema/`, `fixtures/ai/`, `gen-ts/` and the release
72
+ manifest, so every TypeScript byte named by the manifest is available from the
73
+ same release. Go source remains available through the tagged Go module.
74
+
75
+ `generatedGo` and `generatedTypeScript` seal every `.go`/`.ts` file in their
76
+ package directories. `gen-go/contract_release.go` and
77
+ `gen-ts/contract-release.ts` are the only exclusions: those generated files
78
+ embed the aggregate digests themselves, so including them would create a
79
+ self-reference with no finite digest. The manifest names both exclusions and
80
+ their reason; tests reject any different exclusion set and independently
81
+ recompute every included file and aggregate.
82
+
83
+ Platform-neutral workload and secret references are identifiers, not general
84
+ URLs. They use `scheme://authority/path` with a reviewed additive scheme
85
+ registry (`aws-sm`, `iam-role`, `k8s-sa`, `secretref`, `spiffe`, `vault`,
86
+ `vault-v2`). A new platform extends that registry in a contracts release.
87
+ Userinfo, ports, percent encoding, query strings, fragments and empty path
88
+ segments are deliberately unrepresentable, preventing reference fields from
89
+ becoming a credential or arbitrary-value transport.
90
+
91
+ The v2 metering schemas are projections linked to existing v1 policy/trace
92
+ identities. During migration, consumers dual-read v1 and v2 and may dual-write
93
+ both. Old records are never rewritten; corrections are append-only adjustment
94
+ or superseding records. Removal of v1 writes requires separately recorded
95
+ consumer cutover evidence.
96
+
60
97
  ## Consuming
61
98
 
62
99
  - **Go:** `go get github.com/Fourier-Labs-AI/harbour-contracts/gen-go@v0.1.0`
63
100
 
64
101
  Two things make this work, and the second is not the obvious one.
65
102
 
66
- **The tag must be 3-part semver.** Go requires exactly `vMAJOR.MINOR.PATCH`, so the
67
- repo's 4-digit `VERSION` (`0.1.0.0`) cannot be a Go tag — the proxy rejects it. Each
68
- release carries **two** tags on the same commit: `v0.1.0.0` (repo version, what
69
- `/ship` manages) and `v0.1.0` (Go module). Keep the first three components identical.
103
+ **The publish tag must be 3-part semver.** Go and npm require
104
+ `MAJOR.MINOR.PATCH`, while this repository records
105
+ `MAJOR.MINOR.PATCH.MICRO`. A publishable release therefore requires MICRO to
106
+ be zero and maps deterministically: repository `0.9.0.0` → package `0.9.0` →
107
+ publish tag `v0.9.0`. The optional four-part bookkeeping tag `v0.9.0.0` may
108
+ point at the same commit but does not publish. CI verifies this mapping,
109
+ the changelog heading and either tag form.
70
110
 
71
111
  **The repo is private, and Go fetches it from a global cache.** Set this once per
72
112
  machine:
@@ -0,0 +1,134 @@
1
+ {
2
+ "schema": "harbour.contract-release/1.0",
3
+ "repositoryVersion": "0.9.0.0",
4
+ "publishVersion": "0.9.0",
5
+ "publishTag": "v0.9.0",
6
+ "schemasDigest": "sha256:df73090b9fbbac8a39d0ec92e929f4d687bd7920de583fb2463bf8570dc68ebb",
7
+ "aiFixturesDigest": "sha256:180a5f30cf0b6d93fa4c812a217d2365ffe22ac54d11626e71f8072fcf8f67c6",
8
+ "generatedGoDigest": "sha256:be376911aec8ee6359a38fdafebf343ce157255e19c544617b7bcccd4329e5de",
9
+ "generatedTypeScriptDigest": "sha256:857288e60b476b42dce0304ec05aff6af1f2719278959ed03740ef88af5e736b",
10
+ "generatedExclusions": {
11
+ "gen-go/contract_release.go": "contains the generated aggregate digests (self-reference)",
12
+ "gen-ts/contract-release.ts": "contains the generated aggregate digests (self-reference)"
13
+ },
14
+ "schemas": {
15
+ "schema/ai-budget-ledger-event.schema.json": "sha256:8396a1b3457bed3496dc7b60fb7fb30f76bbe3c60a20501823a61c75f2fdbafa",
16
+ "schema/ai-callsite-inventory.schema.json": "sha256:b15899a97cf108e4cd1bfd31ec40c57b341590ddb9c118fdaa904215dbe01859",
17
+ "schema/ai-classification-stamp.schema.json": "sha256:ad7f01dc8bb9a1cd619fce470227914aa3ef2ad57d34bfeaa0c6ef753aa6781d",
18
+ "schema/ai-composite-policy-digest.schema.json": "sha256:3efccc249327e59f67a37fd954b524ee727a3e28a3c557a46d6ec1f15d69b34e",
19
+ "schema/ai-deployment-gate-decision.schema.json": "sha256:bae1bdf91777b9a78f8da5a29f06b5de7f1e235789cf16b1bb507e85ad0243ff",
20
+ "schema/ai-gateway-key-lifecycle-event.schema.json": "sha256:ba5cb862abe73227bee714b25247b4cacb34f11fdd1476bb5f920923fd75e2a9",
21
+ "schema/ai-gateway-key-lookup.schema.json": "sha256:e994d4782c9bc4f14d3a1c35c9ac1e7a5ec84284cde5b3af7e3e6022130ddbb3",
22
+ "schema/ai-governance-decision.schema.json": "sha256:4d45c8540908bebb68456c45077c0cd453b416a3b955cc710de270950e090f50",
23
+ "schema/ai-metering-policy.schema.json": "sha256:e036885c170ce654740353aaaa01b2a7bcff714e73629123d7865af98c1cf303",
24
+ "schema/ai-policy-snapshot.schema.json": "sha256:dde70f30f4a501cfa65fc4d8da954d902e1c4cc966573fbe654eaea7bdeefca9",
25
+ "schema/ai-pricing-revision.schema.json": "sha256:75ccb847ac090821d817e92dc98dff49e29620018f8dc465b47f3617585d5b21",
26
+ "schema/ai-runtime-binding.schema.json": "sha256:e86cac2f70a474997bdef1577ca15f22982ec0ce866921df3f763c4d7f7fa191",
27
+ "schema/ai-runtime-contract.schema.json": "sha256:694cf8900ebe07a37ba0f12f50d2eed76e6608dc809e2b65969043e548dc4bba",
28
+ "schema/ai-trace-event-v2.schema.json": "sha256:946489fe9d58de5acf4a265d250800b4ad7b08aaacc50b00ef39feabe7aae94e",
29
+ "schema/ai-trace-event.schema.json": "sha256:47c2268c9b8dbcf6e7908aeef43e71210f8a309bf4be4acc02139f9b59e7c717",
30
+ "schema/ai-transform-event.schema.json": "sha256:b845762e653b19afdaf959f7bd1624db490cd10c760daa9aaa61fb83f2a86b6e",
31
+ "schema/ai-transform-result.schema.json": "sha256:244e380a36957ab2dcb526ea22aaecb56b53664ce1fda6934d0021c084c99133",
32
+ "schema/ai-verification-evidence.schema.json": "sha256:bdbc762df256d2a8dd0bdda60d4d13915ce40034cd756af9515871d145f10ad9",
33
+ "schema/api-error-response.schema.json": "sha256:3d43d5bdf0b59c944e20509d832e6776c3ecdba4d6c245a9118bbe52062a8304",
34
+ "schema/artifact-contract.schema.json": "sha256:f4d14d71ed754c9c8c2b03babd4666ace7d94dd4851ee548227bf1235404a814",
35
+ "schema/data-dependency.schema.json": "sha256:89ba8481ccabc935e7dab5d13871c985839a751ad1586710d8382a15e1f3340c",
36
+ "schema/data-grant.schema.json": "sha256:e640553831ecc1c01cc9a37fe388b84d0ffeaa0d0050e63712b48f65fa437c8a",
37
+ "schema/data-source.schema.json": "sha256:5a809171cc97f5778ca37db300d454098ce1c2d9071d2380550707b049899a75",
38
+ "schema/deploy-request.schema.json": "sha256:4caed64c8c2f8b7638675b128ac8d58e735bb727262462fe81679b3c12ce1c36",
39
+ "schema/deploy-response.schema.json": "sha256:8ab86b31f6a3f91b0daba9b21aa3d00bbd1aae4605dff8b229e7eb4de062c6f6",
40
+ "schema/deployment-environment.schema.json": "sha256:3f1325d5579b3fc47d02c83b6ac0657108909b1dfb901f68203c9c8b668c2ef4",
41
+ "schema/deployment-source.schema.json": "sha256:256988b1efbfc90bd0e1ae31a2c5d69b20ef1e4471dc24c9f9aa759278270fbe",
42
+ "schema/deployment-status-failure.schema.json": "sha256:1a182e603d22467a4be507a37fd10698f6f3178d314d33eaf5de2c7f687c9412",
43
+ "schema/deployment-status-request.schema.json": "sha256:1f9f87adc947a252b53b61f71ae17f8c1b8fbc1166f31301a043d11ac257dc66",
44
+ "schema/deployment-status-response.schema.json": "sha256:9583c36df8100cadbae74c909b59344cbc43585b09b66010c591d721054ece1a",
45
+ "schema/env-bindings.schema.json": "sha256:ae09bc4ca5508afa698ef854a59153c4c6f99b07017b48cb9b07ce05abad12f2",
46
+ "schema/error-category.enum.json": "sha256:e215fe3dc254cf7fca6785f3a12aaeee9d28811b6625916630adda1ed5fc1a14",
47
+ "schema/error-envelope.schema.json": "sha256:75dccda7dd16fdf8435deda53fc7dbcdc109b65114617a17f11763010c656f90",
48
+ "schema/kvs-routing-entry.schema.json": "sha256:b75f3a5dfa93a428b2764e03222b66b6ef2bed980f8bac8ffac54afdf3526bc5",
49
+ "schema/promotion-request.schema.json": "sha256:22b726a9b92f3a6833386fe05f63ae705bcdfc83db215c28b39465068368a3c3",
50
+ "schema/promotion-response.schema.json": "sha256:8ffb1683e31419d87a1d7a499d7eb06d411b37ffaf8663a81f5e1a11e0f3417d",
51
+ "schema/secret-reference.schema.json": "sha256:966f7a6d2575b46a4b54804d06dc05c6229ebbcbd9200fe6a6c8d3b4ffb90f9f",
52
+ "schema/transform-report.schema.json": "sha256:10ba5faa915b3a9327909b0444a163f8e31f51b9f1b3d049ea341e8cedc521e1",
53
+ "schema/version-state.schema.json": "sha256:e7c4b2e7b615ebb07f36d0df22ded51b2c9688ef9e9bfe79de1d5cd94de9ae40"
54
+ },
55
+ "aiFixtures": {
56
+ "fixtures/ai/valid-blocked-trace-event.json": "sha256:c72e753f5ed805d97b47af5cc57ea2fe9034f27b133bf0f5c6565fbc0c6693c1",
57
+ "fixtures/ai/valid-budget-ledger-event.json": "sha256:f56ee5339e549da44be1a30ac9ab08e209ff06749910bedfd66f47ef37c92877",
58
+ "fixtures/ai/valid-classification-stamp.json": "sha256:bf8256cec5626031b4cf5acfe9ffde73100150ba19259c36b274e1be0820bb73",
59
+ "fixtures/ai/valid-composite-policy-digest.json": "sha256:d13f2d022f9a29230103845b8af42b4f90c0d818ee64e6efaa31f5a547d9eeb7",
60
+ "fixtures/ai/valid-deployment-gate-decision.json": "sha256:cf070be5b6b4b4363d72aba448c1f23c1eef288e930a7f0a2807598a30a7e0af",
61
+ "fixtures/ai/valid-failed-trace-event.json": "sha256:3c25816ddae6f4f9448ffd8c6144631c341fe8f19f932efe981757b5e221df87",
62
+ "fixtures/ai/valid-gateway-key-lifecycle-event.json": "sha256:e8730526f7616adf7f2bc5cc29f566eadcf46d25b61807ed3c083956dd70d323",
63
+ "fixtures/ai/valid-gateway-key-lookup.json": "sha256:a577cbdd019a7f39631e7efdb12dccb4377e3184d626a79979bfc426d04a50f4",
64
+ "fixtures/ai/valid-governance-decision.json": "sha256:0cd3ffc5244e177af00670c6d839814a93048157cf11ccb738ed13b10d875c55",
65
+ "fixtures/ai/valid-inventory.json": "sha256:3bb29df5525c3a69f6c13c203fbd08bb3d493ae5416fdd2f99125c74bbc11759",
66
+ "fixtures/ai/valid-metering-policy.json": "sha256:791892d2b70b999b6b4eb37ba0db6df579bb4a7dc31411c1edd5fc41f9f10600",
67
+ "fixtures/ai/valid-policy-snapshot.json": "sha256:862fb81b2a77f152c5f0d9f04542b8a93e5d0a3d88a518263a550c4ca0047f60",
68
+ "fixtures/ai/valid-pricing-revision.json": "sha256:ff7bfdccc1fd4173cf0cf0800fb953e60de55286b0bba557fac9c6a4e5984f81",
69
+ "fixtures/ai/valid-runtime-binding.json": "sha256:df971a518b8e680bb5260e801e7a0b03dd05076aeb11258205ec5ec205719f53",
70
+ "fixtures/ai/valid-runtime-contract.json": "sha256:a6af61297f2612679112675e9d401685966e58b891720014e3a5176426850006",
71
+ "fixtures/ai/valid-trace-event-v2.json": "sha256:001bc0bfb64bb2c161e10e49347727887302fba067c7a1ced511f17457867451",
72
+ "fixtures/ai/valid-trace-event.json": "sha256:42451ebfb0dc0c475baf6bc1acc3d1006cc2294df37174764e936519b7d64100",
73
+ "fixtures/ai/valid-transform-event.json": "sha256:6d99d5f34c010b39b194ff49a4c279d88bc7f05c697bacf088791352ca2d6330",
74
+ "fixtures/ai/valid-transform-result.json": "sha256:406f6deae648837f7610fda38f6b4c1a1a73b83b7a96f9f427fcf4e2061dee50",
75
+ "fixtures/ai/valid-verification-evidence.json": "sha256:899a486ab4c0c1fff96568bc01f798280886439f4cfb47cf66cb59001141000f"
76
+ },
77
+ "generatedGo": {
78
+ "gen-go/ai_composite_policy_digest_helper.go": "sha256:31b4d9b4afd965b9869acbd3a58527949402f6711f624f2a4f02b3c6e406f71f",
79
+ "gen-go/ai_contracts_test.go": "sha256:8dc5aa4e3ef6a82b988dbc3f88b9ee80003eda3a0c10ec58d1804ed95282c330",
80
+ "gen-go/ai_gateway_key_token.go": "sha256:859c34383955f21c22589158214df074b74de6907a54bee7c781acfa9dad8679",
81
+ "gen-go/contracts_test.go": "sha256:f15c34da8758ab4f81c4ea3f03382010a1a5a83159dd0dc18abc9c543d77951e",
82
+ "gen-go/doc.go": "sha256:c17bc2d39ed175ce7105c68305f8ae7152f659eb7cd187ecceee7698eb3a65dd",
83
+ "gen-go/error_category.go": "sha256:e36745796e32f753cf153a76c5f77c4bdf37a6a228e6607abcf95cac6f4a934b",
84
+ "gen-go/schema_documents.go": "sha256:c0399930c719b93d850847b257186f08d69a527f3ac1286ed0c49b66327b315a",
85
+ "gen-go/types.go": "sha256:9dc516c9f3e8f1b53f12cd581667c728b757e5f401021f3ac46946a633b7ad0b",
86
+ "gen-go/version_state.go": "sha256:827f8768359998409b86ea02d9ba1a149981928bae7161e4dc95fe0520ce7410"
87
+ },
88
+ "generatedTypeScript": {
89
+ "gen-ts/ai-budget-ledger-event.ts": "sha256:26454e6adc34b7c202cfb2888753b164b22dcd2d9f7a0b10c835a0db9132f36f",
90
+ "gen-ts/ai-callsite-inventory.ts": "sha256:2665ffe965056b85a7f03db22071d56ce6d21d306a82a876908d0727ef2315dc",
91
+ "gen-ts/ai-classification-stamp.ts": "sha256:dce78efba03df86a0986a16fd54c52066d322ff515d2463dbc45cafad82ecb44",
92
+ "gen-ts/ai-composite-policy-digest-helper.ts": "sha256:d6c51d0c35599ee4f81d605b71773f4fff41a0bb46499ff0c6185072fedf53ce",
93
+ "gen-ts/ai-composite-policy-digest.ts": "sha256:26b72227ca511d744c0f27fa0c85eb1ba6451ee380e38371e58a810898cfae96",
94
+ "gen-ts/ai-deployment-gate-decision.ts": "sha256:e2b5aeccdf0c8785f9621e9d54fc072ebfce029804becb2c396a737cdde17350",
95
+ "gen-ts/ai-gateway-key-lifecycle-event.ts": "sha256:8f1ab4774be1959e82c97da20ec8b293f3f10262f95393d2ae57e4c7817353cb",
96
+ "gen-ts/ai-gateway-key-lookup.ts": "sha256:e55fc9a2252d5e7e1a383a58c8b92f22d8147ee4862a893a6cfe815b4225fc00",
97
+ "gen-ts/ai-gateway-key-token.ts": "sha256:ff6551ad3332cc665878d7ec93f42ce185c375e637531b2fbc82c697b877e784",
98
+ "gen-ts/ai-governance-decision.ts": "sha256:efc422971a06d741e048c81f299ce258d7fdd4b7f036a2b9dda7aaca0679e950",
99
+ "gen-ts/ai-metering-policy.ts": "sha256:7dc951dbc208721de6c881219524c6075c92523e7884e31d934899c36b43f24e",
100
+ "gen-ts/ai-policy-snapshot.ts": "sha256:58e53c5468e65b6a229905c21cd05a34935242c4c55564cf292da675a44b3afa",
101
+ "gen-ts/ai-pricing-revision.ts": "sha256:87ee18e16ae5fa10f64ceed52e07bb05a4860f4b6303ad678cb0d35d23fdb1d5",
102
+ "gen-ts/ai-runtime-binding.ts": "sha256:176c830d400ce44c508f8d249bb3c9724b2d595b78262615487cdafc4790263e",
103
+ "gen-ts/ai-runtime-contract.ts": "sha256:fc60f5c45edfee7d6f37e99ed9a60e4e5c22bba5793593aa259f028e1c7d0c6e",
104
+ "gen-ts/ai-trace-event-v2.ts": "sha256:9c453805316d471eb8acac04f33f931d5a441560a249bef990ec8451606d86b8",
105
+ "gen-ts/ai-trace-event.ts": "sha256:1e714996dc4622e94c6ae144a7bdb09147306940db47ae788aafd6f7f8311b0c",
106
+ "gen-ts/ai-transform-event.ts": "sha256:c8b520e01ce12b0e3a5ebe03a3ca63cc83368f26e1eef933de732c4fc1c504f9",
107
+ "gen-ts/ai-transform-result.ts": "sha256:208c66b2aeb425c0cbcc18b7191f6e8989443f2b2c1690648e0e06cc1448ce25",
108
+ "gen-ts/ai-verification-evidence.ts": "sha256:979439d77f8b47631d1eb3b6c3c54ea6fec41089d2a51dc815fd370b1c4917fc",
109
+ "gen-ts/api-error-response.ts": "sha256:0fd73be282e7a5d72d6c343a4e64d09c232556b16161167f0cffd6278ed7e3d3",
110
+ "gen-ts/artifact-contract.ts": "sha256:2c1b3986e3561553c53db1a6f406924e7bb22205dce969d8aecaa238707a2072",
111
+ "gen-ts/data-dependency.ts": "sha256:0572c31d7ae9088eccc104eee1a205bf176d1d6dacfaf0f290d666024e284966",
112
+ "gen-ts/data-grant.ts": "sha256:2358579d8aa1e57b01a6f2b0eacce5531e7f21ef226404c9809925365e0d6155",
113
+ "gen-ts/data-source.ts": "sha256:71be83b050468c2ea8c5830d28f1837c2b5929d23b4fdf6661bc5bfe8999904c",
114
+ "gen-ts/deploy-request.ts": "sha256:7dd26aa2e35c8ab17af6d8b76327662b41a65f3816b3fe105b0e69de4b163f78",
115
+ "gen-ts/deploy-response.ts": "sha256:7695fd32450f187204ef1d031d1de32d35b88eb3cb2bfbffd604872303b627d3",
116
+ "gen-ts/deployment-environment.ts": "sha256:bbd6eec3a1631b13a8de6e6b95081696f7be01d0bd2bf1b7a9e3a1db809a727c",
117
+ "gen-ts/deployment-source.ts": "sha256:8ccb55aaa7260eb6d19a00987d6a20a4b514e343564da13f27cd7fee8013500a",
118
+ "gen-ts/deployment-status-failure.ts": "sha256:3ffe268e32240f9da3172b161b8e99e06aa2d21d8c37b30f340506a337c64047",
119
+ "gen-ts/deployment-status-request.ts": "sha256:7ddccd07ab9f6d0821903a291ab35f903bb055727e03a058b99165ec048f6483",
120
+ "gen-ts/deployment-status-response.ts": "sha256:b6916c226a6965368642d821d4b9c029649d00d27d7e09996fc1927fcc698401",
121
+ "gen-ts/env-bindings.ts": "sha256:a167cfe9842352c9fec6412ff0d82bda9c5f5c3a1af541bd5c27a57f54fd0941",
122
+ "gen-ts/error-category-registry.ts": "sha256:327a75153684b161f07ed3f5321048ff928147acdde6b52db9cafd59c48b17c4",
123
+ "gen-ts/error-category.ts": "sha256:9bda89180c3b740c9aa8be466216592e8ca9d0d368c274333edf6ea5c45afd8e",
124
+ "gen-ts/error-envelope.ts": "sha256:4457309be794f9d4fc0cf62530cc2d442c007bac9ae84aff66df099cc9e40310",
125
+ "gen-ts/index.ts": "sha256:24af68e75520e6006abd04ee0cfbc0fc0d134580c116f3ee33c130b867e8ba88",
126
+ "gen-ts/kvs-routing-entry.ts": "sha256:d92e85ee9f257d77850d1d3aac9438e2055f38084ff84a48fcedae239d47d4ca",
127
+ "gen-ts/promotion-request.ts": "sha256:a613b930e3ea5b26d5503d8ee1d3c83b424dc4acb880edad52504302f9c2ec5f",
128
+ "gen-ts/promotion-response.ts": "sha256:a9865c9a64d2bca986c1cba0baa842bdc863dd1a1afafc44ac9782f2f11f1b09",
129
+ "gen-ts/secret-reference.ts": "sha256:a8b65de72705b6f51f57cd8ca58881483108005b1fa4d19106c3e9cf1fa877e7",
130
+ "gen-ts/transform-report.ts": "sha256:154617c0bc4b8e36d7edd07640454c89fad8ec34b02aa85c904c9acd9855a6c3",
131
+ "gen-ts/version-state-machine.ts": "sha256:4371bc7e2bde86b0447f5242104c576cc160dfd7dae1885acbfb63540f230bdd",
132
+ "gen-ts/version-state.ts": "sha256:a835112930299e7b593a1b8810b7414f6c9e809da2092306c743128170a3b702"
133
+ }
134
+ }
@@ -0,0 +1,21 @@
1
+ export type AiBudgetIdentifier = string;
2
+ export type AiBudgetDigest = string;
3
+ /**
4
+ * Append-only v2 committed-exposure ledger event. Amounts are integer micro-USD and replay is identified by idempotencyKey.
5
+ */
6
+ export interface AiBudgetLedgerEvent {
7
+ schema: 'harbour.ai-budget-ledger-event/2.0';
8
+ eventId: AiBudgetIdentifier;
9
+ idempotencyKey: AiBudgetIdentifier;
10
+ budgetScope: AiBudgetIdentifier;
11
+ period: AiBudgetIdentifier;
12
+ eventType: 'RESERVED' | 'SETTLED' | 'REPAIRED' | 'ADJUSTED';
13
+ reservationId: AiBudgetIdentifier;
14
+ requestId?: AiBudgetIdentifier;
15
+ amountMicroUsd: number;
16
+ committedMicroUsdAfter: number;
17
+ pricingRevisionDigest?: AiBudgetDigest;
18
+ supersedesEventId?: AiBudgetIdentifier;
19
+ eventDigest: AiBudgetDigest;
20
+ occurredAt: string;
21
+ }
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ export {};
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Immutable, value-free classification evidence for one exact version and source revision. Unavailable evidence is explicit and never interpreted as clean.
3
+ */
4
+ export type AiClassificationStamp = {
5
+ schema: 'harbour.ai-classification-stamp/1.0';
6
+ stampId: AiClassificationIdentifier;
7
+ tenantId: AiClassificationIdentifier;
8
+ appId: AiClassificationIdentifier;
9
+ environment: AiClassificationIdentifier;
10
+ versionId: string;
11
+ sourceRevision: string;
12
+ status: 'AVAILABLE' | 'UNAVAILABLE';
13
+ classification?: 'Green' | 'Yellow' | 'Orange' | 'Red';
14
+ classifierId: AiClassificationIdentifier;
15
+ classifierVersion: string;
16
+ sourceDigest: AiClassificationDigest;
17
+ inventoryDigest?: AiClassificationDigest;
18
+ securityEvidenceDigest?: AiClassificationDigest;
19
+ evidenceDigest: AiClassificationDigest;
20
+ stampDigest: AiClassificationDigest;
21
+ unavailableReason?: AiClassificationIdentifier;
22
+ stampedAt: string;
23
+ };
24
+ export type AiClassificationIdentifier = string;
25
+ export type AiClassificationDigest = string;
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { AiCompositePolicyDigestInput } from './ai-composite-policy-digest.js';
2
+ /** Exact UTF-8 digest preimage. Field order is fixed by schema x-digest; absence is the literal hyphen. */
3
+ export declare function compositePolicyDigestPreimage(input: AiCompositePolicyDigestInput): string;
4
+ /** Canonical composite policy digest including sha256: prefix. */
5
+ export declare function computeCompositePolicyDigest(input: AiCompositePolicyDigestInput): string;
@@ -0,0 +1,13 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ import { createHash } from 'node:crypto';
4
+ const domain = "harbour.ai-composite-policy-digest/1";
5
+ const absent = "-";
6
+ /** Exact UTF-8 digest preimage. Field order is fixed by schema x-digest; absence is the literal hyphen. */
7
+ export function compositePolicyDigestPreimage(input) {
8
+ return [domain, input.baselineDigest ?? absent, input.classificationStampDigest ?? absent, input.tenantPolicyDigest ?? absent, input.applicationPolicyDigest ?? absent, input.versionOverrideDigest ?? absent].join('\n');
9
+ }
10
+ /** Canonical composite policy digest including sha256: prefix. */
11
+ export function computeCompositePolicyDigest(input) {
12
+ return 'sha256:' + createHash('sha256').update(compositePolicyDigestPreimage(input), 'utf8').digest('hex');
13
+ }
@@ -0,0 +1,12 @@
1
+ export type AiCompositePolicyDigest = string;
2
+ /**
3
+ * The complete ordered identity input for one composite policy digest. The digest is SHA-256 over the UTF-8 preimage specified by x-digest; missing optional layer digests use the literal hyphen sentinel.
4
+ */
5
+ export interface AiCompositePolicyDigestInput {
6
+ schema: 'harbour.ai-composite-policy-digest/1.0';
7
+ baselineDigest: AiCompositePolicyDigest;
8
+ classificationStampDigest: AiCompositePolicyDigest;
9
+ tenantPolicyDigest?: AiCompositePolicyDigest;
10
+ applicationPolicyDigest?: AiCompositePolicyDigest;
11
+ versionOverrideDigest?: AiCompositePolicyDigest;
12
+ }
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ export {};
@@ -0,0 +1,27 @@
1
+ /**
2
+ * One append-only deployment gate decision. Corrections are new records linked by supersedesDecisionId; existing records are never overwritten.
3
+ */
4
+ export type AiDeploymentGateDecision = {
5
+ schema: 'harbour.ai-deployment-gate-decision/1.0';
6
+ decisionId: AiGateIdentifier;
7
+ sequence: number;
8
+ supersedesDecisionId?: AiGateIdentifier;
9
+ tenantId: AiGateIdentifier;
10
+ appId: AiGateIdentifier;
11
+ environment: AiGateIdentifier;
12
+ versionId: string;
13
+ sourceRevision: string;
14
+ decision: 'PASS' | 'BLOCKED';
15
+ /**
16
+ * @maxItems 64
17
+ */
18
+ reasonCodes: AiGateIdentifier[];
19
+ classificationStampDigest: AiGateDigest;
20
+ planDigest: AiGateDigest;
21
+ policyDigest: AiGateDigest;
22
+ evidenceDigest: AiGateDigest;
23
+ decisionDigest: AiGateDigest;
24
+ decidedAt: string;
25
+ };
26
+ export type AiGateIdentifier = string;
27
+ export type AiGateDigest = string;
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ export {};
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Append-only, value-free lifecycle evidence for one version-scoped Gateway key.
3
+ */
4
+ export type AiGatewayKeyLifecycleEvent = ({
5
+ fromStatus?: 'NONE';
6
+ toStatus?: 'PENDING';
7
+ } | {
8
+ fromStatus?: 'PENDING';
9
+ toStatus?: 'ACTIVE';
10
+ } | {
11
+ fromStatus?: 'PENDING';
12
+ toStatus?: 'REVOKED';
13
+ } | {
14
+ fromStatus?: 'ACTIVE';
15
+ toStatus?: 'REVOKED';
16
+ } | {
17
+ fromStatus?: 'REVOKED';
18
+ toStatus?: 'DELETION_SCHEDULED';
19
+ } | {
20
+ fromStatus?: 'DELETION_SCHEDULED';
21
+ toStatus?: 'DELETED';
22
+ }) & {
23
+ schema: 'harbour.ai-gateway-key-lifecycle-event/1.0';
24
+ eventId: AiKeyLifecycleIdentifier;
25
+ sequence: number;
26
+ keyId: string;
27
+ tenantId: AiKeyLifecycleIdentifier;
28
+ appId: AiKeyLifecycleIdentifier;
29
+ environment: AiKeyLifecycleIdentifier;
30
+ versionId: string;
31
+ fromStatus: AiKeyLifecycleStatus;
32
+ toStatus: AiKeyLifecycleStatus;
33
+ cause: 'PLAN' | 'ACTIVATION' | 'FAILED' | 'STALE' | 'SUPERSEDED' | 'VERSION_DELETED' | 'MANUAL_REVOKE' | 'OVERLAP_EXPIRED' | 'RECONCILIATION';
34
+ secretRef?: AiKeyLifecycleSafeReference;
35
+ overlapExpiresAt?: string;
36
+ eventDigest: AiKeyLifecycleDigest;
37
+ occurredAt: string;
38
+ };
39
+ export type AiKeyLifecycleIdentifier = string;
40
+ export type AiKeyLifecycleStatus = 'NONE' | 'PENDING' | 'ACTIVE' | 'REVOKED' | 'DELETION_SCHEDULED' | 'DELETED';
41
+ /**
42
+ * Value-free hierarchical secret reference using the additive reviewed scheme registry; no userinfo, query, fragment, port or percent encoding.
43
+ */
44
+ export type AiKeyLifecycleSafeReference = string;
45
+ export type AiKeyLifecycleDigest = string;
46
+ /** True iff from→to is a legal AiKeyLifecycleStatus edge (schema x-transitions). */
47
+ export declare function canTransitionAiKeyLifecycleStatus(from: string, to: string): boolean;
48
+ /** True iff the AiKeyLifecycleStatus is terminal (DELETED). */
49
+ export declare function isTerminalAiKeyLifecycleStatus(state: string): boolean;
@@ -0,0 +1,16 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ const legalAiKeyLifecycleStatusTransitions = {
4
+ "NONE": { "PENDING": true },
5
+ "PENDING": { "ACTIVE": true, "REVOKED": true },
6
+ "ACTIVE": { "REVOKED": true },
7
+ "REVOKED": { "DELETION_SCHEDULED": true },
8
+ "DELETION_SCHEDULED": { "DELETED": true },
9
+ };
10
+ const terminalAiKeyLifecycleStatusStates = new Set(["DELETED"]);
11
+ /** True iff from→to is a legal AiKeyLifecycleStatus edge (schema x-transitions). */
12
+ export function canTransitionAiKeyLifecycleStatus(from, to) {
13
+ return Boolean(legalAiKeyLifecycleStatusTransitions[from]?.[to]);
14
+ }
15
+ /** True iff the AiKeyLifecycleStatus is terminal (DELETED). */
16
+ export function isTerminalAiKeyLifecycleStatus(state) { return terminalAiKeyLifecycleStatusStates.has(state); }
@@ -51,6 +51,10 @@ export type AiInterceptionPlanEntry = {
51
51
  runtimeShimVersion?: string;
52
52
  runtimeShimDigest?: AiDecisionDigest;
53
53
  };
54
+ /**
55
+ * Platform-neutral value-free hierarchical reference using the additive reviewed scheme registry; no userinfo, query, fragment, port or percent encoding.
56
+ */
57
+ export type AiDecisionSafeReference = string;
54
58
  export interface AiDecisionRuntimeContract {
55
59
  schema: 'harbour.ai-runtime-contract/1.0';
56
60
  tenantId: AiDecisionIdentifier;
@@ -66,9 +70,17 @@ export interface AiDecisionRuntimeContract {
66
70
  embeddings?: string;
67
71
  };
68
72
  policyDigest: AiDecisionDigest;
73
+ runtimeBinding?: AiDecisionRuntimeBinding;
69
74
  /**
70
75
  * @minItems 1
71
76
  * @maxItems 2
72
77
  */
73
78
  requiredStrategies: ('deployment_injection' | 'deterministic_adapter')[];
74
79
  }
80
+ export interface AiDecisionRuntimeBinding {
81
+ schema: 'harbour.ai-runtime-binding/1.0';
82
+ platform: string;
83
+ workloadIdentityRef: AiDecisionSafeReference;
84
+ secretRef: AiDecisionSafeReference;
85
+ runtimeBindingDigest: AiDecisionDigest;
86
+ }
@@ -0,0 +1,16 @@
1
+ export type AiMeteringPolicyDigest = string;
2
+ /**
3
+ * Additive v2 metering-policy binding. It binds a composite policy to immutable pricing revisions without changing the v1 policy snapshot.
4
+ */
5
+ export interface AiMeteringPolicy {
6
+ schema: 'harbour.ai-metering-policy/2.0';
7
+ policyDigest: AiMeteringPolicyDigest;
8
+ /**
9
+ * @minItems 1
10
+ * @maxItems 512
11
+ */
12
+ pricingRevisionDigests: AiMeteringPolicyDigest[];
13
+ reservationMode: 'committed_exposure';
14
+ policyDigestV2: AiMeteringPolicyDigest;
15
+ publishedAt: string;
16
+ }
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ export {};
@@ -0,0 +1,29 @@
1
+ export type AiPricingIdentifier = string;
2
+ export type AiPricingDigest = string;
3
+ /**
4
+ * Immutable v2 line-item pricing revision. A correction is a new revision; published records are never edited.
5
+ */
6
+ export interface AiPricingRevision {
7
+ schema: 'harbour.ai-pricing-revision/2.0';
8
+ revisionId: AiPricingIdentifier;
9
+ provider: 'openai' | 'anthropic' | 'gemini' | 'openrouter';
10
+ providerModel: string;
11
+ region?: AiPricingIdentifier;
12
+ currency: 'USD';
13
+ /**
14
+ * @minItems 1
15
+ * @maxItems 64
16
+ */
17
+ dimensions: PriceDimension[];
18
+ supersedesRevisionId?: AiPricingIdentifier;
19
+ revisionDigest: AiPricingDigest;
20
+ effectiveAt: string;
21
+ publishedAt: string;
22
+ }
23
+ export interface PriceDimension {
24
+ dimension: AiPricingIdentifier;
25
+ direction: 'input' | 'output';
26
+ unit: AiPricingIdentifier;
27
+ scale: number;
28
+ microUsdPerScale: number;
29
+ }
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * A value-free hierarchical identifier. Schemes are an additive reviewed registry; userinfo, ports, percent encoding, query strings, fragments and empty path segments are unrepresentable.
3
+ */
4
+ export type AiRuntimeSafeReference = string;
5
+ /**
6
+ * Platform-neutral, value-free binding of one workload identity to one version-scoped Harbour Gateway secret. Platform adapters may add implementation details internally; they never enter this contract.
7
+ */
8
+ export interface AiRuntimeBinding {
9
+ schema: 'harbour.ai-runtime-binding/1.0';
10
+ platform: string;
11
+ workloadIdentityRef: AiRuntimeSafeReference;
12
+ secretRef: AiRuntimeSafeReference;
13
+ runtimeBindingDigest: string;
14
+ }
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ export {};
@@ -1,6 +1,10 @@
1
1
  export type AiRuntimeIdentifier = string;
2
2
  export type AiRuntimeModelAlias = string;
3
3
  export type AiRuntimeDigest = string;
4
+ /**
5
+ * Platform-neutral value-free hierarchical reference using the additive reviewed scheme registry; no userinfo, query, fragment, port or percent encoding.
6
+ */
7
+ export type AiRuntimeContractSafeReference = string;
4
8
  /**
5
9
  * Immutable deployment runtime contract derived by an AI Governance PLAN decision. Contains only scoped configuration and a Secrets Manager reference, never key plaintext.
6
10
  */
@@ -19,9 +23,20 @@ export interface AiRuntimeContract {
19
23
  embeddings?: AiRuntimeModelAlias;
20
24
  };
21
25
  policyDigest: AiRuntimeDigest;
26
+ runtimeBinding?: AiRuntimeContractBinding;
22
27
  /**
23
28
  * @minItems 1
24
29
  * @maxItems 2
25
30
  */
26
31
  requiredStrategies: ('deployment_injection' | 'deterministic_adapter')[];
27
32
  }
33
+ /**
34
+ * Optional additive platform-neutral binding. Existing 1.0 records without it remain valid.
35
+ */
36
+ export interface AiRuntimeContractBinding {
37
+ schema: 'harbour.ai-runtime-binding/1.0';
38
+ platform: string;
39
+ workloadIdentityRef: AiRuntimeContractSafeReference;
40
+ secretRef: AiRuntimeContractSafeReference;
41
+ runtimeBindingDigest: AiRuntimeDigest;
42
+ }
@@ -0,0 +1,31 @@
1
+ export type AiTraceV2Digest = string;
2
+ export type AiTraceV2Identifier = string;
3
+ /**
4
+ * Additive metering projection linked to a readable v1 trace. It carries dimension-level reported or estimated usage without changing the v1 event.
5
+ */
6
+ export interface AiTraceEventV2 {
7
+ schema: 'harbour.ai-trace-event/2.0';
8
+ traceId: string;
9
+ requestId: string;
10
+ policyDigest: AiTraceV2Digest;
11
+ outcome: 'succeeded' | 'blocked' | 'failed' | 'cancelled';
12
+ /**
13
+ * @maxItems 256
14
+ */
15
+ usageLineItems: UsageLineItem[];
16
+ totalCostMicroUsd: number;
17
+ reservationId?: string;
18
+ meteringStatus: 'settled' | 'reserved' | 'unknown' | 'repaired';
19
+ occurredAt: string;
20
+ }
21
+ export interface UsageLineItem {
22
+ attempt: number;
23
+ dimension: AiTraceV2Identifier;
24
+ direction: 'input' | 'output';
25
+ quantity: number;
26
+ unit: AiTraceV2Identifier;
27
+ priceRevisionDigest: AiTraceV2Digest;
28
+ scale: number;
29
+ costMicroUsd: number;
30
+ provenance: 'reported' | 'estimated';
31
+ }
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ export {};
@@ -14,6 +14,7 @@ export interface AiVerificationEvidence {
14
14
  interceptionPlanDigest: AiVerificationDigest;
15
15
  runtimeContractDigest: AiVerificationDigest;
16
16
  policyDigest: AiVerificationDigest;
17
+ runtimeBindingDigest?: AiVerificationDigest;
17
18
  finalWorkspaceDigest: AiVerificationDigest;
18
19
  /**
19
20
  * @maxItems 1000
@@ -0,0 +1,7 @@
1
+ export declare const ContractRepositoryVersion: "0.9.0.0";
2
+ export declare const ContractPublishVersion: "0.9.0";
3
+ export declare const ContractPublishTag: "v0.9.0";
4
+ export declare const ContractSchemasDigest: "sha256:df73090b9fbbac8a39d0ec92e929f4d687bd7920de583fb2463bf8570dc68ebb";
5
+ export declare const ContractAiFixturesDigest: "sha256:180a5f30cf0b6d93fa4c812a217d2365ffe22ac54d11626e71f8072fcf8f67c6";
6
+ export declare const ContractGeneratedGoDigest: "sha256:be376911aec8ee6359a38fdafebf343ce157255e19c544617b7bcccd4329e5de";
7
+ export declare const ContractGeneratedTypeScriptDigest: "sha256:857288e60b476b42dce0304ec05aff6af1f2719278959ed03740ef88af5e736b";
@@ -0,0 +1,9 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ export const ContractRepositoryVersion = "0.9.0.0";
4
+ export const ContractPublishVersion = "0.9.0";
5
+ export const ContractPublishTag = "v0.9.0";
6
+ export const ContractSchemasDigest = "sha256:df73090b9fbbac8a39d0ec92e929f4d687bd7920de583fb2463bf8570dc68ebb";
7
+ export const ContractAiFixturesDigest = "sha256:180a5f30cf0b6d93fa4c812a217d2365ffe22ac54d11626e71f8072fcf8f67c6";
8
+ export const ContractGeneratedGoDigest = "sha256:be376911aec8ee6359a38fdafebf343ce157255e19c544617b7bcccd4329e5de";
9
+ export const ContractGeneratedTypeScriptDigest = "sha256:857288e60b476b42dce0304ec05aff6af1f2719278959ed03740ef88af5e736b";