@fourier-labs/harbour-contracts 0.3.1 → 0.5.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 (92) hide show
  1. package/README.md +1 -1
  2. package/dist/gen-ts/ai-callsite-inventory.d.ts +49 -0
  3. package/dist/gen-ts/ai-gateway-key-lookup.d.ts +20 -0
  4. package/dist/gen-ts/ai-gateway-key-token.d.ts +4 -0
  5. package/dist/gen-ts/ai-gateway-key-token.js +6 -0
  6. package/dist/gen-ts/ai-governance-decision.d.ts +74 -0
  7. package/dist/gen-ts/ai-policy-snapshot.d.ts +429 -0
  8. package/dist/gen-ts/ai-runtime-contract.d.ts +27 -0
  9. package/dist/gen-ts/ai-trace-event.d.ts +68 -0
  10. package/dist/gen-ts/ai-transform-event.d.ts +66 -0
  11. package/dist/gen-ts/ai-transform-result.d.ts +32 -0
  12. package/dist/gen-ts/ai-verification-evidence.d.ts +49 -0
  13. package/dist/gen-ts/data-dependency.d.ts +42 -0
  14. package/dist/gen-ts/data-grant.d.ts +58 -0
  15. package/dist/gen-ts/data-grant.js +12 -0
  16. package/dist/gen-ts/data-source.d.ts +74 -0
  17. package/dist/{deploy-request.d.ts → gen-ts/deploy-request.d.ts} +30 -0
  18. package/dist/gen-ts/deploy-response.js +3 -0
  19. package/dist/gen-ts/deployment-environment.js +3 -0
  20. package/dist/gen-ts/deployment-source.js +3 -0
  21. package/dist/gen-ts/deployment-status-failure.js +3 -0
  22. package/dist/gen-ts/deployment-status-request.js +3 -0
  23. package/dist/{deployment-status-response.d.ts → gen-ts/deployment-status-response.d.ts} +2 -2
  24. package/dist/gen-ts/deployment-status-response.js +3 -0
  25. package/dist/gen-ts/env-bindings.js +3 -0
  26. package/dist/{error-category-registry.d.ts → gen-ts/error-category-registry.d.ts} +7 -0
  27. package/dist/{error-category-registry.js → gen-ts/error-category-registry.js} +14 -0
  28. package/dist/gen-ts/error-category.js +3 -0
  29. package/dist/gen-ts/error-envelope.js +3 -0
  30. package/dist/{index.d.ts → gen-ts/index.d.ts} +16 -0
  31. package/dist/{index.js → gen-ts/index.js} +16 -0
  32. package/dist/gen-ts/kvs-routing-entry.js +3 -0
  33. package/dist/gen-ts/promotion-request.d.ts +17 -0
  34. package/dist/gen-ts/promotion-request.js +3 -0
  35. package/dist/gen-ts/promotion-response.d.ts +17 -0
  36. package/dist/gen-ts/promotion-response.js +3 -0
  37. package/dist/gen-ts/secret-reference.d.ts +36 -0
  38. package/dist/gen-ts/secret-reference.js +3 -0
  39. package/dist/{version-state-machine.d.ts → gen-ts/version-state-machine.d.ts} +7 -2
  40. package/dist/gen-ts/version-state-machine.js +45 -0
  41. package/dist/gen-ts/version-state.js +3 -0
  42. package/dist/resolver/index.d.ts +256 -0
  43. package/dist/resolver/index.js +679 -0
  44. package/package.json +14 -4
  45. package/schema/ai-callsite-inventory.schema.json +138 -0
  46. package/schema/ai-gateway-key-lookup.schema.json +53 -0
  47. package/schema/ai-governance-decision.schema.json +105 -0
  48. package/schema/ai-policy-snapshot.schema.json +340 -0
  49. package/schema/ai-runtime-contract.schema.json +85 -0
  50. package/schema/ai-trace-event.schema.json +178 -0
  51. package/schema/ai-transform-event.schema.json +72 -0
  52. package/schema/ai-transform-result.schema.json +46 -0
  53. package/schema/ai-verification-evidence.schema.json +57 -0
  54. package/schema/data-dependency.schema.json +89 -0
  55. package/schema/data-grant.schema.json +107 -0
  56. package/schema/data-source.schema.json +151 -0
  57. package/schema/deploy-request.schema.json +60 -0
  58. package/schema/deploy-response.schema.json +1 -1
  59. package/schema/deployment-status-request.schema.json +1 -1
  60. package/schema/deployment-status-response.schema.json +2 -2
  61. package/schema/error-category.enum.json +7 -0
  62. package/schema/promotion-request.schema.json +26 -0
  63. package/schema/promotion-response.schema.json +50 -0
  64. package/schema/secret-reference.schema.json +70 -0
  65. package/schema/version-state.schema.json +25 -24
  66. package/dist/version-state-machine.js +0 -35
  67. /package/dist/{api-error-response.js → gen-ts/ai-callsite-inventory.js} +0 -0
  68. /package/dist/{artifact-contract.js → gen-ts/ai-gateway-key-lookup.js} +0 -0
  69. /package/dist/{deploy-request.js → gen-ts/ai-governance-decision.js} +0 -0
  70. /package/dist/{deploy-response.js → gen-ts/ai-policy-snapshot.js} +0 -0
  71. /package/dist/{deployment-environment.js → gen-ts/ai-runtime-contract.js} +0 -0
  72. /package/dist/{deployment-source.js → gen-ts/ai-trace-event.js} +0 -0
  73. /package/dist/{deployment-status-failure.js → gen-ts/ai-transform-event.js} +0 -0
  74. /package/dist/{deployment-status-request.js → gen-ts/ai-transform-result.js} +0 -0
  75. /package/dist/{deployment-status-response.js → gen-ts/ai-verification-evidence.js} +0 -0
  76. /package/dist/{api-error-response.d.ts → gen-ts/api-error-response.d.ts} +0 -0
  77. /package/dist/{env-bindings.js → gen-ts/api-error-response.js} +0 -0
  78. /package/dist/{artifact-contract.d.ts → gen-ts/artifact-contract.d.ts} +0 -0
  79. /package/dist/{error-category.js → gen-ts/artifact-contract.js} +0 -0
  80. /package/dist/{error-envelope.js → gen-ts/data-dependency.js} +0 -0
  81. /package/dist/{kvs-routing-entry.js → gen-ts/data-source.js} +0 -0
  82. /package/dist/{version-state.js → gen-ts/deploy-request.js} +0 -0
  83. /package/dist/{deploy-response.d.ts → gen-ts/deploy-response.d.ts} +0 -0
  84. /package/dist/{deployment-environment.d.ts → gen-ts/deployment-environment.d.ts} +0 -0
  85. /package/dist/{deployment-source.d.ts → gen-ts/deployment-source.d.ts} +0 -0
  86. /package/dist/{deployment-status-failure.d.ts → gen-ts/deployment-status-failure.d.ts} +0 -0
  87. /package/dist/{deployment-status-request.d.ts → gen-ts/deployment-status-request.d.ts} +0 -0
  88. /package/dist/{env-bindings.d.ts → gen-ts/env-bindings.d.ts} +0 -0
  89. /package/dist/{error-category.d.ts → gen-ts/error-category.d.ts} +0 -0
  90. /package/dist/{error-envelope.d.ts → gen-ts/error-envelope.d.ts} +0 -0
  91. /package/dist/{kvs-routing-entry.d.ts → gen-ts/kvs-routing-entry.d.ts} +0 -0
  92. /package/dist/{version-state.d.ts → gen-ts/version-state.d.ts} +0 -0
@@ -0,0 +1,66 @@
1
+ export type AiTransformIdentifier = string;
2
+ export type AiTransformDigest = string;
3
+ export type AiTransformPlanEntry = {
4
+ [k: string]: unknown;
5
+ } & {
6
+ callSiteFingerprint: AiTransformDigest;
7
+ sourcePath: string;
8
+ expectedSourceFileSha256: AiTransformDigest;
9
+ strategy: 'deployment_injection' | 'deterministic_adapter';
10
+ configurationMappingId?: AiTransformIdentifier;
11
+ configurationMappingVersion?: string;
12
+ transformId?: AiTransformIdentifier;
13
+ transformVersion?: string;
14
+ /**
15
+ * @minItems 1
16
+ * @maxItems 32
17
+ */
18
+ allowedSyntaxKinds: [AiTransformIdentifier, ...AiTransformIdentifier[]];
19
+ runtimeShimName?: string;
20
+ runtimeShimVersion?: string;
21
+ runtimeShimDigest?: AiTransformDigest;
22
+ } & {
23
+ callSiteFingerprint: AiTransformDigest;
24
+ sourcePath: string;
25
+ expectedSourceFileSha256: AiTransformDigest;
26
+ strategy: 'deployment_injection' | 'deterministic_adapter';
27
+ configurationMappingId?: AiTransformIdentifier;
28
+ configurationMappingVersion?: string;
29
+ transformId?: AiTransformIdentifier;
30
+ transformVersion?: string;
31
+ /**
32
+ * @minItems 1
33
+ * @maxItems 32
34
+ */
35
+ allowedSyntaxKinds: [AiTransformIdentifier, ...AiTransformIdentifier[]];
36
+ runtimeShimName?: string;
37
+ runtimeShimVersion?: string;
38
+ runtimeShimDigest?: AiTransformDigest;
39
+ };
40
+ /**
41
+ * Checksum-bound deterministic AI interception task input. Entries are the complete ordered PLAN interception plan so the task can verify the governance plan digest before applying its deterministic subset; source and patches are referenced, never embedded.
42
+ */
43
+ export interface AiTransformEvent {
44
+ schema: 'harbour.ai-transform-event/1.0';
45
+ tenantId: AiTransformIdentifier;
46
+ appId: AiTransformIdentifier;
47
+ environment: AiTransformIdentifier;
48
+ versionId: string;
49
+ sourceRevision: string;
50
+ workspace: AiTransformWorkspace;
51
+ inventoryDigest: AiTransformDigest;
52
+ policyDigest: AiTransformDigest;
53
+ runtimeContractDigest: AiTransformDigest;
54
+ interceptionPlanDigest: AiTransformDigest;
55
+ /**
56
+ * @minItems 1
57
+ * @maxItems 1000
58
+ */
59
+ entries: [AiTransformPlanEntry, ...AiTransformPlanEntry[]];
60
+ }
61
+ export interface AiTransformWorkspace {
62
+ bucket: string;
63
+ key: string;
64
+ sha256: AiTransformDigest;
65
+ size: number;
66
+ }
@@ -0,0 +1,32 @@
1
+ export type AiTransformResultDigest = string;
2
+ export type AiTransformResultIdentifier = string;
3
+ /**
4
+ * Bounded deterministic interception result; contains descriptors and digest evidence only.
5
+ */
6
+ export interface AiTransformResult {
7
+ schema: 'harbour.ai-transform-result/1.0';
8
+ workspace: AiTransformResultWorkspace;
9
+ interceptionPlanDigest: AiTransformResultDigest;
10
+ transformerVersion: string;
11
+ /**
12
+ * @minItems 1
13
+ * @maxItems 1000
14
+ */
15
+ applied: [AiTransformApplied, ...AiTransformApplied[]];
16
+ }
17
+ export interface AiTransformResultWorkspace {
18
+ bucket: string;
19
+ key: string;
20
+ sha256: AiTransformResultDigest;
21
+ size: number;
22
+ }
23
+ export interface AiTransformApplied {
24
+ callSiteFingerprint: AiTransformResultDigest;
25
+ transformId: AiTransformResultIdentifier;
26
+ transformVersion: string;
27
+ sourcePath: string;
28
+ beforeSha256: AiTransformResultDigest;
29
+ afterSha256: AiTransformResultDigest;
30
+ governedBoundaryFingerprint: AiTransformResultDigest;
31
+ runtimeShimDigest: AiTransformResultDigest;
32
+ }
@@ -0,0 +1,49 @@
1
+ export type AiVerificationIdentifier = string;
2
+ export type AiVerificationDigest = string;
3
+ /**
4
+ * Bounded, value-free evidence submitted by deployment verification for one governed version.
5
+ */
6
+ export interface AiVerificationEvidence {
7
+ schema: 'harbour.ai-verification-evidence/1.0';
8
+ tenantId: AiVerificationIdentifier;
9
+ appId: AiVerificationIdentifier;
10
+ environment: AiVerificationIdentifier;
11
+ versionId: string;
12
+ sourceRevision: string;
13
+ inventoryDigest: AiVerificationDigest;
14
+ interceptionPlanDigest: AiVerificationDigest;
15
+ runtimeContractDigest: AiVerificationDigest;
16
+ policyDigest: AiVerificationDigest;
17
+ finalWorkspaceDigest: AiVerificationDigest;
18
+ /**
19
+ * @maxItems 1000
20
+ */
21
+ verifiedCallsiteFingerprints: AiVerificationDigest[];
22
+ /**
23
+ * @maxItems 1000
24
+ */
25
+ appliedTransforms: AiVerificationTransform[];
26
+ /**
27
+ * @minItems 1
28
+ * @maxItems 32
29
+ */
30
+ endpointChecks: [AiVerificationEndpointCheck, ...AiVerificationEndpointCheck[]];
31
+ providerCredentialsAbsent: true;
32
+ smokeTraceId: string;
33
+ evidenceDigest: AiVerificationDigest;
34
+ verifiedAt: string;
35
+ }
36
+ export interface AiVerificationTransform {
37
+ callSiteFingerprint: AiVerificationDigest;
38
+ governedBoundaryFingerprint: AiVerificationDigest;
39
+ transformId: AiVerificationIdentifier;
40
+ transformVersion: string;
41
+ beforeSha256: AiVerificationDigest;
42
+ afterSha256: AiVerificationDigest;
43
+ runtimeShimDigest: AiVerificationDigest;
44
+ }
45
+ export interface AiVerificationEndpointCheck {
46
+ name: AiVerificationIdentifier;
47
+ passed: true;
48
+ configurationMappingVersion: string;
49
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * database = a SQL/warehouse connection; api = an HTTP(S) service; app_owned_external = infrastructure the app owns outside Harbour.
3
+ */
4
+ export type DataDependencyKind = 'database' | 'api' | 'app_owned_external';
5
+ /**
6
+ * matched = resolved to a registered source; out_of_scope = resolved but not requestable; unknown = unresolvable; inventory = registered but unused; app_owned_external = app-owned, outside Harbour's remit.
7
+ */
8
+ export type DataDependencyClassification = 'matched' | 'out_of_scope' | 'unknown' | 'inventory' | 'app_owned_external';
9
+ /**
10
+ * declared = stated by the builder; detected = found by analysis.
11
+ */
12
+ export type DataDependencyOrigin = 'declared' | 'detected';
13
+ /**
14
+ * A single external data dependency of an app, either declared by the builder or detected during analysis. Classification records how the dependency resolved against the tenant's registered data-source inventory; matchedSourceId is present only when classification is matched.
15
+ */
16
+ export interface DataDependency {
17
+ kind: DataDependencyKind;
18
+ identifiers: DataDependencyIdentifiers;
19
+ classification: DataDependencyClassification;
20
+ /**
21
+ * sourceId of the registered data source this dependency matched; present only when classification is matched.
22
+ */
23
+ matchedSourceId?: string;
24
+ origin: DataDependencyOrigin;
25
+ }
26
+ /**
27
+ * Evidence identifying the dependency; used to match it against the registered source inventory.
28
+ */
29
+ export interface DataDependencyIdentifiers {
30
+ /**
31
+ * Hostnames the dependency was observed or declared against.
32
+ */
33
+ hosts: string[];
34
+ /**
35
+ * Client driver/library that surfaced the dependency (e.g. pg, snowflake-sdk).
36
+ */
37
+ driver?: string;
38
+ /**
39
+ * Environment-variable names the app reads to configure this dependency.
40
+ */
41
+ envNames: string[];
42
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Access mode. MVP is read-only; write is a deliberate future schema change.
3
+ */
4
+ export type DataGrantMode = 'read';
5
+ /**
6
+ * MVP: one minted service principal per grant. Per-end-user passthrough is a future schema change.
7
+ */
8
+ export type DataGrantIdentityModel = 'service';
9
+ /**
10
+ * Grant lifecycle state. Legal edges live in x-transitions; GRANTED and DENIED are terminal.
11
+ */
12
+ export type DataGrantStatus = 'REQUESTED' | 'GRANTED' | 'DENIED';
13
+ /**
14
+ * An app's approved (or requested) read scope against a registered data source. MVP is deliberately narrow: mode is read-only and identityModel is service (one minted principal per grant, no per-end-user identity passthrough). Grant status is a tiny state machine — legal edges live in x-transitions and codegen turns them into shared CanTransitionDataGrantStatus / IsTerminalDataGrantStatus helpers so control-plane and consumers agree on legality.
15
+ */
16
+ export interface DataGrant {
17
+ /**
18
+ * App the grant belongs to.
19
+ */
20
+ appId: string;
21
+ /**
22
+ * Registered data source the grant targets (data-source.schema.json).
23
+ */
24
+ sourceId: string;
25
+ /**
26
+ * Requested/granted selectors; every selector must fall inside the source's allowedScope.
27
+ *
28
+ * @minItems 1
29
+ */
30
+ scope: [string, ...string[]];
31
+ mode: DataGrantMode;
32
+ identityModel: DataGrantIdentityModel;
33
+ status: DataGrantStatus;
34
+ /**
35
+ * secretref URI of the minted per-grant credential; present once GRANTED.
36
+ */
37
+ credentialRef?: string;
38
+ /**
39
+ * Name of the scoped principal minted on the source for this grant; present once GRANTED.
40
+ */
41
+ mintedPrincipal?: string;
42
+ /**
43
+ * Operation (e.g. deployment analysis) that raised the request, for audit correlation.
44
+ */
45
+ requestedByOperationId?: string;
46
+ /**
47
+ * Admin identity that resolved the request; present once GRANTED or DENIED.
48
+ */
49
+ approvedBy?: string;
50
+ /**
51
+ * RFC 3339 instant the request was resolved; present once GRANTED or DENIED.
52
+ */
53
+ approvedAt?: string;
54
+ }
55
+ /** True iff from→to is a legal DataGrantStatus edge (schema x-transitions). */
56
+ export declare function canTransitionDataGrantStatus(from: string, to: string): boolean;
57
+ /** True iff the DataGrantStatus is terminal (GRANTED, DENIED). */
58
+ export declare function isTerminalDataGrantStatus(state: string): boolean;
@@ -0,0 +1,12 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ const legalDataGrantStatusTransitions = {
4
+ "REQUESTED": { "GRANTED": true, "DENIED": true },
5
+ };
6
+ const terminalDataGrantStatusStates = new Set(["GRANTED", "DENIED"]);
7
+ /** True iff from→to is a legal DataGrantStatus edge (schema x-transitions). */
8
+ export function canTransitionDataGrantStatus(from, to) {
9
+ return Boolean(legalDataGrantStatusTransitions[from]?.[to]);
10
+ }
11
+ /** True iff the DataGrantStatus is terminal (GRANTED, DENIED). */
12
+ export function isTerminalDataGrantStatus(state) { return terminalDataGrantStatusStates.has(state); }
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Closed connector set for the Data-Access MVP.
3
+ */
4
+ export type DataSourceConnector = 'postgres' | 'redshift' | 'bigquery' | 'databricks';
5
+ /**
6
+ * byo = admin brought existing infrastructure; harbour_managed = Harbour provisioned it.
7
+ */
8
+ export type DataSourceProvisioningMode = 'byo' | 'harbour_managed';
9
+ /**
10
+ * DISABLED sources reject new grants and suspend existing access.
11
+ */
12
+ export type DataSourceStatus = 'ACTIVE' | 'DISABLED';
13
+ /**
14
+ * An admin-registered external data source (Data-Access MVP). The credential the platform holds for the source never crosses this boundary — credentialRef is a secretref URI resolved internally. allowedScope is the admin-declared selector allowlist grants are checked against; observedScope is what discovery actually saw and is informational only.
15
+ */
16
+ export interface DataSource {
17
+ /**
18
+ * Owning tenant (org) identifier.
19
+ */
20
+ tenantId: string;
21
+ /**
22
+ * Tenant-unique data-source identifier.
23
+ */
24
+ sourceId: string;
25
+ connector: DataSourceConnector;
26
+ /**
27
+ * Human-readable name shown to admins and builders.
28
+ */
29
+ displayName: string;
30
+ endpoint: DataSourceEndpoint;
31
+ /**
32
+ * secretref URI naming the platform-held credential for this source. The referenced value never crosses this boundary.
33
+ */
34
+ credentialRef: string;
35
+ provisioningMode: DataSourceProvisioningMode;
36
+ /**
37
+ * Admin-declared selector allowlist (e.g. schema.table patterns) that grant scopes are validated against.
38
+ */
39
+ allowedScope: string[];
40
+ /**
41
+ * Selectors discovery actually observed on the source. Informational; never widens allowedScope.
42
+ */
43
+ observedScope?: string[];
44
+ /**
45
+ * Whether builders may request grants against this source.
46
+ */
47
+ requestableByBuilders: boolean;
48
+ status: DataSourceStatus;
49
+ }
50
+ /**
51
+ * Connector endpoint coordinates. host is always present; database vs project/workspace depends on the connector family.
52
+ */
53
+ export interface DataSourceEndpoint {
54
+ /**
55
+ * Network host (or warehouse endpoint) of the source.
56
+ */
57
+ host: string;
58
+ /**
59
+ * TCP port; absent where the connector implies it.
60
+ */
61
+ port?: number;
62
+ /**
63
+ * Database name (postgres/redshift-style connectors).
64
+ */
65
+ database?: string;
66
+ /**
67
+ * Project identifier (bigquery-style connectors).
68
+ */
69
+ project?: string;
70
+ /**
71
+ * Workspace identifier (databricks-style connectors).
72
+ */
73
+ workspace?: string;
74
+ }
@@ -1,3 +1,23 @@
1
+ /**
2
+ * One environment-variable binding: exactly one of secretRef (secret, resolved at runtime) or value (plain literal).
3
+ */
4
+ export type DeployRequestEnvironmentBinding = {
5
+ /**
6
+ * Environment-variable name the app reads.
7
+ */
8
+ name: string;
9
+ /**
10
+ * secretref URI resolved at runtime; the value never appears in the request.
11
+ */
12
+ secretRef?: string;
13
+ /**
14
+ * Plain (non-secret) literal value.
15
+ */
16
+ value?: string;
17
+ } & DeployRequestEnvironmentBinding1;
18
+ export type DeployRequestEnvironmentBinding1 = {
19
+ [k: string]: unknown;
20
+ };
1
21
  /**
2
22
  * JSON body for POST /v1/tenants/{tenant}/apps/{app}/deployments. tenant and app come from path parameters and are not body fields. The preview MVP requires environment=preview. Every accepted POST is a new deployment intent; idempotencyKey is retained only as request correlation.
3
23
  */
@@ -19,6 +39,7 @@ export interface DeployRequest {
19
39
  * Optional legacy request-correlation value returned as requestId. It does not make repeated HTTP POSTs idempotent; versionId is the deployment identity and SQS deduplication key.
20
40
  */
21
41
  idempotencyKey?: string;
42
+ environmentBindings?: DeployRequestEnvironmentBindings;
22
43
  }
23
44
  export interface DeployRequestSource {
24
45
  /**
@@ -30,3 +51,12 @@ export interface DeployRequestSource {
30
51
  */
31
52
  repositoryUrl: string;
32
53
  }
54
+ /**
55
+ * Optional runtime environment configuration (Secret-Manager MVP). Named environmentBindings, not environment — the existing required `environment` property is the deployment-target token and predates this object. Additive: requests without it remain valid.
56
+ */
57
+ export interface DeployRequestEnvironmentBindings {
58
+ /**
59
+ * Environment-variable bindings for this deployment.
60
+ */
61
+ bindings: DeployRequestEnvironmentBinding[];
62
+ }
@@ -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,3 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ export {};
@@ -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,3 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ export {};
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ export {};
@@ -6,8 +6,8 @@ export interface DeploymentStatusResponse {
6
6
  versionId: string;
7
7
  tenant: string;
8
8
  app: string;
9
- environment: 'preview';
10
- status: 'QUEUED' | 'ANALYZING' | 'TRANSFORMING' | 'VALIDATING' | 'BUILDING' | 'VERIFYING' | 'GATING' | 'LIVE' | 'FAILED' | 'STALE';
9
+ environment: 'preview' | 'prod';
10
+ status: 'QUEUED' | 'ANALYZING' | 'TRANSFORMING' | 'VALIDATING' | 'BUILDING' | 'VERIFYING' | 'GATING' | 'LIVE' | 'AWAITING-PROMOTION' | 'PROMOTING' | 'FAILED' | 'STALE';
11
11
  message: string;
12
12
  branch: string;
13
13
  commit: 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,3 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ export {};
@@ -27,6 +27,13 @@ export declare const ErrorCategories: {
27
27
  readonly AdmissionAppNotRegistered: "admission.app-not-registered";
28
28
  readonly DeployCommitNotOnBranch: "deploy.commit-not-on-branch";
29
29
  readonly DeployQueuePublicationFailed: "deploy.queue-publication-failed";
30
+ readonly PromotionPreviewNotPromotable: "promotion.preview-not-promotable";
31
+ readonly PromotionProductionBranchMoved: "promotion.production-branch-moved";
32
+ readonly PromotionSourceTreeMismatch: "promotion.source-tree-mismatch";
33
+ readonly PromotionArtifactMismatch: "promotion.artifact-mismatch";
34
+ readonly PromotionIdempotencyConflict: "promotion.idempotency-conflict";
35
+ readonly PromotionInProgress: "promotion.in-progress";
36
+ readonly PromotionQueuePublicationFailed: "promotion.queue-publication-failed";
30
37
  readonly CutoverFlipFailed: "cutover.flip-failed";
31
38
  };
32
39
  /** Retryable lookup for a concrete or family-suffixed category. Unknown → false (fail closed). */
@@ -29,6 +29,13 @@ export const ErrorCategories = {
29
29
  AdmissionAppNotRegistered: "admission.app-not-registered",
30
30
  DeployCommitNotOnBranch: "deploy.commit-not-on-branch",
31
31
  DeployQueuePublicationFailed: "deploy.queue-publication-failed",
32
+ PromotionPreviewNotPromotable: "promotion.preview-not-promotable",
33
+ PromotionProductionBranchMoved: "promotion.production-branch-moved",
34
+ PromotionSourceTreeMismatch: "promotion.source-tree-mismatch",
35
+ PromotionArtifactMismatch: "promotion.artifact-mismatch",
36
+ PromotionIdempotencyConflict: "promotion.idempotency-conflict",
37
+ PromotionInProgress: "promotion.in-progress",
38
+ PromotionQueuePublicationFailed: "promotion.queue-publication-failed",
32
39
  CutoverFlipFailed: "cutover.flip-failed",
33
40
  };
34
41
  const retryableExact = {
@@ -60,6 +67,13 @@ const retryableExact = {
60
67
  "admission.app-not-registered": false,
61
68
  "deploy.commit-not-on-branch": false,
62
69
  "deploy.queue-publication-failed": true,
70
+ "promotion.preview-not-promotable": false,
71
+ "promotion.production-branch-moved": false,
72
+ "promotion.source-tree-mismatch": false,
73
+ "promotion.artifact-mismatch": false,
74
+ "promotion.idempotency-conflict": false,
75
+ "promotion.in-progress": true,
76
+ "promotion.queue-publication-failed": true,
63
77
  "cutover.flip-failed": false,
64
78
  };
65
79
  const retryableFamilies = {
@@ -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,3 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ export {};
@@ -1,5 +1,18 @@
1
+ export * from './ai-callsite-inventory.js';
2
+ export * from './ai-gateway-key-lookup.js';
3
+ export * from './ai-gateway-key-token.js';
4
+ export * from './ai-governance-decision.js';
5
+ export * from './ai-policy-snapshot.js';
6
+ export * from './ai-runtime-contract.js';
7
+ export * from './ai-trace-event.js';
8
+ export * from './ai-transform-event.js';
9
+ export * from './ai-transform-result.js';
10
+ export * from './ai-verification-evidence.js';
1
11
  export * from './api-error-response.js';
2
12
  export * from './artifact-contract.js';
13
+ export * from './data-dependency.js';
14
+ export * from './data-grant.js';
15
+ export * from './data-source.js';
3
16
  export * from './deploy-request.js';
4
17
  export * from './deploy-response.js';
5
18
  export * from './deployment-environment.js';
@@ -12,5 +25,8 @@ export * from './error-category-registry.js';
12
25
  export * from './error-category.js';
13
26
  export * from './error-envelope.js';
14
27
  export * from './kvs-routing-entry.js';
28
+ export * from './promotion-request.js';
29
+ export * from './promotion-response.js';
30
+ export * from './secret-reference.js';
15
31
  export * from './version-state-machine.js';
16
32
  export * from './version-state.js';
@@ -1,7 +1,20 @@
1
1
  /* eslint-disable */
2
2
  // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ export * from './ai-callsite-inventory.js';
4
+ export * from './ai-gateway-key-lookup.js';
5
+ export * from './ai-gateway-key-token.js';
6
+ export * from './ai-governance-decision.js';
7
+ export * from './ai-policy-snapshot.js';
8
+ export * from './ai-runtime-contract.js';
9
+ export * from './ai-trace-event.js';
10
+ export * from './ai-transform-event.js';
11
+ export * from './ai-transform-result.js';
12
+ export * from './ai-verification-evidence.js';
3
13
  export * from './api-error-response.js';
4
14
  export * from './artifact-contract.js';
15
+ export * from './data-dependency.js';
16
+ export * from './data-grant.js';
17
+ export * from './data-source.js';
5
18
  export * from './deploy-request.js';
6
19
  export * from './deploy-response.js';
7
20
  export * from './deployment-environment.js';
@@ -14,5 +27,8 @@ export * from './error-category-registry.js';
14
27
  export * from './error-category.js';
15
28
  export * from './error-envelope.js';
16
29
  export * from './kvs-routing-entry.js';
30
+ export * from './promotion-request.js';
31
+ export * from './promotion-response.js';
32
+ export * from './secret-reference.js';
17
33
  export * from './version-state-machine.js';
18
34
  export * from './version-state.js';
@@ -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,17 @@
1
+ /**
2
+ * 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.
3
+ */
4
+ export interface PromotionRequest {
5
+ /**
6
+ * Immutable preview version selected by the caller. The API also verifies that its tenant and app match the route.
7
+ */
8
+ previewVersionId: string;
9
+ /**
10
+ * Current commit at the configured production branch head. Its root Git tree must equal the preview tree.
11
+ */
12
+ commit: string;
13
+ /**
14
+ * Durable caller-generated key. Identical replays return the original production version; reuse with a changed request is rejected.
15
+ */
16
+ idempotencyKey: string;
17
+ }
@@ -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,17 @@
1
+ /**
2
+ * 202 Accepted body returned after the production version and its durable idempotency binding exist.
3
+ */
4
+ export interface PromotionResponse {
5
+ idempotencyKey: string;
6
+ /**
7
+ * Immutable identity of the admitted production version.
8
+ */
9
+ versionId: string;
10
+ previewVersionId: string;
11
+ tenant: string;
12
+ app: string;
13
+ environment: 'prod';
14
+ status: 'QUEUED';
15
+ acceptedAt: string;
16
+ statusUrl: string;
17
+ }
@@ -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,36 @@
1
+ /**
2
+ * app = shared by the whole app; personal = owned by a single builder (ownerBuilderId).
3
+ */
4
+ export type SecretReferenceScope = 'app' | 'personal';
5
+ /**
6
+ * UNSET slots block promotion until a human sets a value (secrets.unresolvable).
7
+ */
8
+ export type SecretReferenceStatus = 'SET' | 'UNSET';
9
+ /**
10
+ * builder = created by a builder; minted = created by the platform (e.g. a data-grant credential).
11
+ */
12
+ export type SecretReferenceOrigin = 'builder' | 'minted';
13
+ /**
14
+ * 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).
15
+ */
16
+ export interface SecretReference {
17
+ /**
18
+ * App the secret slot belongs to.
19
+ */
20
+ appId: string;
21
+ /**
22
+ * Slot name as the app references it (typically the environment-variable name).
23
+ */
24
+ name: string;
25
+ scope: SecretReferenceScope;
26
+ /**
27
+ * Owning builder; present only when scope is personal.
28
+ */
29
+ ownerBuilderId?: string;
30
+ /**
31
+ * secretref URI of the stored value. The value itself never crosses this boundary.
32
+ */
33
+ secretRef: string;
34
+ status: SecretReferenceStatus;
35
+ origin: SecretReferenceOrigin;
36
+ }
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ export {};
@@ -13,7 +13,12 @@ export declare const States: {
13
13
  readonly STALE: "STALE";
14
14
  };
15
15
  export type StateName = (typeof States)[keyof typeof States];
16
- /** True iff from→to is a legal edge in the T1a state machine. */
17
- export declare function canTransition(from: string, to: string): boolean;
16
+ export declare const Environments: {
17
+ readonly Preview: "preview";
18
+ readonly Prod: "prod";
19
+ };
20
+ export type EnvironmentName = (typeof Environments)[keyof typeof Environments];
21
+ /** True iff from→to is a legal edge for environment in the T1a state machine. */
22
+ export declare function canTransition(environment: string, from: string, to: string): boolean;
18
23
  /** True iff the state is terminal (FAILED, STALE). */
19
24
  export declare function isTerminal(state: string): boolean;