agentic-engineering-harness 0.6.4 → 0.6.6

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.
Files changed (50) hide show
  1. package/README.md +119 -17
  2. package/dist/audit/run.d.ts +2 -0
  3. package/dist/audit/run.js +28 -15
  4. package/dist/audit/run.js.map +1 -1
  5. package/dist/core/init.js +9 -2
  6. package/dist/core/init.js.map +1 -1
  7. package/dist/core/types.d.ts +9 -0
  8. package/dist/main.d.ts +2 -0
  9. package/dist/main.js +266 -0
  10. package/dist/main.js.map +1 -0
  11. package/dist/operations/controller.d.ts +17 -0
  12. package/dist/operations/controller.js +198 -0
  13. package/dist/operations/controller.js.map +1 -0
  14. package/dist/operations/interactive.d.ts +5 -0
  15. package/dist/operations/interactive.js +45 -0
  16. package/dist/operations/interactive.js.map +1 -0
  17. package/dist/operations/mcp.d.ts +1 -0
  18. package/dist/operations/mcp.js +129 -0
  19. package/dist/operations/mcp.js.map +1 -0
  20. package/dist/operations/state.d.ts +43 -0
  21. package/dist/operations/state.js +127 -0
  22. package/dist/operations/state.js.map +1 -0
  23. package/dist/paseo/launchSpec.d.ts +25 -0
  24. package/dist/paseo/launchSpec.js +69 -0
  25. package/dist/paseo/launchSpec.js.map +1 -0
  26. package/dist/paseo/runtime.d.ts +8 -1
  27. package/dist/paseo/runtime.js +66 -21
  28. package/dist/paseo/runtime.js.map +1 -1
  29. package/dist/paseo/sdk.d.ts +33 -12
  30. package/dist/paseo/sdk.js +122 -55
  31. package/dist/paseo/sdk.js.map +1 -1
  32. package/dist/paseo/start.d.ts +9 -2
  33. package/dist/paseo/start.js +63 -13
  34. package/dist/paseo/start.js.map +1 -1
  35. package/dist/runtime/invocation.d.ts +10 -0
  36. package/dist/runtime/invocation.js +51 -0
  37. package/dist/runtime/invocation.js.map +1 -0
  38. package/dist/telemetry/events.js +19 -0
  39. package/dist/telemetry/events.js.map +1 -1
  40. package/dist/workers/agentPrompt.d.ts +4 -0
  41. package/dist/workers/agentPrompt.js +110 -32
  42. package/dist/workers/agentPrompt.js.map +1 -1
  43. package/dist/workers/paseo.js +23 -26
  44. package/dist/workers/paseo.js.map +1 -1
  45. package/docs/PASEO.md +162 -27
  46. package/package.json +10 -6
  47. package/scripts/link-self-bin.mjs +36 -0
  48. package/skills/engineering-workflow/SKILL.md +40 -16
  49. package/skills/paseo-orchestration/SKILL.md +18 -3
  50. package/templates/AGENTS.md +8 -6
package/docs/PASEO.md CHANGED
@@ -2,71 +2,212 @@
2
2
 
3
3
  Paseo is AEH's default interactive orchestration surface. The integration separates **Paseo communication/session lifecycle** from **AEH deterministic workflow ownership**.
4
4
 
5
+ ## Visible operation graph
6
+
7
+ A managed conversational lead does not own a long-running shell process. Long AUDIT/RUN workflows are first-class detached AEH operations:
8
+
9
+ ```bash
10
+ aeh operation start audit "Review the repository architecture and security"
11
+ aeh operation start run TASK-123
12
+ ```
13
+
14
+ `start` returns an operation id promptly. The deterministic controller persists state in `.harness/operations/<id>.json`, then performs the sealed workflow independently of the lead conversation:
15
+
16
+ ```text
17
+ Paseo UI
18
+ │
19
+ ▼
20
+ AEH Lead (semantic orchestrator)
21
+ │ operation tools / short status calls
22
+ ▼
23
+ AEH Operation Controller (deterministic, not an LLM agent)
24
+ ├── seals / validators / state machines
25
+ ├── local orchestration workspace
26
+ └── Paseo SDK
27
+ ├── planner/reviewer/worker agent
28
+ ├── planner/reviewer/worker agent
29
+ └── ...
30
+ ```
31
+
32
+ The controller is deliberately **not** represented by a fake Paseo agent. Only real LLM participants become Paseo sessions.
33
+
34
+ Observe or control an operation with:
35
+
36
+ ```bash
37
+ aeh operation status <operation-id>
38
+ aeh operation wait <operation-id> --timeout 1800
39
+ aeh operation cancel <operation-id>
40
+ aeh paseo agents --operation <operation-id>
41
+ aeh paseo agents --operation <operation-id> --phase review
42
+ ```
43
+
44
+ Synchronous `aeh audit` / `aeh run` remain valid compatibility entrypoints for non-interactive automation.
45
+
5
46
  ## SDK-first control plane
6
47
 
7
48
  AEH uses Paseo's published TypeScript client package, `@getpaseo/client`, as the primary control surface for agent creation, follow-up turns, status lookup and directory queries. Paseo currently documents that package as public but **not yet a stable public SDK**, so AEH deliberately resolves the copy bundled with the active `@getpaseo/cli` installation first instead of independently selecting a client version.
8
49
 
9
- The resolver supports normal PATH installations and mise-managed npm tools. In particular, mise may expose a shim through `command -v`; AEH also asks `mise which paseo` for the real binary and `mise where npm:@getpaseo/cli` for the synthetic npm installation root, then resolves `@getpaseo/client` from that package tree. A direct project-level SDK import is retained only as a compatibility fallback.
50
+ The resolver supports normal PATH installations and mise-managed npm tools, including non-hoisted/store layouts. AEH asks `command -v paseo`, `mise which paseo`, and `mise where npm:@getpaseo/cli`, then resolves or bounded-scans the active installation for its exact `@getpaseo/client` entry. A direct project-level SDK import is retained only as a compatibility fallback.
10
51
 
11
- The CLI remains responsible for daemon bootstrap/recovery and is retained as a compatibility fallback when the SDK cannot be resolved or connected:
52
+ Normal lifecycle is always SDK-first unless `AEH_PASEO_FORCE_CLI=1` is explicitly set:
12
53
 
13
54
  ```text
14
55
  AEH
15
- ├── daemon/bootstrap/recovery -> Paseo CLI
16
- └── normal agent lifecycle -> @getpaseo/client bundled with active CLI
56
+ ├── daemon/bootstrap/recovery -> Paseo CLI
57
+ ├── normal agent lifecycle -> active @getpaseo/client
58
+ └── explicit/recoverable compatibility -> Paseo CLI
17
59
  ```
18
60
 
19
- Set `AEH_PASEO_FORCE_CLI=1` only when the compatibility path is deliberately required. `PASEO_DAEMON_URL` overrides the default SDK endpoint `ws://127.0.0.1:6767/ws`; `PASEO_DAEMON_PASSWORD` supplies daemon authentication when configured.
61
+ `PASEO_DAEMON_URL` overrides the default SDK endpoint `ws://127.0.0.1:6767/ws`; `PASEO_DAEMON_PASSWORD` supplies daemon authentication when configured.
20
62
 
21
63
  A system-prompt-only idle agent is an SDK-only invariant. If the SDK is unavailable, AEH refuses to degrade that lead creation into a CLI user turn because doing so would expose the bootstrap as conversational input.
22
64
 
65
+ ## Agent lifecycle
66
+
67
+ AEH separates visible agent lifecycle into three phases:
68
+
69
+ ```text
70
+ materialize -> dispatch -> wait
71
+ ```
72
+
73
+ - **materialize** creates an idle top-level Paseo agent so it is visible immediately;
74
+ - **dispatch** sends the bounded prompt when deterministic prerequisites/evidence are ready;
75
+ - **wait** collects completion/result without conflating creation with execution.
76
+
77
+ For AUDIT, AEH materializes the selected read-only reviewers before running deterministic validators. They remain visible/idle while validation runs, then AEH dispatches them with the completed validator evidence. This preserves deterministic evidence precedence without the earlier “silent terminal” UX.
78
+
79
+ The adapter follows the Paseo 0.3.1 create contract: `cwd` remains present even when `workspaceId` controls placement, `initialPrompt` is used for the first turn, and provider/model remain separate session-config fields. It supports current handles through `send`, `refetch`, timeline polling and compatible legacy helpers where present.
80
+
23
81
  ## Conversational lead
24
82
 
25
- `aeh start` creates the lead as an idle Paseo agent. The AEH bootstrap is passed through the SDK's `systemPrompt`; it is no longer sent as the first user message and there is no synthetic `AEH READY` turn.
83
+ `aeh start` creates the lead as an idle Paseo agent. The AEH bootstrap is passed through the SDK's `systemPrompt`; it is not sent as a user message and there is no synthetic readiness turn.
84
+
85
+ The bootstrap is intentionally thin. `AGENTS.md`, `.harness/skills/engineering-workflow/SKILL.md`, and the resolved AEH agent topology are authoritative for roles, charters, permissions and delegation.
86
+
87
+ When `orchestration.interactive.usePaseoTools` is enabled, AEH derives the exact command vector that launched the current package and injects an `aeh-control` stdio MCP server into the lead session. A normal installed launch therefore becomes conceptually:
88
+
89
+ ```text
90
+ mcp server: aeh-control
91
+ command: <exact Node executable>
92
+ args: [<exact dist/main.js>, operation, mcp]
93
+ ```
94
+
95
+ Only four MCP tools are preapproved:
96
+
97
+ ```text
98
+ aeh_operation_start_audit
99
+ aeh_operation_start_run
100
+ aeh_operation_status
101
+ aeh_operation_cancel
102
+ ```
103
+
104
+ Paseo's `toolPolicy.preapproved` is scoped to those exact MCP server/tool identities; native shell/edit tools are not broadened by this configuration. If the AEH invocation cannot be parsed as a safe command vector, MCP injection is skipped rather than evaluating shell syntax, and the short `aeh operation ...` CLI surface remains the fallback.
105
+
106
+ The lead bootstrap version is incremented when this managed-session contract changes, so explicit resume cannot silently reuse an older lead that lacks the current operation-control surface.
107
+
108
+ Paseo native orchestration tools remain preferred for bounded conversational delegation and `/paseo-handoff`. Deterministic multi-agent workflows are owned by the detached AEH operation controller, so the lead remains available to the user.
26
109
 
27
- The bootstrap is intentionally thin. `AGENTS.md`, `.harness/skills/engineering-workflow/SKILL.md`, and the resolved AEH agent topology are authoritative for roles, charters, permissions and delegation. This avoids duplicating a role map inside every Paseo conversation and prevents prompt/configuration drift.
110
+ ## Operation MCP server
111
+
112
+ The same control surface can be started directly for any MCP-capable host:
113
+
114
+ ```bash
115
+ aeh operation mcp
116
+ ```
28
117
 
29
- When the lead is running inside Paseo and Paseo exposes its orchestration tools, it may still use the native/MCP conversational surface and `/paseo-handoff`. Deterministic Harness-owned work, however, is created externally by AEH through the SDK.
118
+ It is a stdio JSON-RPC server and calls the same persistent controller used by the CLI. It does not duplicate workflow logic and does not become a normative engineering source.
30
119
 
31
120
  ## Independent AEH agents
32
121
 
33
- AEH-managed workers are created without the Paseo SDK `parent` option. A worker may be placed in a delivery workspace, but workspace placement does not establish parentage. This makes each worker a top-level Paseo agent rather than a child whose lifecycle belongs to the current lead conversation.
122
+ AEH-managed workers are created without Paseo `parent` ownership. Workers are independent top-level sessions so lead context rotation cannot terminate or orphan their lifecycle.
34
123
 
35
- Workflow ownership is represented by labels instead:
124
+ Workflow ownership and visibility use labels:
36
125
 
37
126
  ```text
38
127
  aeh.project=<project>
39
128
  aeh.kind=lead|worker
40
129
  aeh.role=<logical-agent>
41
- aeh.task=<task-id> # workers
130
+ aeh.task=<task-id>
131
+ aeh.operation=<operation-id>
132
+ aeh.operation.kind=audit|run|quick|...
133
+ aeh.operation.phase=queued|planning|review|implementation|diagnosis|...
134
+ aeh.workspace.kind=orchestration|delivery
42
135
  aeh.profile=<profile> # when selected
43
136
  aeh.generation=<n> # leads
44
137
  ```
45
138
 
46
- The shared Paseo runtime exposes list/inspect primitives over those labels. This lets AEH determine which logical agent is active for a task without scraping assistant prose or relying on parent/child nesting. The same labels survive lead context rotation, so a fresh lead can correlate existing workers with durable AEH run state.
139
+ The operation/task labels are durable correlation keys; Paseo parent/subagent nesting is not the workflow source of truth.
47
140
 
48
141
  ### Observe active agents
49
142
 
50
- Use the top-level AEH command to inspect the live Paseo directory. The project label is applied automatically; filters are additive:
51
-
52
143
  ```bash
53
144
  aeh paseo agents
54
145
  aeh paseo agents --status working
55
146
  aeh paseo agents --kind worker --role backend-implementer
56
147
  aeh paseo agents --task TASK-123 --json
148
+ aeh paseo agents --operation AUDIT-... --phase review
57
149
  ```
58
150
 
59
- The tabular view reports status, logical role, task, kind, stable Paseo agent ID and title. `--json` returns the same normalized fields plus the complete AEH label set. This is the preferred way to answer which AEH agent is currently working without depending on Paseo parent/subagent nesting.
151
+ The operation-aware view reports stable Paseo IDs, role, operation, phase, task, status and title.
152
+
153
+ ## Orchestration workspace vs delivery workspace
154
+
155
+ Paseo workspaces and Git delivery isolation are separate concepts.
156
+
157
+ For each detached operation AEH attempts to create a **local Paseo workspace** pointing at the existing repository directory. Its purpose is UI/execution grouping: multiple agents for the same audit/run appear together. It does not create or imply a Git branch/worktree.
158
+
159
+ When delivery policy creates an issue-linked worktree workspace, that delivery workspace takes precedence for implementation/review agents:
160
+
161
+ ```text
162
+ operation workspace -> local grouping, no Git isolation
163
+
164
+ delivery workspace -> branch/worktree isolation and delivery lifecycle
165
+ ```
166
+
167
+ This lets audits and non-delivery operations have coherent Paseo grouping even when `delivery.paseo.enabled` is false.
60
168
 
61
169
  ## Runtime consolidation
62
170
 
63
- Lead startup, `PaseoWorkerExecutor`, and generic `agentPrompt` execution all use the same managed Paseo runtime. That runtime owns SDK-first create/run/probe/list behavior and the CLI fallback. Individual worker paths should not add new hand-written `paseo run/send/wait/logs` loops.
171
+ `PaseoWorkerExecutor` and generic `agentPrompt` no longer independently reconstruct provider/model/title/workspace/labels. Both consume one launch-spec compiler. This is the single boundary for:
172
+
173
+ - provider/model selection;
174
+ - title;
175
+ - operation/task labels;
176
+ - semantic phase;
177
+ - orchestration-vs-delivery workspace;
178
+ - timeout.
179
+
180
+ This prevents launch-path drift such as provider/model or cwd/workspace serialization mismatches.
64
181
 
65
- Structured output is passed through the SDK `outputSchema` field. The compatibility CLI path continues to negotiate `--output-schema` and background capabilities dynamically.
182
+ ## Operation/session metadata
183
+
184
+ Worker/reviewer execution records retain lifecycle metadata in addition to stdout/stderr:
185
+
186
+ ```text
187
+ id
188
+ transport
189
+ workspaceId
190
+ title
191
+ operationId
192
+ operationKind
193
+ phase
194
+ status
195
+ startedAt
196
+ finishedAt
197
+ logicalAgent / runtime / model
198
+ ```
66
199
 
67
- ## Session policy
200
+ Audit/run reports can therefore distinguish a real Paseo SDK session from CLI/direct/Podman execution without inferring it from logs.
68
201
 
69
- Default:
202
+ Operation phase is durable even when optional telemetry export is disabled. Harness lifecycle events update `.harness/operations/<id>.json` through phases such as `validating`, `planning`, `implementation`, `remediation`, `review`, `delivery`, and `finished`.
203
+
204
+ ## Cancellation
205
+
206
+ `aeh operation cancel <id>` terminates the detached controller and then discovers real Paseo agents by `aeh.operation=<id>`. Each active agent is interrupted through Paseo's supported `paseo agent stop <id>` lifecycle. Cleanup failures are retained as `cleanupWarnings` in operation state rather than silently ignored.
207
+
208
+ ## Session policy and context rotation
209
+
210
+ Default lead policy remains:
70
211
 
71
212
  ```yaml
72
213
  orchestration:
@@ -79,16 +220,10 @@ aeh start # fresh idle lead
79
220
  aeh start --resume # explicit compatible reuse
80
221
  ```
81
222
 
82
- Workspaces and durable AEH state remain reusable even though normal conversational context starts clean.
83
-
84
- ## Context rotation
85
-
86
- Default pressure policy is 70/80/90 percent. `aeh context guard` consumes a context ratio only when Paseo exposes a usable field; AEH does not guess.
87
-
88
- At the handoff threshold it writes a deterministic `.harness/paseo/handoffs/*.json` artifact. From a managed Paseo lead it also creates the replacement lead automatically and bootstraps it from the handoff artifact and referenced sealed/run/audit/delivery state. Workers remain independent top-level agents associated through AEH labels and durable task/run state rather than lead parentage.
223
+ Default context pressure policy is 70/80/90 percent. At the handoff threshold AEH writes `.harness/paseo/handoffs/*.json` and rotates responsibility to a fresh lead. Detached operations and independent worker agents continue; durable operation/run/audit/delivery state allows the replacement lead to correlate them without replaying the old conversation.
89
224
 
90
225
  ## Trust boundary
91
226
 
92
- Paseo owns communication, process and session lifecycle. It is not normative engineering truth. AEH TaskContracts, seals, deterministic reports, evidence graphs and quality gates continue to decide acceptance.
227
+ Paseo owns communication, UI grouping, process and session lifecycle. It is not normative engineering truth. AEH TaskContracts, seals, deterministic reports, operation state, evidence graphs and quality gates decide acceptance.
93
228
 
94
229
  For stronger direct process isolation configure Podman sandboxing where appropriate; Paseo orchestration and worker sandboxing remain separate policy axes.
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "agentic-engineering-harness",
3
- "version": "0.6.4",
3
+ "version": "0.6.6",
4
4
  "description": "OSS-first engineering harness for deterministic, spec-driven, issue-driven, audit-governed and orchestration-first multi-agent software delivery.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "engineering-harness": "./dist/entry.js",
8
- "aeh": "./dist/entry.js"
7
+ "engineering-harness": "./dist/main.js",
8
+ "aeh": "./dist/main.js"
9
9
  },
10
10
  "files": [
11
11
  "dist",
@@ -14,11 +14,15 @@
14
14
  "policies",
15
15
  "schemas",
16
16
  "skills",
17
- "docs"
17
+ "docs",
18
+ "scripts/link-self-bin.mjs"
18
19
  ],
19
20
  "scripts": {
20
- "build": "tsc -p tsconfig.json",
21
- "dev": "tsx src/entry.ts",
21
+ "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
22
+ "build": "npm run clean && tsc -p tsconfig.json",
23
+ "prepare": "npm run build && node scripts/link-self-bin.mjs",
24
+ "aeh": "node ./dist/main.js",
25
+ "dev": "tsx src/main.ts",
22
26
  "test": "vitest run",
23
27
  "test:watch": "vitest",
24
28
  "typecheck": "tsc -p tsconfig.json --noEmit",
@@ -0,0 +1,36 @@
1
+ import fs from "node:fs/promises";
2
+ import path from "node:path";
3
+ import process from "node:process";
4
+ import { fileURLToPath } from "node:url";
5
+
6
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
7
+ const binDir = path.join(root, "node_modules", ".bin");
8
+ const entry = path.join(root, "dist", "main.js");
9
+
10
+ try {
11
+ await fs.access(entry);
12
+ } catch {
13
+ throw new Error(`Cannot link AEH self-development bin because ${entry} does not exist. Run npm run build first.`);
14
+ }
15
+
16
+ await fs.mkdir(binDir, { recursive: true });
17
+ for (const name of ["aeh", "engineering-harness"]) await writeBin(name);
18
+
19
+ async function writeBin(name) {
20
+ const sh = path.join(binDir, name);
21
+ const cmd = `${sh}.cmd`;
22
+ const ps1 = `${sh}.ps1`;
23
+ const relative = "../../dist/main.js";
24
+
25
+ await fs.rm(sh, { force: true });
26
+ await fs.writeFile(sh, `#!/bin/sh\nexec node \"$(dirname \"$0\")/${relative}\" \"$@\"\n`);
27
+ await fs.chmod(sh, 0o755);
28
+
29
+ await fs.rm(cmd, { force: true });
30
+ await fs.writeFile(cmd, `@ECHO OFF\r\nnode \"%~dp0\\..\\..\\dist\\main.js\" %*\r\n`);
31
+
32
+ await fs.rm(ps1, { force: true });
33
+ await fs.writeFile(ps1, `#!/usr/bin/env pwsh\n& node \"$PSScriptRoot/../../dist/main.js\" $args\nexit $LASTEXITCODE\n`);
34
+ }
35
+
36
+ if (process.env.AEH_SELF_BIN_VERBOSE === "1") console.log(`Linked repo-local AEH bins in ${binDir}`);
@@ -25,16 +25,29 @@ Delegate everything else to the narrowest bounded role:
25
25
  - SPEC authoring -> `spec-manager` using OpenSpec;
26
26
  - implementation/validation/review -> Harness-selected workers.
27
27
 
28
- Use the `paseo-orchestration` skill. Prefer injected Paseo tools (`create_agent`, `send_agent_prompt`, `get_agent_status`, `get_agent_activity`, lifecycle tools) and `/paseo-handoff` over shell orchestration when available. AEH's Paseo CLI adapter is the compatibility fallback. Do not create hand-written `paseo run` loops from the lead.
28
+ Use the `paseo-orchestration` skill. Prefer injected Paseo tools (`create_agent`, `send_agent_prompt`, `get_agent_status`, `get_agent_activity`, lifecycle tools) and `/paseo-handoff` for bounded conversational delegation. For deterministic multi-agent AEH workflows, use the first-class operation controller rather than holding the lead inside a long shell process. AEH's Paseo CLI adapter is a compatibility fallback; do not create hand-written `paseo run` loops from the lead.
29
+
30
+ The AEH operation controller is deterministic infrastructure, not an LLM agent. Do not create a fake controller/session merely to make it visible in Paseo. Real LLM participants are materialized as independent top-level Paseo agents and are correlated through AEH operation/task labels.
29
31
 
30
32
  ## Persistent interactive entry
31
33
 
32
34
  When the conversation was created by `aeh start`, its bootstrap is a standing instruction. Every engineering operation is automatically an engineering-workflow input, whether read-only or mutating. Only a purely informational question may bypass AEH.
33
35
 
34
- A normal `aeh start` creates a fresh lead. `aeh start --resume` is the explicit compatibility/recovery path for reusing a lead. Do not assume old conversational context is normative; Git, sealed artifacts, AuditReports, run state and delivery state are the durable sources.
36
+ A normal `aeh start` creates a fresh lead. `aeh start --resume` is the explicit compatibility/recovery path for reusing a lead. Do not assume old conversational context is normative; Git, sealed artifacts, AuditReports, operation state, run state and delivery state are the durable sources.
35
37
 
36
38
  The bootstrap may provide an exact AEH invocation. Use it whenever this skill writes `aeh`.
37
39
 
40
+ ## Interactive operation boundary
41
+
42
+ Inside a managed Paseo lead, long deterministic workflows must be started detached:
43
+
44
+ - audit: `aeh operation start audit "<request>" ...`
45
+ - sealed task execution: `aeh operation start run <taskId> ...`
46
+
47
+ The start command must return promptly with an `operationId`. Report that identifier and the meaningful phase to the user instead of waiting in an interactive shell. Observe with `aeh operation status <operationId>` and, when useful, `aeh paseo agents --operation <operationId>`. Use `aeh operation wait` only when synchronous waiting is explicitly required by a non-interactive caller or bounded recovery flow. Cancel with `aeh operation cancel <operationId>` when the user requests cancellation.
48
+
49
+ Direct synchronous commands such as `aeh audit` and `aeh run` remain valid non-interactive/compatibility entrypoints, but a conversational Paseo lead should not use them for a long-running operation when the detached controller is available.
50
+
38
51
  ## Context pressure before broad work
39
52
 
40
53
  Do not wait for model compaction as the normal context lifecycle.
@@ -44,14 +57,14 @@ Do not wait for model compaction as the normal context lifecycle.
44
57
  - >=80%: proactive handoff to a fresh lead;
45
58
  - >=90%: mandatory handoff before additional engineering work.
46
59
 
47
- Use Paseo's current status/tool data when it exposes context usage, otherwise use `aeh context guard --agent "$PASEO_AGENT_ID"`. When AEH writes a `.harness/paseo/handoffs/*.json` artifact, use `/paseo-handoff` (preferred) or a fresh `create_agent`, point the new lead at that artifact and stop continuing the workflow in the old lead. Deterministic artifacts, not a prose replay of the whole chat, carry state across the handoff.
60
+ Use Paseo's current status/tool data when it exposes context usage, otherwise use `aeh context guard --agent "$PASEO_AGENT_ID"`. When AEH writes a `.harness/paseo/handoffs/*.json` artifact, use `/paseo-handoff` (preferred) or a fresh `create_agent`, point the new lead at that artifact and stop continuing the workflow in the old lead. Deterministic artifacts, not a prose replay of the whole chat, carry state across the handoff. Detached AEH operations and their top-level worker agents survive lead rotation.
48
61
 
49
62
  ## Intent layer
50
63
 
51
64
  Classify every request as:
52
65
 
53
66
  - `INFORMATIONAL`: explanation/lookup only. May be answered directly and must remain non-mutating.
54
- - `AUDIT`: read-only engineering review/validation/security/architecture/performance/quality/coverage/PR analysis. Must use `aeh audit`.
67
+ - `AUDIT`: read-only engineering review/validation/security/architecture/performance/quality/coverage/PR analysis. Must use the Harness audit path.
55
68
  - `CHANGE`: implementation, fix, refactor, addition, removal, dependency/config update or other repository mutation. Must continue through deterministic QUICK/SPEC triage.
56
69
 
57
70
  When not trivially informational, use `aeh intent` with compact evidence. Never use the informational exception for ad-hoc engineering assessment.
@@ -72,15 +85,16 @@ Do not invoke sudo or silently install unmanaged host prerequisites.
72
85
 
73
86
  ## AUDIT path
74
87
 
75
- 1. Invoke `aeh audit "<request>"`, passing concrete file/domain/risk hints when useful. Repository-wide scope is valid.
76
- 2. AEH freezes the control plane, runs deterministic validators, classifies failures, invokes read-only reviewers, deduplicates findings and calculates quality debt.
77
- 3. Validator failures remain evidence; do not reinterpret them as PASS.
78
- 4. Persisted reports under `.harness/audits/` are durable input for later remediation.
79
- 5. AUDIT never implements fixes. A later "fix these" is a new CHANGE using the AuditReport as evidence.
88
+ 1. From an interactive Paseo lead, invoke `aeh operation start audit "<request>"`, passing concrete file/domain/risk/reviewer hints when useful. Repository-wide scope is valid. A non-interactive caller may use synchronous `aeh audit`.
89
+ 2. AEH freezes the control plane and materializes the selected read-only reviewers as visible Paseo agents before deterministic validation begins. The agents remain idle until validator evidence is ready.
90
+ 3. AEH runs deterministic validators, classifies failures, dispatches the materialized reviewers with that evidence, deduplicates findings and calculates quality debt.
91
+ 4. Validator failures remain evidence; do not reinterpret them as PASS.
92
+ 5. Persisted reports under `.harness/audits/` and `.harness/operations/` are durable input for later remediation and recovery.
93
+ 6. AUDIT never implements fixes. A later "fix these" is a new CHANGE using the AuditReport as evidence.
80
94
 
81
95
  ## Issue-driven CHANGE path
82
96
 
83
- For an existing GitHub issue, use `aeh issue implement <number>` (or `aeh run --issue <number>`). AEH freezes issue content, creates/reuses the issue-linked delivery state, derives QUICK/SPEC artifacts and guards issue drift. Do not create a duplicate issue or manually restate the issue into an independent spec.
97
+ For an existing GitHub issue, use the issue intake flow to freeze and derive the task. `aeh issue implement <number>` remains a synchronous compatibility shortcut. From an interactive lead, once the resulting QuickContract/TaskContract is validated and sealed, execute it through `aeh operation start run <taskId>`. AEH guards issue drift and reuses the issue-linked delivery state. Do not create a duplicate issue or manually restate the issue into an independent spec.
84
98
 
85
99
  ## Non-issue CHANGE discovery and triage
86
100
 
@@ -97,8 +111,8 @@ For a CHANGE classified QUICK:
97
111
 
98
112
  1. Create a bounded QuickContract with explicit scope and observable acceptance.
99
113
  2. `aeh quick validate <id>`.
100
- 3. `aeh run <id>`.
101
- 4. Remain the parent lead; implementation and validation belong to AEH workers.
114
+ 3. From an interactive lead, start `aeh operation start run <id>`; use synchronous `aeh run <id>` only for non-interactive compatibility.
115
+ 4. Remain the semantic parent lead; implementation, validation and review belong to AEH workers and the deterministic controller.
102
116
 
103
117
  ## SPEC path — OpenSpec authoring
104
118
 
@@ -109,14 +123,24 @@ The lead must not write proposal/spec/design/tasks/Gherkin itself.
109
123
  3. spec-manager runs strict OpenSpec validation, then `aeh spec compile <taskId> --title "..." --change <change>`.
110
124
  4. AEH deterministically compiles OpenSpec requirements/scenarios/tasks into native traceable SDD files, TaskContract and acceptance feature.
111
125
  5. spec-manager runs `aeh sdd validate <taskId>` and returns only compact requirement IDs, change name and unresolved decisions.
112
- 6. The lead proceeds with normal seal/run/handoff. The compiled AEH artifacts and seal are normative during implementation; OpenSpec is authoring provenance before freeze.
126
+ 6. The lead proceeds with normal seal/handoff, then starts `aeh operation start run <taskId>` when interactive. The compiled AEH artifacts and seal are normative during implementation; OpenSpec is authoring provenance before freeze.
113
127
  7. Do not use OpenSpec apply commands to implement product code. AEH owns implementation, validation, review convergence and delivery.
114
128
 
115
129
  If OpenSpec cannot express a true product decision without guessing, return `REQUIRES_PRODUCT_DECISION`; otherwise author and validate autonomously.
116
130
 
131
+ ## Operation observation
132
+
133
+ Use durable operation state for progress rather than narrating terminal silence:
134
+
135
+ - `aeh operation status <id>` -> controller status/phase/result/error;
136
+ - `aeh paseo agents --operation <id>` -> real LLM participants and their roles/phases;
137
+ - `aeh operation wait <id>` -> synchronous boundary only when necessary.
138
+
139
+ Paseo workspaces used for operation grouping are local orchestration containers and do not imply Git branch/worktree delivery. Delivery workspaces remain a separate isolation decision and take precedence for workers when present.
140
+
117
141
  ## Quality convergence and recovery
118
142
 
119
- After a sealed run starts, do not reimplement Harness state machines in the lead. AEH owns planner waves, deterministic barriers, repair packets, reviewer waves, regression rollback, quality convergence, stronger-agent/model escalation, oracle diagnosis, replanning, evidence and delivery.
143
+ After a sealed operation starts, do not reimplement Harness state machines in the lead. AEH owns planner waves, deterministic barriers, repair packets, reviewer waves, regression rollback, quality convergence, stronger-agent/model escalation, oracle diagnosis, replanning, evidence and delivery.
120
144
 
121
145
  Default acceptance remains: critical/high/medium = 0, low <= 3, DebtScore <= 3. Do not stop because an arbitrary remediation count elapsed.
122
146
 
@@ -133,8 +157,8 @@ Request human input only for:
133
157
 
134
158
  ## Self-modification
135
159
 
136
- If the repository is AEH itself or the task changes topology, toolchain, skills, policies, validators or orchestration, the active run remains governed by the frozen controller from run start. New rules activate only on a later run.
160
+ If the repository is AEH itself or the task changes topology, toolchain, skills, policies, validators or orchestration, the active operation remains governed by the frozen controller from operation start. New rules activate only on a later operation.
137
161
 
138
162
  ## User-facing communication
139
163
 
140
- Keep status concise. Do not narrate every shell command or subagent read. Surface meaningful transitions such as `AUDIT`, `QUICK`, `SPEC`, spec validated, run started, deterministic blocker, quality convergence state, handoff, final acceptance/delivery. The lead's context is reserved for decisions, not operational transcripts.
164
+ Keep status concise. Do not narrate every shell command or subagent read. Surface meaningful transitions such as operation started, `AUDIT`, `QUICK`, `SPEC`, spec validated, deterministic blocker, quality convergence state, handoff, final acceptance/delivery. A useful update names the operation id and phase and, when relevant, the visible worker roles. The lead's context is reserved for decisions, not operational transcripts.
@@ -9,7 +9,7 @@ Use this skill whenever an AEH lead, planner or coordinator delegates work throu
9
9
 
10
10
  ## Preferred control surface
11
11
 
12
- When Paseo tools are injected into the current agent, prefer them over shell commands:
12
+ When Paseo tools are injected into the current agent, prefer them over shell commands for bounded conversational delegation:
13
13
 
14
14
  - `create_agent` for a bounded subagent;
15
15
  - `send_agent_prompt` for follow-up work;
@@ -17,9 +17,24 @@ When Paseo tools are injected into the current agent, prefer them over shell com
17
17
  - `cancel_agent` / `archive_agent` for lifecycle cleanup;
18
18
  - `update_agent` / `set_agent_mode` for supported runtime changes.
19
19
 
20
+ When the optional AEH operation MCP server (`aeh operation mcp`) is injected, use its tools for long deterministic Harness workflows:
21
+
22
+ - `aeh_operation_start_audit`;
23
+ - `aeh_operation_start_run`;
24
+ - `aeh_operation_status`;
25
+ - `aeh_operation_cancel`.
26
+
27
+ These MCP tools call the same persistent detached operation controller as the CLI. They do not create a controller LLM agent. If the AEH MCP server is not injected, `aeh operation start/status/cancel` is the short non-blocking compatibility surface; do not replace it with a long synchronous `aeh audit`/`aeh run` from the conversational lead.
28
+
20
29
  Load `/paseo` when the exact current Paseo surface is needed. Use `/paseo-handoff` when responsibility, not merely a subtask, should move to a fresh agent. `/paseo-committee` and `/paseo-advisor` are analysis-only escalation tools and must not replace deterministic AEH gates.
21
30
 
22
- The Harness CLI/daemon adapter remains a deterministic fallback when native tools are unavailable. Do not hand-write `paseo run` shell loops from the lead unless AEH explicitly reports that it is using the CLI fallback.
31
+ The Harness CLI/daemon adapter remains a deterministic compatibility path when native tools/SDK are unavailable. Do not hand-write `paseo run` shell loops from the lead unless AEH explicitly reports that it is using the CLI fallback.
32
+
33
+ ## Visible execution graph
34
+
35
+ Real planner/reviewer/implementer/oracle sessions should be top-level Paseo agents labeled with their AEH operation/task/role. The deterministic operation controller remains outside the agent graph. Operation-local Paseo workspaces are grouping containers; delivery worktree workspaces are a separate Git-isolation concern.
36
+
37
+ Use `aeh paseo agents --operation <id>` (or Paseo's corresponding directory/status tools) to observe real participants without scraping terminal output.
23
38
 
24
39
  ## Lead discipline
25
40
 
@@ -35,4 +50,4 @@ Return compact structured summaries to the lead. Do not paste raw logs or entire
35
50
 
36
51
  ## Context pressure
37
52
 
38
- Before broad engineering work, inspect the current agent status if Paseo exposes context usage. At the configured handoff threshold, create a deterministic AEH handoff artifact and use `/paseo-handoff` (preferred) or `create_agent` to continue in a fresh lead. Do not compact and continue as the normal path when AEH has declared `HANDOFF_REQUIRED` or `HARD_HANDOFF`.
53
+ Before broad engineering work, inspect the current agent status if Paseo exposes context usage. At the configured handoff threshold, create a deterministic AEH handoff artifact and use `/paseo-handoff` (preferred) or `create_agent` to continue in a fresh lead. Detached operations and their top-level workers remain valid across lead rotation. Do not compact and continue as the normal path when AEH has declared `HANDOFF_REQUIRED` or `HARD_HANDOFF`.
@@ -14,7 +14,7 @@ Do not use the informational exception for an ad-hoc engineering review. `aeh st
14
14
 
15
15
  ## Lead agent — thin orchestrator
16
16
 
17
- The lead owns user intent, high-level routing, true ambiguity and final semantic acceptance. It does **not** own routine repository exploration, environment repair, SDD authoring or implementation.
17
+ The lead owns user intent, high-level routing, true ambiguity and final semantic acceptance. It does **not** own routine repository exploration, environment repair, SDD authoring, implementation or a long-running controller shell.
18
18
 
19
19
  Delegate by default:
20
20
 
@@ -24,18 +24,20 @@ Delegate by default:
24
24
  - SPEC authoring -> `spec-manager` using OpenSpec;
25
25
  - implementation/validation/review -> Harness-selected workers.
26
26
 
27
- Prefer Paseo's injected orchestration tools and `/paseo-handoff` over hand-written shell orchestration when available. Preserve the lead context for decisions rather than raw logs and source dumps.
27
+ Prefer Paseo's injected orchestration tools and `/paseo-handoff` for bounded conversational delegation. Long deterministic AUDIT/RUN workflows use the detached AEH operation controller. The controller is deterministic infrastructure, not an LLM agent; real planner/reviewer/worker sessions appear independently in Paseo and are correlated by AEH operation/task labels.
28
28
 
29
29
  For engineering work:
30
30
 
31
31
  1. Check context pressure before broad work. Around 70% stop exploratory work; at 80% hand off proactively to a fresh lead using the deterministic `.harness/paseo/handoffs/` artifact; at 90% handoff is mandatory rather than normal compaction-and-continue.
32
32
  2. Classify `INFORMATIONAL | AUDIT | CHANGE` through AEH when not trivially informational.
33
- 3. AUDIT -> `aeh audit`.
33
+ 3. Interactive AUDIT -> `aeh operation start audit "<request>"`; use `aeh operation status <id>` and `aeh paseo agents --operation <id>` for progress. Synchronous `aeh audit` remains a non-interactive compatibility path.
34
34
  4. CHANGE -> delegate discovery/planning, then obey deterministic QUICK/SPEC.
35
- 5. QUICK -> bounded QuickContract and AEH run.
36
- 6. SPEC -> delegate to `spec-manager`; the lead must not write proposal/spec/design/tasks itself. OpenSpec is the authoring source, then `aeh spec compile` produces the traceable native AEH SDD/TaskContract used for sealing/execution.
35
+ 5. QUICK -> bounded QuickContract; interactive execution -> `aeh operation start run <taskId>`.
36
+ 6. SPEC -> delegate to `spec-manager`; the lead must not write proposal/spec/design/tasks itself. OpenSpec is the authoring source, then `aeh spec compile` produces the traceable native AEH SDD/TaskContract used for sealing/execution; interactive execution then uses `aeh operation start run <taskId>`.
37
37
  7. Environment/tool failures -> delegate bounded recovery to `environment-manager`; do not personally execute long npm/git/Paseo diagnostic sequences.
38
38
 
39
+ Operation-local Paseo workspaces are only UI/execution grouping. They do not imply a Git branch/worktree; delivery isolation remains a separate policy. Detached operations and their top-level agents survive lead context rotation.
40
+
39
41
  After workers finish, use actual deterministic reports/evidence and the final semantic gate. Never accept work solely from a worker summary.
40
42
 
41
43
  ## Worker agent
@@ -55,7 +57,7 @@ If the plan conflicts with reality, report the blocker instead of silently redes
55
57
  ## Source-of-truth order
56
58
 
57
59
  1. Current Git-versioned code and schemas.
58
- 2. Frozen TaskContract and compiled AEH SDD artifacts for CHANGE work; persisted AuditReport for prior AUDIT evidence.
60
+ 2. Frozen TaskContract and compiled AEH SDD artifacts for CHANGE work; persisted AuditReport and operation record for prior AUDIT evidence.
59
61
  3. OpenSpec source artifacts as pre-freeze authoring provenance.
60
62
  4. ADRs and project policy.
61
63
  5. Executable acceptance criteria and deterministic validator evidence.