@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,172 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { authoringTaskFullContextReadinessBlockers, patchPayloadPatchSets, patchSetOperations, sharedContextBundleReadinessBlockers, validateCollectedPatchSet, } from "./internal/authoring-patch-workflow.js";
|
|
4
|
+
import { asText, ensureArray, fileExists, nowIso, readJson, repoRelativePath, resolveRepoPath, writeJson, } from "./internal/runtime-io.js";
|
|
5
|
+
function isRecord(value) {
|
|
6
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
export function runDatasetAuthoringPatchCollect({ repoRoot, options = {}, } = {}) {
|
|
9
|
+
if (options.help) {
|
|
10
|
+
return {
|
|
11
|
+
schema_version: 1,
|
|
12
|
+
status: "help",
|
|
13
|
+
command: "dataset-authoring-patch-collect",
|
|
14
|
+
usage: [
|
|
15
|
+
"node scripts/foundry.ts dataset-authoring-patch-collect --task-manifest <authoring-task-manifest.json>",
|
|
16
|
+
"node scripts/foundry.ts dataset-authoring-patch-collect --task-manifest ./authoring-tasks/authoring-task-manifest.json",
|
|
17
|
+
],
|
|
18
|
+
purpose: "Collect per-task AI patch outputs into one batch patch file and block if any task output is missing or structurally invalid. This command is local-only and never writes the database.",
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const manifestPath = resolveRepoPath(repoRoot, options.taskManifest ?? options.manifest ?? options.input);
|
|
22
|
+
if (!manifestPath || !fileExists(manifestPath)) {
|
|
23
|
+
throw new Error("--task-manifest is required and must point to authoring-task-manifest.json.");
|
|
24
|
+
}
|
|
25
|
+
const manifest = readJson(manifestPath);
|
|
26
|
+
const batchPatchContract = isRecord(manifest.batch_patch_contract)
|
|
27
|
+
? manifest.batch_patch_contract
|
|
28
|
+
: {};
|
|
29
|
+
const manifestCommands = isRecord(manifest.commands) ? manifest.commands : {};
|
|
30
|
+
const manifestDir = path.dirname(manifestPath);
|
|
31
|
+
const outDir = resolveRepoPath(repoRoot, options.outDir || manifestDir);
|
|
32
|
+
const batchPatchPath = resolveRepoPath(repoRoot, options.out ||
|
|
33
|
+
options.patchOut ||
|
|
34
|
+
batchPatchContract.output_patch_file ||
|
|
35
|
+
path.join(outDir, "ai-patches.batch.json"));
|
|
36
|
+
const reportPath = path.join(outDir, "authoring-patch-collect-report.json");
|
|
37
|
+
const requiredTasks = ensureArray(manifest.tasks).filter((task) => isRecord(task) &&
|
|
38
|
+
(task.status === "ready_for_ai_authoring" || Number(task.action_item_count ?? 0) > 0));
|
|
39
|
+
const patchSets = [];
|
|
40
|
+
const patchFiles = [];
|
|
41
|
+
const blockers = [];
|
|
42
|
+
if (requiredTasks.length > 0) {
|
|
43
|
+
blockers.push(...sharedContextBundleReadinessBlockers({
|
|
44
|
+
repoRoot: repoRoot,
|
|
45
|
+
sharedContextBundle: manifest.shared_context_bundle,
|
|
46
|
+
sourceKind: "manifest",
|
|
47
|
+
sourcePath: manifestPath,
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
for (const [taskIndex, task] of requiredTasks.entries()) {
|
|
51
|
+
const taskContextBlockers = authoringTaskFullContextReadinessBlockers({
|
|
52
|
+
repoRoot: repoRoot,
|
|
53
|
+
task,
|
|
54
|
+
});
|
|
55
|
+
if (taskContextBlockers.length > 0) {
|
|
56
|
+
blockers.push(...taskContextBlockers.map((blocker) => ({
|
|
57
|
+
...blocker,
|
|
58
|
+
task_index: taskIndex,
|
|
59
|
+
entity: task.entity ?? null,
|
|
60
|
+
})));
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
const taskFiles = isRecord(task.files) ? task.files : {};
|
|
64
|
+
const patchPath = resolveRepoPath(repoRoot, taskFiles.output_patch_file);
|
|
65
|
+
if (!patchPath || !fileExists(patchPath)) {
|
|
66
|
+
blockers.push({
|
|
67
|
+
code: "ai_patch_missing",
|
|
68
|
+
message: "Expected AI patch file is missing for authoring task.",
|
|
69
|
+
task_index: taskIndex,
|
|
70
|
+
entity: task.entity ?? null,
|
|
71
|
+
expected_patch_file: taskFiles.output_patch_file ?? null,
|
|
72
|
+
});
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
let rawPatch;
|
|
76
|
+
try {
|
|
77
|
+
rawPatch = readJson(patchPath);
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
blockers.push({
|
|
81
|
+
code: "ai_patch_invalid_json",
|
|
82
|
+
message: error instanceof Error ? error.message : String(error),
|
|
83
|
+
task_index: taskIndex,
|
|
84
|
+
entity: task.entity ?? null,
|
|
85
|
+
patch_file: repoRelativePath(repoRoot, patchPath),
|
|
86
|
+
});
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if (asText(rawPatch?.template_status) === "requires_ai_completion") {
|
|
90
|
+
blockers.push({
|
|
91
|
+
code: "ai_patch_template_incomplete",
|
|
92
|
+
message: "AI patch file still has template_status=requires_ai_completion.",
|
|
93
|
+
task_index: taskIndex,
|
|
94
|
+
entity: task.entity ?? null,
|
|
95
|
+
patch_file: repoRelativePath(repoRoot, patchPath),
|
|
96
|
+
});
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const patchStatus = asText(rawPatch?.patch_status ?? rawPatch?.status);
|
|
100
|
+
if (patchStatus !== "completed") {
|
|
101
|
+
blockers.push({
|
|
102
|
+
code: "ai_patch_status_not_completed",
|
|
103
|
+
message: "AI patch file must declare patch_status=completed before collect.",
|
|
104
|
+
task_index: taskIndex,
|
|
105
|
+
entity: task.entity ?? null,
|
|
106
|
+
patch_file: repoRelativePath(repoRoot, patchPath),
|
|
107
|
+
patch_status: patchStatus || null,
|
|
108
|
+
});
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const taskPatchSets = patchPayloadPatchSets(rawPatch);
|
|
112
|
+
if (taskPatchSets.length === 0) {
|
|
113
|
+
blockers.push({
|
|
114
|
+
code: "ai_patch_no_patch_sets",
|
|
115
|
+
message: "AI patch file must contain a patch set or patch_sets[].",
|
|
116
|
+
task_index: taskIndex,
|
|
117
|
+
entity: task.entity ?? null,
|
|
118
|
+
patch_file: repoRelativePath(repoRoot, patchPath),
|
|
119
|
+
});
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
for (const [patchSetIndex, patchSet] of taskPatchSets.entries()) {
|
|
123
|
+
const typedPatchSet = isRecord(patchSet) ? patchSet : {};
|
|
124
|
+
blockers.push(...validateCollectedPatchSet({
|
|
125
|
+
repoRoot: repoRoot,
|
|
126
|
+
task,
|
|
127
|
+
patchSet: typedPatchSet,
|
|
128
|
+
patchSetIndex,
|
|
129
|
+
patchPath,
|
|
130
|
+
}));
|
|
131
|
+
}
|
|
132
|
+
patchSets.push(...taskPatchSets.map((patchSet) => (isRecord(patchSet) ? patchSet : {})));
|
|
133
|
+
patchFiles.push(repoRelativePath(repoRoot, patchPath));
|
|
134
|
+
}
|
|
135
|
+
const operationCount = patchSets.reduce((total, patchSet) => total + (patchSetOperations(patchSet)?.length ?? 0), 0);
|
|
136
|
+
const report = {
|
|
137
|
+
schema_version: 1,
|
|
138
|
+
generated_at_utc: nowIso(),
|
|
139
|
+
status: blockers.length > 0 ? "blocked" : "ready_for_patch_apply",
|
|
140
|
+
task_manifest: repoRelativePath(repoRoot, manifestPath),
|
|
141
|
+
counts: {
|
|
142
|
+
tasks: ensureArray(manifest.tasks).length,
|
|
143
|
+
required_tasks: requiredTasks.length,
|
|
144
|
+
patch_files: patchFiles.length,
|
|
145
|
+
patch_sets: patchSets.length,
|
|
146
|
+
operations: operationCount,
|
|
147
|
+
blockers: blockers.length,
|
|
148
|
+
},
|
|
149
|
+
patch_files: patchFiles,
|
|
150
|
+
blockers,
|
|
151
|
+
commands: {
|
|
152
|
+
apply_all_patches: manifestCommands.apply_all_patches ?? null,
|
|
153
|
+
},
|
|
154
|
+
files: {
|
|
155
|
+
batch_patch: repoRelativePath(repoRoot, batchPatchPath),
|
|
156
|
+
report: repoRelativePath(repoRoot, reportPath),
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
160
|
+
if (blockers.length === 0) {
|
|
161
|
+
writeJson(batchPatchPath, {
|
|
162
|
+
schema_version: 1,
|
|
163
|
+
kind: "tiangong_foundry_dataset_patch_batch",
|
|
164
|
+
patch_status: "completed",
|
|
165
|
+
generated_at_utc: report.generated_at_utc,
|
|
166
|
+
task_manifest: repoRelativePath(repoRoot, manifestPath),
|
|
167
|
+
patch_sets: patchSets,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
writeJson(reportPath, report);
|
|
171
|
+
return report;
|
|
172
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { listImportProfiles, profileFor } from "./internal/profiles-config.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { listImportProfiles, profileFor } from "./internal/profiles-config.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { foundryTraceSummary } from "./internal/trace-summary.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { foundryTraceSummary } from "./internal/trace-summary.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function requirePrivateOAuthSessionFile(value: string): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
// Foundry validates a reference; only the CLI reads and rotates session contents.
|
|
4
|
+
export function requirePrivateOAuthSessionFile(value) {
|
|
5
|
+
let stat;
|
|
6
|
+
try {
|
|
7
|
+
if (!path.isAbsolute(value))
|
|
8
|
+
throw new Error();
|
|
9
|
+
stat = fs.lstatSync(value);
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
throw new Error("OAuth session reference must identify an existing absolute private file.");
|
|
13
|
+
}
|
|
14
|
+
if (!stat.isFile() ||
|
|
15
|
+
stat.isSymbolicLink() ||
|
|
16
|
+
(process.platform !== "win32" && (stat.mode & 0o077) !== 0)) {
|
|
17
|
+
throw new Error("OAuth session reference must identify a regular private file without symlinks.");
|
|
18
|
+
}
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
type JsonRecord = Record<string, unknown>;
|
|
2
|
+
type FinalizeOptions = Record<string, unknown>;
|
|
3
|
+
type StageReport = JsonRecord & {
|
|
4
|
+
status?: unknown;
|
|
5
|
+
files?: JsonRecord;
|
|
6
|
+
rewrite_rows?: unknown;
|
|
7
|
+
};
|
|
8
|
+
type IdentityPreflightCommands = {
|
|
9
|
+
identityPreflightRunIndexPath: (options: FinalizeOptions) => string | null;
|
|
10
|
+
runDatasetIdentityPreflightRequestsBuild: (options: FinalizeOptions) => StageReport;
|
|
11
|
+
runDatasetIdentityPreflightIndexMerge: (options: FinalizeOptions) => StageReport;
|
|
12
|
+
runDatasetIdentityPreflightRun: (options: FinalizeOptions) => StageReport;
|
|
13
|
+
};
|
|
14
|
+
type FinalizeFactoryDependencies = {
|
|
15
|
+
executionEnvironment?: NodeJS.ProcessEnv;
|
|
16
|
+
asText: (value: unknown) => string;
|
|
17
|
+
booleanOption: (value: unknown) => boolean;
|
|
18
|
+
cliWrapperCommands: {
|
|
19
|
+
runDatasetCurationQueueBuild: (options: FinalizeOptions) => StageReport;
|
|
20
|
+
};
|
|
21
|
+
countRowsFile: (filePath: string) => number;
|
|
22
|
+
datasetIdentity: (row: JsonRecord, datasetType: string) => {
|
|
23
|
+
id: string;
|
|
24
|
+
version: string;
|
|
25
|
+
};
|
|
26
|
+
ensureArray: <T>(value: T | T[] | null | undefined) => T[];
|
|
27
|
+
fileExists: (filePath: string | null) => boolean;
|
|
28
|
+
identityPreflightCommands: IdentityPreflightCommands;
|
|
29
|
+
identityReferenceRewriteIndexPath: (options: FinalizeOptions, rowsFile: string) => string | null;
|
|
30
|
+
normalizedList: (value: unknown) => string[];
|
|
31
|
+
readRowsFile: (filePath: string | null) => JsonRecord[];
|
|
32
|
+
referenceShortDescription: (reference: JsonRecord) => string;
|
|
33
|
+
repoRelativeMaybe: (filePath: string | null) => string | null;
|
|
34
|
+
resolveRepoPath: (value: unknown) => string | null;
|
|
35
|
+
unique: <T>(values: T[]) => T[];
|
|
36
|
+
writeJsonLines: (filePath: string, rows: JsonRecord[]) => unknown;
|
|
37
|
+
};
|
|
38
|
+
export declare function createPostAuthoringFinalizeUtils({ executionEnvironment, asText, booleanOption, cliWrapperCommands, countRowsFile, datasetIdentity, ensureArray, fileExists, identityPreflightCommands, identityReferenceRewriteIndexPath, normalizedList, readRowsFile, referenceShortDescription, repoRelativeMaybe, resolveRepoPath, unique, writeJsonLines, }: FinalizeFactoryDependencies): {
|
|
39
|
+
identityReferenceRewritesFileForRowsFile: (rowsFile: string | null, options?: FinalizeOptions) => string | null;
|
|
40
|
+
preseedResolutionReuseDecisions: ({ index }: {
|
|
41
|
+
index: string | null;
|
|
42
|
+
}) => JsonRecord;
|
|
43
|
+
runFinalizeAutoCurationQueue: ({ datasetType, rowsFile, cleanedRowsFile, outDir, options, fullContextRequirement, identityReferenceRewriteStage, }: {
|
|
44
|
+
datasetType: string;
|
|
45
|
+
rowsFile: string;
|
|
46
|
+
cleanedRowsFile: string;
|
|
47
|
+
outDir: string;
|
|
48
|
+
options: FinalizeOptions;
|
|
49
|
+
fullContextRequirement: unknown;
|
|
50
|
+
identityReferenceRewriteStage: StageReport | null;
|
|
51
|
+
}) => {
|
|
52
|
+
stage: string;
|
|
53
|
+
status: string;
|
|
54
|
+
queue_dir: string;
|
|
55
|
+
report_file: string | null;
|
|
56
|
+
report: null;
|
|
57
|
+
files: {
|
|
58
|
+
manifest?: undefined;
|
|
59
|
+
identity_external_flow_refs?: undefined;
|
|
60
|
+
process_reference_external_flow_refs?: undefined;
|
|
61
|
+
};
|
|
62
|
+
} | {
|
|
63
|
+
stage: string;
|
|
64
|
+
status: string;
|
|
65
|
+
queue_dir: null;
|
|
66
|
+
report_file: null;
|
|
67
|
+
report: null;
|
|
68
|
+
files: {
|
|
69
|
+
manifest?: undefined;
|
|
70
|
+
identity_external_flow_refs?: undefined;
|
|
71
|
+
process_reference_external_flow_refs?: undefined;
|
|
72
|
+
};
|
|
73
|
+
} | {
|
|
74
|
+
stage: string;
|
|
75
|
+
status: unknown;
|
|
76
|
+
queue_dir: string;
|
|
77
|
+
report_file: string | null;
|
|
78
|
+
report: StageReport;
|
|
79
|
+
files: {
|
|
80
|
+
manifest: {} | null;
|
|
81
|
+
identity_external_flow_refs: string | null;
|
|
82
|
+
process_reference_external_flow_refs: string | null;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
runFinalizeIdentityPreflightStage: ({ rowsFile, outDir, options, }: {
|
|
86
|
+
rowsFile: string;
|
|
87
|
+
outDir: string;
|
|
88
|
+
options: FinalizeOptions;
|
|
89
|
+
}) => JsonRecord;
|
|
90
|
+
sourceReferenceRewritesFileForRowsFile: (rowsFile: string | null, options?: FinalizeOptions) => string | null;
|
|
91
|
+
};
|
|
92
|
+
export declare const postAuthoringFinalizeUtilsTestHooks: {
|
|
93
|
+
foundryEntryPath: string;
|
|
94
|
+
};
|
|
95
|
+
export {};
|