agentic-engineering-harness 0.6.7 → 0.6.9

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.
@@ -12,6 +12,7 @@ AEH treats Paseo as the authority for agent runtime state and generic agent orch
12
12
  | Provider/model availability | Paseo | provider snapshot/listModels/diagnostic |
13
13
  | Generic create/send/status/activity tools | Paseo | injected native/MCP Paseo tools |
14
14
  | AUDIT/RUN operation state | AEH | `aeh-control` / operation state |
15
+ | Detached operation completion wake-up | AEH + Paseo dispatch | durable completion target + follow-up to existing lead |
15
16
  | Context thresholds and handoff policy | AEH | `aeh_context_status` / `context guard` |
16
17
  | SDD, contracts, seals, validation | AEH | deterministic Harness core |
17
18
  | Quality convergence/acceptance | AEH | deterministic Harness core |
@@ -51,9 +52,11 @@ HARD_HANDOFF
51
52
  ratio >= hardHandoffThreshold (default 90%)
52
53
  ```
53
54
 
54
- Managed leads receive the preapproved `aeh_context_status` tool. `aeh context guard --agent ...` remains the CLI compatibility/non-interactive surface and owns handoff-artifact/rotation side effects.
55
+ Managed leads receive the preapproved `aeh_context_status` tool. A normal managed lead calls it without an `agentId`. AEH resolves the context target in strict order: explicit diagnostic `agentId`, host-provided `PASEO_AGENT_ID`, then the compatible project-local `lead-session.json` written by `aeh start`. The durable fallback respects configured `orchestration.interactive.stateDir` and validates the lead-state schema version, current bootstrap/runtime version, project root, project name and agent id before use. It fails closed on stale or mismatched state and never guesses by listing agents. The selected identity source is traced as `harness.paseo.context.identity`.
55
56
 
56
- ## Event-driven completion
57
+ `aeh context guard --agent ...` remains the CLI compatibility/non-interactive surface and owns handoff-artifact/rotation side effects.
58
+
59
+ ## Event-driven agent completion
57
60
 
58
61
  Agent waiting is:
59
62
 
@@ -64,10 +67,17 @@ subscribe(agent_update)
64
67
  |
65
68
  +--> updates trigger refetch
66
69
  |
67
- `--> terminal state -> read recent timeline -> complete
70
+ `--> terminal state + turn evidence -> read recent timeline -> complete
68
71
  ```
69
72
 
70
- Subscription is installed **before** the first refetch so a transition cannot fall between the snapshot and listener setup. A freshly observed `idle` state is not treated as completion until the wait has observed activity/update evidence, avoiding a send/wait race.
73
+ Subscription is installed **before** the first refetch so a transition cannot fall between the snapshot and listener setup.
74
+
75
+ For a newly created agent, an assistant response in the fresh timeline can prove that a very fast turn completed before the subscription was installed. For a continued/reused agent, AEH captures the last assistant response **before dispatch** and uses it as a baseline. An `idle` snapshot is accepted only when at least one of these is true:
76
+
77
+ - AEH observed an active-turn status (`working`, `running`, `streaming`, `starting`) or `activeTurn` before returning to terminal state;
78
+ - the latest assistant response differs from the pre-dispatch baseline.
79
+
80
+ A subscription notification by itself is **not** turn activity. This prevents metadata-only updates plus stale timeline output from making AEH conclude that a reviewer finished before its current turn actually did.
71
81
 
72
82
  Fallback order:
73
83
 
@@ -81,6 +91,38 @@ Paseo CLI wait/log compatibility
81
91
 
82
92
  The selected path is emitted in Paseo integration traces.
83
93
 
94
+ ## Detached operation completion wake-up
95
+
96
+ A detached AUDIT/RUN deliberately outlives the conversational turn that starts it. The initiating lead is therefore not required to remain active or poll until all reviewers/workers finish.
97
+
98
+ For a managed-lead MCP start, AEH resolves the current lead identity and persists a completion target beside the operation:
99
+
100
+ ```text
101
+ .harness/operations/<operation-id>.completion.json
102
+ ```
103
+
104
+ The completion target has an independent lifecycle:
105
+
106
+ ```text
107
+ PENDING -> SENT
108
+ -> FAILED
109
+ -> DISABLED
110
+ ```
111
+
112
+ When the engineering operation becomes `SUCCEEDED`, `FAILED`, or `CANCELLED`, the controller first persists that terminal engineering state, then sends a non-blocking follow-up to the existing Paseo lead. The message starts with:
113
+
114
+ ```text
115
+ [AEH_OPERATION_COMPLETED]
116
+ ```
117
+
118
+ and includes the operation id/status plus the durable result/report path when available. The callback tells the lead to continue the original pending user request, read the existing operation/report, and **not** start a duplicate operation.
119
+
120
+ This solves the case where the lead's original turn ends while reviewers are still running. The reviewers remain independent top-level Paseo agents; the completion callback reactivates the lead only after the controller's full completion barrier has resolved and the operation is terminal.
121
+
122
+ Callback delivery does not participate in engineering acceptance. If the follow-up cannot be delivered, the callback sidecar becomes `FAILED` and the failure is traced, but a successful AUDIT/RUN remains successful. `aeh_operation_status` is therefore a recovery/diagnostic surface, not the normal mechanism for keeping a conversational turn alive.
123
+
124
+ Cancellation uses the same terminal callback path after worker cleanup. A synchronous controller spawn failure disables a callback that could otherwise arrive as a confusing continuation after the start tool itself already failed.
125
+
84
126
  ## Provider/model preflight
85
127
 
86
128
  Before creating or materializing an agent, AEH attempts a public-SDK preflight:
@@ -150,11 +192,19 @@ harness.paseo.agent.launch
150
192
  harness.paseo.agent.materialize
151
193
  harness.paseo.agent.dispatch
152
194
  harness.paseo.agent.snapshot
195
+ harness.paseo.agent.turn.baseline
196
+ harness.paseo.agent.turn.baseline.skipped
153
197
  harness.paseo.agent.wait
154
198
  harness.paseo.agent.wait.completed
155
199
  harness.paseo.agent.wait.fallback
200
+ harness.paseo.context.identity
156
201
  harness.paseo.context.status
157
202
  harness.paseo.context.handoff
203
+ harness.paseo.operation.callback.target
204
+ harness.paseo.operation.callback.registered
205
+ harness.paseo.operation.callback.sent
206
+ harness.paseo.operation.callback.failed
207
+ harness.paseo.operation.callback.disabled
158
208
  harness.paseo.fallback.cli
159
209
  harness.paseo.workspace.cli.*
160
210
  harness.paseo.cleanup.cli.*
@@ -164,6 +214,9 @@ A useful trace answers:
164
214
 
165
215
  - which transport was selected (`sdk` or `cli`);
166
216
  - which observation source was used (`subscription`, snapshot, sdk-wait, cli-wait);
217
+ - how the managed lead identity was resolved (`argument`, `environment`, `lead-state`);
218
+ - whether an `idle` completion had real turn evidence rather than a metadata-only update;
219
+ - whether a detached completion callback was registered and delivered;
167
220
  - whether a fallback was exceptional or an intentional SDK parity gap;
168
221
  - why the fallback occurred;
169
222
  - the associated agent/operation/provider/model/workspace;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-engineering-harness",
3
- "version": "0.6.7",
3
+ "version": "0.6.9",
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": {
@@ -44,7 +44,11 @@ Inside a managed Paseo lead, long deterministic workflows must be started detach
44
44
  - audit: `aeh operation start audit "<request>" ...`
45
45
  - sealed task execution: `aeh operation start run <taskId> ...`
46
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.
47
+ The start command must return promptly with an `operationId`. Report that identifier and the meaningful starting phase to the user, then allow the current lead turn to end if there is no additional semantic work to do. The controller durably registers the initiating managed lead as a completion target. When the operation becomes `SUCCEEDED`, `FAILED` or `CANCELLED`, AEH sends that lead an `[AEH_OPERATION_COMPLETED]` follow-up so it can consume the durable result and finish the original user request.
48
+
49
+ Do **not** keep the lead alive by repeatedly calling `aeh operation status` or `aeh_operation_status`. Those are explicit diagnostics/manual-recovery surfaces. 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; cancellation also follows the completion-callback path after cleanup.
50
+
51
+ When `[AEH_OPERATION_COMPLETED]` arrives, treat it as an internal continuation event, not a new user task. Do not create another AUDIT/RUN. Read the existing operation state and cited report/result artifact, then complete the original user-facing response.
48
52
 
49
53
  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
54
 
@@ -89,10 +93,12 @@ Do not invoke sudo or silently install unmanaged host prerequisites.
89
93
 
90
94
  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`.
91
95
  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.
92
- 3. AEH runs deterministic validators, classifies failures, dispatches the materialized reviewers with that evidence, deduplicates findings and calculates quality debt.
93
- 4. Validator failures remain evidence; do not reinterpret them as PASS.
94
- 5. Persisted reports under `.harness/audits/` and `.harness/operations/` are durable input for later remediation and recovery.
95
- 6. AUDIT never implements fixes. A later "fix these" is a new CHANGE using the AuditReport as evidence.
96
+ 3. AEH runs deterministic validators, classifies failures, dispatches the materialized reviewers with that evidence, waits for the complete reviewer barrier, deduplicates findings and calculates quality debt.
97
+ 4. The lead is allowed to finish its initiating conversational turn while step 3 continues. It must not infer that the AUDIT ended merely because its own turn ended or because some reviewers have replied.
98
+ 5. Only after the controller reaches terminal operation state does it send `[AEH_OPERATION_COMPLETED]` back to the initiating lead. The lead then reads the persisted AuditReport and completes the original user-facing audit response.
99
+ 6. Validator failures remain evidence; do not reinterpret them as PASS.
100
+ 7. Persisted reports under `.harness/audits/` and `.harness/operations/` are durable input for later remediation and recovery.
101
+ 8. AUDIT never implements fixes. A later "fix these" is a new CHANGE using the AuditReport as evidence.
96
102
 
97
103
  ## Issue-driven CHANGE path
98
104
 
@@ -115,6 +121,7 @@ For a CHANGE classified QUICK:
115
121
  2. `aeh quick validate <id>`.
116
122
  3. From an interactive lead, start `aeh operation start run <id>`; use synchronous `aeh run <id>` only for non-interactive compatibility.
117
123
  4. Remain the semantic parent lead; implementation, validation and review belong to AEH workers and the deterministic controller.
124
+ 5. The lead may end its current turn after the detached operation starts; AEH's completion callback will reactivate it after the full run/review/delivery state machine is terminal.
118
125
 
119
126
  ## SPEC path — OpenSpec authoring
120
127
 
@@ -130,17 +137,20 @@ The lead must not write proposal/spec/design/tasks/Gherkin itself.
130
137
 
131
138
  If OpenSpec cannot express a true product decision without guessing, return `REQUIRES_PRODUCT_DECISION`; otherwise author and validate autonomously.
132
139
 
133
- ## Operation observation
140
+ ## Operation observation and recovery
141
+
142
+ Durable operation state remains authoritative, but normal managed-lead continuation is callback-driven rather than polling-driven:
134
143
 
135
- Use durable operation state for progress rather than narrating terminal silence:
144
+ - `[AEH_OPERATION_COMPLETED]` -> normal wake-up/continuation after terminal state;
145
+ - `aeh operation status <id>` -> explicit diagnostic controller status/phase/result/error;
146
+ - `aeh paseo agents --operation <id>` -> manual inspection of real LLM participants and their roles/phases;
147
+ - `aeh operation wait <id>` -> synchronous non-interactive/recovery boundary only.
136
148
 
137
- - `aeh operation status <id>` -> controller status/phase/result/error;
138
- - `aeh paseo agents --operation <id>` -> real LLM participants and their roles/phases;
139
- - `aeh operation wait <id>` -> synchronous boundary only when necessary.
149
+ If a completion callback is known to have failed, inspect the `.harness/operations/<id>.completion.json` sidecar and Paseo traces, then recover by reading the terminal operation/report directly. Do not launch a duplicate operation solely because the callback failed.
140
150
 
141
151
  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.
142
152
 
143
- Paseo lifecycle/provider/context integration decisions are recorded under `.harness/telemetry/paseo.ndjson`; normal telemetry/OTLP receives the same events when enabled. Use these traces to distinguish SDK-native paths, negotiated fallbacks and intentional public-SDK parity gaps rather than inferring behavior from terminal output.
153
+ Paseo lifecycle/provider/context/integration decisions are recorded under `.harness/telemetry/paseo.ndjson`; normal telemetry/OTLP receives the same events when enabled. Use these traces to distinguish SDK-native paths, reviewer turn-barrier evidence, completion callback delivery, negotiated fallbacks and intentional public-SDK parity gaps rather than inferring behavior from terminal output.
144
154
 
145
155
  ## Quality convergence and recovery
146
156
 
@@ -165,4 +175,4 @@ If the repository is AEH itself or the task changes topology, toolchain, skills,
165
175
 
166
176
  ## User-facing communication
167
177
 
168
- 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.
178
+ 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. For a detached operation, one start acknowledgement is normally enough; do not emit a stream of status polls. When the completion callback arrives, provide the actual consolidated result. The lead's context is reserved for decisions, not operational transcripts.
@@ -33,6 +33,21 @@ When the AEH control MCP server (`aeh operation mcp`) is injected, use its tools
33
33
 
34
34
  These MCP tools call the same persistent detached operation controller/policy code as the CLI. They do not create a controller LLM agent. If the AEH MCP server is not injected, `aeh operation start/status/cancel` and `aeh context guard` are short compatibility surfaces; do not replace them with long synchronous `aeh audit`/`aeh run` from the conversational lead.
35
35
 
36
+ ## Detached operation completion
37
+
38
+ Managed AUDIT/RUN operations are callback-driven. When `aeh_operation_start_audit` or `aeh_operation_start_run` succeeds, the deterministic controller durably records the initiating managed lead as the completion target. The lead may end its current conversational turn while reviewers/workers continue independently.
39
+
40
+ Do **not** repeatedly poll `aeh_operation_status` in the normal path. When the operation reaches `SUCCEEDED`, `FAILED` or `CANCELLED`, AEH sends an `[AEH_OPERATION_COMPLETED]` follow-up to the same lead. Treat that message as an internal continuation of the still-pending user request:
41
+
42
+ - do not start a duplicate AUDIT/RUN;
43
+ - inspect the existing operation record and the durable report/result artifact named by the callback;
44
+ - finish the original user-facing request from those durable results;
45
+ - use `aeh_operation_status` only for explicit diagnostics, manual inspection, or recovery when callback delivery is known to have failed.
46
+
47
+ Callback delivery state is persisted separately from the engineering result. A failed callback must never rewrite a successful engineering operation as failed. Relevant integration traces are `harness.paseo.operation.callback.registered`, `.target`, `.sent`, `.failed`, and `.disabled`.
48
+
49
+ This wake-up mechanism is intentionally independent of Paseo parent/child ownership. AEH reviewers/workers remain top-level agents so a lead rotation does not terminate them.
50
+
36
51
  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.
37
52
 
38
53
  ## SDK-first lifecycle
@@ -45,6 +60,8 @@ AEH should use the public `@getpaseo/client` surface first for semantic operatio
45
60
  - agent subscriptions for event-driven completion, with subscribe-before-refetch race closure;
46
61
  - provider snapshot/model/diagnostic APIs for early configuration failures.
47
62
 
63
+ For a continued/reused agent turn, capture the last assistant response **before** dispatch. An `idle` snapshot is not sufficient proof that the new turn finished: accept it only after a real active-turn transition or assistant output that differs from the pre-dispatch baseline. Metadata-only subscription updates are not turn activity.
64
+
48
65
  The CLI remains a compatibility/parity-gap surface, not a parallel source of truth. Two intentional external-controller CLI uses currently remain for Paseo 0.3.1:
49
66
 
50
67
  1. operation workspace creation requiring `--isolation local` plus user-visible `--title`, which the public SDK create contract does not yet expose with equivalent parity;
@@ -60,9 +77,9 @@ Use `aeh paseo agents --operation <id>` (or Paseo's corresponding directory/stat
60
77
 
61
78
  ## Observability
62
79
 
63
- AEH persists integration decisions under `.harness/telemetry/paseo.ndjson` even when remote OTLP export is disabled. Relevant events include provider preflight, agent snapshot/context source, lifecycle transport, event-driven wait, SDK-to-CLI fallback, intentional workspace CLI use and cleanup CLI use. When normal Harness telemetry is enabled the same events also flow through the standard telemetry/OTLP path.
80
+ AEH persists integration decisions under `.harness/telemetry/paseo.ndjson` even when remote OTLP export is disabled. Relevant events include provider preflight, agent snapshot/context source, lifecycle transport, event-driven wait, resumed-turn baseline, detached-operation callback delivery, SDK-to-CLI fallback, intentional workspace CLI use and cleanup CLI use. When normal Harness telemetry is enabled the same events also flow through the standard telemetry/OTLP path.
64
81
 
65
- A trace should answer: which transport was used, which source supplied state, whether a fallback was intentional or exceptional, why it happened, and which operation/agent/provider/model was affected.
82
+ A trace should answer: which transport was used, which source supplied state, whether a fallback was intentional or exceptional, why it happened, which operation/agent/provider/model was affected, and whether completion notification reached the initiating lead.
66
83
 
67
84
  ## Lead discipline
68
85