harnessed 5.0.5 → 5.0.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.
- package/CHANGELOG.md +3183 -0
- package/README-en.md +10 -1
- package/README-zh.md +10 -1
- package/README.md +10 -1
- package/bin/harnessed-check-docs.mjs +1 -0
- package/bin/harnessed-inject-state.mjs +57 -9
- package/bin/harnessed-stop-hook.mjs +51 -9
- package/bin/harnessed-update-reminder-worker.mjs +3 -1
- package/bin/harnessed-update-reminder.mjs +3 -1
- package/dist/cli.mjs +1952 -432
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/manifests/optional/codegraph.yaml +2 -0
- package/manifests/skill-packs/gsd.yaml +5 -3
- package/manifests/skill-packs/mattpocock-skills.yaml +3 -3
- package/manifests/tools/playwright-cli.yaml +4 -0
- package/messages/en.json +1 -0
- package/messages/zh-Hans.json +3 -2
- package/package.json +3 -1
- package/workflows/auto/SKILL.md +1 -1
- package/workflows/auto/SKILL.zh-Hans.md +1 -1
- package/workflows/defaults.yaml +12 -0
- package/workflows/discuss/phase/SKILL.md +1 -1
- package/workflows/discuss/phase/SKILL.zh-Hans.md +1 -1
- package/workflows/discuss/subtask/SKILL.md +1 -1
- package/workflows/discuss/subtask/SKILL.zh-Hans.md +1 -1
- package/workflows/plan/ai-integration/SKILL.md +39 -0
- package/workflows/plan/ai-integration/SKILL.zh-Hans.md +38 -0
- package/workflows/plan/ai-integration/workflow.yaml +12 -0
- package/workflows/plan/auto/workflow.yaml +22 -2
- package/workflows/plan/phase/SKILL.md +2 -2
- package/workflows/plan/phase/SKILL.zh-Hans.md +2 -2
- package/workflows/plan/secure/SKILL.md +39 -0
- package/workflows/plan/secure/SKILL.zh-Hans.md +38 -0
- package/workflows/plan/secure/workflow.yaml +12 -0
- package/workflows/plan/spec/SKILL.md +39 -0
- package/workflows/plan/spec/SKILL.zh-Hans.md +38 -0
- package/workflows/plan/spec/workflow.yaml +12 -0
- package/workflows/plan/ui/SKILL.md +39 -0
- package/workflows/plan/ui/SKILL.zh-Hans.md +38 -0
- package/workflows/plan/ui/workflow.yaml +12 -0
- package/workflows/role-prompts.yaml +36 -6
- package/workflows/role-prompts.zh-Hans.yaml +36 -6
- package/workflows/ship/auto/SKILL.md +2 -1
- package/workflows/ship/auto/SKILL.zh-Hans.md +2 -1
- package/workflows/task/clarify/SKILL.md +2 -2
- package/workflows/task/clarify/SKILL.zh-Hans.md +2 -2
- package/workflows/task/code/SKILL.md +1 -1
- package/workflows/task/code/SKILL.zh-Hans.md +1 -1
- package/workflows/task/deliver/SKILL.md +1 -1
- package/workflows/task/deliver/SKILL.zh-Hans.md +1 -1
- package/workflows/task/test/SKILL.md +1 -1
- package/workflows/task/test/SKILL.zh-Hans.md +1 -1
- package/workflows/verify/auto/SKILL.md +1 -1
- package/workflows/verify/auto/SKILL.zh-Hans.md +1 -1
- package/workflows/verify/design/SKILL.md +1 -1
- package/workflows/verify/design/SKILL.zh-Hans.md +1 -1
- package/workflows/verify/progress/SKILL.md +1 -1
- package/workflows/verify/progress/SKILL.zh-Hans.md +1 -1
package/README-en.md
CHANGED
|
@@ -529,7 +529,7 @@ planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/
|
|
|
529
529
|
| `harnessed status` | Current phase + lock holder |
|
|
530
530
|
| `harnessed doctor` | Health check (Node / MCP / jq / Win bash / routing / token budget / skill integrity / GateGuard conflict / update-available / stale hooks, etc.). The **stale hooks** check flags orphaned harnessed `Stop`/`UserPromptSubmit` entries in `~/.claude/settings.json` that point at a deleted `bin/*.mjs` — the cause of a `MODULE_NOT_FOUND` error on every prompt after a raw `npm uninstall -g harnessed`. Fix: run `harnessed uninstall` (it strips them) **before** removing the package. |
|
|
531
531
|
| `harnessed update [--check\|--dry-run\|--rollback [version]\|--all\|--upstreams\|--migration-report] [--json] [--platform <host>] [--non-interactive] [--repair --yes]` | Self-update, channel-aware: binary installs replace themselves in place from GitHub releases (sha256 + ed25519-signature verified — releases ship `<asset>.sha256.sig`, signed-release contract since 4.32.19; the replaced version is banked for rollback); npm installs run `npm i -g harnessed@latest`. `--check` reports versions without installing; `--dry-run` previews without writing; `--rollback [version]` (binary installs only) atomically restores a banked previous binary — npm installs are pointed at `npm i -g harnessed@<version>`; `--all` (alias `--upstreams`) requests fresh-runtime closure, including owned assets and reviewed third-party updates; `--json` emits one structured result; `--platform <host>` selects `claude` or `codex`; `--non-interactive` skips prompts, and repair automation additionally requires explicit `--repair --yes`; `--repair --yes` invokes a bounded, user-authorized agent repair and then deterministic verification; `--migration-report` is a read-only stale-state inventory |
|
|
532
|
-
| `harnessed release-preflight` | Read-only release-readiness gate (CHANGELOG `[Unreleased]` / version / git-clean / tag-absent); exits 1 if not ready. The Ship-stage gate. |
|
|
532
|
+
| `harnessed release-preflight [--release-version <semver>]` | Read-only release-readiness gate (CHANGELOG `[Unreleased]` / version / git-clean / tag-absent); `--release-version` overrides manifest discovery; exits 1 if not ready. The Ship-stage gate. |
|
|
533
533
|
| `harnessed retro --done` | Reset the retro-reminder phase counter after running `/retro` (clears the per-turn RETRO-DUE nudge). |
|
|
534
534
|
| `harnessed install <name>` | Install an upstream manifest |
|
|
535
535
|
| `harnessed uninstall [name]` | Reverse uninstall — runs the manifest's declared `spec.uninstall` teardown (cmd + `$HOME`-confined, idempotent `cleanup_paths`) for the skill-installing methods (`npm-cli` / `git-clone-with-setup` / `npx-skill-installer`); other methods keep their per-method reverse |
|
|
@@ -537,6 +537,15 @@ planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/
|
|
|
537
537
|
| `harnessed rollback <timestamp>` | One-line rollback of a **backup snapshot** (EOL preserve + sha1 verify) — distinct from `update --rollback`, which restores a previous **compiled binary** |
|
|
538
538
|
| `harnessed gc` | Clean up expired backups |
|
|
539
539
|
| `harnessed audit-log` | Routing transparency log query (supports `--filter` jq expression) |
|
|
540
|
+
| `harnessed agents-md` | Write or update the marker-delimited harnessed block in `<CODEX_HOME>/AGENTS.md` without changing surrounding prose |
|
|
541
|
+
| `harnessed audit` | Audit manifest and runtime self-consistency (`--skip-runtime` checks the manifest only) |
|
|
542
|
+
| `harnessed check-docs` | Check `.planning/` documentation discipline and return a non-zero exit for advisory or blocking findings |
|
|
543
|
+
| `harnessed eval` | Run the deterministic orchestrator-behavior regression suite; `harnessed eval record` captures a replayable scenario |
|
|
544
|
+
| `harnessed exempt-gateguard` | Persist the `.planning/**` GateGuard exemption that resolves the dual-guard conflict |
|
|
545
|
+
| `harnessed facts <master>` | Emit deterministic and unresolved gate facts for `harnessed gates --context-file` |
|
|
546
|
+
| `harnessed install-base [--dry-run]` | Install the phase 1.3 base profile; `--dry-run` previews without writing |
|
|
547
|
+
| `harnessed manifest-add <upstream>` | Add an upstream adapter through the EE-5 merge gate |
|
|
548
|
+
| `harnessed research --query <text>` | Run the headless research workflow; `--dry-run` previews without spawning |
|
|
540
549
|
|
|
541
550
|
**Fresh-runtime closure (Phase 78):** `harnessed update --all --json` first performs self-update, then hands off to a verified fresh runtime through an absolute executable/package entry path. Only that runtime refreshes harnessed-owned workflow/hook assets and updates already-installed third-party components through reviewed adapters for the selected host. Self-update failure prevents third-party mutation; handoff failure reports incomplete closure even if harnessed itself changed. GSD is the first reviewed adapter, with runtime identity/version verification before and after its upstream-owned update action. Components without a reviewed adapter report `unsupported`; missing third-party components remain `not-installed` and are not installed.
|
|
542
551
|
|
package/README-zh.md
CHANGED
|
@@ -525,7 +525,7 @@ planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/
|
|
|
525
525
|
| `harnessed status` | 当前 phase + lock holder |
|
|
526
526
|
| `harnessed doctor` | 健康检查 (Node / MCP / jq / Win bash / routing / token budget / skill 完整性 / GateGuard 冲突 / update-available 等) |
|
|
527
527
|
| `harnessed update [--check\|--dry-run\|--rollback [version]\|--all\|--upstreams\|--migration-report] [--json] [--platform <host>] [--non-interactive] [--repair --yes]` | 自更新,按安装通道分流:二进制安装从 GitHub releases 原地自替换(sha256 + ed25519 签名双重校验 —— releases 附带 `<asset>.sha256.sig`,4.32.19 起为签名发布契约;被替换的版本存档备回滚);npm 安装执行 `npm i -g harnessed@latest`。`--check` 报告版本但不安装;`--dry-run` 预览不写盘;`--rollback [version]`(仅二进制安装)原子恢复已存档的上一版二进制 —— npm 安装则被指引执行 `npm i -g harnessed@<version>`;`--all`(别名 `--upstreams`)请求 fresh-runtime closure,包含自有 assets 和 reviewed 第三方更新;`--json` 输出单个结构化结果;`--platform <host>` 选择 `claude` 或 `codex`;`--non-interactive` 跳过 prompt,而 repair 自动化还必须显式使用 `--repair --yes`;`--repair --yes` 启动有边界且经过用户授权的 agent repair,随后执行确定性验证;`--migration-report` 为只读陈旧状态盘点 |
|
|
528
|
-
| `harnessed release-preflight` | Read-only 发布就绪关卡 (CHANGELOG `[Unreleased]` / version / git-clean / tag-absent)
|
|
528
|
+
| `harnessed release-preflight [--release-version <semver>]` | Read-only 发布就绪关卡 (CHANGELOG `[Unreleased]` / version / git-clean / tag-absent);`--release-version` 可覆盖 manifest 自动发现;未就绪则 exit 1。即 Ship-stage 关卡 |
|
|
529
529
|
| `harnessed retro --done` | 跑完 `/retro` 后重置 retro-reminder phase 计数器 (清掉每轮的 RETRO-DUE 提醒) |
|
|
530
530
|
| `harnessed install <name>` | 装上游 manifest |
|
|
531
531
|
| `harnessed uninstall [name]` | 反向卸载 —— 对装 skill 的方法 (`npm-cli` / `git-clone-with-setup` / `npx-skill-installer`) 执行 manifest 声明的 `spec.uninstall` teardown (cmd + 限定 `$HOME` 内、幂等 `cleanup_paths`);其余方法沿用各自的 per-method 反向逻辑 |
|
|
@@ -533,6 +533,15 @@ planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/
|
|
|
533
533
|
| `harnessed rollback <timestamp>` | 一行回滚**备份快照** (EOL preserve + sha1 verify) —— 区别于 `update --rollback`:后者恢复的是上一版**编译二进制** |
|
|
534
534
|
| `harnessed gc` | 清理过期 backup |
|
|
535
535
|
| `harnessed audit-log` | 路由透明日志 query (支持 `--filter` jq 表达式) |
|
|
536
|
+
| `harnessed agents-md` | 写入或更新 `<CODEX_HOME>/AGENTS.md` 中带 marker 的 harnessed 区块,不改动区块外内容 |
|
|
537
|
+
| `harnessed audit` | 审计 manifest 与 runtime 的自洽性 (`--skip-runtime` 仅检查 manifest) |
|
|
538
|
+
| `harnessed check-docs` | 检查 `.planning/` 文档纪律,发现 advisory 或 blocking 问题时返回非零 exit code |
|
|
539
|
+
| `harnessed eval` | 运行确定性的编排行为回归套件;`harnessed eval record` 可记录可重放场景 |
|
|
540
|
+
| `harnessed exempt-gateguard` | 持久化 `.planning/**` GateGuard 豁免,解决双 guard 冲突 |
|
|
541
|
+
| `harnessed facts <master>` | 输出供 `harnessed gates --context-file` 使用的确定性与待判断 gate facts |
|
|
542
|
+
| `harnessed install-base [--dry-run]` | 安装 phase 1.3 base profile;`--dry-run` 仅预览不写入 |
|
|
543
|
+
| `harnessed manifest-add <upstream>` | 通过 EE-5 merge gate 新增 upstream adapter |
|
|
544
|
+
| `harnessed research --query <text>` | 运行 headless research workflow;`--dry-run` 仅预览不 spawn |
|
|
536
545
|
|
|
537
546
|
**Fresh-runtime closure (Phase 78):** `harnessed update --all --json` 先自更新,再通过可执行文件/package entry 的绝对路径交接到经过验证的 fresh runtime。仅该 runtime 刷新 harnessed-owned workflow/hook assets,并通过 reviewed adapter 更新所选宿主中已安装的第三方组件。自更新失败时不修改第三方组件;handoff 失败时,即使 harnessed 自身已变化也会报告 closure 未完成。GSD 是首个 reviewed adapter,在其 upstream-owned 更新操作前后验证 runtime identity/version。没有 reviewed adapter 的组件报告 `unsupported`;缺失的第三方组件保持 `not-installed`,不会被安装。
|
|
538
547
|
|
package/README.md
CHANGED
|
@@ -527,7 +527,7 @@ planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/
|
|
|
527
527
|
| `harnessed status` | Current phase + lock holder |
|
|
528
528
|
| `harnessed doctor` | Health check (Node / MCP / jq / Win bash / routing / token budget / skill integrity / GateGuard conflict / update-available / stale hooks, etc.). The **stale hooks** check flags orphaned harnessed `Stop`/`UserPromptSubmit` entries in `~/.claude/settings.json` that point at a deleted `bin/*.mjs` — the cause of a `MODULE_NOT_FOUND` error on every prompt after a raw `npm uninstall -g harnessed`. Fix: run `harnessed uninstall` (it strips them) **before** removing the package. |
|
|
529
529
|
| `harnessed update [--check\|--dry-run\|--rollback [version]\|--all\|--upstreams\|--migration-report] [--json] [--platform <host>] [--non-interactive] [--repair --yes]` | Self-update, channel-aware: binary installs replace themselves in place from GitHub releases (sha256 + ed25519-signature verified — releases ship `<asset>.sha256.sig`, signed-release contract since 4.32.19; the replaced version is banked for rollback); npm installs run `npm i -g harnessed@latest`. `--check` reports versions without installing; `--dry-run` previews without writing; `--rollback [version]` (binary installs only) atomically restores a banked previous binary — npm installs are pointed at `npm i -g harnessed@<version>`; `--all` (alias `--upstreams`) requests fresh-runtime closure, including owned assets and reviewed third-party updates; `--json` emits one structured result; `--platform <host>` selects `claude` or `codex`; `--non-interactive` skips prompts, and repair automation additionally requires explicit `--repair --yes`; `--repair --yes` invokes a bounded, user-authorized agent repair and then deterministic verification; `--migration-report` is a read-only stale-state inventory |
|
|
530
|
-
| `harnessed release-preflight` | Read-only release-readiness gate (CHANGELOG `[Unreleased]` / version / git-clean / tag-absent); exits 1 if not ready. The Ship-stage gate. |
|
|
530
|
+
| `harnessed release-preflight [--release-version <semver>]` | Read-only release-readiness gate (CHANGELOG `[Unreleased]` / version / git-clean / tag-absent); `--release-version` overrides manifest discovery; exits 1 if not ready. The Ship-stage gate. |
|
|
531
531
|
| `harnessed retro --done` | Reset the retro-reminder phase counter after running `/retro` (clears the per-turn RETRO-DUE nudge). |
|
|
532
532
|
| `harnessed install <name>` | Install an upstream manifest |
|
|
533
533
|
| `harnessed uninstall [name]` | Reverse uninstall — runs the manifest's declared `spec.uninstall` teardown (cmd + `$HOME`-confined, idempotent `cleanup_paths`) for the skill-installing methods (`npm-cli` / `git-clone-with-setup` / `npx-skill-installer`); other methods keep their per-method reverse |
|
|
@@ -535,6 +535,15 @@ planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/
|
|
|
535
535
|
| `harnessed rollback <timestamp>` | One-line rollback of a **backup snapshot** (EOL preserve + sha1 verify) — distinct from `update --rollback`, which restores a previous **compiled binary** |
|
|
536
536
|
| `harnessed gc` | Clean up expired backups |
|
|
537
537
|
| `harnessed audit-log` | Routing transparency log query (supports `--filter` jq expression) |
|
|
538
|
+
| `harnessed agents-md` | Write or update the marker-delimited harnessed block in `<CODEX_HOME>/AGENTS.md` without changing surrounding prose |
|
|
539
|
+
| `harnessed audit` | Audit manifest and runtime self-consistency (`--skip-runtime` checks the manifest only) |
|
|
540
|
+
| `harnessed check-docs` | Check `.planning/` documentation discipline and return a non-zero exit for advisory or blocking findings |
|
|
541
|
+
| `harnessed eval` | Run the deterministic orchestrator-behavior regression suite; `harnessed eval record` captures a replayable scenario |
|
|
542
|
+
| `harnessed exempt-gateguard` | Persist the `.planning/**` GateGuard exemption that resolves the dual-guard conflict |
|
|
543
|
+
| `harnessed facts <master>` | Emit deterministic and unresolved gate facts for `harnessed gates --context-file` |
|
|
544
|
+
| `harnessed install-base [--dry-run]` | Install the phase 1.3 base profile; `--dry-run` previews without writing |
|
|
545
|
+
| `harnessed manifest-add <upstream>` | Add an upstream adapter through the EE-5 merge gate |
|
|
546
|
+
| `harnessed research --query <text>` | Run the headless research workflow; `--dry-run` previews without spawning |
|
|
538
547
|
|
|
539
548
|
**Fresh-runtime closure (Phase 78):** `harnessed update --all --json` first performs self-update, then hands off to a verified fresh runtime through an absolute executable/package entry path. Only that runtime refreshes harnessed-owned workflow/hook assets and updates already-installed third-party components through reviewed adapters for the selected host. Self-update failure prevents third-party mutation; handoff failure reports incomplete closure even if harnessed itself changed. GSD is the first reviewed adapter, with runtime identity/version verification before and after its upstream-owned update action. Components without a reviewed adapter report `unsupported`; missing third-party components remain `not-installed` and are not installed.
|
|
540
549
|
|
|
@@ -24,6 +24,7 @@ var en_default = {
|
|
|
24
24
|
'setup.step_a_render.complete': ' generated {{count}}/{{total}} command files',
|
|
25
25
|
'setup.step_a_render.warnings_header':
|
|
26
26
|
' [A.5] warnings \u2014 some capability cmds could not be fully resolved:',
|
|
27
|
+
'setup.command_warning': ' [A.6] {{message}}',
|
|
27
28
|
'setup.step_c.created': ' [C] created {{path}} + enabled Agent Teams',
|
|
28
29
|
'setup.step_c.already_enabled': ' [C] Agent Teams already enabled ({{path}})',
|
|
29
30
|
'setup.step_c.enabled_backup':
|
|
@@ -61,8 +61,32 @@ function isHostId(id) {
|
|
|
61
61
|
function descriptorFor(id, home = homedir()) {
|
|
62
62
|
return id === 'codex' ? codexDescriptor(home) : claudeDescriptor(home)
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
|
|
64
|
+
function configuredHome(envVar) {
|
|
65
|
+
const value = process.env[envVar]?.trim()
|
|
66
|
+
return value || void 0
|
|
67
|
+
}
|
|
68
|
+
function descriptorForConfiguredHome(id, home = homedir()) {
|
|
69
|
+
const descriptor = descriptorFor(id, home)
|
|
70
|
+
const nativeHome = configuredHome(id === 'codex' ? 'CODEX_HOME' : 'CLAUDE_CONFIG_DIR')
|
|
71
|
+
if (nativeHome === void 0) return descriptor
|
|
72
|
+
if (id === 'codex') {
|
|
73
|
+
return {
|
|
74
|
+
...descriptor,
|
|
75
|
+
homeDir: nativeHome,
|
|
76
|
+
stateRoot: join(nativeHome, 'harnessed'),
|
|
77
|
+
commandsDir: join(nativeHome, 'prompts'),
|
|
78
|
+
mcpConfigPath: join(nativeHome, 'config.toml'),
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
...descriptor,
|
|
83
|
+
homeDir: nativeHome,
|
|
84
|
+
stateRoot: join(nativeHome, 'harnessed'),
|
|
85
|
+
settingsPath: join(nativeHome, 'settings.json'),
|
|
86
|
+
skillsDir: join(nativeHome, 'skills'),
|
|
87
|
+
commandsDir: join(nativeHome, 'commands'),
|
|
88
|
+
pluginsRegistry: join(nativeHome, 'plugins', 'installed_plugins.json'),
|
|
89
|
+
}
|
|
66
90
|
}
|
|
67
91
|
function detectPlatform(home = homedir()) {
|
|
68
92
|
const resolved = resolveHost(home)
|
|
@@ -74,11 +98,18 @@ function resolveHost(home) {
|
|
|
74
98
|
return resolveHostWithReason(home).descriptor
|
|
75
99
|
}
|
|
76
100
|
function resolveHostWithReason(home = homedir()) {
|
|
77
|
-
const
|
|
101
|
+
const claudeHome = configuredHome('CLAUDE_CONFIG_DIR')
|
|
102
|
+
const codexHome = configuredHome('CODEX_HOME')
|
|
103
|
+
const envPlatform = process.env.HARNESSED_PLATFORM?.trim()
|
|
104
|
+
const explicitHost = envPlatform !== void 0 && isHostId(envPlatform) ? envPlatform : void 0
|
|
105
|
+
if (explicitHost === void 0 && claudeHome !== void 0 && codexHome !== void 0) {
|
|
106
|
+
throw new Error('both CLAUDE_CONFIG_DIR and CODEX_HOME are set; pass --platform claude|codex')
|
|
107
|
+
}
|
|
108
|
+
const base = descriptorForConfiguredHome('claude', home)
|
|
109
|
+
const codex = descriptorForConfiguredHome('codex', home)
|
|
78
110
|
const skipped = []
|
|
79
|
-
const envPlatform = process.env.HARNESSED_PLATFORM
|
|
80
111
|
if (envPlatform !== void 0 && envPlatform !== '') {
|
|
81
|
-
const d =
|
|
112
|
+
const d = isHostId(envPlatform) ? descriptorForConfiguredHome(envPlatform, home) : void 0
|
|
82
113
|
if (d) {
|
|
83
114
|
return {
|
|
84
115
|
descriptor: d,
|
|
@@ -88,11 +119,23 @@ function resolveHostWithReason(home = homedir()) {
|
|
|
88
119
|
}
|
|
89
120
|
skipped.push({ kind: 'env-platform-unknown', envVar: 'HARNESSED_PLATFORM', value: envPlatform })
|
|
90
121
|
}
|
|
122
|
+
if (claudeHome !== void 0 || codexHome !== void 0) {
|
|
123
|
+
const id = claudeHome !== void 0 ? 'claude' : 'codex'
|
|
124
|
+
return {
|
|
125
|
+
descriptor: id === 'claude' ? base : codex,
|
|
126
|
+
reason: {
|
|
127
|
+
kind: 'env-platform',
|
|
128
|
+
envVar: id === 'claude' ? 'CLAUDE_CONFIG_DIR' : 'CODEX_HOME',
|
|
129
|
+
value: id === 'claude' ? claudeHome : codexHome,
|
|
130
|
+
},
|
|
131
|
+
skipped,
|
|
132
|
+
}
|
|
133
|
+
}
|
|
91
134
|
const inClaude = Boolean(process.env.CLAUDE_CODE_SESSION_ID?.trim())
|
|
92
135
|
const inCodex = Boolean(process.env.CODEX_SESSION_ID?.trim())
|
|
93
136
|
if (inClaude !== inCodex) {
|
|
94
137
|
return {
|
|
95
|
-
descriptor: inClaude ? base :
|
|
138
|
+
descriptor: inClaude ? base : codex,
|
|
96
139
|
reason: {
|
|
97
140
|
kind: 'host-session-env',
|
|
98
141
|
envVar: inClaude ? 'CLAUDE_CODE_SESSION_ID' : 'CODEX_SESSION_ID',
|
|
@@ -101,11 +144,11 @@ function resolveHostWithReason(home = homedir()) {
|
|
|
101
144
|
}
|
|
102
145
|
}
|
|
103
146
|
if (inClaude && inCodex) skipped.push({ kind: 'host-session-env-ambiguous' })
|
|
104
|
-
for (const pinRoot of [
|
|
147
|
+
for (const pinRoot of [codex.stateRoot, base.stateRoot]) {
|
|
105
148
|
const pinPath = join(pinRoot, '.platform')
|
|
106
149
|
try {
|
|
107
150
|
const value = readFileSync(pinPath, 'utf8').trim()
|
|
108
|
-
const d =
|
|
151
|
+
const d = isHostId(value) ? descriptorForConfiguredHome(value, home) : void 0
|
|
109
152
|
if (d) return { descriptor: d, reason: { kind: 'platform-pin', pinPath, value }, skipped }
|
|
110
153
|
skipped.push({ kind: 'platform-pin-unknown', pinPath, value })
|
|
111
154
|
} catch {}
|
|
@@ -118,7 +161,6 @@ function resolveHostWithReason(home = homedir()) {
|
|
|
118
161
|
skipped,
|
|
119
162
|
}
|
|
120
163
|
}
|
|
121
|
-
const codex = codexDescriptor(home)
|
|
122
164
|
if (existsSync(codex.homeDir)) {
|
|
123
165
|
return {
|
|
124
166
|
descriptor: codex,
|
|
@@ -415,6 +457,12 @@ function buildWorkflowStateBlock(wf, forward, ledgerAgeMs) {
|
|
|
415
457
|
`REOPENED: sub '${next}' was sent back (attempt ${nextEntry.fail_count}${nextEntry.attempt_budget !== void 0 ? `/${nextEntry.attempt_budget}` : ''}) \u2014 ${nextEntry.reason}. Address THAT before re-running it; a repeat of the same attempt burns the budget.`,
|
|
416
458
|
)
|
|
417
459
|
}
|
|
460
|
+
for (const e of ledger) {
|
|
461
|
+
if (!e.spawn_failure || isSettled(e)) continue
|
|
462
|
+
lines.push(
|
|
463
|
+
`SPAWN-FAILED: sub '${e.sub}' failed to spawn (${e.spawn_failure}) \u2014 attempt ${e.fail_count ?? 0}; fix the cause before respawning it`,
|
|
464
|
+
)
|
|
465
|
+
}
|
|
418
466
|
if (!next && forward && (forward.unit.kind === 'phase' || forward.unit.kind === 'task')) {
|
|
419
467
|
const n = forward.remainingPhases
|
|
420
468
|
lines.push(
|
|
@@ -66,8 +66,32 @@ function isHostId(id) {
|
|
|
66
66
|
function descriptorFor(id, home = homedir()) {
|
|
67
67
|
return id === 'codex' ? codexDescriptor(home) : claudeDescriptor(home)
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
|
|
69
|
+
function configuredHome(envVar) {
|
|
70
|
+
const value = process.env[envVar]?.trim()
|
|
71
|
+
return value || void 0
|
|
72
|
+
}
|
|
73
|
+
function descriptorForConfiguredHome(id, home = homedir()) {
|
|
74
|
+
const descriptor = descriptorFor(id, home)
|
|
75
|
+
const nativeHome = configuredHome(id === 'codex' ? 'CODEX_HOME' : 'CLAUDE_CONFIG_DIR')
|
|
76
|
+
if (nativeHome === void 0) return descriptor
|
|
77
|
+
if (id === 'codex') {
|
|
78
|
+
return {
|
|
79
|
+
...descriptor,
|
|
80
|
+
homeDir: nativeHome,
|
|
81
|
+
stateRoot: join(nativeHome, 'harnessed'),
|
|
82
|
+
commandsDir: join(nativeHome, 'prompts'),
|
|
83
|
+
mcpConfigPath: join(nativeHome, 'config.toml'),
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
...descriptor,
|
|
88
|
+
homeDir: nativeHome,
|
|
89
|
+
stateRoot: join(nativeHome, 'harnessed'),
|
|
90
|
+
settingsPath: join(nativeHome, 'settings.json'),
|
|
91
|
+
skillsDir: join(nativeHome, 'skills'),
|
|
92
|
+
commandsDir: join(nativeHome, 'commands'),
|
|
93
|
+
pluginsRegistry: join(nativeHome, 'plugins', 'installed_plugins.json'),
|
|
94
|
+
}
|
|
71
95
|
}
|
|
72
96
|
function detectPlatform(home = homedir()) {
|
|
73
97
|
const resolved = resolveHost(home)
|
|
@@ -79,11 +103,18 @@ function resolveHost(home) {
|
|
|
79
103
|
return resolveHostWithReason(home).descriptor
|
|
80
104
|
}
|
|
81
105
|
function resolveHostWithReason(home = homedir()) {
|
|
82
|
-
const
|
|
106
|
+
const claudeHome = configuredHome('CLAUDE_CONFIG_DIR')
|
|
107
|
+
const codexHome = configuredHome('CODEX_HOME')
|
|
108
|
+
const envPlatform = process.env.HARNESSED_PLATFORM?.trim()
|
|
109
|
+
const explicitHost = envPlatform !== void 0 && isHostId(envPlatform) ? envPlatform : void 0
|
|
110
|
+
if (explicitHost === void 0 && claudeHome !== void 0 && codexHome !== void 0) {
|
|
111
|
+
throw new Error('both CLAUDE_CONFIG_DIR and CODEX_HOME are set; pass --platform claude|codex')
|
|
112
|
+
}
|
|
113
|
+
const base = descriptorForConfiguredHome('claude', home)
|
|
114
|
+
const codex = descriptorForConfiguredHome('codex', home)
|
|
83
115
|
const skipped = []
|
|
84
|
-
const envPlatform = process.env.HARNESSED_PLATFORM
|
|
85
116
|
if (envPlatform !== void 0 && envPlatform !== '') {
|
|
86
|
-
const d =
|
|
117
|
+
const d = isHostId(envPlatform) ? descriptorForConfiguredHome(envPlatform, home) : void 0
|
|
87
118
|
if (d) {
|
|
88
119
|
return {
|
|
89
120
|
descriptor: d,
|
|
@@ -93,11 +124,23 @@ function resolveHostWithReason(home = homedir()) {
|
|
|
93
124
|
}
|
|
94
125
|
skipped.push({ kind: 'env-platform-unknown', envVar: 'HARNESSED_PLATFORM', value: envPlatform })
|
|
95
126
|
}
|
|
127
|
+
if (claudeHome !== void 0 || codexHome !== void 0) {
|
|
128
|
+
const id = claudeHome !== void 0 ? 'claude' : 'codex'
|
|
129
|
+
return {
|
|
130
|
+
descriptor: id === 'claude' ? base : codex,
|
|
131
|
+
reason: {
|
|
132
|
+
kind: 'env-platform',
|
|
133
|
+
envVar: id === 'claude' ? 'CLAUDE_CONFIG_DIR' : 'CODEX_HOME',
|
|
134
|
+
value: id === 'claude' ? claudeHome : codexHome,
|
|
135
|
+
},
|
|
136
|
+
skipped,
|
|
137
|
+
}
|
|
138
|
+
}
|
|
96
139
|
const inClaude = Boolean(process.env.CLAUDE_CODE_SESSION_ID?.trim())
|
|
97
140
|
const inCodex = Boolean(process.env.CODEX_SESSION_ID?.trim())
|
|
98
141
|
if (inClaude !== inCodex) {
|
|
99
142
|
return {
|
|
100
|
-
descriptor: inClaude ? base :
|
|
143
|
+
descriptor: inClaude ? base : codex,
|
|
101
144
|
reason: {
|
|
102
145
|
kind: 'host-session-env',
|
|
103
146
|
envVar: inClaude ? 'CLAUDE_CODE_SESSION_ID' : 'CODEX_SESSION_ID',
|
|
@@ -106,11 +149,11 @@ function resolveHostWithReason(home = homedir()) {
|
|
|
106
149
|
}
|
|
107
150
|
}
|
|
108
151
|
if (inClaude && inCodex) skipped.push({ kind: 'host-session-env-ambiguous' })
|
|
109
|
-
for (const pinRoot of [
|
|
152
|
+
for (const pinRoot of [codex.stateRoot, base.stateRoot]) {
|
|
110
153
|
const pinPath = join(pinRoot, '.platform')
|
|
111
154
|
try {
|
|
112
155
|
const value = readFileSync(pinPath, 'utf8').trim()
|
|
113
|
-
const d =
|
|
156
|
+
const d = isHostId(value) ? descriptorForConfiguredHome(value, home) : void 0
|
|
114
157
|
if (d) return { descriptor: d, reason: { kind: 'platform-pin', pinPath, value }, skipped }
|
|
115
158
|
skipped.push({ kind: 'platform-pin-unknown', pinPath, value })
|
|
116
159
|
} catch {}
|
|
@@ -123,7 +166,6 @@ function resolveHostWithReason(home = homedir()) {
|
|
|
123
166
|
skipped,
|
|
124
167
|
}
|
|
125
168
|
}
|
|
126
|
-
const codex = codexDescriptor(home)
|
|
127
169
|
if (existsSync(codex.homeDir)) {
|
|
128
170
|
return {
|
|
129
171
|
descriptor: codex,
|
|
@@ -65,7 +65,7 @@ var init_package = __esm({
|
|
|
65
65
|
'package.json'() {
|
|
66
66
|
package_default = {
|
|
67
67
|
name: 'harnessed',
|
|
68
|
-
version: '5.0.
|
|
68
|
+
version: '5.0.6',
|
|
69
69
|
description: 'AI coding harness package manager + composition orchestrator',
|
|
70
70
|
type: 'module',
|
|
71
71
|
license: 'Apache-2.0',
|
|
@@ -116,6 +116,7 @@ var init_package = __esm({
|
|
|
116
116
|
'routing',
|
|
117
117
|
'config-templates',
|
|
118
118
|
'schemas',
|
|
119
|
+
'CHANGELOG.md',
|
|
119
120
|
'README.md',
|
|
120
121
|
'README-en.md',
|
|
121
122
|
'README-zh.md',
|
|
@@ -126,6 +127,7 @@ var init_package = __esm({
|
|
|
126
127
|
scripts: {
|
|
127
128
|
dev: 'tsup --watch',
|
|
128
129
|
build: 'tsc --noEmit && tsup && node ./scripts/build-hooks.mjs',
|
|
130
|
+
prepack: 'npm run build',
|
|
129
131
|
'build:hooks': 'node ./scripts/build-hooks.mjs',
|
|
130
132
|
'build:schema': 'node ./scripts/build-schema.mjs',
|
|
131
133
|
'validate:schema': 'node ./scripts/validate-schema.mjs',
|
|
@@ -14,7 +14,7 @@ var init_package = __esm({
|
|
|
14
14
|
'package.json'() {
|
|
15
15
|
package_default = {
|
|
16
16
|
name: 'harnessed',
|
|
17
|
-
version: '5.0.
|
|
17
|
+
version: '5.0.6',
|
|
18
18
|
description: 'AI coding harness package manager + composition orchestrator',
|
|
19
19
|
type: 'module',
|
|
20
20
|
license: 'Apache-2.0',
|
|
@@ -65,6 +65,7 @@ var init_package = __esm({
|
|
|
65
65
|
'routing',
|
|
66
66
|
'config-templates',
|
|
67
67
|
'schemas',
|
|
68
|
+
'CHANGELOG.md',
|
|
68
69
|
'README.md',
|
|
69
70
|
'README-en.md',
|
|
70
71
|
'README-zh.md',
|
|
@@ -75,6 +76,7 @@ var init_package = __esm({
|
|
|
75
76
|
scripts: {
|
|
76
77
|
dev: 'tsup --watch',
|
|
77
78
|
build: 'tsc --noEmit && tsup && node ./scripts/build-hooks.mjs',
|
|
79
|
+
prepack: 'npm run build',
|
|
78
80
|
'build:hooks': 'node ./scripts/build-hooks.mjs',
|
|
79
81
|
'build:schema': 'node ./scripts/build-schema.mjs',
|
|
80
82
|
'validate:schema': 'node ./scripts/validate-schema.mjs',
|