@tiangong-lca/foundry 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/LICENSE +21 -0
- package/README.md +532 -0
- package/docs/architecture.md +450 -0
- package/docs/foundry-task-contracts.md +147 -0
- package/docs/import-profiles/bafu/constraints.md +343 -0
- package/docs/import-profiles/bafu/leaf-process-classification-authoring.md +153 -0
- package/docs/import-profiles/bafu/profile.md +183 -0
- package/docs/import-profiles/uslci/constraints.md +29 -0
- package/docs/import-profiles/uslci/profile.md +43 -0
- package/docs/import-profiles/worldsteel/constraints.md +77 -0
- package/docs/import-profiles/worldsteel/import-coverage.md +93 -0
- package/docs/import-profiles/worldsteel/import-plan.md +375 -0
- package/docs/import-profiles/worldsteel/profile.md +78 -0
- package/docs/package-distribution-contract.md +287 -0
- package/docs/public-runtime-contract.md +218 -0
- package/docs/runtime-context-contract.md +138 -0
- package/docs/safety-policy.md +164 -0
- package/docs/task-authorization-contract.md +131 -0
- package/docs/uslci-import-runbook.md +336 -0
- package/docs/workspace-migration-contract.md +127 -0
- package/package-dist/assets/foundry-package-descriptor.json +1661 -0
- package/package-dist/scripts/foundry-facade.d.ts +78 -0
- package/package-dist/scripts/foundry-facade.js +1317 -0
- package/package-dist/scripts/foundry-runtime.d.ts +180 -0
- package/package-dist/scripts/foundry-runtime.js +190 -0
- package/package-dist/scripts/lib/batch-orchestration/scope-attempt-ledger.d.ts +27 -0
- package/package-dist/scripts/lib/batch-orchestration/scope-attempt-ledger.js +85 -0
- package/package-dist/scripts/lib/batch-orchestration/scope-resume-contract.d.ts +38 -0
- package/package-dist/scripts/lib/batch-orchestration/scope-resume-contract.js +90 -0
- package/package-dist/scripts/lib/bundle-row-types.d.ts +44 -0
- package/package-dist/scripts/lib/bundle-row-types.js +46 -0
- package/package-dist/scripts/lib/bundle-sample-utils.d.ts +183 -0
- package/package-dist/scripts/lib/bundle-sample-utils.js +526 -0
- package/package-dist/scripts/lib/bundle-source-context.d.ts +31 -0
- package/package-dist/scripts/lib/bundle-source-context.js +142 -0
- package/package-dist/scripts/lib/canonical-description.d.ts +12 -0
- package/package-dist/scripts/lib/canonical-description.js +72 -0
- package/package-dist/scripts/lib/canonical-support-rewrites.d.ts +127 -0
- package/package-dist/scripts/lib/canonical-support-rewrites.js +527 -0
- package/package-dist/scripts/lib/decision-owners/classification.d.ts +245 -0
- package/package-dist/scripts/lib/decision-owners/classification.js +754 -0
- package/package-dist/scripts/lib/decision-owners/identity-preflight.d.ts +333 -0
- package/package-dist/scripts/lib/decision-owners/identity-preflight.js +1353 -0
- package/package-dist/scripts/lib/decision-owners/identity-task.d.ts +130 -0
- package/package-dist/scripts/lib/decision-owners/identity-task.js +494 -0
- package/package-dist/scripts/lib/decision-owners/identity.d.ts +74 -0
- package/package-dist/scripts/lib/decision-owners/identity.js +443 -0
- package/package-dist/scripts/lib/decision-owners/location.d.ts +239 -0
- package/package-dist/scripts/lib/decision-owners/location.js +704 -0
- package/package-dist/scripts/lib/decision-task-utils.d.ts +484 -0
- package/package-dist/scripts/lib/decision-task-utils.js +735 -0
- package/package-dist/scripts/lib/finalize-owners/cli-wrappers.d.ts +52 -0
- package/package-dist/scripts/lib/finalize-owners/cli-wrappers.js +146 -0
- package/package-dist/scripts/lib/finalize-owners/commit-handoff.d.ts +79 -0
- package/package-dist/scripts/lib/finalize-owners/commit-handoff.js +515 -0
- package/package-dist/scripts/lib/finalize-owners/post-authoring.d.ts +234 -0
- package/package-dist/scripts/lib/finalize-owners/post-authoring.js +1720 -0
- package/package-dist/scripts/lib/finalize-owners/post-write-closeout.d.ts +140 -0
- package/package-dist/scripts/lib/finalize-owners/post-write-closeout.js +656 -0
- package/package-dist/scripts/lib/foundry-args.d.ts +7 -0
- package/package-dist/scripts/lib/foundry-args.js +38 -0
- package/package-dist/scripts/lib/foundry-authentication-environment.d.ts +17 -0
- package/package-dist/scripts/lib/foundry-authentication-environment.js +55 -0
- package/package-dist/scripts/lib/foundry-authorization-input.d.ts +31 -0
- package/package-dist/scripts/lib/foundry-authorization-input.js +151 -0
- package/package-dist/scripts/lib/foundry-command-metadata.d.ts +32 -0
- package/package-dist/scripts/lib/foundry-command-metadata.js +1012 -0
- package/package-dist/scripts/lib/foundry-command-registry.d.ts +34 -0
- package/package-dist/scripts/lib/foundry-command-registry.js +241 -0
- package/package-dist/scripts/lib/foundry-command-spec.d.ts +1 -0
- package/package-dist/scripts/lib/foundry-command-spec.js +1 -0
- package/package-dist/scripts/lib/foundry-decision-owners.d.ts +17 -0
- package/package-dist/scripts/lib/foundry-decision-owners.js +68 -0
- package/package-dist/scripts/lib/foundry-decision-routing.d.ts +3 -0
- package/package-dist/scripts/lib/foundry-decision-routing.js +38 -0
- package/package-dist/scripts/lib/foundry-execution-admission.d.ts +33 -0
- package/package-dist/scripts/lib/foundry-execution-admission.js +225 -0
- package/package-dist/scripts/lib/foundry-execution-attempt.d.ts +11 -0
- package/package-dist/scripts/lib/foundry-execution-attempt.js +33 -0
- package/package-dist/scripts/lib/foundry-execution-context-format.d.ts +18 -0
- package/package-dist/scripts/lib/foundry-execution-context-format.js +83 -0
- package/package-dist/scripts/lib/foundry-facade-store.d.ts +25 -0
- package/package-dist/scripts/lib/foundry-facade-store.js +449 -0
- package/package-dist/scripts/lib/foundry-finalize-owners.d.ts +21 -0
- package/package-dist/scripts/lib/foundry-finalize-owners.js +203 -0
- package/package-dist/scripts/lib/foundry-identity-owners.d.ts +13 -0
- package/package-dist/scripts/lib/foundry-identity-owners.js +58 -0
- package/package-dist/scripts/lib/foundry-managed-host.d.ts +7 -0
- package/package-dist/scripts/lib/foundry-managed-host.js +173 -0
- package/package-dist/scripts/lib/foundry-migration-adoption-plan.d.ts +39 -0
- package/package-dist/scripts/lib/foundry-migration-adoption-plan.js +467 -0
- package/package-dist/scripts/lib/foundry-migration-adoption.d.ts +31 -0
- package/package-dist/scripts/lib/foundry-migration-adoption.js +187 -0
- package/package-dist/scripts/lib/foundry-migration-authority.d.ts +42 -0
- package/package-dist/scripts/lib/foundry-migration-authority.js +280 -0
- package/package-dist/scripts/lib/foundry-migration-inventory.d.ts +31 -0
- package/package-dist/scripts/lib/foundry-migration-inventory.js +148 -0
- package/package-dist/scripts/lib/foundry-migration-plan.d.ts +48 -0
- package/package-dist/scripts/lib/foundry-migration-plan.js +234 -0
- package/package-dist/scripts/lib/foundry-migration-replay.d.ts +3 -0
- package/package-dist/scripts/lib/foundry-migration-replay.js +134 -0
- package/package-dist/scripts/lib/foundry-migration-stage.d.ts +15 -0
- package/package-dist/scripts/lib/foundry-migration-stage.js +152 -0
- package/package-dist/scripts/lib/foundry-migration-transfer-io.d.ts +13 -0
- package/package-dist/scripts/lib/foundry-migration-transfer-io.js +226 -0
- package/package-dist/scripts/lib/foundry-migration-transfer.d.ts +36 -0
- package/package-dist/scripts/lib/foundry-migration-transfer.js +350 -0
- package/package-dist/scripts/lib/foundry-operation-result.d.ts +71 -0
- package/package-dist/scripts/lib/foundry-operation-result.js +264 -0
- package/package-dist/scripts/lib/foundry-owner-execution-store.d.ts +319 -0
- package/package-dist/scripts/lib/foundry-owner-execution-store.js +293 -0
- package/package-dist/scripts/lib/foundry-owner-readback.d.ts +22 -0
- package/package-dist/scripts/lib/foundry-owner-readback.js +189 -0
- package/package-dist/scripts/lib/foundry-owner-trace-acceptance.d.ts +15 -0
- package/package-dist/scripts/lib/foundry-owner-trace-acceptance.js +68 -0
- package/package-dist/scripts/lib/foundry-package-contract.d.ts +56 -0
- package/package-dist/scripts/lib/foundry-package-contract.js +392 -0
- package/package-dist/scripts/lib/foundry-private-path.d.ts +2 -0
- package/package-dist/scripts/lib/foundry-private-path.js +20 -0
- package/package-dist/scripts/lib/foundry-runtime-cache.d.ts +3 -0
- package/package-dist/scripts/lib/foundry-runtime-cache.js +25 -0
- package/package-dist/scripts/lib/foundry-runtime-command-policy.d.ts +20 -0
- package/package-dist/scripts/lib/foundry-runtime-command-policy.js +173 -0
- package/package-dist/scripts/lib/foundry-runtime-context-types.d.ts +59 -0
- package/package-dist/scripts/lib/foundry-runtime-context-types.js +1 -0
- package/package-dist/scripts/lib/foundry-runtime-context.d.ts +27 -0
- package/package-dist/scripts/lib/foundry-runtime-context.js +668 -0
- package/package-dist/scripts/lib/foundry-runtime-environment.d.ts +9 -0
- package/package-dist/scripts/lib/foundry-runtime-environment.js +90 -0
- package/package-dist/scripts/lib/foundry-runtime-error.d.ts +4 -0
- package/package-dist/scripts/lib/foundry-runtime-error.js +8 -0
- package/package-dist/scripts/lib/foundry-runtime-identity.d.ts +18 -0
- package/package-dist/scripts/lib/foundry-runtime-identity.js +127 -0
- package/package-dist/scripts/lib/foundry-runtime-paths.d.ts +16 -0
- package/package-dist/scripts/lib/foundry-runtime-paths.js +159 -0
- package/package-dist/scripts/lib/foundry-runtime-qualification.d.ts +66 -0
- package/package-dist/scripts/lib/foundry-runtime-qualification.js +223 -0
- package/package-dist/scripts/lib/foundry-runtime-selection-record.d.ts +16 -0
- package/package-dist/scripts/lib/foundry-runtime-selection-record.js +32 -0
- package/package-dist/scripts/lib/foundry-runtime-selection.d.ts +14 -0
- package/package-dist/scripts/lib/foundry-runtime-selection.js +123 -0
- package/package-dist/scripts/lib/foundry-runtime-utils.d.ts +178 -0
- package/package-dist/scripts/lib/foundry-runtime-utils.js +603 -0
- package/package-dist/scripts/lib/foundry-semantic-input.d.ts +30 -0
- package/package-dist/scripts/lib/foundry-semantic-input.js +132 -0
- package/package-dist/scripts/lib/foundry-task-authorization.d.ts +68 -0
- package/package-dist/scripts/lib/foundry-task-authorization.js +350 -0
- package/package-dist/scripts/lib/foundry-task-io.d.ts +18 -0
- package/package-dist/scripts/lib/foundry-task-io.js +92 -0
- package/package-dist/scripts/lib/foundry-task-registration.d.ts +6 -0
- package/package-dist/scripts/lib/foundry-task-registration.js +384 -0
- package/package-dist/scripts/lib/foundry-task-start-spec.d.ts +34 -0
- package/package-dist/scripts/lib/foundry-task-start-spec.js +161 -0
- package/package-dist/scripts/lib/foundry-task-store.d.ts +18 -0
- package/package-dist/scripts/lib/foundry-task-store.js +466 -0
- package/package-dist/scripts/lib/foundry-task-types.d.ts +99 -0
- package/package-dist/scripts/lib/foundry-task-types.js +1 -0
- package/package-dist/scripts/lib/foundry-workflow-approval-continuation.d.ts +6 -0
- package/package-dist/scripts/lib/foundry-workflow-approval-continuation.js +136 -0
- package/package-dist/scripts/lib/foundry-workflow-assessment.d.ts +3 -0
- package/package-dist/scripts/lib/foundry-workflow-assessment.js +231 -0
- package/package-dist/scripts/lib/foundry-workflow-authorization.d.ts +22 -0
- package/package-dist/scripts/lib/foundry-workflow-authorization.js +174 -0
- package/package-dist/scripts/lib/foundry-workflow-context.d.ts +3 -0
- package/package-dist/scripts/lib/foundry-workflow-context.js +99 -0
- package/package-dist/scripts/lib/foundry-workflow-decisions.d.ts +18 -0
- package/package-dist/scripts/lib/foundry-workflow-decisions.js +123 -0
- package/package-dist/scripts/lib/foundry-workflow-execution.d.ts +8 -0
- package/package-dist/scripts/lib/foundry-workflow-execution.js +248 -0
- package/package-dist/scripts/lib/foundry-workflow-finalize.d.ts +13 -0
- package/package-dist/scripts/lib/foundry-workflow-finalize.js +264 -0
- package/package-dist/scripts/lib/foundry-workflow-identity-apply.d.ts +14 -0
- package/package-dist/scripts/lib/foundry-workflow-identity-apply.js +159 -0
- package/package-dist/scripts/lib/foundry-workflow-identity.d.ts +6 -0
- package/package-dist/scripts/lib/foundry-workflow-identity.js +153 -0
- package/package-dist/scripts/lib/foundry-workflow-import.d.ts +4 -0
- package/package-dist/scripts/lib/foundry-workflow-import.js +70 -0
- package/package-dist/scripts/lib/foundry-workflow-io.d.ts +11 -0
- package/package-dist/scripts/lib/foundry-workflow-io.js +77 -0
- package/package-dist/scripts/lib/foundry-workflow-reference-verify.d.ts +41 -0
- package/package-dist/scripts/lib/foundry-workflow-reference-verify.js +266 -0
- package/package-dist/scripts/lib/foundry-workflow-rows.d.ts +2 -0
- package/package-dist/scripts/lib/foundry-workflow-rows.js +47 -0
- package/package-dist/scripts/lib/foundry-workflow-semantic.d.ts +5 -0
- package/package-dist/scripts/lib/foundry-workflow-semantic.js +367 -0
- package/package-dist/scripts/lib/foundry-workflow-state.d.ts +37 -0
- package/package-dist/scripts/lib/foundry-workflow-state.js +158 -0
- package/package-dist/scripts/lib/full-context-proof.d.ts +51 -0
- package/package-dist/scripts/lib/full-context-proof.js +932 -0
- package/package-dist/scripts/lib/identity-preflight-artifacts.d.ts +184 -0
- package/package-dist/scripts/lib/identity-preflight-artifacts.js +573 -0
- package/package-dist/scripts/lib/identity-preflight-proof.d.ts +117 -0
- package/package-dist/scripts/lib/identity-preflight-proof.js +341 -0
- package/package-dist/scripts/lib/identity-reference-rewrite-utils.d.ts +147 -0
- package/package-dist/scripts/lib/identity-reference-rewrite-utils.js +817 -0
- package/package-dist/scripts/lib/import-curation/authoring-packages.d.ts +28 -0
- package/package-dist/scripts/lib/import-curation/authoring-packages.js +92 -0
- package/package-dist/scripts/lib/import-curation/curation-cleanup.d.ts +32 -0
- package/package-dist/scripts/lib/import-curation/curation-cleanup.js +203 -0
- package/package-dist/scripts/lib/import-curation/curation-gate.d.ts +47 -0
- package/package-dist/scripts/lib/import-curation/curation-gate.js +528 -0
- package/package-dist/scripts/lib/import-curation/internal/artifact-inputs.d.ts +24 -0
- package/package-dist/scripts/lib/import-curation/internal/artifact-inputs.js +152 -0
- package/package-dist/scripts/lib/import-curation/internal/authoring-patch-workflow.d.ts +3 -0
- package/package-dist/scripts/lib/import-curation/internal/authoring-patch-workflow.js +3 -0
- package/package-dist/scripts/lib/import-curation/internal/authoring-task-workflow.d.ts +1 -0
- package/package-dist/scripts/lib/import-curation/internal/authoring-task-workflow.js +1 -0
- package/package-dist/scripts/lib/import-curation/internal/context-inputs.d.ts +56 -0
- package/package-dist/scripts/lib/import-curation/internal/context-inputs.js +206 -0
- package/package-dist/scripts/lib/import-curation/internal/curation-gate-workflow.d.ts +14 -0
- package/package-dist/scripts/lib/import-curation/internal/curation-gate-workflow.js +14 -0
- package/package-dist/scripts/lib/import-curation/internal/dataset-payload.d.ts +70 -0
- package/package-dist/scripts/lib/import-curation/internal/dataset-payload.js +141 -0
- package/package-dist/scripts/lib/import-curation/internal/dataset-types.d.ts +25 -0
- package/package-dist/scripts/lib/import-curation/internal/dataset-types.js +45 -0
- package/package-dist/scripts/lib/import-curation/internal/full-context-proof.d.ts +129 -0
- package/package-dist/scripts/lib/import-curation/internal/full-context-proof.js +552 -0
- package/package-dist/scripts/lib/import-curation/internal/hash-utils.d.ts +2 -0
- package/package-dist/scripts/lib/import-curation/internal/hash-utils.js +10 -0
- package/package-dist/scripts/lib/import-curation/internal/mutation-manifest-workflow.d.ts +15 -0
- package/package-dist/scripts/lib/import-curation/internal/mutation-manifest-workflow.js +15 -0
- package/package-dist/scripts/lib/import-curation/internal/prewrite-cleanup.d.ts +31 -0
- package/package-dist/scripts/lib/import-curation/internal/prewrite-cleanup.js +467 -0
- package/package-dist/scripts/lib/import-curation/internal/profiles-config.d.ts +47 -0
- package/package-dist/scripts/lib/import-curation/internal/profiles-config.js +88 -0
- package/package-dist/scripts/lib/import-curation/internal/runtime-io.d.ts +23 -0
- package/package-dist/scripts/lib/import-curation/internal/runtime-io.js +132 -0
- package/package-dist/scripts/lib/import-curation/internal/trace-summary.d.ts +53 -0
- package/package-dist/scripts/lib/import-curation/internal/trace-summary.js +114 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-authoring-tasks.d.ts +141 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-authoring-tasks.js +854 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-decision-apply-context.d.ts +20 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-decision-apply-context.js +46 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-decision-full-context.d.ts +110 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-decision-full-context.js +782 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-dry-run-context.d.ts +24 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-dry-run-context.js +191 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-evidence-scope.d.ts +80 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-evidence-scope.js +359 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-identity-decision-context.d.ts +146 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-identity-decision-context.js +381 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-identity-preflight.d.ts +223 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-identity-preflight.js +1079 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-patch-collect.d.ts +41 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-patch-collect.js +412 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-patch-evidence-context.d.ts +117 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-patch-evidence-context.js +278 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-patch-evidence.d.ts +59 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-patch-evidence.js +593 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-queue-context.d.ts +58 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-queue-context.js +263 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-reference-closure.d.ts +177 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-reference-closure.js +812 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-row-transform-context.d.ts +159 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-row-transform-context.js +466 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-semantic-actions.d.ts +152 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-semantic-actions.js +1377 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-source-reference-context.d.ts +38 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-source-reference-context.js +116 -0
- package/package-dist/scripts/lib/import-curation/mutation-manifest.d.ts +51 -0
- package/package-dist/scripts/lib/import-curation/mutation-manifest.js +542 -0
- package/package-dist/scripts/lib/import-curation/patch-collect.d.ts +18 -0
- package/package-dist/scripts/lib/import-curation/patch-collect.js +172 -0
- package/package-dist/scripts/lib/import-curation/profiles.d.ts +1 -0
- package/package-dist/scripts/lib/import-curation/profiles.js +1 -0
- package/package-dist/scripts/lib/import-curation/trace-summary.d.ts +1 -0
- package/package-dist/scripts/lib/import-curation/trace-summary.js +1 -0
- package/package-dist/scripts/lib/oauth-session-reference.d.ts +1 -0
- package/package-dist/scripts/lib/oauth-session-reference.js +20 -0
- package/package-dist/scripts/lib/post-authoring-finalize-utils.d.ts +95 -0
- package/package-dist/scripts/lib/post-authoring-finalize-utils.js +548 -0
- package/package-dist/scripts/lib/post-write-root-proof.d.ts +44 -0
- package/package-dist/scripts/lib/post-write-root-proof.js +169 -0
- package/package-dist/scripts/lib/reference-description-text.d.ts +2 -0
- package/package-dist/scripts/lib/reference-description-text.js +12 -0
- package/package-dist/scripts/lib/remote-verification-accepted-diff.d.ts +42 -0
- package/package-dist/scripts/lib/remote-verification-accepted-diff.js +424 -0
- package/package-dist/scripts/lib/same-identity-commit-recovery.d.ts +8 -0
- package/package-dist/scripts/lib/same-identity-commit-recovery.js +52 -0
- package/package-dist/scripts/lib/source-semantics.d.ts +255 -0
- package/package-dist/scripts/lib/source-semantics.js +888 -0
- package/package-dist/scripts/lib/stage-contract.d.ts +36 -0
- package/package-dist/scripts/lib/stage-contract.js +25 -0
- package/package-dist/scripts/lib/task-authorization.d.ts +84 -0
- package/package-dist/scripts/lib/task-authorization.js +210 -0
- package/package-dist/scripts/lib/tidas-adapter.d.ts +113 -0
- package/package-dist/scripts/lib/tidas-adapter.js +525 -0
- package/package-dist/scripts/lib/tidas-language-utils.d.ts +8 -0
- package/package-dist/scripts/lib/tidas-language-utils.js +206 -0
- package/package-dist/scripts/lib/tidas-row-utils.d.ts +70 -0
- package/package-dist/scripts/lib/tidas-row-utils.js +225 -0
- package/package-dist/scripts/lib/trace-coverage.d.ts +53 -0
- package/package-dist/scripts/lib/trace-coverage.js +178 -0
- package/package-dist/scripts/package-entry.d.ts +2 -0
- package/package-dist/scripts/package-entry.js +4 -0
- package/package-dist/scripts/public-api.d.ts +80 -0
- package/package-dist/scripts/public-api.js +28 -0
- package/package-dist/scripts/runtime-entry.d.ts +23 -0
- package/package-dist/scripts/runtime-entry.js +424 -0
- package/package.json +93 -0
- package/specs/canonical-support/flow-properties-unit-groups.json +2692 -0
- package/specs/import-profiles.json +118 -0
- package/specs/prewrite-content-policy.json +105 -0
- package/specs/schemas/authorization-derivation.schema.json +34 -0
- package/specs/schemas/execution-context.schema.json +68 -0
- package/specs/schemas/foundry-authorization-input.schema.json +120 -0
- package/specs/schemas/foundry-facade-request-index.schema.json +78 -0
- package/specs/schemas/foundry-managed-runtime.schema.json +122 -0
- package/specs/schemas/foundry-migration-activation.schema.json +213 -0
- package/specs/schemas/foundry-migration-adoption-plan.schema.json +548 -0
- package/specs/schemas/foundry-migration-transfer-receipt.schema.json +93 -0
- package/specs/schemas/foundry-operation-result.schema.json +147 -0
- package/specs/schemas/foundry-package-descriptor.schema.json +134 -0
- package/specs/schemas/foundry-runtime-selection.schema.json +59 -0
- package/specs/schemas/foundry-semantic-input.schema.json +36 -0
- package/specs/schemas/foundry-task-start.schema.json +123 -0
- package/specs/schemas/foundry-workspace-migration-pending.schema.json +17 -0
- package/specs/schemas/foundry-workspace-migration-plan.schema.json +59 -0
- package/specs/schemas/foundry-workspace-migration-transfer-plan.schema.json +357 -0
- package/specs/schemas/foundry-workspace-v2.schema.json +70 -0
- package/specs/schemas/runtime-qualification.schema.json +63 -0
- package/specs/schemas/task-authorization.schema.json +154 -0
- package/specs/schemas/tidas-runtime-expectation.schema.json +54 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { resolveArtifactPath } from "./artifact-inputs.js";
|
|
3
|
+
import { identityKey, detectDatasetType, unwrapDatasetPayload } from "./dataset-payload.js";
|
|
4
|
+
import { annualSupplyMissingDataSentinelText } from "./prewrite-cleanup.js";
|
|
5
|
+
import { asText, directoryExists, ensureArray, fileExists, readJson, readJsonIfExists, readRows, repoRelativePath, resolveRepoPath, } from "./runtime-io.js";
|
|
6
|
+
function isRecord(value) {
|
|
7
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
8
|
+
}
|
|
9
|
+
function isQueueTask(value) {
|
|
10
|
+
return Boolean(value) && typeof value === "object";
|
|
11
|
+
}
|
|
12
|
+
// part-00.mjs
|
|
13
|
+
export const annualSupplyFieldPath = "processDataSet.modellingAndValidation.dataSourcesTreatmentAndRepresentativeness.annualSupplyOrProductionVolume";
|
|
14
|
+
export function isAnnualSupplyTarget(code, itemPath) {
|
|
15
|
+
return (asText(code).startsWith("annual_supply_or_production_volume") ||
|
|
16
|
+
asText(itemPath).includes("annualSupplyOrProductionVolume"));
|
|
17
|
+
}
|
|
18
|
+
export function isAnnualSupplySchemaIssue(issue) {
|
|
19
|
+
const typedIssue = issue;
|
|
20
|
+
return isAnnualSupplyTarget(typedIssue?.code, typedIssue?.path);
|
|
21
|
+
}
|
|
22
|
+
export function schemaIssueInstruction(issue) {
|
|
23
|
+
const typedIssue = issue;
|
|
24
|
+
const code = String(typedIssue?.code ?? "");
|
|
25
|
+
const issuePath = String(typedIssue?.path ?? "");
|
|
26
|
+
if (isAnnualSupplyTarget(code, issuePath)) {
|
|
27
|
+
return `Use source evidence or an explicitly documented profile fallback to write annualSupplyOrProductionVolume as a real annualized quantity with unit, for example '<number> <unit>/year'. If no annualized source evidence exists, Foundry deterministic cleanup must write the intentionally non-physical sentinel '${annualSupplyMissingDataSentinelText}' so database-side follow-up can bulk-locate and replace it later.`;
|
|
28
|
+
}
|
|
29
|
+
if (code === "invalid_format") {
|
|
30
|
+
return "Use the SDK schema and methodology YAML for this field to replace the invalid value with a schema-valid source-backed value.";
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
export function schemaIssueCurationAction(issue) {
|
|
35
|
+
const typedIssue = issue;
|
|
36
|
+
const code = String(typedIssue?.code ?? "");
|
|
37
|
+
const issuePath = String(typedIssue?.path ?? "");
|
|
38
|
+
const annualSupplyIssue = isAnnualSupplySchemaIssue(issue);
|
|
39
|
+
const base = {
|
|
40
|
+
source: "schema",
|
|
41
|
+
code: typedIssue?.code,
|
|
42
|
+
path: typedIssue?.path ?? null,
|
|
43
|
+
message: typedIssue?.message ?? null,
|
|
44
|
+
instruction: schemaIssueInstruction(issue),
|
|
45
|
+
...(annualSupplyIssue
|
|
46
|
+
? {
|
|
47
|
+
sentinel_completion_allowed: true,
|
|
48
|
+
sentinel_cleanup_path: annualSupplyFieldPath,
|
|
49
|
+
sentinel_value: annualSupplyMissingDataSentinelText,
|
|
50
|
+
sentinel_policy: "The 9999 missing-data sentinel is intentionally non-physical and easy to bulk-query; later database-side curation owns replacing it with real annual volume evidence.",
|
|
51
|
+
}
|
|
52
|
+
: {}),
|
|
53
|
+
};
|
|
54
|
+
if (annualSupplyIssue) {
|
|
55
|
+
return {
|
|
56
|
+
...base,
|
|
57
|
+
action_kind: "annual_supply_sentinel_completion",
|
|
58
|
+
required_owner: "foundry_deterministic_cleanup",
|
|
59
|
+
ai_required: false,
|
|
60
|
+
instruction: schemaIssueInstruction(issue),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
if (issuePath.includes("common:other.tidasimport:sourceTrace")) {
|
|
64
|
+
return {
|
|
65
|
+
...base,
|
|
66
|
+
action_kind: "source_trace_externalization",
|
|
67
|
+
required_owner: "foundry_deterministic_cleanup",
|
|
68
|
+
ai_required: false,
|
|
69
|
+
instruction: "Preserve sourceTrace in the authoring package context, then remove or externalize it before remote write.",
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
if (code === "invalid_format" && issuePath.endsWith("common:timeStamp")) {
|
|
73
|
+
return {
|
|
74
|
+
...base,
|
|
75
|
+
action_kind: "timestamp_normalization",
|
|
76
|
+
required_owner: "foundry_deterministic_cleanup",
|
|
77
|
+
ai_required: false,
|
|
78
|
+
instruction: "Normalize the timestamp to the SDK-accepted datetime format before validation.",
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
...base,
|
|
83
|
+
action_kind: "ai_authoring",
|
|
84
|
+
required_owner: "foundry_ai_authoring",
|
|
85
|
+
ai_required: true,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export function readCurationQueueContext(repoRoot, options) {
|
|
89
|
+
const queueDirOption = options.queueDir ?? options.curationQueueDir;
|
|
90
|
+
const queueDir = resolveRepoPath(repoRoot, queueDirOption);
|
|
91
|
+
if (!queueDirOption)
|
|
92
|
+
return null;
|
|
93
|
+
if (!queueDir || !directoryExists(queueDir)) {
|
|
94
|
+
throw new Error(`--queue-dir must point to an existing curation queue directory: ${queueDirOption}`);
|
|
95
|
+
}
|
|
96
|
+
const manifestPath = path.join(queueDir, "outputs", "curation-queue-manifest.json");
|
|
97
|
+
if (!fileExists(manifestPath)) {
|
|
98
|
+
throw new Error(`--queue-dir is missing outputs/curation-queue-manifest.json: ${queueDirOption}`);
|
|
99
|
+
}
|
|
100
|
+
const manifest = readJson(manifestPath);
|
|
101
|
+
const tasks = ensureArray(manifest.tasks).filter(isQueueTask);
|
|
102
|
+
return {
|
|
103
|
+
queueDir,
|
|
104
|
+
manifestPath,
|
|
105
|
+
manifest,
|
|
106
|
+
tasks,
|
|
107
|
+
tasksById: new Map(tasks.map((task) => [String(task.task_id ?? ""), task])),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
export function queueFilePath(repoRoot, queueContext, fileRef) {
|
|
111
|
+
return resolveArtifactPath(repoRoot, fileRef, queueContext.queueDir);
|
|
112
|
+
}
|
|
113
|
+
export function queueFileRelativePath(repoRoot, queueContext, fileRef) {
|
|
114
|
+
const resolved = queueFilePath(repoRoot, queueContext, fileRef);
|
|
115
|
+
return resolved ? repoRelativePath(repoRoot, resolved) : null;
|
|
116
|
+
}
|
|
117
|
+
export function summarizeQueueTask(repoRoot, queueContext, task) {
|
|
118
|
+
if (!task)
|
|
119
|
+
return null;
|
|
120
|
+
return {
|
|
121
|
+
schema_version: task.schema_version ?? 1,
|
|
122
|
+
entity_type: task.entity_type ?? null,
|
|
123
|
+
task_id: task.task_id ?? null,
|
|
124
|
+
entity_id: task.entity_id ?? null,
|
|
125
|
+
version: task.version ?? null,
|
|
126
|
+
lock_key: task.lock_key ?? null,
|
|
127
|
+
depends_on: ensureArray(task.depends_on),
|
|
128
|
+
input_rows_file: queueFileRelativePath(repoRoot, queueContext, task.input_rows_file),
|
|
129
|
+
closure_file: queueFileRelativePath(repoRoot, queueContext, task.closure_file),
|
|
130
|
+
run_plan_file: queueFileRelativePath(repoRoot, queueContext, task.run_plan_file),
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
export function readQueueTaskRows(repoRoot, queueContext, task) {
|
|
134
|
+
const inputRowsPath = queueFilePath(repoRoot, queueContext, task?.input_rows_file);
|
|
135
|
+
return inputRowsPath && fileExists(inputRowsPath) ? readRows(inputRowsPath) : [];
|
|
136
|
+
}
|
|
137
|
+
export function findQueueTask(queueContext, datasetType, identity) {
|
|
138
|
+
if (!queueContext || datasetType === "lifecyclemodel")
|
|
139
|
+
return null;
|
|
140
|
+
const queueType = ["contact", "source", "unitgroup", "flowproperty"].includes(datasetType)
|
|
141
|
+
? "support"
|
|
142
|
+
: datasetType;
|
|
143
|
+
for (const type of new Set([datasetType, queueType])) {
|
|
144
|
+
const exact = queueContext.tasks.find((task) => task.entity_type === type &&
|
|
145
|
+
task.entity_id === identity.id &&
|
|
146
|
+
task.version === identity.version);
|
|
147
|
+
if (exact)
|
|
148
|
+
return exact;
|
|
149
|
+
const fallback = queueContext.tasks.find((task) => task.entity_type === type && task.entity_id === identity.id);
|
|
150
|
+
if (fallback)
|
|
151
|
+
return fallback;
|
|
152
|
+
}
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
export function buildQueueAuthoringContext(repoRoot, queueContext, datasetType, identity) {
|
|
156
|
+
if (!queueContext)
|
|
157
|
+
return null;
|
|
158
|
+
const base = {
|
|
159
|
+
queue_dir: repoRelativePath(repoRoot, queueContext.queueDir),
|
|
160
|
+
manifest_file: repoRelativePath(repoRoot, queueContext.manifestPath),
|
|
161
|
+
queue_status: queueContext.manifest.status ?? null,
|
|
162
|
+
queue_counts: queueContext.manifest.counts ?? null,
|
|
163
|
+
queue_blockers: ensureArray(queueContext.manifest.blockers),
|
|
164
|
+
};
|
|
165
|
+
if (datasetType === "lifecyclemodel") {
|
|
166
|
+
return {
|
|
167
|
+
...base,
|
|
168
|
+
status: "not_applicable",
|
|
169
|
+
reason: "curation queue currently attaches entity closure for flow and process rows.",
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
const task = findQueueTask(queueContext, datasetType, identity);
|
|
173
|
+
const concreteSupport = task?.entity_type === "support" && datasetType !== "support";
|
|
174
|
+
const supportInput = concreteSupport ? readQueueTaskRows(repoRoot, queueContext, task) : [];
|
|
175
|
+
const matchingSupport = !concreteSupport ||
|
|
176
|
+
(supportInput.length > 0 &&
|
|
177
|
+
supportInput.every((row) => detectDatasetType(unwrapDatasetPayload(row, datasetType)) === datasetType));
|
|
178
|
+
if (!task || !matchingSupport) {
|
|
179
|
+
return {
|
|
180
|
+
...base,
|
|
181
|
+
status: "missing_task",
|
|
182
|
+
entity_type: datasetType,
|
|
183
|
+
entity_id: identity.id,
|
|
184
|
+
version: identity.version,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
const closurePath = queueFilePath(repoRoot, queueContext, task.closure_file);
|
|
188
|
+
const closure = readJsonIfExists(closurePath);
|
|
189
|
+
const dependencies = isRecord(closure?.dependencies) ? closure.dependencies : {};
|
|
190
|
+
const dependencyRows = ensureArray(dependencies.local_tasks).map((value) => {
|
|
191
|
+
const dependency = value;
|
|
192
|
+
const dependencyTask = queueContext.tasksById.get(String(dependency.task_id ?? ""));
|
|
193
|
+
return {
|
|
194
|
+
ref: dependency.ref ?? null,
|
|
195
|
+
ref_path: dependency.ref_path ?? null,
|
|
196
|
+
task: summarizeQueueTask(repoRoot, queueContext, dependencyTask),
|
|
197
|
+
input_rows: readQueueTaskRows(repoRoot, queueContext, dependencyTask),
|
|
198
|
+
};
|
|
199
|
+
});
|
|
200
|
+
const supportRows = queueContext.tasks
|
|
201
|
+
.filter((candidate) => candidate.entity_type === "support")
|
|
202
|
+
.map((supportTask) => ({
|
|
203
|
+
task: summarizeQueueTask(repoRoot, queueContext, supportTask),
|
|
204
|
+
input_rows: readQueueTaskRows(repoRoot, queueContext, supportTask),
|
|
205
|
+
}));
|
|
206
|
+
return {
|
|
207
|
+
...base,
|
|
208
|
+
status: "attached",
|
|
209
|
+
task: summarizeQueueTask(repoRoot, queueContext, task),
|
|
210
|
+
closure_file: closurePath ? repoRelativePath(repoRoot, closurePath) : null,
|
|
211
|
+
closure,
|
|
212
|
+
dependency_rows: dependencyRows,
|
|
213
|
+
support_rows: supportRows,
|
|
214
|
+
notes: [
|
|
215
|
+
"dependency_rows are local flow/support closure inputs for this entity task.",
|
|
216
|
+
"AI output must still be a structured patch or build plan; database writes are not allowed from this package.",
|
|
217
|
+
],
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
export function readAuthoringQueueContext(repoRoot, optionValue, kind) {
|
|
221
|
+
const queuePath = resolveRepoPath(repoRoot, optionValue);
|
|
222
|
+
if (!optionValue) {
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
if (!queuePath || !fileExists(queuePath)) {
|
|
226
|
+
throw new Error(`--${kind}-queue must point to a readable JSONL queue file: ${optionValue}`);
|
|
227
|
+
}
|
|
228
|
+
const rows = readRows(queuePath).filter(isRecord);
|
|
229
|
+
return {
|
|
230
|
+
kind,
|
|
231
|
+
path: queuePath,
|
|
232
|
+
rows,
|
|
233
|
+
rowsByIdentity: new Map(rows
|
|
234
|
+
.map((row) => {
|
|
235
|
+
const id = asText(row.dataset_id ?? row.entity_id ?? row.process_id ?? row.flow_id ?? row.id);
|
|
236
|
+
const version = asText(row.dataset_version ?? row.version) || "00.00.001";
|
|
237
|
+
return [`${id}@@${version}`, row];
|
|
238
|
+
})
|
|
239
|
+
.filter(([key]) => !key.startsWith("@@"))),
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
export function authoringQueueRowsForIdentity(queueContext, identity) {
|
|
243
|
+
if (!queueContext)
|
|
244
|
+
return [];
|
|
245
|
+
const exact = queueContext.rowsByIdentity.get(identityKey(identity));
|
|
246
|
+
if (exact)
|
|
247
|
+
return [exact];
|
|
248
|
+
const idOnly = queueContext.rows.filter((row) => asText(row.dataset_id ?? row.entity_id ?? row.process_id ?? row.flow_id ?? row.id) ===
|
|
249
|
+
identity.id);
|
|
250
|
+
return idOnly;
|
|
251
|
+
}
|
|
252
|
+
export function identityPreflightIndexPath(repoRoot, options, rowsFile) {
|
|
253
|
+
const explicit = options.identityPreflightIndex ??
|
|
254
|
+
options.identityPreflightRequests ??
|
|
255
|
+
options.identityPreflightRequestsIndex ??
|
|
256
|
+
options.identityPreflightFile;
|
|
257
|
+
if (explicit)
|
|
258
|
+
return resolveRepoPath(repoRoot, explicit);
|
|
259
|
+
if (!rowsFile)
|
|
260
|
+
return null;
|
|
261
|
+
const defaultPath = path.join(path.dirname(path.dirname(rowsFile)), "identity-preflight-requests", "identity-preflight-requests.jsonl");
|
|
262
|
+
return fileExists(defaultPath) ? defaultPath : null;
|
|
263
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
interface JsonRecord {
|
|
2
|
+
[key: string]: unknown;
|
|
3
|
+
}
|
|
4
|
+
interface ArtifactEnvelope {
|
|
5
|
+
path: string;
|
|
6
|
+
value: JsonRecord;
|
|
7
|
+
}
|
|
8
|
+
interface ReferenceParts {
|
|
9
|
+
table?: unknown;
|
|
10
|
+
id?: unknown;
|
|
11
|
+
version?: unknown;
|
|
12
|
+
}
|
|
13
|
+
export interface DatasetReference {
|
|
14
|
+
table: string | null;
|
|
15
|
+
id: string;
|
|
16
|
+
version: string;
|
|
17
|
+
path: string;
|
|
18
|
+
type: string | null;
|
|
19
|
+
short_description: string | null;
|
|
20
|
+
}
|
|
21
|
+
interface RowsTransformContext extends JsonRecord {
|
|
22
|
+
status?: unknown;
|
|
23
|
+
inputRowsFile?: string | null;
|
|
24
|
+
outputRowsFile?: string | null;
|
|
25
|
+
counts?: JsonRecord;
|
|
26
|
+
}
|
|
27
|
+
interface DecisionApplyContext extends JsonRecord {
|
|
28
|
+
status?: unknown;
|
|
29
|
+
decisions: unknown[];
|
|
30
|
+
}
|
|
31
|
+
interface IdentityReferenceRewriteContext extends RowsTransformContext {
|
|
32
|
+
scopedRows?: unknown[];
|
|
33
|
+
}
|
|
34
|
+
interface PatchApplyContext extends JsonRecord {
|
|
35
|
+
status?: unknown;
|
|
36
|
+
evidenceRows?: unknown[];
|
|
37
|
+
globalBlockers?: JsonRecord[];
|
|
38
|
+
byIdentity: {
|
|
39
|
+
get(key: string): unknown[] | undefined;
|
|
40
|
+
};
|
|
41
|
+
byRowIndex: {
|
|
42
|
+
get(key: number): unknown[] | undefined;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
interface SourceContactSemanticEvidenceOptions {
|
|
46
|
+
repoRoot: string;
|
|
47
|
+
datasetType: unknown;
|
|
48
|
+
rowsFile: string | null;
|
|
49
|
+
sourceContactRewriteContext?: RowsTransformContext | null;
|
|
50
|
+
canonicalSupportRewriteContext?: RowsTransformContext | null;
|
|
51
|
+
cleanupContext?: RowsTransformContext | null;
|
|
52
|
+
}
|
|
53
|
+
interface FullContextBlockerOptions {
|
|
54
|
+
repoRoot: string;
|
|
55
|
+
profile: unknown;
|
|
56
|
+
datasetType: string;
|
|
57
|
+
curationGateArtifact?: ArtifactEnvelope | null;
|
|
58
|
+
rowsFile: string;
|
|
59
|
+
patchApplyArtifact?: ArtifactEnvelope | null;
|
|
60
|
+
patchApplyContext?: PatchApplyContext | null;
|
|
61
|
+
patchCollectArtifact?: ArtifactEnvelope | null;
|
|
62
|
+
cleanupArtifact?: ArtifactEnvelope | null;
|
|
63
|
+
classificationDecisionApplyArtifact?: ArtifactEnvelope | null;
|
|
64
|
+
classificationDecisionApplyContext?: DecisionApplyContext | null;
|
|
65
|
+
locationDecisionApplyArtifact?: ArtifactEnvelope | null;
|
|
66
|
+
locationDecisionApplyContext?: DecisionApplyContext | null;
|
|
67
|
+
identityDecisionApplyArtifact?: ArtifactEnvelope | null;
|
|
68
|
+
identityDecisionApplyContext?: DecisionApplyContext | null;
|
|
69
|
+
identityReferenceRewriteContext?: IdentityReferenceRewriteContext | null;
|
|
70
|
+
unresolvedExchangeExternalizationContext?: RowsTransformContext | null;
|
|
71
|
+
sourceContactRewriteContext?: RowsTransformContext | null;
|
|
72
|
+
canonicalSupportRewriteContext?: RowsTransformContext | null;
|
|
73
|
+
cleanupContext?: RowsTransformContext | null;
|
|
74
|
+
}
|
|
75
|
+
interface RemoteVerifyArtifact {
|
|
76
|
+
value?: JsonRecord;
|
|
77
|
+
}
|
|
78
|
+
interface BuildReferenceClosureOptions {
|
|
79
|
+
repoRoot: string;
|
|
80
|
+
rows: unknown[];
|
|
81
|
+
datasetType: string;
|
|
82
|
+
remoteVerifyArtifact?: RemoteVerifyArtifact | null;
|
|
83
|
+
provenReferenceKeys?: Set<string>;
|
|
84
|
+
unresolvedReferenceKeys?: Set<string>;
|
|
85
|
+
allowAccountLocalSupportAndElementary?: boolean;
|
|
86
|
+
}
|
|
87
|
+
interface MapRows {
|
|
88
|
+
success?: Map<string, JsonRecord>;
|
|
89
|
+
prepared?: Map<string, JsonRecord>;
|
|
90
|
+
failures?: Map<string, JsonRecord>;
|
|
91
|
+
}
|
|
92
|
+
interface DryRunContexts {
|
|
93
|
+
flow?: MapRows | null;
|
|
94
|
+
process?: MapRows | null;
|
|
95
|
+
lifecyclemodel?: MapRows | null;
|
|
96
|
+
datasetSaveDraft?: MapRows | null;
|
|
97
|
+
}
|
|
98
|
+
interface WriteIdentity extends JsonRecord {
|
|
99
|
+
id: string;
|
|
100
|
+
version: string;
|
|
101
|
+
payload: unknown;
|
|
102
|
+
dataset_type?: string | null;
|
|
103
|
+
sourceRowsFile?: string | null;
|
|
104
|
+
}
|
|
105
|
+
interface WriteCandidateOptions {
|
|
106
|
+
repoRoot: string;
|
|
107
|
+
datasetType: string;
|
|
108
|
+
row: unknown;
|
|
109
|
+
identity: WriteIdentity;
|
|
110
|
+
rowIndex: number;
|
|
111
|
+
schemaRow?: JsonRecord | null;
|
|
112
|
+
curationEntity?: JsonRecord | null;
|
|
113
|
+
curationWaivedQaCodes?: unknown[];
|
|
114
|
+
curationGateProvided: boolean;
|
|
115
|
+
dryRun: DryRunContexts;
|
|
116
|
+
remoteVerifyBlockers: Set<string>;
|
|
117
|
+
targetUserId: string;
|
|
118
|
+
cleanupStatus: unknown;
|
|
119
|
+
patchApplyContext?: PatchApplyContext | null;
|
|
120
|
+
sourceReferenceRewritesByKey?: Map<string, unknown[]> | null;
|
|
121
|
+
identityReferenceRewritesByKey?: Map<string, unknown[]> | null;
|
|
122
|
+
identityDecisionApplyContext?: DecisionApplyContext | null;
|
|
123
|
+
cleanupContext?: JsonRecord | null;
|
|
124
|
+
evidenceScopeBlockers?: JsonRecord[];
|
|
125
|
+
allowAccountLocalSupportAndElementary?: boolean;
|
|
126
|
+
profile?: unknown;
|
|
127
|
+
}
|
|
128
|
+
interface ReferenceReuseOptions {
|
|
129
|
+
repoRoot: string;
|
|
130
|
+
datasetType: string;
|
|
131
|
+
rows: unknown[];
|
|
132
|
+
writeCandidateKeys: Set<string>;
|
|
133
|
+
identityReferenceRewritesByKey?: Map<string, unknown[]> | null;
|
|
134
|
+
}
|
|
135
|
+
interface PartitionItem {
|
|
136
|
+
decision: string;
|
|
137
|
+
operation?: string | null;
|
|
138
|
+
}
|
|
139
|
+
export interface MutationManifestItem extends JsonRecord {
|
|
140
|
+
dataset_type: string;
|
|
141
|
+
entity_id: string;
|
|
142
|
+
version: string;
|
|
143
|
+
role: string;
|
|
144
|
+
decision: string;
|
|
145
|
+
operation: string | null;
|
|
146
|
+
blockers: JsonRecord[];
|
|
147
|
+
foundry_traces: {
|
|
148
|
+
unresolved_traces: unknown[];
|
|
149
|
+
unresolved_exchange_traces: unknown[];
|
|
150
|
+
source_exchange_completeness: unknown[];
|
|
151
|
+
};
|
|
152
|
+
ai_patch_evidence_count?: number;
|
|
153
|
+
identity_reference_rewrite_count: number;
|
|
154
|
+
}
|
|
155
|
+
export declare function sourceContactRewriteSemanticEvidenceCount({ repoRoot, datasetType, rowsFile, sourceContactRewriteContext, canonicalSupportRewriteContext, cleanupContext, }: SourceContactSemanticEvidenceOptions): number;
|
|
156
|
+
export declare function buildFullContextAiCompletionBlockers({ repoRoot, profile, datasetType, curationGateArtifact, rowsFile, patchApplyArtifact, patchApplyContext, patchCollectArtifact, cleanupArtifact, classificationDecisionApplyArtifact, classificationDecisionApplyContext, locationDecisionApplyArtifact, locationDecisionApplyContext, identityDecisionApplyArtifact, identityDecisionApplyContext, identityReferenceRewriteContext, unresolvedExchangeExternalizationContext, sourceContactRewriteContext, canonicalSupportRewriteContext, cleanupContext, }: FullContextBlockerOptions): JsonRecord[];
|
|
157
|
+
export declare const referenceTableByTypeToken: Array<readonly [string, string]>;
|
|
158
|
+
export declare const referenceTableByPathToken: Array<readonly [string, string]>;
|
|
159
|
+
export declare function referenceTableFromType(value: unknown): string | null;
|
|
160
|
+
export declare function referenceTableFromPath(pathSegments: string[]): string | null;
|
|
161
|
+
export declare function referenceKey({ table, id, version }: ReferenceParts): string;
|
|
162
|
+
export declare function plannedRootReferenceKeys(rows: unknown[], datasetType: string): Set<string>;
|
|
163
|
+
export declare function plannedRootReferenceIds(rows: unknown[], datasetType: string): Set<string>;
|
|
164
|
+
export declare function collectDatasetReferences(value: unknown, pathSegments?: string[], refs?: DatasetReference[]): DatasetReference[];
|
|
165
|
+
export declare function isFoundryTracePathSegments(pathSegments: string[]): boolean;
|
|
166
|
+
export declare function remoteVerifyChecks(repoRoot: string, remoteVerifyArtifact?: RemoteVerifyArtifact | null): JsonRecord[];
|
|
167
|
+
export declare function remoteVerifiedReferenceKeys(repoRoot: string, remoteVerifyArtifact?: RemoteVerifyArtifact | null, { acceptExactExistingOutdated }?: {
|
|
168
|
+
acceptExactExistingOutdated?: boolean;
|
|
169
|
+
}): Set<string>;
|
|
170
|
+
export declare function identityReferenceRewriteProofKeys(context?: IdentityReferenceRewriteContext | null): Set<string>;
|
|
171
|
+
export declare function buildReferenceClosureBlockers({ repoRoot, rows, datasetType, remoteVerifyArtifact, provenReferenceKeys, unresolvedReferenceKeys, allowAccountLocalSupportAndElementary, }: BuildReferenceClosureOptions): JsonRecord[];
|
|
172
|
+
export declare function failureReasons(row: unknown): JsonRecord[];
|
|
173
|
+
export declare function decisionCounts(items: PartitionItem[]): Record<string, number>;
|
|
174
|
+
export declare function operationCounts(items: PartitionItem[]): Record<string, number>;
|
|
175
|
+
export declare function buildWriteCandidateItem({ repoRoot, datasetType, row, identity, rowIndex, schemaRow, curationEntity, curationWaivedQaCodes, curationGateProvided, dryRun, remoteVerifyBlockers, targetUserId, cleanupStatus, patchApplyContext, sourceReferenceRewritesByKey, identityReferenceRewritesByKey, identityDecisionApplyContext, cleanupContext, evidenceScopeBlockers, allowAccountLocalSupportAndElementary, profile, }: WriteCandidateOptions): MutationManifestItem;
|
|
176
|
+
export declare function buildReferenceReuseItems({ repoRoot: _repoRoot, datasetType, rows, writeCandidateKeys, identityReferenceRewritesByKey, }: ReferenceReuseOptions): MutationManifestItem[];
|
|
177
|
+
export {};
|