@tea-agent/loop-agent 0.10.0 → 0.11.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/AGENTS.md +10 -2
- package/CHANGELOG.md +67 -25
- package/README.md +82 -11
- package/dist/application/dag/args.js +1 -12
- package/dist/application/dag/generate-task-dag.js +23 -2
- package/dist/application/dag/run-dag.js +1 -27
- package/dist/application/dag/validate-dag.js +2 -2
- package/dist/application/loop/run-action.js +0 -4
- package/dist/cli/command-definitions.js +44 -16
- package/dist/cli/program.js +40 -23
- package/dist/cli/update/notifier.js +117 -0
- package/dist/cli/update/npm-client.js +151 -0
- package/dist/cli/update/policy.js +58 -0
- package/dist/cli/update/state.js +68 -0
- package/dist/cli.js +33 -0
- package/dist/commands/cursor-prompt.js +42 -82
- package/dist/commands/dag-approve.js +36 -0
- package/dist/commands/delegate.js +75 -77
- package/dist/commands/doctor.js +0 -18
- package/dist/commands/init.js +476 -91
- package/dist/commands/instructions.js +7 -10
- package/dist/commands/loop.js +4 -20
- package/dist/commands/plan.js +50 -0
- package/dist/executors/config-core.js +0 -51
- package/dist/executors/dag-pi-executor.js +1 -1
- package/dist/executors/dag.js +0 -1
- package/dist/executors/index.js +0 -2
- package/dist/executors/model-routing.js +9 -9
- package/dist/executors/shell-executor.js +1 -1
- package/dist/governance/checks.js +6 -3
- package/dist/governance/exec-plans.js +545 -0
- package/dist/governance/manifest-types.js +24 -2
- package/dist/infrastructure/harness/loop-action-store.js +0 -3
- package/dist/records/harvest.js +2 -23
- package/dist/records/one-shot-runs.js +1 -1
- package/dist/shared/artifacts-core.js +24 -5
- package/dist/shared/output-truncation.js +37 -0
- package/dist/shared/package-metadata.js +353 -0
- package/dist/{executors/cursor-executor.js → sidecars/cursor-prompt/executor.js} +2 -42
- package/dist/sidecars/cursor-prompt/index.js +3 -0
- package/dist/sidecars/cursor-prompt/stream.js +121 -0
- package/dist/task/config-types.js +28 -12
- package/dist/task/delegate.js +9 -21
- package/dist/task/runtime.js +1 -2
- package/dist/worker/cli.js +29 -2
- package/dist/worker/delivery/final-verification.js +47 -11
- package/dist/worker/delivery/package.js +63 -10
- package/dist/worker/feature/run.js +60 -8
- package/dist/worker/loop-agent/loop-agent-client.js +329 -126
- package/dist/worker/observability/read-model.js +27 -1
- package/dist/worker/observe/static/app.js +326 -45
- package/dist/worker/observe/static/index.html +1 -1
- package/dist/worker/observe/static/styles.css +5 -4
- package/dist/worker/preflight.js +49 -1
- package/dist/worker/run-task/run-task.js +22 -12
- package/dist/worker/runner/run-ready.js +76 -12
- package/dist/worker/task-spec/schema.js +0 -1
- package/dist/workflows/dag/convergence/controller.js +1 -1
- package/dist/workflows/dag/executor-registry.js +0 -2
- package/dist/workflows/dag/init-hybrid.js +402 -25
- package/dist/workflows/dag/node-execution.js +61 -7
- package/dist/workflows/dag/runner.js +45 -17
- package/dist/workflows/dag/scheduler.js +7 -2
- package/dist/workflows/dag/sdd-embedded.js +128 -0
- package/dist/workflows/dag/skill-instructions.js +5 -4
- package/dist/workflows/dag/skill-snapshot.js +527 -0
- package/dist/workflows/dag/types.js +42 -9
- package/dist/workflows/dag/validate.js +5 -8
- package/dist/workflows/loop/actions/dag-action.js +0 -2
- package/dist/workflows/loop/actions/shared.js +1 -1
- package/dist/workflows/loop/actions.js +14 -31
- package/dist/workflows/loop/benchmark.js +1 -1
- package/dist/workflows/loop/index.js +1 -1
- package/dist/workflows/loop/policy/auto-policy.js +22 -14
- package/dist/workflows/loop/policy/path-patterns.js +13 -0
- package/docs/README.md +36 -33
- package/docs/agent-dag-recovery-playbook.md +1 -1
- package/docs/agent-dag-runner.md +2 -2
- package/docs/architecture/README.md +26 -0
- package/docs/architecture/dag-execution.md +134 -0
- package/docs/architecture/evolution.md +52 -0
- package/docs/architecture/facts-and-state.md +58 -0
- package/docs/architecture/runtime-boundaries.md +45 -17
- package/docs/architecture/system-overview.md +93 -0
- package/docs/architecture/worker-and-feature.md +81 -0
- package/docs/cursor-prompt-sidecar.md +36 -0
- package/docs/decisions/README.md +13 -1
- package/docs/design/README.md +42 -21
- package/docs/development-principles.md +2 -2
- package/docs/exec-plans/active/README.md +2 -2
- package/docs/exec-plans/completed/README.md +12 -0
- package/docs/feature-workflow.md +50 -4
- package/docs/harness-methodology-debugging.md +1 -1
- package/docs/harness-methodology-tdd.md +3 -3
- package/docs/init-surface.manifest.json +60 -25
- package/docs/loop-agent-harness.md +28 -4
- package/docs/progress/README.md +32 -1
- package/docs/reports/README.md +84 -18
- package/docs/skills/README.md +2 -1
- package/docs/skills/vetted-skill-registry.md +2 -1
- package/docs/templates/agent-dag-report.schema.json +6 -6
- package/docs/templates/agent-dag.base.json +0 -5
- package/docs/templates/agent-dag.final-verification.json +0 -5
- package/docs/templates/agent-dag.schema.json +1 -2
- package/docs/templates/agent-dag.supervised-implementation.json +1 -6
- package/docs/templates/frontend-design-contract.md +33 -0
- package/docs/templates/frontend-task-constraints.md +25 -0
- package/docs/templates/frontend-task-requirement.md +61 -0
- package/docs/templates/harness.schema.json +10 -12
- package/docs/templates/hybrid-dag.json +1 -6
- package/docs/templates/interactive-ui-round2-experiment.md +1 -1
- package/docs/templates/product-line/task.yaml +0 -1
- package/docs/templates/project-start-checklist.md +2 -2
- package/docs/templates/worker-dogfood-evidence.md +28 -0
- package/docs/templates/worker-dogfood-setup.md +20 -0
- package/docs/verification-matrix.md +10 -0
- package/examples/decision-gate-agent-dag.json +87 -33
- package/examples/example-dag.json +0 -5
- package/examples/hybrid-loop-agent-dag.json +0 -5
- package/harness.json +7 -15
- package/package.json +22 -46
- package/scripts/check-product-line-docs.sh +10 -7
- package/skills/agent-worker/SKILL.md +37 -0
- package/skills/agent-worker/references/agent-worker-operator.md +43 -0
- package/skills/frontend-design-review/SKILL.md +59 -0
- package/skills/frontend-design-review/references/review-checklist.md +37 -0
- package/skills/frontend-implementation/SKILL.md +51 -0
- package/skills/frontend-implementation/references/code-standards.md +34 -0
- package/skills/frontend-implementation/references/design-spec.md +46 -0
- package/skills/frontend-implementation/references/node-contracts.md +32 -0
- package/skills/frontend-review/SKILL.md +53 -0
- package/skills/frontend-review/references/review-findings.md +42 -0
- package/skills/frontend-verification/SKILL.md +40 -0
- package/skills/frontend-verification/references/verification-checklist.md +56 -0
- package/skills/grill-me/SKILL.md +10 -0
- package/skills/grill-with-docs/SKILL.md +88 -0
- package/skills/grill-with-docs/adr-format.md +47 -0
- package/skills/grill-with-docs/context-format.md +60 -0
- package/skills/loop-agent/SKILL.md +11 -9
- package/skills/loop-agent/references/command-reference.md +13 -15
- package/skills/loop-agent/references/docs-converge.md +126 -0
- package/skills/loop-agent/references/harness-policy.md +7 -7
- package/skills/loop-agent/references/hybrid-dag.md +15 -18
- package/skills/loop-agent/references/long-running-loop.md +4 -6
- package/skills/loop-agent/references/multi-worktree.md +6 -6
- package/skills/loop-agent/references/orchestrator-and-interventions.md +3 -3
- package/skills/loop-agent/references/pi-subagent-assisted-mode.md +14 -11
- package/skills/loop-agent/references/task-workflow.md +1 -1
- package/skills/using-git-worktrees/SKILL.md +215 -0
- package/dist/commands/cursor-worker.js +0 -43
- package/dist/cursor-worker-entry.js +0 -8
- package/dist/executors/cursor-artifacts.js +0 -33
- package/dist/executors/cursor-execution-log.js +0 -81
- package/dist/executors/cursor-executor-artifacts.js +0 -134
- package/dist/executors/cursor-run.js +0 -115
- package/dist/executors/cursor-tool.js +0 -94
- package/dist/executors/cursor-worker-client.js +0 -223
- package/dist/executors/cursor-worker-protocol.js +0 -18
- package/dist/executors/cursor-worker-server.js +0 -54
- package/dist/executors/cursor-worker.js +0 -3
- package/dist/executors/cursor.js +0 -6
- package/dist/executors/dag-cursor-executor.js +0 -87
- package/dist/workflows/loop/actions/cursor-fix.js +0 -191
- package/dist/workflows/loop/policy/cursor-fix-policy.js +0 -31
- package/docs/cursor-executor-usage.md +0 -25
- package/docs/dynamic-workflow-dag-engine-roadmap.md +0 -1749
|
@@ -153,23 +153,20 @@ export async function buildInstructions(repoRoot, stage, taskId) {
|
|
|
153
153
|
],
|
|
154
154
|
}));
|
|
155
155
|
}
|
|
156
|
-
const artifactSteps = [
|
|
157
|
-
"analyze",
|
|
158
|
-
"plan",
|
|
159
|
-
"implement",
|
|
160
|
-
"verify",
|
|
161
|
-
"retrospective",
|
|
162
|
-
];
|
|
163
156
|
return refreshInstructionBlockers(withMissingDependencies({
|
|
164
157
|
...base,
|
|
165
158
|
outputPath: path.join(taskDir, "artifacts"),
|
|
166
159
|
dependencies: [paths.taskConfigPath, paths.statePath],
|
|
167
160
|
template: {
|
|
168
|
-
requiredHeadings:
|
|
161
|
+
requiredHeadings: [
|
|
162
|
+
getArtifactRelativePath("implement"),
|
|
163
|
+
getArtifactRelativePath("verify"),
|
|
164
|
+
],
|
|
169
165
|
},
|
|
170
166
|
completionCriteria: [
|
|
171
|
-
"
|
|
172
|
-
"
|
|
167
|
+
"修改记录.md and 验证结果.md are promote-run bridge artifacts filled from completed DAG/one-shot evidence",
|
|
168
|
+
"do not hand-write L1 分析报告/实现计划/复盘报告; those are not seeded or required",
|
|
169
|
+
"verification artifact summarizes available completed-run evidence; inspect the run facts for exact shell commands and full output",
|
|
173
170
|
],
|
|
174
171
|
}));
|
|
175
172
|
}
|
package/dist/commands/loop.js
CHANGED
|
@@ -7,10 +7,9 @@ function usage() {
|
|
|
7
7
|
" loop status <task-id> [--json]",
|
|
8
8
|
" loop run <task-id> --action shell-verify [--command <cmd>]... [--timeout-ms N] [--cwd <repo-relative-dir>]",
|
|
9
9
|
" loop run <task-id> --action pi-review [--provider <id>] [--model <id>] [--timeout-ms N] [--cwd <repo-relative-dir>]",
|
|
10
|
-
" loop run <task-id> --action
|
|
11
|
-
" loop run <task-id> --action dag [--execute] [--dag <path>] [--run-id <id>] [--max-concurrent N] [--cwd <repo-relative-dir>] [--no-cursor]",
|
|
10
|
+
" loop run <task-id> --action dag [--execute] [--dag <path>] [--run-id <id>] [--max-concurrent N] [--cwd <repo-relative-dir>]",
|
|
12
11
|
" loop run <task-id> --action workflow [--profile pr-review|--workflow <path>] [--execute] [--run-id <id>] [--changed-file <path>]... [--cwd <repo-relative-dir>]",
|
|
13
|
-
" loop run <task-id> --auto [--max-rounds N] [--
|
|
12
|
+
" loop run <task-id> --auto [--max-rounds N] [--approval-granted]",
|
|
14
13
|
" loop record-round <task-id> --action <name> --result <summary> --lesson <summary> --next <summary> --decision <continue|pause|blocked|complete> [--verification <summary>] [--failure-category <category>] [--ref <path>]...",
|
|
15
14
|
" loop add-signal <task-id> --type <human_followup|approval|scope_changed|review_feedback> --message <text> [--urgent] [--ref <path>]...",
|
|
16
15
|
" loop closeout <task-id>",
|
|
@@ -144,7 +143,7 @@ export async function runLoop(repoRoot, args) {
|
|
|
144
143
|
}
|
|
145
144
|
const record = await runLoopAuto(repoRoot, taskId, {
|
|
146
145
|
maxRounds,
|
|
147
|
-
|
|
146
|
+
approvalGranted: rest.includes("--approval-granted"),
|
|
148
147
|
});
|
|
149
148
|
console.log(JSON.stringify(record, null, 2));
|
|
150
149
|
return;
|
|
@@ -174,20 +173,6 @@ export async function runLoop(repoRoot, args) {
|
|
|
174
173
|
console.log(JSON.stringify(record, null, 2));
|
|
175
174
|
return;
|
|
176
175
|
}
|
|
177
|
-
if (action === "cursor-fix") {
|
|
178
|
-
const record = await runLoopAction({
|
|
179
|
-
action,
|
|
180
|
-
repoRoot,
|
|
181
|
-
taskId,
|
|
182
|
-
options: {
|
|
183
|
-
timeoutMs,
|
|
184
|
-
cwd: readFlag(rest, "--cwd"),
|
|
185
|
-
model: readFlag(rest, "--model"),
|
|
186
|
-
},
|
|
187
|
-
});
|
|
188
|
-
console.log(JSON.stringify(record, null, 2));
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
176
|
if (action === "dag") {
|
|
192
177
|
const maxConcurrentRaw = readFlag(rest, "--max-concurrent");
|
|
193
178
|
let maxConcurrent;
|
|
@@ -208,7 +193,6 @@ export async function runLoop(repoRoot, args) {
|
|
|
208
193
|
dagPath: readFlag(rest, "--dag"),
|
|
209
194
|
runId: readFlag(rest, "--run-id"),
|
|
210
195
|
maxConcurrent,
|
|
211
|
-
noCursor: rest.includes("--no-cursor"),
|
|
212
196
|
},
|
|
213
197
|
});
|
|
214
198
|
console.log(JSON.stringify(record, null, 2));
|
|
@@ -248,7 +232,7 @@ export async function runLoop(repoRoot, args) {
|
|
|
248
232
|
return;
|
|
249
233
|
}
|
|
250
234
|
if (action !== "shell-verify") {
|
|
251
|
-
throw new Error("loop run currently supports --action shell-verify|pi-review|
|
|
235
|
+
throw new Error("loop run currently supports --action shell-verify|pi-review|dag|workflow");
|
|
252
236
|
}
|
|
253
237
|
const record = await runLoopAction({
|
|
254
238
|
action: "shell-verify",
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { checkExecPlanIndex, completeExecPlan, createExecPlan, } from "../governance/exec-plans.js";
|
|
2
|
+
import { repoRelativePath } from "../shared/path-refs.js";
|
|
3
|
+
/**
|
|
4
|
+
* Create an active exec-plan and sync the active index.
|
|
5
|
+
*
|
|
6
|
+
* Usage: `loop-agent plan create <plan-id> "<title>"`
|
|
7
|
+
*/
|
|
8
|
+
export async function runPlanCreate(repoRoot, planId, title) {
|
|
9
|
+
const result = await createExecPlan(repoRoot, planId, title);
|
|
10
|
+
console.log(JSON.stringify({
|
|
11
|
+
planId: result.planId,
|
|
12
|
+
status: result.status,
|
|
13
|
+
created: repoRelativePath(repoRoot, result.planPath),
|
|
14
|
+
}, null, 2));
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Move an active exec-plan to completed and sync both indexes.
|
|
18
|
+
*
|
|
19
|
+
* Usage: `loop-agent plan complete <plan-id> --summary "<summary>"`
|
|
20
|
+
*/
|
|
21
|
+
export async function runPlanComplete(repoRoot, planId, options) {
|
|
22
|
+
const result = await completeExecPlan(repoRoot, planId, options);
|
|
23
|
+
console.log(JSON.stringify({
|
|
24
|
+
planId: result.planId,
|
|
25
|
+
status: result.status,
|
|
26
|
+
from: repoRelativePath(repoRoot, result.fromPath),
|
|
27
|
+
to: repoRelativePath(repoRoot, result.toPath),
|
|
28
|
+
activeIndex: repoRelativePath(repoRoot, result.activeIndex),
|
|
29
|
+
completedIndex: repoRelativePath(repoRoot, result.completedIndex),
|
|
30
|
+
}, null, 2));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Check exec-plan index consistency and print the result as JSON.
|
|
34
|
+
*
|
|
35
|
+
* Usage: `loop-agent plan check`
|
|
36
|
+
*/
|
|
37
|
+
export async function runPlanCheck(repoRoot) {
|
|
38
|
+
const result = await checkExecPlanIndex(repoRoot);
|
|
39
|
+
console.log(JSON.stringify({
|
|
40
|
+
ok: result.ok,
|
|
41
|
+
issues: result.issues,
|
|
42
|
+
activeFiles: result.activeFiles,
|
|
43
|
+
completedFiles: result.completedFiles,
|
|
44
|
+
}, null, 2));
|
|
45
|
+
if (!result.ok) {
|
|
46
|
+
throw new Error(`exec-plan index check failed (${result.issues.length} issue(s)): ${result.issues
|
|
47
|
+
.map((issue) => issue.message)
|
|
48
|
+
.join("; ")}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -1,56 +1,5 @@
|
|
|
1
|
-
import { DEFAULT_CURSOR_MODEL } from './cursor-executor.js';
|
|
2
|
-
import { resolveExecutorModelMatrix } from './model-routing.js';
|
|
3
1
|
export const TASK_COMPLEXITY_TO_DAG = {
|
|
4
2
|
small: 'LOW',
|
|
5
3
|
medium: 'MED',
|
|
6
4
|
large: 'HIGH',
|
|
7
5
|
};
|
|
8
|
-
export function resolveCursorModel(overrides = {}, cursorConfig) {
|
|
9
|
-
return overrides.taskModel ?? cursorConfig?.defaultModel ?? DEFAULT_CURSOR_MODEL;
|
|
10
|
-
}
|
|
11
|
-
export function resolveCursorModelForTaskConfig(taskConfig, cursorConfig) {
|
|
12
|
-
if (taskConfig.cursorModel?.trim()) {
|
|
13
|
-
return taskConfig.cursorModel.trim();
|
|
14
|
-
}
|
|
15
|
-
const dagLevel = TASK_COMPLEXITY_TO_DAG[taskConfig.complexity ?? 'medium'];
|
|
16
|
-
const matrix = resolveExecutorModelMatrix('cursor', cursorConfig);
|
|
17
|
-
return matrix[dagLevel] ?? resolveCursorModel({}, cursorConfig);
|
|
18
|
-
}
|
|
19
|
-
export function resolveTaskExecutor(taskConfig, override) {
|
|
20
|
-
if (override)
|
|
21
|
-
return override;
|
|
22
|
-
return taskConfig.executor ?? 'pi';
|
|
23
|
-
}
|
|
24
|
-
export function resolveCursorExecutorConfig(manifest) {
|
|
25
|
-
const config = manifest.executors?.cursor;
|
|
26
|
-
if (config?.enabled === false)
|
|
27
|
-
return undefined;
|
|
28
|
-
return config;
|
|
29
|
-
}
|
|
30
|
-
export function assertCursorExecutorAvailable(manifest) {
|
|
31
|
-
const config = resolveCursorExecutorConfig(manifest);
|
|
32
|
-
if (!config) {
|
|
33
|
-
throw new Error('cursor executor is not registered in harness.json executors.cursor');
|
|
34
|
-
}
|
|
35
|
-
return config;
|
|
36
|
-
}
|
|
37
|
-
export function validateCursorTaskPreflight(taskConfig) {
|
|
38
|
-
if (taskConfig.executor !== 'cursor')
|
|
39
|
-
return;
|
|
40
|
-
const allowed = taskConfig.allowedPaths ?? [];
|
|
41
|
-
if (allowed.length === 0) {
|
|
42
|
-
// Read-only analysis tasks may omit allowedPaths; write tasks must declare scope explicitly.
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
export function assertCursorWriteTaskScope(taskConfig, changedPaths) {
|
|
47
|
-
if (taskConfig.executor !== 'cursor')
|
|
48
|
-
return;
|
|
49
|
-
if ((taskConfig.allowedPaths ?? []).length > 0)
|
|
50
|
-
return;
|
|
51
|
-
const codeChanges = changedPaths.filter((filePath) => !filePath.startsWith('.harness/tasks/'));
|
|
52
|
-
if (codeChanges.length > 0) {
|
|
53
|
-
throw new Error('cursor write task refused: allowedPaths is empty but git diff contains code changes. ' +
|
|
54
|
-
'Declare allowedPaths explicitly or keep the task read-only.');
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { writeTextArtifactFile } from "../infrastructure/harness/artifact-store.js";
|
|
3
3
|
import { executePiStep, } from "./pi-executor.js";
|
|
4
|
-
import { redactPromptForLog, truncateOutput } from "
|
|
4
|
+
import { redactPromptForLog, truncateOutput, } from "../shared/output-truncation.js";
|
|
5
5
|
import { readGitStatusPorcelain, runPostRunWriteGuard, } from "./shell-write-guard.js";
|
|
6
6
|
export const DAG_PI_READONLY_TOOLS = ["read", "grep", "find", "ls"];
|
|
7
7
|
export const DAG_PI_WRITE_TOOLS = [
|
package/dist/executors/dag.js
CHANGED
package/dist/executors/index.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { DEFAULT_DAG_EXECUTOR_MODELS, } from '../workflows/dag/types.js';
|
|
2
|
-
export const DEFAULT_DAG_CURSOR_MODEL = "composer-2.5";
|
|
3
2
|
export const DEFAULT_DAG_MODELS = {
|
|
4
3
|
HIGH: "gpt-5.5",
|
|
5
|
-
MED: "
|
|
6
|
-
LOW: "
|
|
4
|
+
MED: "glm-5.2",
|
|
5
|
+
LOW: "gpt-5.3-codex-spark",
|
|
7
6
|
};
|
|
8
7
|
/**
|
|
9
8
|
* DAG executor model tier keys that may carry a per-complexity override.
|
|
10
9
|
*/
|
|
11
10
|
const EXECUTOR_MODEL_TIERS = ["LOW", "MED", "HIGH"];
|
|
12
11
|
/**
|
|
13
|
-
* Resolve the DAG executor model matrix for
|
|
14
|
-
* `executors.<name>` config.
|
|
12
|
+
* Resolve the DAG executor model matrix for Pi from harness `executors.pi`.
|
|
15
13
|
*
|
|
16
14
|
* Priority per tier (LOW/MED/HIGH):
|
|
17
15
|
* 1. execConfig[tier] (truthy and !== "default" sentinel)
|
|
18
16
|
* 2. execConfig.defaultModel (truthy and !== "default" sentinel)
|
|
19
|
-
* 3. DEFAULT_DAG_EXECUTOR_MODELS[
|
|
17
|
+
* 3. DEFAULT_DAG_EXECUTOR_MODELS.pi[tier]
|
|
20
18
|
*
|
|
21
19
|
* The "default" literal (injected by the schema `.default("default")`) and
|
|
22
20
|
* absent/undefined both mean "no override, fall through".
|
|
@@ -38,15 +36,17 @@ export function resolveExecutorModelMatrix(executor, execConfig) {
|
|
|
38
36
|
};
|
|
39
37
|
}
|
|
40
38
|
/**
|
|
41
|
-
* Resolve
|
|
42
|
-
* Single entry point for DAG generation and --strict-models baseline resolution.
|
|
39
|
+
* Resolve the Pi DAG executor model matrix from a harness manifest.
|
|
43
40
|
*/
|
|
44
41
|
export function resolveExecutorModelMatrices(manifest) {
|
|
45
42
|
return {
|
|
46
43
|
pi: resolveExecutorModelMatrix("pi", manifest.executors?.pi),
|
|
47
|
-
cursor: resolveExecutorModelMatrix("cursor", manifest.executors?.cursor),
|
|
48
44
|
};
|
|
49
45
|
}
|
|
46
|
+
/** @deprecated Prefer resolveExecutorModelMatrices; alias kept for call-site clarity. */
|
|
47
|
+
export function resolvePiModelMatrix(manifest) {
|
|
48
|
+
return resolveExecutorModelMatrices(manifest).pi;
|
|
49
|
+
}
|
|
50
50
|
export function resolveModelSelection(manifest, taskConfig, step, options) {
|
|
51
51
|
const retryAttempt = options?.retryAttempt ?? 0;
|
|
52
52
|
if (Object.keys(manifest.modelProfiles ?? {}).length === 0) {
|
|
@@ -2,7 +2,7 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
import { appendFileSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { writeDagNodeTextArtifact } from "../infrastructure/harness/artifact-store.js";
|
|
5
|
-
import { truncateOutput } from "
|
|
5
|
+
import { truncateOutput } from "../shared/output-truncation.js";
|
|
6
6
|
import { expandShellPreset, buildVerdictGateShellCommand } from "./shell-presets.js";
|
|
7
7
|
import { pathsChangedDuringRun, snapshotGitStatusPorcelain, validateShellWriteGuard, } from "./shell-write-guard.js";
|
|
8
8
|
import { buildShellProcessEnv } from "./shell-verification.js";
|
|
@@ -3,7 +3,7 @@ import path from 'node:path';
|
|
|
3
3
|
import { repoRelativePath } from '../shared/path-refs.js';
|
|
4
4
|
import { loadHarnessManifest } from './harness.js';
|
|
5
5
|
import { auditLoopAgentSkillSafety } from './skill-safety.js';
|
|
6
|
-
import { getTaskPaths, getTaskStatus, loadTaskConfig
|
|
6
|
+
import { getTaskPaths, getTaskStatus, loadTaskConfig } from '../task/runtime.js';
|
|
7
7
|
import { buildTaskReadModel } from '../task/read-model.js';
|
|
8
8
|
const SKIP_DIRS = new Set([
|
|
9
9
|
'.git',
|
|
@@ -244,12 +244,15 @@ export async function checkTaskHandoff(repoRoot, taskId) {
|
|
|
244
244
|
message: '任务已 completed,但验证工件未标记完成',
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
|
-
|
|
247
|
+
// Standard DAG tasks do not require a retrospective artifact. Preserve an
|
|
248
|
+
// explicit legacy task contract, however, so historical tasks that opted
|
|
249
|
+
// into requireRetrospective do not silently lose their handoff warning.
|
|
250
|
+
if (state.status === 'completed' && taskConfig.requireRetrospective && !state.artifacts.retrospective) {
|
|
248
251
|
issues.push({
|
|
249
252
|
type: 'missing-retrospective-artifact',
|
|
250
253
|
severity: 'warning',
|
|
251
254
|
file: toRepoRelative(repoRoot, path.join(taskPaths.taskDir, 'artifacts', '复盘报告.md')),
|
|
252
|
-
message: '
|
|
255
|
+
message: '任务显式要求 retrospective,但复盘工件未完成',
|
|
253
256
|
});
|
|
254
257
|
}
|
|
255
258
|
if (readModel.promotion.required && !readModel.promotion.ready) {
|