23 Commits

Author SHA1 Message Date
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
21237e19a0 refactor(sense-generator): extract moderator to its own file
小橘 🍊(NEKO Team)
2026-04-28 03:53:49 +00:00
6a2d6b0627 fix(sense-generator): derive attempt count from steps, not llmExtract
attempt is a deterministic fact (count of tester steps), not something
an LLM should guess. Removed from tester meta schema, moderator counts
it directly from context.steps.

小橘 🍊(NEKO Team)
2026-04-28 03:51:42 +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
bc4ac8a5cc refactor(sense-generator): prompt.ts instead of prompt.md + mustache
Static imports, no runtime file reads, bundler friendly.
Removed mustache dependency.

小橘 🍊(NEKO Team)
2026-04-28 03:38:26 +00:00
a811660a33 refactor(sense-generator): extract prompts to prompt.md templates
Each role's prompt is now a separate markdown file with {{mustache}} placeholders,
loaded at module init and interpolated at runtime.

小橘 🍊(NEKO Team)
2026-04-28 03:32:51 +00:00
516a28533a refactor(sense-generator): extract meta schemas to types.ts
小橘 🍊(NEKO Team)
2026-04-28 02:38:07 +00:00
fd3a8c64f2 refactor(sense-generator): remove unnecessary buildWorkflow wrapper
小橘 🍊(NEKO Team)
2026-04-28 02:32:55 +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
e05c71d6b0 refactor(sense-generator): use createCursorRole factory, slim meta to routing-only
- planner/coder: replaced 80+ lines hand-written agent calls with createCursorRole()
- SenseMeta slimmed to routing signals only (senseName, filesCreated, passed/attempt)
- Roles read context from thread via nerve thread <id>, not from previous role's meta
- tester stays hand-written (pure CLI logic)
- Re-exported spawnSafe from workflow-utils for helper use

Refs uncaged/nerve#210

小橘 🍊(NEKO Team)
2026-04-28 02:22:38 +00:00
8ff6003a75 refactor(sense-generator): use createCursorRole and slim SenseMeta
Replace hand-written planner and coder with createCursorRole from nerve-workflow-utils. Prompts instruct reading the Nerve thread via nerve thread show. Extract uses resolveDashScopeProvider. SenseMeta keeps routing-only fields; tester remains hand-written with filesystem and smoke checks.

Made-with: Cursor
2026-04-28 02:20:01 +00:00
c5ea790447 refactor(workflow-generator): simplify roles — merge analyst+architect→planner, add coder⇄tester loop, hermes committer
Refs #143

小橘 <xiaoju@shazhou.work>
2026-04-25 10:31:33 +00:00
476ac4d7a5 workflow: pr-code-reviewer
Workflow: pr-code-reviewer
User request (summary): Create a code-reviewer workflow that: 1) Takes a PR URL (supporting Gitea git.shazhou.work, GitHub, and Gitee) as input. 2) A fetcher role detects the platform from the URL, authenticates using ava...
Reviewer (summary): npx tsc --noEmit passed and nerve.yaml contains the workflow entry
Staged paths:
- nerve.yaml
- workflows/pr-code-reviewer/index.ts
- workflows/pr-code-reviewer/package.json
- workflows/pr-code-reviewer/pnpm-lock.yaml
- workflows/pr-code-reviewer/tsconfig.json
2026-04-25 06:46:00 +00:00
61c8349307 fix: allow reading other workflows but not writing
小橘 🍊(NEKO Team)
2026-04-25 06:26:14 +00:00
024ddf0b8b fix(workflow-generator): restrict coder to only touch target workflow dir
Prevents coder from modifying other workflow directories like
sense-generator when generating a new workflow.

小橘 🍊(NEKO Team)
2026-04-25 06:19:18 +00:00
714a320bdc feat: add hello-world workflow and update sense-generator config
- Add hello-world workflow generated by workflow-generator
- Add package.json/tsconfig.json to sense-generator
- Update nerve.yaml

小橘 🍊(NEKO Team)
2026-04-25 06:12:29 +00:00
028125b74f feat(workflow-generator): add committer role
Auto-generated by workflow-generator itself. After reviewer passes,
committer creates a feature branch, stages workflow files, commits
with a meaningful message, and pushes to origin.

小橘 🍊(NEKO Team)
2026-04-25 06:02:09 +00:00
0803a00482 chore: instruct coder to use .default() on zod schemas for llmExtract
小橘 🍊(NEKO Team)
2026-04-25 04:48:11 +00:00
9f2067db7d fix: add dryRun early-return for all roles in workflow-generator
llmExtract returns {} as T in dryRun mode, causing .map() on undefined.
Each role now returns mock data immediately when dryRun is true.

小橘 🍊(NEKO Team)
2026-04-25 04:24:42 +00:00
7bfb24c2c1 feat: add workflow-generator meta-workflow (Issue #99)
4-role workflow (analyst → architect → coder → reviewer) that generates
new workflows from natural language descriptions. Uses cursorAgent for
analysis/design/code generation and llmExtract for structured extraction.

小橘 🍊(NEKO Team)
2026-04-25 04:18:57 +00:00
9a3c50c257 refactor: consolidate senses — merge tcp-socket-stats into system-health, remove cpu-usage
- Remove cpu-usage sense (redundant with system-health loadavg)
- Remove linux-tcp-socket-stats (merged into linux-system-health)
- Remove disk-usage-mounts (unused)
- Add tcp socket fields to system-health schema + migration
- Simplify nerve.yaml: 4 senses → 2

小橘 <xiaoju@shazhou.work>
2026-04-24 06:13:51 +00:00
d1a2ee876a fix: hermesRun command and tester verdict via llmExtract
- Fix hermes invocation: 'hermes -q' → 'hermes chat -q' with proper flags
- Replace fragile string.includes('PASS') with llmExtract judge
  (previous false positive: matched '--pass-session-id' in usage text)

小橘 🍊(NEKO Team)
2026-04-23 12:20:11 +00:00
56c7588c82 feat: sense-generator workflow with llmExtract metadata extraction
- Planner uses cursor-agent ask mode (not plan mode) for stdout output
- llmExtract: structured metadata extraction via DashScope qwen-plus + tool_choice
- Replaces fragile regex name parsing with reliable LLM tool call
- Removed unknown-sense artifact from failed generation

小橘 🍊(NEKO Team)
2026-04-23 12:01:12 +00:00