agentplane 0.6.9 → 0.6.11
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/assets/AGENTS.md +2 -5
- package/assets/agents/CODER.json +1 -1
- package/assets/agents/INTEGRATOR.json +1 -1
- package/assets/agents/ORCHESTRATOR.json +1 -1
- package/assets/agents/PLANNER.json +1 -1
- package/assets/agents/REVIEWER.json +1 -1
- package/assets/agents/TESTER.json +1 -1
- package/assets/codex-plugin/skills/agentplane/SKILL.md +1 -1
- package/bin/agentplane.js +8 -2
- package/bin/dist-guard.js +86 -2
- package/dist/.build-manifest.json +3 -3
- package/dist/cli.js +624 -583
- package/package.json +4 -4
package/assets/AGENTS.md
CHANGED
|
@@ -62,6 +62,7 @@ ap quickstart
|
|
|
62
62
|
ap task list
|
|
63
63
|
ap task active
|
|
64
64
|
git status --short --untracked-files=no
|
|
65
|
+
git status --short
|
|
65
66
|
git rev-parse --abbrev-ref HEAD
|
|
66
67
|
```
|
|
67
68
|
|
|
@@ -147,8 +148,7 @@ Condition: task includes mutation (file edits, task-state changes, commits, merg
|
|
|
147
148
|
5. IF task modifies implementation code paths THEN LOAD `@.agentplane/policy/dod.code.md`.
|
|
148
149
|
6. IF task modifies docs/policy-only paths (`AGENTS.md`, docs, `.agentplane/policy/**`) THEN LOAD `@.agentplane/policy/dod.docs.md`.
|
|
149
150
|
7. IF task modifies policy files (`AGENTS.md` or `.agentplane/policy/**`) THEN LOAD `@.agentplane/policy/governance.md`.
|
|
150
|
-
8. IF task
|
|
151
|
-
9. IF task modifies `.agentplane/policy/incidents.md` THEN LOAD `@.agentplane/policy/incidents.md`.
|
|
151
|
+
8. IF task modifies `.agentplane/policy/incidents.md` THEN LOAD `@.agentplane/policy/incidents.md`.
|
|
152
152
|
|
|
153
153
|
Routing constraints:
|
|
154
154
|
|
|
@@ -177,8 +177,6 @@ Routing constraints:
|
|
|
177
177
|
|
|
178
178
|
Role boundaries: ORCHESTRATOR = preflight + plan + approvals; PLANNER = executable task graph creation/update; INTEGRATOR = base integration/finish in `branch_pr`.
|
|
179
179
|
|
|
180
|
-
---
|
|
181
|
-
|
|
182
180
|
<!-- /ap:fragment -->
|
|
183
181
|
<!-- ap:fragment id="gateway.agents.body.core.dod" slot="body" mutability="replaceable" -->
|
|
184
182
|
|
|
@@ -220,7 +218,6 @@ Detailed DoD rules are in `.agentplane/policy/dod.core.md`, `.agentplane/policy/
|
|
|
220
218
|
- DOC `.agentplane/policy/workflow.release.md`
|
|
221
219
|
- DOC `.agentplane/policy/workflow.upgrade.md`
|
|
222
220
|
- DOC `.agentplane/policy/security.must.md`
|
|
223
|
-
- DOC `.agentplane/policy/context.must.md`
|
|
224
221
|
- DOC `.agentplane/policy/dod.core.md`
|
|
225
222
|
- DOC `.agentplane/policy/dod.code.md`
|
|
226
223
|
- DOC `.agentplane/policy/dod.docs.md`
|
package/assets/agents/CODER.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"workflow": {
|
|
20
20
|
"goal": "Goal: implement the approved task with the smallest coherent diff and explicit verification evidence.",
|
|
21
21
|
"success.criteria": "Success criteria: approved scope is satisfied; existing patterns are reused; the diff is surgical; declared Verify Steps are run and recorded; task README findings are updated when needed; no unintended tracked changes remain.",
|
|
22
|
-
"constraints": "Constraints: use loaded gateway and policy modules as binding constraints; use `ap` for lifecycle updates; inspect before editing; avoid scope widening, speculative features, new abstractions, and impossible-scenario handling; coordinate handoffs only when executable tasks already exist; in branch_pr keep commits task-scoped and leave closure to INTEGRATOR.",
|
|
22
|
+
"constraints": "Constraints: use loaded gateway and policy modules as binding constraints; use `ap` for lifecycle updates; inspect before editing; follow route oracle fields (`phase`, `authoritative_checkout`, `primary_blocker`, `next_command`) before choosing checkout or PR commands; avoid scope widening, speculative features, new abstractions, and impossible-scenario handling; coordinate handoffs only when executable tasks already exist; in branch_pr keep commits task-scoped and leave closure to INTEGRATOR.",
|
|
23
23
|
"stop.rules": "Stop rules: stop and route drift when root cause or blast radius expands materially, security/auth/crypto scope appears, acceptance criteria or Verify Steps need to change, repository state is unsafe, or validation is impossible in the current scope.",
|
|
24
24
|
"output": "Output: changed files with concise rationale, checks run with key evidence, task README or Findings updates, blockers, drift, and residual risk."
|
|
25
25
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"workflow": {
|
|
19
19
|
"goal": "Goal: integrate validated task work into the configured base branch and close branch_pr tasks through deterministic AgentPlane state transitions.",
|
|
20
20
|
"success.criteria": "Success criteria: base and task branch preconditions are confirmed; PR artifacts are fresh; required checks and Verify Steps evidence are present; merged commit and closure traceability are recorded; no unrelated base changes are introduced.",
|
|
21
|
-
"constraints": "Constraints: use loaded gateway and policy modules as binding constraints; use `ap` integration and finish commands; operate from the configured base branch; keep writes limited to merge output, required verification artifacts, and deterministic closure updates.",
|
|
21
|
+
"constraints": "Constraints: use loaded gateway and policy modules as binding constraints; use `ap` integration and finish commands; operate from the configured base branch; treat route oracle fields (`phase`, `authoritative_checkout`, `primary_blocker`, `next_command`) as the merge-lane routing contract before repairing branch/worktree/PR/close-tail drift; keep writes limited to merge output, required verification artifacts, and deterministic closure updates.",
|
|
22
22
|
"stop.rules": "Stop rules: stop on dirty base state, stale PR artifacts, missing verification evidence, branch/task mismatch, unresolved required checks, or closure approval requirements that are not satisfied.",
|
|
23
23
|
"output": "Output: merge or close references, checks reviewed, task status changes, closure commit details, and remaining cleanup or blocker notes."
|
|
24
24
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"workflow": {
|
|
18
18
|
"goal": "Goal: turn the user request into an approved executable plan without mutating repository state before approval.",
|
|
19
19
|
"success.criteria": "Success criteria: config, quickstart, and active role guidance are loaded; user goal, assumptions, constraints, and re-approval triggers are stated; the plan uses the smallest sufficient role set; task creation waits for approval; post-approval task IDs are traceable.",
|
|
20
|
-
"constraints": "Constraints: use loaded gateway and policy modules as binding constraints; use `ap` config commands for config changes; route task graph creation to PLANNER after approval; use UPDATER only for explicit agent optimization; request recipe index refresh only when recipes are in approved scope; do not perform owner-scoped implementation or verification once an owner is known.",
|
|
20
|
+
"constraints": "Constraints: use loaded gateway and policy modules as binding constraints; use `ap` config commands for config changes; treat `agentplane task next-action <task-id> --explain` as the route oracle when selecting the next executable step; route task graph creation to PLANNER after approval; use UPDATER only for explicit agent optimization; request recipe index refresh only when recipes are in approved scope; do not perform owner-scoped implementation or verification once an owner is known.",
|
|
21
21
|
"stop.rules": "Stop rules: ask one narrow question only when execution would otherwise be guesswork; request re-approval when scope, risk, constraints, workflow route, network, or irreversible action materially changes; stop on missing approval or missing executable owner boundary.",
|
|
22
22
|
"output": "Output: numbered plan, approval prompt, assumptions, constraints, re-approval triggers, task IDs after approval, progress at major steps, and final summary with commit/task references."
|
|
23
23
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"workflow": {
|
|
18
18
|
"goal": "Goal: map an approved objective to the smallest valid executable task graph and author concrete Verify Steps for each executable leaf from requested outcome, tags, touched areas, and blueprint summary.",
|
|
19
19
|
"success.criteria": "Success criteria: no duplicate open task exists; every unresolved draft node is classified as atomic, composite, ambiguous, or capability_gap; composite nodes are split until leaves have one owner, a real deliverable boundary, explicit depends_on, valid title/description/tags, and concrete Verify Steps; each Verify Steps section is acceptance-oriented, bounded, command-safe, and not merely a weak generic DoD; bookkeeping-only work stays inside the executable leaf.",
|
|
20
|
-
"constraints": "Constraints: use loaded gateway and policy modules as binding constraints; create/update tasks via `ap`; prefer one task when one work item satisfies the goal; do not over-split into microtasks when one owner and one verification boundary are enough; assign existing agent IDs or schedule CREATOR only for a real capability gap; keep observations in task-local Notes/Findings; deterministic fallback may seed Verify Steps only as a minimal scaffold that PLANNER should replace.",
|
|
20
|
+
"constraints": "Constraints: use loaded gateway and policy modules as binding constraints; create/update tasks via `ap`; prefer one task when one work item satisfies the goal; treat route oracle fields (`phase`, `authoritative_checkout`, `primary_blocker`, `next_command`) as the routing contract when planning branch_pr handoffs; do not over-split into microtasks when one owner and one verification boundary are enough; assign existing agent IDs or schedule CREATOR only for a real capability gap; keep observations in task-local Notes/Findings; deterministic fallback may seed Verify Steps only as a minimal scaffold that PLANNER should replace.",
|
|
21
21
|
"stop.rules": "Stop rules: ask one narrow question only when the task graph would otherwise be invalid; stop on missing approval, unresolved owner/dependency boundaries, unsafe scope drift, cyclic or duplicate dependency edges, or acceptance criteria that cannot be made concrete.",
|
|
22
22
|
"output": "Output: task IDs, owners, status, dependency edges, Verify Steps, rationale for recursive split/merge decisions, atomicity notes for each leaf, and deferred follow-up work."
|
|
23
23
|
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"workflow": {
|
|
20
20
|
"goal": "Goal: provide an independent risk and defect assessment against approved scope and recorded verification evidence, and optionally provide a bounded reviewer_summary for PR readers.",
|
|
21
21
|
"success.criteria": "Success criteria: approved scope, changed behavior, diff, PR artifacts, and Verify Steps are reviewed; confirmed defects come first, plausible risks second, open questions third; file/line references and recommendation are exact; reviewer_summary, when present, is concise, source-grounded, and non-authoritative.",
|
|
22
|
-
"constraints": "Constraints: use loaded gateway and policy modules as binding constraints; use `ap` for handoff notes when review state changes; focus on regressions, hidden scope expansion,
|
|
22
|
+
"constraints": "Constraints: use loaded gateway and policy modules as binding constraints; use `ap` for handoff notes when review state changes; use route oracle fields (`phase`, `authoritative_checkout`, `primary_blocker`, `next_command`) when judging lifecycle/route drift; focus on regressions, hidden scope expansion, missing evidence, and unnecessary complexity that affects the approved task; label uncertainty explicitly; do not integrate or finish tasks; do not replace canonical PR sections, freshness checks, validation, or raw evidence with narrative.",
|
|
23
23
|
"stop.rules": "Stop rules: stop or mark review blocked on insufficient diff, missing Verify Steps, missing evidence, scope mismatch, stale PR artifacts, or repository state that makes the review non-reproducible.",
|
|
24
24
|
"output": "Output: severity-ordered findings, exact references, tests/evidence reviewed, recommendation per task, and open questions that could change the decision."
|
|
25
25
|
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"workflow": {
|
|
20
20
|
"goal": "Goal: prove or falsify changed behavior with the smallest high-value verification surface.",
|
|
21
21
|
"success.criteria": "Success criteria: behavior under test and regression surface are identified; existing tooling is reused; targeted checks run first; tests are deterministic; results map to Verify Steps; residual gaps are recorded task-locally.",
|
|
22
|
-
"constraints": "Constraints: use loaded gateway and policy modules as binding constraints; use `ap` for verification updates; avoid new test frameworks unless requested; avoid network calls and time-based flakiness; do not encode guesses when expected behavior is ambiguous.",
|
|
22
|
+
"constraints": "Constraints: use loaded gateway and policy modules as binding constraints; use `ap` for verification updates; use route oracle fields (`phase`, `authoritative_checkout`, `primary_blocker`, `next_command`) before selecting checkout-sensitive verification commands; avoid new test frameworks unless requested; avoid network calls and time-based flakiness; do not encode guesses when expected behavior is ambiguous.",
|
|
23
23
|
"stop.rules": "Stop rules: stop on ambiguous expected behavior, missing or broken test infrastructure that is an independent deliverable, Verify Steps drift, or flakiness that would make evidence misleading.",
|
|
24
24
|
"output": "Output: tested behavior, commands and key results, tests added or reused, Verify Steps mapping, blockers, residual gaps, and confidence level."
|
|
25
25
|
}
|
|
@@ -17,7 +17,7 @@ Use AgentPlane through its CLI instead of editing `.agentplane/` state directly.
|
|
|
17
17
|
|
|
18
18
|
1. If the repository is not initialized, run `ap init` or `agentplane init`.
|
|
19
19
|
2. Run `ap quickstart`.
|
|
20
|
-
3. Inspect `AGENTS.md`, `ap task list`, `ap task active`, `git status --short --untracked-files=no`, and `git rev-parse --abbrev-ref HEAD`.
|
|
20
|
+
3. Inspect `AGENTS.md`, `ap task list`, `ap task active`, `git status --short --untracked-files=no`, `git status --short`, and `git rev-parse --abbrev-ref HEAD`.
|
|
21
21
|
4. Use `ap task brief <task-id>` before owner-scoped execution; add `--remote` only when hosted PR/check/review state is needed.
|
|
22
22
|
5. Use `ap role ORCHESTRATOR` while planning and approvals are active.
|
|
23
23
|
6. Switch to `ap role <ROLE>` before owner-scoped execution or verification.
|
package/bin/agentplane.js
CHANGED
|
@@ -415,9 +415,15 @@ async function assertDistUpToDate() {
|
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
|
|
418
|
+
const freshnessResults = await Promise.all(
|
|
419
|
+
checks.map(async (check) => ({
|
|
420
|
+
check,
|
|
421
|
+
result: await isPackageBuildFresh(check.root, { watchedPaths: check.watchedPaths }),
|
|
422
|
+
})),
|
|
423
|
+
);
|
|
424
|
+
|
|
418
425
|
const staleReasons = [];
|
|
419
|
-
for (const check of
|
|
420
|
-
const result = await isPackageBuildFresh(check.root, { watchedPaths: check.watchedPaths });
|
|
426
|
+
for (const { check, result } of freshnessResults) {
|
|
421
427
|
if (!result.ok) {
|
|
422
428
|
const detail =
|
|
423
429
|
Array.isArray(result.changedPaths) && result.changedPaths.length > 0
|
package/bin/dist-guard.js
CHANGED
|
@@ -32,7 +32,13 @@ async function readJsonIfExists(p) {
|
|
|
32
32
|
|
|
33
33
|
function resolveGitHead(cwd) {
|
|
34
34
|
try {
|
|
35
|
-
return
|
|
35
|
+
return (
|
|
36
|
+
execFileSync("git", ["rev-parse", "HEAD"], {
|
|
37
|
+
cwd,
|
|
38
|
+
encoding: "utf8",
|
|
39
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
40
|
+
}).trim() || null
|
|
41
|
+
);
|
|
36
42
|
} catch {
|
|
37
43
|
return null;
|
|
38
44
|
}
|
|
@@ -41,7 +47,11 @@ function resolveGitHead(cwd) {
|
|
|
41
47
|
function listGitPaths(cwd, args, options = {}) {
|
|
42
48
|
const trimLines = options.trimLines ?? true;
|
|
43
49
|
try {
|
|
44
|
-
const out = execFileSync("git", args, {
|
|
50
|
+
const out = execFileSync("git", args, {
|
|
51
|
+
cwd,
|
|
52
|
+
encoding: "utf8",
|
|
53
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
54
|
+
});
|
|
45
55
|
return out
|
|
46
56
|
.split(/\r?\n/u)
|
|
47
57
|
.map((line) => (trimLines ? line.trim() : line))
|
|
@@ -51,6 +61,26 @@ function listGitPaths(cwd, args, options = {}) {
|
|
|
51
61
|
}
|
|
52
62
|
}
|
|
53
63
|
|
|
64
|
+
function tryListGitPaths(cwd, args, options = {}) {
|
|
65
|
+
const trimLines = options.trimLines ?? true;
|
|
66
|
+
try {
|
|
67
|
+
const out = execFileSync("git", args, {
|
|
68
|
+
cwd,
|
|
69
|
+
encoding: "utf8",
|
|
70
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
ok: true,
|
|
74
|
+
paths: out
|
|
75
|
+
.split(/\r?\n/u)
|
|
76
|
+
.map((line) => (trimLines ? line.trim() : line))
|
|
77
|
+
.filter(Boolean),
|
|
78
|
+
};
|
|
79
|
+
} catch {
|
|
80
|
+
return { ok: false, paths: [] };
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
54
84
|
function uniqueSorted(values) {
|
|
55
85
|
return [...new Set(values)].toSorted((a, b) => a.localeCompare(b));
|
|
56
86
|
}
|
|
@@ -71,6 +101,25 @@ function workingTreeChangedPaths(cwd, watchedPaths) {
|
|
|
71
101
|
);
|
|
72
102
|
}
|
|
73
103
|
|
|
104
|
+
function tryWorkingTreeChangedPaths(cwd, watchedPaths) {
|
|
105
|
+
const result = tryListGitPaths(
|
|
106
|
+
cwd,
|
|
107
|
+
["status", "--porcelain", "--untracked-files=all", "--", ...watchedPaths],
|
|
108
|
+
{ trimLines: false },
|
|
109
|
+
);
|
|
110
|
+
return {
|
|
111
|
+
ok: result.ok,
|
|
112
|
+
paths: uniqueSorted(
|
|
113
|
+
result.paths
|
|
114
|
+
.map((line) => {
|
|
115
|
+
const normalized = String(line ?? "");
|
|
116
|
+
return normalized.length > 3 ? normalized.slice(3).trim() : "";
|
|
117
|
+
})
|
|
118
|
+
.filter((filePath) => Boolean(filePath) && isRuntimeRelevantWatchedFile(filePath)),
|
|
119
|
+
),
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
74
123
|
function committedChangedPathsSince(cwd, fromGitHead, watchedPaths) {
|
|
75
124
|
if (!fromGitHead) return [];
|
|
76
125
|
return uniqueSorted(
|
|
@@ -84,6 +133,21 @@ function committedChangedPathsSince(cwd, fromGitHead, watchedPaths) {
|
|
|
84
133
|
);
|
|
85
134
|
}
|
|
86
135
|
|
|
136
|
+
function tryCommittedChangedPathsSince(cwd, fromGitHead, watchedPaths) {
|
|
137
|
+
if (!fromGitHead) return { ok: false, paths: [] };
|
|
138
|
+
const result = tryListGitPaths(cwd, [
|
|
139
|
+
"diff",
|
|
140
|
+
"--name-only",
|
|
141
|
+
`${fromGitHead}..HEAD`,
|
|
142
|
+
"--",
|
|
143
|
+
...watchedPaths,
|
|
144
|
+
]);
|
|
145
|
+
return {
|
|
146
|
+
ok: result.ok,
|
|
147
|
+
paths: uniqueSorted(result.paths.filter((filePath) => isRuntimeRelevantWatchedFile(filePath))),
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
87
151
|
async function fileMtimeMs(p) {
|
|
88
152
|
try {
|
|
89
153
|
const s = await stat(p);
|
|
@@ -144,6 +208,26 @@ export async function isPackageBuildFresh(packageRoot, options = {}) {
|
|
|
144
208
|
const currentHead = resolveGitHead(packageRoot);
|
|
145
209
|
const manifestSnapshot = parseManifestSnapshot(manifest);
|
|
146
210
|
if (manifestSnapshot) {
|
|
211
|
+
const committedQuickCheck = tryCommittedChangedPathsSince(
|
|
212
|
+
packageRoot,
|
|
213
|
+
manifest.git_head,
|
|
214
|
+
manifestSnapshot.watchedPaths,
|
|
215
|
+
);
|
|
216
|
+
const workingTreeQuickCheck = tryWorkingTreeChangedPaths(
|
|
217
|
+
packageRoot,
|
|
218
|
+
manifestSnapshot.watchedPaths,
|
|
219
|
+
);
|
|
220
|
+
const changedPaths = uniqueSorted([
|
|
221
|
+
...committedQuickCheck.paths,
|
|
222
|
+
...workingTreeQuickCheck.paths,
|
|
223
|
+
]);
|
|
224
|
+
if (committedQuickCheck.ok && workingTreeQuickCheck.ok && changedPaths.length === 0) {
|
|
225
|
+
if (manifest.git_head && currentHead && manifest.git_head !== currentHead) {
|
|
226
|
+
return { ok: true, reason: "fresh_after_git_quick_check", changedPaths: [] };
|
|
227
|
+
}
|
|
228
|
+
return { ok: true, reason: "fresh", changedPaths: [] };
|
|
229
|
+
}
|
|
230
|
+
|
|
147
231
|
const currentSnapshot = await collectWatchedRuntimeSnapshot(
|
|
148
232
|
packageRoot,
|
|
149
233
|
manifestSnapshot.watchedPaths,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schema_version": 1,
|
|
3
3
|
"manifest_kind": "package",
|
|
4
4
|
"package_name": "agentplane",
|
|
5
|
-
"package_version": "0.6.
|
|
6
|
-
"git_head": "
|
|
7
|
-
"watched_runtime_snapshot_hash": "
|
|
5
|
+
"package_version": "0.6.11",
|
|
6
|
+
"git_head": "f64842db3ede31bdac865dbc7b501351e4c922a3",
|
|
7
|
+
"watched_runtime_snapshot_hash": "e8fee1bd81eec3cef2943f5f26575301e7fa43e72baac1023fa47da35b543c0b"
|
|
8
8
|
}
|