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,55 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readActiveLongTaskBinding } from "./lib/long-task-state.js";
|
|
3
|
+
import { stopCheckDeliveryTask } from "./lib/long-task-status-v2.js";
|
|
4
|
+
import { repositoryRoot } from "./lib/long-task-workspace.js";
|
|
5
|
+
const input = await readStdin();
|
|
6
|
+
try {
|
|
7
|
+
const root = await repositoryRoot(input.cwd || process.cwd());
|
|
8
|
+
const active = await readActiveLongTaskBinding(root);
|
|
9
|
+
if (!active)
|
|
10
|
+
output({});
|
|
11
|
+
if (input.hook_event_name === "SessionStart" ||
|
|
12
|
+
input.hook_event_name === "PostCompact")
|
|
13
|
+
output({
|
|
14
|
+
hookSpecificOutput: {
|
|
15
|
+
hookEventName: input.hook_event_name,
|
|
16
|
+
additionalContext: [
|
|
17
|
+
"Active Single-Goal Long-Task Workflow V2",
|
|
18
|
+
`Workdir: ${active.workdir}`,
|
|
19
|
+
`Task: ${active.task_id}`,
|
|
20
|
+
`Authority revision: ${active.authority_revision}`,
|
|
21
|
+
`Resume: ty-context long-task resume ${JSON.stringify(active.workdir)}`,
|
|
22
|
+
].join("\n"),
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
if (input.hook_event_name !== "Stop")
|
|
26
|
+
output({});
|
|
27
|
+
const result = await stopCheckDeliveryTask(active.workdir, input.last_assistant_message ?? "");
|
|
28
|
+
if (result.continue)
|
|
29
|
+
output(result.message ? { systemMessage: result.message } : {});
|
|
30
|
+
output({
|
|
31
|
+
decision: "block",
|
|
32
|
+
reason: result.message ||
|
|
33
|
+
result.reason ||
|
|
34
|
+
"The Live Final Gate did not accept the current candidate.",
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
const reason = `Long-task Live Final Gate failed closed: ${message(error)}`;
|
|
39
|
+
if (input.hook_event_name === "Stop")
|
|
40
|
+
output({ decision: "block", reason });
|
|
41
|
+
output({ continue: false, stopReason: reason });
|
|
42
|
+
}
|
|
43
|
+
async function readStdin() {
|
|
44
|
+
let value = "";
|
|
45
|
+
for await (const chunk of process.stdin)
|
|
46
|
+
value += chunk;
|
|
47
|
+
return value.trim() ? JSON.parse(value) : {};
|
|
48
|
+
}
|
|
49
|
+
function output(value) {
|
|
50
|
+
process.stdout.write(`${JSON.stringify(value)}\n`);
|
|
51
|
+
process.exit(0);
|
|
52
|
+
}
|
|
53
|
+
function message(error) {
|
|
54
|
+
return error instanceof Error ? error.message : String(error);
|
|
55
|
+
}
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/Seven128/project-tiny-context-harness/schemas/long-task-delivery-v2.schema.json",
|
|
4
|
+
"title": "Single-Goal Delivery Contract V2",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schema_version", "task", "source_claims", "risk", "global"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema_version": { "const": "long-task-delivery-v2" },
|
|
10
|
+
"task": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"required": ["id", "title", "goal", "source_paths", "context_refs"],
|
|
14
|
+
"properties": {
|
|
15
|
+
"id": { "$ref": "#/$defs/key" },
|
|
16
|
+
"title": { "$ref": "#/$defs/nonEmpty" },
|
|
17
|
+
"goal": { "$ref": "#/$defs/nonEmpty" },
|
|
18
|
+
"source_paths": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/nonEmpty" } },
|
|
19
|
+
"context_refs": { "$ref": "#/$defs/nonEmptyStrings" },
|
|
20
|
+
"context_snapshot_mode": { "enum": ["referenced", "full"], "default": "referenced" }
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"source_claims": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"minItems": 1,
|
|
26
|
+
"items": { "$ref": "#/$defs/sourceClaim" }
|
|
27
|
+
},
|
|
28
|
+
"risk": { "$ref": "#/$defs/risk" },
|
|
29
|
+
"global": { "$ref": "#/$defs/global" },
|
|
30
|
+
"outcomes": { "type": "array", "items": { "$ref": "#/$defs/outcome" }, "minItems": 1 },
|
|
31
|
+
"outcome_files": { "$ref": "#/$defs/nonEmptyStrings" }
|
|
32
|
+
},
|
|
33
|
+
"oneOf": [
|
|
34
|
+
{ "required": ["outcomes"], "not": { "required": ["outcome_files"] } },
|
|
35
|
+
{ "required": ["outcome_files"], "not": { "required": ["outcomes"] } }
|
|
36
|
+
],
|
|
37
|
+
"$defs": {
|
|
38
|
+
"key": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" },
|
|
39
|
+
"nonEmpty": { "type": "string", "minLength": 1 },
|
|
40
|
+
"nonEmptyStrings": { "type": "array", "items": { "$ref": "#/$defs/nonEmpty" } },
|
|
41
|
+
"keyedStatement": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"additionalProperties": false,
|
|
44
|
+
"required": ["key", "statement"],
|
|
45
|
+
"properties": { "key": { "$ref": "#/$defs/key" }, "statement": { "$ref": "#/$defs/nonEmpty" } }
|
|
46
|
+
},
|
|
47
|
+
"keyedPath": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"additionalProperties": false,
|
|
50
|
+
"required": ["key", "path"],
|
|
51
|
+
"properties": { "key": { "$ref": "#/$defs/key" }, "path": { "$ref": "#/$defs/nonEmpty" } }
|
|
52
|
+
},
|
|
53
|
+
"sourceClaim": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"required": ["key", "source_ref", "statement", "disposition"],
|
|
57
|
+
"properties": {
|
|
58
|
+
"key": { "$ref": "#/$defs/key" },
|
|
59
|
+
"source_ref": { "type": "string", "pattern": "^[^#]+(?:#[^#]+)?$" },
|
|
60
|
+
"statement": { "$ref": "#/$defs/nonEmpty" },
|
|
61
|
+
"disposition": {
|
|
62
|
+
"oneOf": [
|
|
63
|
+
{ "type": "object", "additionalProperties": false, "required": ["type", "refs"], "properties": { "type": { "enum": ["claim", "global_constraint", "risk_fact", "external_confirmation"] }, "refs": { "$ref": "#/$defs/nonEmptyStrings" } } },
|
|
64
|
+
{ "type": "object", "additionalProperties": false, "required": ["type", "refs"], "properties": { "type": { "const": "acceptance" }, "refs": { "type": "array", "minItems": 1, "maxItems": 1, "items": { "$ref": "#/$defs/nonEmpty" } } } },
|
|
65
|
+
{ "type": "object", "additionalProperties": false, "required": ["type", "ref"], "properties": { "type": { "const": "outcome_result" }, "ref": { "$ref": "#/$defs/nonEmpty" } } },
|
|
66
|
+
{ "type": "object", "additionalProperties": false, "required": ["type", "reason"], "properties": { "type": { "const": "decision_required" }, "reason": { "$ref": "#/$defs/nonEmpty" } } }
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"risk": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"additionalProperties": false,
|
|
74
|
+
"required": ["facts"],
|
|
75
|
+
"properties": {
|
|
76
|
+
"requested_level": { "enum": ["auto", "standard", "strict"], "default": "auto" },
|
|
77
|
+
"facts": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"additionalProperties": false,
|
|
80
|
+
"properties": {
|
|
81
|
+
"public_api_or_schema_change": { "$ref": "#/$defs/keys", "default": [] },
|
|
82
|
+
"persistent_data_change": { "$ref": "#/$defs/keys", "default": [] },
|
|
83
|
+
"data_migration": { "$ref": "#/$defs/keys", "default": [] },
|
|
84
|
+
"security_boundary_change": { "$ref": "#/$defs/keys", "default": [] },
|
|
85
|
+
"permission_boundary_change": { "$ref": "#/$defs/keys", "default": [] },
|
|
86
|
+
"irreversible_external_effect": { "$ref": "#/$defs/keys", "default": [] },
|
|
87
|
+
"critical_user_path": { "$ref": "#/$defs/keys", "default": [] },
|
|
88
|
+
"full_population_operation": { "$ref": "#/$defs/keys", "default": [] },
|
|
89
|
+
"multi_repository_change": { "$ref": "#/$defs/keys", "default": [] },
|
|
90
|
+
"weak_observability": { "$ref": "#/$defs/keys", "default": [] }
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"keys": { "type": "array", "items": { "$ref": "#/$defs/key" }, "uniqueItems": true },
|
|
96
|
+
"global": {
|
|
97
|
+
"type": "object",
|
|
98
|
+
"additionalProperties": false,
|
|
99
|
+
"properties": {
|
|
100
|
+
"product": { "type": "object", "additionalProperties": false, "properties": { "non_goals": { "type": "array", "items": { "$ref": "#/$defs/keyedStatement" }, "default": [] } }, "default": {} },
|
|
101
|
+
"technical": {
|
|
102
|
+
"type": "object",
|
|
103
|
+
"additionalProperties": false,
|
|
104
|
+
"properties": {
|
|
105
|
+
"constraints": { "type": "array", "items": { "$ref": "#/$defs/keyedStatement" }, "default": [] },
|
|
106
|
+
"forbidden_paths": { "type": "array", "items": { "$ref": "#/$defs/keyedPath" }, "default": [] },
|
|
107
|
+
"forbidden_shortcuts": { "type": "array", "items": { "$ref": "#/$defs/keyedStatement" }, "default": [] }
|
|
108
|
+
},
|
|
109
|
+
"default": {}
|
|
110
|
+
},
|
|
111
|
+
"acceptance": {
|
|
112
|
+
"type": "object",
|
|
113
|
+
"additionalProperties": false,
|
|
114
|
+
"properties": {
|
|
115
|
+
"checks": { "type": "array", "items": { "$ref": "#/$defs/check" }, "default": [] },
|
|
116
|
+
"counterfactual_controls": { "type": "array", "items": { "$ref": "#/$defs/globalCounterfactual" }, "default": [] },
|
|
117
|
+
"external_confirmations": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["key", "description", "owner"], "properties": { "key": { "$ref": "#/$defs/key" }, "description": { "$ref": "#/$defs/nonEmpty" }, "owner": { "$ref": "#/$defs/nonEmpty" } } }, "default": [] }
|
|
118
|
+
},
|
|
119
|
+
"default": {}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"outcome": {
|
|
124
|
+
"type": "object",
|
|
125
|
+
"additionalProperties": false,
|
|
126
|
+
"required": ["key", "title", "product", "technical", "acceptance"],
|
|
127
|
+
"properties": {
|
|
128
|
+
"key": { "$ref": "#/$defs/key" },
|
|
129
|
+
"title": { "$ref": "#/$defs/nonEmpty" },
|
|
130
|
+
"depends_on": { "$ref": "#/$defs/keys", "default": [] },
|
|
131
|
+
"product": { "$ref": "#/$defs/product" },
|
|
132
|
+
"technical": { "$ref": "#/$defs/technical" },
|
|
133
|
+
"acceptance": { "$ref": "#/$defs/acceptance" }
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"product": {
|
|
137
|
+
"type": "object",
|
|
138
|
+
"additionalProperties": false,
|
|
139
|
+
"required": ["observable_result", "owner"],
|
|
140
|
+
"properties": {
|
|
141
|
+
"observable_result": { "$ref": "#/$defs/nonEmpty" },
|
|
142
|
+
"owner": { "type": "object", "additionalProperties": false, "required": ["label", "context_refs", "path_globs"], "properties": { "label": { "$ref": "#/$defs/nonEmpty" }, "context_refs": { "$ref": "#/$defs/nonEmptyStrings" }, "path_globs": { "$ref": "#/$defs/nonEmptyStrings" } } },
|
|
143
|
+
"requirements": { "type": "array", "items": { "$ref": "#/$defs/requirement" }, "default": [] },
|
|
144
|
+
"owner_surfaces": { "$ref": "#/$defs/nonEmptyStrings", "default": [] },
|
|
145
|
+
"controls": { "type": "array", "items": { "$ref": "#/$defs/control" }, "default": [] },
|
|
146
|
+
"non_completing_outcomes": { "type": "array", "items": { "$ref": "#/$defs/keyedStatement" }, "default": [] }
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"requirement": {
|
|
150
|
+
"type": "object",
|
|
151
|
+
"additionalProperties": false,
|
|
152
|
+
"required": ["key", "statement", "required_proof_surfaces"],
|
|
153
|
+
"properties": { "key": { "$ref": "#/$defs/key" }, "statement": { "$ref": "#/$defs/nonEmpty" }, "required_proof_surfaces": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/proofSurface" } } }
|
|
154
|
+
},
|
|
155
|
+
"control": {
|
|
156
|
+
"type": "object",
|
|
157
|
+
"additionalProperties": false,
|
|
158
|
+
"required": ["key", "location"],
|
|
159
|
+
"properties": { "key": { "$ref": "#/$defs/key" }, "location": { "$ref": "#/$defs/nonEmpty" }, "trigger": { "type": "string", "default": "" }, "input": { "type": "string", "default": "" }, "loading_state": { "type": "string", "default": "" }, "empty_state": { "type": "string", "default": "" }, "success_state": { "type": "string", "default": "" }, "failure_state": { "type": "string", "default": "" }, "feedback": { "type": "string", "default": "" } }
|
|
160
|
+
},
|
|
161
|
+
"technical": {
|
|
162
|
+
"type": "object",
|
|
163
|
+
"additionalProperties": false,
|
|
164
|
+
"required": ["expected_change_paths"],
|
|
165
|
+
"properties": {
|
|
166
|
+
"obligations": { "type": "array", "items": { "$ref": "#/$defs/obligation" }, "default": [] },
|
|
167
|
+
"expected_change_paths": { "$ref": "#/$defs/nonEmptyStrings" },
|
|
168
|
+
"allowed_support_paths": { "$ref": "#/$defs/nonEmptyStrings", "default": [] },
|
|
169
|
+
"forbidden_paths": { "$ref": "#/$defs/nonEmptyStrings", "default": [] },
|
|
170
|
+
"forbidden_shortcuts": { "type": "array", "items": { "$ref": "#/$defs/keyedStatement" }, "default": [] },
|
|
171
|
+
"bindings": { "type": "array", "items": { "$ref": "#/$defs/binding" }, "default": [] },
|
|
172
|
+
"rollback_and_recovery": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/rollback" }], "default": null }
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"obligation": {
|
|
176
|
+
"type": "object",
|
|
177
|
+
"additionalProperties": false,
|
|
178
|
+
"required": ["key", "statement", "required_proof_surfaces"],
|
|
179
|
+
"properties": { "key": { "$ref": "#/$defs/key" }, "statement": { "$ref": "#/$defs/nonEmpty" }, "required_proof_surfaces": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/proofSurface" } } }
|
|
180
|
+
},
|
|
181
|
+
"proofSurface": { "enum": ["ui_browser", "runtime_behavior", "api_contract", "data_state", "security_boundary", "population_coverage", "implementation_structure"] },
|
|
182
|
+
"binding": {
|
|
183
|
+
"type": "object",
|
|
184
|
+
"additionalProperties": false,
|
|
185
|
+
"required": ["key", "kind", "target", "carrier_paths"],
|
|
186
|
+
"properties": { "key": { "$ref": "#/$defs/key" }, "kind": { "enum": ["file", "path_glob", "verified"] }, "target": { "$ref": "#/$defs/nonEmpty" }, "carrier_paths": { "$ref": "#/$defs/nonEmptyStrings" }, "existence": { "enum": ["existing", "planned"] }, "verification_check_key": { "$ref": "#/$defs/key" } }
|
|
187
|
+
},
|
|
188
|
+
"rollback": {
|
|
189
|
+
"type": "object",
|
|
190
|
+
"additionalProperties": false,
|
|
191
|
+
"required": ["rollback", "recovery", "verification_check_keys"],
|
|
192
|
+
"properties": { "rollback": { "$ref": "#/$defs/nonEmpty" }, "recovery": { "$ref": "#/$defs/nonEmpty" }, "verification_check_keys": { "$ref": "#/$defs/keys" } }
|
|
193
|
+
},
|
|
194
|
+
"acceptance": {
|
|
195
|
+
"type": "object",
|
|
196
|
+
"additionalProperties": false,
|
|
197
|
+
"required": ["checks"],
|
|
198
|
+
"properties": {
|
|
199
|
+
"checks": { "type": "array", "items": { "$ref": "#/$defs/check" } },
|
|
200
|
+
"population": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/population" }], "default": null },
|
|
201
|
+
"counterfactual_controls": { "type": "array", "items": { "$ref": "#/$defs/counterfactual" }, "default": [] }
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"check": {
|
|
205
|
+
"type": "object",
|
|
206
|
+
"additionalProperties": false,
|
|
207
|
+
"required": ["key", "proof_surface", "runner", "verification_inputs"],
|
|
208
|
+
"properties": {
|
|
209
|
+
"key": { "$ref": "#/$defs/key" },
|
|
210
|
+
"proof_surface": { "$ref": "#/$defs/proofSurface" },
|
|
211
|
+
"runner": { "$ref": "#/$defs/runner" },
|
|
212
|
+
"verification_inputs": { "$ref": "#/$defs/nonEmptyStrings" },
|
|
213
|
+
"input_paths": { "$ref": "#/$defs/nonEmptyStrings", "default": [] },
|
|
214
|
+
"expected_output_paths": { "$ref": "#/$defs/nonEmptyStrings", "default": [] },
|
|
215
|
+
"artifact_globs": { "$ref": "#/$defs/nonEmptyStrings", "default": [] },
|
|
216
|
+
"positive_assertions": { "type": "array", "items": { "$ref": "#/$defs/assertion" }, "default": [] },
|
|
217
|
+
"negative_assertions": { "type": "array", "items": { "$ref": "#/$defs/assertion" }, "default": [] },
|
|
218
|
+
"environment_requirements": { "type": "array", "items": { "$ref": "#/$defs/environment" }, "default": [] }
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"runner": {
|
|
222
|
+
"type": "object",
|
|
223
|
+
"additionalProperties": false,
|
|
224
|
+
"required": ["type", "target", "effect"],
|
|
225
|
+
"properties": {
|
|
226
|
+
"type": { "enum": ["package_script", "project_binary", "node_oracle", "playwright_test"] },
|
|
227
|
+
"target": { "$ref": "#/$defs/nonEmpty" },
|
|
228
|
+
"argv": { "$ref": "#/$defs/nonEmptyStrings", "default": [] },
|
|
229
|
+
"cwd": { "$ref": "#/$defs/nonEmpty", "default": "." },
|
|
230
|
+
"timeout_ms": { "type": "integer", "minimum": 100, "maximum": 3600000, "default": 30000 },
|
|
231
|
+
"effect": { "enum": ["read_only", "test_sandbox"] },
|
|
232
|
+
"retry_policy": { "enum": ["none", "transient_once"], "default": "none" },
|
|
233
|
+
"idempotent": { "type": "boolean", "default": false }
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
"assertion": {
|
|
237
|
+
"type": "object",
|
|
238
|
+
"additionalProperties": false,
|
|
239
|
+
"required": ["key", "claims", "observation", "operator"],
|
|
240
|
+
"properties": {
|
|
241
|
+
"key": { "$ref": "#/$defs/key" },
|
|
242
|
+
"criterion": { "$ref": "#/$defs/nonEmpty" },
|
|
243
|
+
"claims": { "$ref": "#/$defs/nonEmptyStrings" },
|
|
244
|
+
"observation": { "$ref": "#/$defs/nonEmpty" },
|
|
245
|
+
"operator": { "enum": ["equals", "not_equals", "contains", "not_contains", "matches", "not_matches", "greater_than", "greater_or_equal", "less_than", "less_or_equal", "truthy", "falsy", "exists", "set_equals", "subset_of", "superset_of"] },
|
|
246
|
+
"expected": true
|
|
247
|
+
},
|
|
248
|
+
"allOf": [
|
|
249
|
+
{
|
|
250
|
+
"if": { "properties": { "operator": { "enum": ["equals", "not_equals", "contains", "not_contains", "matches", "not_matches", "greater_than", "greater_or_equal", "less_than", "less_or_equal", "set_equals", "subset_of", "superset_of"] } } },
|
|
251
|
+
"then": { "required": ["expected"] }
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"if": { "properties": { "operator": { "enum": ["exists", "truthy", "falsy"] } } },
|
|
255
|
+
"then": { "not": { "required": ["expected"] } }
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"if": { "properties": { "operator": { "enum": ["matches", "not_matches"] } } },
|
|
259
|
+
"then": { "properties": { "expected": { "type": "string", "format": "regex" } } }
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"if": { "properties": { "operator": { "enum": ["greater_than", "greater_or_equal", "less_than", "less_or_equal"] } } },
|
|
263
|
+
"then": { "properties": { "expected": { "type": "number" } } }
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"if": { "properties": { "operator": { "enum": ["set_equals", "subset_of", "superset_of"] } } },
|
|
267
|
+
"then": { "properties": { "expected": { "type": "array" } } }
|
|
268
|
+
}
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
"environment": {
|
|
272
|
+
"oneOf": [
|
|
273
|
+
{
|
|
274
|
+
"type": "object",
|
|
275
|
+
"additionalProperties": false,
|
|
276
|
+
"required": ["key", "kind", "target"],
|
|
277
|
+
"properties": { "key": { "$ref": "#/$defs/key" }, "kind": { "enum": ["executable", "file", "directory", "env_var"] }, "target": { "$ref": "#/$defs/nonEmpty" } }
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"type": "object",
|
|
281
|
+
"additionalProperties": false,
|
|
282
|
+
"required": ["key", "kind", "host", "port", "timeout_ms"],
|
|
283
|
+
"properties": { "key": { "$ref": "#/$defs/key" }, "kind": { "const": "loopback_tcp" }, "host": { "enum": ["127.0.0.1", "::1", "localhost"] }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "timeout_ms": { "type": "integer", "minimum": 10, "maximum": 60000 } }
|
|
284
|
+
}
|
|
285
|
+
]
|
|
286
|
+
},
|
|
287
|
+
"population": {
|
|
288
|
+
"type": "object",
|
|
289
|
+
"additionalProperties": false,
|
|
290
|
+
"required": ["check_key", "claims", "observations", "exclusion_rules"],
|
|
291
|
+
"properties": {
|
|
292
|
+
"check_key": { "$ref": "#/$defs/key" },
|
|
293
|
+
"claims": { "$ref": "#/$defs/nonEmptyStrings" },
|
|
294
|
+
"observations": {
|
|
295
|
+
"type": "object",
|
|
296
|
+
"additionalProperties": false,
|
|
297
|
+
"required": ["eligible_ids", "observed_ids", "excluded_items"],
|
|
298
|
+
"properties": { "eligible_ids": { "$ref": "#/$defs/nonEmpty" }, "observed_ids": { "$ref": "#/$defs/nonEmpty" }, "excluded_items": { "$ref": "#/$defs/nonEmpty" } }
|
|
299
|
+
},
|
|
300
|
+
"exclusion_rules": { "type": "array", "items": { "$ref": "#/$defs/keyedStatement" } }
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
"counterfactual": {
|
|
304
|
+
"type": "object",
|
|
305
|
+
"additionalProperties": false,
|
|
306
|
+
"required": ["key", "binding_key", "claims", "check_key", "mutation", "expected_assertion_failures"],
|
|
307
|
+
"properties": {
|
|
308
|
+
"key": { "$ref": "#/$defs/key" },
|
|
309
|
+
"binding_key": { "$ref": "#/$defs/key" },
|
|
310
|
+
"claims": { "$ref": "#/$defs/nonEmptyStrings" },
|
|
311
|
+
"check_key": { "$ref": "#/$defs/key" },
|
|
312
|
+
"expected_assertion_failures": { "$ref": "#/$defs/keys" },
|
|
313
|
+
"mutation": {
|
|
314
|
+
"oneOf": [
|
|
315
|
+
{ "type": "object", "additionalProperties": false, "required": ["type", "paths"], "properties": { "type": { "const": "remove_paths" }, "paths": { "$ref": "#/$defs/nonEmptyStrings" } } },
|
|
316
|
+
{ "type": "object", "additionalProperties": false, "required": ["type", "path", "fixture_path"], "properties": { "type": { "const": "replace_file" }, "path": { "$ref": "#/$defs/nonEmpty" }, "fixture_path": { "$ref": "#/$defs/nonEmpty" } } }
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
"globalCounterfactual": {
|
|
322
|
+
"type": "object",
|
|
323
|
+
"additionalProperties": false,
|
|
324
|
+
"required": ["key", "binding_ref", "claims", "check_key", "mutation", "expected_assertion_failures"],
|
|
325
|
+
"properties": {
|
|
326
|
+
"key": { "$ref": "#/$defs/key" },
|
|
327
|
+
"binding_ref": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*\\.[a-z0-9][a-z0-9-]*$" },
|
|
328
|
+
"claims": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/nonEmpty" } },
|
|
329
|
+
"check_key": { "$ref": "#/$defs/key" },
|
|
330
|
+
"expected_assertion_failures": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/key" }, "uniqueItems": true },
|
|
331
|
+
"mutation": {
|
|
332
|
+
"oneOf": [
|
|
333
|
+
{ "type": "object", "additionalProperties": false, "required": ["type", "paths"], "properties": { "type": { "const": "remove_paths" }, "paths": { "$ref": "#/$defs/nonEmptyStrings" } } },
|
|
334
|
+
{ "type": "object", "additionalProperties": false, "required": ["type", "path", "fixture_path"], "properties": { "type": { "const": "replace_file" }, "path": { "$ref": "#/$defs/nonEmpty" }, "fixture_path": { "$ref": "#/$defs/nonEmpty" } } }
|
|
335
|
+
]
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/Seven128/project-tiny-context-harness/schemas/long-task-outcomes-v2.schema.json",
|
|
4
|
+
"title": "Single-Goal Delivery Contract V2 Outcome Fragment",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schema_version", "outcomes"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema_version": { "const": "long-task-outcomes-v2" },
|
|
10
|
+
"outcomes": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"minItems": 1,
|
|
13
|
+
"items": {
|
|
14
|
+
"$ref": "long-task-delivery-v2.schema.json#/$defs/outcome"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
package/migrations/README.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
# Migrations
|
|
2
|
-
|
|
3
|
-
Schema migrations for
|
|
1
|
+
# Migrations
|
|
2
|
+
|
|
3
|
+
Schema migrations for Harness config and managed file layout belong here.
|
|
4
|
+
|
|
5
|
+
Version 0.6.0 includes `long-task-v1-retirement`. It safely removes the
|
|
6
|
+
retired repo-local Hook, reports a legacy active projection as
|
|
7
|
+
`manual_required`, and deliberately does not import V1 progress or receipts
|
|
8
|
+
into the V2 Claim/Evidence authority.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "project-tiny-context-harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Minimal project memory and validation harness for AI coding agents.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Seven128",
|
|
@@ -50,8 +50,17 @@
|
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json",
|
|
52
52
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
53
|
-
"test:built": "node
|
|
54
|
-
"test": "npm run build &&
|
|
53
|
+
"test:default:built": "node ../../tests/ty-context/run-package-suite.mjs default",
|
|
54
|
+
"test:default": "npm run build && npm run test:default:built",
|
|
55
|
+
"test:built": "npm run test:default:built && npm run test:long-task-workflow:built",
|
|
56
|
+
"pretest": "npm run build",
|
|
57
|
+
"test": "npm run test:built",
|
|
58
|
+
"test:workflow-default:built": "node --test --test-concurrency=1 ../../tests/ty-context/workflow-contract-routing.test.mjs",
|
|
59
|
+
"test:delivery-contract:built": "node --test --test-concurrency=1 ../../tests/ty-context/long-task-compact-authoring.test.mjs ../../tests/ty-context/long-task-authoring-claims.test.mjs ../../tests/ty-context/long-task-authoring-preflight.test.mjs ../../tests/ty-context/long-task-authority-authoring-fields.test.mjs ../../tests/ty-context/long-task-playwright-ac-evidence.test.mjs ../../tests/ty-context/long-task-delivery-parser.test.mjs ../../tests/ty-context/long-task-delivery-compiler.test.mjs ../../tests/ty-context/long-task-delivery-risk.test.mjs ../../tests/ty-context/long-task-claim-coverage.test.mjs ../../tests/ty-context/long-task-closure-invariants.test.mjs ../../tests/ty-context/long-task-source-authority-closure.test.mjs ../../tests/ty-context/long-task-evidence-sensitivity-policy.test.mjs ../../tests/ty-context/long-task-global-evidence-sensitivity.test.mjs ../../tests/ty-context/long-task-source-risk-binding.test.mjs ../../tests/ty-context/long-task-non-completing-source.test.mjs ../../tests/ty-context/long-task-playwright-trust-boundary.test.mjs ../../tests/ty-context/long-task-planned-counterfactual.test.mjs ../../tests/ty-context/long-task-public-contract-example.test.mjs ../../tests/ty-context/long-task-release-tarball-contract.test.mjs",
|
|
60
|
+
"test:delivery-contract": "npm run build && npm run test:delivery-contract:built",
|
|
61
|
+
"test:long-task-workflow:built": "node ../../tests/ty-context/run-package-suite.mjs long-task",
|
|
62
|
+
"test:long-task-workflow": "npm run build && npm run test:long-task-workflow:built",
|
|
63
|
+
"test:long-task-performance": "npm run build && node ../../tests/ty-context/long-task-performance.mjs",
|
|
55
64
|
"prepack": "npm run build"
|
|
56
65
|
},
|
|
57
66
|
"engines": {
|
|
@@ -59,11 +68,13 @@
|
|
|
59
68
|
},
|
|
60
69
|
"dependencies": {
|
|
61
70
|
"@google/design.md": "^0.3.0",
|
|
62
|
-
"impeccable": "^3.1
|
|
71
|
+
"impeccable": "^3.2.1",
|
|
72
|
+
"re2js": "2.8.6",
|
|
73
|
+
"smol-toml": "1.7.0",
|
|
63
74
|
"yaml": "^2.9.0"
|
|
64
75
|
},
|
|
65
76
|
"devDependencies": {
|
|
66
|
-
"@types/node": "^26.
|
|
67
|
-
"typescript": "^
|
|
77
|
+
"@types/node": "^26.1.1",
|
|
78
|
+
"typescript": "^7.0.2"
|
|
68
79
|
}
|
|
69
80
|
}
|
package/source-mappings.yaml
CHANGED
|
@@ -17,9 +17,6 @@ source_mappings:
|
|
|
17
17
|
- source: ".codex/ty-context-managed/make/ty-context.mk"
|
|
18
18
|
target: "packages/ty-context/assets/make/ty-context.mk"
|
|
19
19
|
mode: "copy-file"
|
|
20
|
-
- source: ".codex/ty-context-managed/protected-harness-baseline.json"
|
|
21
|
-
target: "packages/ty-context/assets/protected-harness-baseline.json"
|
|
22
|
-
mode: "copy-file"
|
|
23
20
|
- source: ".codex/ty-context-managed/minimal_tools"
|
|
24
21
|
target: "packages/ty-context/assets/tools"
|
|
25
22
|
mode: "copy-tree"
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schema_version": "protected-harness-baseline-v1",
|
|
3
|
-
"purpose": "Protect composite-long-task final completion mechanics from product-task self-validation drift.",
|
|
4
|
-
"baseline_reason": "Trusted Evidence Kernel and Harness Drift Lock define the canonical completion proof surface.",
|
|
5
|
-
"protected_categories": {
|
|
6
|
-
"final_gate_implementation": ["packages/ty-context/src/commands/composite-long-task.ts", "packages/ty-context/src/lib/superpowers-task-gates.ts", "packages/ty-context/src/lib/superpowers-task-evidence-kernel.ts", "packages/ty-context/src/lib/superpowers-task-command-run-correlation.ts", "packages/ty-context/src/lib/superpowers-task-unregistered-evidence.ts", "packages/ty-context/src/lib/superpowers-task-ac010.ts"],
|
|
7
|
-
"completion_output_implementation": ["packages/ty-context/src/lib/superpowers-task-completion-output.ts", "packages/ty-context/src/lib/superpowers-task-final-card.ts"],
|
|
8
|
-
"validator_implementation": ["packages/ty-context/src/lib/superpowers-task-validator.ts", "packages/ty-context/src/lib/plan-acceptance-validator.ts"],
|
|
9
|
-
"derive_implementation": ["packages/ty-context/src/lib/superpowers-task-derive.ts"],
|
|
10
|
-
"evidence_registration_implementation": ["packages/ty-context/src/lib/superpowers-task-evidence.ts", "packages/ty-context/src/lib/superpowers-task-current-evidence.ts"],
|
|
11
|
-
"harness_protection_implementation": ["packages/ty-context/src/lib/superpowers-task-harness-drift.ts", "packages/ty-context/src/lib/superpowers-task-protected-baseline.ts"],
|
|
12
|
-
"assertion_result_schema": ["packages/ty-context/src/lib/superpowers-task-state-schema.ts", "packages/ty-context/src/lib/superpowers-task-assertion-normalizers.ts"],
|
|
13
|
-
"fixture_expected_outcomes": ["tests/ty-context/superpowers-task-evidence-kernel.test.mjs", "tests/ty-context/composite-long-task-assertion-gate.test.mjs", "tests/ty-context/composite-long-task-expanded-assertion-gate.test.mjs", "tests/ty-context/composite-long-task-trusted-evidence-kernel.test.mjs", "tests/ty-context/composite-long-task-completion-output-gate.test.mjs", "tests/ty-context/fixtures/composite-long-task/completion-output-gate/expected-outcomes.json", "tests/ty-context/composite-long-task-false-completion-regression.test.mjs", "tests/ty-context/fixtures/composite-long-task/false-completion-regression/manifest.json", "tests/ty-context/composite-long-task-final-gate-triage.test.mjs", "tests/ty-context/fixtures/composite-long-task/final-gate-triage/manifest.json"],
|
|
14
|
-
"workflow_protocol": [".codex/ty-context-managed/skills/composite-long-task-workflow/references/composite-long-task-workflow-protocol.md", ".codex/ty-context-managed/skills/composite-long-task-workflow/assets/goal-objective.template.md", ".codex/ty-context-managed/skills/composite-long-task-workflow/assets/execution-binding.template.md"],
|
|
15
|
-
"skill_markdown": [".codex/ty-context-managed/skills/composite-long-task-workflow/SKILL.md"],
|
|
16
|
-
"test_runner_scripts": ["packages/ty-context/package.json", "package.json", "Makefile"]
|
|
17
|
-
},
|
|
18
|
-
"product_task_rule": "Changing protected paths in product_task blocks product_goal_complete.",
|
|
19
|
-
"harness_task_rule": "Changing protected paths in harness_task requires a baseline reason, adversarial fixtures, a happy-path fixture and no product completion claim."
|
|
20
|
-
}
|