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,246 +0,0 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { ensureDir, pathExists, readText, writeTextIfChanged } from "./fs.js";
|
|
4
|
-
import { normalizeProofLayerId } from "./superpowers-task-fields.js";
|
|
5
|
-
import { appendSuperpowersEvent } from "./superpowers-task-events.js";
|
|
6
|
-
import { evaluateProofLayerAssertions, isMachineVerifiableLayer } from "./superpowers-task-assertions.js";
|
|
7
|
-
import { readEvidenceRecords } from "./superpowers-task-evidence-records.js";
|
|
8
|
-
import { SUPERPOWERS_TASK_STATE_JSON_SCHEMA, SUPERPOWERS_TASK_STATE_SCHEMA_VERSION, asStringArray, isRecord } from "./superpowers-task-state-schema.js";
|
|
9
|
-
const SOURCE_FILES = {
|
|
10
|
-
product_architecture_source: {
|
|
11
|
-
path: "product-architecture-source.md",
|
|
12
|
-
authority: "intent_scope_boundaries"
|
|
13
|
-
},
|
|
14
|
-
technical_realization_plan: {
|
|
15
|
-
path: "technical-realization-plan.md",
|
|
16
|
-
authority: "plan_items_execution_blueprint_conformance"
|
|
17
|
-
},
|
|
18
|
-
acceptance_checklist: {
|
|
19
|
-
path: "acceptance-checklist.md",
|
|
20
|
-
authority: "acs_completion_semantics_proof_layers"
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
const SLICE_PROGRESS_TYPES = new Set(["functional_gap_closed", "proof_gap_closed", "blocker_resolved", "invalid_evidence_removed"]);
|
|
24
|
-
export async function initializeSuperpowersTask(workdir, options = {}) {
|
|
25
|
-
await ensureDir(path.join(workdir, "derived"));
|
|
26
|
-
await writeTextIfChanged(path.join(workdir, "task-state.schema.json"), `${stableJson(SUPERPOWERS_TASK_STATE_JSON_SCHEMA)}\n`);
|
|
27
|
-
for (const source of Object.values(SOURCE_FILES)) {
|
|
28
|
-
const target = path.join(workdir, source.path);
|
|
29
|
-
if (!(await pathExists(target))) {
|
|
30
|
-
await writeTextIfChanged(target, `# ${source.path.replace(/\.md$/, "").replace(/-/g, " ")}\n`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
const now = new Date().toISOString();
|
|
34
|
-
const state = {
|
|
35
|
-
meta: {
|
|
36
|
-
task_id: options.taskId ?? `SP-${compactDate(now)}-001`,
|
|
37
|
-
plan_slug: options.planSlug ?? path.basename(workdir),
|
|
38
|
-
created_at: now,
|
|
39
|
-
updated_at: now,
|
|
40
|
-
schema_version: SUPERPOWERS_TASK_STATE_SCHEMA_VERSION,
|
|
41
|
-
goal_type: options.goalType ?? "implementation",
|
|
42
|
-
product_goal_complete: false,
|
|
43
|
-
acceptance_target_status: "not_run",
|
|
44
|
-
audit_task_complete: false,
|
|
45
|
-
completion_output_status: "blocked"
|
|
46
|
-
},
|
|
47
|
-
sources: await sourceRecords(workdir),
|
|
48
|
-
context: {
|
|
49
|
-
product_context_delta: "none",
|
|
50
|
-
technical_context_delta: "none",
|
|
51
|
-
source_to_context_coverage: [],
|
|
52
|
-
context_to_implementation_binding: []
|
|
53
|
-
},
|
|
54
|
-
delivery: {
|
|
55
|
-
product_architecture_scope: {
|
|
56
|
-
delivery_scope: "",
|
|
57
|
-
full_population_required: null,
|
|
58
|
-
representative_samples_validate: [],
|
|
59
|
-
representative_samples_do_not_validate: [],
|
|
60
|
-
out_of_scope_backlog: [],
|
|
61
|
-
scope_fit_decision: "",
|
|
62
|
-
selected_scope_fit_slice: "",
|
|
63
|
-
owner_boundary: "",
|
|
64
|
-
primary_capability_path: "",
|
|
65
|
-
non_completing_outcomes: [],
|
|
66
|
-
assertion_policy: "",
|
|
67
|
-
source_authority: "",
|
|
68
|
-
product_goal: ""
|
|
69
|
-
},
|
|
70
|
-
scope_conflicts: []
|
|
71
|
-
},
|
|
72
|
-
graph: {
|
|
73
|
-
plan_items: {},
|
|
74
|
-
acceptance_criteria: {},
|
|
75
|
-
proof_layers: {},
|
|
76
|
-
edges: []
|
|
77
|
-
},
|
|
78
|
-
attempts: [],
|
|
79
|
-
current_attempt_id: "",
|
|
80
|
-
required_command_specs: [],
|
|
81
|
-
command_runs: [],
|
|
82
|
-
negative_evidence_records: [],
|
|
83
|
-
slices: [],
|
|
84
|
-
evidence: [],
|
|
85
|
-
gates: {},
|
|
86
|
-
progress: emptyProgressState(),
|
|
87
|
-
blockers: [],
|
|
88
|
-
final: {
|
|
89
|
-
product_goal_complete: false,
|
|
90
|
-
acceptance_target_status: "not_run",
|
|
91
|
-
audit_task_complete: false,
|
|
92
|
-
completion_output_status: "blocked",
|
|
93
|
-
final_answer_allowed: false,
|
|
94
|
-
required_user_visible_status: "blocked",
|
|
95
|
-
final_answer: "blocked",
|
|
96
|
-
exit_code: 2,
|
|
97
|
-
blocked_reasons: ["final_gate_not_run"],
|
|
98
|
-
rejection_reasons: [],
|
|
99
|
-
generated_output_mismatch: false,
|
|
100
|
-
completion_basis: [],
|
|
101
|
-
next_required_actions: []
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
await saveSuperpowersState(workdir, state);
|
|
105
|
-
await appendSuperpowersEvent(workdir, "task_initialized", { task_id: state.meta.task_id });
|
|
106
|
-
return state;
|
|
107
|
-
}
|
|
108
|
-
export async function loadSuperpowersState(workdir) {
|
|
109
|
-
return JSON.parse(await readText(path.join(workdir, "task-state.json")));
|
|
110
|
-
}
|
|
111
|
-
export async function saveSuperpowersState(workdir, state) {
|
|
112
|
-
state.meta.updated_at = new Date().toISOString();
|
|
113
|
-
await writeTextIfChanged(path.join(workdir, "task-state.json"), `${stableJson(state)}\n`);
|
|
114
|
-
}
|
|
115
|
-
export async function applySliceDelta(workdir, deltaFile) {
|
|
116
|
-
const state = await loadSuperpowersState(workdir);
|
|
117
|
-
const delta = JSON.parse(await readText(deltaFile));
|
|
118
|
-
const sliceId = String(delta.slice_id ?? "");
|
|
119
|
-
const progressValue = isRecord(delta.progress_value) ? delta.progress_value : undefined;
|
|
120
|
-
if (!sliceId) {
|
|
121
|
-
throw new Error("slice_delta must include slice_id");
|
|
122
|
-
}
|
|
123
|
-
if (!progressValue || !String(progressValue.type ?? "").trim() || asStringArray(progressValue.closed_items).length === 0) {
|
|
124
|
-
throw new Error("slice_delta must include progress_value with type and closed_items");
|
|
125
|
-
}
|
|
126
|
-
const progressType = String(progressValue.type);
|
|
127
|
-
if (!SLICE_PROGRESS_TYPES.has(progressType)) {
|
|
128
|
-
throw new Error(`slice_delta progress_value.type must be one of ${[...SLICE_PROGRESS_TYPES].join(", ")}; got ${progressType || "(missing)"}`);
|
|
129
|
-
}
|
|
130
|
-
const evidenceRecords = readEvidenceRecords(delta.evidence_records);
|
|
131
|
-
for (const evidence of evidenceRecords) {
|
|
132
|
-
const existingIndex = state.evidence.findIndex((item) => item.evidence_id === evidence.evidence_id);
|
|
133
|
-
if (existingIndex >= 0) {
|
|
134
|
-
state.evidence[existingIndex] = evidence;
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
state.evidence.push(evidence);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
const slice = {
|
|
141
|
-
slice_id: sliceId,
|
|
142
|
-
slice_goal: String(delta.slice_goal ?? ""),
|
|
143
|
-
touched_plan_items: asStringArray(delta.touched_plan_items),
|
|
144
|
-
touched_acs: asStringArray(delta.touched_acs),
|
|
145
|
-
missing_layer_classes: asStringArray(delta.missing_layer_classes),
|
|
146
|
-
code_changes: asStringArray(delta.code_changes),
|
|
147
|
-
evidence_records: evidenceRecords.map((item) => item.evidence_id),
|
|
148
|
-
closed_layers: asStringArray(delta.closed_layers).map(normalizeProofLayerId),
|
|
149
|
-
remaining_layers: asStringArray(delta.remaining_layers).map(normalizeProofLayerId),
|
|
150
|
-
blockers: Array.isArray(delta.blockers) ? delta.blockers : [],
|
|
151
|
-
cleanup_assertions: asStringArray(delta.cleanup_assertions),
|
|
152
|
-
progress_value: {
|
|
153
|
-
type: progressType,
|
|
154
|
-
closed_items: asStringArray(progressValue.closed_items),
|
|
155
|
-
why_it_reduces_rework: String(progressValue.why_it_reduces_rework ?? "")
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
state.slices.push(slice);
|
|
159
|
-
for (const layerId of slice.closed_layers) {
|
|
160
|
-
const layer = state.graph.proof_layers[layerId];
|
|
161
|
-
if (!layer) {
|
|
162
|
-
continue;
|
|
163
|
-
}
|
|
164
|
-
layer.status = "satisfied";
|
|
165
|
-
layer.evidence_ids = unique([...layer.evidence_ids, ...evidenceRecords.filter((item) => item.proves.includes(layerId)).map((item) => item.evidence_id)]);
|
|
166
|
-
}
|
|
167
|
-
recomputeStatuses(state);
|
|
168
|
-
await saveSuperpowersState(workdir, state);
|
|
169
|
-
await appendSuperpowersEvent(workdir, "slice_delta_applied", { slice_id: sliceId });
|
|
170
|
-
return state;
|
|
171
|
-
}
|
|
172
|
-
export async function refreshSourceHashes(workdir, state) {
|
|
173
|
-
state.sources = await sourceRecords(workdir);
|
|
174
|
-
}
|
|
175
|
-
export function recomputeStatuses(state) {
|
|
176
|
-
for (const [acId, ac] of Object.entries(state.graph.acceptance_criteria)) {
|
|
177
|
-
const layerIds = ac.required_proof_layers.map((layer) => `${acId}.${layer}`);
|
|
178
|
-
if (layerIds.length === 0) {
|
|
179
|
-
ac.status = "not_run";
|
|
180
|
-
}
|
|
181
|
-
else if (layerIds.every((layerId) => layerSatisfiedForCompletion(state, layerId))) {
|
|
182
|
-
ac.status = "complete";
|
|
183
|
-
}
|
|
184
|
-
else if (layerIds.some((layerId) => state.graph.proof_layers[layerId]?.status === "satisfied")) {
|
|
185
|
-
ac.status = "partial";
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
ac.status = "not_run";
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
for (const item of Object.values(state.graph.plan_items)) {
|
|
192
|
-
if (item.related_acs.length > 0 && item.related_acs.every((acId) => state.graph.acceptance_criteria[acId]?.status === "complete")) {
|
|
193
|
-
item.status = "complete";
|
|
194
|
-
}
|
|
195
|
-
else if (item.related_acs.some((acId) => state.graph.acceptance_criteria[acId]?.status === "partial")) {
|
|
196
|
-
item.status = "partial";
|
|
197
|
-
}
|
|
198
|
-
else if (item.status === "complete") {
|
|
199
|
-
item.status = "not_started";
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
function layerSatisfiedForCompletion(state, layerId) {
|
|
204
|
-
if (state.graph.proof_layers[layerId]?.status !== "satisfied") {
|
|
205
|
-
return false;
|
|
206
|
-
}
|
|
207
|
-
return !isMachineVerifiableLayer(layerId) || evaluateProofLayerAssertions(state, layerId).assertion_status === "passed";
|
|
208
|
-
}
|
|
209
|
-
export function emptyProgressState() {
|
|
210
|
-
return {
|
|
211
|
-
system_capability_progress: { status: "not_started" },
|
|
212
|
-
representative_sample_progress: { status: "not_started" },
|
|
213
|
-
real_object_coverage: { status: "unknown" },
|
|
214
|
-
full_population_operation_progress: { status: "not_in_scope" }
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
export async function sourceRecords(workdir) {
|
|
218
|
-
const sources = {};
|
|
219
|
-
for (const [key, source] of Object.entries(SOURCE_FILES)) {
|
|
220
|
-
const file = path.join(workdir, source.path);
|
|
221
|
-
const content = (await pathExists(file)) ? await readText(file) : "";
|
|
222
|
-
sources[key] = { path: source.path, sha256: sha256(content), authority: source.authority };
|
|
223
|
-
}
|
|
224
|
-
return sources;
|
|
225
|
-
}
|
|
226
|
-
export function sha256(value) {
|
|
227
|
-
return createHash("sha256").update(value).digest("hex");
|
|
228
|
-
}
|
|
229
|
-
export function stableJson(value) {
|
|
230
|
-
return JSON.stringify(sortJson(value), null, 2);
|
|
231
|
-
}
|
|
232
|
-
function sortJson(value) {
|
|
233
|
-
if (Array.isArray(value)) {
|
|
234
|
-
return value.map(sortJson);
|
|
235
|
-
}
|
|
236
|
-
if (!isRecord(value)) {
|
|
237
|
-
return value;
|
|
238
|
-
}
|
|
239
|
-
return Object.fromEntries(Object.keys(value).sort().map((key) => [key, sortJson(value[key])]));
|
|
240
|
-
}
|
|
241
|
-
function unique(values) {
|
|
242
|
-
return [...new Set(values.filter(Boolean))];
|
|
243
|
-
}
|
|
244
|
-
function compactDate(value) {
|
|
245
|
-
return value.slice(0, 10).replace(/-/g, "");
|
|
246
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
const CANONICAL_PLAN_STATUSES = new Set(["not_started", "in_progress", "partial", "blocked", "invalidated", "complete", "out_of_scope_NA"]);
|
|
2
|
-
const CANONICAL_AC_STATUSES = new Set([
|
|
3
|
-
"not_started",
|
|
4
|
-
"not_run",
|
|
5
|
-
"in_progress",
|
|
6
|
-
"partial",
|
|
7
|
-
"blocked",
|
|
8
|
-
"invalidated",
|
|
9
|
-
"under_specified",
|
|
10
|
-
"complete",
|
|
11
|
-
"out_of_scope_NA"
|
|
12
|
-
]);
|
|
13
|
-
export function validateCanonicalStatuses(state, errors) {
|
|
14
|
-
for (const [planId, item] of Object.entries(state.graph?.plan_items ?? {})) {
|
|
15
|
-
if (!CANONICAL_PLAN_STATUSES.has(item.status)) {
|
|
16
|
-
errors.push(`plan item ${planId} has non-canonical status: ${item.status}`);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
for (const [acId, ac] of Object.entries(state.graph?.acceptance_criteria ?? {})) {
|
|
20
|
-
if (!CANONICAL_AC_STATUSES.has(ac.status)) {
|
|
21
|
-
errors.push(`AC ${acId} has non-canonical status: ${ac.status}`);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SuperpowersAcceptanceCriterion, SuperpowersTaskState } from "./superpowers-task-state-schema.js";
|
|
2
|
-
export interface UnderSpecifiedAc {
|
|
3
|
-
ac_id: string;
|
|
4
|
-
reasons: string[];
|
|
5
|
-
}
|
|
6
|
-
export declare function findUnderSpecifiedAcs(state: SuperpowersTaskState): UnderSpecifiedAc[];
|
|
7
|
-
export declare function underSpecifiedReasons(acId: string, ac: SuperpowersAcceptanceCriterion): string[];
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { isMachineVerifiableLayer } from "./superpowers-task-assertions.js";
|
|
2
|
-
const GENERATED_ONLY_EVIDENCE = /\b(matrix|verdict|validator|final[-_ ]?card|final[-_ ]?summary|evidence[-_ ]?index|derived\/)/i;
|
|
3
|
-
const MACHINE_UI_PROOF = /\b(browser|ui_browser|e2e|smoke|trace|playwright|route|owner surface)\b/i;
|
|
4
|
-
const MANUAL_ONLY_TEST = /\b(查看页面|人工确认|manual confirm|manually inspect|visual check only)\b/i;
|
|
5
|
-
export function findUnderSpecifiedAcs(state) {
|
|
6
|
-
return Object.entries(state.graph?.acceptance_criteria ?? {})
|
|
7
|
-
.map(([acId, ac]) => ({ ac_id: acId, reasons: underSpecifiedReasons(acId, ac) }))
|
|
8
|
-
.filter((item) => item.reasons.length > 0);
|
|
9
|
-
}
|
|
10
|
-
export function underSpecifiedReasons(acId, ac) {
|
|
11
|
-
if (ac.machine_blocking !== true && ac.assertion_result_required !== true) {
|
|
12
|
-
return [];
|
|
13
|
-
}
|
|
14
|
-
const reasons = [];
|
|
15
|
-
if (!trimmed(ac.assertion_command)) {
|
|
16
|
-
reasons.push(`${acId} under_specified: assertion_command is required for machine_blocking AC`);
|
|
17
|
-
}
|
|
18
|
-
if ((ac.assertion_artifacts ?? []).length === 0) {
|
|
19
|
-
reasons.push(`${acId} under_specified: assertion_artifacts are required for machine_blocking AC`);
|
|
20
|
-
}
|
|
21
|
-
if ((ac.positive_assertions ?? []).length === 0) {
|
|
22
|
-
reasons.push(`${acId} under_specified: positive_assertions are required for machine_blocking AC`);
|
|
23
|
-
}
|
|
24
|
-
if ((ac.negative_assertions ?? []).length === 0) {
|
|
25
|
-
reasons.push(`${acId} under_specified: negative_assertions are required for machine_blocking AC`);
|
|
26
|
-
}
|
|
27
|
-
if ((ac.invalid_completion_signals ?? []).length === 0) {
|
|
28
|
-
reasons.push(`${acId} under_specified: invalid_completion_signals are required for machine_blocking AC`);
|
|
29
|
-
}
|
|
30
|
-
if (ac.assertion_result_required !== true) {
|
|
31
|
-
reasons.push(`${acId} under_specified: machine_blocking AC must require assertion_result`);
|
|
32
|
-
}
|
|
33
|
-
const requiredLayers = ac.required_proof_layers ?? [];
|
|
34
|
-
if (requiredLayers.some((layer) => isMachineVerifiableLayer(`${acId}.${layer}`)) && !trimmed(ac.assertion_command)) {
|
|
35
|
-
reasons.push(`${acId} under_specified: machine proof layers cannot produce assertion_result without assertion_command`);
|
|
36
|
-
}
|
|
37
|
-
if (requiredLayers.includes("ui_browser") && !MACHINE_UI_PROOF.test(acEvidenceText(ac))) {
|
|
38
|
-
reasons.push(`${acId} under_specified: ui_browser AC requires browser/e2e/smoke/trace-backed proof`);
|
|
39
|
-
}
|
|
40
|
-
const finalEvidence = ac.final_evidence_expected ?? [];
|
|
41
|
-
if (finalEvidence.length > 0 && finalEvidence.every((item) => GENERATED_ONLY_EVIDENCE.test(item))) {
|
|
42
|
-
reasons.push(`${acId} under_specified: final_evidence_expected only names generated summary artifacts`);
|
|
43
|
-
}
|
|
44
|
-
const testCases = ac.test_cases ?? [];
|
|
45
|
-
if (testCases.length > 0 && testCases.every((item) => MANUAL_ONLY_TEST.test(item))) {
|
|
46
|
-
reasons.push(`${acId} under_specified: test_cases are manual-only`);
|
|
47
|
-
}
|
|
48
|
-
return reasons;
|
|
49
|
-
}
|
|
50
|
-
function acEvidenceText(ac) {
|
|
51
|
-
return [
|
|
52
|
-
ac.assertion_command ?? "",
|
|
53
|
-
...(ac.assertion_artifacts ?? []),
|
|
54
|
-
...(ac.verification_method ?? []),
|
|
55
|
-
...(ac.test_cases ?? []),
|
|
56
|
-
...(ac.final_evidence_expected ?? [])
|
|
57
|
-
].join("\n");
|
|
58
|
-
}
|
|
59
|
-
function trimmed(value) {
|
|
60
|
-
return Boolean(value && value.trim());
|
|
61
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type SuperpowersTaskState } from "./superpowers-task-state-schema.js";
|
|
2
|
-
export interface IgnoredUnregisteredEvidence {
|
|
3
|
-
path: string;
|
|
4
|
-
status: string;
|
|
5
|
-
target_ac_ids: string[];
|
|
6
|
-
target_proof_layers: string[];
|
|
7
|
-
}
|
|
8
|
-
export declare function scanUnregisteredAssertionEvidence(workdir: string, state: SuperpowersTaskState): Promise<{
|
|
9
|
-
ignored: IgnoredUnregisteredEvidence[];
|
|
10
|
-
errors: string[];
|
|
11
|
-
}>;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { listFiles, readText } from "./fs.js";
|
|
3
|
-
import { isRecord } from "./superpowers-task-state-schema.js";
|
|
4
|
-
export async function scanUnregisteredAssertionEvidence(workdir, state) {
|
|
5
|
-
const registeredPaths = new Set();
|
|
6
|
-
for (const evidence of state.evidence ?? []) {
|
|
7
|
-
for (const candidate of [evidence.artifact_path, ...(evidence.artifact_paths ?? []), ...(evidence.assertion_result?.artifacts ?? [])]) {
|
|
8
|
-
if (candidate) {
|
|
9
|
-
registeredPaths.add(slash(candidate));
|
|
10
|
-
registeredPaths.add(slash(path.join(workdir, candidate)));
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
const ignored = [];
|
|
15
|
-
for (const file of await listFiles(workdir)) {
|
|
16
|
-
if (!/\.json$/i.test(file)) {
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
const relative = slash(path.relative(workdir, file));
|
|
20
|
-
if (registeredPaths.has(relative) || registeredPaths.has(slash(file))) {
|
|
21
|
-
continue;
|
|
22
|
-
}
|
|
23
|
-
const parsed = await readJson(file);
|
|
24
|
-
const assertion = assertionRecord(parsed);
|
|
25
|
-
if (!assertion) {
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
const status = String(assertion.status ?? "");
|
|
29
|
-
if (status !== "passed") {
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
ignored.push({
|
|
33
|
-
path: relative,
|
|
34
|
-
status,
|
|
35
|
-
target_ac_ids: asStringArray(assertion.target_ac_ids),
|
|
36
|
-
target_proof_layers: asStringArray(assertion.target_proof_layers)
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
ignored,
|
|
41
|
-
errors: ignored.map((item) => `ignored_unregistered_evidence: unregistered assertion JSON ${item.path} status=passed is not proof`)
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
async function readJson(file) {
|
|
45
|
-
try {
|
|
46
|
-
return JSON.parse(await readText(file));
|
|
47
|
-
}
|
|
48
|
-
catch {
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function assertionRecord(value) {
|
|
53
|
-
if (!isRecord(value)) {
|
|
54
|
-
return undefined;
|
|
55
|
-
}
|
|
56
|
-
if (looksLikeAssertion(value)) {
|
|
57
|
-
return value;
|
|
58
|
-
}
|
|
59
|
-
if (isRecord(value.assertion_result) && looksLikeAssertion(value.assertion_result)) {
|
|
60
|
-
return value.assertion_result;
|
|
61
|
-
}
|
|
62
|
-
return undefined;
|
|
63
|
-
}
|
|
64
|
-
function looksLikeAssertion(value) {
|
|
65
|
-
return /assertion-result-v\d+/i.test(String(value.schema_version ?? "")) || (typeof value.status === "string" && Array.isArray(value.target_ac_ids));
|
|
66
|
-
}
|
|
67
|
-
function asStringArray(value) {
|
|
68
|
-
return Array.isArray(value) ? value.map(String).filter(Boolean) : [];
|
|
69
|
-
}
|
|
70
|
-
function slash(value) {
|
|
71
|
-
return value.replace(/\\/g, "/");
|
|
72
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type SuperpowersTaskState } from "./superpowers-task-state-schema.js";
|
|
2
|
-
import type { ValidatorReport } from "./validators.js";
|
|
3
|
-
export declare function validateSuperpowersState(projectRoot: string, args?: string[]): Promise<ValidatorReport>;
|
|
4
|
-
export declare function completionConditionErrors(state: SuperpowersTaskState): string[];
|
|
5
|
-
export declare function allCompletionConditionsSatisfied(state: SuperpowersTaskState): boolean;
|