project-tiny-context-harness 0.2.84 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +163 -428
- package/assets/README.md +283 -455
- package/assets/README.zh-CN.md +199 -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 +62 -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 +379 -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 -157
- 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 +15 -3
- 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 -244
- package/assets/skills/composite-long-task-workflow/assets/execution-binding.template.md +0 -57
- 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 -675
- 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 -52
- package/dist/lib/superpowers-task-completion-output.js +0 -228
- 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 -382
- 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 -24
- package/dist/lib/superpowers-task-gates.d.ts +0 -12
- package/dist/lib/superpowers-task-gates.js +0 -155
- 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 -440
- 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 -290
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
export const PRODUCT_FIELDS = [
|
|
2
|
-
"delivery_scope",
|
|
3
|
-
"full_population_required",
|
|
4
|
-
"representative_samples_validate",
|
|
5
|
-
"representative_samples_do_not_validate",
|
|
6
|
-
"out_of_scope_backlog",
|
|
7
|
-
"scope_fit_decision",
|
|
8
|
-
"selected_scope_fit_slice",
|
|
9
|
-
"owner_boundary",
|
|
10
|
-
"primary_capability_path",
|
|
11
|
-
"non_completing_outcomes",
|
|
12
|
-
"assertion_policy",
|
|
13
|
-
"source_authority",
|
|
14
|
-
"product_goal",
|
|
15
|
-
"surface_ia_lock",
|
|
16
|
-
"decision_lock",
|
|
17
|
-
"context_delta",
|
|
18
|
-
"source_to_context_coverage",
|
|
19
|
-
"acceptance_semantics",
|
|
20
|
-
"impact"
|
|
21
|
-
];
|
|
22
|
-
export const PLAN_FIELDS = [
|
|
23
|
-
"delivery_scope",
|
|
24
|
-
"capability_target",
|
|
25
|
-
"representative_samples",
|
|
26
|
-
"full_population_boundary",
|
|
27
|
-
"non_required_population",
|
|
28
|
-
"owner_surfaces",
|
|
29
|
-
"forbidden_surfaces",
|
|
30
|
-
"owner_boundary",
|
|
31
|
-
"primary_capability_path",
|
|
32
|
-
"trigger_contract",
|
|
33
|
-
"state_transition_contract",
|
|
34
|
-
"observable_result_contract",
|
|
35
|
-
"assertion_support",
|
|
36
|
-
"required_assertion_commands",
|
|
37
|
-
"invalid_implementation_shortcuts",
|
|
38
|
-
"implementation_paths",
|
|
39
|
-
"required_tests",
|
|
40
|
-
"related_acs",
|
|
41
|
-
"requirement_ref",
|
|
42
|
-
"decision_id",
|
|
43
|
-
"proof_layer_ids",
|
|
44
|
-
"api_schema_changes",
|
|
45
|
-
"state_machine",
|
|
46
|
-
"data_flow",
|
|
47
|
-
"worker_runtime_behavior",
|
|
48
|
-
"ui_ia_changes",
|
|
49
|
-
"migration_plan",
|
|
50
|
-
"evidence_artifacts",
|
|
51
|
-
"explicit_no_test_scope",
|
|
52
|
-
"non_completing_shortcuts",
|
|
53
|
-
"substitution_policy",
|
|
54
|
-
"drift_severity",
|
|
55
|
-
"partial_conditions",
|
|
56
|
-
"blockers",
|
|
57
|
-
"context_fact_refs"
|
|
58
|
-
];
|
|
59
|
-
export const ACCEPTANCE_FIELDS = [
|
|
60
|
-
"acceptance_scope",
|
|
61
|
-
"ac_validates",
|
|
62
|
-
"ac_does_not_validate",
|
|
63
|
-
"sample_boundary",
|
|
64
|
-
"full_population_required",
|
|
65
|
-
"related_plan_items",
|
|
66
|
-
"required_proof_layers",
|
|
67
|
-
"assertion_command",
|
|
68
|
-
"assertion_artifacts",
|
|
69
|
-
"positive_assertions",
|
|
70
|
-
"negative_assertions",
|
|
71
|
-
"machine_blocking",
|
|
72
|
-
"invalid_completion_signals",
|
|
73
|
-
"assertion_result_required",
|
|
74
|
-
"ac_type",
|
|
75
|
-
"proof_chain",
|
|
76
|
-
"verification_method",
|
|
77
|
-
"fail_conditions",
|
|
78
|
-
"invalid_evidence",
|
|
79
|
-
"substitution_policy",
|
|
80
|
-
"missing_layer_downgrade",
|
|
81
|
-
"auditor_expectation",
|
|
82
|
-
"out_of_scope_na_approval_source",
|
|
83
|
-
"required_test_ids",
|
|
84
|
-
"explicit_no_test_scope",
|
|
85
|
-
"hard_blockers",
|
|
86
|
-
"validates_explanation",
|
|
87
|
-
"does_not_validate_explanation",
|
|
88
|
-
"final_evidence_expected",
|
|
89
|
-
"test_cases"
|
|
90
|
-
];
|
|
91
|
-
export const PRODUCT_REQUIRED_FIELDS = [
|
|
92
|
-
"delivery_scope",
|
|
93
|
-
"full_population_required",
|
|
94
|
-
"representative_samples_validate",
|
|
95
|
-
"representative_samples_do_not_validate",
|
|
96
|
-
"out_of_scope_backlog",
|
|
97
|
-
"scope_fit_decision",
|
|
98
|
-
"selected_scope_fit_slice",
|
|
99
|
-
"owner_boundary",
|
|
100
|
-
"primary_capability_path",
|
|
101
|
-
"non_completing_outcomes",
|
|
102
|
-
"assertion_policy",
|
|
103
|
-
"source_authority",
|
|
104
|
-
"product_goal"
|
|
105
|
-
];
|
|
106
|
-
export const PLAN_REQUIRED_FIELDS = [
|
|
107
|
-
"delivery_scope",
|
|
108
|
-
"capability_target",
|
|
109
|
-
"representative_samples",
|
|
110
|
-
"full_population_boundary",
|
|
111
|
-
"non_required_population",
|
|
112
|
-
"owner_boundary",
|
|
113
|
-
"primary_capability_path",
|
|
114
|
-
"trigger_contract",
|
|
115
|
-
"state_transition_contract",
|
|
116
|
-
"observable_result_contract",
|
|
117
|
-
"assertion_support",
|
|
118
|
-
"required_assertion_commands",
|
|
119
|
-
"invalid_implementation_shortcuts",
|
|
120
|
-
"implementation_paths"
|
|
121
|
-
];
|
|
122
|
-
export const ACCEPTANCE_REQUIRED_FIELDS = [
|
|
123
|
-
"acceptance_scope",
|
|
124
|
-
"ac_validates",
|
|
125
|
-
"ac_does_not_validate",
|
|
126
|
-
"sample_boundary",
|
|
127
|
-
"full_population_required",
|
|
128
|
-
"related_plan_items",
|
|
129
|
-
"required_proof_layers",
|
|
130
|
-
"assertion_command",
|
|
131
|
-
"assertion_artifacts",
|
|
132
|
-
"positive_assertions",
|
|
133
|
-
"negative_assertions",
|
|
134
|
-
"machine_blocking",
|
|
135
|
-
"invalid_completion_signals",
|
|
136
|
-
"assertion_result_required"
|
|
137
|
-
];
|
|
138
|
-
export const PRODUCT_FIELD_TYPES = {
|
|
139
|
-
delivery_scope: "enum",
|
|
140
|
-
full_population_required: "boolean",
|
|
141
|
-
representative_samples_validate: "array",
|
|
142
|
-
representative_samples_do_not_validate: "array",
|
|
143
|
-
out_of_scope_backlog: "array",
|
|
144
|
-
scope_fit_decision: "enum",
|
|
145
|
-
selected_scope_fit_slice: "text",
|
|
146
|
-
owner_boundary: "text",
|
|
147
|
-
primary_capability_path: "text",
|
|
148
|
-
non_completing_outcomes: "array",
|
|
149
|
-
assertion_policy: "text",
|
|
150
|
-
source_authority: "text",
|
|
151
|
-
product_goal: "text",
|
|
152
|
-
surface_ia_lock: "text",
|
|
153
|
-
decision_lock: "text",
|
|
154
|
-
context_delta: "text",
|
|
155
|
-
source_to_context_coverage: "text",
|
|
156
|
-
acceptance_semantics: "text",
|
|
157
|
-
impact: "text"
|
|
158
|
-
};
|
|
159
|
-
export const PLAN_FIELD_TYPES = {
|
|
160
|
-
delivery_scope: "enum",
|
|
161
|
-
capability_target: "text",
|
|
162
|
-
representative_samples: "array",
|
|
163
|
-
full_population_boundary: "text",
|
|
164
|
-
non_required_population: "array",
|
|
165
|
-
owner_surfaces: "array",
|
|
166
|
-
forbidden_surfaces: "array",
|
|
167
|
-
owner_boundary: "text",
|
|
168
|
-
primary_capability_path: "text",
|
|
169
|
-
trigger_contract: "text",
|
|
170
|
-
state_transition_contract: "text",
|
|
171
|
-
observable_result_contract: "text",
|
|
172
|
-
assertion_support: "text",
|
|
173
|
-
required_assertion_commands: "array",
|
|
174
|
-
invalid_implementation_shortcuts: "array",
|
|
175
|
-
implementation_paths: "array",
|
|
176
|
-
required_tests: "array",
|
|
177
|
-
related_acs: "array",
|
|
178
|
-
requirement_ref: "text",
|
|
179
|
-
decision_id: "text",
|
|
180
|
-
proof_layer_ids: "array",
|
|
181
|
-
api_schema_changes: "text",
|
|
182
|
-
state_machine: "text",
|
|
183
|
-
data_flow: "text",
|
|
184
|
-
worker_runtime_behavior: "text",
|
|
185
|
-
ui_ia_changes: "text",
|
|
186
|
-
migration_plan: "text",
|
|
187
|
-
evidence_artifacts: "array",
|
|
188
|
-
explicit_no_test_scope: "boolean",
|
|
189
|
-
non_completing_shortcuts: "array",
|
|
190
|
-
substitution_policy: "array",
|
|
191
|
-
drift_severity: "text",
|
|
192
|
-
partial_conditions: "array",
|
|
193
|
-
blockers: "array",
|
|
194
|
-
context_fact_refs: "array"
|
|
195
|
-
};
|
|
196
|
-
export const ACCEPTANCE_FIELD_TYPES = {
|
|
197
|
-
acceptance_scope: "enum",
|
|
198
|
-
ac_validates: "array",
|
|
199
|
-
ac_does_not_validate: "array",
|
|
200
|
-
sample_boundary: "text",
|
|
201
|
-
full_population_required: "boolean",
|
|
202
|
-
related_plan_items: "array",
|
|
203
|
-
required_proof_layers: "array",
|
|
204
|
-
assertion_command: "text",
|
|
205
|
-
assertion_artifacts: "array",
|
|
206
|
-
positive_assertions: "array",
|
|
207
|
-
negative_assertions: "array",
|
|
208
|
-
machine_blocking: "boolean",
|
|
209
|
-
invalid_completion_signals: "array",
|
|
210
|
-
assertion_result_required: "boolean",
|
|
211
|
-
ac_type: "text",
|
|
212
|
-
proof_chain: "array",
|
|
213
|
-
verification_method: "array",
|
|
214
|
-
fail_conditions: "array",
|
|
215
|
-
invalid_evidence: "array",
|
|
216
|
-
substitution_policy: "array",
|
|
217
|
-
missing_layer_downgrade: "text",
|
|
218
|
-
auditor_expectation: "text",
|
|
219
|
-
out_of_scope_na_approval_source: "text",
|
|
220
|
-
required_test_ids: "array",
|
|
221
|
-
explicit_no_test_scope: "boolean",
|
|
222
|
-
hard_blockers: "array",
|
|
223
|
-
validates_explanation: "text",
|
|
224
|
-
does_not_validate_explanation: "text",
|
|
225
|
-
final_evidence_expected: "array",
|
|
226
|
-
test_cases: "array"
|
|
227
|
-
};
|
|
228
|
-
export const PRODUCT_DELIVERY_SCOPES = new Set([
|
|
229
|
-
"system_capability_build", "representative_sample_validation", "full_population_operation", "mixed_scope_requires_boundary"
|
|
230
|
-
]);
|
|
231
|
-
export const PLAN_DELIVERY_SCOPES = new Set([
|
|
232
|
-
"system_capability_build", "representative_sample_validation", "full_population_operation", "out_of_scope_backlog"
|
|
233
|
-
]);
|
|
234
|
-
export const ACCEPTANCE_SCOPES = new Set([
|
|
235
|
-
"system_capability_build", "representative_sample_validation", "full_population_operation", "full_population_not_required"
|
|
236
|
-
]);
|
|
237
|
-
export const SCOPE_FIT_DECISIONS = new Set(["fit_for_three_inputs", "selected_from_split", "blocked_for_decision"]);
|
|
238
|
-
export const CANONICAL_PROOF_LAYERS = [
|
|
239
|
-
"code",
|
|
240
|
-
"api_schema",
|
|
241
|
-
"worker_runtime",
|
|
242
|
-
"data_artifact",
|
|
243
|
-
"integration",
|
|
244
|
-
"ui_browser",
|
|
245
|
-
"security_redaction",
|
|
246
|
-
"all_provider_all_runner",
|
|
247
|
-
"cleanup_stale_scan",
|
|
248
|
-
"test"
|
|
249
|
-
];
|
|
250
|
-
export const LEGACY_PROOF_LAYER_ALIASES = {
|
|
251
|
-
runtime: "worker_runtime",
|
|
252
|
-
browser: "ui_browser",
|
|
253
|
-
api: "api_schema",
|
|
254
|
-
data: "data_artifact",
|
|
255
|
-
security: "security_redaction"
|
|
256
|
-
};
|
|
257
|
-
export const MACHINE_VERIFIABLE_LAYER_NAMES = new Set(CANONICAL_PROOF_LAYERS.filter((layer) => layer !== "code"));
|
|
258
|
-
export function fieldSet(fields) {
|
|
259
|
-
return new Set(fields);
|
|
260
|
-
}
|
|
261
|
-
export function normalizeProofLayerName(layer) {
|
|
262
|
-
const normalized = layer.trim().toLowerCase().replace(/[- ]+/g, "_");
|
|
263
|
-
return LEGACY_PROOF_LAYER_ALIASES[normalized] ?? normalized;
|
|
264
|
-
}
|
|
265
|
-
export function normalizeProofLayerId(layerId) {
|
|
266
|
-
const value = layerId.trim();
|
|
267
|
-
if (!value.includes(".")) {
|
|
268
|
-
return normalizeProofLayerName(value);
|
|
269
|
-
}
|
|
270
|
-
const acId = value.slice(0, value.lastIndexOf("."));
|
|
271
|
-
const layer = value.slice(value.lastIndexOf(".") + 1);
|
|
272
|
-
return `${acId}.${normalizeProofLayerName(layer)}`;
|
|
273
|
-
}
|
|
274
|
-
export function isSelectedScopeFitSlice(value) {
|
|
275
|
-
return value === "none" || /^SFC-\d{3,}$/i.test(value);
|
|
276
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { type CompletionOutputContract } from "./superpowers-task-completion-output.js";
|
|
2
|
-
import { type SuperpowersTaskState } from "./superpowers-task-state-schema.js";
|
|
3
|
-
export declare function renderFinalCard(contract: CompletionOutputContract, state: SuperpowersTaskState): string;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export function renderFinalCard(contract, state) {
|
|
2
|
-
const reasons = contract.completion_output_status === "blocked" ? contract.blocked_reasons : contract.rejection_reasons;
|
|
3
|
-
const reasonBlock = reasons.length > 0 ? reasons.map((reason) => `- ${reason}`).join("\n") : "- none";
|
|
4
|
-
const gate = contract.completion_output_status === "accept" ? "Final answer: accept" : `Final answer: ${contract.completion_output_status}`;
|
|
5
|
-
const auditLine = contract.completion_output_status === "accept"
|
|
6
|
-
? "Final-gate accepted the current attempt."
|
|
7
|
-
: "Audit workflow completed; acceptance target not complete.";
|
|
8
|
-
return `# Final Card
|
|
9
|
-
|
|
10
|
-
completion_output_status: ${contract.completion_output_status}
|
|
11
|
-
${gate}
|
|
12
|
-
required_user_visible_status: ${contract.required_user_visible_status}
|
|
13
|
-
final_answer_allowed: ${contract.final_answer_allowed}
|
|
14
|
-
exit_code: ${contract.exit_code}
|
|
15
|
-
product_goal_complete: ${contract.product_goal_complete}
|
|
16
|
-
acceptance_target_status: ${contract.acceptance_target_status}
|
|
17
|
-
audit_task_complete: ${state.final.audit_task_complete}
|
|
18
|
-
|
|
19
|
-
${auditLine}
|
|
20
|
-
|
|
21
|
-
Reasons:
|
|
22
|
-
${reasonBlock}
|
|
23
|
-
`;
|
|
24
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type CompletionOutputContract } from "./superpowers-task-completion-output.js";
|
|
2
|
-
export declare function runSliceGate(workdir: string, sliceId: string): Promise<{
|
|
3
|
-
passed: boolean;
|
|
4
|
-
messages: string[];
|
|
5
|
-
}>;
|
|
6
|
-
export declare function runEpochGate(workdir: string, epochId: string): Promise<{
|
|
7
|
-
passed: boolean;
|
|
8
|
-
messages: string[];
|
|
9
|
-
}>;
|
|
10
|
-
export declare function runFinalGate(workdir: string): Promise<CompletionOutputContract & {
|
|
11
|
-
errors: string[];
|
|
12
|
-
}>;
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { appendSuperpowersEvent } from "./superpowers-task-events.js";
|
|
2
|
-
import { deriveSuperpowersArtifacts } from "./superpowers-task-derive.js";
|
|
3
|
-
import { validatePlanAcceptance } from "./plan-acceptance-validator.js";
|
|
4
|
-
import { loadSuperpowersState, saveSuperpowersState } from "./superpowers-task-state.js";
|
|
5
|
-
import { applyCompletionOutputContract, completionPhraseFindingMessages, resolveCompletionOutputStatus, scanGeneratedCompletionOutputSurfaces } from "./superpowers-task-completion-output.js";
|
|
6
|
-
import { applyTrustedEvidenceKernelResult, evaluateTrustedEvidenceKernel } from "./superpowers-task-evidence-kernel.js";
|
|
7
|
-
import { isRecord } from "./superpowers-task-state-schema.js";
|
|
8
|
-
import { validateSuperpowersState } from "./superpowers-task-validator.js";
|
|
9
|
-
export async function runSliceGate(workdir, sliceId) {
|
|
10
|
-
const state = await loadSuperpowersState(workdir);
|
|
11
|
-
const slice = state.slices.find((item) => item.slice_id === sliceId);
|
|
12
|
-
const messages = [];
|
|
13
|
-
if (!slice) {
|
|
14
|
-
messages.push(`slice not found: ${sliceId}`);
|
|
15
|
-
}
|
|
16
|
-
else if (!slice.progress_value?.type || slice.progress_value.closed_items.length === 0) {
|
|
17
|
-
messages.push(`slice ${sliceId} has no progress_value`);
|
|
18
|
-
}
|
|
19
|
-
await deriveSuperpowersArtifacts(workdir);
|
|
20
|
-
await appendSuperpowersEvent(workdir, "slice_gate", { slice_id: sliceId, passed: messages.length === 0 });
|
|
21
|
-
return { passed: messages.length === 0, messages };
|
|
22
|
-
}
|
|
23
|
-
export async function runEpochGate(workdir, epochId) {
|
|
24
|
-
await deriveSuperpowersArtifacts(workdir);
|
|
25
|
-
await appendSuperpowersEvent(workdir, "epoch_gate", { epoch_id: epochId, passed: true });
|
|
26
|
-
return { passed: true, messages: ["epoch derived artifacts refreshed"] };
|
|
27
|
-
}
|
|
28
|
-
export async function runFinalGate(workdir) {
|
|
29
|
-
const state = await loadSuperpowersState(workdir);
|
|
30
|
-
const kernel = await evaluateTrustedEvidenceKernel(workdir, state);
|
|
31
|
-
applyTrustedEvidenceKernelResult(state, kernel);
|
|
32
|
-
state.gates.validator = { status: "not_run", kernel: "trusted_evidence_kernel" };
|
|
33
|
-
await saveSuperpowersState(workdir, state);
|
|
34
|
-
await deriveSuperpowersArtifacts(workdir);
|
|
35
|
-
const report = await validateSuperpowersState(workdir, [workdir]);
|
|
36
|
-
const acceptanceReport = await validatePlanAcceptance(workdir, [workdir]);
|
|
37
|
-
const latest = await loadSuperpowersState(workdir);
|
|
38
|
-
let errors = [...new Set([...kernel.errors, ...report.errors, ...acceptanceReport.errors])];
|
|
39
|
-
let complete = kernel.product_goal_complete && errors.length === 0;
|
|
40
|
-
const acceptanceStatus = complete ? "complete" : acceptanceStatusForErrors(errors, kernel);
|
|
41
|
-
const nextRequiredActions = complete ? [] : nextActionsForErrors(errors);
|
|
42
|
-
let contract = resolveCompletionOutputStatus({
|
|
43
|
-
final_gate_ran: true,
|
|
44
|
-
product_goal_complete: complete,
|
|
45
|
-
acceptance_target_status: acceptanceStatus,
|
|
46
|
-
audit_task_complete: true,
|
|
47
|
-
validator_errors: report.errors,
|
|
48
|
-
acceptance_validator_errors: acceptanceReport.errors,
|
|
49
|
-
rejection_reasons: complete ? [] : nextRequiredActions
|
|
50
|
-
});
|
|
51
|
-
applyCompletionOutputContract(latest, contract);
|
|
52
|
-
latest.final.completion_basis = complete
|
|
53
|
-
? ["trusted_evidence_kernel", "current_attempt_evidence", "negative_evidence_scan_passed", "harness_drift_lock_passed"]
|
|
54
|
-
: [];
|
|
55
|
-
latest.final.next_required_actions = nextRequiredActions;
|
|
56
|
-
latest.gates.validator = { status: errors.length === 0 ? "pass" : "blocked", errors };
|
|
57
|
-
latest.gates.final_gate = {
|
|
58
|
-
status: complete ? "pass" : acceptanceStatus,
|
|
59
|
-
kernel: "trusted_evidence_kernel",
|
|
60
|
-
order: kernel.kernel_order,
|
|
61
|
-
errors,
|
|
62
|
-
stale_evidence_ids: kernel.stale_evidence_ids,
|
|
63
|
-
ignored_unregistered_evidence: kernel.ignored_unregistered_evidence,
|
|
64
|
-
invalidated_evidence_ids: kernel.invalidated_evidence_ids,
|
|
65
|
-
ac_findings: kernel.ac_findings,
|
|
66
|
-
pi_findings: kernel.pi_findings,
|
|
67
|
-
harness_task_final_verdict: kernel.harness_task_final_verdict,
|
|
68
|
-
next_required_actions: nextRequiredActions,
|
|
69
|
-
completion_output_status: contract.completion_output_status,
|
|
70
|
-
final_answer_allowed: contract.final_answer_allowed,
|
|
71
|
-
required_user_visible_status: contract.required_user_visible_status,
|
|
72
|
-
exit_code: contract.exit_code,
|
|
73
|
-
blocked_reasons: contract.blocked_reasons,
|
|
74
|
-
rejection_reasons: contract.rejection_reasons,
|
|
75
|
-
generated_output_mismatch: contract.generated_output_mismatch
|
|
76
|
-
};
|
|
77
|
-
await saveSuperpowersState(workdir, latest);
|
|
78
|
-
await deriveSuperpowersArtifacts(workdir);
|
|
79
|
-
const outputFindings = await scanGeneratedCompletionOutputSurfaces(workdir, contract);
|
|
80
|
-
if (outputFindings.length > 0) {
|
|
81
|
-
errors = [...new Set([...errors, ...completionPhraseFindingMessages(outputFindings)])];
|
|
82
|
-
complete = false;
|
|
83
|
-
contract = resolveCompletionOutputStatus({
|
|
84
|
-
final_gate_ran: true,
|
|
85
|
-
product_goal_complete: false,
|
|
86
|
-
acceptance_target_status: acceptanceStatusForErrors(errors, kernel),
|
|
87
|
-
audit_task_complete: true,
|
|
88
|
-
validator_errors: errors,
|
|
89
|
-
generated_output_mismatch: true
|
|
90
|
-
});
|
|
91
|
-
const blockedLatest = await loadSuperpowersState(workdir);
|
|
92
|
-
applyCompletionOutputContract(blockedLatest, contract);
|
|
93
|
-
blockedLatest.final.completion_basis = [];
|
|
94
|
-
blockedLatest.final.next_required_actions = nextActionsForErrors(errors);
|
|
95
|
-
blockedLatest.gates.validator = { status: "blocked", errors };
|
|
96
|
-
blockedLatest.gates.final_gate = {
|
|
97
|
-
...(isRecord(blockedLatest.gates.final_gate) ? blockedLatest.gates.final_gate : {}),
|
|
98
|
-
status: contract.completion_output_status,
|
|
99
|
-
errors,
|
|
100
|
-
next_required_actions: blockedLatest.final.next_required_actions,
|
|
101
|
-
completion_output_status: contract.completion_output_status,
|
|
102
|
-
final_answer_allowed: contract.final_answer_allowed,
|
|
103
|
-
required_user_visible_status: contract.required_user_visible_status,
|
|
104
|
-
exit_code: contract.exit_code,
|
|
105
|
-
blocked_reasons: contract.blocked_reasons,
|
|
106
|
-
rejection_reasons: contract.rejection_reasons,
|
|
107
|
-
generated_output_mismatch: contract.generated_output_mismatch,
|
|
108
|
-
false_completion_phrase_findings: outputFindings
|
|
109
|
-
};
|
|
110
|
-
blockedLatest.final.false_completion_phrase_findings = outputFindings;
|
|
111
|
-
await saveSuperpowersState(workdir, blockedLatest);
|
|
112
|
-
await deriveSuperpowersArtifacts(workdir);
|
|
113
|
-
}
|
|
114
|
-
await appendSuperpowersEvent(workdir, "final_gate", {
|
|
115
|
-
product_goal_complete: contract.product_goal_complete,
|
|
116
|
-
completion_output_status: contract.completion_output_status
|
|
117
|
-
});
|
|
118
|
-
return { ...contract, errors };
|
|
119
|
-
}
|
|
120
|
-
function acceptanceStatusForErrors(errors, kernel) {
|
|
121
|
-
const text = errors.join("\n");
|
|
122
|
-
if (kernel?.acceptance_target_status === "under_specified" || /under_specified/i.test(text)) {
|
|
123
|
-
return "under_specified";
|
|
124
|
-
}
|
|
125
|
-
if (/source hash mismatch|source_changed_requires_recompile|scope_conflict_requires_decision|auditor blocker|Context Delta coverage is unresolved|harness_drift|protected_baseline|harness_task_missing|required_command_specs_hash/i.test(text)) {
|
|
126
|
-
return "blocked";
|
|
127
|
-
}
|
|
128
|
-
if (/invalid evidence|forbidden shortcut|negative evidence|stale evidence|raw secret|contains_secret|sibling substitution|assertion_result\.status=failed|assertion exit_code=|command_exit_code=|forbidden text|current contradiction|workflow_gate_bug_prevented|playwright_last_run_failed|owner_dom_forbidden_state|failed_test_result_artifact/i.test(text)) {
|
|
129
|
-
return "invalidated";
|
|
130
|
-
}
|
|
131
|
-
return "partial";
|
|
132
|
-
}
|
|
133
|
-
function nextActionsForErrors(errors) {
|
|
134
|
-
return errors.slice(0, 12).map((error) => {
|
|
135
|
-
if (/source hash mismatch/i.test(error)) {
|
|
136
|
-
return `${error}; rerun ty-context composite-long-task compile <workdir> after approving source changes`;
|
|
137
|
-
}
|
|
138
|
-
if (/scope_conflict_requires_decision/i.test(error)) {
|
|
139
|
-
return `${error}; clarify Product / Plan / Checklist delivery scope before more implementation`;
|
|
140
|
-
}
|
|
141
|
-
if (/missing assertion result|not machine-backed/i.test(error)) {
|
|
142
|
-
return `${error}; add assertion_result evidence for the target AC/proof layer`;
|
|
143
|
-
}
|
|
144
|
-
if (/negative evidence|forbidden/i.test(error)) {
|
|
145
|
-
return `${error}; rerun the negative evidence scan and fix the contradictory owner-surface state`;
|
|
146
|
-
}
|
|
147
|
-
if (/current contradiction|playwright_last_run_failed|owner_dom_forbidden_state|failed_test_result_artifact/i.test(error)) {
|
|
148
|
-
return `${error}; rerun the required current assertion command after fixing the current failure`;
|
|
149
|
-
}
|
|
150
|
-
if (/derived\/.*does not match/i.test(error)) {
|
|
151
|
-
return `${error}; rerun ty-context composite-long-task derive <workdir>`;
|
|
152
|
-
}
|
|
153
|
-
return error;
|
|
154
|
-
});
|
|
155
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type SuperpowersTaskState } from "./superpowers-task-state-schema.js";
|
|
2
|
-
export interface HarnessDriftResult {
|
|
3
|
-
harness_drift_detected: boolean;
|
|
4
|
-
acceptance_target_status: "complete" | "partial" | "blocked";
|
|
5
|
-
product_goal_complete: boolean;
|
|
6
|
-
harness_task_final_verdict?: "passed" | "failed";
|
|
7
|
-
changed_files: string[];
|
|
8
|
-
errors: string[];
|
|
9
|
-
}
|
|
10
|
-
export declare function detectHarnessDrift(state: SuperpowersTaskState): HarnessDriftResult;
|
|
11
|
-
export declare function isHarnessPath(file: string): boolean;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { isRecord } from "./superpowers-task-state-schema.js";
|
|
2
|
-
const HARNESS_PATH_PATTERNS = [
|
|
3
|
-
/(^|\/)tests\/.*\.(spec|test)\.[cm]?[jt]sx?$/i,
|
|
4
|
-
/(^|\/)playwright\.config\./i,
|
|
5
|
-
/(^|\/).*\.spec\.[cm]?[jt]sx?$/i,
|
|
6
|
-
/(^|\/).*\.test\.[cm]?[jt]sx?$/i,
|
|
7
|
-
/(^|\/)tests\/ty-context\/fixtures\/composite-long-task\//i,
|
|
8
|
-
/superpowers-task-(assertions|evidence|evidence-kernel|current-evidence|command-specs|command-run-correlation|unregistered-evidence|completion-output|final-card|ac010|gates|validator|derive|state|state-schema|state-shape|under-specified|protected-baseline|harness-drift)\.ts$/i,
|
|
9
|
-
/(^|\/)(\.codex\/ty-context-managed|packages\/ty-context\/assets)\/skills\/composite-long-task-workflow\//i,
|
|
10
|
-
/composite-long-task-workflow-protocol\.md$/i,
|
|
11
|
-
/(^|\/)Makefile$/i,
|
|
12
|
-
/(^|\/)package\.json$/i
|
|
13
|
-
];
|
|
14
|
-
const REQUIRED_NEGATIVE_FIXTURES = [
|
|
15
|
-
"stale_evidence",
|
|
16
|
-
"historical_complete",
|
|
17
|
-
"derived_contradiction",
|
|
18
|
-
"ac010_summary_only",
|
|
19
|
-
"target_mismatch",
|
|
20
|
-
"api_only_for_ui",
|
|
21
|
-
"negative_evidence_after_pass",
|
|
22
|
-
"source_hash_mismatch",
|
|
23
|
-
"dirty_worktree_mismatch",
|
|
24
|
-
"missing_assertion_result",
|
|
25
|
-
"test_weakening"
|
|
26
|
-
];
|
|
27
|
-
export function detectHarnessDrift(state) {
|
|
28
|
-
const attempt = currentAttempt(state);
|
|
29
|
-
const changedFiles = changedFilesFor(attempt);
|
|
30
|
-
const harnessFiles = changedFiles.filter(isHarnessPath);
|
|
31
|
-
const mode = attempt?.mode ?? "product_task";
|
|
32
|
-
if (mode === "product_task" && harnessFiles.length > 0) {
|
|
33
|
-
return {
|
|
34
|
-
harness_drift_detected: true,
|
|
35
|
-
acceptance_target_status: "blocked",
|
|
36
|
-
product_goal_complete: false,
|
|
37
|
-
changed_files: harnessFiles,
|
|
38
|
-
errors: [
|
|
39
|
-
`harness_drift_detected: ${harnessFiles.join(", ")}`,
|
|
40
|
-
"本轮修改了验收工具链或测试本身,不能用被修改后的验收证明同一轮产品完成。请拆成独立 harness_task。"
|
|
41
|
-
]
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
if (mode === "harness_task") {
|
|
45
|
-
return harnessTaskFixtureVerdict(state, changedFiles);
|
|
46
|
-
}
|
|
47
|
-
return { harness_drift_detected: false, acceptance_target_status: "complete", product_goal_complete: true, changed_files: [], errors: [] };
|
|
48
|
-
}
|
|
49
|
-
export function isHarnessPath(file) {
|
|
50
|
-
const normalized = file.replace(/\\/g, "/");
|
|
51
|
-
return HARNESS_PATH_PATTERNS.some((pattern) => pattern.test(normalized));
|
|
52
|
-
}
|
|
53
|
-
function harnessTaskFixtureVerdict(state, changedFiles) {
|
|
54
|
-
const fixtureState = isRecord(state.gates?.harness_task_fixtures) ? state.gates.harness_task_fixtures : undefined;
|
|
55
|
-
const errors = [];
|
|
56
|
-
if (!fixtureState) {
|
|
57
|
-
errors.push("harness_task_missing_adversarial_fixtures: harness_task must declare adversarial fixture outcomes");
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
for (const fixture of REQUIRED_NEGATIVE_FIXTURES) {
|
|
61
|
-
if (fixtureState[fixture] !== false) {
|
|
62
|
-
errors.push(`harness_task_missing_adversarial_fixtures: ${fixture} must have expected product_goal_complete=false`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
if (fixtureState.happy_path !== true) {
|
|
66
|
-
errors.push("harness_task_missing_happy_path_fixture: happy_path must have expected product_goal_complete=true");
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
const fixtureChanges = changedFiles.filter((file) => /(^|\/)tests\/ty-context\/.*fixture/i.test(file.replace(/\\/g, "/")));
|
|
70
|
-
if (fixtureChanges.length > 0) {
|
|
71
|
-
errors.push(`fixture_changed_requires_review: ${fixtureChanges.join(", ")}`);
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
harness_drift_detected: false,
|
|
75
|
-
acceptance_target_status: errors.length > 0 ? "blocked" : "complete",
|
|
76
|
-
product_goal_complete: false,
|
|
77
|
-
harness_task_final_verdict: errors.length > 0 ? "failed" : "passed",
|
|
78
|
-
changed_files: changedFiles,
|
|
79
|
-
errors
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
function currentAttempt(state) {
|
|
83
|
-
if (!state.current_attempt_id) {
|
|
84
|
-
return undefined;
|
|
85
|
-
}
|
|
86
|
-
return (state.attempts ?? []).find((item) => item.task_attempt_id === state.current_attempt_id);
|
|
87
|
-
}
|
|
88
|
-
function changedFilesFor(attempt) {
|
|
89
|
-
return [...new Set((attempt?.changed_files ?? []).map((file) => file.replace(/\\/g, "/")).filter(Boolean))];
|
|
90
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function nextSuperpowersSlices(workdir: string, limit?: number): Promise<string[]>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { loadSuperpowersState } from "./superpowers-task-state.js";
|
|
2
|
-
export async function nextSuperpowersSlices(workdir, limit = 5) {
|
|
3
|
-
const state = await loadSuperpowersState(workdir);
|
|
4
|
-
return Object.entries(state.graph.proof_layers)
|
|
5
|
-
.filter(([, layer]) => layer.required && layer.status !== "satisfied")
|
|
6
|
-
.slice(0, limit)
|
|
7
|
-
.map(([layerId], index) => {
|
|
8
|
-
const acId = layerId.split(".")[0];
|
|
9
|
-
const planId = Object.entries(state.graph.plan_items).find(([, item]) => item.related_acs.includes(acId))?.[0] ?? "PI";
|
|
10
|
-
return `${index + 1}. ${planId}/${acId}: close ${layerId}`;
|
|
11
|
-
});
|
|
12
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type SuperpowersTaskState } from "./superpowers-task-state-schema.js";
|
|
2
|
-
export interface ProtectedBaselineResult {
|
|
3
|
-
protected_baseline_changed: boolean;
|
|
4
|
-
product_goal_complete: boolean;
|
|
5
|
-
changed_files: string[];
|
|
6
|
-
errors: string[];
|
|
7
|
-
}
|
|
8
|
-
export declare const PROTECTED_BASELINE_PATHS: string[];
|
|
9
|
-
export declare function evaluateProtectedBaseline(state: SuperpowersTaskState): ProtectedBaselineResult;
|
|
10
|
-
export declare function isProtectedBaselinePath(file: string): boolean;
|