project-tiny-context-harness 0.2.85 → 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 -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
package/dist/lib/managed-file.js
CHANGED
|
@@ -18,15 +18,30 @@ export const MANAGED_METADATA_START = "<!-- ty-context-managed";
|
|
|
18
18
|
export const MANAGED_METADATA_END = "-->";
|
|
19
19
|
export const AGENTS_BLOCK_MARKERS = [
|
|
20
20
|
{ start: MANAGED_BLOCK_START, end: MANAGED_BLOCK_END },
|
|
21
|
-
{
|
|
22
|
-
|
|
21
|
+
{
|
|
22
|
+
start: LEGACY_PJSDLC_MANAGED_BLOCK_START,
|
|
23
|
+
end: LEGACY_PJSDLC_MANAGED_BLOCK_END,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
start: LEGACY_SDLC_MANAGED_BLOCK_START,
|
|
27
|
+
end: LEGACY_SDLC_MANAGED_BLOCK_END,
|
|
28
|
+
},
|
|
23
29
|
];
|
|
24
30
|
export const MAKEFILE_BLOCK_MARKERS = [
|
|
25
31
|
{ start: MAKEFILE_BLOCK_START, end: MAKEFILE_BLOCK_END },
|
|
26
|
-
{
|
|
27
|
-
|
|
32
|
+
{
|
|
33
|
+
start: LEGACY_PJSDLC_MAKEFILE_BLOCK_START,
|
|
34
|
+
end: LEGACY_PJSDLC_MAKEFILE_BLOCK_END,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
start: LEGACY_SDLC_MAKEFILE_BLOCK_START,
|
|
38
|
+
end: LEGACY_SDLC_MAKEFILE_BLOCK_END,
|
|
39
|
+
},
|
|
28
40
|
];
|
|
29
41
|
export const GITHUB_WORKFLOW_BLOCK_MARKERS = [
|
|
30
42
|
{ start: GITHUB_WORKFLOW_BLOCK_START, end: GITHUB_WORKFLOW_BLOCK_END },
|
|
31
|
-
{
|
|
43
|
+
{
|
|
44
|
+
start: LEGACY_PJSDLC_GITHUB_WORKFLOW_BLOCK_START,
|
|
45
|
+
end: LEGACY_PJSDLC_GITHUB_WORKFLOW_BLOCK_END,
|
|
46
|
+
},
|
|
32
47
|
];
|
package/dist/lib/migrations.js
CHANGED
|
@@ -1,19 +1,41 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { promises as fs } from "node:fs";
|
|
3
|
-
import { CONTEXT_MANIFEST_PATH, contextManifestFromExistingAreas } from "./context-manifest.js";
|
|
4
|
-
import { architectureContextTemplate, areaContextTemplate, globalContextTemplate, verificationContextTemplate } from "./context-templates.js";
|
|
3
|
+
import { CONTEXT_MANIFEST_PATH, contextManifestFromExistingAreas, } from "./context-manifest.js";
|
|
4
|
+
import { architectureContextTemplate, areaContextTemplate, globalContextTemplate, verificationContextTemplate, } from "./context-templates.js";
|
|
5
5
|
import { CURRENT_SCHEMA_VERSION } from "./constants.js";
|
|
6
6
|
import { defaultConfig, readConfig } from "./config.js";
|
|
7
7
|
import { createDesignMdIfMissing, DESIGN_MD_PATH } from "./design-md.js";
|
|
8
|
-
import { ensureDir, listFiles, pathExists, readText, writeTextIfChanged } from "./fs.js";
|
|
8
|
+
import { ensureDir, listFiles, pathExists, readText, writeTextIfChanged, } from "./fs.js";
|
|
9
9
|
import { harnessConfigPath, harnessRoot } from "./harness-root.js";
|
|
10
10
|
import { legacySdlcHarnessMigration } from "./legacy-sdlc-migration.js";
|
|
11
|
-
import { stringifyYaml } from "./yaml.js";
|
|
11
|
+
import { parseYaml, stringifyYaml } from "./yaml.js";
|
|
12
12
|
async function verifyNoop() {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
export const migrations = [
|
|
16
16
|
legacySdlcHarnessMigration,
|
|
17
|
+
{
|
|
18
|
+
id: "long-task-v1-retirement",
|
|
19
|
+
introducedIn: "0.6.0",
|
|
20
|
+
description: "Retire the V1 acceptance runtime and repo-local Hook before enabling the sole V2 authority path.",
|
|
21
|
+
scope: "<harnessRoot>/hooks/long-task-hook.mjs and legacy active-long-task projection",
|
|
22
|
+
risk: "safe",
|
|
23
|
+
manualMessage: "An unfinished V1 Contract cannot be silently upgraded because Claim Coverage, owner boundaries, verification inputs and Counterfactual V2 require explicit product authority.",
|
|
24
|
+
detect: detectLongTaskV1Retirement,
|
|
25
|
+
apply: migrateLongTaskV1Retirement,
|
|
26
|
+
verify: verifyLongTaskV1Retirement,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "composite-codex-to-long-task",
|
|
30
|
+
introducedIn: "0.5.0",
|
|
31
|
+
description: "Replace the retired composite-codex profile with the Single-Goal long-task profile without importing historical Campaign state.",
|
|
32
|
+
scope: "<harnessRoot>/config.yaml and package-owned retired Long-Task assets",
|
|
33
|
+
risk: "safe",
|
|
34
|
+
manualMessage: "Historical Campaign/source/Contract files remain ordinary user files and are intentionally not imported or executed.",
|
|
35
|
+
detect: detectCompositeCodexProfile,
|
|
36
|
+
apply: migrateCompositeCodexProfile,
|
|
37
|
+
verify: verifyCompositeCodexProfile,
|
|
38
|
+
},
|
|
17
39
|
{
|
|
18
40
|
id: "schema-v4-config-refresh",
|
|
19
41
|
introducedIn: "0.2.0",
|
|
@@ -23,7 +45,7 @@ export const migrations = [
|
|
|
23
45
|
manualMessage: "Review Harness config manually if custom managed-file paths still drift after upgrade.",
|
|
24
46
|
detect: detectConfigRefresh,
|
|
25
47
|
apply: migrateConfig,
|
|
26
|
-
verify: verifyNoop
|
|
48
|
+
verify: verifyNoop,
|
|
27
49
|
},
|
|
28
50
|
{
|
|
29
51
|
id: "legacy-modules-to-areas",
|
|
@@ -34,7 +56,7 @@ export const migrations = [
|
|
|
34
56
|
manualMessage: "Resolve target conflicts manually; the Harness will not overwrite existing area Context files.",
|
|
35
57
|
detect: detectLegacyModulesToAreas,
|
|
36
58
|
apply: migrateLegacyModulesToAreas,
|
|
37
|
-
verify: verifyNoop
|
|
59
|
+
verify: verifyNoop,
|
|
38
60
|
},
|
|
39
61
|
{
|
|
40
62
|
id: "context-manifest-baseline",
|
|
@@ -45,7 +67,7 @@ export const migrations = [
|
|
|
45
67
|
manualMessage: "Review deep area files without manifest roles and assign explicit context roles when needed.",
|
|
46
68
|
detect: detectContextManifestBaseline,
|
|
47
69
|
apply: migrateContextManifest,
|
|
48
|
-
verify: verifyNoop
|
|
70
|
+
verify: verifyNoop,
|
|
49
71
|
},
|
|
50
72
|
{
|
|
51
73
|
id: "global-context-v4-sections",
|
|
@@ -56,7 +78,7 @@ export const migrations = [
|
|
|
56
78
|
manualMessage: "Review global Context manually if project-specific long-term facts need refinement.",
|
|
57
79
|
detect: detectGlobalContextSections,
|
|
58
80
|
apply: migrateGlobalContextSections,
|
|
59
|
-
verify: verifyNoop
|
|
81
|
+
verify: verifyNoop,
|
|
60
82
|
},
|
|
61
83
|
{
|
|
62
84
|
id: "design-md-baseline",
|
|
@@ -67,7 +89,7 @@ export const migrations = [
|
|
|
67
89
|
manualMessage: "Review the starter design baseline and replace it with project-specific visual facts when available.",
|
|
68
90
|
detect: detectDesignMdBaseline,
|
|
69
91
|
apply: migrateDesignMd,
|
|
70
|
-
verify: verifyNoop
|
|
92
|
+
verify: verifyNoop,
|
|
71
93
|
},
|
|
72
94
|
{
|
|
73
95
|
id: "deprecated-skill-overrides",
|
|
@@ -77,12 +99,39 @@ export const migrations = [
|
|
|
77
99
|
risk: "manual",
|
|
78
100
|
manualMessage: "Move override files into standalone project-local Skills before running sync.",
|
|
79
101
|
detect: detectDeprecatedSkillOverrides,
|
|
80
|
-
verify: verifyNoop
|
|
81
|
-
}
|
|
102
|
+
verify: verifyNoop,
|
|
103
|
+
},
|
|
82
104
|
];
|
|
105
|
+
async function detectLongTaskV1Retirement(projectRoot, root, migration) {
|
|
106
|
+
const items = [];
|
|
107
|
+
const hook = path.join(projectRoot, root, "hooks", "long-task-hook.mjs");
|
|
108
|
+
if (await pathExists(hook))
|
|
109
|
+
items.push(item(migration, "safe_pending", path.relative(projectRoot, hook).split(path.sep).join("/"), "The V1 repo-local Hook can be removed; V2 invokes the package-owned verifier entry directly."));
|
|
110
|
+
const projection = path.join(projectRoot, root, "ty-context-active-long-task.json");
|
|
111
|
+
if (await pathExists(projection))
|
|
112
|
+
items.push(item(migration, "manual_required", path.relative(projectRoot, projection).split(path.sep).join("/"), "Retire or explicitly rewrite the unfinished V1 task as a V2 Contract; upgrade will not import historical acceptance state."));
|
|
113
|
+
return items;
|
|
114
|
+
}
|
|
115
|
+
async function migrateLongTaskV1Retirement(projectRoot, root, report) {
|
|
116
|
+
const hook = path.join(projectRoot, root, "hooks", "long-task-hook.mjs");
|
|
117
|
+
if (await pathExists(hook)) {
|
|
118
|
+
await fs.rm(hook, { force: true });
|
|
119
|
+
report.changed.push(path.relative(projectRoot, hook).split(path.sep).join("/"));
|
|
120
|
+
}
|
|
121
|
+
else
|
|
122
|
+
report.skipped.push("long-task-v1-retirement:repo-local-hook");
|
|
123
|
+
}
|
|
124
|
+
async function verifyLongTaskV1Retirement(projectRoot, root) {
|
|
125
|
+
if (await pathExists(path.join(projectRoot, root, "hooks", "long-task-hook.mjs")))
|
|
126
|
+
throw new Error("long-task-v1-retirement migration verification failed");
|
|
127
|
+
}
|
|
83
128
|
export async function createUpgradePlan(projectRoot) {
|
|
84
129
|
const root = await harnessRoot(projectRoot);
|
|
85
|
-
const plan = {
|
|
130
|
+
const plan = {
|
|
131
|
+
safe_pending: [],
|
|
132
|
+
manual_required: [],
|
|
133
|
+
blocked: [],
|
|
134
|
+
};
|
|
86
135
|
for (const migration of migrations) {
|
|
87
136
|
for (const item of await migration.detect(projectRoot, root, migration.id)) {
|
|
88
137
|
plan[item.status].push(item);
|
|
@@ -91,7 +140,9 @@ export async function createUpgradePlan(projectRoot) {
|
|
|
91
140
|
return plan;
|
|
92
141
|
}
|
|
93
142
|
export function hasUpgradePlanWork(plan) {
|
|
94
|
-
return plan.safe_pending.length > 0 ||
|
|
143
|
+
return (plan.safe_pending.length > 0 ||
|
|
144
|
+
plan.manual_required.length > 0 ||
|
|
145
|
+
plan.blocked.length > 0);
|
|
95
146
|
}
|
|
96
147
|
export function updateModeForPlan(plan) {
|
|
97
148
|
if (plan.manual_required.length > 0 || plan.blocked.length > 0) {
|
|
@@ -104,9 +155,13 @@ export function updateModeForPlan(plan) {
|
|
|
104
155
|
}
|
|
105
156
|
export function formatUpgradePlan(plan) {
|
|
106
157
|
const lines = [
|
|
107
|
-
`upgrade plan mode=${updateModeForPlan(plan)} safe_pending=${plan.safe_pending.length} manual_required=${plan.manual_required.length} blocked=${plan.blocked.length}
|
|
158
|
+
`upgrade plan mode=${updateModeForPlan(plan)} safe_pending=${plan.safe_pending.length} manual_required=${plan.manual_required.length} blocked=${plan.blocked.length}`,
|
|
108
159
|
];
|
|
109
|
-
for (const status of [
|
|
160
|
+
for (const status of [
|
|
161
|
+
"safe_pending",
|
|
162
|
+
"manual_required",
|
|
163
|
+
"blocked",
|
|
164
|
+
]) {
|
|
110
165
|
for (const item of plan[status]) {
|
|
111
166
|
const location = item.path ? ` ${item.path}` : "";
|
|
112
167
|
lines.push(`${status}: ${item.id}${location} - ${item.message}`);
|
|
@@ -115,7 +170,12 @@ export function formatUpgradePlan(plan) {
|
|
|
115
170
|
return lines;
|
|
116
171
|
}
|
|
117
172
|
export async function runMigrations(projectRoot, existingPlan) {
|
|
118
|
-
const report = {
|
|
173
|
+
const report = {
|
|
174
|
+
changed: [],
|
|
175
|
+
skipped: [],
|
|
176
|
+
manualRequired: [],
|
|
177
|
+
blocked: [],
|
|
178
|
+
};
|
|
119
179
|
const root = await harnessRoot(projectRoot);
|
|
120
180
|
const plan = existingPlan ?? (await createUpgradePlan(projectRoot));
|
|
121
181
|
report.manualRequired.push(...plan.manual_required);
|
|
@@ -142,13 +202,16 @@ async function migrateBaseProjectContext(projectRoot, report) {
|
|
|
142
202
|
await ensureDir(path.join(projectRoot, "project_context", "areas"));
|
|
143
203
|
const files = [
|
|
144
204
|
["project_context/global.md", globalContextTemplate()],
|
|
145
|
-
["project_context/architecture.md", architectureContextTemplate()]
|
|
205
|
+
["project_context/architecture.md", architectureContextTemplate()],
|
|
146
206
|
];
|
|
147
207
|
if (await contextManifestReferences(projectRoot, "project_context/areas/main.md")) {
|
|
148
208
|
files.push(["project_context/areas/main.md", areaContextTemplate("main")]);
|
|
149
209
|
}
|
|
150
210
|
if (await contextManifestReferences(projectRoot, "project_context/areas/main/verification.md")) {
|
|
151
|
-
files.push([
|
|
211
|
+
files.push([
|
|
212
|
+
"project_context/areas/main/verification.md",
|
|
213
|
+
verificationContextTemplate("main"),
|
|
214
|
+
]);
|
|
152
215
|
}
|
|
153
216
|
for (const [relative, content] of files) {
|
|
154
217
|
const target = path.join(projectRoot, ...relative.split("/"));
|
|
@@ -186,7 +249,7 @@ async function detectGlobalContextSections(projectRoot, _root, migration) {
|
|
|
186
249
|
return [];
|
|
187
250
|
}
|
|
188
251
|
return [
|
|
189
|
-
item(migration, "safe_pending", relative, "Global Context needs Schema v4 sections or legacy module path rewrites.")
|
|
252
|
+
item(migration, "safe_pending", relative, "Global Context needs Schema v4 sections or legacy module path rewrites."),
|
|
190
253
|
];
|
|
191
254
|
}
|
|
192
255
|
async function migrateGlobalContextSections(projectRoot, _root, report) {
|
|
@@ -212,7 +275,9 @@ async function migrateGlobalContextSections(projectRoot, _root, report) {
|
|
|
212
275
|
report.skipped.push(`${relative}#schema-v4-sections`);
|
|
213
276
|
return;
|
|
214
277
|
}
|
|
215
|
-
const next = additions.length === 0
|
|
278
|
+
const next = additions.length === 0
|
|
279
|
+
? rewritten
|
|
280
|
+
: `${rewritten.replace(/\s*$/, "\n\n")}${additions.join("\n")}`;
|
|
216
281
|
if (await writeTextIfChanged(target, next)) {
|
|
217
282
|
report.changed.push(`${relative}#schema-v4-sections`);
|
|
218
283
|
}
|
|
@@ -226,7 +291,7 @@ async function detectContextManifestBaseline(projectRoot, _root, migration) {
|
|
|
226
291
|
return [];
|
|
227
292
|
}
|
|
228
293
|
const items = [
|
|
229
|
-
item(migration, "safe_pending", CONTEXT_MANIFEST_PATH, "Context graph manifest is missing and can be created from existing area files.")
|
|
294
|
+
item(migration, "safe_pending", CONTEXT_MANIFEST_PATH, "Context graph manifest is missing and can be created from existing area files."),
|
|
230
295
|
];
|
|
231
296
|
for (const ambiguous of await ambiguousAreaContextFiles(projectRoot)) {
|
|
232
297
|
items.push(item(migration, "manual_required", ambiguous, "Deep area Context cannot be safely role-classified by path alone; review context.toml after upgrade."));
|
|
@@ -249,7 +314,9 @@ async function migrateContextManifest(projectRoot, _root, report) {
|
|
|
249
314
|
async function detectLegacyModulesToAreas(projectRoot, _root, migration) {
|
|
250
315
|
const modulesRoot = path.join(projectRoot, "project_context", "modules");
|
|
251
316
|
const areasRoot = path.join(projectRoot, "project_context", "areas");
|
|
252
|
-
const moduleFiles = (await listFiles(modulesRoot))
|
|
317
|
+
const moduleFiles = (await listFiles(modulesRoot))
|
|
318
|
+
.filter((file) => file.endsWith(".md"))
|
|
319
|
+
.sort();
|
|
253
320
|
const items = [];
|
|
254
321
|
for (const source of moduleFiles) {
|
|
255
322
|
const relativeToModules = path.relative(modulesRoot, source);
|
|
@@ -268,7 +335,9 @@ async function detectLegacyModulesToAreas(projectRoot, _root, migration) {
|
|
|
268
335
|
async function migrateLegacyModulesToAreas(projectRoot, _root, report) {
|
|
269
336
|
const modulesRoot = path.join(projectRoot, "project_context", "modules");
|
|
270
337
|
const areasRoot = path.join(projectRoot, "project_context", "areas");
|
|
271
|
-
const moduleFiles = (await listFiles(modulesRoot))
|
|
338
|
+
const moduleFiles = (await listFiles(modulesRoot))
|
|
339
|
+
.filter((file) => file.endsWith(".md"))
|
|
340
|
+
.sort();
|
|
272
341
|
if (moduleFiles.length === 0) {
|
|
273
342
|
report.skipped.push("project_context/modules");
|
|
274
343
|
return;
|
|
@@ -288,7 +357,7 @@ async function migrateLegacyModulesToAreas(projectRoot, _root, report) {
|
|
|
288
357
|
report.changed.push(`${sourceRelative} -> ${targetRelative}`);
|
|
289
358
|
}
|
|
290
359
|
const remainingFiles = await listFiles(modulesRoot);
|
|
291
|
-
if (remainingFiles.length === 0 && await pathExists(modulesRoot)) {
|
|
360
|
+
if (remainingFiles.length === 0 && (await pathExists(modulesRoot))) {
|
|
292
361
|
await fs.rm(modulesRoot, { recursive: true, force: true });
|
|
293
362
|
report.changed.push("removed project_context/modules");
|
|
294
363
|
}
|
|
@@ -300,14 +369,62 @@ async function migrateManifestModulePaths(projectRoot, report) {
|
|
|
300
369
|
}
|
|
301
370
|
const original = await readText(manifestPath);
|
|
302
371
|
const next = ensureManifestDefaultArea(rewriteLegacyModuleReferences(original));
|
|
303
|
-
if (next !== original && await writeTextIfChanged(manifestPath, next)) {
|
|
372
|
+
if (next !== original && (await writeTextIfChanged(manifestPath, next))) {
|
|
304
373
|
report.changed.push(`${CONTEXT_MANIFEST_PATH}#areas-paths`);
|
|
305
374
|
}
|
|
306
375
|
}
|
|
307
376
|
async function detectDesignMdBaseline(projectRoot, _root, migration) {
|
|
308
377
|
return (await pathExists(path.join(projectRoot, DESIGN_MD_PATH)))
|
|
309
378
|
? []
|
|
310
|
-
: [
|
|
379
|
+
: [
|
|
380
|
+
item(migration, "safe_pending", DESIGN_MD_PATH, "DESIGN.md is missing and can be created with the package baseline."),
|
|
381
|
+
];
|
|
382
|
+
}
|
|
383
|
+
async function detectCompositeCodexProfile(projectRoot, _root, migration) {
|
|
384
|
+
const relative = await harnessConfigPath(projectRoot);
|
|
385
|
+
const file = path.join(projectRoot, relative);
|
|
386
|
+
if (!(await pathExists(file)))
|
|
387
|
+
return [];
|
|
388
|
+
const raw = parseYaml(await readText(file));
|
|
389
|
+
return raw.profiles?.enabled?.includes("composite-codex")
|
|
390
|
+
? [
|
|
391
|
+
item(migration, "safe_pending", relative, "The retired composite-codex profile can be safely replaced with long-task; historical user files will be preserved."),
|
|
392
|
+
]
|
|
393
|
+
: [];
|
|
394
|
+
}
|
|
395
|
+
async function migrateCompositeCodexProfile(projectRoot, root, report) {
|
|
396
|
+
const relative = await harnessConfigPath(projectRoot);
|
|
397
|
+
const file = path.join(projectRoot, relative);
|
|
398
|
+
const raw = parseYaml(await readText(file));
|
|
399
|
+
const profiles = raw.profiles && typeof raw.profiles === "object"
|
|
400
|
+
? raw.profiles
|
|
401
|
+
: {};
|
|
402
|
+
const enabled = Array.isArray(profiles.enabled) ? profiles.enabled : [];
|
|
403
|
+
profiles.enabled = [
|
|
404
|
+
...new Set(enabled.map((profile) => profile === "composite-codex" ? "long-task" : profile)),
|
|
405
|
+
];
|
|
406
|
+
raw.profiles = profiles;
|
|
407
|
+
if (await writeTextIfChanged(file, stringifyYaml(raw)))
|
|
408
|
+
report.changed.push(relative);
|
|
409
|
+
else
|
|
410
|
+
report.skipped.push(relative);
|
|
411
|
+
for (const retired of [
|
|
412
|
+
path.join(projectRoot, root, "skills", "prepare-composite-long-task"),
|
|
413
|
+
path.join(projectRoot, root, "skills", "composite-long-task-workflow"),
|
|
414
|
+
path.join(projectRoot, root, "ty-context-managed", "composite"),
|
|
415
|
+
]) {
|
|
416
|
+
if (!(await pathExists(retired)))
|
|
417
|
+
continue;
|
|
418
|
+
await fs.rm(retired, { recursive: true, force: true });
|
|
419
|
+
report.changed.push(path.relative(projectRoot, retired).split(path.sep).join("/"));
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
async function verifyCompositeCodexProfile(projectRoot) {
|
|
423
|
+
const relative = await harnessConfigPath(projectRoot);
|
|
424
|
+
const raw = parseYaml(await readText(path.join(projectRoot, relative)));
|
|
425
|
+
const enabled = raw.profiles?.enabled ?? [];
|
|
426
|
+
if (enabled.includes("composite-codex") || !enabled.includes("long-task"))
|
|
427
|
+
throw new Error("composite-codex-to-long-task migration verification failed");
|
|
311
428
|
}
|
|
312
429
|
async function migrateDesignMd(projectRoot, _root, report) {
|
|
313
430
|
if (await createDesignMdIfMissing(projectRoot)) {
|
|
@@ -325,7 +442,8 @@ async function detectConfigRefresh(projectRoot, root, migration) {
|
|
|
325
442
|
}
|
|
326
443
|
const config = await readConfig(projectRoot);
|
|
327
444
|
const current = defaultConfig(root);
|
|
328
|
-
const managedMatches = JSON.stringify(config.managed_files) ===
|
|
445
|
+
const managedMatches = JSON.stringify(config.managed_files) ===
|
|
446
|
+
JSON.stringify(current.managed_files);
|
|
329
447
|
const neverOverwriteHasDefaults = current.never_overwrite.every((entry) => config.never_overwrite.includes(entry));
|
|
330
448
|
if (config.core.package === current.core.package &&
|
|
331
449
|
config.core.schema_version === CURRENT_SCHEMA_VERSION &&
|
|
@@ -334,7 +452,7 @@ async function detectConfigRefresh(projectRoot, root, migration) {
|
|
|
334
452
|
return [];
|
|
335
453
|
}
|
|
336
454
|
return [
|
|
337
|
-
item(migration, "safe_pending", relativeConfigPath, "Harness config needs current package metadata, schema version or managed-file defaults.")
|
|
455
|
+
item(migration, "safe_pending", relativeConfigPath, "Harness config needs current package metadata, schema version or managed-file defaults."),
|
|
338
456
|
];
|
|
339
457
|
}
|
|
340
458
|
async function migrateConfig(projectRoot, root, report) {
|
|
@@ -369,10 +487,15 @@ async function detectDeprecatedSkillOverrides(projectRoot, root, migration) {
|
|
|
369
487
|
}
|
|
370
488
|
async function ambiguousAreaContextFiles(projectRoot) {
|
|
371
489
|
const areasRoot = path.join(projectRoot, "project_context", "areas");
|
|
372
|
-
const areaFiles = (await listFiles(areasRoot))
|
|
490
|
+
const areaFiles = (await listFiles(areasRoot))
|
|
491
|
+
.filter((file) => file.endsWith(".md"))
|
|
492
|
+
.sort();
|
|
373
493
|
const ambiguous = [];
|
|
374
494
|
for (const file of areaFiles) {
|
|
375
|
-
const relativeToAreas = path
|
|
495
|
+
const relativeToAreas = path
|
|
496
|
+
.relative(areasRoot, file)
|
|
497
|
+
.split(path.sep)
|
|
498
|
+
.join("/");
|
|
376
499
|
if (!relativeToAreas.includes("/")) {
|
|
377
500
|
continue;
|
|
378
501
|
}
|
|
@@ -399,7 +522,7 @@ function item(migrationId, status, pathLabel, message) {
|
|
|
399
522
|
scope: migration.scope,
|
|
400
523
|
status,
|
|
401
524
|
path: pathLabel,
|
|
402
|
-
message
|
|
525
|
+
message,
|
|
403
526
|
};
|
|
404
527
|
}
|
|
405
528
|
function hasHeading(content, heading) {
|
|
@@ -413,7 +536,8 @@ function rewriteLegacyModuleReferences(content) {
|
|
|
413
536
|
}
|
|
414
537
|
function inferredRoleContext(relativeToAreas) {
|
|
415
538
|
const normalized = relativeToAreas.toLowerCase();
|
|
416
|
-
if (normalized.endsWith("/verification.md") ||
|
|
539
|
+
if (normalized.endsWith("/verification.md") ||
|
|
540
|
+
normalized === "verification.md") {
|
|
417
541
|
return "verification";
|
|
418
542
|
}
|
|
419
543
|
if (normalized.endsWith("/deployment.md") || normalized === "deployment.md") {
|
package/dist/lib/modularity.d.ts
CHANGED
|
@@ -7,9 +7,31 @@ export interface ModularityCheckOptions {
|
|
|
7
7
|
export interface ModularityFileReport {
|
|
8
8
|
relativePath: string;
|
|
9
9
|
lines: number;
|
|
10
|
+
metrics: ModularityMetrics;
|
|
11
|
+
risks: string[];
|
|
12
|
+
regressions: string[];
|
|
10
13
|
overLimit: boolean;
|
|
14
|
+
regressed: boolean;
|
|
15
|
+
baseline?: {
|
|
16
|
+
lines: number;
|
|
17
|
+
metrics: ModularityMetrics;
|
|
18
|
+
risks: string[];
|
|
19
|
+
};
|
|
11
20
|
waived?: ModularityWaiver;
|
|
12
21
|
}
|
|
22
|
+
export interface ModularityMetricLocation {
|
|
23
|
+
symbol: string;
|
|
24
|
+
line: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ModularityMetrics {
|
|
27
|
+
maxFunctionStatements: number;
|
|
28
|
+
maxFunctionStatementsLocation?: ModularityMetricLocation;
|
|
29
|
+
maxBranchComplexity: number;
|
|
30
|
+
maxBranchComplexityLocation?: ModularityMetricLocation;
|
|
31
|
+
exports: number;
|
|
32
|
+
stateTransitions: number;
|
|
33
|
+
responsibilities: string[];
|
|
34
|
+
}
|
|
13
35
|
export interface ModularityCheckReport {
|
|
14
36
|
limit: number;
|
|
15
37
|
files: ModularityFileReport[];
|
|
@@ -20,8 +42,12 @@ export interface ModularityCheckReport {
|
|
|
20
42
|
export interface ModularityWaiver {
|
|
21
43
|
relativePath: string;
|
|
22
44
|
category: string;
|
|
45
|
+
owner: string;
|
|
46
|
+
introducedAt: string;
|
|
23
47
|
reason: string;
|
|
24
|
-
|
|
48
|
+
trackingIssue: string;
|
|
49
|
+
expiryCondition: string;
|
|
25
50
|
}
|
|
26
51
|
export declare function runModularityCheck(projectRoot: string, options: ModularityCheckOptions): Promise<ModularityCheckReport>;
|
|
52
|
+
export declare function analyzeModularity(content: string, relativePath?: string): ModularityMetrics;
|
|
27
53
|
export declare function countPhysicalLines(content: string): number;
|