@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
@@ -0,0 +1,25 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+
4
+ /**
5
+ * 202 Accepted body returned by POST /v1/tenants/{tenant}/apps/{app}/deployments only after the authoritative QUEUED version exists and its version-qualified SQS message is accepted.
6
+ */
7
+ export interface DeployResponse {
8
+ /**
9
+ * Caller correlation value. This is not the deployment identity.
10
+ */
11
+ requestId: string;
12
+ /**
13
+ * Immutable identity of the admitted preview version.
14
+ */
15
+ versionId: string;
16
+ tenant: string;
17
+ app: string;
18
+ environment: 'preview';
19
+ status: 'QUEUED';
20
+ acceptedAt: string;
21
+ /**
22
+ * Relative URL for exact-version Status. The versionId path segment is URL encoded.
23
+ */
24
+ statusUrl: string;
25
+ }
@@ -0,0 +1,7 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+
4
+ /**
5
+ * Public environment accepted by the preview deployment-control-plane APIs. The MVP accepts only preview; production remains reachable only through Harbour's human-merge promotion flow.
6
+ */
7
+ export type DeploymentEnvironment = 'preview';
@@ -0,0 +1,16 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+
4
+ /**
5
+ * Credential-free GitHub source supplied in the DeployRequest body. Credentials are resolved internally by MaterializeSource and never cross the API boundary.
6
+ */
7
+ export interface DeploymentSource {
8
+ /**
9
+ * Source provider. The preview MVP accepts only GitHub.
10
+ */
11
+ provider: 'github';
12
+ /**
13
+ * Credential-free HTTPS GitHub repository URL. Query strings, fragments, embedded credentials and non-github.com hosts are rejected.
14
+ */
15
+ repositoryUrl: string;
16
+ }
@@ -0,0 +1,12 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+
4
+ /**
5
+ * Frontend-safe failure projection nested in a failed DeploymentStatusResponse. Internal evidence references, AWS identifiers and raw provider errors are excluded.
6
+ */
7
+ export interface DeploymentStatusFailure {
8
+ category: string;
9
+ retryable: boolean;
10
+ message: string;
11
+ remediationHint: string;
12
+ }
@@ -0,0 +1,11 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+
4
+ /**
5
+ * Validated path parameters for GET /v1/tenants/{tenant}/apps/{app}/deployments/{versionId}. The Status Lambda constructs this object from API Gateway path parameters; it is not a GET request body.
6
+ */
7
+ export interface DeploymentStatusRequest {
8
+ tenant: string;
9
+ app: string;
10
+ versionId: string;
11
+ }
@@ -0,0 +1,39 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+
4
+ /**
5
+ * 200 OK body returned by GET /v1/tenants/{tenant}/apps/{app}/deployments/{versionId}. It describes that exact immutable version; newer deployments cannot change which record this response represents.
6
+ */
7
+ export interface DeploymentStatusResponse {
8
+ requestId: string;
9
+ versionId: string;
10
+ tenant: string;
11
+ app: string;
12
+ environment: 'preview' | 'prod';
13
+ status:
14
+ | 'QUEUED'
15
+ | 'ANALYZING'
16
+ | 'TRANSFORMING'
17
+ | 'VALIDATING'
18
+ | 'BUILDING'
19
+ | 'VERIFYING'
20
+ | 'GATING'
21
+ | 'LIVE'
22
+ | 'AWAITING-PROMOTION'
23
+ | 'PROMOTING'
24
+ | 'FAILED'
25
+ | 'STALE';
26
+ message: string;
27
+ branch: string;
28
+ commit: string;
29
+ requestedAt: string;
30
+ updatedAt: string;
31
+ url?: string;
32
+ failure?: StatusFailureProjection;
33
+ }
34
+ export interface StatusFailureProjection {
35
+ category: string;
36
+ retryable: boolean;
37
+ message: string;
38
+ remediationHint: string;
39
+ }
@@ -0,0 +1,64 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+
4
+ /**
5
+ * Resolved environment bindings (LLD §4.2.2). Deliberately COMPLETE — including BYOC/multi-cloud fields MVP does not use (roleArn/externalId absent = act in own account). Resolved once at admission by EnvResolver, stamped onto the version record; every downstream stage reads it from the record and never re-resolves. Adding a field bumps bindingsVersion and touches every consumer — that is the point. `executionCell` is where source-touching stages run (MVP: provider 'harbour').
6
+ */
7
+ export interface EnvBindings {
8
+ /**
9
+ * e.g. preview | prod.
10
+ */
11
+ env: string;
12
+ executor: Binding;
13
+ sql: Binding;
14
+ kv: Binding;
15
+ files: Binding;
16
+ secrets: Binding;
17
+ serving: Binding;
18
+ executionCell: Binding;
19
+ /**
20
+ * Ordered gate names evaluated at GATING.
21
+ */
22
+ gates: string[];
23
+ /**
24
+ * MVP: absent. Future: per-target constraints (region pins, size caps, …).
25
+ */
26
+ constraints?: {
27
+ [k: string]: unknown;
28
+ };
29
+ /**
30
+ * Stamped onto the version record for audit; bumps when the binding shape changes.
31
+ */
32
+ bindingsVersion: number;
33
+ }
34
+ /**
35
+ * provider + target + provider-specific `config` (LLD §4.2.2). The binding object itself is closed: a new first-class field is a deliberate schema change plus a bindingsVersion bump, never an ad-hoc key.
36
+ */
37
+ export interface Binding {
38
+ provider: string;
39
+ target: Target;
40
+ /**
41
+ * Provider-specific values, resolved at admission and stamped on the version record. MVP (StaticEnvResolver, from CDK stack outputs) e.g. sql: {clusterArn, proxyEndpoint, databaseName}; serving: {distributionId, bucket}. Kept as a named open map rather than loose top-level keys so BOTH generated languages preserve it faithfully — a Go struct silently drops unrecognized top-level keys, a map does not.
42
+ */
43
+ config?: {
44
+ [k: string]: unknown;
45
+ };
46
+ }
47
+ export interface Target {
48
+ /**
49
+ * MVP: own account id.
50
+ */
51
+ account: string;
52
+ /**
53
+ * MVP: us-east-1.
54
+ */
55
+ region: string;
56
+ /**
57
+ * BYOC cross-account role; absent in MVP = act locally.
58
+ */
59
+ roleArn?: string;
60
+ /**
61
+ * BYOC assume-role external id; absent in MVP.
62
+ */
63
+ externalId?: string;
64
+ }
@@ -0,0 +1,108 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+
4
+ export const ErrorCategories = {
5
+ IntakeNoEntrypoint: "intake.no-entrypoint",
6
+ IntakeUnsupportedRuntime: "intake.unsupported-runtime",
7
+ IntakeAttestationMissing: "intake.attestation-missing",
8
+ IntakeMultiAppRepo: "intake.multi-app-repo",
9
+ SecretsUnresolvable: "secrets.unresolvable",
10
+ SecretsReferenceUnresolvable: "secrets.reference-unresolvable",
11
+ SecretsPlaceholderUnresolved: "secrets.placeholder-unresolved",
12
+ SecretsLeakedInArtifact: "secrets.leaked-in-artifact",
13
+ StorageSqliteMisclassified: "storage.sqlite-misclassified",
14
+ StorageMappingDrift: "storage.mapping-drift",
15
+ TransformDeadlineExceeded: "transform.deadline-exceeded",
16
+ TransformValidationFailed: "transform.validation-failed",
17
+ FrontendEnvInlinedUnfixable: "frontend.env-inlined-unfixable",
18
+ BuildRecipeFailed: "build.recipe-failed",
19
+ BuildImageTooLarge: "build.image-too-large",
20
+ BrowserProbeFailed: "browser.probe-failed",
21
+ BrowserProbeUnavailable: "browser.probe-unavailable",
22
+ VerifySmokeFailed: "verify.smoke-failed",
23
+ VerifyCharacterizationDiverged: "verify.characterization-diverged",
24
+ VerifyMigrationFromZeroFailed: "verify.migration-from-zero-failed",
25
+ VerifyMigrationSeededFailed: "verify.migration-seeded-failed",
26
+ AuthAppPubliclyInvocable: "auth.app-publicly-invocable",
27
+ AuthIdentityHeaderContractViolated: "auth.identity-header-contract-violated",
28
+ GateSecurityScan: "gate.security-scan",
29
+ GateOrgApproverDeclined: "gate.org-approver-declined",
30
+ PromoteMigrationFailed: "promote.migration-failed",
31
+ PromoteStaticRebuildFailed: "promote.static-rebuild-failed",
32
+ RuntimePersistentComputeRequired: "runtime.persistent-compute-required",
33
+ RuntimeEgressBlocked: "runtime.egress-blocked",
34
+ AdmissionAppNotRegistered: "admission.app-not-registered",
35
+ DeployCommitNotOnBranch: "deploy.commit-not-on-branch",
36
+ DeployQueuePublicationFailed: "deploy.queue-publication-failed",
37
+ SourceBranchMoved: "source.branch-moved",
38
+ PromotionPreviewNotPromotable: "promotion.preview-not-promotable",
39
+ PromotionProductionBranchMoved: "promotion.production-branch-moved",
40
+ PromotionSourceTreeMismatch: "promotion.source-tree-mismatch",
41
+ PromotionArtifactMismatch: "promotion.artifact-mismatch",
42
+ PromotionIdempotencyConflict: "promotion.idempotency-conflict",
43
+ PromotionInProgress: "promotion.in-progress",
44
+ PromotionQueuePublicationFailed: "promotion.queue-publication-failed",
45
+ CutoverFlipFailed: "cutover.flip-failed",
46
+ } as const;
47
+
48
+ const retryableExact: Record<string, boolean> = {
49
+ "intake.no-entrypoint": false,
50
+ "intake.unsupported-runtime": false,
51
+ "intake.attestation-missing": false,
52
+ "intake.multi-app-repo": false,
53
+ "secrets.unresolvable": false,
54
+ "secrets.reference-unresolvable": false,
55
+ "secrets.placeholder-unresolved": false,
56
+ "secrets.leaked-in-artifact": false,
57
+ "storage.sqlite-misclassified": false,
58
+ "storage.mapping-drift": false,
59
+ "transform.deadline-exceeded": false,
60
+ "transform.validation-failed": true,
61
+ "frontend.env-inlined-unfixable": false,
62
+ "build.recipe-failed": false,
63
+ "build.image-too-large": false,
64
+ "browser.probe-failed": true,
65
+ "browser.probe-unavailable": false,
66
+ "verify.smoke-failed": false,
67
+ "verify.characterization-diverged": false,
68
+ "verify.migration-from-zero-failed": false,
69
+ "verify.migration-seeded-failed": false,
70
+ "auth.app-publicly-invocable": false,
71
+ "auth.identity-header-contract-violated": false,
72
+ "gate.security-scan": false,
73
+ "gate.org-approver-declined": false,
74
+ "promote.migration-failed": false,
75
+ "promote.static-rebuild-failed": false,
76
+ "runtime.persistent-compute-required": false,
77
+ "runtime.egress-blocked": false,
78
+ "admission.app-not-registered": false,
79
+ "deploy.commit-not-on-branch": false,
80
+ "deploy.queue-publication-failed": true,
81
+ "source.branch-moved": false,
82
+ "promotion.preview-not-promotable": false,
83
+ "promotion.production-branch-moved": false,
84
+ "promotion.source-tree-mismatch": false,
85
+ "promotion.artifact-mismatch": false,
86
+ "promotion.idempotency-conflict": false,
87
+ "promotion.in-progress": true,
88
+ "promotion.queue-publication-failed": true,
89
+ "cutover.flip-failed": false,
90
+ };
91
+ const retryableFamilies: Record<string, boolean> = {
92
+ "storage.unsupported-engine": false,
93
+ "transform.non-retryable": false,
94
+ "quota.exceeded": false,
95
+ "uncategorized": false,
96
+ };
97
+
98
+ /** Retryable lookup for a concrete or family-suffixed category. Unknown → false (fail closed). */
99
+ export function isRetryable(category: string): boolean {
100
+ if (category in retryableExact) return retryableExact[category];
101
+ let best = false, bestLen = -1;
102
+ for (const prefix of Object.keys(retryableFamilies)) {
103
+ if (category === prefix || category.startsWith(prefix + '.')) {
104
+ if (prefix.length > bestLen) { best = retryableFamilies[prefix]; bestLen = prefix.length; }
105
+ }
106
+ }
107
+ return best;
108
+ }
@@ -0,0 +1,7 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+
4
+ /**
5
+ * The closed failure-category enum T1b (LLD §2.2). Categories are hierarchical lowercase dot-paths; the histogram groups on any prefix. Some entries are FAMILIES (variable last segment, e.g. storage.unsupported-engine.<engine>) — at runtime a concrete token replaces the placeholder. Extended ONLY by PR to this file. Root validates any well-formed category string; x-registry is the source of truth for the per-category `retryable` flag and codegen constants.
6
+ */
7
+ export type ErrorCategory = string;
@@ -0,0 +1,49 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+
4
+ /**
5
+ * Emitted exactly once per FAILED transition (LLD §2.1). Consumed identically by MCP (maker), alarms (platform), and the failure-log histogram. `maker_message` is the only human-facing text; everything else is data.
6
+ */
7
+ export interface ErrorEnvelope {
8
+ /**
9
+ * Schema version of this envelope. Bumped only by PR to this file.
10
+ */
11
+ envelope_version: 1;
12
+ /**
13
+ * Immutable app slug.
14
+ */
15
+ app_id: string;
16
+ /**
17
+ * `<org>#<app>#<env>#<zero-padded ordinal>` (LLD §4.2.1).
18
+ */
19
+ version_id: string;
20
+ env: 'preview' | 'prod';
21
+ /**
22
+ * Pipeline stage that produced the failure (frozen T1b stage enum).
23
+ */
24
+ stage: 'admission' | 'intake' | 'transform' | 'validate' | 'build' | 'verify' | 'gate' | 'cutover' | 'promote';
25
+ /**
26
+ * A category from the closed enum in error-category.enum.json (families carry a concrete last segment at runtime).
27
+ */
28
+ category: string;
29
+ /**
30
+ * Echoed from the category registry (LLD §2.2). The maker's tool renders "retrying…" vs "this app can't be converted because…".
31
+ */
32
+ retryable: boolean;
33
+ /**
34
+ * Plain English, no AWS terms. What happened + what next. The ONLY human-facing field.
35
+ */
36
+ maker_message: string;
37
+ /**
38
+ * Actionable for the maker's AI tool (machine-usable).
39
+ */
40
+ remediation_hint: string;
41
+ /**
42
+ * `s3://…/evidence/<org>/<app>/<version_id>/…` — reference to the evidence bundle, never inline.
43
+ */
44
+ evidence_ref: string;
45
+ /**
46
+ * ISO-8601 UTC.
47
+ */
48
+ ts: string;
49
+ }
@@ -0,0 +1,47 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+
4
+ export * from './ai-budget-ledger-event.js';
5
+ export * from './ai-callsite-inventory.js';
6
+ export * from './ai-classification-stamp.js';
7
+ export * from './ai-composite-policy-digest-helper.js';
8
+ export * from './ai-composite-policy-digest.js';
9
+ export * from './ai-deployment-gate-decision.js';
10
+ export * from './ai-gateway-key-lifecycle-event.js';
11
+ export * from './ai-gateway-key-lookup.js';
12
+ export * from './ai-gateway-key-token.js';
13
+ export * from './ai-governance-decision.js';
14
+ export * from './ai-metering-policy.js';
15
+ export * from './ai-policy-snapshot.js';
16
+ export * from './ai-pricing-revision.js';
17
+ export * from './ai-runtime-binding.js';
18
+ export * from './ai-runtime-contract.js';
19
+ export * from './ai-trace-event-v2.js';
20
+ export * from './ai-trace-event.js';
21
+ export * from './ai-transform-event.js';
22
+ export * from './ai-transform-result.js';
23
+ export * from './ai-verification-evidence.js';
24
+ export * from './api-error-response.js';
25
+ export * from './artifact-contract.js';
26
+ export * from './contract-release.js';
27
+ export * from './data-dependency.js';
28
+ export * from './data-grant.js';
29
+ export * from './data-source.js';
30
+ export * from './deploy-request.js';
31
+ export * from './deploy-response.js';
32
+ export * from './deployment-environment.js';
33
+ export * from './deployment-source.js';
34
+ export * from './deployment-status-failure.js';
35
+ export * from './deployment-status-request.js';
36
+ export * from './deployment-status-response.js';
37
+ export * from './env-bindings.js';
38
+ export * from './error-category-registry.js';
39
+ export * from './error-category.js';
40
+ export * from './error-envelope.js';
41
+ export * from './kvs-routing-entry.js';
42
+ export * from './promotion-request.js';
43
+ export * from './promotion-response.js';
44
+ export * from './secret-reference.js';
45
+ export * from './transform-report.js';
46
+ export * from './version-state-machine.js';
47
+ export * from './version-state.js';
@@ -0,0 +1,30 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+
4
+ /**
5
+ * Value stored in the CloudFront KeyValueStore and read by the viewer-request router on EVERY request. Keyed by `<org>.<app>` — the tenant-qualified app identity, not a host header; slugs are lowercase DNS-label-shaped and cannot contain dots, so the single dot is an unambiguous separator. Two constraints cannot be expressed in JSON Schema and are enforced in the router: the TOTAL length of all `staticAssetPrefixes` must not exceed 512 bytes, and the array must be empty when `routeMode` is `static`. Written by cutover; a request whose entry fails any of these rules is refused at the edge rather than routed on a guess.
6
+ */
7
+ export interface KvsRoutingEntry {
8
+ /**
9
+ * Immutable prefix of the LIVE version's static output: `builds/<org>/<app>/<64-hex-digest>`, with no trailing slash. The digest is what makes a cutover safe — the router rewrites matching requests to this prefix before the cache lookup, so it is also the edge cache key, and a new version therefore cannot serve the previous version's cached bytes.
10
+ */
11
+ staticPath: string;
12
+ /**
13
+ * Whether the app has an application runtime. REQUIRED: an entry without it is refused with 503 rather than guessed at. In `server` mode a path under a declared `staticAssetPrefixes` entry is served from S3 and everything else goes to `apiDomain`; in `static` mode every path is served from S3.
14
+ */
15
+ routeMode: 'server' | 'static';
16
+ /**
17
+ * The version's monotonic sequence number within its lane. Cutover uses it to keep writes one-way: an entry is only replaced by a strictly higher ordinal, so a delayed or replayed write cannot move an app backwards.
18
+ */
19
+ ordinal: number;
20
+ /**
21
+ * The app runtime's AWS_IAM-protected Lambda Function URL host. Required in `server` mode and omitted entirely for a static-only app. The router refuses any other domain shape, so this cannot be pointed at an arbitrary origin.
22
+ */
23
+ apiDomain?: string;
24
+ /**
25
+ * Build-derived prefixes that a `server` app serves from its immutable S3 output rather than from its runtime, e.g. `_next/static/`. Derived from verified build output, never from framework names. Must be strictly ascending, must total at most 512 bytes, and must be absent or empty in `static` mode — the last two are enforced in the router because JSON Schema cannot express them. Omitted when empty: a server app with public build output and no prefixes serves every asset from its Lambda, which is a build-plan defect rather than a routing one.
26
+ *
27
+ * @maxItems 16
28
+ */
29
+ staticAssetPrefixes?: string[];
30
+ }
@@ -0,0 +1,43 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+
4
+ /**
5
+ * JSON body for POST /v1/tenants/{tenant}/apps/{app}/promotions. Repository identity is loaded from stored application and preview records, not supplied by the caller.
6
+ */
7
+ export interface PromotionRequest {
8
+ /**
9
+ * Immutable preview version selected by the caller. The API also verifies that its tenant and app match the route.
10
+ */
11
+ previewVersionId: string;
12
+ /**
13
+ * Current commit at the configured production branch head. Its root Git tree must equal the preview tree.
14
+ */
15
+ commit: string;
16
+ /**
17
+ * Durable caller-generated key. Identical replays return the original production version; reuse with a changed request is rejected.
18
+ */
19
+ idempotencyKey: string;
20
+ environmentBindings?: PromotionRequestEnvironmentBindings;
21
+ }
22
+ /**
23
+ * Optional secret bindings for the production version. Additive: promotions without it remain valid, and a deployment plane that ignores the field behaves exactly as before. Named environmentBindings to match deploy-request.schema.json, whose preview counterpart this mirrors.
24
+ */
25
+ export interface PromotionRequestEnvironmentBindings {
26
+ /**
27
+ * Secret bindings for the production version. An empty array is meaningful: it says the caller looked and the app declares no secrets.
28
+ */
29
+ bindings: PromotionRequestSecretBinding[];
30
+ }
31
+ /**
32
+ * One secret binding. Unlike the preview counterpart there is no `value` member and `secretRef` is required, so a plain literal is unrepresentable on the promotion path rather than merely refused by the handler. The secretRef pattern admits only the app-secret shape, which is what keeps a promotion from naming a tenant integration credential.
33
+ */
34
+ export interface PromotionRequestSecretBinding {
35
+ /**
36
+ * Environment-variable name the app reads.
37
+ */
38
+ name: string;
39
+ /**
40
+ * Governance reference the deployment plane resolves. The value never appears in the request, in this schema, or in any record derived from it.
41
+ */
42
+ secretRef: string;
43
+ }
@@ -0,0 +1,20 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+
4
+ /**
5
+ * 202 Accepted body returned after the production version and its durable idempotency binding exist.
6
+ */
7
+ export interface PromotionResponse {
8
+ idempotencyKey: string;
9
+ /**
10
+ * Immutable identity of the admitted production version.
11
+ */
12
+ versionId: string;
13
+ previewVersionId: string;
14
+ tenant: string;
15
+ app: string;
16
+ environment: 'prod';
17
+ status: 'QUEUED';
18
+ acceptedAt: string;
19
+ statusUrl: string;
20
+ }
@@ -0,0 +1,40 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+
4
+ /**
5
+ * app = shared by the whole app; personal = owned by a single builder (ownerBuilderId).
6
+ */
7
+ export type SecretReferenceScope = 'app' | 'personal';
8
+ /**
9
+ * UNSET slots block promotion until a human sets a value (secrets.unresolvable).
10
+ */
11
+ export type SecretReferenceStatus = 'SET' | 'UNSET';
12
+ /**
13
+ * builder = created by a builder; minted = created by the platform (e.g. a data-grant credential).
14
+ */
15
+ export type SecretReferenceOrigin = 'builder' | 'minted';
16
+
17
+ /**
18
+ * Secret-Manager MVP: a named secret slot an app depends on. Only the reference and its lifecycle cross this boundary — the secret VALUE never appears in any contract. scope=app secrets are shared by the app; scope=personal secrets belong to one builder (ownerBuilderId). origin records whether a builder created the slot or the platform minted it (e.g. for a data grant).
19
+ */
20
+ export interface SecretReference {
21
+ /**
22
+ * App the secret slot belongs to.
23
+ */
24
+ appId: string;
25
+ /**
26
+ * Slot name as the app references it (typically the environment-variable name).
27
+ */
28
+ name: string;
29
+ scope: SecretReferenceScope;
30
+ /**
31
+ * Owning builder; present only when scope is personal.
32
+ */
33
+ ownerBuilderId?: string;
34
+ /**
35
+ * secretref URI of the stored value. The value itself never crosses this boundary.
36
+ */
37
+ secretRef: string;
38
+ status: SecretReferenceStatus;
39
+ origin: SecretReferenceOrigin;
40
+ }
@@ -0,0 +1,105 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+
4
+ /**
5
+ * Structured output an agent must return from one Harbour transformation attempt. Handed to the agent as its output schema, then decoded and semantically re-validated by the control plane, which remains the authority. The enum on applied_playbooks.items is the one dynamic part: the adapter injects the names of the playbooks supplied for that invocation before writing the document, so the model is structurally prevented from naming a playbook it was not given. Application-secret handling was removed platform-wide, so this document carries no redactions and no secrets fields.
6
+ */
7
+ export interface TransformReport {
8
+ /**
9
+ * @minItems 1
10
+ */
11
+ applied_playbooks: string[];
12
+ static_rebuild_required: boolean;
13
+ analysis: {
14
+ deployable: boolean;
15
+ needsTransformation: boolean;
16
+ /**
17
+ * @maxItems 64
18
+ */
19
+ blockers: string[];
20
+ /**
21
+ * @minItems 1
22
+ * @maxItems 1024
23
+ */
24
+ surfaces: string[];
25
+ /**
26
+ * @maxItems 1024
27
+ */
28
+ evidence: {
29
+ path: string;
30
+ line: number;
31
+ reason: string;
32
+ }[];
33
+ };
34
+ database: {
35
+ mode: 'none' | 'sql' | 'unsupported';
36
+ changeType: 'none' | 'code_only' | 'schema_only' | 'code_and_schema';
37
+ requiresCodeChanges: boolean;
38
+ requiresSchemaMigration: boolean;
39
+ desiredSchemaPath: string;
40
+ /**
41
+ * @maxItems 128
42
+ */
43
+ migrationPaths: string[];
44
+ /**
45
+ * @maxItems 512
46
+ */
47
+ changedFiles: string[];
48
+ /**
49
+ * @maxItems 128
50
+ */
51
+ evidence: {
52
+ path: string;
53
+ line: number;
54
+ reason: string;
55
+ }[];
56
+ /**
57
+ * @maxItems 64
58
+ */
59
+ unsupportedFeatures: string[];
60
+ };
61
+ application: {
62
+ runtime: string;
63
+ buildKind: 'container' | 'static';
64
+ topology: 'static' | 'backend' | 'frontend_and_backend';
65
+ entrypoint: string;
66
+ build: {
67
+ /**
68
+ * @minItems 1
69
+ * @maxItems 64
70
+ */
71
+ installCommand: string[];
72
+ /**
73
+ * @minItems 1
74
+ * @maxItems 64
75
+ */
76
+ buildCommand: string[];
77
+ /**
78
+ * @minItems 1
79
+ * @maxItems 16
80
+ */
81
+ outputs: {
82
+ path: string;
83
+ kind: 'public' | 'backend';
84
+ route: string;
85
+ }[];
86
+ };
87
+ basePath: {
88
+ required: boolean;
89
+ environmentVariable: 'HARBOUR_BASE_PATH';
90
+ };
91
+ /**
92
+ * @minItems 1
93
+ * @maxItems 64
94
+ */
95
+ evidence: {
96
+ path: string;
97
+ line: number;
98
+ reason: string;
99
+ }[];
100
+ /**
101
+ * @maxItems 64
102
+ */
103
+ unsupportedFeatures: string[];
104
+ };
105
+ }