@fourier-labs/harbour-contracts 0.5.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.
- package/README.md +44 -4
- package/contract-release.json +134 -0
- package/dist/gen-ts/ai-budget-ledger-event.d.ts +21 -0
- package/dist/gen-ts/ai-budget-ledger-event.js +3 -0
- package/dist/gen-ts/ai-classification-stamp.d.ts +25 -0
- package/dist/gen-ts/ai-classification-stamp.js +3 -0
- package/dist/gen-ts/ai-composite-policy-digest-helper.d.ts +5 -0
- package/dist/gen-ts/ai-composite-policy-digest-helper.js +13 -0
- package/dist/gen-ts/ai-composite-policy-digest.d.ts +12 -0
- package/dist/gen-ts/ai-composite-policy-digest.js +3 -0
- package/dist/gen-ts/ai-deployment-gate-decision.d.ts +27 -0
- package/dist/gen-ts/ai-deployment-gate-decision.js +3 -0
- package/dist/gen-ts/ai-gateway-key-lifecycle-event.d.ts +49 -0
- package/dist/gen-ts/ai-gateway-key-lifecycle-event.js +16 -0
- package/dist/gen-ts/ai-governance-decision.d.ts +14 -2
- package/dist/gen-ts/ai-metering-policy.d.ts +16 -0
- package/dist/gen-ts/ai-metering-policy.js +3 -0
- package/dist/gen-ts/ai-policy-snapshot.d.ts +5 -269
- package/dist/gen-ts/ai-pricing-revision.d.ts +29 -0
- package/dist/gen-ts/ai-pricing-revision.js +3 -0
- package/dist/gen-ts/ai-runtime-binding.d.ts +14 -0
- package/dist/gen-ts/ai-runtime-binding.js +3 -0
- package/dist/gen-ts/ai-runtime-contract.d.ts +16 -1
- package/dist/gen-ts/ai-trace-event-v2.d.ts +31 -0
- package/dist/gen-ts/ai-trace-event-v2.js +3 -0
- package/dist/gen-ts/ai-transform-event.d.ts +2 -21
- package/dist/gen-ts/ai-transform-result.d.ts +1 -1
- package/dist/gen-ts/ai-verification-evidence.d.ts +2 -1
- package/dist/gen-ts/contract-release.d.ts +7 -0
- package/dist/gen-ts/contract-release.js +9 -0
- package/dist/gen-ts/data-grant.d.ts +1 -1
- package/dist/gen-ts/error-category-registry.d.ts +5 -0
- package/dist/gen-ts/error-category-registry.js +10 -0
- package/dist/gen-ts/index.d.ts +12 -0
- package/dist/gen-ts/index.js +12 -0
- package/dist/gen-ts/kvs-routing-entry.d.ts +19 -5
- package/dist/gen-ts/promotion-request.d.ts +23 -0
- package/dist/gen-ts/transform-report.d.ts +102 -0
- package/dist/gen-ts/transform-report.js +3 -0
- package/fixtures/ai/valid-blocked-trace-event.json +31 -0
- package/fixtures/ai/valid-budget-ledger-event.json +15 -0
- package/fixtures/ai/valid-classification-stamp.json +19 -0
- package/fixtures/ai/valid-composite-policy-digest.json +11 -0
- package/fixtures/ai/valid-deployment-gate-decision.json +18 -0
- package/fixtures/ai/valid-failed-trace-event.json +50 -0
- package/fixtures/ai/valid-gateway-key-lifecycle-event.json +16 -0
- package/fixtures/ai/valid-gateway-key-lookup.json +14 -0
- package/fixtures/ai/valid-governance-decision.json +53 -0
- package/fixtures/ai/valid-inventory.json +30 -0
- package/fixtures/ai/valid-metering-policy.json +8 -0
- package/fixtures/ai/valid-policy-snapshot.json +117 -0
- package/fixtures/ai/valid-pricing-revision.json +14 -0
- package/fixtures/ai/valid-runtime-binding.json +7 -0
- package/fixtures/ai/valid-runtime-contract.json +24 -0
- package/fixtures/ai/valid-trace-event-v2.json +24 -0
- package/fixtures/ai/valid-trace-event.json +41 -0
- package/fixtures/ai/valid-transform-event.json +32 -0
- package/fixtures/ai/valid-transform-result.json +23 -0
- package/fixtures/ai/valid-verification-evidence.json +33 -0
- package/gen-ts/ai-budget-ledger-event.ts +25 -0
- package/gen-ts/ai-callsite-inventory.ts +64 -0
- package/gen-ts/ai-classification-stamp.ts +28 -0
- package/gen-ts/ai-composite-policy-digest-helper.ts +18 -0
- package/gen-ts/ai-composite-policy-digest.ts +16 -0
- package/gen-ts/ai-deployment-gate-decision.ts +30 -0
- package/gen-ts/ai-gateway-key-lifecycle-event.ts +81 -0
- package/gen-ts/ai-gateway-key-lookup.ts +23 -0
- package/gen-ts/ai-gateway-key-token.ts +7 -0
- package/gen-ts/ai-governance-decision.ts +90 -0
- package/gen-ts/ai-metering-policy.ts +20 -0
- package/gen-ts/ai-policy-snapshot.ts +169 -0
- package/gen-ts/ai-pricing-revision.ts +33 -0
- package/gen-ts/ai-runtime-binding.ts +18 -0
- package/gen-ts/ai-runtime-contract.ts +46 -0
- package/gen-ts/ai-trace-event-v2.ts +35 -0
- package/gen-ts/ai-trace-event.ts +72 -0
- package/gen-ts/ai-transform-event.ts +51 -0
- package/gen-ts/ai-transform-result.ts +36 -0
- package/gen-ts/ai-verification-evidence.ts +54 -0
- package/gen-ts/api-error-response.ts +16 -0
- package/gen-ts/artifact-contract.ts +81 -0
- package/gen-ts/contract-release.ts +10 -0
- package/gen-ts/data-dependency.ts +46 -0
- package/gen-ts/data-grant.ts +71 -0
- package/gen-ts/data-source.ts +78 -0
- package/gen-ts/deploy-request.ts +66 -0
- package/gen-ts/deploy-response.ts +25 -0
- package/gen-ts/deployment-environment.ts +7 -0
- package/gen-ts/deployment-source.ts +16 -0
- package/gen-ts/deployment-status-failure.ts +12 -0
- package/gen-ts/deployment-status-request.ts +11 -0
- package/gen-ts/deployment-status-response.ts +39 -0
- package/gen-ts/env-bindings.ts +64 -0
- package/gen-ts/error-category-registry.ts +108 -0
- package/gen-ts/error-category.ts +7 -0
- package/gen-ts/error-envelope.ts +49 -0
- package/gen-ts/index.ts +47 -0
- package/gen-ts/kvs-routing-entry.ts +30 -0
- package/gen-ts/promotion-request.ts +43 -0
- package/gen-ts/promotion-response.ts +20 -0
- package/gen-ts/secret-reference.ts +40 -0
- package/gen-ts/transform-report.ts +105 -0
- package/gen-ts/version-state-machine.ts +52 -0
- package/gen-ts/version-state.ts +19 -0
- package/package.json +8 -4
- package/schema/ai-budget-ledger-event.schema.json +29 -0
- package/schema/ai-classification-stamp.schema.json +40 -0
- package/schema/ai-composite-policy-digest.schema.json +27 -0
- package/schema/ai-deployment-gate-decision.schema.json +38 -0
- package/schema/ai-gateway-key-lifecycle-event.schema.json +61 -0
- package/schema/ai-governance-decision.schema.json +23 -2
- package/schema/ai-metering-policy.schema.json +18 -0
- package/schema/ai-pricing-revision.schema.json +38 -0
- package/schema/ai-runtime-binding.schema.json +26 -0
- package/schema/ai-runtime-contract.schema.json +24 -2
- package/schema/ai-trace-event-v2.schema.json +41 -0
- package/schema/ai-verification-evidence.schema.json +1 -0
- package/schema/error-category.enum.json +6 -1
- package/schema/kvs-routing-entry.schema.json +28 -8
- package/schema/promotion-request.schema.json +38 -0
- package/schema/transform-report.schema.json +204 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Access mode. MVP is read-only; write is a deliberate future schema change.
|
|
6
|
+
*/
|
|
7
|
+
export type DataGrantMode = 'read';
|
|
8
|
+
/**
|
|
9
|
+
* MVP: one minted service principal per grant. Per-end-user passthrough is a future schema change.
|
|
10
|
+
*/
|
|
11
|
+
export type DataGrantIdentityModel = 'service';
|
|
12
|
+
/**
|
|
13
|
+
* Grant lifecycle state. Legal edges live in x-transitions; GRANTED and DENIED are terminal.
|
|
14
|
+
*/
|
|
15
|
+
export type DataGrantStatus = 'REQUESTED' | 'GRANTED' | 'DENIED';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 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.
|
|
19
|
+
*/
|
|
20
|
+
export interface DataGrant {
|
|
21
|
+
/**
|
|
22
|
+
* App the grant belongs to.
|
|
23
|
+
*/
|
|
24
|
+
appId: string;
|
|
25
|
+
/**
|
|
26
|
+
* Registered data source the grant targets (data-source.schema.json).
|
|
27
|
+
*/
|
|
28
|
+
sourceId: string;
|
|
29
|
+
/**
|
|
30
|
+
* Requested/granted selectors; every selector must fall inside the source's allowedScope.
|
|
31
|
+
*
|
|
32
|
+
* @minItems 1
|
|
33
|
+
*/
|
|
34
|
+
scope: string[];
|
|
35
|
+
mode: DataGrantMode;
|
|
36
|
+
identityModel: DataGrantIdentityModel;
|
|
37
|
+
status: DataGrantStatus;
|
|
38
|
+
/**
|
|
39
|
+
* secretref URI of the minted per-grant credential; present once GRANTED.
|
|
40
|
+
*/
|
|
41
|
+
credentialRef?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Name of the scoped principal minted on the source for this grant; present once GRANTED.
|
|
44
|
+
*/
|
|
45
|
+
mintedPrincipal?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Operation (e.g. deployment analysis) that raised the request, for audit correlation.
|
|
48
|
+
*/
|
|
49
|
+
requestedByOperationId?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Admin identity that resolved the request; present once GRANTED or DENIED.
|
|
52
|
+
*/
|
|
53
|
+
approvedBy?: string;
|
|
54
|
+
/**
|
|
55
|
+
* RFC 3339 instant the request was resolved; present once GRANTED or DENIED.
|
|
56
|
+
*/
|
|
57
|
+
approvedAt?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const legalDataGrantStatusTransitions: Record<string, Record<string, true>> = {
|
|
61
|
+
"REQUESTED": { "GRANTED": true, "DENIED": true },
|
|
62
|
+
};
|
|
63
|
+
const terminalDataGrantStatusStates = new Set<string>(["GRANTED", "DENIED"]);
|
|
64
|
+
|
|
65
|
+
/** True iff from→to is a legal DataGrantStatus edge (schema x-transitions). */
|
|
66
|
+
export function canTransitionDataGrantStatus(from: string, to: string): boolean {
|
|
67
|
+
return Boolean(legalDataGrantStatusTransitions[from]?.[to]);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** True iff the DataGrantStatus is terminal (GRANTED, DENIED). */
|
|
71
|
+
export function isTerminalDataGrantStatus(state: string): boolean { return terminalDataGrantStatusStates.has(state); }
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Closed connector set for the Data-Access MVP.
|
|
6
|
+
*/
|
|
7
|
+
export type DataSourceConnector = 'postgres' | 'redshift' | 'bigquery' | 'databricks';
|
|
8
|
+
/**
|
|
9
|
+
* byo = admin brought existing infrastructure; harbour_managed = Harbour provisioned it.
|
|
10
|
+
*/
|
|
11
|
+
export type DataSourceProvisioningMode = 'byo' | 'harbour_managed';
|
|
12
|
+
/**
|
|
13
|
+
* DISABLED sources reject new grants and suspend existing access.
|
|
14
|
+
*/
|
|
15
|
+
export type DataSourceStatus = 'ACTIVE' | 'DISABLED';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 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.
|
|
19
|
+
*/
|
|
20
|
+
export interface DataSource {
|
|
21
|
+
/**
|
|
22
|
+
* Owning tenant (org) identifier.
|
|
23
|
+
*/
|
|
24
|
+
tenantId: string;
|
|
25
|
+
/**
|
|
26
|
+
* Tenant-unique data-source identifier.
|
|
27
|
+
*/
|
|
28
|
+
sourceId: string;
|
|
29
|
+
connector: DataSourceConnector;
|
|
30
|
+
/**
|
|
31
|
+
* Human-readable name shown to admins and builders.
|
|
32
|
+
*/
|
|
33
|
+
displayName: string;
|
|
34
|
+
endpoint: DataSourceEndpoint;
|
|
35
|
+
/**
|
|
36
|
+
* secretref URI naming the platform-held credential for this source. The referenced value never crosses this boundary.
|
|
37
|
+
*/
|
|
38
|
+
credentialRef: string;
|
|
39
|
+
provisioningMode: DataSourceProvisioningMode;
|
|
40
|
+
/**
|
|
41
|
+
* Admin-declared selector allowlist (e.g. schema.table patterns) that grant scopes are validated against.
|
|
42
|
+
*/
|
|
43
|
+
allowedScope: string[];
|
|
44
|
+
/**
|
|
45
|
+
* Selectors discovery actually observed on the source. Informational; never widens allowedScope.
|
|
46
|
+
*/
|
|
47
|
+
observedScope?: string[];
|
|
48
|
+
/**
|
|
49
|
+
* Whether builders may request grants against this source.
|
|
50
|
+
*/
|
|
51
|
+
requestableByBuilders: boolean;
|
|
52
|
+
status: DataSourceStatus;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Connector endpoint coordinates. host is always present; database vs project/workspace depends on the connector family.
|
|
56
|
+
*/
|
|
57
|
+
export interface DataSourceEndpoint {
|
|
58
|
+
/**
|
|
59
|
+
* Network host (or warehouse endpoint) of the source.
|
|
60
|
+
*/
|
|
61
|
+
host: string;
|
|
62
|
+
/**
|
|
63
|
+
* TCP port; absent where the connector implies it.
|
|
64
|
+
*/
|
|
65
|
+
port?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Database name (postgres/redshift-style connectors).
|
|
68
|
+
*/
|
|
69
|
+
database?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Project identifier (bigquery-style connectors).
|
|
72
|
+
*/
|
|
73
|
+
project?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Workspace identifier (databricks-style connectors).
|
|
76
|
+
*/
|
|
77
|
+
workspace?: string;
|
|
78
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* One environment-variable binding: exactly one of secretRef (secret, resolved at runtime) or value (plain literal).
|
|
6
|
+
*/
|
|
7
|
+
export type DeployRequestEnvironmentBinding = {
|
|
8
|
+
/**
|
|
9
|
+
* Environment-variable name the app reads.
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* secretref URI resolved at runtime; the value never appears in the request.
|
|
14
|
+
*/
|
|
15
|
+
secretRef?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Plain (non-secret) literal value.
|
|
18
|
+
*/
|
|
19
|
+
value?: string;
|
|
20
|
+
} & DeployRequestEnvironmentBinding1;
|
|
21
|
+
export type DeployRequestEnvironmentBinding1 = {
|
|
22
|
+
[k: string]: unknown;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 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.
|
|
27
|
+
*/
|
|
28
|
+
export interface DeployRequest {
|
|
29
|
+
source: DeployRequestSource;
|
|
30
|
+
/**
|
|
31
|
+
* Deployment target. The API rejects production; production remains human-merge gated.
|
|
32
|
+
*/
|
|
33
|
+
environment: 'preview';
|
|
34
|
+
/**
|
|
35
|
+
* Git branch that must contain the exact requested commit.
|
|
36
|
+
*/
|
|
37
|
+
branch: string;
|
|
38
|
+
/**
|
|
39
|
+
* Exact lowercase hexadecimal Git commit to materialize and deploy.
|
|
40
|
+
*/
|
|
41
|
+
commit: string;
|
|
42
|
+
/**
|
|
43
|
+
* 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.
|
|
44
|
+
*/
|
|
45
|
+
idempotencyKey?: string;
|
|
46
|
+
environmentBindings?: DeployRequestEnvironmentBindings;
|
|
47
|
+
}
|
|
48
|
+
export interface DeployRequestSource {
|
|
49
|
+
/**
|
|
50
|
+
* Source provider. The preview MVP accepts only github.
|
|
51
|
+
*/
|
|
52
|
+
provider: 'github';
|
|
53
|
+
/**
|
|
54
|
+
* Credential-free HTTPS GitHub repository URL.
|
|
55
|
+
*/
|
|
56
|
+
repositoryUrl: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 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.
|
|
60
|
+
*/
|
|
61
|
+
export interface DeployRequestEnvironmentBindings {
|
|
62
|
+
/**
|
|
63
|
+
* Environment-variable bindings for this deployment.
|
|
64
|
+
*/
|
|
65
|
+
bindings: DeployRequestEnvironmentBinding[];
|
|
66
|
+
}
|
|
@@ -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
|
+
}
|
package/gen-ts/index.ts
ADDED
|
@@ -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
|
+
}
|