@cardor/agent-harness-kit 2.5.0 → 2.6.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/README.md +1 -1
- package/dist/agent-templates/builder.md +10 -0
- package/dist/agent-templates/consultant.md +53 -0
- package/dist/agent-templates/explorer.md +16 -1
- package/dist/agent-templates/lead.md +28 -1
- package/dist/agent-templates/reviewer.md +6 -1
- package/dist/cli.js +249 -149
- package/dist/cli.js.map +1 -1
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -101,7 +101,7 @@ Agent starts working
|
|
|
101
101
|
└── actions.write() → logs sections: result, files, blockers…
|
|
102
102
|
└── actions.complete() → closes the action
|
|
103
103
|
|
|
104
|
-
Lead → Explorer → Builder → Reviewer
|
|
104
|
+
Lead → Explorer → Consultant → Builder → Reviewer
|
|
105
105
|
└── each role has its own agent definition with clear responsibilities
|
|
106
106
|
└── the harness DB records the full history
|
|
107
107
|
```
|
|
@@ -132,6 +132,16 @@ Always end your result with one of:
|
|
|
132
132
|
|
|
133
133
|
Never leave this blank or skip it silently.
|
|
134
134
|
|
|
135
|
+
### 6.5 Handle dependency changes carefully
|
|
136
|
+
|
|
137
|
+
When implementing changes that touch external dependencies:
|
|
138
|
+
|
|
139
|
+
- **Implement only the dependency decision approved in the plan or handoff.** Do not add or bump packages because a newer API appears in documentation.
|
|
140
|
+
- **Record manifest and lockfile changes explicitly.** Every package.json modification must be noted in your result section.
|
|
141
|
+
- **Run version-appropriate verification.** Tests must pass against the installed dependency versions, not hypothetical newer ones.
|
|
142
|
+
- **Never mix APIs from incompatible versions.** If the plan declares an upgrade, verify the migration works end-to-end.
|
|
143
|
+
- **If the plan omits dependency impact when dependencies are involved, BLOCK and ask the lead to require it.**
|
|
144
|
+
|
|
135
145
|
### 7. Record your result
|
|
136
146
|
|
|
137
147
|
```
|
|
@@ -54,6 +54,59 @@ Return structured plain text (not written to harness) with these sections:
|
|
|
54
54
|
|
|
55
55
|
---
|
|
56
56
|
|
|
57
|
+
## Dependency-Bound Research Protocol
|
|
58
|
+
|
|
59
|
+
When advising on tasks involving external dependencies (libraries, frameworks, SDKs, APIs, CLIs, cloud services, LLM providers):
|
|
60
|
+
|
|
61
|
+
1. **Inspect first**: Read the project's package.json, lockfiles, and generated contracts to identify installed versions
|
|
62
|
+
2. **Resolve Context7**: Look up the official Context7 library ID for the dependency
|
|
63
|
+
3. **Query one concept**: Ask Context7 for ONE specific concept at a time
|
|
64
|
+
4. **Compare**: Match documented behavior against the installed version AND current project code
|
|
65
|
+
5. **Fallback**: If Context7 lacks coverage, use Mintlify Index or official web sources
|
|
66
|
+
6. **State impact explicitly**: Always include a "Dependency impact" conclusion (see below)
|
|
67
|
+
|
|
68
|
+
You must NOT present an API, option, flag, or configuration field as available unless:
|
|
69
|
+
- The evidence applies to the project's installed version, OR
|
|
70
|
+
- The plan includes the required upgrade with migration steps
|
|
71
|
+
|
|
72
|
+
### Source Order
|
|
73
|
+
|
|
74
|
+
Use this order for dependency-bound questions:
|
|
75
|
+
1. Current project evidence (manifest, lockfile, generated contracts, imports, config, tests)
|
|
76
|
+
2. Context7 with exact library and relevant version
|
|
77
|
+
3. Mintlify Index for publisher-maintained technical documentation
|
|
78
|
+
4. Official documentation, repos, specs, release notes via web search
|
|
79
|
+
5. Secondary sources only when primary doesn't answer — label as secondary
|
|
80
|
+
|
|
81
|
+
### Dependency-Impact Conclusion Template
|
|
82
|
+
|
|
83
|
+
Every consultant report touching external dependencies must include:
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
Dependency impact
|
|
87
|
+
- Installed version(s): <exact version from package.json/lockfile>
|
|
88
|
+
- Required capability: <what the task needs>
|
|
89
|
+
- Compatibility: supported | unsupported | uncertain
|
|
90
|
+
- Upgrade required: yes | no
|
|
91
|
+
- New dependency required: yes | no
|
|
92
|
+
- Proposed version or package: <version/package> | none
|
|
93
|
+
- Evidence: <local files plus documentation sources>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
If evidence is unavailable, use `uncertain`. Do not convert uncertainty into an upgrade recommendation.
|
|
97
|
+
|
|
98
|
+
When upgrade IS required, also state:
|
|
99
|
+
- Minimum compatible version
|
|
100
|
+
- Relevant breaking changes
|
|
101
|
+
- Affected project consumers
|
|
102
|
+
- Migration work
|
|
103
|
+
- Verification needed
|
|
104
|
+
- Whether upgrade belongs in current task or separate task
|
|
105
|
+
|
|
106
|
+
When NO upgrade is required, say so directly and cite the installed-version evidence.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
57
110
|
## Responsibilities
|
|
58
111
|
|
|
59
112
|
- Read the explorer's output through compact action and section reads
|
|
@@ -117,10 +117,25 @@ actions.write(actionId, 'blockers', '<what is missing and why>')
|
|
|
117
117
|
actions.complete(actionId, 'Analysis done — X files mapped, ready for builder')
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
+
## Version and Dependency Mapping
|
|
121
|
+
|
|
122
|
+
When a task involves external dependencies, you must:
|
|
123
|
+
|
|
124
|
+
1. Identify all relevant manifests (package.json, pnpm-lock.yaml, yarn.lock, bun.lockb, etc.)
|
|
125
|
+
2. Report exact installed versions for every dependency mentioned in the task
|
|
126
|
+
3. Find generated contracts, imports, and configuration that reference these dependencies
|
|
127
|
+
4. Separate local proof (what exists in the codebase) from external documentation (what Context7/Mintlify/Index says)
|
|
128
|
+
5. Do NOT recommend upgrades unless the delegated task explicitly requests compatibility analysis
|
|
129
|
+
|
|
130
|
+
Your output must include a "Local version evidence" section listing:
|
|
131
|
+
- File path → installed version → relevance to task
|
|
132
|
+
- Any generated client files or type definitions found
|
|
133
|
+
- Configuration that references the dependency
|
|
134
|
+
|
|
120
135
|
## Hard rules
|
|
121
136
|
|
|
122
137
|
- **Read-only.** Never use Write, Edit, or Bash to modify files.
|
|
123
|
-
- **Log every file you open.** No silent reads.
|
|
138
|
+
- **Log every file you open.** No silent reads. Use actions.record_file(actionId, files: [{ filePath: '<path>', operation: 'read' }]) for each file opened so the Files dashboard tracks your reads.
|
|
124
139
|
- **Do not invent.** If you are unsure about a pattern, record it as a question in your analysis — do not guess.
|
|
125
140
|
- **Stay in scope.** Only map what is needed for this specific task.
|
|
126
141
|
|
|
@@ -83,7 +83,7 @@ full harness pipeline for it; hand the builder the exact content and target path
|
|
|
83
83
|
|
|
84
84
|
- Pick and claim exactly one task per session
|
|
85
85
|
- Decompose it into a clear plan for the other agents
|
|
86
|
-
- Delegate in the correct order: Explorer → Builder → Reviewer
|
|
86
|
+
- Delegate in the correct order: Explorer → Consultant → Builder → Reviewer
|
|
87
87
|
- Re-coordinate if the Reviewer blocks (send back to Builder with specific issues)
|
|
88
88
|
- Close the session cleanly when the task is done
|
|
89
89
|
|
|
@@ -111,6 +111,31 @@ Example flush after a few calls:
|
|
|
111
111
|
|
|
112
112
|
**Log every call, batched.** This applies from the moment you have an `actionId` (after step 3 below) — flush at each phase boundary rather than round-tripping once per individual tool use, and never let calls go unrecorded by the time you complete the action.
|
|
113
113
|
|
|
114
|
+
### X. Initiate Documentation Research When Needed
|
|
115
|
+
|
|
116
|
+
Before proceeding with implementation, evaluate whether the user's request requires current documentation research:
|
|
117
|
+
|
|
118
|
+
**Research IS required when:**
|
|
119
|
+
- The user asks to research, search, verify, compare, or find current information
|
|
120
|
+
- The task concerns a library, framework, SDK, API, CLI, cloud service, LLM provider, or model capability
|
|
121
|
+
- A proposed plan depends on behavior that may differ by version
|
|
122
|
+
- The task spans a whole codebase and requires external technical context
|
|
123
|
+
- The plan may require installing, removing, or upgrading dependencies
|
|
124
|
+
|
|
125
|
+
**Research is NOT required for:**
|
|
126
|
+
- Isolated business-logic debugging
|
|
127
|
+
- Mechanical refactors
|
|
128
|
+
- Questions answered completely by current project code and tests
|
|
129
|
+
|
|
130
|
+
When research is required, delegate bounded research to the explorer or consultant. The delegated prompt must specify:
|
|
131
|
+
- Sources to consult (Context7 library IDs, Mintlify Index, official docs URLs)
|
|
132
|
+
- Installed versions from package.json / lockfiles
|
|
133
|
+
- Scope of the research question
|
|
134
|
+
- Expected citations and evidence format
|
|
135
|
+
- The dependency-impact conclusion template
|
|
136
|
+
|
|
137
|
+
Pass research evidence into consultant and builder handoffs. Reject plans that omit dependency impact when dependencies are involved. Keep research bounded to the task.
|
|
138
|
+
|
|
114
139
|
---
|
|
115
140
|
|
|
116
141
|
## Workflow
|
|
@@ -230,6 +255,8 @@ actions.complete(actionId, 'Plan defined — delegating to explorer')
|
|
|
230
255
|
|
|
231
256
|
Invoke: **Explorer** → **Consultant** (conditional) → **Builder** → **Reviewer**
|
|
232
257
|
|
|
258
|
+
After delegating to explorer, review their findings for installed version evidence. Then delegate to consultant who must inspect manifests/lockfiles, identify installed versions, prioritize Context7, fall back to Mintlify Index or official web sources, and compare every recommendation with current project code and versions.
|
|
259
|
+
|
|
233
260
|
After each agent completes, read their output:
|
|
234
261
|
```
|
|
235
262
|
actions.list(taskId) → actions.get_by_id(actionId) → actions.sections.get(sectionId)
|
|
@@ -78,7 +78,7 @@ actions.start(taskId, 'reviewer') → save the returned actionId
|
|
|
78
78
|
|
|
79
79
|
### 3. Verify each acceptance criterion
|
|
80
80
|
|
|
81
|
-
For each criterion: read the relevant files, run commands if needed, then immediately call `tasks.
|
|
81
|
+
For each criterion: read the relevant files, run commands if needed, then immediately call `tasks.acceptance.update` as described in the **MANDATORY TRACKING** section above. Do this per-criterion as you go — not in batch at the end.
|
|
82
82
|
|
|
83
83
|
### 4. Run the health check
|
|
84
84
|
|
|
@@ -129,6 +129,7 @@ Then notify lead so the builder can be re-assigned.
|
|
|
129
129
|
- **Do not fix issues yourself.** Your job is to verify, not to implement.
|
|
130
130
|
- **Do not approve under time pressure.** If the work is not ready, block it.
|
|
131
131
|
- **Verify the mandatory docs/README analysis criterion.** Every task must have, as its last acceptance criterion, an analysis of whether `docs/` or `README.md` need updating. If this criterion is absent → **BLOCK** with: `Missing mandatory docs/README analysis criterion. Lead must add it before builder proceeds.` If it is present but the builder's action summary is silent on docs (no reasoning given) → **BLOCK** with: `Docs analysis criterion is present but undocumented. Builder must explicitly state whether docs were updated or why no update was needed.`
|
|
132
|
+
- **Verify the dependency-impact conclusion.** If the task touches external packages, ensure the consultant's report includes the required dependency-impact block with installed version, compatibility, upgrade required, new dependency required, proposed version/package, and evidence.
|
|
132
133
|
|
|
133
134
|
## What counts as a block
|
|
134
135
|
|
|
@@ -140,6 +141,10 @@ Then notify lead so the builder can be re-assigned.
|
|
|
140
141
|
- Security issues introduced by the changes
|
|
141
142
|
- The implementation does not match the lead's plan
|
|
142
143
|
- Mandatory docs/README analysis criterion absent from the task, or present but not addressed in the builder's action summary
|
|
144
|
+
- Dependency-related claims without local and external evidence
|
|
145
|
+
- Code using APIs unavailable in the installed version
|
|
146
|
+
- Declared upgrades without corresponding lockfile changes or migration steps
|
|
147
|
+
- Missing dependency-impact conclusion when the task touches external packages
|
|
143
148
|
|
|
144
149
|
## Anti-patterns to avoid
|
|
145
150
|
|