ai-engineering-loop 2.3.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/{ai-engineering-loop → ael}/SKILL.md +2 -2
- package/.agents/skills/{ai-engineering-loop → ael}/references/loop-risky.md +1 -0
- package/CHANGELOG.md +30 -0
- package/README.md +5 -4
- package/README.npm.md +6 -6
- package/THIRD_PARTY_NOTICES.md +11 -0
- package/adapters/dot/README.md +3 -3
- package/adapters/dot/skills/dot-dev-skill-router/SKILL.md +13 -13
- package/adapters/dot/skills/dot-dev-workflow/SKILL.md +3 -3
- package/adapters/generate-adapter/SKILL.md +1 -1
- package/adapters/generate-workflow/SKILL.md +1 -1
- package/adapters/quality/skills/task-impact-inquiry/SKILL.md +2 -2
- package/adapters/spec/LICENSE +202 -0
- package/adapters/spec/NOTICE-AEL.md +26 -0
- package/adapters/spec/agents/ael-spec-codebase-details.md +71 -0
- package/adapters/spec/agents/ael-spec-comprehension.md +71 -0
- package/adapters/spec/agents/ael-spec-design.md +65 -0
- package/adapters/spec/agents/ael-spec-implementation-readiness.md +64 -0
- package/adapters/spec/agents/ael-spec-structural.md +67 -0
- package/adapters/spec/agents/ael-spec-style.md +68 -0
- package/adapters/spec/agents/ael-spec-synthesizer.md +73 -0
- package/adapters/spec/agents/ael-spec-zoom-out.md +76 -0
- package/adapters/spec/skills/ael-spec-brainstorm/SKILL.md +265 -0
- package/adapters/spec/skills/ael-spec-draft/SKILL.md +315 -0
- package/adapters/spec/skills/ael-spec-draft/references/design_doc.md +179 -0
- package/adapters/spec/skills/ael-spec-drift/SKILL.md +68 -0
- package/adapters/spec/skills/ael-spec-resolve/SKILL.md +188 -0
- package/adapters/spec/skills/ael-spec-review/SKILL.md +403 -0
- package/adapters/spec/skills/ael-spec-review-loop/SKILL.md +191 -0
- package/adapters/spec/standards/ael-spec-execution-instructions.md +36 -0
- package/adapters/spec/standards/ael-spec-feature-spec-standard.md +38 -0
- package/adapters/spec/standards/ael-spec-heilmeier-standard.md +32 -0
- package/adapters/spec/standards/ael-spec-implementation-readiness-standard.md +36 -0
- package/adapters/spec/standards/ael-spec-re-implementation-standard.md +39 -0
- package/adapters/spec/standards/ael-spec-zoom-out-standard.md +62 -0
- package/agents/instruction-only/AGENTS.md +1 -1
- package/bin/ai-engineering-loop.js +47 -7
- package/core/grill-policy.md +1 -1
- package/core/project-initialization.md +2 -2
- package/core/spec-pack.md +47 -0
- package/lib/bench.js +12 -12
- package/lib/design-ref.js +178 -0
- package/lib/docs.js +1 -1
- package/lib/doctor.js +2 -2
- package/lib/gates.js +1 -0
- package/lib/goal-runtime.js +5 -0
- package/lib/host-skill-build.js +1 -1
- package/lib/hosts/doctor.js +21 -3
- package/lib/impact-map.js +29 -1
- package/lib/receipt.js +12 -1
- package/lib/smart-context.js +10 -1
- package/lib/sync-hosts.js +28 -5
- package/package.json +3 -2
- package/schemas/goal-contract.schema.json +87 -11
- /package/.agents/skills/{ai-engineering-loop → ael}/references/loop-commands.md +0 -0
- /package/.agents/skills/{ai-engineering-loop → ael}/references/loop-deliver.md +0 -0
- /package/.agents/skills/{ai-engineering-loop → ael}/references/loop-goal.md +0 -0
- /package/.agents/skills/{ai-engineering-loop → ael}/references/loop-hosts.md +0 -0
- /package/.agents/skills/{ai-engineering-loop → ael}/references/loop-maker.md +0 -0
- /package/.agents/skills/{ai-engineering-loop → ael}/references/loop-review.md +0 -0
- /package/.agents/skills/{ai-engineering-loop → ael}/references/loop-verify.md +0 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
<!-- Generated by scripts/sync-spec-pack.js from egagofur/elephant-goldfish-model@228457d1e0b6. Derived from the Elephant-Goldfish Model, Copyright Google LLC, Apache-2.0; modified: renamed to ael-spec-*, host-neutral references. Do not edit; run the script. -->
|
|
2
|
+
|
|
3
|
+
# [Feature/Project Name]
|
|
4
|
+
|
|
5
|
+
* **Author:** [Author Name or GitHub Handle]
|
|
6
|
+
* **Status:** [Draft | Proposed | In Review | Approved]
|
|
7
|
+
* **Date:** [YYYY-MM-DD]
|
|
8
|
+
|
|
9
|
+
--------------------------------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
<!-- Provide a high-level summary of the feature, the business or technical
|
|
14
|
+
problem it solves, and its context within the system. Keep it concise so both
|
|
15
|
+
humans and agents can quickly parse the main objective.
|
|
16
|
+
-->
|
|
17
|
+
|
|
18
|
+
## The Problem
|
|
19
|
+
|
|
20
|
+
[Summarize the problem and the proposed solution here.]
|
|
21
|
+
|
|
22
|
+
## Goals
|
|
23
|
+
|
|
24
|
+
<!--
|
|
25
|
+
What will this feature achieve? Be specific, measurable, and clear.
|
|
26
|
+
These goals represent the absolute criteria for success.
|
|
27
|
+
-->
|
|
28
|
+
|
|
29
|
+
* Goal 1
|
|
30
|
+
* Goal 2
|
|
31
|
+
|
|
32
|
+
## Non-Goals
|
|
33
|
+
|
|
34
|
+
<!--
|
|
35
|
+
Explicitly state what is out of scope. This is crucial to prevent feature creep
|
|
36
|
+
and to define strict boundaries for the implementation agent.
|
|
37
|
+
-->
|
|
38
|
+
|
|
39
|
+
* Non-Goal 1
|
|
40
|
+
* Non-Goal 2
|
|
41
|
+
|
|
42
|
+
## Open Questions
|
|
43
|
+
|
|
44
|
+
<!--
|
|
45
|
+
List unresolved design questions, technical unknowns, or dependencies requiring
|
|
46
|
+
investigation. Unanswered questions are retained here across drafting sessions
|
|
47
|
+
to preserve conversational memory and prevent future sessions from re-asking
|
|
48
|
+
questions that were already discussed. Remove answered questions as they are
|
|
49
|
+
resolved.
|
|
50
|
+
-->
|
|
51
|
+
|
|
52
|
+
* **Question 1**: [Description of technical unknown or open question]
|
|
53
|
+
* **Question 2**: [Description of technical unknown or open question]
|
|
54
|
+
|
|
55
|
+
## Critical User Journeys (CUJs)
|
|
56
|
+
|
|
57
|
+
<!--
|
|
58
|
+
Define the end-to-end user journeys this design enables. Each CUJ must contain:
|
|
59
|
+
|
|
60
|
+
1. Given: Preconditions, starting state, and environment configurations.
|
|
61
|
+
2. When: The trigger, user action, or system event.
|
|
62
|
+
3. Then: The expected outcome, verification criteria, and postconditions.
|
|
63
|
+
-->
|
|
64
|
+
|
|
65
|
+
### CUJ 1: [Journey Title]
|
|
66
|
+
|
|
67
|
+
* **Given**: [Preconditions]
|
|
68
|
+
* **When**: [Actions]
|
|
69
|
+
* **Then**: [Expected Outcomes]
|
|
70
|
+
|
|
71
|
+
### CUJ 2: [Journey Title]
|
|
72
|
+
|
|
73
|
+
* **Given**: [Preconditions]
|
|
74
|
+
* **When**: [Actions]
|
|
75
|
+
* **Then**: [Expected Outcomes]
|
|
76
|
+
|
|
77
|
+
## Technical Plan (Architecture)
|
|
78
|
+
|
|
79
|
+
<!-- Detail the high-level design, architectural choices, system data flows, and
|
|
80
|
+
component interactions. Include ASCII or Mermaid diagrams to clearly model the
|
|
81
|
+
relationships.
|
|
82
|
+
-->
|
|
83
|
+
|
|
84
|
+
[Explain your architectural choices, data structures, and system component
|
|
85
|
+
mapping here.]
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
[Optional ASCII Architecture Diagram]
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Alternatives Considered
|
|
92
|
+
|
|
93
|
+
<!-- Document other architectural approaches or designs that were evaluated and
|
|
94
|
+
rejected. Explain the pros, cons, and the technical reasoning for why the chosen
|
|
95
|
+
plan is superior.
|
|
96
|
+
-->
|
|
97
|
+
|
|
98
|
+
### Alternative A: [Alternative Title]
|
|
99
|
+
|
|
100
|
+
* **Pros**: [List benefits]
|
|
101
|
+
* **Cons**: [List drawbacks]
|
|
102
|
+
* **Reason for Rejection**: [Why this option was not selected]
|
|
103
|
+
|
|
104
|
+
--------------------------------------------------------------------------------
|
|
105
|
+
|
|
106
|
+
## Non-Functional Requirements
|
|
107
|
+
|
|
108
|
+
<!-- Analyze non-functional concerns only if they represent critical risks for
|
|
109
|
+
this design:
|
|
110
|
+
|
|
111
|
+
- Security & Privacy: (Data sensitivity, auth/auth, secrets management).
|
|
112
|
+
- Performance & Latency: (Execution runtime, storage footprint, LLM token
|
|
113
|
+
overhead).
|
|
114
|
+
- Rollout & Rollback: (Feature flags, backward compatibility, rollback
|
|
115
|
+
commands).
|
|
116
|
+
-->
|
|
117
|
+
|
|
118
|
+
[Detail any critical non-functional requirements here. If none are critical,
|
|
119
|
+
this section can be omitted or stated as "None".]
|
|
120
|
+
|
|
121
|
+
--------------------------------------------------------------------------------
|
|
122
|
+
|
|
123
|
+
### Additional Resources
|
|
124
|
+
|
|
125
|
+
<!-- Specify the external resources and context that were used during the design
|
|
126
|
+
discussion. Optional. If none were provided omit this section.-->
|
|
127
|
+
|
|
128
|
+
* Important project docs referenced
|
|
129
|
+
* Important docs/ referenced
|
|
130
|
+
* Related work
|
|
131
|
+
|
|
132
|
+
### Future Improvements
|
|
133
|
+
|
|
134
|
+
<!-- Specify areas that have room for future improvement here. If none were
|
|
135
|
+
provided omit this section.-->
|
|
136
|
+
|
|
137
|
+
* **The idea**: What could be improved?
|
|
138
|
+
|
|
139
|
+
--------------------------------------------------------------------------------
|
|
140
|
+
|
|
141
|
+
## Detailed Implementation Plan
|
|
142
|
+
|
|
143
|
+
<!-- Specify exactly which files must be created or modified. Do not use vague
|
|
144
|
+
language or TBDs.
|
|
145
|
+
-->
|
|
146
|
+
|
|
147
|
+
### Target Files to Create/Modify
|
|
148
|
+
|
|
149
|
+
#### 1. `[File Path 1]` ([Create | Modify])
|
|
150
|
+
|
|
151
|
+
* **Type / Scope**: [e.g., Python Service, C++ Library, TypeScript Module, Build
|
|
152
|
+
Configuration]
|
|
153
|
+
* **Proposed Changes**: [Describe the new APIs, class/function signatures, or
|
|
154
|
+
behavioral logic here. Focus on the minimal required details for
|
|
155
|
+
implementation.]
|
|
156
|
+
|
|
157
|
+
#### 2. `[File Path 2]` ([Create | Modify])
|
|
158
|
+
|
|
159
|
+
* **Type / Scope**: [e.g., Unit Test, E2E Test Driver]
|
|
160
|
+
* **Proposed Changes**: [Describe the test coverage, expected test cases, or
|
|
161
|
+
mock assertions.]
|
|
162
|
+
|
|
163
|
+
### Verification Plan
|
|
164
|
+
|
|
165
|
+
<!-- Specify what unit, integration, or manual tests must pass to validate the
|
|
166
|
+
implementation. What metrics should be measured to verify success?
|
|
167
|
+
-->
|
|
168
|
+
|
|
169
|
+
* **Compilation/Build**: [e.g., `npm run build`, `cargo build`, `make`]
|
|
170
|
+
* **Unit Tests**: [e.g., `pytest`, `npm test`, `cargo test`]
|
|
171
|
+
* **Static Analysis & Linting**: [e.g., `eslint`, `ruff check`, `golangci-lint`]
|
|
172
|
+
* **Test Coverage Requirement**: [e.g., 85%+ branch coverage]
|
|
173
|
+
* **E2E/Integration**: [e.g., Integration test command or automated eval runner]
|
|
174
|
+
|
|
175
|
+
--------------------------------------------------------------------------------
|
|
176
|
+
|
|
177
|
+
<!-- Provenance: Indicates initial structural drafting via EGM. -->
|
|
178
|
+
|
|
179
|
+
*Drafted with EGM*
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ael-spec-drift
|
|
3
|
+
license: Apache-2.0
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
description: >-
|
|
6
|
+
Runs drift detection on all design documents to check for document and
|
|
7
|
+
code consistency. Produces an actionable report with differences. Use when the
|
|
8
|
+
user asks to detect drift or check for consistency across all design documents
|
|
9
|
+
or READMEs in a directory.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<!-- Generated by scripts/sync-spec-pack.js from egagofur/elephant-goldfish-model@228457d1e0b6. Derived from the Elephant-Goldfish Model, Copyright Google LLC, Apache-2.0; modified: renamed to ael-spec-*, host-neutral references. Do not edit; run the script. -->
|
|
13
|
+
|
|
14
|
+
# Detect Drift In Designs and Code
|
|
15
|
+
|
|
16
|
+
Host rules: spawn each Goldfish reviewer as a fresh sibling subagent with your host's subagent tool, as described in `npx ai-engineering-loop docs loop-hosts` (read only your host's section). Personas and standards named below resolve with `npx ai-engineering-loop docs <name>`.
|
|
17
|
+
|
|
18
|
+
When the user asks to detect drift across all designs or a set of READMEs, the
|
|
19
|
+
goal is to identify all instances where the codebase has diverged or failed to
|
|
20
|
+
implement the specifications described by those designs or READMEs.
|
|
21
|
+
|
|
22
|
+
1. **Check Input**: Verify a directory containing design documents or READMEs
|
|
23
|
+
is provided. If not provided, ask the user to specify the target directory.
|
|
24
|
+
2. **List Documents**: List all files in the design directory.
|
|
25
|
+
3. **Analyze**: For EACH design document:
|
|
26
|
+
|
|
27
|
+
* **Contextualize**: Read the design document. Identify the intent,
|
|
28
|
+
proposed changes, and specific filenames/symbols mentioned.
|
|
29
|
+
* **Locate Source**: Find the corresponding source code files in the
|
|
30
|
+
source tree. If paths aren't explicit, use code search or grep to
|
|
31
|
+
locate the relevant classes, functions, or API endpoints mentioned in
|
|
32
|
+
the doc. Prompt the user to add missing links to the document to make
|
|
33
|
+
future detection cheaper.
|
|
34
|
+
* **Verify**: Read the current state of those source files.
|
|
35
|
+
* **Detect Drift**: Compare the design vs. reality. Look specifically for:
|
|
36
|
+
* Missing Features: Logic described in the doc but absent in the code.
|
|
37
|
+
* Incomplete Models: Dataclasses/Classes/Structs/Protos missing fields
|
|
38
|
+
specified in the design.
|
|
39
|
+
* Logic Shortcuts: Hardcoded values where dynamic logic was planned.
|
|
40
|
+
* Architectural Divergence: Implementation using different
|
|
41
|
+
patterns/libraries than proposed.
|
|
42
|
+
* **Filter**: Report ONLY the differences. Do not describe what is working
|
|
43
|
+
or what matches. If the code matches the design perfectly, output "No
|
|
44
|
+
drift detected."
|
|
45
|
+
|
|
46
|
+
4. **Report**: Produce a single report listing all discrepancies found.
|
|
47
|
+
|
|
48
|
+
* Append the analysis for each file to `{YYYY-MM-DD}_DRIFT_REPORT.md`
|
|
49
|
+
using your file-writing tool.
|
|
50
|
+
* Strict Format:
|
|
51
|
+
|
|
52
|
+
```markdown
|
|
53
|
+
## <DESIGN_DOC_NAME>
|
|
54
|
+
|
|
55
|
+
<Bulleted list of specific divergences found>
|
|
56
|
+
<Or "No drift detected">
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
5. **Guidance**
|
|
60
|
+
|
|
61
|
+
- Be rigorous. If a design doc mentions a specific object, field or file
|
|
62
|
+
name and the code doesn't have it, that is a reportable drift. Double
|
|
63
|
+
check for coverage. If there is some part of the logic that is not
|
|
64
|
+
referenced in a design or README, this is a reportable drift.
|
|
65
|
+
- Read files liberally to ensure you are looking at the current state
|
|
66
|
+
of the code, not relying on memory.
|
|
67
|
+
- Process the files sequentially to ensure the tool output buffer doesn't
|
|
68
|
+
overflow.
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ael-spec-resolve
|
|
3
|
+
license: Apache-2.0
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
description: >-
|
|
6
|
+
The Elephant resolution skill. Ingests flat deficiency reports from
|
|
7
|
+
concurrent Goldfish reviewers, applies automated fixes for PROPOSE FIX
|
|
8
|
+
items via UI multiple-choice gates, and presents interactive
|
|
9
|
+
negotiation/re-sync checkpoints.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<!-- Generated by scripts/sync-spec-pack.js from egagofur/elephant-goldfish-model@228457d1e0b6. Derived from the Elephant-Goldfish Model, Copyright Google LLC, Apache-2.0; modified: renamed to ael-spec-*, host-neutral references. Do not edit; run the script. -->
|
|
13
|
+
|
|
14
|
+
# Goldfish Review: Resolve
|
|
15
|
+
|
|
16
|
+
Host rules: spawn each Goldfish reviewer as a fresh sibling subagent with your host's subagent tool, as described in `npx ai-engineering-loop docs loop-hosts` (read only your host's section). Personas and standards named below resolve with `npx ai-engineering-loop docs <name>`.
|
|
17
|
+
|
|
18
|
+
## Overview
|
|
19
|
+
|
|
20
|
+
This skill instructs the agent on how to operate within the primary Elephant
|
|
21
|
+
context window to parse flat deficiency reports from concurrent Goldfish
|
|
22
|
+
reviewers. It defends accurate design choices, applies automated textual
|
|
23
|
+
repairs, and manages interactive negotiation checkpoints.
|
|
24
|
+
|
|
25
|
+
## Prerequisites & Context Strategy
|
|
26
|
+
|
|
27
|
+
* **Context Recommendation (Elephant Memory)**: This skill should be run in
|
|
28
|
+
the persistent conversation session that generated the target document (the
|
|
29
|
+
Elephant) to recall earlier reasoning and craft higher-quality fixes.
|
|
30
|
+
|
|
31
|
+
## Inputs
|
|
32
|
+
|
|
33
|
+
The caller or orchestration driver provides exactly these parameters:
|
|
34
|
+
|
|
35
|
+
* **`TargetFile`**: Absolute or relative path to target document.
|
|
36
|
+
* **`LineRange`**: Exact line numbers (or `full file`).
|
|
37
|
+
* **`FindingsList`**: Aggregated flat list of findings from Goldfish
|
|
38
|
+
reviewers.
|
|
39
|
+
|
|
40
|
+
## Execution Workflow
|
|
41
|
+
|
|
42
|
+
### Step 1: Intake Validation & Gather Context
|
|
43
|
+
|
|
44
|
+
1. **Hybrid Execution UX**: Detect if execution arguments are present:
|
|
45
|
+
|
|
46
|
+
* *Automated Mode*: If all parameters are provided, execute silently as a
|
|
47
|
+
subprocess.
|
|
48
|
+
* *Standalone Human Mode*: If parameters are omitted, trigger a friendly
|
|
49
|
+
onboarding flow. Prompt for one piece of input at a time, waiting for
|
|
50
|
+
the user's response after each turn. Once all inputs are specified,
|
|
51
|
+
display the final setup and verify the user is ready to continue.
|
|
52
|
+
|
|
53
|
+
2. Read `TargetFile` at `LineRange` by reading it and parse the `FindingsList`.
|
|
54
|
+
|
|
55
|
+
### Step 2: Evaluate & Categorize
|
|
56
|
+
|
|
57
|
+
Give each finding exactly one category:
|
|
58
|
+
|
|
59
|
+
* **CONTEST**: The critique is inaccurate or relies on a misunderstanding of
|
|
60
|
+
the codebase. Cite evidence that the reviewer could read: a file and
|
|
61
|
+
symbol, or a decision recorded in the document.
|
|
62
|
+
* **ESCALATE**: The critique is inaccurate, but the evidence is outside every
|
|
63
|
+
file the reviewer could read (for example, a team convention or a verbal
|
|
64
|
+
decision). State that fact. Do not fix the finding. Give it to the user.
|
|
65
|
+
* **PROPOSE FIX**: The critique is valid. Define precise textual replacements
|
|
66
|
+
or structural formatting adjustments to resolve the gap.
|
|
67
|
+
* **DECLINE**: The finding is a Nit. Record it. Do not fix it. You can use
|
|
68
|
+
PROPOSE FIX for a Nit if the fix is worth it.
|
|
69
|
+
|
|
70
|
+
Apply these rules:
|
|
71
|
+
|
|
72
|
+
* **A contest must be checkable.** "This was intentional" is not evidence.
|
|
73
|
+
If you cannot cite evidence the reviewer could read, use ESCALATE or
|
|
74
|
+
PROPOSE FIX.
|
|
75
|
+
* **Do not add context only to satisfy a reviewer.** Add context when a human
|
|
76
|
+
reader of the document needs it. If only a zero-context subagent needs it,
|
|
77
|
+
use ESCALATE.
|
|
78
|
+
* **Do not contest a comprehension gap.** If a fresh reader could not follow
|
|
79
|
+
the document, the document is missing context.
|
|
80
|
+
* **Do not change a severity.** If you think a Blocker is a Nit, CONTEST it
|
|
81
|
+
and state the reason.
|
|
82
|
+
* You wrote the document under review. A wish to contest is not evidence
|
|
83
|
+
that the reviewer is wrong.
|
|
84
|
+
|
|
85
|
+
### Step 3: Report Fixes
|
|
86
|
+
|
|
87
|
+
Construct the final report and save it named
|
|
88
|
+
`goldfish_review_report.md` in the working directory (or your harness's artifact directory, if it has one)
|
|
89
|
+
using your file-writing tool. Use this layout:
|
|
90
|
+
|
|
91
|
+
```markdown
|
|
92
|
+
# Goldfish Annotated Review Report
|
|
93
|
+
|
|
94
|
+
**Target:** `[TargetFile]` (`[LineRange]`)
|
|
95
|
+
|
|
96
|
+
## Prioritized Findings & AI Suggestions
|
|
97
|
+
|
|
98
|
+
{{range findings, ordered by Severity}}
|
|
99
|
+
### [Issue 1] [`[ReviewerPersona]`] - Severity: [High | Medium | Low]
|
|
100
|
+
* **Affected Scope:** [Lines Start-End]([RelativePath]#L[Start]-L[End]) ([Sub-header])
|
|
101
|
+
* **Discrepancy Description:** [copied from FindingsList]
|
|
102
|
+
* **Rationale:** [copied from FindingsList]
|
|
103
|
+
* ***AI Suggestion:*** [CONTEST | ESCALATE | PROPOSE FIX | DECLINE]
|
|
104
|
+
* ***Justification:*** [Detailed reason]
|
|
105
|
+
* ***Proposed Edit:***
|
|
106
|
+
* Location: [Line/Header]
|
|
107
|
+
* Change: [Precise replacement string or deletion note]
|
|
108
|
+
{{end}}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Step 4: Interactive Resolution Gate
|
|
112
|
+
|
|
113
|
+
If any finding is `ESCALATE`, list those findings first in the chat message.
|
|
114
|
+
They need the user's knowledge, not only approval.
|
|
115
|
+
|
|
116
|
+
Before proceeding, output a visible chat message to the user: *"I have compiled
|
|
117
|
+
the audit findings into `goldfish_review_report.md`. Please review the findings there and choose how you would like to
|
|
118
|
+
proceed:
|
|
119
|
+
|
|
120
|
+
- **Comment directly on the file**: Review `goldfish_review_report.md` in
|
|
121
|
+
chat or the file and leave comments/edits to approve, reject, or contest
|
|
122
|
+
specific items.
|
|
123
|
+
- **Auto accept**: Reply "auto accept" to batch-apply all proposed fixes
|
|
124
|
+
(skipping contested items).
|
|
125
|
+
- **Continue to next phase**: Reply "continue" or "no changes" to proceed
|
|
126
|
+
without applying fixes.
|
|
127
|
+
- **Interactive breakdown**: Reply "interactive breakdown" for a guided,
|
|
128
|
+
item-by-item walkthrough in chat with detailed explanations for each
|
|
129
|
+
proposed edit or contested finding before making decisions.
|
|
130
|
+
- **Custom instruction / Wildcard request**: Reply with any custom
|
|
131
|
+
instruction, question, or out-of-band request."*
|
|
132
|
+
|
|
133
|
+
You **MUST** immediately yield active execution by calling **zero tools** in
|
|
134
|
+
this turn payload. You must stop execution and go idle, waiting for the human
|
|
135
|
+
developer to comment on/edit the artifact or reply in the chat.
|
|
136
|
+
|
|
137
|
+
Interpret the user's action/response as follows:
|
|
138
|
+
|
|
139
|
+
- **"Auto accept" / "Accept all suggestions" / User clicks "Proceed" without
|
|
140
|
+
contesting**: Apply all fixes where the AI suggestion was `PROPOSE FIX`
|
|
141
|
+
directly to `TargetFile` at `LineRange` in a single batch using
|
|
142
|
+
your file-editing tool. Any items categorized as `CONTEST`, `ESCALATE`, or
|
|
143
|
+
`DECLINE` are explicitly bypassed. Then proceed to Step 5.
|
|
144
|
+
- **"Continue to next phase" / "No changes"**: Do not apply any automated
|
|
145
|
+
fixes. Then proceed to Step 5.
|
|
146
|
+
- **"Interactive breakdown"**: Enter a sequential breakdown loop over ALL
|
|
147
|
+
finding items (all categories except `DECLINE`):
|
|
148
|
+
|
|
149
|
+
1. For each item `i`, output a visible chat message formatting the full
|
|
150
|
+
finding details and explanation in rich markdown:
|
|
151
|
+
|
|
152
|
+
```markdown
|
|
153
|
+
### Breakdown Item [i]: [Issue Title] [`[ReviewerPersona]`]
|
|
154
|
+
* **Scope:** [Lines Start-End]([RelativePath]#L[Start]-L[End]) ([Sub-header])
|
|
155
|
+
* **Description:** [Description]
|
|
156
|
+
* **AI Suggestion:** [CONTEST | ESCALATE | PROPOSE FIX]
|
|
157
|
+
* **Explanation & Justification:** [Detailed reason and background explaining why the fix is proposed or why the finding is contested]
|
|
158
|
+
* **Proposed Edit:** [Precise replacement text or deletion note]
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Then prompt the user in chat for their decision on this item (calling
|
|
162
|
+
**zero tools** and going idle):
|
|
163
|
+
|
|
164
|
+
* If `PROPOSE FIX`: Ask the user to reply with **Accept proposed
|
|
165
|
+
fix**, **Skip / ignore**, or **Discuss**.
|
|
166
|
+
* If `CONTEST`: Ask the user to reply with **Skip / agree with
|
|
167
|
+
contest**, **Overrule contest (propose fix)**, or **Discuss**.
|
|
168
|
+
* If `ESCALATE`: Ask the user to reply with **Confirm (no change)**,
|
|
169
|
+
**Add the fact to the document**, or **Discuss**.
|
|
170
|
+
|
|
171
|
+
2. Record the user's decisions in an internal memory checklist (e.g., *Item
|
|
172
|
+
1: Accepted*, *Item 2: Ignored*, *Item 3: Overruled*). **Do NOT call any
|
|
173
|
+
file editing tools during this sequential loop.**
|
|
174
|
+
|
|
175
|
+
3. Once all items have been decided, summarize the accepted edits, execute
|
|
176
|
+
them using your file-editing tool, and proceed to Step 5.
|
|
177
|
+
|
|
178
|
+
- **Custom instruction / Out-of-band edit**: If the user provides targeted
|
|
179
|
+
instructions, apply them and proceed.
|
|
180
|
+
|
|
181
|
+
### Step 5: Post-Resolution Synchronization & Exit
|
|
182
|
+
|
|
183
|
+
1. **Re-verify Lines**: If changes were made to `TargetFile`, verify that the
|
|
184
|
+
file remains structurally coherent and valid markdown.
|
|
185
|
+
2. Mark the report as resolved (add a `Status: resolved` line at the top).
|
|
186
|
+
3. **Handoff**: Exit cleanly back to the caller (such as `ael-spec-review-loop`)
|
|
187
|
+
with the count of accepted fixes, contested items, escalated items,
|
|
188
|
+
declined items, and remaining unaddressed issues.
|