@tea-agent/loop-agent 0.2.1 → 0.4.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 +91 -87
- package/CHANGELOG.md +89 -52
- package/README.md +195 -180
- package/bin/agent-worker.js +22 -0
- package/bin/loop-agent.js +21 -21
- package/dist/application/dag/args.js +6 -0
- package/dist/application/dag/generate-task-dag.js +2 -0
- package/dist/application/dag/run-dag.js +3 -0
- package/dist/application/dag/validate-dag.js +40 -0
- package/dist/cli/command-definitions.js +2 -2
- package/dist/cli/program.js +24 -4
- package/dist/commands/init.js +1011 -459
- package/dist/commands/loop-benchmark.js +11 -11
- package/dist/commands/pi-reuse-benchmark.js +16 -16
- package/dist/executors/cursor-executor.js +1 -1
- package/dist/executors/dag-pi-executor.js +8 -1
- package/dist/task/runtime.js +27 -27
- package/dist/worker/cli.js +119 -0
- package/dist/worker/loop-agent/command-result.js +1 -0
- package/dist/worker/loop-agent/loop-agent-client.js +105 -0
- package/dist/worker/loop-agent/parse-json.js +14 -0
- package/dist/worker/materialize/harness-task-materializer.js +157 -0
- package/dist/worker/pool/failure-routing.js +98 -0
- package/dist/worker/pool/run-store.js +117 -0
- package/dist/worker/pool/types.js +1 -0
- package/dist/worker/preflight.js +108 -0
- package/dist/worker/profile-mapping.js +76 -0
- package/dist/worker/progress-reporter.js +81 -0
- package/dist/worker/report/morning-report.js +69 -0
- package/dist/worker/repos/repo-resolver.js +23 -0
- package/dist/worker/run-task/run-task.js +359 -0
- package/dist/worker/runner/run-ready.js +216 -0
- package/dist/worker/task-graph/acceptance-schema.js +25 -0
- package/dist/worker/task-graph/ready-queue.js +23 -0
- package/dist/worker/task-graph/task-graph-schema.js +28 -0
- package/dist/worker/task-graph/types.js +1 -0
- package/dist/worker/task-graph/validate.js +188 -0
- package/dist/worker/task-spec/complexity-mapping.js +8 -0
- package/dist/worker/task-spec/schema.js +116 -0
- package/dist/worker/task-spec/types.js +1 -0
- package/dist/worker/task-spec/validate.js +352 -0
- package/dist/workflows/dag/canvas-observer.js +275 -275
- package/dist/workflows/dag/dynamic-runtime/loop-until.js +2 -1
- package/dist/workflows/dag/dynamic-runtime/map.js +1 -0
- package/dist/workflows/dag/init-hybrid.js +3 -3
- package/dist/workflows/dag/skills.js +3 -3
- package/dist/workflows/dag/types.js +2 -0
- package/dist/workflows/dynamic/compile.js +11 -0
- package/dist/workflows/dynamic/spec.js +1 -0
- package/docs/README.md +72 -65
- package/docs/agent-dag-recovery-playbook.md +184 -184
- package/docs/agent-dag-runner.md +42 -40
- package/docs/architecture/runtime-boundaries.md +147 -147
- package/docs/cursor-executor-usage.md +25 -25
- package/docs/decisions/README.md +3 -3
- package/docs/design/README.md +36 -36
- package/docs/development-principles.md +73 -71
- package/docs/dynamic-workflow-dag-engine-roadmap.md +1749 -1749
- package/docs/exec-plans/README.md +6 -6
- package/docs/exec-plans/active/README.md +7 -10
- package/docs/exec-plans/completed/README.md +19 -9
- package/docs/feature-workflow.md +186 -186
- package/docs/harness-methodology-debugging.md +153 -153
- package/docs/harness-methodology-tdd.md +130 -130
- package/docs/harness-methodology-verification.md +27 -27
- package/docs/init-surface.manifest.json +175 -0
- package/docs/loop-agent-harness.md +42 -42
- package/docs/production-readiness.md +96 -96
- package/docs/progress/README.md +3 -3
- package/docs/reports/README.md +5 -5
- package/docs/skills/README.md +6 -0
- package/docs/skills/vetted-skill-registry.md +26 -0
- package/docs/templates/adr.md +60 -60
- package/docs/templates/agent-dag-authority-surface-audit.prompt.md +94 -94
- package/docs/templates/agent-dag-decision-envelope.schema.json +213 -213
- package/docs/templates/agent-dag-decision-gate-dogfood-report.md +117 -117
- package/docs/templates/agent-dag-decision-gate.prompt.md +246 -246
- package/docs/templates/agent-dag-process-supervisor.prompt.md +98 -98
- package/docs/templates/agent-dag-report.schema.json +454 -454
- package/docs/templates/agent-dag-review-verdict.prompt.md +68 -68
- package/docs/templates/agent-dag.base.json +195 -195
- package/docs/templates/agent-dag.final-verification.json +190 -190
- package/docs/templates/agent-dag.schema.json +316 -316
- package/docs/templates/agent-dag.supervised-implementation.json +500 -500
- package/docs/templates/exec-plan.md +64 -64
- package/docs/templates/feature-spec.md +53 -53
- package/docs/templates/hybrid-dag.json +193 -193
- package/docs/templates/init-evolution-review.md +33 -0
- package/docs/templates/production-readiness-checklist.md +57 -57
- package/docs/templates/progress-log.md +17 -17
- package/docs/templates/project-start-checklist.md +9 -9
- package/docs/templates/qa-report.md +48 -48
- package/docs/templates/sprint-contract.md +29 -29
- package/docs/verification-matrix.md +41 -41
- package/examples/decision-gate-agent-dag.json +123 -123
- package/examples/example-dag.json +51 -51
- package/examples/hybrid-loop-agent-dag.json +194 -194
- package/harness.json +94 -92
- package/package.json +66 -62
- package/skills/ai-engineering-context/SKILL.md +48 -48
- package/skills/code-review-core/SKILL.md +20 -0
- package/skills/codebase-scout/SKILL.md +19 -0
- package/skills/init-capability-evolution/SKILL.md +69 -0
- package/skills/loop-agent/SKILL.md +147 -145
- package/skills/loop-agent/references/README.md +67 -67
- package/skills/loop-agent/references/command-reference.md +403 -357
- package/skills/loop-agent/references/harness-policy.md +259 -258
- package/skills/loop-agent/references/hybrid-dag.md +216 -216
- package/skills/loop-agent/references/learned/README.md +21 -21
- package/skills/loop-agent/references/long-running-loop.md +59 -59
- package/skills/loop-agent/references/model-routing.md +36 -36
- package/skills/loop-agent/references/multi-worktree.md +54 -54
- package/skills/loop-agent/references/one-shot-runs.md +85 -85
- package/skills/loop-agent/references/orchestrator-and-interventions.md +169 -169
- package/skills/loop-agent/references/pi-prompt.md +23 -23
- package/skills/loop-agent/references/pi-subagent-assisted-mode.md +81 -81
- package/skills/loop-agent/references/post-implementation-and-patterns.md +44 -44
- package/skills/loop-agent/references/task-workflow.md +84 -84
- package/skills/loop-agent/references/verification-and-failure-handling.md +128 -128
- package/skills/requesting-code-review/SKILL.md +101 -101
- package/skills/requesting-code-review/code-reviewer.md +168 -168
- package/skills/systematic-debugging/CREATION-LOG.md +119 -119
- package/skills/systematic-debugging/SKILL.md +296 -296
- package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -158
- package/skills/systematic-debugging/condition-based-waiting.md +115 -115
- package/skills/systematic-debugging/defense-in-depth.md +122 -122
- package/skills/systematic-debugging/find-polluter.sh +63 -63
- package/skills/systematic-debugging/root-cause-tracing.md +169 -169
- package/skills/systematic-debugging/test-academic.md +14 -14
- package/skills/systematic-debugging/test-pressure-1.md +58 -58
- package/skills/systematic-debugging/test-pressure-2.md +68 -68
- package/skills/systematic-debugging/test-pressure-3.md +69 -69
- package/skills/test-driven-development/SKILL.md +20 -0
- package/skills/verification-before-completion/SKILL.md +154 -154
- package/skills/webapp-testing/SKILL.md +19 -0
package/dist/cli/program.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
1
2
|
import path from "node:path";
|
|
2
3
|
import { Command } from "commander";
|
|
3
4
|
import { resolveAdapter } from "../adapters/index.js";
|
|
@@ -50,10 +51,22 @@ import { handleStandaloneOneShotCommandError } from "../shared/one-shot-prompt-a
|
|
|
50
51
|
import { runDagDecisionInspect, runDagDecisionValidate, } from "../workflows/dag/decision-envelope.js";
|
|
51
52
|
import { runDagDoctor, runDagStatus } from "../workflows/dag/lifecycle.js";
|
|
52
53
|
import { CODE_AGENT_COMMAND_MANIFEST } from "./catalog.js";
|
|
53
|
-
function
|
|
54
|
+
function readPackageVersion() {
|
|
55
|
+
try {
|
|
56
|
+
const raw = readFileSync(new URL("../../package.json", import.meta.url), "utf-8");
|
|
57
|
+
const parsed = JSON.parse(raw);
|
|
58
|
+
if (typeof parsed.version === "string")
|
|
59
|
+
return parsed.version;
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
// Fall back only if the package metadata is unexpectedly unavailable.
|
|
63
|
+
}
|
|
64
|
+
return "0.0.0";
|
|
65
|
+
}
|
|
66
|
+
function resolveRepoRootOnly(command, defaultRepoRoot, behavior) {
|
|
54
67
|
const options = collectGlobalOptions(command);
|
|
55
68
|
const repoRoot = path.resolve(options.repoRoot ?? defaultRepoRoot);
|
|
56
|
-
if (options.repoRoot)
|
|
69
|
+
if (options.repoRoot && !behavior?.quiet)
|
|
57
70
|
console.log(`[loop-agent] repo root: ${repoRoot}`);
|
|
58
71
|
return repoRoot;
|
|
59
72
|
}
|
|
@@ -341,6 +354,7 @@ function configureDagValidate(command) {
|
|
|
341
354
|
.option("--dag <path>", "DAG spec path")
|
|
342
355
|
.option("--strict-models", "fail on model routing warnings")
|
|
343
356
|
.option("--strict-governance", "fail on governance warnings")
|
|
357
|
+
.option("--strict-skills", "fail on missing, errored, truncated, or unresolved skill instructions")
|
|
344
358
|
.option("--forbid-executor <executor>", "forbid executor", (value, previous = []) => [
|
|
345
359
|
...previous,
|
|
346
360
|
value,
|
|
@@ -474,7 +488,9 @@ async function runPiPromptCommand(args) {
|
|
|
474
488
|
}
|
|
475
489
|
}
|
|
476
490
|
async function runInitCommand(args, command, defaultRepoRoot) {
|
|
477
|
-
|
|
491
|
+
const initArgs = commandArgsWithOptions(args, command);
|
|
492
|
+
const quiet = initArgs.includes("--json") || initArgs.includes("--markdown");
|
|
493
|
+
await runInit(resolveRepoRootOnly(command, defaultRepoRoot, { quiet }), initArgs);
|
|
478
494
|
}
|
|
479
495
|
async function runExamplesCommand(args, command, defaultRepoRoot) {
|
|
480
496
|
await runExamples(resolveRepoRootOnly(command, defaultRepoRoot), commandArgsWithOptions(args, command));
|
|
@@ -484,6 +500,7 @@ export function buildLoopAgentProgram(options) {
|
|
|
484
500
|
program
|
|
485
501
|
.name("loop-agent")
|
|
486
502
|
.description("Loop Agent task and DAG automation CLI")
|
|
503
|
+
.version(readPackageVersion(), "-V, --version", "display version")
|
|
487
504
|
.showHelpAfterError()
|
|
488
505
|
.option("--repo-root <path>", "repository root")
|
|
489
506
|
.option("--adapter <name>", "harness adapter name")
|
|
@@ -526,7 +543,10 @@ export function buildLoopAgentProgram(options) {
|
|
|
526
543
|
.option("--no-merge", "skip existing files")
|
|
527
544
|
.option("--provider <provider>", "model provider")
|
|
528
545
|
.option("--model <model>", "model name")
|
|
529
|
-
.option("--json", "print JSON")
|
|
546
|
+
.option("--json", "print JSON")
|
|
547
|
+
.option("--markdown", "print Markdown")
|
|
548
|
+
.option("--bootstrap-surface", "write an inferred .harness/init-surface.json baseline")
|
|
549
|
+
.option("--apply-safe", "apply deterministic safe init updates");
|
|
530
550
|
command.action(async (args, _options, actionCommand) => runInitCommand(args, actionCommand, options.defaultRepoRoot));
|
|
531
551
|
addStandaloneSubcommands(command, entry.subcommands ?? [], (args, actionCommand) => runInitCommand(args, actionCommand, options.defaultRepoRoot));
|
|
532
552
|
program.addCommand(command);
|