@hmharness/agent 0.14.4 → 0.14.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.
@@ -1,6 +1,6 @@
1
1
  import { runLoop, type LoopResult, type ProviderConfig, type Registry, type ToolContext } from '@hmharness/kernel';
2
2
  import type { DeviceTestOptions, DeviceTestStep } from '@hmharness/domain-harmony';
3
- export type PipelineStage = 'plan' | 'code' | 'test' | 'review' | 'judge' | 'device';
3
+ export type PipelineStage = 'plan' | 'architect' | 'code' | 'test' | 'review' | 'judge' | 'device';
4
4
  /** stage labels used in runStage (repairer = the repair-loop role) */
5
5
  export type StageRole = PipelineStage | 'repairer';
6
6
  export interface StageRecord {
package/dist/pipeline.js CHANGED
@@ -56,6 +56,7 @@ function stageMessages(opts, role, directive) {
56
56
  }
57
57
  const DIRECTIVES = {
58
58
  plan: (task) => `Goal: ${task}\nProduce the numbered implementation plan (each step names its verification). Do not execute anything.`,
59
+ architect: (task, extra) => `Goal: ${task}\n${extra}\nMake the structural decisions for this task: module boundaries, data flow, interface contracts, technology tradeoffs, risks. Numbered decisions with rationale; flag the riskiest one. No code.`,
59
60
  code: (task, extra) => `Goal: ${task}\n${extra}\nImplement the plan now (surgical edits, cheapest verification per step).`,
60
61
  test: (task, extra) => `Goal: ${task}\n${extra}\nRun the verifications from the plan; probe edge cases; report input -> actual vs expected for each probe.`,
61
62
  review: (_task, extra) => `Review the changes produced so far on disk.\n${extra}\nFindings first, severity-ordered, file:line evidence, no fixes.`,
@@ -144,13 +145,19 @@ export async function runPipeline(opts) {
144
145
  status = 'budget';
145
146
  return await finish();
146
147
  }
147
- // 2. code (carries the plan)
148
- await runStage('code', 1, DIRECTIVES.code(opts.task, `Approved plan:\n${plan.text.slice(0, 2000)}`));
148
+ // 2. architect (structural decisions between plan and code, V3 slice 4)
149
+ const arch = await runStage('architect', 1, DIRECTIVES.architect(opts.task, `Plan:\n${plan.text.slice(0, 1500)}`));
149
150
  if (spent >= totalBudget) {
150
151
  status = 'budget';
151
152
  return await finish();
152
153
  }
153
- // 3. test + repair loop (code+test rerun carries the reviewer/judge findings)
154
+ // 3. code (carries plan + architecture)
155
+ await runStage('code', 1, DIRECTIVES.code(opts.task, `Approved plan:\n${plan.text.slice(0, 1500)}\nArchitecture decisions:\n${arch.text.slice(0, 1500)}`));
156
+ if (spent >= totalBudget) {
157
+ status = 'budget';
158
+ return await finish();
159
+ }
160
+ // 4. test + repair loop (code+test rerun carries the reviewer/judge findings)
154
161
  let testOut = await runStage('test', 1, DIRECTIVES.test(opts.task, `Plan:\n${plan.text.slice(0, 1500)}`));
155
162
  if (spent >= totalBudget) {
156
163
  status = 'budget';
package/dist/roles.js CHANGED
@@ -1,4 +1,9 @@
1
1
  export const TEAM_ROLES = {
2
+ architect: {
3
+ name: 'architect',
4
+ charter: 'ARCHITECT duty: make structural decisions - module boundaries, data flow, interface contracts, technology tradeoffs, and key risks. Output a numbered decision list where each decision names its rationale and its blast radius (what breaks if wrong). Never write code, never execute steps - decisions only. Flag the single riskiest decision explicitly.',
5
+ goodFor: 'structural decisions between planning and coding',
6
+ },
2
7
  planner: {
3
8
  name: 'planner',
4
9
  charter: 'PLANNER duty: decompose the goal into ordered, verifiable steps. Output a numbered plan where every step names its verification (command/check). Never execute the steps yourself - plan only. Flag risks and unknowns explicitly.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmharness/agent",
3
- "version": "0.14.4",
3
+ "version": "0.14.6",
4
4
  "description": "hmharness agent execution layer: base tools, system prompt, sub-agent spawn, and the shared task runner that frontends (cli, web) drive.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -17,7 +17,7 @@
17
17
  "dependencies": {
18
18
  "@hmharness/domain-harmony": "0.13.5",
19
19
  "@hmharness/domain-ops": "0.8.0",
20
- "@hmharness/evolution": "0.14.4",
20
+ "@hmharness/evolution": "0.14.5",
21
21
  "@hmharness/kernel": "0.9.0",
22
22
  "@hmharness/observability": "0.7.0",
23
23
  "@hmharness/sandbox": "0.8.0"