project-tiny-context-harness 0.2.85 → 0.6.1
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 +164 -427
- package/assets/README.md +284 -455
- package/assets/README.zh-CN.md +200 -123
- package/assets/agents/AGENTS_CORE.md +54 -67
- package/assets/context_templates/context.toml +3 -0
- package/assets/context_templates/global.md +6 -6
- package/assets/github/harness.yml +2 -2
- package/assets/skills/context_development_engineer/SKILL.md +91 -107
- package/assets/skills/context_product_plan/SKILL.md +18 -28
- package/assets/skills/context_surface_contract/SKILL.md +35 -38
- package/assets/skills/context_uiux_design/SKILL.md +31 -30
- package/assets/skills/long-task-workflow/SKILL.md +76 -0
- package/assets/skills/long-task-workflow/agents/openai.yaml +4 -0
- package/assets/skills/long-task-workflow/references/authority-lifecycle.md +41 -0
- package/assets/skills/long-task-workflow/references/contract-authoring.md +63 -0
- package/assets/skills/long-task-workflow/references/evidence-design.md +45 -0
- package/assets/skills/normal-long-task/SKILL.md +12 -489
- package/assets/skills/source-plan-authoring/SKILL.md +467 -0
- package/assets/tools/validate_context.py +293 -127
- package/dist/cli.js +3 -1
- package/dist/commands/check-modularity.js +33 -10
- package/dist/commands/composite-campaign.d.ts +1 -0
- package/dist/commands/composite-campaign.js +8 -0
- package/dist/commands/composite-long-task.d.ts +1 -6
- package/dist/commands/composite-long-task.js +7 -163
- package/dist/commands/delivery-set.d.ts +1 -0
- package/dist/commands/delivery-set.js +8 -0
- package/dist/commands/disable.d.ts +1 -0
- package/dist/commands/disable.js +15 -0
- package/dist/commands/enable.d.ts +1 -0
- package/dist/commands/enable.js +14 -0
- package/dist/commands/export-context-args.js +13 -4
- package/dist/commands/export-context.js +18 -7
- package/dist/commands/index.js +42 -30
- package/dist/commands/init.js +12 -6
- package/dist/commands/long-task-authoring.d.ts +3 -0
- package/dist/commands/long-task-authoring.js +92 -0
- package/dist/commands/long-task-explain.d.ts +1 -0
- package/dist/commands/long-task-explain.js +52 -0
- package/dist/commands/long-task.d.ts +1 -0
- package/dist/commands/long-task.js +226 -0
- package/dist/commands/package-source.js +2 -2
- package/dist/commands/upgrade.js +10 -10
- package/dist/index.d.ts +11 -1
- package/dist/index.js +8 -0
- package/dist/lib/config.js +34 -8
- package/dist/lib/context-default-footprint.d.ts +16 -0
- package/dist/lib/context-default-footprint.js +107 -0
- package/dist/lib/context-export.js +105 -41
- package/dist/lib/context-graph-snapshot.d.ts +18 -0
- package/dist/lib/context-graph-snapshot.js +171 -0
- package/dist/lib/context-manifest-schema.d.ts +28 -0
- package/dist/lib/context-manifest-schema.js +150 -0
- package/dist/lib/context-manifest.js +28 -20
- package/dist/lib/context-templates.js +5 -5
- package/dist/lib/design-md.js +1 -1
- package/dist/lib/doctor.js +54 -1
- package/dist/lib/harness-root.js +25 -8
- package/dist/lib/init.js +6 -3
- package/dist/lib/legacy-managed-scan.js +23 -7
- package/dist/lib/legacy-sdlc-migration.js +21 -11
- package/dist/lib/long-task-acceptance-reference.d.ts +22 -0
- package/dist/lib/long-task-acceptance-reference.js +46 -0
- package/dist/lib/long-task-acceptance-shape.d.ts +5 -0
- package/dist/lib/long-task-acceptance-shape.js +131 -0
- package/dist/lib/long-task-activation-validation.d.ts +21 -0
- package/dist/lib/long-task-activation-validation.js +136 -0
- package/dist/lib/long-task-artifacts.d.ts +5 -0
- package/dist/lib/long-task-artifacts.js +34 -0
- package/dist/lib/long-task-assertions-v2.d.ts +22 -0
- package/dist/lib/long-task-assertions-v2.js +212 -0
- package/dist/lib/long-task-authoring-authority-preview.d.ts +5 -0
- package/dist/lib/long-task-authoring-authority-preview.js +85 -0
- package/dist/lib/long-task-authoring-preflight-diagnostics.d.ts +8 -0
- package/dist/lib/long-task-authoring-preflight-diagnostics.js +179 -0
- package/dist/lib/long-task-authoring-preflight-repair-order.d.ts +8 -0
- package/dist/lib/long-task-authoring-preflight-repair-order.js +95 -0
- package/dist/lib/long-task-authoring-preflight-types.d.ts +46 -0
- package/dist/lib/long-task-authoring-preflight-types.js +38 -0
- package/dist/lib/long-task-authoring-preflight.d.ts +3 -0
- package/dist/lib/long-task-authoring-preflight.js +44 -0
- package/dist/lib/long-task-authority-material-diff.d.ts +17 -0
- package/dist/lib/long-task-authority-material-diff.js +152 -0
- package/dist/lib/long-task-authority-materials.d.ts +7 -0
- package/dist/lib/long-task-authority-materials.js +83 -0
- package/dist/lib/long-task-authority-policy.d.ts +168 -0
- package/dist/lib/long-task-authority-policy.js +181 -0
- package/dist/lib/long-task-authority-revision-details.d.ts +19 -0
- package/dist/lib/long-task-authority-revision-details.js +192 -0
- package/dist/lib/long-task-authority-revision-enforcement.d.ts +3 -0
- package/dist/lib/long-task-authority-revision-enforcement.js +41 -0
- package/dist/lib/long-task-authority-revision-types.d.ts +50 -0
- package/dist/lib/long-task-authority-revision-types.js +1 -0
- package/dist/lib/long-task-authority-revision.d.ts +4 -0
- package/dist/lib/long-task-authority-revision.js +188 -0
- package/dist/lib/long-task-authority-transition-policy.d.ts +62 -0
- package/dist/lib/long-task-authority-transition-policy.js +62 -0
- package/dist/lib/long-task-authority-types.d.ts +96 -0
- package/dist/lib/long-task-authority-types.js +1 -0
- package/dist/lib/long-task-authority.d.ts +7 -0
- package/dist/lib/long-task-authority.js +142 -0
- package/dist/lib/long-task-boundary-check.d.ts +15 -0
- package/dist/lib/long-task-boundary-check.js +9 -0
- package/dist/lib/long-task-check-evidence-decoder.d.ts +3 -0
- package/dist/lib/long-task-check-evidence-decoder.js +74 -0
- package/dist/lib/long-task-check-execution-policy.d.ts +18 -0
- package/dist/lib/long-task-check-execution-policy.js +36 -0
- package/dist/lib/long-task-check-runner.d.ts +2 -0
- package/dist/lib/long-task-check-runner.js +181 -0
- package/dist/lib/long-task-check-shape.d.ts +2 -0
- package/dist/lib/long-task-check-shape.js +136 -0
- package/dist/lib/long-task-claim-definitions.d.ts +7 -0
- package/dist/lib/long-task-claim-definitions.js +78 -0
- package/dist/lib/long-task-claim-proof-policy.d.ts +4 -0
- package/dist/lib/long-task-claim-proof-policy.js +57 -0
- package/dist/lib/long-task-claims.d.ts +10 -0
- package/dist/lib/long-task-claims.js +187 -0
- package/dist/lib/long-task-context-authority-topology.d.ts +7 -0
- package/dist/lib/long-task-context-authority-topology.js +37 -0
- package/dist/lib/long-task-context-authority.d.ts +14 -0
- package/dist/lib/long-task-context-authority.js +66 -0
- package/dist/lib/long-task-contract-types.d.ts +203 -0
- package/dist/lib/long-task-contract-types.js +1 -0
- package/dist/lib/long-task-counterfactual-claim-policy.d.ts +10 -0
- package/dist/lib/long-task-counterfactual-claim-policy.js +57 -0
- package/dist/lib/long-task-counterfactual-sandbox.d.ts +6 -0
- package/dist/lib/long-task-counterfactual-sandbox.js +87 -0
- package/dist/lib/long-task-counterfactual-types.d.ts +24 -0
- package/dist/lib/long-task-counterfactual-types.js +1 -0
- package/dist/lib/long-task-delivery-compiler.d.ts +10 -0
- package/dist/lib/long-task-delivery-compiler.js +129 -0
- package/dist/lib/long-task-delivery-parser.d.ts +13 -0
- package/dist/lib/long-task-delivery-parser.js +90 -0
- package/dist/lib/long-task-delivery-preflight.d.ts +5 -0
- package/dist/lib/long-task-delivery-preflight.js +151 -0
- package/dist/lib/long-task-delivery-shape.d.ts +5 -0
- package/dist/lib/long-task-delivery-shape.js +5 -0
- package/dist/lib/long-task-delivery-types.d.ts +8 -0
- package/dist/lib/long-task-delivery-types.js +8 -0
- package/dist/lib/long-task-delivery-validation.d.ts +3 -0
- package/dist/lib/long-task-delivery-validation.js +175 -0
- package/dist/lib/long-task-evidence-adapter-policy.d.ts +4 -0
- package/dist/lib/long-task-evidence-adapter-policy.js +15 -0
- package/dist/lib/long-task-evidence-adapter-types.d.ts +1 -0
- package/dist/lib/long-task-evidence-adapter-types.js +1 -0
- package/dist/lib/long-task-evidence-findings.d.ts +5 -0
- package/dist/lib/long-task-evidence-findings.js +113 -0
- package/dist/lib/long-task-evidence-sensitivity-policy.d.ts +4 -0
- package/dist/lib/long-task-evidence-sensitivity-policy.js +98 -0
- package/dist/lib/long-task-evidence-v2.d.ts +5 -0
- package/dist/lib/long-task-evidence-v2.js +226 -0
- package/dist/lib/long-task-explain-acceptance-link.d.ts +46 -0
- package/dist/lib/long-task-explain-acceptance-link.js +96 -0
- package/dist/lib/long-task-explain-claim-links.d.ts +45 -0
- package/dist/lib/long-task-explain-claim-links.js +88 -0
- package/dist/lib/long-task-explain-source-links.d.ts +93 -0
- package/dist/lib/long-task-explain-source-links.js +51 -0
- package/dist/lib/long-task-final-v2.d.ts +2 -0
- package/dist/lib/long-task-final-v2.js +124 -0
- package/dist/lib/long-task-finding-context.d.ts +3 -0
- package/dist/lib/long-task-finding-context.js +63 -0
- package/dist/lib/long-task-freshness.d.ts +3 -0
- package/dist/lib/long-task-freshness.js +80 -0
- package/dist/lib/long-task-hook-install.d.ts +9 -0
- package/dist/lib/long-task-hook-install.js +184 -0
- package/dist/lib/long-task-hook-preflight.d.ts +7 -0
- package/dist/lib/long-task-hook-preflight.js +58 -0
- package/dist/lib/long-task-observation-ownership.d.ts +2 -0
- package/dist/lib/long-task-observation-ownership.js +22 -0
- package/dist/lib/long-task-outcome-parser.d.ts +4 -0
- package/dist/lib/long-task-outcome-parser.js +100 -0
- package/dist/lib/long-task-paths.d.ts +49 -0
- package/dist/lib/long-task-paths.js +418 -0
- package/dist/lib/long-task-playwright-counterfactual-policy.d.ts +7 -0
- package/dist/lib/long-task-playwright-counterfactual-policy.js +125 -0
- package/dist/lib/long-task-playwright-evidence.d.ts +6 -0
- package/dist/lib/long-task-playwright-evidence.js +244 -0
- package/dist/lib/long-task-product-shape.d.ts +6 -0
- package/dist/lib/long-task-product-shape.js +73 -0
- package/dist/lib/long-task-progress.d.ts +4 -0
- package/dist/lib/long-task-progress.js +114 -0
- package/dist/lib/long-task-protected-files.d.ts +1 -0
- package/dist/lib/long-task-protected-files.js +30 -0
- package/dist/lib/long-task-required-proof-surfaces.d.ts +2 -0
- package/dist/lib/long-task-required-proof-surfaces.js +13 -0
- package/dist/lib/long-task-requirement-shape.d.ts +2 -0
- package/dist/lib/long-task-requirement-shape.js +18 -0
- package/dist/lib/long-task-risk-surfaces.d.ts +2 -0
- package/dist/lib/long-task-risk-surfaces.js +60 -0
- package/dist/lib/long-task-risk-types.d.ts +5 -0
- package/dist/lib/long-task-risk-types.js +12 -0
- package/dist/lib/long-task-risk.d.ts +9 -0
- package/dist/lib/long-task-risk.js +132 -0
- package/dist/lib/long-task-root-shape.d.ts +4 -0
- package/dist/lib/long-task-root-shape.js +86 -0
- package/dist/lib/long-task-runner-environment.d.ts +7 -0
- package/dist/lib/long-task-runner-environment.js +57 -0
- package/dist/lib/long-task-runner-files.d.ts +3 -0
- package/dist/lib/long-task-runner-files.js +39 -0
- package/dist/lib/long-task-runner-freeze.d.ts +2 -0
- package/dist/lib/long-task-runner-freeze.js +168 -0
- package/dist/lib/long-task-runtime-types.d.ts +214 -0
- package/dist/lib/long-task-runtime-types.js +1 -0
- package/dist/lib/long-task-shape-primitives.d.ts +17 -0
- package/dist/lib/long-task-shape-primitives.js +81 -0
- package/dist/lib/long-task-source-authority-types.d.ts +13 -0
- package/dist/lib/long-task-source-authority-types.js +1 -0
- package/dist/lib/long-task-source-claim-validation.d.ts +5 -0
- package/dist/lib/long-task-source-claim-validation.js +96 -0
- package/dist/lib/long-task-source-continuity.d.ts +4 -0
- package/dist/lib/long-task-source-continuity.js +57 -0
- package/dist/lib/long-task-source-inventory.d.ts +2 -0
- package/dist/lib/long-task-source-inventory.js +21 -0
- package/dist/lib/long-task-source-item-parser.d.ts +3 -0
- package/dist/lib/long-task-source-item-parser.js +112 -0
- package/dist/lib/long-task-source-shape.d.ts +2 -0
- package/dist/lib/long-task-source-shape.js +56 -0
- package/dist/lib/long-task-source-target-continuity.d.ts +4 -0
- package/dist/lib/long-task-source-target-continuity.js +80 -0
- package/dist/lib/long-task-source-target-index.d.ts +12 -0
- package/dist/lib/long-task-source-target-index.js +76 -0
- package/dist/lib/long-task-source-validation.d.ts +3 -0
- package/dist/lib/long-task-source-validation.js +46 -0
- package/dist/lib/long-task-state.d.ts +91 -0
- package/dist/lib/long-task-state.js +611 -0
- package/dist/lib/long-task-status-projection.d.ts +21 -0
- package/dist/lib/long-task-status-projection.js +116 -0
- package/dist/lib/long-task-status-v2.d.ts +37 -0
- package/dist/lib/long-task-status-v2.js +306 -0
- package/dist/lib/long-task-technical-shape.d.ts +3 -0
- package/dist/lib/long-task-technical-shape.js +44 -0
- package/dist/lib/long-task-verifier-authority.d.ts +12 -0
- package/dist/lib/long-task-verifier-authority.js +47 -0
- package/dist/lib/long-task-verifier-identity.d.ts +2 -0
- package/dist/lib/long-task-verifier-identity.js +55 -0
- package/dist/lib/long-task-verifier-v2.d.ts +13 -0
- package/dist/lib/long-task-verifier-v2.js +266 -0
- package/dist/lib/long-task-workspace-runtime-types.d.ts +23 -0
- package/dist/lib/long-task-workspace-runtime-types.js +1 -0
- package/dist/lib/long-task-workspace.d.ts +25 -0
- package/dist/lib/long-task-workspace.js +366 -0
- package/dist/lib/managed-file.js +20 -5
- package/dist/lib/migrations.js +156 -32
- package/dist/lib/modularity.d.ts +27 -1
- package/dist/lib/modularity.js +499 -23
- package/dist/lib/package-json-config.js +14 -5
- package/dist/lib/package-source.js +4 -2
- package/dist/lib/profiles.d.ts +13 -0
- package/dist/lib/profiles.js +66 -0
- package/dist/lib/schema-guard.js +4 -2
- package/dist/lib/source-files.js +14 -7
- package/dist/lib/source-pack-classify.js +91 -19
- package/dist/lib/source-pack-config.js +25 -8
- package/dist/lib/source-pack-export.js +84 -25
- package/dist/lib/source-pack-manifest.js +18 -6
- package/dist/lib/source-pack-records.js +35 -11
- package/dist/lib/source-pack-render.js +47 -18
- package/dist/lib/stable-json.d.ts +2 -0
- package/dist/lib/stable-json.js +21 -0
- package/dist/lib/strict-codec.d.ts +4 -0
- package/dist/lib/strict-codec.js +65 -0
- package/dist/lib/sync-engine.js +76 -24
- package/dist/lib/types.d.ts +8 -1
- package/dist/lib/upgrade.js +4 -3
- package/dist/lib/validators.js +218 -191
- package/dist/long-task-hook.d.ts +2 -0
- package/dist/long-task-hook.js +55 -0
- package/dist/schemas/long-task-delivery-v2/long-task-delivery-v2.schema.json +340 -0
- package/dist/schemas/long-task-delivery-v2/long-task-outcomes-v2.schema.json +18 -0
- package/migrations/README.md +8 -3
- package/package.json +17 -6
- package/source-mappings.yaml +0 -3
- package/assets/protected-harness-baseline.json +0 -20
- package/assets/skills/composite-long-task-workflow/SKILL.md +0 -245
- package/assets/skills/composite-long-task-workflow/assets/execution-binding.template.md +0 -62
- package/assets/skills/composite-long-task-workflow/assets/goal-objective.template.md +0 -17
- package/assets/skills/composite-long-task-workflow/references/composite-long-task-workflow-protocol.md +0 -682
- package/dist/commands/superpowers.d.ts +0 -1
- package/dist/commands/superpowers.js +0 -8
- package/dist/lib/composite-long-task-renderer.d.ts +0 -12
- package/dist/lib/composite-long-task-renderer.js +0 -109
- package/dist/lib/plan-acceptance-artifacts.d.ts +0 -1
- package/dist/lib/plan-acceptance-artifacts.js +0 -220
- package/dist/lib/plan-acceptance-evidence.d.ts +0 -2
- package/dist/lib/plan-acceptance-evidence.js +0 -108
- package/dist/lib/plan-acceptance-json.d.ts +0 -15
- package/dist/lib/plan-acceptance-json.js +0 -133
- package/dist/lib/plan-acceptance-validator.d.ts +0 -2
- package/dist/lib/plan-acceptance-validator.js +0 -209
- package/dist/lib/plan-contract-validator.d.ts +0 -2
- package/dist/lib/plan-contract-validator.js +0 -127
- package/dist/lib/plan-validator-common.d.ts +0 -24
- package/dist/lib/plan-validator-common.js +0 -196
- package/dist/lib/superpowers-task-ac010.d.ts +0 -6
- package/dist/lib/superpowers-task-ac010.js +0 -26
- package/dist/lib/superpowers-task-assertion-normalizers.d.ts +0 -3
- package/dist/lib/superpowers-task-assertion-normalizers.js +0 -74
- package/dist/lib/superpowers-task-assertions.d.ts +0 -20
- package/dist/lib/superpowers-task-assertions.js +0 -257
- package/dist/lib/superpowers-task-attempt.d.ts +0 -4
- package/dist/lib/superpowers-task-attempt.js +0 -102
- package/dist/lib/superpowers-task-command-run-correlation.d.ts +0 -8
- package/dist/lib/superpowers-task-command-run-correlation.js +0 -103
- package/dist/lib/superpowers-task-command-specs.d.ts +0 -3
- package/dist/lib/superpowers-task-command-specs.js +0 -52
- package/dist/lib/superpowers-task-compile-diagnostics.d.ts +0 -5
- package/dist/lib/superpowers-task-compile-diagnostics.js +0 -20
- package/dist/lib/superpowers-task-compile-guards.d.ts +0 -2
- package/dist/lib/superpowers-task-compile-guards.js +0 -66
- package/dist/lib/superpowers-task-compile.d.ts +0 -6
- package/dist/lib/superpowers-task-compile.js +0 -133
- package/dist/lib/superpowers-task-completion-output.d.ts +0 -91
- package/dist/lib/superpowers-task-completion-output.js +0 -374
- package/dist/lib/superpowers-task-conformance.d.ts +0 -2
- package/dist/lib/superpowers-task-conformance.js +0 -24
- package/dist/lib/superpowers-task-contradictions.d.ts +0 -6
- package/dist/lib/superpowers-task-contradictions.js +0 -126
- package/dist/lib/superpowers-task-current-evidence.d.ts +0 -3
- package/dist/lib/superpowers-task-current-evidence.js +0 -176
- package/dist/lib/superpowers-task-delivery.d.ts +0 -4
- package/dist/lib/superpowers-task-delivery.js +0 -96
- package/dist/lib/superpowers-task-derive.d.ts +0 -14
- package/dist/lib/superpowers-task-derive.js +0 -393
- package/dist/lib/superpowers-task-events.d.ts +0 -1
- package/dist/lib/superpowers-task-events.js +0 -13
- package/dist/lib/superpowers-task-evidence-kernel.d.ts +0 -19
- package/dist/lib/superpowers-task-evidence-kernel.js +0 -347
- package/dist/lib/superpowers-task-evidence-records.d.ts +0 -2
- package/dist/lib/superpowers-task-evidence-records.js +0 -55
- package/dist/lib/superpowers-task-evidence.d.ts +0 -10
- package/dist/lib/superpowers-task-evidence.js +0 -147
- package/dist/lib/superpowers-task-fields.d.ts +0 -22
- package/dist/lib/superpowers-task-fields.js +0 -276
- package/dist/lib/superpowers-task-final-card.d.ts +0 -3
- package/dist/lib/superpowers-task-final-card.js +0 -35
- package/dist/lib/superpowers-task-gates.d.ts +0 -12
- package/dist/lib/superpowers-task-gates.js +0 -267
- package/dist/lib/superpowers-task-harness-drift.d.ts +0 -11
- package/dist/lib/superpowers-task-harness-drift.js +0 -90
- package/dist/lib/superpowers-task-next-slices.d.ts +0 -1
- package/dist/lib/superpowers-task-next-slices.js +0 -12
- package/dist/lib/superpowers-task-protected-baseline.d.ts +0 -10
- package/dist/lib/superpowers-task-protected-baseline.js +0 -66
- package/dist/lib/superpowers-task-source-compile.d.ts +0 -5
- package/dist/lib/superpowers-task-source-compile.js +0 -226
- package/dist/lib/superpowers-task-source-parser.d.ts +0 -23
- package/dist/lib/superpowers-task-source-parser.js +0 -218
- package/dist/lib/superpowers-task-state-schema.d.ts +0 -460
- package/dist/lib/superpowers-task-state-schema.js +0 -66
- package/dist/lib/superpowers-task-state-shape.d.ts +0 -3
- package/dist/lib/superpowers-task-state-shape.js +0 -50
- package/dist/lib/superpowers-task-state.d.ts +0 -16
- package/dist/lib/superpowers-task-state.js +0 -246
- package/dist/lib/superpowers-task-status.d.ts +0 -2
- package/dist/lib/superpowers-task-status.js +0 -24
- package/dist/lib/superpowers-task-under-specified.d.ts +0 -7
- package/dist/lib/superpowers-task-under-specified.js +0 -61
- package/dist/lib/superpowers-task-unregistered-evidence.d.ts +0 -11
- package/dist/lib/superpowers-task-unregistered-evidence.js +0 -72
- package/dist/lib/superpowers-task-validator.d.ts +0 -5
- package/dist/lib/superpowers-task-validator.js +0 -293
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { compiledAuthorityMaterials } from "./long-task-authority-materials.js";
|
|
2
|
+
import { contextAuthorityChanged } from "./long-task-context-authority.js";
|
|
3
|
+
import { canonicalValueJson } from "./strict-codec.js";
|
|
4
|
+
export function authorityMaterialRevisionDiff(previous, nextMaterials) {
|
|
5
|
+
const previousMaterials = compiledAuthorityMaterials(previous);
|
|
6
|
+
const productSemanticsChanged = changedProjectionFields(flattenProductSemantics(previousMaterials.product_semantics), flattenProductSemantics(nextMaterials.product_semantics));
|
|
7
|
+
const globalSemanticsChanged = changedProjectionFields(flattenGlobalSemantics(previousMaterials.global_semantics), flattenGlobalSemantics(nextMaterials.global_semantics));
|
|
8
|
+
const sourceFilesAdded = recordKeysAdded(previousMaterials.source_hashes, nextMaterials.source_hashes);
|
|
9
|
+
const sourceFilesRemoved = recordKeysRemoved(previousMaterials.source_hashes, nextMaterials.source_hashes);
|
|
10
|
+
const sourceFilesChanged = recordValuesChanged(previousMaterials.source_hashes, nextMaterials.source_hashes);
|
|
11
|
+
const contextSnapshotModeChanged = previousMaterials.context_snapshot.mode !==
|
|
12
|
+
nextMaterials.context_snapshot.mode;
|
|
13
|
+
const contextTopologyChanged = previousMaterials.context_snapshot.topology_sha256 !==
|
|
14
|
+
nextMaterials.context_snapshot.topology_sha256;
|
|
15
|
+
const contextFilesAdded = recordKeysAdded(previousMaterials.context_snapshot.sha256, nextMaterials.context_snapshot.sha256);
|
|
16
|
+
const contextFilesRemoved = recordKeysRemoved(previousMaterials.context_snapshot.sha256, nextMaterials.context_snapshot.sha256);
|
|
17
|
+
const contextFilesChanged = recordValuesChanged(previousMaterials.context_snapshot.sha256, nextMaterials.context_snapshot.sha256);
|
|
18
|
+
const controllingContextChanged = contextAuthorityChanged(previousMaterials.context_snapshot, nextMaterials.context_snapshot);
|
|
19
|
+
return {
|
|
20
|
+
product_semantics_changed: productSemanticsChanged,
|
|
21
|
+
global_semantics_changed: globalSemanticsChanged,
|
|
22
|
+
source_files_added: sourceFilesAdded,
|
|
23
|
+
source_files_removed: sourceFilesRemoved,
|
|
24
|
+
source_files_changed: sourceFilesChanged,
|
|
25
|
+
context_snapshot_mode_changed: contextSnapshotModeChanged,
|
|
26
|
+
context_topology_changed: contextTopologyChanged,
|
|
27
|
+
context_files_added: contextFilesAdded,
|
|
28
|
+
context_files_removed: contextFilesRemoved,
|
|
29
|
+
context_files_changed: contextFilesChanged,
|
|
30
|
+
reduction_reasons: [
|
|
31
|
+
...(productSemanticsChanged.length ? ["product_semantics_changed"] : []),
|
|
32
|
+
...(globalSemanticsChanged.length ? ["global_semantics_changed"] : []),
|
|
33
|
+
...(sourceFilesAdded.length ||
|
|
34
|
+
sourceFilesRemoved.length ||
|
|
35
|
+
sourceFilesChanged.length
|
|
36
|
+
? ["source_file_content_changed"]
|
|
37
|
+
: []),
|
|
38
|
+
...(controllingContextChanged ? ["context_authority_changed"] : []),
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export function sourceClaimAdditions(beforeClaims, afterClaims) {
|
|
43
|
+
const before = new Set(beforeClaims.map((claim) => claim.key));
|
|
44
|
+
return afterClaims
|
|
45
|
+
.filter((claim) => !before.has(claim.key))
|
|
46
|
+
.map((claim) => `${claim.key}:added`)
|
|
47
|
+
.sort();
|
|
48
|
+
}
|
|
49
|
+
export function changedProductClaimSemantics(previous, next) {
|
|
50
|
+
const before = productClaimSemantics(previous);
|
|
51
|
+
const after = productClaimSemantics(next);
|
|
52
|
+
return [...before.keys()]
|
|
53
|
+
.filter((claim) => after.has(claim) &&
|
|
54
|
+
canonicalValueJson(before.get(claim)) !==
|
|
55
|
+
canonicalValueJson(after.get(claim)))
|
|
56
|
+
.sort();
|
|
57
|
+
}
|
|
58
|
+
function productClaimSemantics(contract) {
|
|
59
|
+
const result = new Map();
|
|
60
|
+
for (const outcome of contract.outcomes) {
|
|
61
|
+
result.set(`${outcome.key}.result`, outcome.product.observable_result);
|
|
62
|
+
for (const item of outcome.product.requirements)
|
|
63
|
+
result.set(`${outcome.key}.requirement.${item.key}`, {
|
|
64
|
+
statement: item.statement,
|
|
65
|
+
required_proof_surfaces: [...item.required_proof_surfaces].sort(),
|
|
66
|
+
});
|
|
67
|
+
for (const control of outcome.product.controls)
|
|
68
|
+
for (const [field, value] of [
|
|
69
|
+
["location", control.location],
|
|
70
|
+
["trigger", control.trigger],
|
|
71
|
+
["input", control.input],
|
|
72
|
+
["loading", control.loading_state],
|
|
73
|
+
["empty", control.empty_state],
|
|
74
|
+
["success", control.success_state],
|
|
75
|
+
["failure", control.failure_state],
|
|
76
|
+
["feedback", control.feedback],
|
|
77
|
+
])
|
|
78
|
+
if (value.trim())
|
|
79
|
+
result.set(`${outcome.key}.control.${control.key}.${field}`, value);
|
|
80
|
+
for (const item of outcome.product.non_completing_outcomes)
|
|
81
|
+
result.set(`${outcome.key}.non_completing.${item.key}`, item.statement);
|
|
82
|
+
for (const item of outcome.technical.obligations)
|
|
83
|
+
result.set(`${outcome.key}.obligation.${item.key}`, item.statement);
|
|
84
|
+
for (const item of outcome.technical.forbidden_shortcuts)
|
|
85
|
+
result.set(`${outcome.key}.forbidden_shortcut.${item.key}`, item.statement);
|
|
86
|
+
}
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
function flattenProductSemantics(projection) {
|
|
90
|
+
const fields = new Map([
|
|
91
|
+
["task.goal", projection.task_goal],
|
|
92
|
+
]);
|
|
93
|
+
for (const item of projection.global_non_goals)
|
|
94
|
+
fields.set(`global.product.non_goals.${item.key}`, item.statement);
|
|
95
|
+
for (const outcome of projection.outcomes) {
|
|
96
|
+
const prefix = `outcomes.${outcome.key}`;
|
|
97
|
+
fields.set(`${prefix}.title`, outcome.title);
|
|
98
|
+
fields.set(`${prefix}.observable_result`, outcome.observable_result);
|
|
99
|
+
fields.set(`${prefix}.owner.label`, outcome.owner.label);
|
|
100
|
+
fields.set(`${prefix}.owner.owner_surfaces`, outcome.owner.owner_surfaces);
|
|
101
|
+
for (const requirement of outcome.requirements) {
|
|
102
|
+
fields.set(`${prefix}.requirements.${requirement.key}`, requirement.statement);
|
|
103
|
+
fields.set(`${prefix}.requirements.${requirement.key}.required_proof_surfaces`, requirement.required_proof_surfaces);
|
|
104
|
+
}
|
|
105
|
+
for (const control of outcome.controls)
|
|
106
|
+
for (const field of [
|
|
107
|
+
"location",
|
|
108
|
+
"trigger",
|
|
109
|
+
"input",
|
|
110
|
+
"loading_state",
|
|
111
|
+
"empty_state",
|
|
112
|
+
"success_state",
|
|
113
|
+
"failure_state",
|
|
114
|
+
"feedback",
|
|
115
|
+
])
|
|
116
|
+
fields.set(`${prefix}.controls.${control.key}.${field}`, control[field]);
|
|
117
|
+
for (const item of outcome.non_completing_outcomes)
|
|
118
|
+
fields.set(`${prefix}.non_completing.${item.key}`, item.statement);
|
|
119
|
+
}
|
|
120
|
+
return fields;
|
|
121
|
+
}
|
|
122
|
+
function flattenGlobalSemantics(projection) {
|
|
123
|
+
const fields = new Map();
|
|
124
|
+
for (const item of projection.constraints)
|
|
125
|
+
fields.set(`global.technical.constraints.${item.key}`, item.statement);
|
|
126
|
+
for (const item of projection.forbidden_shortcuts)
|
|
127
|
+
fields.set(`global.technical.forbidden_shortcuts.${item.key}`, item.statement);
|
|
128
|
+
return fields;
|
|
129
|
+
}
|
|
130
|
+
function changedProjectionFields(previous, next) {
|
|
131
|
+
return [...new Set([...previous.keys(), ...next.keys()])]
|
|
132
|
+
.filter((field) => !previous.has(field) ||
|
|
133
|
+
!next.has(field) ||
|
|
134
|
+
canonicalValueJson(previous.get(field)) !==
|
|
135
|
+
canonicalValueJson(next.get(field)))
|
|
136
|
+
.sort();
|
|
137
|
+
}
|
|
138
|
+
function recordKeysAdded(previous, next) {
|
|
139
|
+
return Object.keys(next)
|
|
140
|
+
.filter((key) => !(key in previous))
|
|
141
|
+
.sort();
|
|
142
|
+
}
|
|
143
|
+
function recordKeysRemoved(previous, next) {
|
|
144
|
+
return Object.keys(previous)
|
|
145
|
+
.filter((key) => !(key in next))
|
|
146
|
+
.sort();
|
|
147
|
+
}
|
|
148
|
+
function recordValuesChanged(previous, next) {
|
|
149
|
+
return Object.keys(previous)
|
|
150
|
+
.filter((key) => key in next && previous[key] !== next[key])
|
|
151
|
+
.sort();
|
|
152
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AuthorityMaterialHashesV2, CompiledDeliveryContractV2, CompiledSourceItemV2, ContextAuthoritySnapshotV2, DeliveryContractV2, GlobalSemanticProjectionV2, NextAuthorityMaterialsV2, ProductSemanticProjectionV2 } from "./long-task-delivery-types.js";
|
|
2
|
+
export declare function computeAuthorityMaterials(contract: Pick<DeliveryContractV2, "task" | "global" | "outcomes">, sourceHashes: Record<string, string>, sourceItems: CompiledSourceItemV2[], contextSnapshot: ContextAuthoritySnapshotV2): NextAuthorityMaterialsV2;
|
|
3
|
+
export declare function compiledAuthorityMaterials(compiled: CompiledDeliveryContractV2): NextAuthorityMaterialsV2;
|
|
4
|
+
export declare function authorityMaterialHashes(materials: NextAuthorityMaterialsV2): AuthorityMaterialHashesV2;
|
|
5
|
+
export declare function authorityMaterialsChanged(previous: NextAuthorityMaterialsV2, next: NextAuthorityMaterialsV2): boolean;
|
|
6
|
+
export declare function projectProductSemantics(contract: Pick<DeliveryContractV2, "task" | "global" | "outcomes">): ProductSemanticProjectionV2;
|
|
7
|
+
export declare function projectGlobalSemantics(contract: Pick<DeliveryContractV2, "global">): GlobalSemanticProjectionV2;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { normalizeContextAuthoritySnapshot } from "./long-task-context-authority.js";
|
|
2
|
+
import { canonicalValueJson, sha256Hex } from "./strict-codec.js";
|
|
3
|
+
export function computeAuthorityMaterials(contract, sourceHashes, sourceItems, contextSnapshot) {
|
|
4
|
+
return {
|
|
5
|
+
source_hashes: sortRecord(sourceHashes),
|
|
6
|
+
source_items: [...sourceItems].sort((left, right) => left.key.localeCompare(right.key)),
|
|
7
|
+
context_snapshot: normalizeContextAuthoritySnapshot(contextSnapshot),
|
|
8
|
+
product_semantics: projectProductSemantics(contract),
|
|
9
|
+
global_semantics: projectGlobalSemantics(contract),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function compiledAuthorityMaterials(compiled) {
|
|
13
|
+
const stored = compiled.authority_materials;
|
|
14
|
+
return (stored ??
|
|
15
|
+
computeAuthorityMaterials(compiled, compiled.source_hashes, compiled.source_items, compiled.context_snapshot));
|
|
16
|
+
}
|
|
17
|
+
export function authorityMaterialHashes(materials) {
|
|
18
|
+
return {
|
|
19
|
+
source_hashes_sha256: hash(materials.source_hashes),
|
|
20
|
+
context_snapshot_sha256: hash(materials.context_snapshot),
|
|
21
|
+
product_semantics_sha256: hash(materials.product_semantics),
|
|
22
|
+
global_semantics_sha256: hash(materials.global_semantics),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export function authorityMaterialsChanged(previous, next) {
|
|
26
|
+
return canonicalValueJson(previous) !== canonicalValueJson(next);
|
|
27
|
+
}
|
|
28
|
+
export function projectProductSemantics(contract) {
|
|
29
|
+
return {
|
|
30
|
+
task_goal: contract.task.goal,
|
|
31
|
+
global_non_goals: keyedStatements(contract.global.product.non_goals),
|
|
32
|
+
outcomes: [...contract.outcomes].sort(keyOrder).map((outcome) => ({
|
|
33
|
+
key: outcome.key,
|
|
34
|
+
title: outcome.title,
|
|
35
|
+
observable_result: outcome.product.observable_result,
|
|
36
|
+
owner: {
|
|
37
|
+
label: outcome.product.owner.label,
|
|
38
|
+
owner_surfaces: [...outcome.product.owner_surfaces].sort(),
|
|
39
|
+
},
|
|
40
|
+
requirements: [...outcome.product.requirements]
|
|
41
|
+
.sort(keyOrder)
|
|
42
|
+
.map((requirement) => ({
|
|
43
|
+
key: requirement.key,
|
|
44
|
+
statement: requirement.statement,
|
|
45
|
+
required_proof_surfaces: [
|
|
46
|
+
...requirement.required_proof_surfaces,
|
|
47
|
+
].sort(),
|
|
48
|
+
})),
|
|
49
|
+
controls: [...outcome.product.controls].sort(keyOrder).map((control) => ({
|
|
50
|
+
key: control.key,
|
|
51
|
+
location: control.location,
|
|
52
|
+
trigger: control.trigger,
|
|
53
|
+
input: control.input,
|
|
54
|
+
loading_state: control.loading_state,
|
|
55
|
+
empty_state: control.empty_state,
|
|
56
|
+
success_state: control.success_state,
|
|
57
|
+
failure_state: control.failure_state,
|
|
58
|
+
feedback: control.feedback,
|
|
59
|
+
})),
|
|
60
|
+
non_completing_outcomes: keyedStatements(outcome.product.non_completing_outcomes),
|
|
61
|
+
})),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export function projectGlobalSemantics(contract) {
|
|
65
|
+
return {
|
|
66
|
+
constraints: keyedStatements(contract.global.technical.constraints),
|
|
67
|
+
forbidden_shortcuts: keyedStatements(contract.global.technical.forbidden_shortcuts),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function keyedStatements(values) {
|
|
71
|
+
return [...values]
|
|
72
|
+
.sort(keyOrder)
|
|
73
|
+
.map(({ key, statement }) => ({ key, statement }));
|
|
74
|
+
}
|
|
75
|
+
function keyOrder(left, right) {
|
|
76
|
+
return left.key.localeCompare(right.key);
|
|
77
|
+
}
|
|
78
|
+
function sortRecord(value) {
|
|
79
|
+
return Object.fromEntries(Object.entries(value).sort(([left], [right]) => left.localeCompare(right)));
|
|
80
|
+
}
|
|
81
|
+
function hash(value) {
|
|
82
|
+
return sha256Hex(canonicalValueJson(value));
|
|
83
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
export type AuthorityFieldPolicy = "identity" | "semantic_user_review" | "proof_additive" | "runner_authority" | "input_coverage" | "output_requirement" | "scope" | "readiness_only" | "descriptive_non_authoritative";
|
|
2
|
+
export declare const CHECK_AUTHORITY_POLICY: {
|
|
3
|
+
key: "identity";
|
|
4
|
+
proof_surface: "semantic_user_review";
|
|
5
|
+
runner: "runner_authority";
|
|
6
|
+
verification_inputs: "proof_additive";
|
|
7
|
+
input_paths: "input_coverage";
|
|
8
|
+
expected_output_paths: "output_requirement";
|
|
9
|
+
artifact_globs: "proof_additive";
|
|
10
|
+
positive_assertions: "proof_additive";
|
|
11
|
+
negative_assertions: "proof_additive";
|
|
12
|
+
environment_requirements: "proof_additive";
|
|
13
|
+
};
|
|
14
|
+
export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
|
|
15
|
+
readonly task: {
|
|
16
|
+
id: "identity";
|
|
17
|
+
title: "descriptive_non_authoritative";
|
|
18
|
+
goal: "semantic_user_review";
|
|
19
|
+
source_paths: "scope";
|
|
20
|
+
context_refs: "scope";
|
|
21
|
+
context_snapshot_mode: "scope";
|
|
22
|
+
};
|
|
23
|
+
readonly source_claim: {
|
|
24
|
+
key: "identity";
|
|
25
|
+
source_ref: "scope";
|
|
26
|
+
statement: "semantic_user_review";
|
|
27
|
+
disposition: "semantic_user_review";
|
|
28
|
+
};
|
|
29
|
+
readonly risk: {
|
|
30
|
+
requested_level: "semantic_user_review";
|
|
31
|
+
facts: "semantic_user_review";
|
|
32
|
+
};
|
|
33
|
+
readonly global_product: {
|
|
34
|
+
non_goals: "semantic_user_review";
|
|
35
|
+
};
|
|
36
|
+
readonly global_technical: {
|
|
37
|
+
constraints: "semantic_user_review";
|
|
38
|
+
forbidden_paths: "scope";
|
|
39
|
+
forbidden_shortcuts: "semantic_user_review";
|
|
40
|
+
};
|
|
41
|
+
readonly global_acceptance: {
|
|
42
|
+
checks: "proof_additive";
|
|
43
|
+
counterfactual_controls: "proof_additive";
|
|
44
|
+
external_confirmations: "semantic_user_review";
|
|
45
|
+
};
|
|
46
|
+
readonly outcome: {
|
|
47
|
+
key: "identity";
|
|
48
|
+
title: "descriptive_non_authoritative";
|
|
49
|
+
depends_on: "readiness_only";
|
|
50
|
+
product: "semantic_user_review";
|
|
51
|
+
technical: "semantic_user_review";
|
|
52
|
+
acceptance: "proof_additive";
|
|
53
|
+
};
|
|
54
|
+
readonly outcome_product: {
|
|
55
|
+
observable_result: "semantic_user_review";
|
|
56
|
+
owner: "semantic_user_review";
|
|
57
|
+
requirements: "semantic_user_review";
|
|
58
|
+
owner_surfaces: "semantic_user_review";
|
|
59
|
+
controls: "semantic_user_review";
|
|
60
|
+
non_completing_outcomes: "semantic_user_review";
|
|
61
|
+
};
|
|
62
|
+
readonly requirement: {
|
|
63
|
+
key: "identity";
|
|
64
|
+
statement: "semantic_user_review";
|
|
65
|
+
required_proof_surfaces: "proof_additive";
|
|
66
|
+
};
|
|
67
|
+
readonly owner: {
|
|
68
|
+
label: "identity";
|
|
69
|
+
context_refs: "scope";
|
|
70
|
+
path_globs: "scope";
|
|
71
|
+
};
|
|
72
|
+
readonly control: {
|
|
73
|
+
key: "identity";
|
|
74
|
+
location: "semantic_user_review";
|
|
75
|
+
trigger: "semantic_user_review";
|
|
76
|
+
input: "semantic_user_review";
|
|
77
|
+
loading_state: "semantic_user_review";
|
|
78
|
+
empty_state: "semantic_user_review";
|
|
79
|
+
success_state: "semantic_user_review";
|
|
80
|
+
failure_state: "semantic_user_review";
|
|
81
|
+
feedback: "semantic_user_review";
|
|
82
|
+
};
|
|
83
|
+
readonly outcome_technical: {
|
|
84
|
+
obligations: "semantic_user_review";
|
|
85
|
+
expected_change_paths: "scope";
|
|
86
|
+
allowed_support_paths: "scope";
|
|
87
|
+
forbidden_paths: "scope";
|
|
88
|
+
bindings: "semantic_user_review";
|
|
89
|
+
forbidden_shortcuts: "semantic_user_review";
|
|
90
|
+
rollback_and_recovery: "semantic_user_review";
|
|
91
|
+
};
|
|
92
|
+
readonly obligation: {
|
|
93
|
+
key: "identity";
|
|
94
|
+
statement: "semantic_user_review";
|
|
95
|
+
required_proof_surfaces: "proof_additive";
|
|
96
|
+
};
|
|
97
|
+
readonly binding: {
|
|
98
|
+
key: "identity";
|
|
99
|
+
kind: "semantic_user_review";
|
|
100
|
+
target: "semantic_user_review";
|
|
101
|
+
carrier_paths: "scope";
|
|
102
|
+
existence: "semantic_user_review";
|
|
103
|
+
verification_check_key: "proof_additive";
|
|
104
|
+
};
|
|
105
|
+
readonly rollback: {
|
|
106
|
+
rollback: "semantic_user_review";
|
|
107
|
+
recovery: "semantic_user_review";
|
|
108
|
+
verification_check_keys: "proof_additive";
|
|
109
|
+
};
|
|
110
|
+
readonly outcome_acceptance: {
|
|
111
|
+
checks: "proof_additive";
|
|
112
|
+
population: "proof_additive";
|
|
113
|
+
counterfactual_controls: "proof_additive";
|
|
114
|
+
};
|
|
115
|
+
readonly check: {
|
|
116
|
+
key: "identity";
|
|
117
|
+
proof_surface: "semantic_user_review";
|
|
118
|
+
runner: "runner_authority";
|
|
119
|
+
verification_inputs: "proof_additive";
|
|
120
|
+
input_paths: "input_coverage";
|
|
121
|
+
expected_output_paths: "output_requirement";
|
|
122
|
+
artifact_globs: "proof_additive";
|
|
123
|
+
positive_assertions: "proof_additive";
|
|
124
|
+
negative_assertions: "proof_additive";
|
|
125
|
+
environment_requirements: "proof_additive";
|
|
126
|
+
};
|
|
127
|
+
readonly assertion: {
|
|
128
|
+
key: "identity";
|
|
129
|
+
criterion: "semantic_user_review";
|
|
130
|
+
claims: "proof_additive";
|
|
131
|
+
observation: "proof_additive";
|
|
132
|
+
operator: "proof_additive";
|
|
133
|
+
expected: "proof_additive";
|
|
134
|
+
};
|
|
135
|
+
readonly runner: {
|
|
136
|
+
type: "runner_authority";
|
|
137
|
+
target: "runner_authority";
|
|
138
|
+
argv: "runner_authority";
|
|
139
|
+
cwd: "runner_authority";
|
|
140
|
+
timeout_ms: "runner_authority";
|
|
141
|
+
effect: "runner_authority";
|
|
142
|
+
retry_policy: "runner_authority";
|
|
143
|
+
idempotent: "runner_authority";
|
|
144
|
+
};
|
|
145
|
+
readonly population: {
|
|
146
|
+
check_key: "proof_additive";
|
|
147
|
+
claims: "proof_additive";
|
|
148
|
+
observations: "proof_additive";
|
|
149
|
+
exclusion_rules: "proof_additive";
|
|
150
|
+
};
|
|
151
|
+
readonly counterfactual: {
|
|
152
|
+
key: "identity";
|
|
153
|
+
binding_key: "proof_additive";
|
|
154
|
+
claims: "proof_additive";
|
|
155
|
+
check_key: "proof_additive";
|
|
156
|
+
mutation: "proof_additive";
|
|
157
|
+
expected_assertion_failures: "proof_additive";
|
|
158
|
+
};
|
|
159
|
+
readonly global_counterfactual: {
|
|
160
|
+
key: "identity";
|
|
161
|
+
binding_ref: "proof_additive";
|
|
162
|
+
claims: "proof_additive";
|
|
163
|
+
check_key: "proof_additive";
|
|
164
|
+
mutation: "proof_additive";
|
|
165
|
+
expected_assertion_failures: "proof_additive";
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
export declare function projectFieldsByPolicy<T extends object>(value: T, policy: Record<keyof T, AuthorityFieldPolicy>, included: ReadonlySet<AuthorityFieldPolicy>): Partial<T>;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
const TASK_AUTHORITY_POLICY = {
|
|
2
|
+
id: "identity",
|
|
3
|
+
title: "descriptive_non_authoritative",
|
|
4
|
+
goal: "semantic_user_review",
|
|
5
|
+
source_paths: "scope",
|
|
6
|
+
context_refs: "scope",
|
|
7
|
+
context_snapshot_mode: "scope",
|
|
8
|
+
};
|
|
9
|
+
const SOURCE_CLAIM_AUTHORITY_POLICY = {
|
|
10
|
+
key: "identity",
|
|
11
|
+
source_ref: "scope",
|
|
12
|
+
statement: "semantic_user_review",
|
|
13
|
+
disposition: "semantic_user_review",
|
|
14
|
+
};
|
|
15
|
+
const RISK_AUTHORITY_POLICY = {
|
|
16
|
+
requested_level: "semantic_user_review",
|
|
17
|
+
facts: "semantic_user_review",
|
|
18
|
+
};
|
|
19
|
+
const GLOBAL_PRODUCT_AUTHORITY_POLICY = {
|
|
20
|
+
non_goals: "semantic_user_review",
|
|
21
|
+
};
|
|
22
|
+
const GLOBAL_TECHNICAL_AUTHORITY_POLICY = {
|
|
23
|
+
constraints: "semantic_user_review",
|
|
24
|
+
forbidden_paths: "scope",
|
|
25
|
+
forbidden_shortcuts: "semantic_user_review",
|
|
26
|
+
};
|
|
27
|
+
const GLOBAL_ACCEPTANCE_AUTHORITY_POLICY = {
|
|
28
|
+
checks: "proof_additive",
|
|
29
|
+
counterfactual_controls: "proof_additive",
|
|
30
|
+
external_confirmations: "semantic_user_review",
|
|
31
|
+
};
|
|
32
|
+
const OUTCOME_AUTHORITY_POLICY = {
|
|
33
|
+
key: "identity",
|
|
34
|
+
title: "descriptive_non_authoritative",
|
|
35
|
+
depends_on: "readiness_only",
|
|
36
|
+
product: "semantic_user_review",
|
|
37
|
+
technical: "semantic_user_review",
|
|
38
|
+
acceptance: "proof_additive",
|
|
39
|
+
};
|
|
40
|
+
const OUTCOME_PRODUCT_AUTHORITY_POLICY = {
|
|
41
|
+
observable_result: "semantic_user_review",
|
|
42
|
+
owner: "semantic_user_review",
|
|
43
|
+
requirements: "semantic_user_review",
|
|
44
|
+
owner_surfaces: "semantic_user_review",
|
|
45
|
+
controls: "semantic_user_review",
|
|
46
|
+
non_completing_outcomes: "semantic_user_review",
|
|
47
|
+
};
|
|
48
|
+
const REQUIREMENT_AUTHORITY_POLICY = {
|
|
49
|
+
key: "identity",
|
|
50
|
+
statement: "semantic_user_review",
|
|
51
|
+
required_proof_surfaces: "proof_additive",
|
|
52
|
+
};
|
|
53
|
+
const OWNER_AUTHORITY_POLICY = {
|
|
54
|
+
label: "identity",
|
|
55
|
+
context_refs: "scope",
|
|
56
|
+
path_globs: "scope",
|
|
57
|
+
};
|
|
58
|
+
const CONTROL_AUTHORITY_POLICY = {
|
|
59
|
+
key: "identity",
|
|
60
|
+
location: "semantic_user_review",
|
|
61
|
+
trigger: "semantic_user_review",
|
|
62
|
+
input: "semantic_user_review",
|
|
63
|
+
loading_state: "semantic_user_review",
|
|
64
|
+
empty_state: "semantic_user_review",
|
|
65
|
+
success_state: "semantic_user_review",
|
|
66
|
+
failure_state: "semantic_user_review",
|
|
67
|
+
feedback: "semantic_user_review",
|
|
68
|
+
};
|
|
69
|
+
const OUTCOME_TECHNICAL_AUTHORITY_POLICY = {
|
|
70
|
+
obligations: "semantic_user_review",
|
|
71
|
+
expected_change_paths: "scope",
|
|
72
|
+
allowed_support_paths: "scope",
|
|
73
|
+
forbidden_paths: "scope",
|
|
74
|
+
bindings: "semantic_user_review",
|
|
75
|
+
forbidden_shortcuts: "semantic_user_review",
|
|
76
|
+
rollback_and_recovery: "semantic_user_review",
|
|
77
|
+
};
|
|
78
|
+
const OBLIGATION_AUTHORITY_POLICY = {
|
|
79
|
+
key: "identity",
|
|
80
|
+
statement: "semantic_user_review",
|
|
81
|
+
required_proof_surfaces: "proof_additive",
|
|
82
|
+
};
|
|
83
|
+
const BINDING_AUTHORITY_POLICY = {
|
|
84
|
+
key: "identity",
|
|
85
|
+
kind: "semantic_user_review",
|
|
86
|
+
target: "semantic_user_review",
|
|
87
|
+
carrier_paths: "scope",
|
|
88
|
+
existence: "semantic_user_review",
|
|
89
|
+
verification_check_key: "proof_additive",
|
|
90
|
+
};
|
|
91
|
+
const ROLLBACK_AUTHORITY_POLICY = {
|
|
92
|
+
rollback: "semantic_user_review",
|
|
93
|
+
recovery: "semantic_user_review",
|
|
94
|
+
verification_check_keys: "proof_additive",
|
|
95
|
+
};
|
|
96
|
+
const OUTCOME_ACCEPTANCE_AUTHORITY_POLICY = {
|
|
97
|
+
checks: "proof_additive",
|
|
98
|
+
population: "proof_additive",
|
|
99
|
+
counterfactual_controls: "proof_additive",
|
|
100
|
+
};
|
|
101
|
+
export const CHECK_AUTHORITY_POLICY = {
|
|
102
|
+
key: "identity",
|
|
103
|
+
proof_surface: "semantic_user_review",
|
|
104
|
+
runner: "runner_authority",
|
|
105
|
+
verification_inputs: "proof_additive",
|
|
106
|
+
input_paths: "input_coverage",
|
|
107
|
+
expected_output_paths: "output_requirement",
|
|
108
|
+
artifact_globs: "proof_additive",
|
|
109
|
+
positive_assertions: "proof_additive",
|
|
110
|
+
negative_assertions: "proof_additive",
|
|
111
|
+
environment_requirements: "proof_additive",
|
|
112
|
+
};
|
|
113
|
+
const ASSERTION_AUTHORITY_POLICY = {
|
|
114
|
+
key: "identity",
|
|
115
|
+
criterion: "semantic_user_review",
|
|
116
|
+
claims: "proof_additive",
|
|
117
|
+
observation: "proof_additive",
|
|
118
|
+
operator: "proof_additive",
|
|
119
|
+
expected: "proof_additive",
|
|
120
|
+
};
|
|
121
|
+
const RUNNER_AUTHORITY_POLICY = {
|
|
122
|
+
type: "runner_authority",
|
|
123
|
+
target: "runner_authority",
|
|
124
|
+
argv: "runner_authority",
|
|
125
|
+
cwd: "runner_authority",
|
|
126
|
+
timeout_ms: "runner_authority",
|
|
127
|
+
effect: "runner_authority",
|
|
128
|
+
retry_policy: "runner_authority",
|
|
129
|
+
idempotent: "runner_authority",
|
|
130
|
+
};
|
|
131
|
+
const POPULATION_AUTHORITY_POLICY = {
|
|
132
|
+
check_key: "proof_additive",
|
|
133
|
+
claims: "proof_additive",
|
|
134
|
+
observations: "proof_additive",
|
|
135
|
+
exclusion_rules: "proof_additive",
|
|
136
|
+
};
|
|
137
|
+
const COUNTERFACTUAL_AUTHORITY_POLICY = {
|
|
138
|
+
key: "identity",
|
|
139
|
+
binding_key: "proof_additive",
|
|
140
|
+
claims: "proof_additive",
|
|
141
|
+
check_key: "proof_additive",
|
|
142
|
+
mutation: "proof_additive",
|
|
143
|
+
expected_assertion_failures: "proof_additive",
|
|
144
|
+
};
|
|
145
|
+
const GLOBAL_COUNTERFACTUAL_AUTHORITY_POLICY = {
|
|
146
|
+
key: "identity",
|
|
147
|
+
binding_ref: "proof_additive",
|
|
148
|
+
claims: "proof_additive",
|
|
149
|
+
check_key: "proof_additive",
|
|
150
|
+
mutation: "proof_additive",
|
|
151
|
+
expected_assertion_failures: "proof_additive",
|
|
152
|
+
};
|
|
153
|
+
export const AUTHORITY_FIELD_POLICY_REGISTRIES = {
|
|
154
|
+
task: TASK_AUTHORITY_POLICY,
|
|
155
|
+
source_claim: SOURCE_CLAIM_AUTHORITY_POLICY,
|
|
156
|
+
risk: RISK_AUTHORITY_POLICY,
|
|
157
|
+
global_product: GLOBAL_PRODUCT_AUTHORITY_POLICY,
|
|
158
|
+
global_technical: GLOBAL_TECHNICAL_AUTHORITY_POLICY,
|
|
159
|
+
global_acceptance: GLOBAL_ACCEPTANCE_AUTHORITY_POLICY,
|
|
160
|
+
outcome: OUTCOME_AUTHORITY_POLICY,
|
|
161
|
+
outcome_product: OUTCOME_PRODUCT_AUTHORITY_POLICY,
|
|
162
|
+
requirement: REQUIREMENT_AUTHORITY_POLICY,
|
|
163
|
+
owner: OWNER_AUTHORITY_POLICY,
|
|
164
|
+
control: CONTROL_AUTHORITY_POLICY,
|
|
165
|
+
outcome_technical: OUTCOME_TECHNICAL_AUTHORITY_POLICY,
|
|
166
|
+
obligation: OBLIGATION_AUTHORITY_POLICY,
|
|
167
|
+
binding: BINDING_AUTHORITY_POLICY,
|
|
168
|
+
rollback: ROLLBACK_AUTHORITY_POLICY,
|
|
169
|
+
outcome_acceptance: OUTCOME_ACCEPTANCE_AUTHORITY_POLICY,
|
|
170
|
+
check: CHECK_AUTHORITY_POLICY,
|
|
171
|
+
assertion: ASSERTION_AUTHORITY_POLICY,
|
|
172
|
+
runner: RUNNER_AUTHORITY_POLICY,
|
|
173
|
+
population: POPULATION_AUTHORITY_POLICY,
|
|
174
|
+
counterfactual: COUNTERFACTUAL_AUTHORITY_POLICY,
|
|
175
|
+
global_counterfactual: GLOBAL_COUNTERFACTUAL_AUTHORITY_POLICY,
|
|
176
|
+
};
|
|
177
|
+
export function projectFieldsByPolicy(value, policy, included) {
|
|
178
|
+
return Object.fromEntries(Object.keys(policy)
|
|
179
|
+
.filter((key) => included.has(policy[key]))
|
|
180
|
+
.map((key) => [key, value[key]]));
|
|
181
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CompiledCheckV2, CompiledDeliveryContractV2, CompiledOutcomeV2, DeliveryContractV2, DeliveryOutcomeV2, SourceClaimV2 } from "./long-task-delivery-types.js";
|
|
2
|
+
export declare function checkIndex(globalChecks: CompiledCheckV2[], outcomes: CompiledOutcomeV2[]): Map<string, CompiledCheckV2>;
|
|
3
|
+
export declare function changedRunnerFields(identity: string, before: CompiledCheckV2, after: CompiledCheckV2): string[];
|
|
4
|
+
export declare function removedOrReplacedVerificationInputs(identity: string, before: CompiledCheckV2, after: CompiledCheckV2): string[];
|
|
5
|
+
export declare function removedOrNarrowedInputPaths(identity: string, before: CompiledCheckV2, after: CompiledCheckV2): string[];
|
|
6
|
+
export declare function removedOrWeakenedExpectedOutputPaths(identity: string, before: CompiledCheckV2, after: CompiledCheckV2): string[];
|
|
7
|
+
export declare function sourceClaimReductions(beforeClaims: SourceClaimV2[], afterClaims: SourceClaimV2[]): string[];
|
|
8
|
+
export declare function removedGlobalForbiddenPaths(previous: CompiledDeliveryContractV2, next: DeliveryContractV2): string[];
|
|
9
|
+
export declare function bindingReductions(before: CompiledOutcomeV2, after: DeliveryOutcomeV2): string[];
|
|
10
|
+
export declare function obligationReductions(before: CompiledOutcomeV2, after: DeliveryOutcomeV2): string[];
|
|
11
|
+
export declare function rollbackReductions(before: CompiledOutcomeV2, after: DeliveryOutcomeV2): string[];
|
|
12
|
+
export declare function counterfactualReductions(before: CompiledOutcomeV2, after: DeliveryOutcomeV2): string[];
|
|
13
|
+
export declare function globalCounterfactualReductions(before: CompiledDeliveryContractV2, after: DeliveryContractV2): string[];
|
|
14
|
+
export declare function expandedPatterns(label: string, before: string[], after: string[]): string[];
|
|
15
|
+
export declare function removedExactValues(label: string, before: string[], after: string[]): string[];
|
|
16
|
+
export declare function removedStructuredValues(label: string, before: unknown[], after: unknown[]): string[];
|
|
17
|
+
export declare function removedValues(before: Set<string>, after: Set<string>): string[];
|
|
18
|
+
export declare function addedValues(before: Set<string>, after: Set<string>): string[];
|
|
19
|
+
export declare function same(left: unknown, right: unknown): boolean;
|