@kontourai/flow-agents 3.6.0 → 3.7.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/CHANGELOG.md +7 -0
- package/build/src/builder-flow-run-adapter.d.ts +22 -2
- package/build/src/builder-flow-run-adapter.js +93 -28
- package/build/src/builder-flow-runtime.d.ts +8 -3
- package/build/src/builder-flow-runtime.js +308 -47
- package/build/src/cli/assignment-provider.d.ts +4 -7
- package/build/src/cli/assignment-provider.js +67 -13
- package/build/src/cli/builder-run.js +14 -18
- package/build/src/cli/workflow-sidecar.d.ts +28 -4
- package/build/src/cli/workflow-sidecar.js +801 -97
- package/build/src/cli/workflow.js +290 -42
- package/build/src/flow-kit/validate.d.ts +17 -0
- package/build/src/flow-kit/validate.js +340 -2
- package/build/src/index.js +5 -5
- package/build/src/lib/observed-command.d.ts +7 -0
- package/build/src/lib/observed-command.js +100 -0
- package/build/src/tools/generate-context-map.js +5 -3
- package/context/scripts/hooks/lib/kit-catalog.js +1 -1
- package/context/scripts/hooks/stop-goal-fit.js +78 -9
- package/docs/context-map.md +22 -20
- package/docs/developer-architecture.md +1 -1
- package/docs/public-workflow-cli.md +76 -7
- package/docs/skills-map.md +51 -27
- package/docs/spec/builder-flow-runtime.md +41 -40
- package/docs/workflow-usage-guide.md +109 -42
- package/evals/fixtures/hook-influence/cases.json +2 -2
- package/evals/integration/test_builder_entry_enforcement.sh +52 -41
- package/evals/integration/test_builder_step_producers.sh +297 -6
- package/evals/integration/test_bundle_install.sh +212 -63
- package/evals/integration/test_critique_supersession_roundtrip.sh +21 -8
- package/evals/integration/test_current_json_per_actor.sh +12 -0
- package/evals/integration/test_dual_emit_flow_step.sh +62 -43
- package/evals/integration/test_flowdef_session_activation.sh +145 -25
- package/evals/integration/test_flowdef_session_history_preservation.sh +23 -21
- package/evals/integration/test_gate_lockdown.sh +3 -5
- package/evals/integration/test_goal_fit_hook.sh +60 -2
- package/evals/integration/test_liveness_verdict.sh +14 -17
- package/evals/integration/test_phase_map_and_gate_claim.sh +63 -38
- package/evals/integration/test_public_workflow_cli.sh +325 -11
- package/evals/integration/test_pull_work_liveness_preflight.sh +22 -66
- package/evals/integration/test_sidecar_field_preservation.sh +36 -11
- package/evals/integration/test_workflow_sidecar_writer.sh +277 -44
- package/evals/integration/test_workflow_steering_hook.sh +15 -38
- package/evals/run.sh +2 -0
- package/evals/static/test_builder_skill_coherence.sh +247 -0
- package/evals/static/test_library_exports.sh +5 -2
- package/evals/static/test_workflow_skills.sh +13 -325
- package/kits/builder/flows/build.flow.json +22 -0
- package/kits/builder/flows/shape.flow.json +9 -9
- package/kits/builder/kit.json +70 -16
- package/kits/builder/skills/builder-shape/SKILL.md +75 -75
- package/kits/builder/skills/continue-work/SKILL.md +45 -106
- package/kits/builder/skills/deliver/SKILL.md +96 -442
- package/kits/builder/skills/design-probe/SKILL.md +40 -139
- package/kits/builder/skills/evidence-gate/SKILL.md +59 -201
- package/kits/builder/skills/execute-plan/SKILL.md +54 -125
- package/kits/builder/skills/fix-bug/SKILL.md +42 -132
- package/kits/builder/skills/gate-review/SKILL.md +60 -211
- package/kits/builder/skills/idea-to-backlog/SKILL.md +63 -244
- package/kits/builder/skills/learning-review/SKILL.md +63 -170
- package/kits/builder/skills/pickup-probe/SKILL.md +54 -111
- package/kits/builder/skills/plan-work/SKILL.md +51 -185
- package/kits/builder/skills/pull-work/SKILL.md +136 -485
- package/kits/builder/skills/release-readiness/SKILL.md +66 -107
- package/kits/builder/skills/review-work/SKILL.md +89 -176
- package/kits/builder/skills/tdd-workflow/SKILL.md +53 -147
- package/kits/builder/skills/verify-work/SKILL.md +101 -113
- package/package.json +2 -2
- package/scripts/hooks/lib/kit-catalog.js +1 -1
- package/scripts/hooks/stop-goal-fit.js +78 -9
- package/src/builder-flow-run-adapter.ts +118 -32
- package/src/builder-flow-runtime.ts +331 -61
- package/src/cli/assignment-provider-lock.test.mjs +83 -0
- package/src/cli/assignment-provider.ts +62 -13
- package/src/cli/builder-flow-run-adapter.test.mjs +4 -2
- package/src/cli/builder-flow-runtime.test.mjs +194 -8
- package/src/cli/builder-run.ts +3 -9
- package/src/cli/kit-metadata-security.test.mjs +232 -6
- package/src/cli/public-api.test.mjs +15 -0
- package/src/cli/workflow-sidecar-execution-proof.test.mjs +90 -0
- package/src/cli/workflow-sidecar.ts +724 -97
- package/src/cli/workflow.ts +277 -40
- package/src/flow-kit/validate.ts +320 -2
- package/src/index.ts +6 -5
- package/src/lib/observed-command.ts +96 -0
- package/src/tools/generate-context-map.ts +5 -3
|
@@ -1,140 +1,69 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "execute-plan"
|
|
3
|
-
description: "
|
|
3
|
+
description: "Execution primitive that turns a structured plan into implemented scope through tool-worker delegation."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Execute
|
|
6
|
+
# Execute Plan
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Implement an approved plan while preserving scope, traceability, and recovery context.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Role And Binding
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
- **Role:** canonical Builder build-step producer and standalone execution primitive.
|
|
13
|
+
- **Binding:** `builder.build` step `execute`.
|
|
14
|
+
- **Produces:** the active session execution report (`<slug>--deliver.md`), `state.json`, and `implementation-scope` for an active matching run.
|
|
15
|
+
- **Standalone no-run behavior:** execute the supplied plan and return execution evidence. Do not start a Builder run, record Builder evidence, or imply that an inactive Builder flow advanced.
|
|
15
16
|
|
|
16
17
|
## Model Routing
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
You do not write source files. You read the plan artifact, fan out tasks to tool-worker, and update the session file between waves.
|
|
32
|
-
|
|
33
|
-
## Shared Contracts
|
|
34
|
-
|
|
35
|
-
Follow:
|
|
36
|
-
- `context/contracts/artifact-contract.md`
|
|
37
|
-
- `context/contracts/execution-contract.md`
|
|
38
|
-
- `context/contracts/planning-contract.md` for the plan artifact and Definition Of Done
|
|
39
|
-
- `context/contracts/sandbox-policy.md`
|
|
40
|
-
|
|
41
|
-
This skill owns orchestration between waves. The contracts own artifact continuity, worker task expectations, conflict handling, validation expectations, and completion rules.
|
|
42
|
-
|
|
43
|
-
## Input
|
|
44
|
-
|
|
45
|
-
- **Plan artifact path**: path to the `-plan.md` file in `.kontourai/flow-agents/<slug>/`
|
|
46
|
-
- **Session file path**: the session file to update with progress
|
|
47
|
-
|
|
48
|
-
## Workflow
|
|
49
|
-
|
|
50
|
-
1. Read the plan artifact directly
|
|
51
|
-
2. Confirm the plan follows `context/contracts/planning-contract.md`, including `## Definition Of Done`. If missing, return to `plan-work` before implementation.
|
|
52
|
-
3. Confirm the plan records an appropriate `sandbox_mode` using `context/contracts/sandbox-policy.md`. If missing, infer the smallest safe mode and record it before delegation.
|
|
53
|
-
4. Confirm execution traceability before any worker starts:
|
|
54
|
-
- acceptance criteria have stable ids, preferably matching `acceptance.json`
|
|
55
|
-
- every wave/task lists the acceptance ids it supports
|
|
56
|
-
- the session/deliver file copies or links the criteria and includes a `Requirements Trace` or equivalent mapping
|
|
57
|
-
- each worker prompt includes the relevant acceptance ids and required evidence, not only a loose task title
|
|
58
|
-
- if traceability is missing, update the session file and/or send the plan back for refinement before delegation
|
|
59
|
-
5. Set session file `status: executing` and use `npm run workflow:sidecar -- advance-state <artifact-dir> --status in_progress --phase execution --summary ... --next-action ...` when the repository provides it
|
|
60
|
-
6. **Frontend design check:** If any tasks involve UI, CSS, layouts, components, or visual design, read the `frontend-design` skill and include its aesthetics guidelines in the tool-worker prompts for those tasks
|
|
61
|
-
7. **Before fan-out, run the [Pre-Fan-Out Freshness Re-Check](#pre-fan-out-freshness-re-check) and re-ground if the plan is stale.** Then fan out each wave to tool-worker subagents (up to 4 parallel):
|
|
62
|
-
- Delegate to the exact `tool-worker` role for every implementation worker. Do not spawn unnamed/default implementation agents.
|
|
63
|
-
```
|
|
64
|
-
Each tool-worker gets:
|
|
65
|
-
- Task description from plan
|
|
66
|
-
- Files to create/modify
|
|
67
|
-
- Acceptance criteria
|
|
68
|
-
- Acceptance criterion ids and requirement ids this task supports
|
|
69
|
-
- Required evidence for those criteria
|
|
70
|
-
- Definition Of Done items that this task supports
|
|
71
|
-
- Sandbox mode, approval assumptions, rollback expectations, and escalation stop conditions
|
|
72
|
-
- Context from plan + prior wave results
|
|
73
|
-
- Plan artifact path (so it can read full context directly)
|
|
74
|
-
```
|
|
75
|
-
8. Between waves:
|
|
76
|
-
- Collect results from all tool-worker subagents
|
|
77
|
-
- Check for conflicts before next wave
|
|
78
|
-
- Feed completed wave context forward
|
|
79
|
-
- **Checkpoint**: update session file with completed tasks and next wave
|
|
80
|
-
- Record worker progress with `npm run workflow:sidecar -- record-agent-event --artifact-dir <artifact-dir> --agent-id <worker-id> --kind evidence --status active|done --summary ...`
|
|
81
|
-
9. After all waves: set session file `status: executed` and update `state.json` / `handoff.json` with `advance-state`
|
|
82
|
-
10. For an active Builder Flow run, record the `implementation-scope` gate claim only after the changed-file scope and acceptance mapping are complete:
|
|
83
|
-
```bash
|
|
84
|
-
npm run workflow:sidecar -- record-gate-claim .kontourai/flow-agents/<slug> \
|
|
85
|
-
--expectation implementation-scope \
|
|
86
|
-
--status pass \
|
|
87
|
-
--summary "Implementation completed within the planned scope; changed files and supported acceptance criteria are recorded." \
|
|
88
|
-
--evidence-ref-json '{"kind":"artifact","file":".kontourai/flow-agents/<slug>/<slug>--execute-plan.md","summary":"Execution record with changed files, acceptance mapping, and worker evidence."}'
|
|
89
|
-
```
|
|
90
|
-
Use `fail` or `not_verified` when scope integrity is unresolved. The sidecar writer synchronizes Flow; it does not declare the execute gate passed itself.
|
|
91
|
-
|
|
92
|
-
The orchestrator is responsible for keeping root `state.json` current, and performs that update **exclusively** through `npm run workflow:sidecar -- advance-state` — never through a direct Write/Edit tool call against the sidecar path. `config-protection.js` blocks direct tool-mediated writes to `state.json` by design; that block is expected and correct, not a bug to route around. Workers should receive the workflow artifact root explicitly and append agent events under that root instead of inferring the slug or rewriting shared sidecars.
|
|
93
|
-
|
|
94
|
-
## Pre-Fan-Out Freshness Re-Check
|
|
95
|
-
|
|
96
|
-
A plan can go stale between planning and execution — upstream may have advanced, or the plan may simply be old. `plan-work` and `pull-work` stamp and check `planned_base_sha` / `revision_freshness` at planning and pickup; this is the same check at the **execution boundary**, where stale plans actually cause wasted work (parallel workers building what already landed upstream). Run it before any worker starts.
|
|
97
|
-
|
|
98
|
-
- **Always — cheap SHA tripwire.** Re-fetch the target ref and compare the current target SHA to the plan's `planned_base_sha` (per `context/contracts/planning-contract.md`). If the base moved **and** the newer commits/files intersect `planning_scope_refs`, the plan is stale: do not fan out. Route back to `plan-work` (or `pickup-probe` for provider-backed work) to re-ground against the current base — the same `revision_freshness: stale` rule plan-work and pull-work already enforce. Missing `planned_base_sha` is not fresh; record a `NOT_VERIFIED` gap and confirm the base before fan-out.
|
|
99
|
-
- **On plan age — deeper re-survey.** If the plan is older than the staleness window (default ~1h; shorter for fast-moving scope), do the costlier relook the SHA diff cannot: re-survey what now exists in the target area (recently merged PRs, new modules, sibling work) for anything that already does what this plan proposes. If it already shipped upstream, stop and route back to `plan-work` rather than building a duplicate. The SHA tripwire is the precise signal; plan age is the backstop for landscape drift the diff can't see.
|
|
100
|
-
- Record the re-check result (`fresh`, or re-grounded with the compared SHAs and route-back) in the session file before continuing. Worktree/isolation needs stay owned by `pull-work`'s file-overlap decision — don't re-derive them here.
|
|
101
|
-
|
|
102
|
-
## Session File Updates
|
|
103
|
-
|
|
104
|
-
Between each wave, append to the session file:
|
|
105
|
-
|
|
106
|
-
```markdown
|
|
107
|
-
## Execution Progress
|
|
108
|
-
|
|
109
|
-
### Wave 1 (completed)
|
|
110
|
-
- [x] Task A — done. Supports: AC1, AC2. Evidence: <test/check/artifact>. Modified files: `<path>`.
|
|
111
|
-
- [x] Task B — done. Supports: AC3. Evidence: <test/check/artifact>. Modified files: `<path>`.
|
|
112
|
-
|
|
113
|
-
### Wave 2 (in progress)
|
|
114
|
-
- [ ] Task C. Supports: AC4, AC5. Required evidence: <test/check/artifact>.
|
|
115
|
-
- [ ] Task D. Supports: AC6. Required evidence: <test/check/artifact>.
|
|
116
|
-
|
|
117
|
-
## Requirements Trace
|
|
118
|
-
|
|
119
|
-
- R1 <requirement>. Acceptance: AC1, AC2.
|
|
120
|
-
- R2 <requirement>. Acceptance: AC3.
|
|
121
|
-
|
|
122
|
-
## Modified Files / Scope
|
|
123
|
-
|
|
124
|
-
- Record changed paths in the session/deliver artifact and worker event summaries after each wave.
|
|
125
|
-
- Do not add ad hoc `modified_files` keys to `state.json` unless the sidecar schema explicitly supports them.
|
|
126
|
-
- Verification and optional governance providers such as Veritas should consume this scope from the session/evidence artifacts or a dedicated evidence sidecar, not from invalid state fields.
|
|
127
|
-
```
|
|
19
|
+
Delegate implementation tasks to `tool-worker`. Select `delegate-mechanical`, `delegate-implementation`, or `delegate-design` according to the planned task, resolving the role from `.datum/config.json` when available. Use parallel workers only when the plan's file ownership and dependencies make concurrent work safe; no fixed worker count is part of this contract.
|
|
20
|
+
Apply the routing and escalation contract in `context/contracts/execution-contract.md`.
|
|
21
|
+
|
|
22
|
+
## Provider Boundaries
|
|
23
|
+
|
|
24
|
+
Use `RepositoryAdapter` for repository, target revision, worktree, and changed-file context. Carry provider-backed work-item, board, and ownership context from `WorkItemProvider`, `BoardProvider`, and `AssignmentProvider` when present. GitHub is an optional adapter, never a required execution contract.
|
|
25
|
+
|
|
26
|
+
## Inputs
|
|
27
|
+
|
|
28
|
+
- structured implementation plan and optional host session/artifact location
|
|
29
|
+
- Definition Of Done, stable acceptance criteria, task-to-criterion mapping, and required evidence
|
|
30
|
+
- sandbox/worktree mode, expected modified files, source revision, and conflict risks
|
|
128
31
|
|
|
129
|
-
|
|
32
|
+
## Procedure
|
|
130
33
|
|
|
131
|
-
|
|
34
|
+
1. Read the plan. Return it to `plan-work` when it lacks a Definition Of Done, stable acceptance criteria, task mapping, sandbox boundary, or usable execution scope.
|
|
35
|
+
2. Before delegation, compare the current target revision with the plan's base through `RepositoryAdapter`. Re-ground the plan when changed scope intersects its assumptions; record missing confirmation as `NOT_VERIFIED` rather than treating it as fresh.
|
|
36
|
+
3. Give each worker its bounded task, owned files, relevant acceptance IDs, required evidence, sandbox/worktree constraints, rollback conditions, and plan reference.
|
|
37
|
+
4. Run safe independent tasks concurrently and dependent tasks in order. Between waves, collect results, resolve conflicts, and update the execution record with completed work, remaining work, changed files, and supported acceptance criteria.
|
|
38
|
+
5. For UI tasks, include the applicable frontend design guidance in the worker instruction.
|
|
39
|
+
6. When implementation completes, record scope integrity: changed files, accepted deviations, task-to-criterion traceability, evidence, and outstanding gaps. Hand off to report-only review and verification; do not treat implementation as verification.
|
|
40
|
+
7. Reconcile the execution report and `state.json` with the active session artifact directory.
|
|
41
|
+
Any missing, stale, or unwritable durable record is a blocker or
|
|
42
|
+
`NOT_VERIFIED` gap, not a reason to substitute chat prose. Publish only
|
|
43
|
+
structured, resolving evidence references through the public CLI.
|
|
132
44
|
|
|
133
|
-
|
|
134
|
-
- Session file updated with execution progress and `status: executed`
|
|
135
|
-
- Execution progress follows `context/contracts/execution-contract.md`
|
|
136
|
-
- Structured state/handoff sidecars advanced when `npm run workflow:sidecar --` is available
|
|
45
|
+
## Execution Record
|
|
137
46
|
|
|
138
|
-
|
|
47
|
+
The execution record must identify:
|
|
48
|
+
|
|
49
|
+
- each completed task and its supported `AC*` identifiers
|
|
50
|
+
- changed files and any scope deviation with approval or route-back reason
|
|
51
|
+
- worker evidence, conflicts, rollback notes, remaining work, and next action
|
|
52
|
+
- current revision comparison and re-grounding decision
|
|
53
|
+
|
|
54
|
+
## Active Builder Evidence
|
|
55
|
+
|
|
56
|
+
For an active `builder.build` `execute` step, record `implementation-scope` only after the changed-file scope and acceptance mapping are complete:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
flow-agents workflow status --session-dir <session-dir>
|
|
60
|
+
flow-agents workflow evidence --session-dir <session-dir> \
|
|
61
|
+
--expectation implementation-scope --status pass \
|
|
62
|
+
--summary "Implementation stayed within recorded scope; changed files and supported acceptance criteria are documented." \
|
|
63
|
+
--evidence-ref-json '{"kind":"artifact","file":"<session-dir>/<slug>--deliver.md","summary":"Execution report with changed scope and acceptance mapping."}' \
|
|
64
|
+
--evidence-ref-json '{"kind":"artifact","file":"<session-dir>/state.json","summary":"Current execution state and canonical next action."}'
|
|
65
|
+
```
|
|
139
66
|
|
|
140
|
-
|
|
67
|
+
Use `fail` or `not_verified` when scope integrity is unresolved. A successful
|
|
68
|
+
worker report does not override missing changed-file or acceptance mappings. Do
|
|
69
|
+
not create a Builder run here or use private writer commands.
|
|
@@ -1,152 +1,62 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "fix-bug"
|
|
3
|
-
description: "Bug
|
|
3
|
+
description: "Bug-fix profile for builder.build. Adds disciplined diagnosis and regression-focused verification without replacing the build primitives."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Bug
|
|
6
|
+
# Fix Bug
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## Role and Boundary
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
**Role:** `builder.build` profile for a reported defect.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Select this profile when a Work Item is a bug report, regression, error, or
|
|
13
|
+
observable incorrect behavior. It supplies diagnosis context to the standard
|
|
14
|
+
build primitives; it is not a separate flow or a generic delivery entrypoint.
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
| tool-worker (x4) | execute-plan |
|
|
18
|
-
| tool-code-reviewer | review-work |
|
|
19
|
-
| tool-security-reviewer | review-work (conditional — security-sensitive changes) |
|
|
20
|
-
| tool-verifier | verify-work |
|
|
21
|
-
| tool-playwright | diagnosis (reproduce) + verify-work |
|
|
16
|
+
The profile owns **no step-gate evidence**. `pull-work`, `design-probe`,
|
|
17
|
+
`plan-work`, `execute-plan`, `review-work`, and `verify-work` retain ownership
|
|
18
|
+
of their artifacts and evidence.
|
|
22
19
|
|
|
23
20
|
## Model Routing
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
Use `delegate-mechanical` for reproduction bookkeeping, `delegate-design` for
|
|
23
|
+
hypothesis and fix planning, and `delegate-implementation` for implementation,
|
|
24
|
+
review, and verification. Resolve roles from `.datum/config.json` under
|
|
25
|
+
`context/contracts/execution-contract.md` and record fallbacks or escalations.
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|---|---|
|
|
31
|
-
| tool-worker | `delegate-mechanical` for fully-specified mechanical slices, `delegate-implementation` for precisely-planned implementation, `delegate-design` when a slice needs design latitude |
|
|
32
|
-
| tool-planner | `delegate-design` |
|
|
33
|
-
| tool-code-reviewer / tool-security-reviewer | `delegate-implementation` by default, raised to the worker's tier when higher — never below the tier of the checked work (Goodhart guard) |
|
|
34
|
-
| tool-verifier / tool-playwright | `delegate-implementation` by default, raised to the worker's tier when higher — never below the tier of the checked work (Goodhart guard) |
|
|
27
|
+
## Inputs and Provider Adapters
|
|
35
28
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
Capture the original report, reproduction steps, logs, screenshots, affected
|
|
30
|
+
Repository adapter, and relevant Change-adapter history. The Work Item adapter
|
|
31
|
+
holds the defect scope and acceptance criteria. A GitHub issue is an optional
|
|
32
|
+
Work Item example, not a prerequisite.
|
|
39
33
|
|
|
40
|
-
##
|
|
34
|
+
## Profile Behavior
|
|
41
35
|
|
|
42
|
-
|
|
36
|
+
1. Select `builder.build` through the `deliver` entrypoint, with this profile
|
|
37
|
+
recorded as `fix-bug` in the planning context.
|
|
38
|
+
2. Reproduce the behavior when feasible and distinguish confirmed observations
|
|
39
|
+
from unverified reports.
|
|
40
|
+
3. Ask the planning primitive to identify a root-cause hypothesis, minimal fix
|
|
41
|
+
scope, affected tests, and regression risks before implementation.
|
|
42
|
+
4. Require the execution and verification primitives to prove both that the
|
|
43
|
+
reported behavior is corrected and that relevant existing behavior still
|
|
44
|
+
works.
|
|
45
|
+
5. Route a failed or inconclusive result back to the primitive best able to
|
|
46
|
+
resolve it; do not silently convert an unverified diagnosis into a fix.
|
|
43
47
|
|
|
44
|
-
|
|
48
|
+
Keep investigation proportionate to the report. A missing reproduction is a
|
|
49
|
+
recorded uncertainty, not a reason to fabricate certainty.
|
|
45
50
|
|
|
46
|
-
|
|
47
|
-
- **Directory**: working directory
|
|
51
|
+
## Output Responsibility
|
|
48
52
|
|
|
49
|
-
|
|
53
|
+
This profile creates no independent artifact or evidence. Its output is
|
|
54
|
+
diagnostic and regression context carried into the standard primitive artifacts
|
|
55
|
+
and final delivery report.
|
|
50
56
|
|
|
51
|
-
|
|
57
|
+
## Standalone and No-Active-Run Behavior
|
|
52
58
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
worktree: <worktree>
|
|
58
|
-
created: <date>
|
|
59
|
-
status: diagnosing | planning | fixing | verifying | resolved
|
|
60
|
-
type: fix-bug
|
|
61
|
-
iteration: 0
|
|
62
|
-
|
|
63
|
-
## Bug Report
|
|
64
|
-
|
|
65
|
-
Source: screenshot | error log | user description
|
|
66
|
-
<original report, pasted verbatim>
|
|
67
|
-
|
|
68
|
-
## Diagnosis
|
|
69
|
-
|
|
70
|
-
Root cause from tool-planner.
|
|
71
|
-
|
|
72
|
-
## Plan
|
|
73
|
-
|
|
74
|
-
(populated by plan-work)
|
|
75
|
-
|
|
76
|
-
## Execution Progress
|
|
77
|
-
|
|
78
|
-
(populated by execute-plan)
|
|
79
|
-
|
|
80
|
-
## Verification Report
|
|
81
|
-
|
|
82
|
-
(populated by verify-work)
|
|
83
|
-
|
|
84
|
-
## History
|
|
85
|
-
|
|
86
|
-
- iteration 1: partial — fix applied but regression in sidebar
|
|
87
|
-
- iteration 2: pass — bug fixed, no regressions
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
`<branch>` is the branch recorded in `state.json`'s `branch` field (`ensure-session` derives `agent/<actor>/<slug>`; an explicit `--branch` flag overrides on a new session). `ensure-session` only records the name — creating and checking out the actual git branch/worktree remains this skill's responsibility.
|
|
91
|
-
|
|
92
|
-
## Workflow
|
|
93
|
-
|
|
94
|
-
### 1. Create session file
|
|
95
|
-
|
|
96
|
-
Paste the bug report verbatim. Set `status: diagnosing`.
|
|
97
|
-
|
|
98
|
-
### 2. Diagnose (unique to bugs)
|
|
99
|
-
|
|
100
|
-
1. **Reproduce** (if visual) — delegate to tool-playwright to confirm the bug is visible. Screenshot the broken state.
|
|
101
|
-
2. **Find root cause** — delegate to tool-planner:
|
|
102
|
-
```
|
|
103
|
-
Bug: <description>
|
|
104
|
-
Reproduction: <steps or screenshot evidence>
|
|
105
|
-
Directory: <working directory>
|
|
106
|
-
todo_file: <session file path>
|
|
107
|
-
Find the root cause and propose a fix plan.
|
|
108
|
-
```
|
|
109
|
-
3. Read the diagnosis from tool-planner's output
|
|
110
|
-
4. Paste into session file `## Diagnosis`
|
|
111
|
-
5. Present to user: "Here's what's broken and how I'd fix it. Agree?"
|
|
112
|
-
6. On approval → proceed to plan
|
|
113
|
-
|
|
114
|
-
### 3. Plan (plan-work)
|
|
115
|
-
|
|
116
|
-
Invoke plan-work with: diagnosis + fix goal, directory, session file path.
|
|
117
|
-
|
|
118
|
-
### 4. Execute (execute-plan)
|
|
119
|
-
|
|
120
|
-
Invoke execute-plan with the plan artifact path and session file path.
|
|
121
|
-
|
|
122
|
-
### 5. Review (review-work)
|
|
123
|
-
|
|
124
|
-
Invoke `review-work` with the session file path. It must delegate to `tool-code-reviewer`, and to `tool-security-reviewer` when security triggers are present. CRITICAL/HIGH findings block and loop back to Execute unless explicitly accepted.
|
|
125
|
-
|
|
126
|
-
### 6. Verify (verify-work)
|
|
127
|
-
|
|
128
|
-
Invoke verify-work with the session file path. tool-verifier must verify:
|
|
129
|
-
1. **Bug is fixed** — the specific issue from the report
|
|
130
|
-
2. **No regressions** — build passes, existing tests pass, related functionality works
|
|
131
|
-
|
|
132
|
-
### 7. Route on verdict
|
|
133
|
-
|
|
134
|
-
- **All PASS** → resolve
|
|
135
|
-
- **Any FAIL** → loop
|
|
136
|
-
- **Any NOT_VERIFIED** → surface to user
|
|
137
|
-
|
|
138
|
-
### 8. Loop (on failure)
|
|
139
|
-
|
|
140
|
-
1. Summarize what failed
|
|
141
|
-
2. Increment `iteration`
|
|
142
|
-
3. Re-invoke plan-work with: original diagnosis + failure summary → updated fix plan
|
|
143
|
-
4. Back to step 4
|
|
144
|
-
|
|
145
|
-
### 9. Resolve
|
|
146
|
-
|
|
147
|
-
1. Include verification report verbatim
|
|
148
|
-
2. Show before/after evidence (screenshots if visual)
|
|
149
|
-
3. `git diff --stat`
|
|
150
|
-
4. Set `status: resolved`
|
|
151
|
-
|
|
152
|
-
{context?}
|
|
59
|
+
`fix-bug` does not start or resume a run itself. With no active run, return the
|
|
60
|
+
captured bug context and route to `deliver` to select and start `builder.build`.
|
|
61
|
+
With an active run, apply the profile only when its Work Item matches the
|
|
62
|
+
reported defect; otherwise stop and ask for the intended Work Item.
|