@zhixuan92/multi-model-agent-core 5.1.0 → 5.2.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/dist/bounded-execution/activity-tracker-types.d.ts +30 -15
- package/dist/bounded-execution/activity-tracker-types.d.ts.map +1 -1
- package/dist/bounded-execution/activity-tracker-types.js.map +1 -1
- package/dist/bounded-execution/activity-tracker.d.ts +2 -2
- package/dist/bounded-execution/activity-tracker.d.ts.map +1 -1
- package/dist/bounded-execution/activity-tracker.js +4 -5
- package/dist/bounded-execution/activity-tracker.js.map +1 -1
- package/dist/config/schema.d.ts +41 -2
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +1 -2
- package/dist/config/schema.js.map +1 -1
- package/dist/events/task-envelope.d.ts +5 -5
- package/dist/events/task-envelope.d.ts.map +1 -1
- package/dist/events/task-envelope.js +3 -6
- package/dist/events/task-envelope.js.map +1 -1
- package/dist/events/telemetry-uploader.d.ts +1 -1
- package/dist/events/telemetry-uploader.d.ts.map +1 -1
- package/dist/events/to-wire-record.d.ts +1 -1
- package/dist/events/to-wire-record.d.ts.map +1 -1
- package/dist/events/to-wire-record.js +1 -1
- package/dist/events/to-wire-record.js.map +1 -1
- package/dist/events/wire-schema.d.ts +34 -11
- package/dist/events/wire-schema.d.ts.map +1 -1
- package/dist/events/wire-schema.js +8 -8
- package/dist/events/wire-schema.js.map +1 -1
- package/dist/index.d.ts +13 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -17
- package/dist/index.js.map +1 -1
- package/dist/providers/agent-resolver.js +1 -1
- package/dist/providers/agent-resolver.js.map +1 -1
- package/dist/providers/claude-session.d.ts +2 -1
- package/dist/providers/claude-session.d.ts.map +1 -1
- package/dist/providers/claude-session.js +29 -2
- package/dist/providers/claude-session.js.map +1 -1
- package/dist/providers/codex-cli-session.d.ts +3 -2
- package/dist/providers/codex-cli-session.d.ts.map +1 -1
- package/dist/providers/codex-cli-session.js +5 -2
- package/dist/providers/codex-cli-session.js.map +1 -1
- package/dist/providers/provider-factory.d.ts +2 -2
- package/dist/providers/provider-factory.d.ts.map +1 -1
- package/dist/providers/provider-factory.js +12 -12
- package/dist/providers/provider-factory.js.map +1 -1
- package/dist/providers/runner-types.d.ts +3 -16
- package/dist/providers/runner-types.d.ts.map +1 -1
- package/dist/research/index.d.ts +11 -1
- package/dist/research/index.d.ts.map +1 -1
- package/dist/research/index.js +8 -1
- package/dist/research/index.js.map +1 -1
- package/dist/stores/context-block-tool.d.ts +2 -3
- package/dist/stores/context-block-tool.d.ts.map +1 -1
- package/dist/stores/context-block-tool.js +1 -1
- package/dist/stores/context-block-tool.js.map +1 -1
- package/dist/stores/project-context-registry.d.ts +0 -9
- package/dist/stores/project-context-registry.d.ts.map +1 -1
- package/dist/stores/project-context-registry.js +0 -4
- package/dist/stores/project-context-registry.js.map +1 -1
- package/dist/types/brief-quality-policy.d.ts.map +1 -1
- package/dist/types/enums.d.ts +0 -9
- package/dist/types/enums.d.ts.map +1 -1
- package/dist/types/enums.js +0 -10
- package/dist/types/enums.js.map +1 -1
- package/dist/types/run-result.d.ts +48 -23
- package/dist/types/run-result.d.ts.map +1 -1
- package/dist/types/run-result.js +3 -16
- package/dist/types/run-result.js.map +1 -1
- package/dist/types/stage-stats.d.ts +1 -1
- package/dist/types/stage-stats.d.ts.map +1 -1
- package/dist/types/stage-stats.js +2 -4
- package/dist/types/stage-stats.js.map +1 -1
- package/dist/types/task-spec.d.ts +3 -17
- package/dist/types/task-spec.d.ts.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/unified/reviewer-output-parser.d.ts +51 -0
- package/dist/unified/reviewer-output-parser.d.ts.map +1 -0
- package/dist/unified/reviewer-output-parser.js +39 -0
- package/dist/unified/reviewer-output-parser.js.map +1 -0
- package/dist/unified/skill-loader.d.ts +9 -0
- package/dist/unified/skill-loader.d.ts.map +1 -0
- package/dist/unified/skill-loader.js +45 -0
- package/dist/unified/skill-loader.js.map +1 -0
- package/dist/unified/task-input-schema.d.ts +217 -0
- package/dist/unified/task-input-schema.d.ts.map +1 -0
- package/dist/unified/task-input-schema.js +35 -0
- package/dist/unified/task-input-schema.js.map +1 -0
- package/dist/unified/task-registry.d.ts +23 -0
- package/dist/unified/task-registry.d.ts.map +1 -0
- package/dist/unified/task-registry.js +56 -0
- package/dist/unified/task-registry.js.map +1 -0
- package/dist/unified/two-phase-pipeline.d.ts +52 -0
- package/dist/unified/two-phase-pipeline.d.ts.map +1 -0
- package/dist/unified/two-phase-pipeline.js +95 -0
- package/dist/unified/two-phase-pipeline.js.map +1 -0
- package/dist/unified/type-registry.d.ts +13 -0
- package/dist/unified/type-registry.d.ts.map +1 -0
- package/dist/unified/type-registry.js +30 -0
- package/dist/unified/type-registry.js.map +1 -0
- package/dist/unified/worktree-manager.d.ts +43 -0
- package/dist/unified/worktree-manager.d.ts.map +1 -0
- package/dist/unified/worktree-manager.js +76 -0
- package/dist/unified/worktree-manager.js.map +1 -0
- package/package.json +7 -118
- package/src/skills/audit/implement-plan.md +182 -0
- package/src/skills/audit/implement-skill.md +72 -0
- package/src/skills/audit/implement-spec.md +91 -0
- package/src/skills/audit/implement.md +123 -0
- package/src/skills/audit/review.md +116 -0
- package/src/skills/debug/implement.md +81 -0
- package/src/skills/debug/review.md +69 -0
- package/src/skills/delegate/implement.md +61 -0
- package/src/skills/delegate/review.md +53 -0
- package/src/skills/execute_plan/implement.md +67 -0
- package/src/skills/execute_plan/review.md +63 -0
- package/src/skills/investigate/implement.md +88 -0
- package/src/skills/investigate/review.md +71 -0
- package/src/skills/journal_recall/implement.md +60 -0
- package/src/skills/journal_recall/review.md +69 -0
- package/src/skills/journal_record/implement.md +62 -0
- package/src/skills/journal_record/review.md +65 -0
- package/src/skills/main/implement.md +25 -0
- package/src/skills/main/review.md +3 -0
- package/src/skills/research/implement.md +82 -0
- package/src/skills/research/review.md +68 -0
- package/src/skills/retry_tasks/implement.md +1 -0
- package/src/skills/retry_tasks/review.md +1 -0
- package/src/skills/review/implement.md +87 -0
- package/src/skills/review/review.md +77 -0
- package/dist/bounded-execution/file-artifact-check.d.ts +0 -7
- package/dist/bounded-execution/file-artifact-check.d.ts.map +0 -1
- package/dist/bounded-execution/file-artifact-check.js +0 -13
- package/dist/bounded-execution/file-artifact-check.js.map +0 -1
- package/dist/bounded-execution/progress-events-subscriber.d.ts +0 -33
- package/dist/bounded-execution/progress-events-subscriber.d.ts.map +0 -1
- package/dist/bounded-execution/progress-events-subscriber.js +0 -59
- package/dist/bounded-execution/progress-events-subscriber.js.map +0 -1
- package/dist/bounded-execution/progress-watchdog.d.ts +0 -43
- package/dist/bounded-execution/progress-watchdog.d.ts.map +0 -1
- package/dist/bounded-execution/progress-watchdog.js +0 -170
- package/dist/bounded-execution/progress-watchdog.js.map +0 -1
- package/dist/bounded-execution/real-diff.d.ts +0 -17
- package/dist/bounded-execution/real-diff.d.ts.map +0 -1
- package/dist/bounded-execution/real-diff.js +0 -59
- package/dist/bounded-execution/real-diff.js.map +0 -1
- package/dist/bounded-execution/scope-match.d.ts +0 -7
- package/dist/bounded-execution/scope-match.d.ts.map +0 -1
- package/dist/bounded-execution/scope-match.js +0 -28
- package/dist/bounded-execution/scope-match.js.map +0 -1
- package/dist/bounded-execution/stall-watchdog.d.ts +0 -18
- package/dist/bounded-execution/stall-watchdog.d.ts.map +0 -1
- package/dist/bounded-execution/stall-watchdog.js +0 -134
- package/dist/bounded-execution/stall-watchdog.js.map +0 -1
- package/dist/bounded-execution/wall-clock-guard.d.ts +0 -12
- package/dist/bounded-execution/wall-clock-guard.d.ts.map +0 -1
- package/dist/bounded-execution/wall-clock-guard.js +0 -27
- package/dist/bounded-execution/wall-clock-guard.js.map +0 -1
- package/dist/config/canonical-model-identity.d.ts +0 -9
- package/dist/config/canonical-model-identity.d.ts.map +0 -1
- package/dist/config/canonical-model-identity.js +0 -54
- package/dist/config/canonical-model-identity.js.map +0 -1
- package/dist/journal/default-schema.d.ts +0 -2
- package/dist/journal/default-schema.d.ts.map +0 -1
- package/dist/journal/default-schema.js +0 -27
- package/dist/journal/default-schema.js.map +0 -1
- package/dist/journal/types.d.ts +0 -22
- package/dist/journal/types.d.ts.map +0 -1
- package/dist/journal/types.js +0 -5
- package/dist/journal/types.js.map +0 -1
- package/dist/lifecycle/annotate-parser.d.ts +0 -11
- package/dist/lifecycle/annotate-parser.d.ts.map +0 -1
- package/dist/lifecycle/annotate-parser.js +0 -74
- package/dist/lifecycle/annotate-parser.js.map +0 -1
- package/dist/lifecycle/annotate-prompts.d.ts +0 -9
- package/dist/lifecycle/annotate-prompts.d.ts.map +0 -1
- package/dist/lifecycle/annotate-prompts.js +0 -95
- package/dist/lifecycle/annotate-prompts.js.map +0 -1
- package/dist/lifecycle/auto-commit.d.ts +0 -3
- package/dist/lifecycle/auto-commit.d.ts.map +0 -1
- package/dist/lifecycle/auto-commit.js +0 -5
- package/dist/lifecycle/auto-commit.js.map +0 -1
- package/dist/lifecycle/auto-register-context-block.d.ts +0 -11
- package/dist/lifecycle/auto-register-context-block.d.ts.map +0 -1
- package/dist/lifecycle/auto-register-context-block.js +0 -18
- package/dist/lifecycle/auto-register-context-block.js.map +0 -1
- package/dist/lifecycle/build-cancelled-result.d.ts +0 -11
- package/dist/lifecycle/build-cancelled-result.d.ts.map +0 -1
- package/dist/lifecycle/build-cancelled-result.js +0 -25
- package/dist/lifecycle/build-cancelled-result.js.map +0 -1
- package/dist/lifecycle/derive-completion.d.ts +0 -28
- package/dist/lifecycle/derive-completion.d.ts.map +0 -1
- package/dist/lifecycle/derive-completion.js +0 -79
- package/dist/lifecycle/derive-completion.js.map +0 -1
- package/dist/lifecycle/executor-output-types.d.ts +0 -53
- package/dist/lifecycle/executor-output-types.d.ts.map +0 -1
- package/dist/lifecycle/executor-output-types.js +0 -2
- package/dist/lifecycle/executor-output-types.js.map +0 -1
- package/dist/lifecycle/file-confinement-check.d.ts +0 -17
- package/dist/lifecycle/file-confinement-check.d.ts.map +0 -1
- package/dist/lifecycle/file-confinement-check.js +0 -44
- package/dist/lifecycle/file-confinement-check.js.map +0 -1
- package/dist/lifecycle/findings-parser.d.ts +0 -18
- package/dist/lifecycle/findings-parser.d.ts.map +0 -1
- package/dist/lifecycle/findings-parser.js +0 -143
- package/dist/lifecycle/findings-parser.js.map +0 -1
- package/dist/lifecycle/git-exec.d.ts +0 -62
- package/dist/lifecycle/git-exec.d.ts.map +0 -1
- package/dist/lifecycle/git-exec.js +0 -135
- package/dist/lifecycle/git-exec.js.map +0 -1
- package/dist/lifecycle/git-toplevel.d.ts +0 -12
- package/dist/lifecycle/git-toplevel.d.ts.map +0 -1
- package/dist/lifecycle/git-toplevel.js +0 -52
- package/dist/lifecycle/git-toplevel.js.map +0 -1
- package/dist/lifecycle/goal-builder.d.ts +0 -35
- package/dist/lifecycle/goal-builder.d.ts.map +0 -1
- package/dist/lifecycle/goal-builder.js +0 -56
- package/dist/lifecycle/goal-builder.js.map +0 -1
- package/dist/lifecycle/goal-preconditions.d.ts +0 -21
- package/dist/lifecycle/goal-preconditions.d.ts.map +0 -1
- package/dist/lifecycle/goal-preconditions.js +0 -33
- package/dist/lifecycle/goal-preconditions.js.map +0 -1
- package/dist/lifecycle/goal-prompts.d.ts +0 -27
- package/dist/lifecycle/goal-prompts.d.ts.map +0 -1
- package/dist/lifecycle/goal-prompts.js +0 -204
- package/dist/lifecycle/goal-prompts.js.map +0 -1
- package/dist/lifecycle/goal-report.d.ts +0 -42
- package/dist/lifecycle/goal-report.d.ts.map +0 -1
- package/dist/lifecycle/goal-report.js +0 -125
- package/dist/lifecycle/goal-report.js.map +0 -1
- package/dist/lifecycle/handlers/annotate-stage.d.ts +0 -35
- package/dist/lifecycle/handlers/annotate-stage.d.ts.map +0 -1
- package/dist/lifecycle/handlers/annotate-stage.js +0 -387
- package/dist/lifecycle/handlers/annotate-stage.js.map +0 -1
- package/dist/lifecycle/handlers/baseline-handlers.d.ts +0 -12
- package/dist/lifecycle/handlers/baseline-handlers.d.ts.map +0 -1
- package/dist/lifecycle/handlers/baseline-handlers.js +0 -281
- package/dist/lifecycle/handlers/baseline-handlers.js.map +0 -1
- package/dist/lifecycle/handlers/enrich-runtime-result.d.ts +0 -3
- package/dist/lifecycle/handlers/enrich-runtime-result.d.ts.map +0 -1
- package/dist/lifecycle/handlers/enrich-runtime-result.js +0 -239
- package/dist/lifecycle/handlers/enrich-runtime-result.js.map +0 -1
- package/dist/lifecycle/handlers/implement-stage.d.ts +0 -10
- package/dist/lifecycle/handlers/implement-stage.d.ts.map +0 -1
- package/dist/lifecycle/handlers/implement-stage.js +0 -228
- package/dist/lifecycle/handlers/implement-stage.js.map +0 -1
- package/dist/lifecycle/handlers/prepare-execution-context-handler.d.ts +0 -13
- package/dist/lifecycle/handlers/prepare-execution-context-handler.d.ts.map +0 -1
- package/dist/lifecycle/handlers/prepare-execution-context-handler.js +0 -61
- package/dist/lifecycle/handlers/prepare-execution-context-handler.js.map +0 -1
- package/dist/lifecycle/handlers/read-route-implementer.d.ts +0 -52
- package/dist/lifecycle/handlers/read-route-implementer.d.ts.map +0 -1
- package/dist/lifecycle/handlers/read-route-implementer.js +0 -109
- package/dist/lifecycle/handlers/read-route-implementer.js.map +0 -1
- package/dist/lifecycle/handlers/register-context-block-handlers.d.ts +0 -4
- package/dist/lifecycle/handlers/register-context-block-handlers.d.ts.map +0 -1
- package/dist/lifecycle/handlers/register-context-block-handlers.js +0 -35
- package/dist/lifecycle/handlers/register-context-block-handlers.js.map +0 -1
- package/dist/lifecycle/handlers/review-fix-stage.d.ts +0 -9
- package/dist/lifecycle/handlers/review-fix-stage.d.ts.map +0 -1
- package/dist/lifecycle/handlers/review-fix-stage.js +0 -75
- package/dist/lifecycle/handlers/review-fix-stage.js.map +0 -1
- package/dist/lifecycle/handlers/terminal-handlers.d.ts +0 -61
- package/dist/lifecycle/handlers/terminal-handlers.d.ts.map +0 -1
- package/dist/lifecycle/handlers/terminal-handlers.js +0 -339
- package/dist/lifecycle/handlers/terminal-handlers.js.map +0 -1
- package/dist/lifecycle/lifecycle-context.d.ts +0 -109
- package/dist/lifecycle/lifecycle-context.d.ts.map +0 -1
- package/dist/lifecycle/lifecycle-context.js +0 -2
- package/dist/lifecycle/lifecycle-context.js.map +0 -1
- package/dist/lifecycle/lifecycle-dispatcher.d.ts +0 -35
- package/dist/lifecycle/lifecycle-dispatcher.d.ts.map +0 -1
- package/dist/lifecycle/lifecycle-dispatcher.js +0 -64
- package/dist/lifecycle/lifecycle-dispatcher.js.map +0 -1
- package/dist/lifecycle/lifecycle-driver.d.ts +0 -16
- package/dist/lifecycle/lifecycle-driver.d.ts.map +0 -1
- package/dist/lifecycle/lifecycle-driver.js +0 -334
- package/dist/lifecycle/lifecycle-driver.js.map +0 -1
- package/dist/lifecycle/merge-stage-stats.d.ts +0 -62
- package/dist/lifecycle/merge-stage-stats.d.ts.map +0 -1
- package/dist/lifecycle/merge-stage-stats.js +0 -136
- package/dist/lifecycle/merge-stage-stats.js.map +0 -1
- package/dist/lifecycle/normalize-output-targets.d.ts +0 -2
- package/dist/lifecycle/normalize-output-targets.d.ts.map +0 -1
- package/dist/lifecycle/normalize-output-targets.js +0 -14
- package/dist/lifecycle/normalize-output-targets.js.map +0 -1
- package/dist/lifecycle/perform-implementation.d.ts +0 -3
- package/dist/lifecycle/perform-implementation.d.ts.map +0 -1
- package/dist/lifecycle/perform-implementation.js +0 -371
- package/dist/lifecycle/perform-implementation.js.map +0 -1
- package/dist/lifecycle/read-only-subtype-spec.d.ts +0 -18
- package/dist/lifecycle/read-only-subtype-spec.d.ts.map +0 -1
- package/dist/lifecycle/read-only-subtype-spec.js +0 -2
- package/dist/lifecycle/read-only-subtype-spec.js.map +0 -1
- package/dist/lifecycle/review-verdict-mapping.d.ts +0 -16
- package/dist/lifecycle/review-verdict-mapping.d.ts.map +0 -1
- package/dist/lifecycle/review-verdict-mapping.js +0 -24
- package/dist/lifecycle/review-verdict-mapping.js.map +0 -1
- package/dist/lifecycle/shared-compute.d.ts +0 -14
- package/dist/lifecycle/shared-compute.d.ts.map +0 -1
- package/dist/lifecycle/shared-compute.js +0 -51
- package/dist/lifecycle/shared-compute.js.map +0 -1
- package/dist/lifecycle/stage-idle-tracker.d.ts +0 -14
- package/dist/lifecycle/stage-idle-tracker.d.ts.map +0 -1
- package/dist/lifecycle/stage-idle-tracker.js +0 -17
- package/dist/lifecycle/stage-idle-tracker.js.map +0 -1
- package/dist/lifecycle/stage-io.d.ts +0 -134
- package/dist/lifecycle/stage-io.d.ts.map +0 -1
- package/dist/lifecycle/stage-io.js +0 -9
- package/dist/lifecycle/stage-io.js.map +0 -1
- package/dist/lifecycle/stage-labels.d.ts +0 -7
- package/dist/lifecycle/stage-labels.d.ts.map +0 -1
- package/dist/lifecycle/stage-labels.js +0 -19
- package/dist/lifecycle/stage-labels.js.map +0 -1
- package/dist/lifecycle/stage-plan-builder.d.ts +0 -4
- package/dist/lifecycle/stage-plan-builder.d.ts.map +0 -1
- package/dist/lifecycle/stage-plan-builder.js +0 -157
- package/dist/lifecycle/stage-plan-builder.js.map +0 -1
- package/dist/lifecycle/stage-plan-types.d.ts +0 -131
- package/dist/lifecycle/stage-plan-types.d.ts.map +0 -1
- package/dist/lifecycle/stage-plan-types.js +0 -28
- package/dist/lifecycle/stage-plan-types.js.map +0 -1
- package/dist/lifecycle/stage-progression.d.ts +0 -6
- package/dist/lifecycle/stage-progression.d.ts.map +0 -1
- package/dist/lifecycle/stage-progression.js +0 -100
- package/dist/lifecycle/stage-progression.js.map +0 -1
- package/dist/lifecycle/task-executor.d.ts +0 -24
- package/dist/lifecycle/task-executor.d.ts.map +0 -1
- package/dist/lifecycle/task-executor.js +0 -365
- package/dist/lifecycle/task-executor.js.map +0 -1
- package/dist/lifecycle/task-runner.d.ts +0 -66
- package/dist/lifecycle/task-runner.d.ts.map +0 -1
- package/dist/lifecycle/task-runner.js +0 -334
- package/dist/lifecycle/task-runner.js.map +0 -1
- package/dist/lifecycle/tool-category.d.ts +0 -2
- package/dist/lifecycle/tool-category.d.ts.map +0 -1
- package/dist/lifecycle/tool-category.js +0 -6
- package/dist/lifecycle/tool-category.js.map +0 -1
- package/dist/lifecycle/tool-config-types.d.ts +0 -32
- package/dist/lifecycle/tool-config-types.d.ts.map +0 -1
- package/dist/lifecycle/tool-config-types.js +0 -2
- package/dist/lifecycle/tool-config-types.js.map +0 -1
- package/dist/lifecycle/warm-followup.d.ts +0 -3
- package/dist/lifecycle/warm-followup.d.ts.map +0 -1
- package/dist/lifecycle/warm-followup.js +0 -16
- package/dist/lifecycle/warm-followup.js.map +0 -1
- package/dist/lifecycle/worker-output-contract.d.ts +0 -22
- package/dist/lifecycle/worker-output-contract.d.ts.map +0 -1
- package/dist/lifecycle/worker-output-contract.js +0 -91
- package/dist/lifecycle/worker-output-contract.js.map +0 -1
- package/dist/lifecycle/write-goal-lock.d.ts +0 -29
- package/dist/lifecycle/write-goal-lock.d.ts.map +0 -1
- package/dist/lifecycle/write-goal-lock.js +0 -70
- package/dist/lifecycle/write-goal-lock.js.map +0 -1
- package/dist/providers/assemble-run-result.d.ts +0 -17
- package/dist/providers/assemble-run-result.d.ts.map +0 -1
- package/dist/providers/assemble-run-result.js +0 -52
- package/dist/providers/assemble-run-result.js.map +0 -1
- package/dist/providers/skill-resolver.d.ts +0 -17
- package/dist/providers/skill-resolver.d.ts.map +0 -1
- package/dist/providers/skill-resolver.js +0 -123
- package/dist/providers/skill-resolver.js.map +0 -1
- package/dist/reporting/batch-persister.d.ts +0 -4
- package/dist/reporting/batch-persister.d.ts.map +0 -1
- package/dist/reporting/batch-persister.js +0 -11
- package/dist/reporting/batch-persister.js.map +0 -1
- package/dist/reporting/commit-stage-runner.d.ts +0 -12
- package/dist/reporting/commit-stage-runner.d.ts.map +0 -1
- package/dist/reporting/commit-stage-runner.js +0 -43
- package/dist/reporting/commit-stage-runner.js.map +0 -1
- package/dist/reporting/derive-investigate-status.d.ts +0 -15
- package/dist/reporting/derive-investigate-status.d.ts.map +0 -1
- package/dist/reporting/derive-investigate-status.js +0 -23
- package/dist/reporting/derive-investigate-status.js.map +0 -1
- package/dist/reporting/extract-fenced-json.d.ts +0 -7
- package/dist/reporting/extract-fenced-json.d.ts.map +0 -1
- package/dist/reporting/extract-fenced-json.js +0 -17
- package/dist/reporting/extract-fenced-json.js.map +0 -1
- package/dist/reporting/findings-headline.d.ts +0 -12
- package/dist/reporting/findings-headline.d.ts.map +0 -1
- package/dist/reporting/findings-headline.js +0 -40
- package/dist/reporting/findings-headline.js.map +0 -1
- package/dist/reporting/findings-outcome.d.ts +0 -13
- package/dist/reporting/findings-outcome.d.ts.map +0 -1
- package/dist/reporting/findings-outcome.js +0 -22
- package/dist/reporting/findings-outcome.js.map +0 -1
- package/dist/reporting/headline-composer.d.ts +0 -29
- package/dist/reporting/headline-composer.d.ts.map +0 -1
- package/dist/reporting/headline-composer.js +0 -10
- package/dist/reporting/headline-composer.js.map +0 -1
- package/dist/reporting/headline-templates/delegate.d.ts +0 -3
- package/dist/reporting/headline-templates/delegate.d.ts.map +0 -1
- package/dist/reporting/headline-templates/delegate.js +0 -42
- package/dist/reporting/headline-templates/delegate.js.map +0 -1
- package/dist/reporting/headline-templates/execute-plan.d.ts +0 -3
- package/dist/reporting/headline-templates/execute-plan.d.ts.map +0 -1
- package/dist/reporting/headline-templates/execute-plan.js +0 -26
- package/dist/reporting/headline-templates/execute-plan.js.map +0 -1
- package/dist/reporting/headline-templates/investigate.d.ts +0 -13
- package/dist/reporting/headline-templates/investigate.d.ts.map +0 -1
- package/dist/reporting/headline-templates/investigate.js +0 -53
- package/dist/reporting/headline-templates/investigate.js.map +0 -1
- package/dist/reporting/headline-templates/journal-recall.d.ts +0 -3
- package/dist/reporting/headline-templates/journal-recall.d.ts.map +0 -1
- package/dist/reporting/headline-templates/journal-recall.js +0 -9
- package/dist/reporting/headline-templates/journal-recall.js.map +0 -1
- package/dist/reporting/headline-templates/journal.d.ts +0 -3
- package/dist/reporting/headline-templates/journal.d.ts.map +0 -1
- package/dist/reporting/headline-templates/journal.js +0 -17
- package/dist/reporting/headline-templates/journal.js.map +0 -1
- package/dist/reporting/headline-templates/research.d.ts +0 -3
- package/dist/reporting/headline-templates/research.d.ts.map +0 -1
- package/dist/reporting/headline-templates/research.js +0 -22
- package/dist/reporting/headline-templates/research.js.map +0 -1
- package/dist/reporting/headline-text.d.ts +0 -36
- package/dist/reporting/headline-text.d.ts.map +0 -1
- package/dist/reporting/headline-text.js +0 -73
- package/dist/reporting/headline-text.js.map +0 -1
- package/dist/reporting/report-parser-slots/delegate-report.d.ts +0 -8
- package/dist/reporting/report-parser-slots/delegate-report.d.ts.map +0 -1
- package/dist/reporting/report-parser-slots/delegate-report.js +0 -12
- package/dist/reporting/report-parser-slots/delegate-report.js.map +0 -1
- package/dist/reporting/report-parser-slots/execute-plan-report.d.ts +0 -11
- package/dist/reporting/report-parser-slots/execute-plan-report.d.ts.map +0 -1
- package/dist/reporting/report-parser-slots/execute-plan-report.js +0 -7
- package/dist/reporting/report-parser-slots/execute-plan-report.js.map +0 -1
- package/dist/reporting/report-parser-slots/investigate-report.d.ts +0 -52
- package/dist/reporting/report-parser-slots/investigate-report.d.ts.map +0 -1
- package/dist/reporting/report-parser-slots/investigate-report.js +0 -307
- package/dist/reporting/report-parser-slots/investigate-report.js.map +0 -1
- package/dist/reporting/report-parser-slots/journal-report.d.ts +0 -19
- package/dist/reporting/report-parser-slots/journal-report.d.ts.map +0 -1
- package/dist/reporting/report-parser-slots/journal-report.js +0 -13
- package/dist/reporting/report-parser-slots/journal-report.js.map +0 -1
- package/dist/reporting/report-parser-slots/no-structured-report.d.ts +0 -10
- package/dist/reporting/report-parser-slots/no-structured-report.d.ts.map +0 -1
- package/dist/reporting/report-parser-slots/no-structured-report.js +0 -13
- package/dist/reporting/report-parser-slots/no-structured-report.js.map +0 -1
- package/dist/reporting/report-parser-slots/research-report.d.ts +0 -31
- package/dist/reporting/report-parser-slots/research-report.d.ts.map +0 -1
- package/dist/reporting/report-parser-slots/research-report.js +0 -50
- package/dist/reporting/report-parser-slots/research-report.js.map +0 -1
- package/dist/reporting/response-envelope-builder.d.ts +0 -32
- package/dist/reporting/response-envelope-builder.d.ts.map +0 -1
- package/dist/reporting/response-envelope-builder.js +0 -26
- package/dist/reporting/response-envelope-builder.js.map +0 -1
- package/dist/reporting/severity.d.ts +0 -62
- package/dist/reporting/severity.d.ts.map +0 -1
- package/dist/reporting/severity.js +0 -93
- package/dist/reporting/severity.js.map +0 -1
- package/dist/reporting/structured-report-parser.d.ts +0 -9
- package/dist/reporting/structured-report-parser.d.ts.map +0 -1
- package/dist/reporting/structured-report-parser.js +0 -8
- package/dist/reporting/structured-report-parser.js.map +0 -1
- package/dist/reporting/terminal-block-registrar.d.ts +0 -14
- package/dist/reporting/terminal-block-registrar.d.ts.map +0 -1
- package/dist/reporting/terminal-block-registrar.js +0 -17
- package/dist/reporting/terminal-block-registrar.js.map +0 -1
- package/dist/reporting/terminal-report-markdown.d.ts +0 -13
- package/dist/reporting/terminal-report-markdown.d.ts.map +0 -1
- package/dist/reporting/terminal-report-markdown.js +0 -31
- package/dist/reporting/terminal-report-markdown.js.map +0 -1
- package/dist/research/research-pre-loop.d.ts +0 -22
- package/dist/research/research-pre-loop.d.ts.map +0 -1
- package/dist/research/research-pre-loop.js +0 -50
- package/dist/research/research-pre-loop.js.map +0 -1
- package/dist/routing/read-route-criteria.d.ts +0 -36
- package/dist/routing/read-route-criteria.d.ts.map +0 -1
- package/dist/routing/read-route-criteria.js +0 -71
- package/dist/routing/read-route-criteria.js.map +0 -1
- package/dist/stores/batch-cache.d.ts +0 -29
- package/dist/stores/batch-cache.d.ts.map +0 -1
- package/dist/stores/batch-cache.js +0 -89
- package/dist/stores/batch-cache.js.map +0 -1
- package/dist/stores/batch-registry.d.ts +0 -138
- package/dist/stores/batch-registry.d.ts.map +0 -1
- package/dist/stores/batch-registry.js +0 -205
- package/dist/stores/batch-registry.js.map +0 -1
- package/dist/tool-surface/register-all-tools.d.ts +0 -4
- package/dist/tool-surface/register-all-tools.d.ts.map +0 -1
- package/dist/tool-surface/register-all-tools.js +0 -35
- package/dist/tool-surface/register-all-tools.js.map +0 -1
- package/dist/tool-surface/tool-surface-registry.d.ts +0 -28
- package/dist/tool-surface/tool-surface-registry.d.ts.map +0 -1
- package/dist/tool-surface/tool-surface-registry.js +0 -16
- package/dist/tool-surface/tool-surface-registry.js.map +0 -1
- package/dist/tools/audit/brief-slot.d.ts +0 -15
- package/dist/tools/audit/brief-slot.d.ts.map +0 -1
- package/dist/tools/audit/brief-slot.js +0 -69
- package/dist/tools/audit/brief-slot.js.map +0 -1
- package/dist/tools/audit/implementer-criteria.d.ts +0 -62
- package/dist/tools/audit/implementer-criteria.d.ts.map +0 -1
- package/dist/tools/audit/implementer-criteria.js +0 -121
- package/dist/tools/audit/implementer-criteria.js.map +0 -1
- package/dist/tools/audit/plan-audit-criteria.d.ts +0 -35
- package/dist/tools/audit/plan-audit-criteria.d.ts.map +0 -1
- package/dist/tools/audit/plan-audit-criteria.js +0 -159
- package/dist/tools/audit/plan-audit-criteria.js.map +0 -1
- package/dist/tools/audit/schema.d.ts +0 -61
- package/dist/tools/audit/schema.d.ts.map +0 -1
- package/dist/tools/audit/schema.js +0 -21
- package/dist/tools/audit/schema.js.map +0 -1
- package/dist/tools/audit/skill-audit-criteria.d.ts +0 -9
- package/dist/tools/audit/skill-audit-criteria.d.ts.map +0 -1
- package/dist/tools/audit/skill-audit-criteria.js +0 -52
- package/dist/tools/audit/skill-audit-criteria.js.map +0 -1
- package/dist/tools/audit/spec-audit-criteria.d.ts +0 -9
- package/dist/tools/audit/spec-audit-criteria.d.ts.map +0 -1
- package/dist/tools/audit/spec-audit-criteria.js +0 -55
- package/dist/tools/audit/spec-audit-criteria.js.map +0 -1
- package/dist/tools/audit/subtypes.d.ts +0 -4
- package/dist/tools/audit/subtypes.d.ts.map +0 -1
- package/dist/tools/audit/subtypes.js +0 -69
- package/dist/tools/audit/subtypes.js.map +0 -1
- package/dist/tools/audit/tool-config.d.ts +0 -7
- package/dist/tools/audit/tool-config.d.ts.map +0 -1
- package/dist/tools/audit/tool-config.js +0 -60
- package/dist/tools/audit/tool-config.js.map +0 -1
- package/dist/tools/criteria-types.d.ts +0 -27
- package/dist/tools/criteria-types.d.ts.map +0 -1
- package/dist/tools/criteria-types.js +0 -25
- package/dist/tools/criteria-types.js.map +0 -1
- package/dist/tools/debug/brief-slot.d.ts +0 -15
- package/dist/tools/debug/brief-slot.d.ts.map +0 -1
- package/dist/tools/debug/brief-slot.js +0 -10
- package/dist/tools/debug/brief-slot.js.map +0 -1
- package/dist/tools/debug/implementer-criteria.d.ts +0 -45
- package/dist/tools/debug/implementer-criteria.d.ts.map +0 -1
- package/dist/tools/debug/implementer-criteria.js +0 -97
- package/dist/tools/debug/implementer-criteria.js.map +0 -1
- package/dist/tools/debug/schema.d.ts +0 -60
- package/dist/tools/debug/schema.d.ts.map +0 -1
- package/dist/tools/debug/schema.js +0 -17
- package/dist/tools/debug/schema.js.map +0 -1
- package/dist/tools/debug/subtypes.d.ts +0 -4
- package/dist/tools/debug/subtypes.d.ts.map +0 -1
- package/dist/tools/debug/subtypes.js +0 -26
- package/dist/tools/debug/subtypes.js.map +0 -1
- package/dist/tools/debug/tool-config.d.ts +0 -7
- package/dist/tools/debug/tool-config.d.ts.map +0 -1
- package/dist/tools/debug/tool-config.js +0 -55
- package/dist/tools/debug/tool-config.js.map +0 -1
- package/dist/tools/delegate/brief-slot.d.ts +0 -20
- package/dist/tools/delegate/brief-slot.d.ts.map +0 -1
- package/dist/tools/delegate/brief-slot.js +0 -31
- package/dist/tools/delegate/brief-slot.js.map +0 -1
- package/dist/tools/delegate/implementer-criteria.d.ts +0 -53
- package/dist/tools/delegate/implementer-criteria.d.ts.map +0 -1
- package/dist/tools/delegate/implementer-criteria.js +0 -99
- package/dist/tools/delegate/implementer-criteria.js.map +0 -1
- package/dist/tools/delegate/schema.d.ts +0 -70
- package/dist/tools/delegate/schema.d.ts.map +0 -1
- package/dist/tools/delegate/schema.js +0 -24
- package/dist/tools/delegate/schema.js.map +0 -1
- package/dist/tools/delegate/tool-config.d.ts +0 -7
- package/dist/tools/delegate/tool-config.d.ts.map +0 -1
- package/dist/tools/delegate/tool-config.js +0 -47
- package/dist/tools/delegate/tool-config.js.map +0 -1
- package/dist/tools/execute-plan/barrel.d.ts +0 -2
- package/dist/tools/execute-plan/barrel.d.ts.map +0 -1
- package/dist/tools/execute-plan/barrel.js +0 -7
- package/dist/tools/execute-plan/barrel.js.map +0 -1
- package/dist/tools/execute-plan/brief-slot.d.ts +0 -25
- package/dist/tools/execute-plan/brief-slot.d.ts.map +0 -1
- package/dist/tools/execute-plan/brief-slot.js +0 -124
- package/dist/tools/execute-plan/brief-slot.js.map +0 -1
- package/dist/tools/execute-plan/implementer-criteria.d.ts +0 -57
- package/dist/tools/execute-plan/implementer-criteria.d.ts.map +0 -1
- package/dist/tools/execute-plan/implementer-criteria.js +0 -108
- package/dist/tools/execute-plan/implementer-criteria.js.map +0 -1
- package/dist/tools/execute-plan/plan-extractor.d.ts +0 -21
- package/dist/tools/execute-plan/plan-extractor.d.ts.map +0 -1
- package/dist/tools/execute-plan/plan-extractor.js +0 -96
- package/dist/tools/execute-plan/plan-extractor.js.map +0 -1
- package/dist/tools/execute-plan/tool-config.d.ts +0 -68
- package/dist/tools/execute-plan/tool-config.d.ts.map +0 -1
- package/dist/tools/execute-plan/tool-config.js +0 -58
- package/dist/tools/execute-plan/tool-config.js.map +0 -1
- package/dist/tools/index.d.ts +0 -8
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -14
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/investigate/brief-slot.d.ts +0 -15
- package/dist/tools/investigate/brief-slot.d.ts.map +0 -1
- package/dist/tools/investigate/brief-slot.js +0 -9
- package/dist/tools/investigate/brief-slot.js.map +0 -1
- package/dist/tools/investigate/implementer-criteria.d.ts +0 -52
- package/dist/tools/investigate/implementer-criteria.d.ts.map +0 -1
- package/dist/tools/investigate/implementer-criteria.js +0 -106
- package/dist/tools/investigate/implementer-criteria.js.map +0 -1
- package/dist/tools/investigate/schema.d.ts +0 -62
- package/dist/tools/investigate/schema.d.ts.map +0 -1
- package/dist/tools/investigate/schema.js +0 -13
- package/dist/tools/investigate/schema.js.map +0 -1
- package/dist/tools/investigate/subtypes.d.ts +0 -4
- package/dist/tools/investigate/subtypes.d.ts.map +0 -1
- package/dist/tools/investigate/subtypes.js +0 -26
- package/dist/tools/investigate/subtypes.js.map +0 -1
- package/dist/tools/investigate/tool-config.d.ts +0 -8
- package/dist/tools/investigate/tool-config.d.ts.map +0 -1
- package/dist/tools/investigate/tool-config.js +0 -68
- package/dist/tools/investigate/tool-config.js.map +0 -1
- package/dist/tools/journal/recall/brief-slot.d.ts +0 -7
- package/dist/tools/journal/recall/brief-slot.d.ts.map +0 -1
- package/dist/tools/journal/recall/brief-slot.js +0 -5
- package/dist/tools/journal/recall/brief-slot.js.map +0 -1
- package/dist/tools/journal/recall/implementer-criteria.d.ts +0 -9
- package/dist/tools/journal/recall/implementer-criteria.d.ts.map +0 -1
- package/dist/tools/journal/recall/implementer-criteria.js +0 -23
- package/dist/tools/journal/recall/implementer-criteria.js.map +0 -1
- package/dist/tools/journal/recall/schema.d.ts +0 -54
- package/dist/tools/journal/recall/schema.d.ts.map +0 -1
- package/dist/tools/journal/recall/schema.js +0 -10
- package/dist/tools/journal/recall/schema.js.map +0 -1
- package/dist/tools/journal/recall/subtypes.d.ts +0 -4
- package/dist/tools/journal/recall/subtypes.d.ts.map +0 -1
- package/dist/tools/journal/recall/subtypes.js +0 -25
- package/dist/tools/journal/recall/subtypes.js.map +0 -1
- package/dist/tools/journal/recall/tool-config.d.ts +0 -8
- package/dist/tools/journal/recall/tool-config.d.ts.map +0 -1
- package/dist/tools/journal/recall/tool-config.js +0 -46
- package/dist/tools/journal/recall/tool-config.js.map +0 -1
- package/dist/tools/journal/record/brief-slot.d.ts +0 -15
- package/dist/tools/journal/record/brief-slot.d.ts.map +0 -1
- package/dist/tools/journal/record/brief-slot.js +0 -28
- package/dist/tools/journal/record/brief-slot.js.map +0 -1
- package/dist/tools/journal/record/implementer-criteria.d.ts +0 -6
- package/dist/tools/journal/record/implementer-criteria.d.ts.map +0 -1
- package/dist/tools/journal/record/implementer-criteria.js +0 -20
- package/dist/tools/journal/record/implementer-criteria.js.map +0 -1
- package/dist/tools/journal/record/schema.d.ts +0 -55
- package/dist/tools/journal/record/schema.d.ts.map +0 -1
- package/dist/tools/journal/record/schema.js +0 -12
- package/dist/tools/journal/record/schema.js.map +0 -1
- package/dist/tools/journal/record/tool-config.d.ts +0 -7
- package/dist/tools/journal/record/tool-config.d.ts.map +0 -1
- package/dist/tools/journal/record/tool-config.js +0 -47
- package/dist/tools/journal/record/tool-config.js.map +0 -1
- package/dist/tools/read-route-prompt.d.ts +0 -113
- package/dist/tools/read-route-prompt.d.ts.map +0 -1
- package/dist/tools/read-route-prompt.js +0 -86
- package/dist/tools/read-route-prompt.js.map +0 -1
- package/dist/tools/register-context-block/schema.d.ts +0 -8
- package/dist/tools/register-context-block/schema.d.ts.map +0 -1
- package/dist/tools/register-context-block/schema.js +0 -7
- package/dist/tools/register-context-block/schema.js.map +0 -1
- package/dist/tools/register-context-block/tool-config.d.ts +0 -6
- package/dist/tools/register-context-block/tool-config.d.ts.map +0 -1
- package/dist/tools/register-context-block/tool-config.js +0 -39
- package/dist/tools/register-context-block/tool-config.js.map +0 -1
- package/dist/tools/research/brief-slot.d.ts +0 -37
- package/dist/tools/research/brief-slot.d.ts.map +0 -1
- package/dist/tools/research/brief-slot.js +0 -68
- package/dist/tools/research/brief-slot.js.map +0 -1
- package/dist/tools/research/implementer-criteria.d.ts +0 -13
- package/dist/tools/research/implementer-criteria.d.ts.map +0 -1
- package/dist/tools/research/implementer-criteria.js +0 -109
- package/dist/tools/research/implementer-criteria.js.map +0 -1
- package/dist/tools/research/schema.d.ts +0 -11
- package/dist/tools/research/schema.d.ts.map +0 -1
- package/dist/tools/research/schema.js +0 -59
- package/dist/tools/research/schema.js.map +0 -1
- package/dist/tools/research/subtypes.d.ts +0 -4
- package/dist/tools/research/subtypes.d.ts.map +0 -1
- package/dist/tools/research/subtypes.js +0 -25
- package/dist/tools/research/subtypes.js.map +0 -1
- package/dist/tools/research/tool-config.d.ts +0 -8
- package/dist/tools/research/tool-config.d.ts.map +0 -1
- package/dist/tools/research/tool-config.js +0 -48
- package/dist/tools/research/tool-config.js.map +0 -1
- package/dist/tools/research/two-turn-driver.d.ts +0 -16
- package/dist/tools/research/two-turn-driver.d.ts.map +0 -1
- package/dist/tools/research/two-turn-driver.js +0 -41
- package/dist/tools/research/two-turn-driver.js.map +0 -1
- package/dist/tools/retry/brief-slot.d.ts +0 -7
- package/dist/tools/retry/brief-slot.d.ts.map +0 -1
- package/dist/tools/retry/brief-slot.js +0 -3
- package/dist/tools/retry/brief-slot.js.map +0 -1
- package/dist/tools/retry/schema.d.ts +0 -53
- package/dist/tools/retry/schema.d.ts.map +0 -1
- package/dist/tools/retry/schema.js +0 -12
- package/dist/tools/retry/schema.js.map +0 -1
- package/dist/tools/retry/tool-config.d.ts +0 -7
- package/dist/tools/retry/tool-config.d.ts.map +0 -1
- package/dist/tools/retry/tool-config.js +0 -79
- package/dist/tools/retry/tool-config.js.map +0 -1
- package/dist/tools/review/brief-slot.d.ts +0 -11
- package/dist/tools/review/brief-slot.d.ts.map +0 -1
- package/dist/tools/review/brief-slot.js +0 -23
- package/dist/tools/review/brief-slot.js.map +0 -1
- package/dist/tools/review/implementer-criteria.d.ts +0 -48
- package/dist/tools/review/implementer-criteria.d.ts.map +0 -1
- package/dist/tools/review/implementer-criteria.js +0 -108
- package/dist/tools/review/implementer-criteria.js.map +0 -1
- package/dist/tools/review/schema.d.ts +0 -64
- package/dist/tools/review/schema.d.ts.map +0 -1
- package/dist/tools/review/schema.js +0 -17
- package/dist/tools/review/schema.js.map +0 -1
- package/dist/tools/review/subtypes.d.ts +0 -4
- package/dist/tools/review/subtypes.d.ts.map +0 -1
- package/dist/tools/review/subtypes.js +0 -27
- package/dist/tools/review/subtypes.js.map +0 -1
- package/dist/tools/review/tool-config.d.ts +0 -7
- package/dist/tools/review/tool-config.d.ts.map +0 -1
- package/dist/tools/review/tool-config.js +0 -94
- package/dist/tools/review/tool-config.js.map +0 -1
- package/dist/tools/shared-output.d.ts +0 -56
- package/dist/tools/shared-output.d.ts.map +0 -1
- package/dist/tools/shared-output.js +0 -33
- package/dist/tools/shared-output.js.map +0 -1
- package/dist/types/review-policy.d.ts +0 -2
- package/dist/types/review-policy.d.ts.map +0 -1
- package/dist/types/review-policy.js +0 -2
- package/dist/types/review-policy.js.map +0 -1
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { execFile } from 'node:child_process';
|
|
2
|
-
import { promisify } from 'node:util';
|
|
3
|
-
const execFileP = promisify(execFile);
|
|
4
|
-
/**
|
|
5
|
-
* Run a git subcommand in `cwd`. Never throws — a non-zero exit (or spawn
|
|
6
|
-
* failure) is returned as `{ code, stderr }`. Shared by the goal-set executor
|
|
7
|
-
* (preconditions, baseSha capture, git-log report) so git plumbing lives in one
|
|
8
|
-
* place rather than inline in a handler.
|
|
9
|
-
*/
|
|
10
|
-
export async function gitC(cwd, args) {
|
|
11
|
-
try {
|
|
12
|
-
const { stdout, stderr } = await execFileP('git', ['-C', cwd, ...args], { windowsHide: true });
|
|
13
|
-
return { stdout, stderr, code: 0 };
|
|
14
|
-
}
|
|
15
|
-
catch (err) {
|
|
16
|
-
const e = err;
|
|
17
|
-
return {
|
|
18
|
-
stdout: e.stdout ?? '',
|
|
19
|
-
stderr: e.stderr ?? e.message ?? String(err),
|
|
20
|
-
code: typeof e.code === 'number' ? e.code : 1,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
/** True when `cwd` is inside a git work-tree. */
|
|
25
|
-
export async function isInsideWorkTree(cwd) {
|
|
26
|
-
const r = await gitC(cwd, ['rev-parse', '--is-inside-work-tree']);
|
|
27
|
-
return r.code === 0 && r.stdout.trim() === 'true';
|
|
28
|
-
}
|
|
29
|
-
/** Resolved HEAD sha, or null when HEAD is unborn / unresolvable. */
|
|
30
|
-
export async function currentHead(cwd) {
|
|
31
|
-
const r = await gitC(cwd, ['rev-parse', 'HEAD']);
|
|
32
|
-
if (r.code !== 0)
|
|
33
|
-
return null;
|
|
34
|
-
const sha = r.stdout.trim();
|
|
35
|
-
return sha.length > 0 ? sha : null;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* True when the work-tree has no uncommitted changes (tracked or untracked).
|
|
39
|
-
* Uses `git status --porcelain` — empty output means clean.
|
|
40
|
-
*/
|
|
41
|
-
export async function isCleanWorkTree(cwd) {
|
|
42
|
-
const r = await gitC(cwd, ['status', '--porcelain']);
|
|
43
|
-
return r.code === 0 && r.stdout.trim() === '';
|
|
44
|
-
}
|
|
45
|
-
/** True when `ancestor` is an ancestor of (or equal to) `descendant`. */
|
|
46
|
-
export async function isAncestor(cwd, ancestor, descendant) {
|
|
47
|
-
if (ancestor === descendant)
|
|
48
|
-
return true;
|
|
49
|
-
const r = await gitC(cwd, ['merge-base', '--is-ancestor', ancestor, descendant]);
|
|
50
|
-
return r.code === 0;
|
|
51
|
-
}
|
|
52
|
-
/** Number of commits in `base..HEAD` (0 when none / base unresolved). */
|
|
53
|
-
export async function commitCount(cwd, base) {
|
|
54
|
-
const r = await gitC(cwd, ['rev-list', '--count', `${base}..HEAD`]);
|
|
55
|
-
if (r.code !== 0)
|
|
56
|
-
return 0;
|
|
57
|
-
const n = Number.parseInt(r.stdout.trim(), 10);
|
|
58
|
-
return Number.isFinite(n) ? n : 0;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Structured commit list for `base..HEAD`, oldest-first. Subjects + changed
|
|
62
|
-
* files only (no patch bodies) so the payload stays bounded — see the spec's
|
|
63
|
-
* git-log-format note. Returns [] when base is unresolved or there are none.
|
|
64
|
-
*/
|
|
65
|
-
export async function gitLogCommits(cwd, base) {
|
|
66
|
-
// %x00 record sep, %x1e field sep: sha, subject. Then --name-only file lines.
|
|
67
|
-
const r = await gitC(cwd, [
|
|
68
|
-
'log', '--reverse', '--name-only', '--no-color',
|
|
69
|
-
'--pretty=format:%x1e%H%x1f%s', `${base}..HEAD`,
|
|
70
|
-
]);
|
|
71
|
-
if (r.code !== 0 || r.stdout.trim() === '')
|
|
72
|
-
return [];
|
|
73
|
-
const commits = [];
|
|
74
|
-
const records = r.stdout.split('\x1e').filter((s) => s.length > 0);
|
|
75
|
-
for (const rec of records) {
|
|
76
|
-
const nlIdx = rec.indexOf('\n');
|
|
77
|
-
const header = nlIdx === -1 ? rec : rec.slice(0, nlIdx);
|
|
78
|
-
const [sha, subject] = header.split('\x1f');
|
|
79
|
-
const fileBlock = nlIdx === -1 ? '' : rec.slice(nlIdx + 1);
|
|
80
|
-
const filesChanged = fileBlock.split('\n').map((l) => l.trim()).filter((l) => l.length > 0);
|
|
81
|
-
commits.push({ sha: (sha ?? '').trim(), subject: (subject ?? '').trim(), filesChanged });
|
|
82
|
-
}
|
|
83
|
-
return commits;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Render `base..HEAD` as `git log --stat`-style text for the phase-2 handoff,
|
|
87
|
-
* truncated to `maxBytes` with a marker. Subjects + per-commit file lists, no
|
|
88
|
-
* patch body.
|
|
89
|
-
*/
|
|
90
|
-
export async function renderGitLogStat(cwd, base, maxBytes = 128 * 1024) {
|
|
91
|
-
const r = await gitC(cwd, ['log', '--stat', '--no-patch', '--no-color', `${base}..HEAD`]);
|
|
92
|
-
const full = r.code === 0 ? r.stdout : '';
|
|
93
|
-
if (Buffer.byteLength(full, 'utf8') <= maxBytes)
|
|
94
|
-
return { text: full, truncated: false };
|
|
95
|
-
// Truncate on a UTF-8-safe boundary.
|
|
96
|
-
const buf = Buffer.from(full, 'utf8').subarray(0, maxBytes);
|
|
97
|
-
return { text: buf.toString('utf8') + '\n…[git_log_truncated]…\n', truncated: true };
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Render the UNCOMMITTED working-tree state for the phase-2 prompt: `git status
|
|
101
|
-
* --short` plus a `--stat` of staged+unstaged changes (no patch body). This is
|
|
102
|
-
* what lets the review-fix tier see work the implementer wrote but did NOT
|
|
103
|
-
* commit — without it, an implementer that under-commits leaves phase 2 blind.
|
|
104
|
-
* Returns '(clean working tree)' when there are no uncommitted changes.
|
|
105
|
-
*/
|
|
106
|
-
export async function renderWorkingTreeStatus(cwd, maxBytes = 64 * 1024) {
|
|
107
|
-
const status = await gitC(cwd, ['status', '--short']);
|
|
108
|
-
if (status.code !== 0)
|
|
109
|
-
return '(working-tree status unavailable)';
|
|
110
|
-
if (status.stdout.trim() === '')
|
|
111
|
-
return '(clean working tree — nothing uncommitted)';
|
|
112
|
-
const stat = await gitC(cwd, ['diff', 'HEAD', '--stat', '--no-color']);
|
|
113
|
-
const text = `Uncommitted changes (git status --short):\n${status.stdout}\n` +
|
|
114
|
-
(stat.code === 0 && stat.stdout.trim() ? `\nDiff stat vs HEAD:\n${stat.stdout}` : '');
|
|
115
|
-
if (Buffer.byteLength(text, 'utf8') <= maxBytes)
|
|
116
|
-
return text;
|
|
117
|
-
return Buffer.from(text, 'utf8').subarray(0, maxBytes).toString('utf8') + '\n…[truncated]…\n';
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Ensure a committer identity is resolvable for the agent's own `git commit`
|
|
121
|
-
* calls. The agent commits in its own subprocess, so env overrides won't reach
|
|
122
|
-
* it — instead, when the repo/global config has no identity, set a goal-set
|
|
123
|
-
* identity in the **local repo config** so the agent's commits inherit it.
|
|
124
|
-
* Returns true when it set one, false when an identity already existed.
|
|
125
|
-
*/
|
|
126
|
-
export async function ensureGitIdentity(cwd, goalId) {
|
|
127
|
-
const name = await gitC(cwd, ['config', 'user.name']);
|
|
128
|
-
const email = await gitC(cwd, ['config', 'user.email']);
|
|
129
|
-
if (name.code === 0 && name.stdout.trim() && email.code === 0 && email.stdout.trim())
|
|
130
|
-
return false;
|
|
131
|
-
await gitC(cwd, ['config', 'user.name', `MMA Goal ${goalId}`]);
|
|
132
|
-
await gitC(cwd, ['config', 'user.email', 'noreply@mmagent.local']);
|
|
133
|
-
return true;
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=git-exec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-exec.js","sourceRoot":"","sources":["../../src/lifecycle/git-exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAQtC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,GAAW,EAAE,IAAc;IACpD,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/F,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IACrC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,CAAC,GAAG,GAA4E,CAAC;QACvF,OAAO;YACL,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,EAAE;YACtB,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC;YAC5C,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAC9C,CAAC;IACJ,CAAC;AACH,CAAC;AAED,iDA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CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,mBAAmB,CAAC;AAChG,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,GAAW,EAAE,MAAc;IACjE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;IACxD,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE;QAAE,OAAO,KAAK,CAAC;IACnG,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,YAAY,MAAM,EAAE,CAAC,CAAC,CAAC;IAC/D,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,uBAAuB,CAAC,CAAC,CAAC;IACnE,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface ResolveOptions {
|
|
2
|
-
timeoutMs?: number;
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Returns the canonical absolute path of the git toplevel for `cwd`, or
|
|
6
|
-
* null if `cwd` is not in a git repo, git is unavailable, the directory
|
|
7
|
-
* does not exist, or the spawn times out (default 5 s).
|
|
8
|
-
*
|
|
9
|
-
* Pure function of (cwd, filesystem state). Never throws.
|
|
10
|
-
*/
|
|
11
|
-
export declare function resolveGitToplevel(cwd: string, opts?: ResolveOptions): Promise<string | null>;
|
|
12
|
-
//# sourceMappingURL=git-toplevel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-toplevel.d.ts","sourceRoot":"","sources":["../../src/lifecycle/git-toplevel.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,cAAmB,GACxB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAmCxB"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { spawn } from 'node:child_process';
|
|
2
|
-
/**
|
|
3
|
-
* Returns the canonical absolute path of the git toplevel for `cwd`, or
|
|
4
|
-
* null if `cwd` is not in a git repo, git is unavailable, the directory
|
|
5
|
-
* does not exist, or the spawn times out (default 5 s).
|
|
6
|
-
*
|
|
7
|
-
* Pure function of (cwd, filesystem state). Never throws.
|
|
8
|
-
*/
|
|
9
|
-
export async function resolveGitToplevel(cwd, opts = {}) {
|
|
10
|
-
const timeoutMs = opts.timeoutMs ?? 5000;
|
|
11
|
-
return new Promise((resolve) => {
|
|
12
|
-
let settled = false;
|
|
13
|
-
const settle = (value) => {
|
|
14
|
-
if (settled)
|
|
15
|
-
return;
|
|
16
|
-
settled = true;
|
|
17
|
-
resolve(value);
|
|
18
|
-
};
|
|
19
|
-
let child;
|
|
20
|
-
try {
|
|
21
|
-
child = spawn('git', ['-C', cwd, 'rev-parse', '--show-toplevel'], {
|
|
22
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
23
|
-
// windowsHide: suppress the console window Windows opens per spawned
|
|
24
|
-
// console binary when the daemon has no attached console. No-op on POSIX.
|
|
25
|
-
windowsHide: true,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
settle(null);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
let stdout = '';
|
|
33
|
-
child.stdout?.on('data', (b) => { stdout += b.toString('utf8'); });
|
|
34
|
-
child.stderr?.on('data', () => { });
|
|
35
|
-
child.on('error', () => settle(null));
|
|
36
|
-
child.on('exit', (code) => {
|
|
37
|
-
if (code === 0)
|
|
38
|
-
settle(stdout.trim() || null);
|
|
39
|
-
else
|
|
40
|
-
settle(null);
|
|
41
|
-
});
|
|
42
|
-
const t = setTimeout(() => {
|
|
43
|
-
try {
|
|
44
|
-
child.kill('SIGKILL');
|
|
45
|
-
}
|
|
46
|
-
catch { /* ignore */ }
|
|
47
|
-
settle(null);
|
|
48
|
-
}, timeoutMs);
|
|
49
|
-
child.on('exit', () => clearTimeout(t));
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=git-toplevel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-toplevel.js","sourceRoot":"","sources":["../../src/lifecycle/git-toplevel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAM3C;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,GAAW,EACX,OAAuB,EAAE;IAEzB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC;IACzC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,MAAM,MAAM,GAAG,CAAC,KAAoB,EAAE,EAAE;YACtC,IAAI,OAAO;gBAAE,OAAO;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC,CAAC;QACF,IAAI,KAAK,CAAC;QACV,IAAI,CAAC;YACH,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,iBAAiB,CAAC,EAAE;gBAChE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,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../types/goal.js';
|
|
2
|
-
import type { ToolMode, SandboxPolicy } from '../types/task-spec.js';
|
|
3
|
-
export interface TaskInput {
|
|
4
|
-
heading: string;
|
|
5
|
-
body: string;
|
|
6
|
-
/** 1-based plan-phase; defaults to 1 (single checkpoint). */
|
|
7
|
-
phase?: number;
|
|
8
|
-
}
|
|
9
|
-
export interface AssembleGoalArgs {
|
|
10
|
-
source: GoalSource;
|
|
11
|
-
cwd: string;
|
|
12
|
-
tasks: TaskInput[];
|
|
13
|
-
/** Phase tiers. [implement] or [implement, review-fix]. */
|
|
14
|
-
phases: GoalPhase[];
|
|
15
|
-
reviewPolicy: GoalReviewPolicy;
|
|
16
|
-
tools: ToolMode;
|
|
17
|
-
sandboxPolicy: SandboxPolicy;
|
|
18
|
-
skills?: string[];
|
|
19
|
-
contextBlockIds?: string[];
|
|
20
|
-
goalId?: string;
|
|
21
|
-
/** Route-specific procedure prepended to both phase prompts. */
|
|
22
|
-
preamble?: string;
|
|
23
|
-
/** Operator's per-task wall-clock budget (config.defaults.timeoutMs); the phase
|
|
24
|
-
* deadline scales off it. Falls back to PER_TASK_DEFAULT_MS when unset. */
|
|
25
|
-
perTaskTimeoutMs?: number;
|
|
26
|
-
}
|
|
27
|
-
export declare function assembleGoal(args: AssembleGoalArgs): Goal;
|
|
28
|
-
/**
|
|
29
|
-
* Map a goal into the single TaskSpec the executor dispatches. The implement
|
|
30
|
-
* prompt is materialized into `prompt`; phase-1 tier becomes `agentType`;
|
|
31
|
-
* `reviewPolicy` collapses to the lifecycle's none/full axis (the review-fix
|
|
32
|
-
* stage only distinguishes none vs run).
|
|
33
|
-
*/
|
|
34
|
-
export declare function goalToTaskSpec(goal: Goal, implementPrompt: string, timeoutMs: number): import('../types.js').TaskSpec;
|
|
35
|
-
//# sourceMappingURL=goal-builder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"goal-builder.d.ts","sourceRoot":"","sources":["../../src/lifecycle/goal-builder.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAY,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAChG,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGrE,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,UAAU,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,2DAA2D;IAC3D,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,YAAY,EAAE,gBAAgB,CAAC;IAC/B,KAAK,EAAE,QAAQ,CAAC;IAChB,aAAa,EAAE,aAAa,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;gFAC4E;IAC5E,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,CA2BzD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,EACV,eAAe,EAAE,MAAM,EACvB,SAAS,EAAE,MAAM,GAChB,OAAO,aAAa,EAAE,QAAQ,CAchC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// Shared Goal assembler. Each write route's briefSlot derives its task list +
|
|
2
|
-
// tiers + reviewPolicy and calls assembleGoal, which renders the planText and
|
|
3
|
-
// fills the Goal. This is the single construction point — adding a write route
|
|
4
|
-
// means a new briefSlot calling this, nothing else.
|
|
5
|
-
import { randomUUID } from 'node:crypto';
|
|
6
|
-
import { renderPlanText, derivePhaseTimeoutMs, GOAL_IDLE_STALL_MS } from './goal-prompts.js';
|
|
7
|
-
export function assembleGoal(args) {
|
|
8
|
-
const goalTasks = args.tasks.map((t, i) => ({
|
|
9
|
-
n: i + 1,
|
|
10
|
-
heading: t.heading.trim() || `task ${i + 1}`,
|
|
11
|
-
body: t.body,
|
|
12
|
-
phase: t.phase ?? 1,
|
|
13
|
-
}));
|
|
14
|
-
const phaseCount = new Set(goalTasks.map((t) => t.phase)).size;
|
|
15
|
-
// reviewPolicy='none' collapses to phase-1 only (configured phase-1 tier).
|
|
16
|
-
const phases = args.reviewPolicy === 'none' ? [args.phases[0]] : args.phases;
|
|
17
|
-
return {
|
|
18
|
-
goalId: args.goalId ?? randomUUID(),
|
|
19
|
-
cwd: args.cwd,
|
|
20
|
-
source: args.source,
|
|
21
|
-
tasks: goalTasks,
|
|
22
|
-
phaseCount,
|
|
23
|
-
planText: renderPlanText(goalTasks, phaseCount),
|
|
24
|
-
...(args.preamble && { preamble: args.preamble }),
|
|
25
|
-
phases,
|
|
26
|
-
reviewPolicy: args.reviewPolicy,
|
|
27
|
-
sandboxPolicy: args.sandboxPolicy,
|
|
28
|
-
tools: args.tools,
|
|
29
|
-
...(args.skills && args.skills.length > 0 && { skills: args.skills }),
|
|
30
|
-
...(args.contextBlockIds && args.contextBlockIds.length > 0 && { contextBlockIds: args.contextBlockIds }),
|
|
31
|
-
goalPhaseTimeoutMs: derivePhaseTimeoutMs(goalTasks.length, args.perTaskTimeoutMs),
|
|
32
|
-
goalIdleStallMs: GOAL_IDLE_STALL_MS,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Map a goal into the single TaskSpec the executor dispatches. The implement
|
|
37
|
-
* prompt is materialized into `prompt`; phase-1 tier becomes `agentType`;
|
|
38
|
-
* `reviewPolicy` collapses to the lifecycle's none/full axis (the review-fix
|
|
39
|
-
* stage only distinguishes none vs run).
|
|
40
|
-
*/
|
|
41
|
-
export function goalToTaskSpec(goal, implementPrompt, timeoutMs) {
|
|
42
|
-
return {
|
|
43
|
-
prompt: implementPrompt,
|
|
44
|
-
goal,
|
|
45
|
-
agentType: goal.phases[0].tier,
|
|
46
|
-
reviewPolicy: goal.reviewPolicy === 'none' ? 'none' : 'full',
|
|
47
|
-
cwd: goal.cwd,
|
|
48
|
-
tools: goal.tools,
|
|
49
|
-
sandboxPolicy: goal.sandboxPolicy,
|
|
50
|
-
timeoutMs: goal.goalPhaseTimeoutMs ?? timeoutMs,
|
|
51
|
-
...(goal.goalIdleStallMs !== undefined && { idleStallMs: goal.goalIdleStallMs }),
|
|
52
|
-
...(goal.skills && { skills: goal.skills }),
|
|
53
|
-
...(goal.contextBlockIds && { contextBlockIds: goal.contextBlockIds }),
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=goal-builder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"goal-builder.js","sourceRoot":"","sources":["../../src/lifecycle/goal-builder.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,oDAAoD;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AA4B7F,MAAM,UAAU,YAAY,CAAC,IAAsB;IACjD,MAAM,SAAS,GAAe,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACtD,CAAC,EAAE,CAAC,GAAG,CAAC;QACR,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC5C,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,KAAK,EAAE,CAAC,CAAC,KAA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;AACH,MAAM,UAAU,cAAc,CAC5B,IAAU,EACV,eAAuB,EACvB,SAAiB;IAEjB,OAAO;QACL,MAAM,EAAE,eAAe;QACvB,IAAI;QACJ,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC,IAAI;QAC/B,YAAY,EAAE,IAAI,CAAC,YAAY,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;QAC5D,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,SAAS,EAAE,IAAI,CAAC,kBAAkB,IAAI,SAAS;QAC/C,GAAG,CAAC,IAAI,CAAC,eAAe,KAAK,SAAS,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;QAChF,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;QAC3C,GAAG,CAAC,IAAI,CAAC,eAAe,IAAI,EAAE,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;KACvE,CAAC;AACJ,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Goal } from '../types/goal.js';
|
|
2
|
-
export type GoalPreconditionCode = 'empty_plan' | 'plan_too_large' | 'not_a_git_repo' | 'dirty_working_tree';
|
|
3
|
-
export type GoalPreconditionResult = {
|
|
4
|
-
ok: true;
|
|
5
|
-
baseSha: string;
|
|
6
|
-
} | {
|
|
7
|
-
ok: false;
|
|
8
|
-
code: GoalPreconditionCode;
|
|
9
|
-
message: string;
|
|
10
|
-
};
|
|
11
|
-
/** Synchronous build-time guards (no git): empty plan, oversized plan. */
|
|
12
|
-
export declare function checkGoalShape(goal: Goal): {
|
|
13
|
-
ok: true;
|
|
14
|
-
} | {
|
|
15
|
-
ok: false;
|
|
16
|
-
code: GoalPreconditionCode;
|
|
17
|
-
message: string;
|
|
18
|
-
};
|
|
19
|
-
/** Git preconditions + baseSha capture. Run inside withWriteGoalLock. */
|
|
20
|
-
export declare function checkGitPreconditions(goal: Goal): Promise<GoalPreconditionResult>;
|
|
21
|
-
//# sourceMappingURL=goal-preconditions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"goal-preconditions.d.ts","sourceRoot":"","sources":["../../src/lifecycle/goal-preconditions.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,MAAM,oBAAoB,GAC5B,YAAY,GACZ,gBAAgB,GAChB,gBAAgB,GAChB,oBAAoB,CAAC;AAEzB,MAAM,MAAM,sBAAsB,GAC9B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC7B;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,oBAAoB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/D,0EAA0E;AAC1E,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,oBAAoB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CASpH;AAED,yEAAyE;AACzE,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAcvF"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// Hard-fail preconditions for a write goal-set, plus baseSha capture. ALL of
|
|
2
|
-
// this runs INSIDE withWriteGoalLock so the clean-tree-at-baseSha guarantee
|
|
3
|
-
// holds against other serialized goal-sets on the same repo.
|
|
4
|
-
import { isInsideWorkTree, currentHead, isCleanWorkTree, ensureGitIdentity } from './git-exec.js';
|
|
5
|
-
import { MAX_PLAN_TEXT_BYTES } from './goal-prompts.js';
|
|
6
|
-
/** Synchronous build-time guards (no git): empty plan, oversized plan. */
|
|
7
|
-
export function checkGoalShape(goal) {
|
|
8
|
-
if (!goal.tasks || goal.tasks.length === 0) {
|
|
9
|
-
return { ok: false, code: 'empty_plan', message: 'goal has no tasks' };
|
|
10
|
-
}
|
|
11
|
-
const bytes = Buffer.byteLength(goal.planText, 'utf8');
|
|
12
|
-
if (bytes > MAX_PLAN_TEXT_BYTES) {
|
|
13
|
-
return { ok: false, code: 'plan_too_large', message: `planText ${bytes}B exceeds ${MAX_PLAN_TEXT_BYTES}B` };
|
|
14
|
-
}
|
|
15
|
-
return { ok: true };
|
|
16
|
-
}
|
|
17
|
-
/** Git preconditions + baseSha capture. Run inside withWriteGoalLock. */
|
|
18
|
-
export async function checkGitPreconditions(goal) {
|
|
19
|
-
const cwd = goal.cwd;
|
|
20
|
-
if (!(await isInsideWorkTree(cwd))) {
|
|
21
|
-
return { ok: false, code: 'not_a_git_repo', message: `${cwd} is not inside a git work-tree` };
|
|
22
|
-
}
|
|
23
|
-
const head = await currentHead(cwd);
|
|
24
|
-
if (!head) {
|
|
25
|
-
return { ok: false, code: 'not_a_git_repo', message: `${cwd} has no resolvable HEAD (unborn branch)` };
|
|
26
|
-
}
|
|
27
|
-
if (!(await isCleanWorkTree(cwd))) {
|
|
28
|
-
return { ok: false, code: 'dirty_working_tree', message: `${cwd} has uncommitted changes; goal mode requires a clean tree` };
|
|
29
|
-
}
|
|
30
|
-
await ensureGitIdentity(cwd, goal.goalId);
|
|
31
|
-
return { ok: true, baseSha: head };
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=goal-preconditions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"goal-preconditions.js","sourceRoot":"","sources":["../../src/lifecycle/goal-preconditions.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,4EAA4E;AAC5E,6DAA6D;AAC7D,OAAO,EAAE,gBAAgB,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,CAAC;IACD,IAAI,CAAC,CAAC,MAAM,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QAClC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,GAAG,GAAG,2DAA2D,EAAE,CAAC;IAC/H,CAAC;IACD,MAAM,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1C,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { Goal, GoalTask } from '../types/goal.js';
|
|
2
|
-
export declare const PER_TASK_DEFAULT_MS = 600000;
|
|
3
|
-
export declare const GOAL_IDLE_STALL_MS: number;
|
|
4
|
-
export declare const MAX_PLAN_TEXT_BYTES: number;
|
|
5
|
-
export declare const MAX_GIT_LOG_BYTES: number;
|
|
6
|
-
/**
|
|
7
|
-
* Per-phase wall-clock for a goal-set of `taskCount` tasks. Scales with the task
|
|
8
|
-
* count off the operator's configured per-task budget (`config.defaults.timeoutMs`),
|
|
9
|
-
* falling back to PER_TASK_DEFAULT_MS only when no config timeout is set. A goal
|
|
10
|
-
* runs all N tasks in one send, so the phase budget is N × the per-task budget.
|
|
11
|
-
*/
|
|
12
|
-
export declare function derivePhaseTimeoutMs(taskCount: number, perTaskMs?: number): number;
|
|
13
|
-
/** First non-empty line of `text`, trimmed to `max` chars (heading derivation). */
|
|
14
|
-
export declare function firstLine(text: string, max?: number): string;
|
|
15
|
-
/** Render the goal's tasks into one prompt body with PHASE + [task N] markers. */
|
|
16
|
-
export declare function renderPlanText(tasks: GoalTask[], phaseCount: number): string;
|
|
17
|
-
/** Phase-1 implement prompt over the whole plan. */
|
|
18
|
-
export declare function implementGoalPrompt(goal: Goal): string;
|
|
19
|
-
/**
|
|
20
|
-
* Phase-2 review-fix prompt. You are the COMPLETION GUARANTOR, not just a
|
|
21
|
-
* reviewer of commits. The implementer (a cheaper tier) attempted every task but
|
|
22
|
-
* may have left some incomplete, wrong, OR done-but-uncommitted. Your job is to
|
|
23
|
-
* make sure EVERY task ends up correctly implemented AND committed — walking the
|
|
24
|
-
* tasks one by one against both the commit log and the uncommitted working tree.
|
|
25
|
-
*/
|
|
26
|
-
export declare function reviewFixGoalPrompt(goal: Goal, gitLog: string, workingTree: string): string;
|
|
27
|
-
//# sourceMappingURL=goal-prompts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"goal-prompts.d.ts","sourceRoot":"","sources":["../../src/lifecycle/goal-prompts.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,eAAO,MAAM,mBAAmB,SAAU,CAAC;AAC3C,eAAO,MAAM,kBAAkB,QAAiC,CAAC;AACjE,eAAO,MAAM,mBAAmB,QAAa,CAAC;AAC9C,eAAO,MAAM,iBAAiB,QAAa,CAAC;AAE5C;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAGlF;AAED,mFAAmF;AACnF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAK,GAAG,MAAM,CAIxD;AAqDD,kFAAkF;AAClF,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAW5E;AA8CD,oDAAoD;AACpD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAsBtD;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAiD3F"}
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
// ── Tunables (spec: budgets / size guards) ──
|
|
2
|
-
export const PER_TASK_DEFAULT_MS = 600_000; // 10 min per task baseline
|
|
3
|
-
export const GOAL_IDLE_STALL_MS = Math.max(300_000, 10 * 60_000); // ≥10 min
|
|
4
|
-
export const MAX_PLAN_TEXT_BYTES = 256 * 1024; // hard-fail plan_too_large above this
|
|
5
|
-
export const MAX_GIT_LOG_BYTES = 128 * 1024; // truncate handoff above this
|
|
6
|
-
/**
|
|
7
|
-
* Per-phase wall-clock for a goal-set of `taskCount` tasks. Scales with the task
|
|
8
|
-
* count off the operator's configured per-task budget (`config.defaults.timeoutMs`),
|
|
9
|
-
* falling back to PER_TASK_DEFAULT_MS only when no config timeout is set. A goal
|
|
10
|
-
* runs all N tasks in one send, so the phase budget is N × the per-task budget.
|
|
11
|
-
*/
|
|
12
|
-
export function derivePhaseTimeoutMs(taskCount, perTaskMs) {
|
|
13
|
-
const base = perTaskMs && perTaskMs > 0 ? perTaskMs : PER_TASK_DEFAULT_MS;
|
|
14
|
-
return Math.max(base, taskCount * base);
|
|
15
|
-
}
|
|
16
|
-
/** First non-empty line of `text`, trimmed to `max` chars (heading derivation). */
|
|
17
|
-
export function firstLine(text, max = 72) {
|
|
18
|
-
const line = (text.split('\n').find((l) => l.trim().length > 0) ?? '').trim();
|
|
19
|
-
const stripped = line.replace(/^#+\s*/, '').replace(/^[-*]\s+/, '');
|
|
20
|
-
return stripped.length > max ? stripped.slice(0, max - 1) + '…' : stripped;
|
|
21
|
-
}
|
|
22
|
-
const PROHIBITED_GIT = [
|
|
23
|
-
'PROHIBITED git operations (local forward-only history only):',
|
|
24
|
-
'NEVER run: push, fetch from / to a remote, reset --hard, rebase, commit --amend,',
|
|
25
|
-
'branch -D, any force operation, or any history rewrite at or below the run start commit.',
|
|
26
|
-
'You may ONLY use: git add, git commit. Anything else corrupts attribution.',
|
|
27
|
-
].join('\n');
|
|
28
|
-
function commitConvention(mode) {
|
|
29
|
-
if (mode === 'implement') {
|
|
30
|
-
return [
|
|
31
|
-
'COMMIT after completing EACH task, before starting the next.',
|
|
32
|
-
'Commit subject MUST start with the exact prefix `[task N] ` (N = the task number).',
|
|
33
|
-
'Format: `[task N] <task heading>`. Worked example:',
|
|
34
|
-
' git commit -m "[task 3] Add config schema validation"',
|
|
35
|
-
'One commit per task. Do not batch multiple tasks into one commit.',
|
|
36
|
-
].join('\n');
|
|
37
|
-
}
|
|
38
|
-
return [
|
|
39
|
-
'COMMIT each fix you make, before moving to the next task.',
|
|
40
|
-
'Commit subject MUST start with the exact prefix `[task N] ` (N = the reviewed task number).',
|
|
41
|
-
'Format: `[task N] fix: <what you changed>`. Worked example:',
|
|
42
|
-
' git commit -m "[task 3] fix: correct off-by-one in range check"',
|
|
43
|
-
'If a task needs no fix, leave it as-is (do not create an empty commit).',
|
|
44
|
-
].join('\n');
|
|
45
|
-
}
|
|
46
|
-
const STRUCTURED_SUMMARY = [
|
|
47
|
-
'FINAL MESSAGE: end your last message with a single fenced ```json block of exactly this shape:',
|
|
48
|
-
'```json',
|
|
49
|
-
'{"tasks":[{"task":1,"heading":"...","filesChanged":["..."],',
|
|
50
|
-
' "verification":[{"cmd":"...","result":"PASS"}],"status":"done","note":""}],',
|
|
51
|
-
' "overall":"one-line summary"}',
|
|
52
|
-
'```',
|
|
53
|
-
'status is "done" | "failed" | "skipped". `verification` MAY be empty when the task',
|
|
54
|
-
'defines no commands. If you hit a plan defect, describe it in `note` and still implement the',
|
|
55
|
-
'best faithful version — use "done" when you completed a reasonable implementation; reserve',
|
|
56
|
-
'"failed"/"skipped" for a task you genuinely could not complete.',
|
|
57
|
-
].join('\n');
|
|
58
|
-
function phaseCheckpoint(phaseCount) {
|
|
59
|
-
if (phaseCount <= 1) {
|
|
60
|
-
return 'Before your final message: confirm every task is committed, then write the structured summary.';
|
|
61
|
-
}
|
|
62
|
-
return [
|
|
63
|
-
`The plan has ${phaseCount} phases (marked \`PHASE k:\`). At each PHASE boundary:`,
|
|
64
|
-
'1. Ensure every task in that phase is committed.',
|
|
65
|
-
'2. Emit a one-line `PHASE-k summary: <what got done>`.',
|
|
66
|
-
'3. Re-ground from `git log` + the plan for the next phase rather than relying on memory.',
|
|
67
|
-
].join('\n');
|
|
68
|
-
}
|
|
69
|
-
/** Render the goal's tasks into one prompt body with PHASE + [task N] markers. */
|
|
70
|
-
export function renderPlanText(tasks, phaseCount) {
|
|
71
|
-
const out = [];
|
|
72
|
-
let lastPhase = 0;
|
|
73
|
-
for (const t of tasks) {
|
|
74
|
-
if (phaseCount > 1 && t.phase !== lastPhase) {
|
|
75
|
-
out.push('', `PHASE ${t.phase}:`);
|
|
76
|
-
lastPhase = t.phase;
|
|
77
|
-
}
|
|
78
|
-
out.push('', `[task ${t.n}] ${t.heading}`, t.body);
|
|
79
|
-
}
|
|
80
|
-
return out.join('\n').trim();
|
|
81
|
-
}
|
|
82
|
-
const IMPLEMENT_ORIENTATION = [
|
|
83
|
-
'You are the autonomous executor of a multi-task plan written by a higher-capability model.',
|
|
84
|
-
'Execute EVERY task below, ONE AT A TIME, in order, from the first task to the last,',
|
|
85
|
-
'following the plan as designed — implement faithfully, do not redesign the plan.',
|
|
86
|
-
'',
|
|
87
|
-
'Stay faithful to the plan — the four ways execution diverges from intent:',
|
|
88
|
-
'1. CODE SUBSTITUTION — plan gave a code block; you wrote different code. The plan code is the contract; copy it verbatim.',
|
|
89
|
-
'2. STEP SKIP — plan listed steps; you omitted some. Every step is required unless marked optional.',
|
|
90
|
-
'3. PLAN REWRITE — you "redesigned" the plan. Implement what is written, not your own approach.',
|
|
91
|
-
'4. PROBLEM-NOT-FLAGGED — you hit a PLAN defect and said nothing. Note it in the task `note`, then proceed with the best faithful implementation. (Fidelity governs the plan\'s DESIGN — fixing your own implementation bugs as you go is expected; see Autonomy below.)',
|
|
92
|
-
].join('\n');
|
|
93
|
-
/** The code-quality bar every task's output must clear (both phases). */
|
|
94
|
-
const ENGINEERING_STANDARD = [
|
|
95
|
-
'ENGINEERING STANDARD — every task\'s output MUST clear this bar (no exceptions):',
|
|
96
|
-
'- Production-grade and fully wired: NO stubs, TODOs, placeholders, or half-implementations.',
|
|
97
|
-
' Everything you add must have a live caller on the production path — nothing exposed-but-unused.',
|
|
98
|
-
'- No legacy or dormant code: when you replace something, DELETE the old path. No dead code,',
|
|
99
|
-
' commented-out blocks, or unreachable branches left behind.',
|
|
100
|
-
'- No parallel / duplicate implementations: do not add a second way to do what already exists —',
|
|
101
|
-
' reuse or extend the existing one. One responsibility, one implementation.',
|
|
102
|
-
'- Match the code you touch: follow its existing patterns, naming, structure, and error handling.',
|
|
103
|
-
'- Build for the long term: clear, focused, reusable units — expandable, maintainable, scalable.',
|
|
104
|
-
' No clever shortcuts that hurt readability.',
|
|
105
|
-
'- Keep it green: if the project builds and its tests pass, your changes must keep them passing.',
|
|
106
|
-
].join('\n');
|
|
107
|
-
/** Autonomy + recoverability discipline (both phases). */
|
|
108
|
-
const AUTONOMY_AND_RECOVERY = [
|
|
109
|
-
'AUTONOMY & RECOVERABILITY:',
|
|
110
|
-
'- Drive the WHOLE plan from the first task to the last. Do not stop early, ask for confirmation,',
|
|
111
|
-
' or bail on uncertainty. Completing every task is the job.',
|
|
112
|
-
'- Fix problems YOURSELF as you hit them — compile errors, failing tests, broken integrations,',
|
|
113
|
-
' mismatched signatures, missing imports: investigate, fix, continue. A blocker is something to',
|
|
114
|
-
' solve, not a reason to quit.',
|
|
115
|
-
'- If the PLAN itself is wrong (impossible step, undefined symbol), note it in that task\'s `note`',
|
|
116
|
-
' and proceed with the most faithful reasonable implementation. Keep moving — never abandon the run.',
|
|
117
|
-
'- You are always recoverable: you COMMIT after each task, so finished work is durable. Do NOT',
|
|
118
|
-
' depend on holding the whole plan in your head — `git log`, the files on disk, and the plan text',
|
|
119
|
-
' are your source of truth; re-read them whenever you need to. There is NO context-window worry:',
|
|
120
|
-
' go task by task, commit, re-ground. If your context gets compacted, recover state from git + the',
|
|
121
|
-
' files, not from memory.',
|
|
122
|
-
].join('\n');
|
|
123
|
-
/** Phase-1 implement prompt over the whole plan. */
|
|
124
|
-
export function implementGoalPrompt(goal) {
|
|
125
|
-
return [
|
|
126
|
-
IMPLEMENT_ORIENTATION,
|
|
127
|
-
...(goal.preamble ? ['', goal.preamble] : []),
|
|
128
|
-
'',
|
|
129
|
-
AUTONOMY_AND_RECOVERY,
|
|
130
|
-
'',
|
|
131
|
-
ENGINEERING_STANDARD,
|
|
132
|
-
'',
|
|
133
|
-
commitConvention('implement'),
|
|
134
|
-
'',
|
|
135
|
-
PROHIBITED_GIT,
|
|
136
|
-
'',
|
|
137
|
-
'Run any verification commands the plan lists; record each result.',
|
|
138
|
-
'',
|
|
139
|
-
phaseCheckpoint(goal.phaseCount),
|
|
140
|
-
'',
|
|
141
|
-
STRUCTURED_SUMMARY,
|
|
142
|
-
'',
|
|
143
|
-
'─────────────────────── PLAN ───────────────────────',
|
|
144
|
-
goal.planText,
|
|
145
|
-
].join('\n');
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Phase-2 review-fix prompt. You are the COMPLETION GUARANTOR, not just a
|
|
149
|
-
* reviewer of commits. The implementer (a cheaper tier) attempted every task but
|
|
150
|
-
* may have left some incomplete, wrong, OR done-but-uncommitted. Your job is to
|
|
151
|
-
* make sure EVERY task ends up correctly implemented AND committed — walking the
|
|
152
|
-
* tasks one by one against both the commit log and the uncommitted working tree.
|
|
153
|
-
*/
|
|
154
|
-
export function reviewFixGoalPrompt(goal, gitLog, workingTree) {
|
|
155
|
-
return [
|
|
156
|
-
'You are the COMPLETION GUARANTOR for the plan below. A prior implementer (a cheaper',
|
|
157
|
-
'tier) attempted every task. It may have: committed a task correctly ([task N] …), done',
|
|
158
|
-
'the work but left it UNCOMMITTED in the working tree, implemented a task WRONGLY or',
|
|
159
|
-
'INCOMPLETELY, or not done it at all. Your job: make sure EVERY task is correctly',
|
|
160
|
-
'implemented AND committed by the end. Do not assume the commit log is complete —',
|
|
161
|
-
'inspect the working tree too.',
|
|
162
|
-
...(goal.preamble ? ['', goal.preamble] : []),
|
|
163
|
-
'',
|
|
164
|
-
'Work through the tasks ONE BY ONE, in order. For each task:',
|
|
165
|
-
'1. Determine its real state — check the commit log AND the uncommitted working tree',
|
|
166
|
-
' (and the files themselves). Did the implementer actually do it, correctly?',
|
|
167
|
-
'2. If it is correct but NOT yet committed → commit it as `[task N] <heading>`.',
|
|
168
|
-
'3. If it is incomplete or wrong → finish/fix it, then commit as `[task N] fix: <what>`.',
|
|
169
|
-
'4. If it is correct and already committed → verify it matches the plan; only re-commit',
|
|
170
|
-
' if you actually change something.',
|
|
171
|
-
'',
|
|
172
|
-
'By the end EVERY task MUST be implemented and committed, and the working tree MUST be',
|
|
173
|
-
'clean (no uncommitted changes left behind).',
|
|
174
|
-
'',
|
|
175
|
-
'Also hold every task to the ENGINEERING STANDARD below — actively hunt for and FIX (then',
|
|
176
|
-
'commit) violations the implementer left: dead/dormant code, unwired stubs or half-',
|
|
177
|
-
'implementations, duplicate/parallel implementations of existing functionality, and anything',
|
|
178
|
-
'that breaks the build or tests.',
|
|
179
|
-
'',
|
|
180
|
-
AUTONOMY_AND_RECOVERY,
|
|
181
|
-
'',
|
|
182
|
-
ENGINEERING_STANDARD,
|
|
183
|
-
'',
|
|
184
|
-
commitConvention('review-fix'),
|
|
185
|
-
'',
|
|
186
|
-
PROHIBITED_GIT,
|
|
187
|
-
'',
|
|
188
|
-
phaseCheckpoint(goal.phaseCount),
|
|
189
|
-
'',
|
|
190
|
-
STRUCTURED_SUMMARY,
|
|
191
|
-
'Additionally include a top-level "findings" array in the JSON: what was wrong/missing,',
|
|
192
|
-
'what you completed or fixed, and anything that remains unresolved.',
|
|
193
|
-
'',
|
|
194
|
-
'──────────────── COMMITS SO FAR (git log --stat) ────────────────',
|
|
195
|
-
gitLog || '(no commits yet — the implementer committed nothing)',
|
|
196
|
-
'',
|
|
197
|
-
'──────────────── UNCOMMITTED WORK (git status) ────────────────',
|
|
198
|
-
workingTree,
|
|
199
|
-
'',
|
|
200
|
-
'─────────────────────── PLAN ───────────────────────',
|
|
201
|
-
goal.planText,
|
|
202
|
-
].join('\n');
|
|
203
|
-
}
|
|
204
|
-
//# sourceMappingURL=goal-prompts.js.map
|