5 Commits

Author SHA1 Message Date
69eb4ffe49 refactor: use destructuring to simplify build functions 2026-04-28 04:04:49 +00:00
cb61e98979 refactor(sense-generator): full DIP — all deps injected via build functions
Every role is self-contained (types.ts, prompt.ts, index.ts).
No shared.ts, no cross-role imports. All dependencies injected:

  index.ts          — wiring (resolve env, call buildSenseGenerator)
  build.ts          — buildSenseGenerator(deps) → WorkflowDefinition
  moderator.ts      — pure routing, composes meta from role types
  roles/planner/    — buildPlannerRole(deps), self-contained
  roles/coder/      — buildCoderRole(deps), self-contained
  roles/tester/     — buildTesterRole(deps), self-contained

Workflow is now reusable: buildSenseGenerator() can be called with
any provider/paths, not hardcoded to this machine.

小橘 🍊(NEKO Team)
2026-04-28 04:00:38 +00:00
6d3313223f refactor(sense-generator): inject provider from index.ts, roles are now sync
Provider resolved once at top level, injected into each build*Role().
Role builders no longer async — they're pure factory calls.

小橘 🍊(NEKO Team)
2026-04-28 03:56:02 +00:00
7c4883ddec refactor(sense-generator): tester → createHermesRole for e2e verification
Replaced 122-line hand-written smoke test with createHermesRole.
Hermes runs the full lifecycle check autonomously via terminal:
files → nerve.yaml → sense list → trigger → query → logs on failure.

All 3 roles now use factories:
  planner: createCursorRole (ask mode)
  coder:   createCursorRole (default mode)
  tester:  createHermesRole (e2e verification)

小橘 🍊(NEKO Team)
2026-04-28 03:48:26 +00:00
2d63639ed1 refactor(sense-generator): split roles into separate directories
Following nerve-dev best practice: each role gets its own directory.

Structure:
  index.ts                    — 31 lines (WorkflowDefinition + moderator)
  roles/planner/index.ts      — 48 lines (createCursorRole)
  roles/coder/index.ts        — 33 lines (createCursorRole)
  roles/tester/index.ts       — 122 lines (hand-written smoke test)
  roles/shared.ts             — 63 lines (providers, helpers)
  roles/types.ts              — 5 lines (SenseMeta)

Was: single 416-line index.ts

Refs uncaged/nerve#210
小橘 🍊(NEKO Team)
2026-04-28 02:30:12 +00:00