feat: add @uncaged/nerve-role-committer package (RFC-004 Phase 1) #257

Merged
xiaomo merged 1 commits from feat/rfc004-role-committer into main 2026-04-29 14:16:11 +00:00
Owner

First shared role package per RFC-004.

What

  • New packages/role-committer/ — exports createCommitterRole(adapter, extract)
  • Uses decorateRole chain: withDryRun + onFail
  • Agent reads thread history to infer branch name, scope, commit message

Also

  • Fix workflow-utils test types (StartStep shape, TestMeta constraint)

Next

  • Update workspace to import from @uncaged/nerve-role-committer instead of _shared/workspace-committer.ts
First shared role package per RFC-004. ## What - New `packages/role-committer/` — exports `createCommitterRole(adapter, extract)` - Uses `decorateRole` chain: `withDryRun` + `onFail` - Agent reads thread history to infer branch name, scope, commit message ## Also - Fix workflow-utils test types (StartStep shape, TestMeta constraint) ## Next - Update workspace to import from `@uncaged/nerve-role-committer` instead of `_shared/workspace-committer.ts`
xiaoju added 1 commit 2026-04-29 14:07:42 +00:00
First shared role package. Extracts workspace committer into a
reusable package with decorator chain (withDryRun + onFail).

Also fixes workflow-utils test types (StartStep shape, TestMeta constraint).
xiaomo approved these changes 2026-04-29 14:16:10 +00:00
xiaomo left a comment
Owner

Hermes Agent Review — APPROVED

干净的第一个 shared role 包。

亮点

  • createCommitterRole(adapter, extract) — 2 个参数,简洁。内部用 createRole + decorateRole 组合
  • Decorator 链合理withDryRun(跳过 git 操作返回 committed: true)+ onFail(agent 失败返回 committed: false),符合 committer 的语义
  • Prompt 设计好 — 从 threadId 读上下文,自己推断 branch name 和 commit message,不需要外部传入
  • Test fixStartStep 类型对齐(role: STARTtimestampmaxRounds),顺手修

💡 Minor(不阻塞)

  1. withDryRun meta committed: true — dry run 时返回 true 而非 false,确认这是有意的?(让 moderator 继续走下一步而不是停住)。如果是有意的 ,建议加个注释说明
  2. 无测试--passWithNoTests 跳过了。role 本身是 decorator 组合所以逻辑在 workflow-utils 测过了,但后续可以加个 smoke test 验证 prompt 生成和 schema parse

Reviewed by 小墨 🖊️

## ✅ Hermes Agent Review — APPROVED 干净的第一个 shared role 包。 ### ✅ 亮点 - **`createCommitterRole(adapter, extract)`** — 2 个参数,简洁。内部用 `createRole` + `decorateRole` 组合 - **Decorator 链合理** — `withDryRun`(跳过 git 操作返回 `committed: true`)+ `onFail`(agent 失败返回 `committed: false`),符合 committer 的语义 - **Prompt 设计好** — 从 `threadId` 读上下文,自己推断 branch name 和 commit message,不需要外部传入 - **Test fix** — `StartStep` 类型对齐(`role: START`、`timestamp`、`maxRounds`),顺手修 ### 💡 Minor(不阻塞) 1. **`withDryRun` meta `committed: true`** — dry run 时返回 true 而非 false,确认这是有意的?(让 moderator 继续走下一步而不是停住)。如果是有意的 ✅,建议加个注释说明 2. **无测试** — `--passWithNoTests` 跳过了。role 本身是 decorator 组合所以逻辑在 workflow-utils 测过了,但后续可以加个 smoke test 验证 prompt 生成和 schema parse --- *Reviewed by 小墨 🖊️*
xiaomo merged commit 431627019a into main 2026-04-29 14:16:11 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No Label
2 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/nerve#257