harnessed 3.0.3 → 3.2.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/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  // package.json
2
2
  var package_default = {
3
- version: "3.0.3"};
3
+ version: "3.2.0"};
4
4
 
5
5
  // src/index.ts
6
6
  var VERSION = package_default.version;
@@ -1 +1 @@
1
- {"version":3,"sources":["../package.json","../src/index.ts"],"names":[],"mappings":";AAAA,IAAA,eAAA,GAAA;AAAA,EAEE,OAAA,EAAW,OA8Fb,CAAA;;;AC3FO,IAAM,UAAU,eAAA,CAAI","file":"index.mjs","sourcesContent":["{\n \"name\": \"harnessed\",\n \"version\": \"3.0.3\",\n \"description\": \"AI coding harness package manager + composition orchestrator\",\n \"type\": \"module\",\n \"license\": \"Apache-2.0\",\n \"author\": \"easyinplay\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/easyinplay/harnessed.git\"\n },\n \"homepage\": \"https://github.com/easyinplay/harnessed#readme\",\n \"bugs\": \"https://github.com/easyinplay/harnessed/issues\",\n \"keywords\": [\n \"claude-code\",\n \"ai-harness\",\n \"package-manager\",\n \"composition\",\n \"skill-pack\",\n \"mcp\",\n \"orchestrator\"\n ],\n \"engines\": {\n \"node\": \">=22.0.0\"\n },\n \"packageManager\": \"pnpm@10.12.0\",\n \"bin\": {\n \"harnessed\": \"./dist/cli.mjs\"\n },\n \"main\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.mjs\",\n \"default\": \"./dist/index.mjs\"\n },\n \"./schemas\": {\n \"types\": \"./dist/schemas/index.d.ts\",\n \"import\": \"./dist/schemas/index.mjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"dist\",\n \"manifests\",\n \"workflows\",\n \"routing\",\n \"config-templates\",\n \"schemas\",\n \"README.md\",\n \"LICENSE\",\n \"NOTICE\"\n ],\n \"scripts\": {\n \"dev\": \"tsup --watch\",\n \"build\": \"tsc --noEmit && tsup\",\n \"build:schema\": \"node ./scripts/build-schema.mjs\",\n \"validate:schema\": \"node ./scripts/validate-schema.mjs\",\n \"typecheck\": \"tsc --noEmit\",\n \"test\": \"vitest run --passWithNoTests\",\n \"test:watch\": \"vitest\",\n \"test:coverage\": \"vitest run --coverage --passWithNoTests\",\n \"bench\": \"vitest bench --run\",\n \"lint\": \"biome check .\",\n \"lint:fix\": \"biome check --write .\",\n \"format\": \"biome format --write .\"\n },\n \"dependencies\": {\n \"@anthropic-ai/claude-agent-sdk\": \"0.3.142\",\n \"@clack/prompts\": \"^0.10.1\",\n \"@sinclair/typebox\": \"^0.34.49\",\n \"ajv\": \"^8.20.0\",\n \"ajv-errors\": \"^3.0.0\",\n \"ajv-formats\": \"^3.0.1\",\n \"commander\": \"^13.0.0\",\n \"diff\": \"^9.0.0\",\n \"expr-eval\": \"^2.0.2\",\n \"picocolors\": \"^1.1.1\",\n \"proper-lockfile\": \"^4.1.2\",\n \"yaml\": \"^2.9.0\"\n },\n \"devDependencies\": {\n \"@biomejs/biome\": \"^2.0.0\",\n \"@types/node\": \"^22.10.0\",\n \"@types/proper-lockfile\": \"^4.1.4\",\n \"@vitest/coverage-v8\": \"^4.0.0\",\n \"tsup\": \"^8.3.0\",\n \"typescript\": \"^5.6.0\",\n \"vitest\": \"^4.0.0\"\n },\n \"pnpm\": {\n \"onlyBuiltDependencies\": [\n \"esbuild\"\n ]\n }\n}\n","// Main library entry — re-exports public APIs.\n// phase 1.1 batch 1: skeleton only; schema validator wired in batch 2 (T3+).\n\nimport pkg from '../package.json' with { type: 'json' }\n\nexport const VERSION = pkg.version\n"]}
1
+ {"version":3,"sources":["../package.json","../src/index.ts"],"names":[],"mappings":";AAAA,IAAA,eAAA,GAAA;AAAA,EAEE,OAAA,EAAW,OA8Fb,CAAA;;;AC3FO,IAAM,UAAU,eAAA,CAAI","file":"index.mjs","sourcesContent":["{\n \"name\": \"harnessed\",\n \"version\": \"3.2.0\",\n \"description\": \"AI coding harness package manager + composition orchestrator\",\n \"type\": \"module\",\n \"license\": \"Apache-2.0\",\n \"author\": \"easyinplay\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/easyinplay/harnessed.git\"\n },\n \"homepage\": \"https://github.com/easyinplay/harnessed#readme\",\n \"bugs\": \"https://github.com/easyinplay/harnessed/issues\",\n \"keywords\": [\n \"claude-code\",\n \"ai-harness\",\n \"package-manager\",\n \"composition\",\n \"skill-pack\",\n \"mcp\",\n \"orchestrator\"\n ],\n \"engines\": {\n \"node\": \">=22.0.0\"\n },\n \"packageManager\": \"pnpm@10.12.0\",\n \"bin\": {\n \"harnessed\": \"./dist/cli.mjs\"\n },\n \"main\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.mjs\",\n \"default\": \"./dist/index.mjs\"\n },\n \"./schemas\": {\n \"types\": \"./dist/schemas/index.d.ts\",\n \"import\": \"./dist/schemas/index.mjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"dist\",\n \"manifests\",\n \"workflows\",\n \"routing\",\n \"config-templates\",\n \"schemas\",\n \"README.md\",\n \"LICENSE\",\n \"NOTICE\"\n ],\n \"scripts\": {\n \"dev\": \"tsup --watch\",\n \"build\": \"tsc --noEmit && tsup\",\n \"build:schema\": \"node ./scripts/build-schema.mjs\",\n \"validate:schema\": \"node ./scripts/validate-schema.mjs\",\n \"typecheck\": \"tsc --noEmit\",\n \"test\": \"vitest run --passWithNoTests\",\n \"test:watch\": \"vitest\",\n \"test:coverage\": \"vitest run --coverage --passWithNoTests\",\n \"bench\": \"vitest bench --run\",\n \"lint\": \"biome check .\",\n \"lint:fix\": \"biome check --write .\",\n \"format\": \"biome format --write .\"\n },\n \"dependencies\": {\n \"@anthropic-ai/claude-agent-sdk\": \"0.3.142\",\n \"@clack/prompts\": \"^0.10.1\",\n \"@sinclair/typebox\": \"^0.34.49\",\n \"ajv\": \"^8.20.0\",\n \"ajv-errors\": \"^3.0.0\",\n \"ajv-formats\": \"^3.0.1\",\n \"commander\": \"^13.0.0\",\n \"diff\": \"^9.0.0\",\n \"expr-eval\": \"^2.0.2\",\n \"picocolors\": \"^1.1.1\",\n \"proper-lockfile\": \"^4.1.2\",\n \"yaml\": \"^2.9.0\"\n },\n \"devDependencies\": {\n \"@biomejs/biome\": \"^2.0.0\",\n \"@types/node\": \"^22.10.0\",\n \"@types/proper-lockfile\": \"^4.1.4\",\n \"@vitest/coverage-v8\": \"^4.0.0\",\n \"tsup\": \"^8.3.0\",\n \"typescript\": \"^5.6.0\",\n \"vitest\": \"^4.0.0\"\n },\n \"pnpm\": {\n \"onlyBuiltDependencies\": [\n \"esbuild\"\n ]\n }\n}\n","// Main library entry — re-exports public APIs.\n// phase 1.1 batch 1: skeleton only; schema validator wired in batch 2 (T3+).\n\nimport pkg from '../package.json' with { type: 'json' }\n\nexport const VERSION = pkg.version\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harnessed",
3
- "version": "3.0.3",
3
+ "version": "3.2.0",
4
4
  "description": "AI coding harness package manager + composition orchestrator",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: auto
3
+ description: |
4
+ Super-master orchestrator — 一行命令跑完整 6-stage feature 开发流 (research conditional →
5
+ discuss → plan → task → verify → retro mandatory), 适合 trivial / well-defined feature OR 你
6
+ 想 hands-off。每 stage 内部仍 fan-out sub-workflow per 现有 stage-master orchestrator pattern。
7
+ v3.2.0 强化:Phase 0 AI 1-shot complexity assessment + Phase 0.5 understanding check prompt
8
+ + Phase 5 `/retro` mandatory。
9
+ schema_version: harnessed.workflow.v3 with delegates_to (6 sub: research conditional order 0 +
10
+ 4 stage-master order 1-4 + retro mandatory order 5) + disciplines_applied (6 default)
11
+ + tools_available (agent-teams-create + planning-with-files)。Fail-fast default; opt-in
12
+ `--staged` flag (alias `--pause-between-stages` for backward-compat) 重现 v3.0.x stage gate
13
+ UX。Triggered by slash command `/auto` (bare per ADR 0030 namespace policy D-02 LOCK)
14
+ after `harnessed setup`.
15
+ trigger_phrases:
16
+ - "auto"
17
+ - "自动跑完"
18
+ - "完整流程"
19
+ - "一键开发"
20
+ - "auto chain"
21
+ - "super master"
22
+ ---
23
+
24
+ # auto super-master orchestrator (v3.2.0 enhanced)
25
+
26
+ ## Overview
27
+
28
+ v3.2.0 NEW — 6-stage cadence (research conditional → discuss → plan → task → verify → retro
29
+ mandatory), sister 4 stage-master `/discuss /plan /task /verify` 独立 invoke 仍 work;
30
+ `/auto` 是 opt-in 一行命令 chain。
31
+
32
+ | order | sub | gate ref | mode | when fires |
33
+ | ----- | --- | -------- | ---- | ---------- |
34
+ | 0 | `research` | `judgments.stage-routing.auto-research-unclear.fires` | serial | user_understanding_unclear == true (Phase 0.5 prompt n) |
35
+ | 1 | `discuss` | (unconditional — 4-stage chain 起点) | serial | always |
36
+ | 2 | `plan` | (unconditional — stage 2) | serial | always |
37
+ | 3 | `task` | (unconditional — stage 3) | serial | always |
38
+ | 4 | `verify` | (unconditional — stage 4 收尾) | serial | always |
39
+ | 5 | `retro` | (unconditional — auto mode mandatory) | serial | always |
40
+
41
+ Engine runtime spawns 6 sub workflow.yaml via `runMasterOrchestrator` per
42
+ T3.5.W0.1 — recursive 一层抽象 (super-master → stage-master OR standalone → sub-workflow):
43
+
44
+ - top-level invoke `/auto` → load `workflows/auto/workflow.yaml` → runAutoPreFlight hook
45
+ - pre-flight Phase 0: `assessComplexity(taskDescription)` → small/medium auto continue;
46
+ large → prompt user 切 `--staged` (y) OR abort 建议手动 (n)
47
+ - pre-flight Phase 0.5: `promptUserUnderstanding()` → y skip research; n set
48
+ `user_understanding_unclear = true` 进 ctx → research gate fires
49
+ - spawn order 0: `workflows/research/workflow.yaml` (if gate fires)
50
+ - spawn order 1-4: 4 stage-master `workflows/<sub>/auto/workflow.yaml`
51
+ - spawn order 5: `workflows/retro/workflow.yaml` (mandatory unconditional)
52
+
53
+ K8 ctx single snapshot:auto top-level invoke 1 snapshot, pass to all 6 spawn
54
+ (sister Phase 3.5 W0.1 pattern verbatim, 1 snapshot per top-level invoke 跨整个 cycle)。
55
+
56
+ ## Default behavior
57
+
58
+ - **Pre-flight gates**: complexity assessment + understanding check (interactive prompts)
59
+ - **Continuous chain**: 6 stage 一行命令跑完, 中间不停
60
+ - **Fail-fast**: 任一 stage fail 立即停, `harnessed resume` 续
61
+ - **Context 自动传递**: planning-with-files `.planning/<phase>/` 喂下 stage
62
+ - **Retro mandatory**: auto mode hands-off scenario,末尾强制 `/retro` 总结 (无 opt-out flag)
63
+ - **沿用 sister planning-with-files /plan 持久化 cadence**
64
+
65
+ ## Optional flag
66
+
67
+ - `--staged` opt-in (primary, 8 字符 ergonomic): 每 stage-master 跑完停, 等用户 review/confirm
68
+ 后跑下 stage (重现 v3.0.x stage gate UX)
69
+ - `--pause-between-stages` alias (backward-compat sister v3.1.0 — 仍 work for 旧脚本不破)
70
+
71
+ ## When to use `/auto` vs 4 stage-master 手动
72
+
73
+ ✅ **触发 `/auto`**:
74
+ - Trivial / well-defined feature (e.g. CRUD endpoint + standard pattern)
75
+ - Hands-off use case (你想"跑完再回来看")
76
+ - 跨 stage decision 都明显 (无 open question)
77
+ - AI 自动判断需求复杂度 small/medium → 直接 continue;large → 自动建议 `--staged`
78
+
79
+ ❌ **跳过 `/auto` → 分阶段手动 `/discuss` → `/plan` → `/task` → `/verify`**:
80
+ - 关键发布 / 大重构 (需 stage gate review)
81
+ - 跨 stage 有 open implementation decisions
82
+ - 你想 stage 之间 hands-on review
83
+ - 不确定整体方向 (此时手动 `/discuss` 强 grill)
84
+ - AI complexity gate 判定 large 且 user 不切 `--staged` → 建议 abort 手动
85
+
86
+ ## Capability refs
87
+
88
+ Sister `workflows/capabilities.yaml`:
89
+ - `agent-teams-create` — Bucket 5 agent-platform (multispec Pattern C 4-specialist team
90
+ in verify stage if critical-release-upgrade gate fires)
91
+ - `planning-with-files` — Bucket 4 核心 capability (持久化 task_plan.md + progress.md
92
+ 跨 6 stage 自动 context 传递)
93
+ - Downstream sub refs:
94
+ - sub `research` upstream → `workflows/research/workflow.yaml` (standalone)
95
+ - sub `discuss` upstream → `workflows/discuss/auto/workflow.yaml` (stage-master)
96
+ - sub `plan` upstream → `workflows/plan/auto/workflow.yaml` (stage-master)
97
+ - sub `task` upstream → `workflows/task/auto/workflow.yaml` (stage-master)
98
+ - sub `verify` upstream → `workflows/verify/auto/workflow.yaml` (stage-master)
99
+ - sub `retro` upstream → `workflows/retro/workflow.yaml` (standalone)
100
+
101
+ ## Invocation
102
+
103
+ - Slash command: `/auto <feature description>` (bare per ADR 0030 namespace policy D-02 LOCK
104
+ after `harnessed setup`)
105
+ - 4 stage-master `/discuss /plan /task /verify` 仍可独立 invoke — `/auto` 是 opt-in NEW workflow
106
+ - `--staged` (primary) or `--pause-between-stages` (alias) opt-in for stage gate UX
107
+
108
+ ## References
109
+
110
+ - D-01 master orchestrator delegation pattern
111
+ - D-02 bare slash cmd convention (ADR 0030 namespace policy LOCK)
112
+ - D-13 declarative SoT (delegates_to[] 声明 + engine consume)
113
+ - workflows/{research,retro}/workflow.yaml — 2 standalone (research conditional + retro mandatory)
114
+ - workflows/{discuss,plan,task,verify}/auto/workflow.yaml — 4 stage-master Phase 3.5 SHIPPED
115
+ - workflows/judgments/stage-routing.yaml — auto-research-unclear trigger (v3.2.0 NEW)
116
+ - src/workflow/masterOrchestrator.ts — 'auto' literal + recursive spawn + runAutoPreFlight hook
117
+ - CHANGELOG [3.2.0] — complexity gate + research/retro flow + `--staged` rename
@@ -0,0 +1,61 @@
1
+ # workflows/auto/workflow.yaml — v3.2.0 enhanced super-master orchestrator
2
+ #
3
+ # Top-level standalone (sister workflows/research/ + workflows/retro/ layout) —
4
+ # 6-stage chain (research conditional → discuss → plan → task → verify → retro
5
+ # mandatory) one-shot auto orchestrate。
6
+ #
7
+ # v3.2.0 delta (sister v3.1.0 ship):
8
+ # ADD research order 0 (gate auto-research-unclear — fires when user_understanding_unclear)
9
+ # ADD retro order 5 (unconditional — mandatory in auto mode per CLAUDE.md hands-off scenario)
10
+ # NOTE complexity gate + understanding check 是 runtime pre-flight hook (NOT yaml decl)
11
+ # sister masterOrchestrator.ts runAutoPreFlight invoke
12
+ #
13
+ # Sister refs:
14
+ # - workflows/discuss/auto/workflow.yaml (stage-master sister fan-out delegates_to pattern)
15
+ # - workflows/research/workflow.yaml + workflows/retro/workflow.yaml (top-level standalone sister)
16
+ # - workflows/judgments/stage-routing.yaml auto-research-unclear trigger (v3.2.0 NEW)
17
+ # - src/workflow/masterOrchestrator.ts ('auto' literal + recursive spawn + runAutoPreFlight hook)
18
+ # - src/workflow/schema/workflow.ts WorkflowSchemaV3 + DelegationClause (Phase 3.3 W0.5 SHIPPED)
19
+ #
20
+ # Super-master invariant (per WorkflowSchemaV3 runtime + check-workflow-schema.mjs K9):
21
+ # - phases 缺省 (master only has delegates_to[])
22
+ # - 6 delegates_to mode serial — 必带 explicit order (K9 invariant T3.3.W0.10)
23
+ # - delegates_to[].sub ∈ {research, discuss, plan, task, verify, retro}
24
+ # (research + retro are top-level standalone; discuss/plan/task/verify are 4 stage-master)
25
+ # - K8 ctx single snapshot: top-level invoke 1 snapshot, pass to all 6 spawn
26
+
27
+ schema_version: harnessed.workflow.v3
28
+ workflow: auto
29
+ description: |
30
+ Super-master orchestrator (v3.2.0 enhanced) — 自动 chain 6 stage (research conditional →
31
+ discuss → plan → task → verify → retro mandatory)。一行命令跑完整 feature 开发流, 适合 trivial
32
+ / well-defined feature OR hands-off use case; 关键 PR / 大重构推荐分阶段手动 (`/discuss` →
33
+ `/plan` → `/task` → `/verify`)。AI 自动判断需求复杂度,大需求建议切 `--staged` 模式 (每 stage
34
+ 完停 review)。Fail-fast default:任一 stage fail 立即停, `harnessed resume` 续。Opt-in
35
+ `--staged` flag (alias `--pause-between-stages`) 重现 v3.0.x stage gate UX。
36
+
37
+ disciplines_applied: [karpathy, output-style, language, operational, priority, protocols]
38
+ tools_available:
39
+ - agent-teams-create
40
+ - planning-with-files
41
+
42
+ delegates_to:
43
+ - sub: research
44
+ mode: serial
45
+ order: 0
46
+ gate: judgments.stage-routing.auto-research-unclear.fires
47
+ - sub: discuss
48
+ mode: serial
49
+ order: 1
50
+ - sub: plan
51
+ mode: serial
52
+ order: 2
53
+ - sub: task
54
+ mode: serial
55
+ order: 3
56
+ - sub: verify
57
+ mode: serial
58
+ order: 4
59
+ - sub: retro
60
+ mode: serial
61
+ order: 5
@@ -91,3 +91,14 @@ triggers:
91
91
  fires_when: "phase.stage == 'verify' and phase.is_final_step == true"
92
92
  invokes:
93
93
  - capability: code-simplifier
94
+
95
+ # v3.2.0 NEW — /auto super-master Phase 0.5 understanding check gate
96
+ auto-research-unclear:
97
+ description: |
98
+ /auto super-master → /research conditional spawn 当 user_understanding_unclear == true
99
+ (Phase 0.5 understanding check prompt n → ctx fact set)。sister CLAUDE.md research routing。
100
+ fires_when: "user_understanding_unclear == true"
101
+ invokes:
102
+ - capability: tavily-mcp
103
+ - capability: exa-mcp
104
+ - capability: ctx7