@tiangong-lca/cli 0.1.1 → 0.1.2
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 +26 -6
- package/dist/src/batch.d.ts +6 -0
- package/dist/src/batch.js +6 -0
- package/dist/src/batch.js.map +1 -0
- package/dist/src/cli.d.ts +161 -0
- package/dist/src/command-spec.d.ts +90 -0
- package/dist/src/command-spec.js +400 -0
- package/dist/src/command-spec.js.map +1 -0
- package/dist/src/lib/artifacts.d.ts +9 -0
- package/dist/src/lib/auth-identity-receipt.d.ts +160 -0
- package/dist/src/lib/batch/attempt-recovery.d.ts +12 -0
- package/dist/src/lib/batch/attempt-recovery.js +183 -0
- package/dist/src/lib/batch/attempt-recovery.js.map +1 -0
- package/dist/src/lib/batch/canonical-contracts.d.ts +21 -0
- package/dist/src/lib/batch/canonical-contracts.js +180 -0
- package/dist/src/lib/batch/canonical-contracts.js.map +1 -0
- package/dist/src/lib/batch/engine.d.ts +2 -0
- package/dist/src/lib/batch/engine.js +294 -0
- package/dist/src/lib/batch/engine.js.map +1 -0
- package/dist/src/lib/batch/errors.d.ts +51 -0
- package/dist/src/lib/batch/errors.js +81 -0
- package/dist/src/lib/batch/errors.js.map +1 -0
- package/dist/src/lib/batch/item-projection.d.ts +10 -0
- package/dist/src/lib/batch/item-projection.js +118 -0
- package/dist/src/lib/batch/item-projection.js.map +1 -0
- package/dist/src/lib/batch/run-lock.d.ts +4 -0
- package/dist/src/lib/batch/run-lock.js +155 -0
- package/dist/src/lib/batch/run-lock.js.map +1 -0
- package/dist/src/lib/batch/scheduler-runtime.d.ts +29 -0
- package/dist/src/lib/batch/scheduler-runtime.js +114 -0
- package/dist/src/lib/batch/scheduler-runtime.js.map +1 -0
- package/dist/src/lib/batch/types.d.ts +183 -0
- package/dist/src/lib/batch/types.js +2 -0
- package/dist/src/lib/batch/types.js.map +1 -0
- package/dist/src/lib/dataset-author.d.ts +39 -0
- package/dist/src/lib/dataset-bilingual.d.ts +165 -0
- package/dist/src/lib/dataset-classification.d.ts +279 -0
- package/dist/src/lib/dataset-command.d.ts +53 -0
- package/dist/src/lib/dataset-contract.d.ts +82 -0
- package/dist/src/lib/dataset-curation-queue.d.ts +219 -0
- package/dist/src/lib/dataset-evidence-search.d.ts +134 -0
- package/dist/src/lib/dataset-import-lca.d.ts +136 -0
- package/dist/src/lib/dataset-local.d.ts +23 -0
- package/dist/src/lib/dataset-maintenance-alias-request.d.ts +12 -0
- package/dist/src/lib/dataset-maintenance-alias-rewrite.d.ts +111 -0
- package/dist/src/lib/dataset-maintenance-apply.d.ts +458 -0
- package/dist/src/lib/dataset-maintenance-clear-account.d.ts +161 -0
- package/dist/src/lib/dataset-maintenance-contract.d.ts +317 -0
- package/dist/src/lib/dataset-maintenance-derivatives.d.ts +48 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-approval-claim.d.ts +50 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-capture.d.ts +110 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-command.d.ts +15 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-contract.d.ts +387 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-execution-contract.d.ts +456 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-freeze.d.ts +99 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-plan.d.ts +85 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-recovery.d.ts +268 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-run.d.ts +123 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-seal.d.ts +50 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-verify.d.ts +85 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-wire.d.ts +32 -0
- package/dist/src/lib/dataset-maintenance-pagination.d.ts +58 -0
- package/dist/src/lib/dataset-maintenance-plan.d.ts +40 -0
- package/dist/src/lib/dataset-maintenance-protected-artifacts.d.ts +16 -0
- package/dist/src/lib/dataset-maintenance-protected-before.d.ts +71 -0
- package/dist/src/lib/dataset-maintenance-protected-contract.d.ts +385 -0
- package/dist/src/lib/dataset-maintenance-protected-freeze.d.ts +148 -0
- package/dist/src/lib/dataset-maintenance-protected-preparation.d.ts +76 -0
- package/dist/src/lib/dataset-maintenance-protected-run.d.ts +252 -0
- package/dist/src/lib/dataset-maintenance-protected-seal.d.ts +93 -0
- package/dist/src/lib/dataset-maintenance-protected-toolchain.d.ts +31 -0
- package/dist/src/lib/dataset-maintenance-protected-verify.d.ts +99 -0
- package/dist/src/lib/dataset-maintenance-remote.d.ts +212 -0
- package/dist/src/lib/dataset-maintenance-support-validation.d.ts +18 -0
- package/dist/src/lib/dataset-maintenance-verify.d.ts +102 -0
- package/dist/src/lib/dataset-patch.d.ts +193 -0
- package/dist/src/lib/dataset-references-rewrite.d.ts +77 -0
- package/dist/src/lib/dataset-remote-refresh.d.ts +64 -0
- package/dist/src/lib/dataset-remote-verify.d.ts +168 -0
- package/dist/src/lib/dataset-save-draft-run.d.ts +283 -0
- package/dist/src/lib/dataset-save-draft-run.js +54 -21
- package/dist/src/lib/dataset-save-draft-run.js.map +1 -1
- package/dist/src/lib/dataset-source-upload-attachments.d.ts +109 -0
- package/dist/src/lib/dataset-validate.d.ts +62 -0
- package/dist/src/lib/dotenv.d.ts +6 -0
- package/dist/src/lib/env.d.ts +59 -0
- package/dist/src/lib/errors.d.ts +18 -0
- package/dist/src/lib/flow-build-alias-map.d.ts +80 -0
- package/dist/src/lib/flow-fetch-rows.d.ts +70 -0
- package/dist/src/lib/flow-get.d.ts +35 -0
- package/dist/src/lib/flow-governance.d.ts +22 -0
- package/dist/src/lib/flow-list.d.ts +57 -0
- package/dist/src/lib/flow-materialize-decisions.d.ts +67 -0
- package/dist/src/lib/flow-payload-validation.d.ts +32 -0
- package/dist/src/lib/flow-publish-reviewed-data.d.ts +262 -0
- package/dist/src/lib/flow-publish-version.d.ts +193 -0
- package/dist/src/lib/flow-qa.d.ts +289 -0
- package/dist/src/lib/flow-read.d.ts +70 -0
- package/dist/src/lib/flow-regen-product.d.ts +431 -0
- package/dist/src/lib/flow-remediate.d.ts +133 -0
- package/dist/src/lib/http.d.ts +25 -0
- package/dist/src/lib/identity-preflight.d.ts +235 -0
- package/dist/src/lib/io.d.ts +2 -0
- package/dist/src/lib/kb-search.d.ts +23 -0
- package/dist/src/lib/lca-release.d.ts +105 -0
- package/dist/src/lib/lifecyclemodel-auto-build.d.ts +223 -0
- package/dist/src/lib/lifecyclemodel-bundle-save.d.ts +71 -0
- package/dist/src/lib/lifecyclemodel-graph.d.ts +91 -0
- package/dist/src/lib/lifecyclemodel-orchestrate.d.ts +349 -0
- package/dist/src/lib/lifecyclemodel-publish-build.d.ts +77 -0
- package/dist/src/lib/lifecyclemodel-publish-resulting-process.d.ts +27 -0
- package/dist/src/lib/lifecyclemodel-qa.d.ts +206 -0
- package/dist/src/lib/lifecyclemodel-resulting-process.d.ts +204 -0
- package/dist/src/lib/lifecyclemodel-save-draft-run.d.ts +96 -0
- package/dist/src/lib/lifecyclemodel-validate-build.d.ts +78 -0
- package/dist/src/lib/llm.d.ts +51 -0
- package/dist/src/lib/package-version.d.ts +3 -0
- package/dist/src/lib/process-auto-build.d.ts +168 -0
- package/dist/src/lib/process-batch-build.d.ts +97 -0
- package/dist/src/lib/process-dedup-review.d.ts +253 -0
- package/dist/src/lib/process-flow-build-plan.d.ts +108 -0
- package/dist/src/lib/process-get.d.ts +26 -0
- package/dist/src/lib/process-list.d.ts +87 -0
- package/dist/src/lib/process-payload-validation.d.ts +27 -0
- package/dist/src/lib/process-publish-build.d.ts +148 -0
- package/dist/src/lib/process-qa.d.ts +243 -0
- package/dist/src/lib/process-refresh-references.d.ts +179 -0
- package/dist/src/lib/process-required-fields.d.ts +142 -0
- package/dist/src/lib/process-resume-build.d.ts +77 -0
- package/dist/src/lib/process-save-draft-run.d.ts +72 -0
- package/dist/src/lib/process-save-draft.d.ts +53 -0
- package/dist/src/lib/process-scope-statistics.d.ts +210 -0
- package/dist/src/lib/process-verify-rows.d.ts +71 -0
- package/dist/src/lib/publish.d.ts +219 -0
- package/dist/src/lib/remote.d.ts +19 -0
- package/dist/src/lib/run.d.ts +60 -0
- package/dist/src/lib/runtime-rulesets.d.ts +29 -0
- package/dist/src/lib/state-lock.d.ts +25 -0
- package/dist/src/lib/state-lock.js +23 -1
- package/dist/src/lib/state-lock.js.map +1 -1
- package/dist/src/lib/supabase-client.d.ts +47 -0
- package/dist/src/lib/supabase-data-api-contract.d.ts +304 -0
- package/dist/src/lib/supabase-data-api-replay.d.ts +74 -0
- package/dist/src/lib/supabase-json-ordered-write.d.ts +65 -0
- package/dist/src/lib/supabase-rest.d.ts +26 -0
- package/dist/src/lib/supabase-session.d.ts +115 -0
- package/dist/src/lib/tidas-languages.d.ts +3 -0
- package/dist/src/lib/tidas-sdk-package-validator.d.ts +111 -0
- package/dist/src/lib/tidas-sdk-validation.d.ts +42 -0
- package/dist/src/lib/unstructured.d.ts +32 -0
- package/dist/src/lib/user-api-key.d.ts +16 -0
- package/dist/src/lib/validation.d.ts +82 -0
- package/dist/src/main.d.ts +4 -0
- package/package.json +13 -2
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type DatasetMaintenancePlan, type DatasetMaintenanceRemoteRow, type DatasetMaintenanceRowSnapshot } from './dataset-maintenance-contract.js';
|
|
2
|
+
import { parseProtectedDerivativeSnapshot, type ProtectedDerivativeSnapshot, type ProtectedDerivativeTarget } from './dataset-maintenance-protected-contract.js';
|
|
3
|
+
import { fetchMaintenanceDerivativeSnapshot, fetchMaintenanceExactRows, type DatasetMaintenanceRemoteContext } from './dataset-maintenance-remote.js';
|
|
4
|
+
export type ProtectedDerivativeSnapshotTarget = Omit<ProtectedDerivativeTarget, 'baseline_snapshot_sha256'> & {
|
|
5
|
+
baseline_snapshot_sha256?: string;
|
|
6
|
+
};
|
|
7
|
+
export type ProtectedBeforeReadDependencies = {
|
|
8
|
+
fetchExactRows: typeof fetchMaintenanceExactRows;
|
|
9
|
+
fetchDerivativeSnapshot: typeof fetchMaintenanceDerivativeSnapshot;
|
|
10
|
+
parseDerivativeSnapshot: typeof parseProtectedDerivativeSnapshot;
|
|
11
|
+
};
|
|
12
|
+
export type ProtectedBeforeReadDependencyOverrides = Partial<ProtectedBeforeReadDependencies>;
|
|
13
|
+
export type ProtectedBeforeValidationResult = {
|
|
14
|
+
projected_rows: DatasetMaintenanceRemoteRow[];
|
|
15
|
+
support_snapshots: DatasetMaintenanceRowSnapshot[];
|
|
16
|
+
derivative_snapshots: ProtectedDerivativeSnapshot[];
|
|
17
|
+
derivative_mode: 'capture' | 'compare';
|
|
18
|
+
};
|
|
19
|
+
type ProtectedBeforeBaseOptions = {
|
|
20
|
+
plan: DatasetMaintenancePlan;
|
|
21
|
+
planDir: string;
|
|
22
|
+
actorUserId: string;
|
|
23
|
+
currentRows: DatasetMaintenanceRemoteRow[];
|
|
24
|
+
completeness: unknown;
|
|
25
|
+
context: DatasetMaintenanceRemoteContext;
|
|
26
|
+
dependencies?: ProtectedBeforeReadDependencyOverrides;
|
|
27
|
+
};
|
|
28
|
+
export type ValidateProtectedBeforeStateOptions = ProtectedBeforeBaseOptions & ({
|
|
29
|
+
derivativeMode: 'capture';
|
|
30
|
+
derivativeTargets: ProtectedDerivativeSnapshotTarget[];
|
|
31
|
+
} | {
|
|
32
|
+
derivativeMode: 'compare';
|
|
33
|
+
derivativeTargets: ProtectedDerivativeTarget[];
|
|
34
|
+
});
|
|
35
|
+
export declare function projectedRows(options: {
|
|
36
|
+
plan: DatasetMaintenancePlan;
|
|
37
|
+
planDir: string;
|
|
38
|
+
currentRows: DatasetMaintenanceRemoteRow[];
|
|
39
|
+
}): DatasetMaintenanceRemoteRow[];
|
|
40
|
+
export declare function assertStrictBeforeState(options: {
|
|
41
|
+
plan: DatasetMaintenancePlan;
|
|
42
|
+
planDir: string;
|
|
43
|
+
actorUserId: string;
|
|
44
|
+
currentRows: DatasetMaintenanceRemoteRow[];
|
|
45
|
+
completeness: unknown;
|
|
46
|
+
}): DatasetMaintenanceRemoteRow[];
|
|
47
|
+
export declare function assertSupportSnapshots(options: {
|
|
48
|
+
plan: DatasetMaintenancePlan;
|
|
49
|
+
actorUserId: string;
|
|
50
|
+
context: DatasetMaintenanceRemoteContext;
|
|
51
|
+
dependencies?: ProtectedBeforeReadDependencyOverrides;
|
|
52
|
+
}): Promise<DatasetMaintenanceRowSnapshot[]>;
|
|
53
|
+
export declare function captureDerivativeSnapshots(options: {
|
|
54
|
+
actorUserId: string;
|
|
55
|
+
context: DatasetMaintenanceRemoteContext;
|
|
56
|
+
derivativeTargets: ProtectedDerivativeSnapshotTarget[];
|
|
57
|
+
dependencies?: ProtectedBeforeReadDependencyOverrides;
|
|
58
|
+
}): Promise<ProtectedDerivativeSnapshot[]>;
|
|
59
|
+
export declare function assertDerivativeBaselines(options: {
|
|
60
|
+
actorUserId: string;
|
|
61
|
+
context: DatasetMaintenanceRemoteContext;
|
|
62
|
+
derivativeTargets: ProtectedDerivativeTarget[];
|
|
63
|
+
dependencies?: ProtectedBeforeReadDependencyOverrides;
|
|
64
|
+
}): Promise<ProtectedDerivativeSnapshot[]>;
|
|
65
|
+
export declare function assertDerivativeCensusBindings(options: {
|
|
66
|
+
actorUserId: string;
|
|
67
|
+
currentRows: DatasetMaintenanceRemoteRow[];
|
|
68
|
+
derivativeSnapshots: ProtectedDerivativeSnapshot[];
|
|
69
|
+
}): void;
|
|
70
|
+
export declare function validateProtectedBeforeState(options: ValidateProtectedBeforeStateOptions): Promise<ProtectedBeforeValidationResult>;
|
|
71
|
+
export {};
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { type DatasetMaintenancePlan, type JsonObject } from './dataset-maintenance-contract.js';
|
|
2
|
+
export declare const PROTECTED_EXECUTION_CONTRACT: {
|
|
3
|
+
readonly freeze_schema: 'dataset-alias-execution-freeze.v1';
|
|
4
|
+
readonly approval_schema: 'dataset-alias-execution-approval.v1';
|
|
5
|
+
readonly preflight_request_schema: 'dataset-alias-execution-preflight.v1';
|
|
6
|
+
readonly preflight_response_schema: 'dataset-alias-execution-preflight-proof.v1';
|
|
7
|
+
readonly gate_response_schema: 'dataset-alias-execution-gate-receipt.v1';
|
|
8
|
+
readonly admit_request_schema: 'dataset-alias-execution-admit.v1';
|
|
9
|
+
readonly admit_response_schema: 'dataset-alias-execution-admit.v1';
|
|
10
|
+
readonly status_response_schema: 'dataset-alias-execution-status.v1';
|
|
11
|
+
readonly terminal_proof_schema: 'dataset-alias-execution-terminal-proof.v1';
|
|
12
|
+
readonly marker_schema: 'dataset-alias-execution-attempt.v1';
|
|
13
|
+
readonly report_schema: 'dataset-alias-execution-report.v1';
|
|
14
|
+
readonly preflight_command: 'cmd_dataset_alias_execution_preflight_guarded';
|
|
15
|
+
readonly gate_command: 'cmd_dataset_alias_execution_gate_guarded';
|
|
16
|
+
readonly admit_command: 'cmd_dataset_alias_execution_admit_guarded';
|
|
17
|
+
readonly read_command: 'cmd_dataset_alias_execution_read';
|
|
18
|
+
};
|
|
19
|
+
export declare const PROTECTED_EXECUTION_COUNTS: {
|
|
20
|
+
readonly action_count: 52;
|
|
21
|
+
readonly batch_count: 2;
|
|
22
|
+
readonly exchange_count: 59;
|
|
23
|
+
readonly amount_field_count: 118;
|
|
24
|
+
readonly unrelated_exchange_count: 309;
|
|
25
|
+
readonly audit_count: 55;
|
|
26
|
+
readonly flowproperty_count: 2;
|
|
27
|
+
readonly flow_count: 23;
|
|
28
|
+
readonly process_count: 27;
|
|
29
|
+
readonly derivative_target_count: 50;
|
|
30
|
+
};
|
|
31
|
+
export type ProtectedExecutionStatus = 'not_admitted' | 'dispatching' | 'dispatched' | 'running' | 'derivatives_pending' | 'completed' | 'failed' | 'indeterminate';
|
|
32
|
+
export type ProtectedReportStatus = 'pending' | 'passed' | 'failed' | 'indeterminate';
|
|
33
|
+
export type ProtectedDerivativeTargetTable = 'flows' | 'processes';
|
|
34
|
+
export type ProtectedDerivativeTarget = {
|
|
35
|
+
table: ProtectedDerivativeTargetTable;
|
|
36
|
+
id: string;
|
|
37
|
+
version: string;
|
|
38
|
+
user_id: string;
|
|
39
|
+
state_code: 0;
|
|
40
|
+
baseline_snapshot_sha256: string;
|
|
41
|
+
};
|
|
42
|
+
export type ProtectedDerivativeSnapshot = {
|
|
43
|
+
schema_version: 'dataset-derivative-snapshot.v1';
|
|
44
|
+
table: ProtectedDerivativeTargetTable;
|
|
45
|
+
id: string;
|
|
46
|
+
version: string;
|
|
47
|
+
user_id: string;
|
|
48
|
+
state_code: 0;
|
|
49
|
+
modified_at: string;
|
|
50
|
+
json_sha256: string;
|
|
51
|
+
json_ordered_sha256: string;
|
|
52
|
+
extracted_md_sha256: string | null;
|
|
53
|
+
embedding_ft_sha256: string | null;
|
|
54
|
+
embedding_ft_at: string | null;
|
|
55
|
+
snapshot_sha256: string;
|
|
56
|
+
};
|
|
57
|
+
export type ProtectedExecutionBindings = {
|
|
58
|
+
plan_file_sha256: string;
|
|
59
|
+
freeze_file_sha256: string;
|
|
60
|
+
freeze_sha256: string;
|
|
61
|
+
approval_file_sha256: string;
|
|
62
|
+
approval_identity_sha256: string;
|
|
63
|
+
approval_text_sha256: string;
|
|
64
|
+
alias_plan_request_sha256: string;
|
|
65
|
+
before_hash_set_sha256: string;
|
|
66
|
+
desired_hash_set_sha256: string;
|
|
67
|
+
exchange_rewrite_set_sha256: string;
|
|
68
|
+
support_snapshot_set_sha256: string;
|
|
69
|
+
derivative_baseline_set_sha256: string;
|
|
70
|
+
derivative_target_set_sha256: string;
|
|
71
|
+
toolchain_evidence_sha256: string;
|
|
72
|
+
};
|
|
73
|
+
export type ProtectedGateExpectations = {
|
|
74
|
+
primary_support_plan_sha256: string;
|
|
75
|
+
execution_unused_sha256: string;
|
|
76
|
+
derivative_quiescence_sha256: string;
|
|
77
|
+
};
|
|
78
|
+
export type DatasetMaintenanceProtectedFreeze = {
|
|
79
|
+
schema_version: typeof PROTECTED_EXECUTION_CONTRACT.freeze_schema;
|
|
80
|
+
environment: 'production';
|
|
81
|
+
project_ref: string;
|
|
82
|
+
account: {
|
|
83
|
+
user_id: string;
|
|
84
|
+
email: string;
|
|
85
|
+
};
|
|
86
|
+
target_visibility: 'owner_draft';
|
|
87
|
+
plan: {
|
|
88
|
+
plan_file_sha256: string;
|
|
89
|
+
plan_sha256: string;
|
|
90
|
+
operation_id: string;
|
|
91
|
+
};
|
|
92
|
+
sets: Omit<ProtectedExecutionBindings, 'plan_file_sha256' | 'freeze_file_sha256' | 'freeze_sha256' | 'approval_file_sha256' | 'approval_identity_sha256' | 'approval_text_sha256'>;
|
|
93
|
+
expected: typeof PROTECTED_EXECUTION_COUNTS;
|
|
94
|
+
derivative_targets: ProtectedDerivativeTarget[];
|
|
95
|
+
policy: {
|
|
96
|
+
state_code_changes: 0;
|
|
97
|
+
save_draft: 0;
|
|
98
|
+
deletes: 0;
|
|
99
|
+
rebuild_derivatives: 0;
|
|
100
|
+
unitgroup_actions: 0;
|
|
101
|
+
person_distance_actions: 0;
|
|
102
|
+
max_admit_posts: 1;
|
|
103
|
+
automatic_retry: false;
|
|
104
|
+
};
|
|
105
|
+
freeze_sha256: string;
|
|
106
|
+
};
|
|
107
|
+
export type DatasetMaintenanceProtectedApproval = {
|
|
108
|
+
schema_version: typeof PROTECTED_EXECUTION_CONTRACT.approval_schema;
|
|
109
|
+
approved_at_utc: string;
|
|
110
|
+
environment: 'production';
|
|
111
|
+
project_ref: string;
|
|
112
|
+
account: {
|
|
113
|
+
user_id: string;
|
|
114
|
+
email: string;
|
|
115
|
+
};
|
|
116
|
+
target_visibility: 'owner_draft';
|
|
117
|
+
plan_sha256: string;
|
|
118
|
+
operation_id: string;
|
|
119
|
+
plan_file_sha256: string;
|
|
120
|
+
freeze_file_sha256: string;
|
|
121
|
+
freeze_sha256: string;
|
|
122
|
+
approval_text_sha256: string;
|
|
123
|
+
max_admit_posts: 1;
|
|
124
|
+
automatic_retry: false;
|
|
125
|
+
approval_identity_sha256: string;
|
|
126
|
+
};
|
|
127
|
+
export type ProtectedExecutionIdentity = {
|
|
128
|
+
request_id: string;
|
|
129
|
+
identity_sha256: string;
|
|
130
|
+
environment: 'production';
|
|
131
|
+
project_ref: string;
|
|
132
|
+
actor: {
|
|
133
|
+
user_id: string;
|
|
134
|
+
email: string;
|
|
135
|
+
};
|
|
136
|
+
target_visibility: 'owner_draft';
|
|
137
|
+
plan_sha256: string;
|
|
138
|
+
operation_id: string;
|
|
139
|
+
bindings: ProtectedExecutionBindings;
|
|
140
|
+
expected: typeof PROTECTED_EXECUTION_COUNTS;
|
|
141
|
+
derivative_targets: ProtectedDerivativeTarget[];
|
|
142
|
+
};
|
|
143
|
+
export type ProtectedPreflightProof = {
|
|
144
|
+
schema_version: typeof PROTECTED_EXECUTION_CONTRACT.preflight_response_schema;
|
|
145
|
+
command: typeof PROTECTED_EXECUTION_CONTRACT.preflight_command;
|
|
146
|
+
request_id: string;
|
|
147
|
+
actor_user_id: string;
|
|
148
|
+
environment: 'production';
|
|
149
|
+
project_ref: string;
|
|
150
|
+
server_context_sha256: string;
|
|
151
|
+
plan_sha256: string;
|
|
152
|
+
operation_id: string;
|
|
153
|
+
alias_plan_request_sha256: string;
|
|
154
|
+
freeze_sha256: string;
|
|
155
|
+
approval_identity_sha256: string;
|
|
156
|
+
plan_request_sha256: string;
|
|
157
|
+
bindings_sha256: string;
|
|
158
|
+
expected_sha256: string;
|
|
159
|
+
derivative_targets_sha256: string;
|
|
160
|
+
gate_expectations: ProtectedGateExpectations;
|
|
161
|
+
gate_expectations_sha256: string;
|
|
162
|
+
failure_baseline_sha256: string;
|
|
163
|
+
preflight_request_sha256: string;
|
|
164
|
+
preflight_token: string;
|
|
165
|
+
preflight_proof_sha256: string;
|
|
166
|
+
completed_at: string;
|
|
167
|
+
expires_at: string;
|
|
168
|
+
simulation: {
|
|
169
|
+
plan_rows: 52;
|
|
170
|
+
plan_exchanges: 59;
|
|
171
|
+
alias_audits: 55;
|
|
172
|
+
derivative_targets: 50;
|
|
173
|
+
rolled_back: true;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
export type ProtectedGateResult = {
|
|
177
|
+
expected_sha256: string;
|
|
178
|
+
observed_sha256: string;
|
|
179
|
+
status: 'passed';
|
|
180
|
+
captured_at: string;
|
|
181
|
+
};
|
|
182
|
+
export type ProtectedGateProof = {
|
|
183
|
+
schema_version: typeof PROTECTED_EXECUTION_CONTRACT.gate_response_schema;
|
|
184
|
+
command: typeof PROTECTED_EXECUTION_CONTRACT.gate_command;
|
|
185
|
+
request_id: string;
|
|
186
|
+
actor_user_id: string;
|
|
187
|
+
preflight_proof_sha256: string;
|
|
188
|
+
gate: 'primary_support_plan' | 'execution_unused' | 'derivative_quiescence';
|
|
189
|
+
result: ProtectedGateResult;
|
|
190
|
+
receipt_sha256: string;
|
|
191
|
+
};
|
|
192
|
+
export type ProtectedAdmissionProof = {
|
|
193
|
+
schema_version: typeof PROTECTED_EXECUTION_CONTRACT.admit_response_schema;
|
|
194
|
+
command: typeof PROTECTED_EXECUTION_CONTRACT.admit_command;
|
|
195
|
+
request_id: string;
|
|
196
|
+
plan_sha256: string;
|
|
197
|
+
operation_id: string;
|
|
198
|
+
plan_request_sha256: string;
|
|
199
|
+
preflight_proof_sha256: string;
|
|
200
|
+
admission_request_sha256: string;
|
|
201
|
+
gate_results_sha256: string;
|
|
202
|
+
status: 'dispatched';
|
|
203
|
+
attempt_count: 1;
|
|
204
|
+
dispatch_count: 1;
|
|
205
|
+
net_request_id: string;
|
|
206
|
+
attempt_consumed: true;
|
|
207
|
+
retry_allowed: false;
|
|
208
|
+
};
|
|
209
|
+
export type ProtectedTerminalTargetProof = {
|
|
210
|
+
ordinal: number;
|
|
211
|
+
request_id: string;
|
|
212
|
+
table: ProtectedDerivativeTargetTable;
|
|
213
|
+
id: string;
|
|
214
|
+
version: string;
|
|
215
|
+
status: string;
|
|
216
|
+
phase: string;
|
|
217
|
+
source_baseline_snapshot_sha256: string;
|
|
218
|
+
expected_snapshot_sha256: string;
|
|
219
|
+
completed_snapshot_sha256: string | null;
|
|
220
|
+
primary_matches: boolean;
|
|
221
|
+
terminal_snapshot_matches: boolean;
|
|
222
|
+
proposals_committed: boolean;
|
|
223
|
+
derivative_fresh: boolean;
|
|
224
|
+
lifecycle_complete: boolean;
|
|
225
|
+
terminal_audit_present: boolean;
|
|
226
|
+
residue: {
|
|
227
|
+
http_requests: number;
|
|
228
|
+
embedding_jobs: number;
|
|
229
|
+
pending_jobs: number;
|
|
230
|
+
failure_rows: number;
|
|
231
|
+
other_active_fences: number;
|
|
232
|
+
};
|
|
233
|
+
causal_terminal_proof: boolean;
|
|
234
|
+
};
|
|
235
|
+
export type ProtectedStatusTargetProof = {
|
|
236
|
+
ordinal: number;
|
|
237
|
+
request_id: string;
|
|
238
|
+
table: ProtectedDerivativeTargetTable;
|
|
239
|
+
id: string;
|
|
240
|
+
version: string;
|
|
241
|
+
status: string;
|
|
242
|
+
phase: string;
|
|
243
|
+
error: JsonObject | null;
|
|
244
|
+
causal_terminal_proof: false;
|
|
245
|
+
};
|
|
246
|
+
type ProtectedDerivativeReadbackCommon = {
|
|
247
|
+
schema_version: 'dataset-derivative-rebuild-batch-status.v1';
|
|
248
|
+
batch_id: string;
|
|
249
|
+
code: string | null;
|
|
250
|
+
causal_terminal_proof: boolean;
|
|
251
|
+
target_count: number;
|
|
252
|
+
flow_count: number;
|
|
253
|
+
process_count: number;
|
|
254
|
+
completed_count: number;
|
|
255
|
+
nonterminal_count: number;
|
|
256
|
+
failed_count: number;
|
|
257
|
+
};
|
|
258
|
+
export type ProtectedDerivativeReadback = ProtectedDerivativeReadbackCommon & ({
|
|
259
|
+
status: 'not_started';
|
|
260
|
+
proof_level: 'none';
|
|
261
|
+
proof_deferred: false;
|
|
262
|
+
invalid_proof_count: null;
|
|
263
|
+
targets: [];
|
|
264
|
+
} | {
|
|
265
|
+
status: 'pending' | 'failed';
|
|
266
|
+
proof_level: 'status_only';
|
|
267
|
+
proof_deferred: boolean;
|
|
268
|
+
invalid_proof_count: null;
|
|
269
|
+
targets: ProtectedStatusTargetProof[];
|
|
270
|
+
} | {
|
|
271
|
+
status: 'completed' | 'failed';
|
|
272
|
+
proof_level: 'causal_terminal';
|
|
273
|
+
proof_deferred: false;
|
|
274
|
+
invalid_proof_count: number;
|
|
275
|
+
targets: ProtectedTerminalTargetProof[];
|
|
276
|
+
});
|
|
277
|
+
export type ProtectedExecutionStatusProof = {
|
|
278
|
+
schema_version: typeof PROTECTED_EXECUTION_CONTRACT.status_response_schema;
|
|
279
|
+
command: typeof PROTECTED_EXECUTION_CONTRACT.read_command;
|
|
280
|
+
request_id: string;
|
|
281
|
+
status: ProtectedReportStatus;
|
|
282
|
+
execution_status: ProtectedExecutionStatus;
|
|
283
|
+
retry_allowed: false;
|
|
284
|
+
actor_user_id: string;
|
|
285
|
+
environment: 'production';
|
|
286
|
+
project_ref: string;
|
|
287
|
+
target_visibility: 'owner_draft' | null;
|
|
288
|
+
plan_sha256: string;
|
|
289
|
+
operation_id: string;
|
|
290
|
+
plan_request_sha256: string;
|
|
291
|
+
freeze_sha256: string | null;
|
|
292
|
+
approval_identity_sha256: string | null;
|
|
293
|
+
approval_text_sha256: string | null;
|
|
294
|
+
derivative_target_set_sha256: string | null;
|
|
295
|
+
preflight_proof_sha256: string;
|
|
296
|
+
admission_request_sha256: string | null;
|
|
297
|
+
gate_results_sha256: string | null;
|
|
298
|
+
attempt_count: number;
|
|
299
|
+
dispatch_count: number;
|
|
300
|
+
gate_count: number;
|
|
301
|
+
gates: Array<ProtectedGateResult & {
|
|
302
|
+
gate: ProtectedGateProof['gate'];
|
|
303
|
+
receipt_sha256: string;
|
|
304
|
+
}>;
|
|
305
|
+
primary_readback: {
|
|
306
|
+
row_count: number | null;
|
|
307
|
+
exchange_count: number | null;
|
|
308
|
+
alias_audit_count: number;
|
|
309
|
+
live_closure_proof: boolean;
|
|
310
|
+
closure: JsonObject;
|
|
311
|
+
} | null;
|
|
312
|
+
derivative_readback: ProtectedDerivativeReadback;
|
|
313
|
+
failure: JsonObject | null;
|
|
314
|
+
};
|
|
315
|
+
declare function parseExpected(value: unknown): typeof PROTECTED_EXECUTION_COUNTS;
|
|
316
|
+
declare function parseDerivativeTarget(value: unknown, index: number): ProtectedDerivativeTarget;
|
|
317
|
+
export declare function parseProtectedDerivativeSnapshot(value: unknown, expected: {
|
|
318
|
+
table: ProtectedDerivativeTargetTable;
|
|
319
|
+
id: string;
|
|
320
|
+
version: string;
|
|
321
|
+
userId: string;
|
|
322
|
+
}): ProtectedDerivativeSnapshot;
|
|
323
|
+
export declare function computeProtectedFreezeSha256(freeze: DatasetMaintenanceProtectedFreeze): string;
|
|
324
|
+
export declare function parseProtectedFreeze(value: unknown): DatasetMaintenanceProtectedFreeze;
|
|
325
|
+
export declare function computeProtectedApprovalIdentitySha256(approval: DatasetMaintenanceProtectedApproval): string;
|
|
326
|
+
export declare function parseProtectedApproval(value: unknown): DatasetMaintenanceProtectedApproval;
|
|
327
|
+
export declare function protectedPlanSetHashes(plan: DatasetMaintenancePlan): {
|
|
328
|
+
before_hash_set_sha256: string;
|
|
329
|
+
desired_hash_set_sha256: string;
|
|
330
|
+
exchange_rewrite_set_sha256: string;
|
|
331
|
+
support_snapshot_set_sha256: string;
|
|
332
|
+
derivative_target_set_sha256: string;
|
|
333
|
+
};
|
|
334
|
+
export declare function protectedDerivativeBaselineSetSha256(targets: ProtectedDerivativeTarget[]): string;
|
|
335
|
+
export declare function assertProtectedFreezeMatchesPlan(options: {
|
|
336
|
+
plan: DatasetMaintenancePlan;
|
|
337
|
+
planFileSha256: string;
|
|
338
|
+
aliasPlanRequestSha256: string;
|
|
339
|
+
freeze: DatasetMaintenanceProtectedFreeze;
|
|
340
|
+
}): void;
|
|
341
|
+
export declare function assertProtectedApprovalBindings(options: {
|
|
342
|
+
approval: DatasetMaintenanceProtectedApproval;
|
|
343
|
+
freeze: DatasetMaintenanceProtectedFreeze;
|
|
344
|
+
freezeFileSha256: string;
|
|
345
|
+
approvalFileSha256: string;
|
|
346
|
+
approveExecution?: string;
|
|
347
|
+
}): void;
|
|
348
|
+
declare function deterministicUuidFromSha256(digest: string): string;
|
|
349
|
+
export declare function buildProtectedExecutionIdentity(options: {
|
|
350
|
+
freeze: DatasetMaintenanceProtectedFreeze;
|
|
351
|
+
approval: DatasetMaintenanceProtectedApproval;
|
|
352
|
+
freezeFileSha256: string;
|
|
353
|
+
approvalFileSha256: string;
|
|
354
|
+
}): ProtectedExecutionIdentity;
|
|
355
|
+
export declare function buildProtectedPreflightRequest(options: {
|
|
356
|
+
identity: ProtectedExecutionIdentity;
|
|
357
|
+
plan: JsonObject;
|
|
358
|
+
freeze: DatasetMaintenanceProtectedFreeze;
|
|
359
|
+
approval: DatasetMaintenanceProtectedApproval;
|
|
360
|
+
}): JsonObject;
|
|
361
|
+
export declare function parseProtectedPreflightProof(value: unknown, identity: ProtectedExecutionIdentity, now?: Date): ProtectedPreflightProof;
|
|
362
|
+
export declare function parseProtectedGateProof(value: unknown, options: {
|
|
363
|
+
identity: ProtectedExecutionIdentity;
|
|
364
|
+
preflight: ProtectedPreflightProof;
|
|
365
|
+
gate: ProtectedGateProof['gate'];
|
|
366
|
+
}): ProtectedGateProof;
|
|
367
|
+
export declare function buildProtectedAdmitRequest(options: {
|
|
368
|
+
preflight: ProtectedPreflightProof;
|
|
369
|
+
gateResults: {
|
|
370
|
+
primary_support_plan: ProtectedGateResult;
|
|
371
|
+
execution_unused: ProtectedGateResult;
|
|
372
|
+
derivative_quiescence: ProtectedGateResult;
|
|
373
|
+
};
|
|
374
|
+
}): JsonObject;
|
|
375
|
+
export declare function parseProtectedAdmissionProof(value: unknown, identity: ProtectedExecutionIdentity, preflight: ProtectedPreflightProof): ProtectedAdmissionProof;
|
|
376
|
+
declare function parseBindings(value: unknown): ProtectedExecutionBindings;
|
|
377
|
+
export declare function parseProtectedStatusProof(value: unknown, identity: ProtectedExecutionIdentity): ProtectedExecutionStatusProof;
|
|
378
|
+
export declare function isUuid(value: string): boolean;
|
|
379
|
+
export declare const __testInternals: {
|
|
380
|
+
deterministicUuidFromSha256: typeof deterministicUuidFromSha256;
|
|
381
|
+
parseBindings: typeof parseBindings;
|
|
382
|
+
parseDerivativeTarget: typeof parseDerivativeTarget;
|
|
383
|
+
parseExpected: typeof parseExpected;
|
|
384
|
+
};
|
|
385
|
+
export {};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { buildAliasPlanRequest } from './dataset-maintenance-alias-request.js';
|
|
2
|
+
import { readProtectedJsonArtifact, materializePrivateArtifactDirectoryAtomically, writePrivateImmutableJson, writePrivateImmutableText } from './dataset-maintenance-protected-artifacts.js';
|
|
3
|
+
import { validateProtectedBeforeState, type ProtectedBeforeValidationResult } from './dataset-maintenance-protected-before.js';
|
|
4
|
+
import { parseMaintenancePlan, type DatasetMaintenancePlan } from './dataset-maintenance-contract.js';
|
|
5
|
+
import { PROTECTED_EXECUTION_COUNTS, type ProtectedDerivativeSnapshot } from './dataset-maintenance-protected-contract.js';
|
|
6
|
+
import { buildProtectedApprovalRequest, buildProtectedFreeze, deriveProtectedDerivativeSnapshotTargets } from './dataset-maintenance-protected-preparation.js';
|
|
7
|
+
import { fetchMaintenanceAccountRows, resolveMaintenanceRemoteContext, type DatasetMaintenanceRemoteContext } from './dataset-maintenance-remote.js';
|
|
8
|
+
import { parseProtectedToolchainEvidence, type DatasetMaintenanceProtectedToolchainEvidence } from './dataset-maintenance-protected-toolchain.js';
|
|
9
|
+
import type { FetchLike } from './http.js';
|
|
10
|
+
export declare const PROTECTED_FREEZE_ARTIFACTS: {
|
|
11
|
+
readonly alias_plan_request: 'protected-alias-plan-request.json';
|
|
12
|
+
readonly derivative_baselines: 'protected-derivative-baselines.json';
|
|
13
|
+
readonly freeze: 'protected-execution-freeze.json';
|
|
14
|
+
readonly approval_request: 'protected-approval-request.json';
|
|
15
|
+
readonly approval_text: 'protected-approval-request.txt';
|
|
16
|
+
readonly report: 'protected-freeze-report.json';
|
|
17
|
+
};
|
|
18
|
+
export type FreezeDatasetMaintenanceProtectedOptions = {
|
|
19
|
+
planPath: string;
|
|
20
|
+
toolchainEvidencePath: string;
|
|
21
|
+
outDir: string;
|
|
22
|
+
expectedProjectRef: string;
|
|
23
|
+
confirm: string;
|
|
24
|
+
cliVersion: string;
|
|
25
|
+
pageSize?: number;
|
|
26
|
+
timeoutMs?: number;
|
|
27
|
+
env: NodeJS.ProcessEnv;
|
|
28
|
+
fetchImpl: FetchLike;
|
|
29
|
+
now?: Date;
|
|
30
|
+
};
|
|
31
|
+
export type DatasetMaintenanceProtectedBaselineManifest = {
|
|
32
|
+
schema_version: 'dataset-alias-derivative-baselines.v1';
|
|
33
|
+
environment: 'production';
|
|
34
|
+
project_ref: string;
|
|
35
|
+
account: {
|
|
36
|
+
user_id: string;
|
|
37
|
+
email: string;
|
|
38
|
+
};
|
|
39
|
+
plan: {
|
|
40
|
+
plan_sha256: string;
|
|
41
|
+
operation_id: string;
|
|
42
|
+
};
|
|
43
|
+
target_count: 50;
|
|
44
|
+
flow_count: 23;
|
|
45
|
+
process_count: 27;
|
|
46
|
+
derivative_baseline_set_sha256: string;
|
|
47
|
+
derivative_snapshot_set_sha256: string;
|
|
48
|
+
snapshots: ProtectedDerivativeSnapshot[];
|
|
49
|
+
};
|
|
50
|
+
export type DatasetMaintenanceProtectedFreezeReport = {
|
|
51
|
+
schema_version: 'dataset-alias-protected-freeze-report.v1';
|
|
52
|
+
generated_at_utc: string;
|
|
53
|
+
status: 'ready_for_human_approval';
|
|
54
|
+
remote_write_mode: 'read_only';
|
|
55
|
+
environment: 'production';
|
|
56
|
+
project_ref: string;
|
|
57
|
+
account: {
|
|
58
|
+
user_id: string;
|
|
59
|
+
email: string;
|
|
60
|
+
};
|
|
61
|
+
plan_sha256: string;
|
|
62
|
+
operation_id: string;
|
|
63
|
+
freeze_sha256: string;
|
|
64
|
+
approval_request_sha256: string;
|
|
65
|
+
approval_text_sha256: string;
|
|
66
|
+
toolchain_evidence_sha256: string;
|
|
67
|
+
derivative_baseline_set_sha256: string;
|
|
68
|
+
derivative_snapshot_set_sha256: string;
|
|
69
|
+
counts: typeof PROTECTED_EXECUTION_COUNTS;
|
|
70
|
+
assertions: {
|
|
71
|
+
account_census_complete: true;
|
|
72
|
+
strict_before_state: true;
|
|
73
|
+
projected_reference_closure: true;
|
|
74
|
+
support_snapshots: 6;
|
|
75
|
+
derivative_snapshots: 50;
|
|
76
|
+
preflight_calls: 0;
|
|
77
|
+
gate_calls: 0;
|
|
78
|
+
admission_calls: 0;
|
|
79
|
+
mutation_calls: 0;
|
|
80
|
+
approval_artifacts: 0;
|
|
81
|
+
};
|
|
82
|
+
artifacts: {
|
|
83
|
+
alias_plan_request: string;
|
|
84
|
+
derivative_baselines: string;
|
|
85
|
+
freeze: string;
|
|
86
|
+
approval_request: string;
|
|
87
|
+
approval_text: string;
|
|
88
|
+
report: string;
|
|
89
|
+
};
|
|
90
|
+
artifact_sha256: {
|
|
91
|
+
alias_plan_request: string;
|
|
92
|
+
derivative_baselines: string;
|
|
93
|
+
freeze: string;
|
|
94
|
+
approval_request: string;
|
|
95
|
+
approval_text: string;
|
|
96
|
+
report: null;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
type FreezeProtectedDependencies = {
|
|
100
|
+
readArtifact: typeof readProtectedJsonArtifact;
|
|
101
|
+
parsePlan: typeof parseMaintenancePlan;
|
|
102
|
+
buildAliasPlan: typeof buildAliasPlanRequest;
|
|
103
|
+
resolveContext: typeof resolveMaintenanceRemoteContext;
|
|
104
|
+
fetchAccountRows: typeof fetchMaintenanceAccountRows;
|
|
105
|
+
parseToolchain: typeof parseProtectedToolchainEvidence;
|
|
106
|
+
deriveTargets: typeof deriveProtectedDerivativeSnapshotTargets;
|
|
107
|
+
validateBefore: typeof validateProtectedBeforeState;
|
|
108
|
+
buildFreeze: typeof buildProtectedFreeze;
|
|
109
|
+
buildApprovalRequest: typeof buildProtectedApprovalRequest;
|
|
110
|
+
writeJson: typeof writePrivateImmutableJson;
|
|
111
|
+
writeText: typeof writePrivateImmutableText;
|
|
112
|
+
materializeArtifacts: typeof materializePrivateArtifactDirectoryAtomically;
|
|
113
|
+
};
|
|
114
|
+
declare function requiredToken(value: string, label: string): string;
|
|
115
|
+
declare function assertContext(options: {
|
|
116
|
+
context: DatasetMaintenanceRemoteContext;
|
|
117
|
+
plan: DatasetMaintenancePlan;
|
|
118
|
+
expectedProjectRef: string;
|
|
119
|
+
confirm: string;
|
|
120
|
+
}): {
|
|
121
|
+
user_id: string;
|
|
122
|
+
email: string;
|
|
123
|
+
};
|
|
124
|
+
declare function assertCanonicalToolchainArtifact(options: {
|
|
125
|
+
artifactText: string;
|
|
126
|
+
evidence: DatasetMaintenanceProtectedToolchainEvidence;
|
|
127
|
+
}): void;
|
|
128
|
+
declare function artifactPaths(outDir: string): DatasetMaintenanceProtectedFreezeReport['artifacts'];
|
|
129
|
+
declare function buildBaselineManifest(options: {
|
|
130
|
+
context: DatasetMaintenanceRemoteContext;
|
|
131
|
+
plan: DatasetMaintenancePlan;
|
|
132
|
+
account: {
|
|
133
|
+
user_id: string;
|
|
134
|
+
email: string;
|
|
135
|
+
};
|
|
136
|
+
validation: ProtectedBeforeValidationResult;
|
|
137
|
+
derivativeBaselineSetSha256: string;
|
|
138
|
+
}): DatasetMaintenanceProtectedBaselineManifest;
|
|
139
|
+
export declare function freezeDatasetMaintenanceProtected(options: FreezeDatasetMaintenanceProtectedOptions, dependencies?: FreezeProtectedDependencies): Promise<DatasetMaintenanceProtectedFreezeReport>;
|
|
140
|
+
export declare const __testInternals: {
|
|
141
|
+
artifactPaths: typeof artifactPaths;
|
|
142
|
+
assertCanonicalToolchainArtifact: typeof assertCanonicalToolchainArtifact;
|
|
143
|
+
assertContext: typeof assertContext;
|
|
144
|
+
buildBaselineManifest: typeof buildBaselineManifest;
|
|
145
|
+
DEFAULT_FREEZE_DEPENDENCIES: FreezeProtectedDependencies;
|
|
146
|
+
requiredToken: typeof requiredToken;
|
|
147
|
+
};
|
|
148
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type DatasetMaintenancePlan, type JsonObject } from './dataset-maintenance-contract.js';
|
|
2
|
+
import { PROTECTED_EXECUTION_COUNTS, type DatasetMaintenanceProtectedApproval, type DatasetMaintenanceProtectedFreeze, type ProtectedDerivativeSnapshot, type ProtectedDerivativeTarget } from './dataset-maintenance-protected-contract.js';
|
|
3
|
+
export declare const PROTECTED_PREPARATION_CONTRACT: {
|
|
4
|
+
readonly approval_request_schema: 'dataset-alias-execution-approval-request.v1';
|
|
5
|
+
};
|
|
6
|
+
export declare const PROTECTED_PRODUCTION_PROJECT_REF: 'qgzvkongdjqiiamzbbts';
|
|
7
|
+
export declare const PROTECTED_PREPARATION_REJECTED_PLAN_SHA256: readonly ['813a201ded0443c79639cfbdb8f5a2fad8a8781ef6edd3ec7019e9a45f5f33ce', '673331422e8dceeb7975984b07276f057b37e8d6de789d7f030ec29f3be29629', '7fdf7e2755599d426e31a9955985d54d5b7cef1adeaa7a10dcc7186353a6c3a8'];
|
|
8
|
+
type ProtectedApprovalRequestCore = {
|
|
9
|
+
schema_version: typeof PROTECTED_PREPARATION_CONTRACT.approval_request_schema;
|
|
10
|
+
approved_at_utc: string;
|
|
11
|
+
environment: 'production';
|
|
12
|
+
project_ref: string;
|
|
13
|
+
account: {
|
|
14
|
+
user_id: string;
|
|
15
|
+
email: string;
|
|
16
|
+
};
|
|
17
|
+
target_visibility: 'owner_draft';
|
|
18
|
+
plan: DatasetMaintenanceProtectedFreeze['plan'];
|
|
19
|
+
freeze_file_sha256: string;
|
|
20
|
+
freeze_sha256: string;
|
|
21
|
+
sets: DatasetMaintenanceProtectedFreeze['sets'];
|
|
22
|
+
expected: typeof PROTECTED_EXECUTION_COUNTS;
|
|
23
|
+
policy: DatasetMaintenanceProtectedFreeze['policy'];
|
|
24
|
+
};
|
|
25
|
+
export type DatasetMaintenanceProtectedApprovalRequest = ProtectedApprovalRequestCore & {
|
|
26
|
+
request_sha256: string;
|
|
27
|
+
approval_text: string;
|
|
28
|
+
approval_text_sha256: string;
|
|
29
|
+
};
|
|
30
|
+
export type CanonicalProtectedArtifact<T> = {
|
|
31
|
+
value: T;
|
|
32
|
+
canonical_file_text: string;
|
|
33
|
+
file_sha256: string;
|
|
34
|
+
};
|
|
35
|
+
export type BuiltProtectedFreeze = CanonicalProtectedArtifact<DatasetMaintenanceProtectedFreeze> & {
|
|
36
|
+
alias_plan_request_sha256: string;
|
|
37
|
+
};
|
|
38
|
+
export type BuiltProtectedApprovalRequest = CanonicalProtectedArtifact<DatasetMaintenanceProtectedApprovalRequest>;
|
|
39
|
+
export type BuiltProtectedApproval = CanonicalProtectedArtifact<DatasetMaintenanceProtectedApproval>;
|
|
40
|
+
export type ProtectedDerivativeSnapshotTarget = Omit<ProtectedDerivativeTarget, 'baseline_snapshot_sha256'>;
|
|
41
|
+
export declare function assertProtectedPreparationPlanSha256(value: unknown, label?: string): string;
|
|
42
|
+
export declare function assertProtectedProductionProjectRef(value: unknown): string;
|
|
43
|
+
export declare function renderProtectedApprovalText(core: ProtectedApprovalRequestCore, requestSha256: string): string;
|
|
44
|
+
export declare function parseProtectedApprovalRequest(value: unknown): DatasetMaintenanceProtectedApprovalRequest;
|
|
45
|
+
export declare function deriveProtectedDerivativeSnapshotTargets(plan: DatasetMaintenancePlan, expectedAccount: {
|
|
46
|
+
user_id: string;
|
|
47
|
+
email: string;
|
|
48
|
+
}): ProtectedDerivativeSnapshotTarget[];
|
|
49
|
+
export declare function buildProtectedFreeze(options: {
|
|
50
|
+
plan: DatasetMaintenancePlan;
|
|
51
|
+
planFileSha256: string;
|
|
52
|
+
aliasPlanRequest: JsonObject;
|
|
53
|
+
projectRef: string;
|
|
54
|
+
account: {
|
|
55
|
+
user_id: string;
|
|
56
|
+
email: string;
|
|
57
|
+
};
|
|
58
|
+
toolchainEvidenceSha256: string;
|
|
59
|
+
derivativeSnapshots: ProtectedDerivativeSnapshot[];
|
|
60
|
+
}): BuiltProtectedFreeze;
|
|
61
|
+
export declare function buildProtectedApprovalRequest(options: {
|
|
62
|
+
freeze: DatasetMaintenanceProtectedFreeze;
|
|
63
|
+
freezeFileSha256: string;
|
|
64
|
+
approvedAtUtc: string;
|
|
65
|
+
}): BuiltProtectedApprovalRequest;
|
|
66
|
+
export declare function sealProtectedApproval(options: {
|
|
67
|
+
approvalRequest: unknown;
|
|
68
|
+
freeze: DatasetMaintenanceProtectedFreeze;
|
|
69
|
+
freezeFileSha256: string;
|
|
70
|
+
humanApprovalText: string;
|
|
71
|
+
approveRequestSha256: string;
|
|
72
|
+
approveTextSha256: string;
|
|
73
|
+
approvedAtUtc: string;
|
|
74
|
+
confirmAccountEmail: string;
|
|
75
|
+
}): BuiltProtectedApproval;
|
|
76
|
+
export {};
|