harnessed 4.37.0 → 4.38.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/bin/harnessed-inject-state.mjs +22 -2
- package/dist/cli.mjs +175 -7
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/manifests/optional/perturn-inject-invalidate.yaml +57 -0
- package/package.json +1 -1
- package/workflows/verify/auto/SKILL.md +11 -0
- package/workflows/verify/auto/SKILL.zh-Hans.md +11 -0
package/dist/index.mjs
CHANGED
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json","../src/index.ts"],"names":[],"mappings":";AAAA,IAAA,eAAA,GAAA;AAAA,EAEE,OAAA,EAAW,QAqGb,CAAA;;;AClGO,IAAM,UAAU,eAAA,CAAI","file":"index.mjs","sourcesContent":["{\n \"name\": \"harnessed\",\n \"version\": \"4.
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/index.ts"],"names":[],"mappings":";AAAA,IAAA,eAAA,GAAA;AAAA,EAEE,OAAA,EAAW,QAqGb,CAAA;;;AClGO,IAAM,UAAU,eAAA,CAAI","file":"index.mjs","sourcesContent":["{\n \"name\": \"harnessed\",\n \"version\": \"4.38.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 \"harnessed-inject-state\": \"./bin/harnessed-inject-state.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 \"bin\",\n \"manifests\",\n \"messages\",\n \"workflows\",\n \"routing\",\n \"config-templates\",\n \"schemas\",\n \"README.md\",\n \"LICENSE\",\n \"NOTICE\",\n \"THIRD-PARTY-NOTICES.md\"\n ],\n \"scripts\": {\n \"dev\": \"tsup --watch\",\n \"build\": \"tsc --noEmit && tsup && node ./scripts/build-hooks.mjs\",\n \"build:hooks\": \"node ./scripts/build-hooks.mjs\",\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 \"build:binary\": \"bun scripts/build-binary.mjs\"\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 \"esbuild\": \"0.27.7\",\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"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# yaml-language-server: $schema=../../schemas/manifest.v1.schema.json
|
|
2
|
+
# 4.38.0 — the compaction half of per-turn injection. PAIRS WITH `perturn-inject`;
|
|
3
|
+
# installing it alone does nothing (there is no delta cache to drop), and
|
|
4
|
+
# installing perturn-inject alone silently falls back to the 4.25.0 behaviour —
|
|
5
|
+
# a blind HARNESSED_INJECT_REFRESH_TURNS timer (default 10).
|
|
6
|
+
#
|
|
7
|
+
# Why it exists: the per-turn hook skips re-emitting <project-context> while the
|
|
8
|
+
# block's hash is unchanged, because the copy already sits in the conversation.
|
|
9
|
+
# Compaction removes that copy without touching the cache, so the skip keeps
|
|
10
|
+
# firing on behalf of content that is gone — up to REFRESH_TURNS-1 turns blind.
|
|
11
|
+
# injectCache.ts (4.25.0) named the timer "a stateless alternative to a PreCompact
|
|
12
|
+
# hook we do not install"; this manifest installs the real signal instead.
|
|
13
|
+
#
|
|
14
|
+
# SessionStart carries every context discontinuity: `compact` compresses the
|
|
15
|
+
# earlier copy away, `clear` wipes it, `resume` rebuilds from the record. No
|
|
16
|
+
# hook_matcher — `startup` is already a no-op (a new session id is a new cache
|
|
17
|
+
# key) and an unfiltered entry is one less thing to keep in sync with CC's source
|
|
18
|
+
# vocabulary. Same bin as perturn-inject, one flag apart; silent, always exit 0.
|
|
19
|
+
apiVersion: harnessed/v1
|
|
20
|
+
kind: Manifest
|
|
21
|
+
metadata:
|
|
22
|
+
name: perturn-inject-invalidate
|
|
23
|
+
display_name: Per-Turn Injection Cache Invalidation (SessionStart)
|
|
24
|
+
description: Opt-in SessionStart hook dropping the per-turn delta cache after compact/clear/resume so the next turn re-injects in full. Pairs with perturn-inject.
|
|
25
|
+
upstream:
|
|
26
|
+
source: perturn-inject-invalidate
|
|
27
|
+
homepage: https://github.com/easyinplay/harnessed
|
|
28
|
+
repository: https://github.com/easyinplay/harnessed.git
|
|
29
|
+
license: MIT
|
|
30
|
+
notice: First-party harnessed hook (4.38.0).
|
|
31
|
+
spec:
|
|
32
|
+
type: cc-hook
|
|
33
|
+
component_type: command
|
|
34
|
+
category: meta
|
|
35
|
+
install_type: hook
|
|
36
|
+
install:
|
|
37
|
+
method: cc-hook-add
|
|
38
|
+
cmd: "node bin/harnessed-inject-state.mjs --invalidate"
|
|
39
|
+
hook_event: SessionStart
|
|
40
|
+
hook_command: "node bin/harnessed-inject-state.mjs --invalidate"
|
|
41
|
+
idempotent_check: "grep -q 'harnessed-inject-state.mjs --invalidate' ~/.claude/settings.json"
|
|
42
|
+
verify:
|
|
43
|
+
cmd: "grep -q 'harnessed-inject-state.mjs --invalidate' ~/.claude/settings.json"
|
|
44
|
+
timeout_ms: 5000
|
|
45
|
+
expected_exit_code: 0
|
|
46
|
+
uninstall:
|
|
47
|
+
cmd: "true"
|
|
48
|
+
upstream_health:
|
|
49
|
+
stability: beta
|
|
50
|
+
last_check: "2026-08-26"
|
|
51
|
+
last_known_good_version: "0.1.0"
|
|
52
|
+
fallback_action: warn
|
|
53
|
+
signed_by: easyinplay
|
|
54
|
+
platforms:
|
|
55
|
+
- linux
|
|
56
|
+
- darwin
|
|
57
|
+
- win32
|
package/package.json
CHANGED
|
@@ -51,6 +51,17 @@ Engine runtime per T3.5.W0.1 `runMasterOrchestrator`:
|
|
|
51
51
|
- **关键发布 / 大重构 PR** 升级 4-specialist Agent Team Pattern C (sub multispec, gate critical-release-upgrade)
|
|
52
52
|
- 再 `code-simplifier` 末尾 (sub simplify, serial order 99)
|
|
53
53
|
|
|
54
|
+
## When verification fails
|
|
55
|
+
|
|
56
|
+
A rejected verification is a machine transition, not a note to yourself.
|
|
57
|
+
|
|
58
|
+
`harnessed checkpoint reopen <sub> --reason "<what is wrong>"` sends the offending sub back to `pending` and records why. Run it once per sub that must be redone, then re-enter the execute chain — the per-turn `<workflow-state>` breadcrumb lists the sub as `next` again and carries a `REOPENED:` line with the reason.
|
|
59
|
+
|
|
60
|
+
- **It counts as an attempt.** Bouncing the same sub repeatedly reaches the same `BUDGET-EXHAUSTED` / `BREAK-LOOP` directives a repeatedly failing sub does. When either fires, stop reopening and escalate.
|
|
61
|
+
- **Not `harnessed reject <sub>`** — that is a terminal decline (this sub is not being done at all) and deliberately does not count attempts.
|
|
62
|
+
- **Not `checkpoint fail`** — `fail` records that an attempt ended badly and stops; `reopen` says the work must be done again.
|
|
63
|
+
- A workflow already at `complete` is flipped back to `active`, so a late verification cannot leave a "complete" workflow holding pending work.
|
|
64
|
+
|
|
54
65
|
## Capability refs
|
|
55
66
|
|
|
56
67
|
Sister `workflows/capabilities.yaml`:
|
|
@@ -51,6 +51,17 @@ via stage-routing.yaml):
|
|
|
51
51
|
- **关键发布 / 大重构 PR** 升级 4-specialist Agent Team Pattern C(sub multispec,关卡 critical-release-upgrade)
|
|
52
52
|
- 再 `code-simplifier` 末尾(sub simplify,serial order 99)
|
|
53
53
|
|
|
54
|
+
## 验证判否之后
|
|
55
|
+
|
|
56
|
+
判否是一次状态机转移,不是写给自己的备注。
|
|
57
|
+
|
|
58
|
+
`harnessed checkpoint reopen <sub> --reason "<哪里不对>"` 把出问题的 sub 打回 `pending` 并记下原因。每个需要返工的 sub 跑一次,然后重新进入 execute 链 —— 每轮的 `<workflow-state>` 断点会重新把它列为 `next`,并带一行 `REOPENED:` 说明原因。
|
|
59
|
+
|
|
60
|
+
- **它计入 attempt。** 反复打回同一个 sub 会撞上与反复失败同样的 `BUDGET-EXHAUSTED` / `BREAK-LOOP` 指令。任一触发即停止打回,上报。
|
|
61
|
+
- **不是 `harnessed reject <sub>`** —— 那是终态放弃(这个 sub 根本不做了),并且刻意不计 attempt。
|
|
62
|
+
- **不是 `checkpoint fail`** —— `fail` 记录的是这次尝试收场不好、就此停下;`reopen` 说的是这活儿得重做。
|
|
63
|
+
- 已经处于 `complete` 的 workflow 会被翻回 `active`,迟到的验证不会留下一个「已完成」却挂着未决工作的 workflow。
|
|
64
|
+
|
|
54
65
|
## 能力引用
|
|
55
66
|
|
|
56
67
|
Sister `workflows/capabilities.yaml`:
|