Commit Graph

210 Commits

Author SHA1 Message Date
xiaoju 3c6c8840ef fix: live script uses agent-executor sandwich (no more includes hack)
CI / test (push) Has been cancelled
- council-v2-live.ts: coder/reviewer now use createCoderRole/createReviewerRole
- Removed inline runCursorAgent (moved to agent-executor.ts)
- reviewer verdict via LLM₂ tool_choice instead of includes('rejected')
- Live verified: architect→coder→reviewer(approved)→closer in 135s
2026-04-17 06:53:48 +00:00
xiaoju a4aa990e9f docs: add roles/ directory reference to COUNCIL-V2.md
Reference concrete role implementations (architect-llm, coder-cursor,
reviewer-cursor, agent-executor) in the Roles section.

Made-with: Cursor
2026-04-17 06:40:54 +00:00
xiaoju f191d594b3 feat: LLM-Agent-LLM sandwich (agent-executor)
- createAgentExecutorRole: prepPrompt → agent.run → LLM₂ tool_choice → meta
- createCursorRunner: extracts Cursor CLI into AgentRunner interface
- Coder role: LLM₂ extracts filesChanged + testsPassed via tool_choice
- Reviewer role: LLM₂ extracts verdict via tool_choice (no more includes hack)
- defaultMeta fallback when LLM₂ fails or returns no tool_call
- 5 new agent-executor tests, 24 total pass
2026-04-17 06:27:19 +00:00
xiaoju 5a8fe051bf docs: tighten COUNCIL-V2.md to 49 lines within 30-50 target
Made-with: Cursor
2026-04-17 06:16:20 +00:00
xiaoju b458daecb8 docs: trim COUNCIL-V2.md to 50 lines and inline source references
Made-with: Cursor
2026-04-17 06:14:08 +00:00
xiaoju ac6db24d6e docs: rewrite COUNCIL-V2.md with concise model overview
Simplified structure with inline code block for WorkflowType,
streamlined section headings, and tighter prose while retaining
all key topics: START/END automaton, pure roles, Moore-machine
diff-driven ticks, and source file references.

Made-with: Cursor
2026-04-17 06:12:04 +00:00
xiaoju 8cec21d285 docs: add COUNCIL-V2.md overview of the WorkflowType model
Covers WorkflowType definition, START/END automaton, pure roles,
and Moore machine diff-driven ticks with source file references.

Made-with: Cursor
2026-04-17 06:09:43 +00:00
xiaoju 2290c478c5 refactor: START/END automaton + pure roles
- START = Symbol('workflow.START'), END = Symbol('workflow.END')
- Moderator: (START | RoleOutput) → Role | END — complete automaton
- Role returns { content: string, meta: Meta | null } — pure function
- Adapter handles all storage: CAS putObject + appendEvent
- 'user' pseudo-role removed, trigger event = coding.__start__
- Roles no longer import/call store.putObject or store.appendEvent
- content fixed to string (not unknown), meta allows null
- -653/+484 lines, 22 tests pass
2026-04-17 06:04:18 +00:00
xiaoju c13290dd25 refactor: type-safe workflow — Role<Meta> + discriminated union moderator
- Role<Meta> = (chain, topicId, store) => Promise<Meta>
- MetaOf<R> extracts Meta from Role type
- RoleOutput<Roles> = discriminated union { role: K, meta: MetaOf<Roles[K]> }
- Moderator receives RoleOutput, switch on role narrows meta type
- WorkflowType simplified: no projection field, just name + roles + moderator
- Adapter builds per-topic summary internally
- coding-workflow: ArchitectMeta, CoderMeta, ReviewerMeta, CloserMeta
- -538/+326 lines — simpler AND more type-safe
2026-04-17 05:24:10 +00:00
xiaoju ff689ce3ce refactor: workflow message chain + CAS storage 2026-04-17 05:02:58 +00:00
xiaoju 59afcf6211 docs: add Workflow as Conversation design notes 2026-04-17 04:24:17 +00:00
xiaoju c61a8d1666 refactor: rename Topic → Workflow, routine → workflows scope 2026-04-17 04:10:56 +00:00
xiaoju f5eb899711 fix(upulse): topic command uses routine scope, not _system 2026-04-17 04:03:38 +00:00
xiaoju 62c1ddd23b feat(upulse): add topic create/list CLI commands
Add 'upulse topic create' to write coding.created events with
auto-generated slugified topicId, and 'upulse topic list' to
display topics grouped by state with --all flag for closed topics.

Made-with: Cursor
2026-04-17 03:56:17 +00:00
xiaoju d073e93d8e chore: update daemon config for v2-only + rename COUNCIL-V2.md 2026-04-17 03:25:23 +00:00
xiaoju b65e9d65cb refactor: remove v1 Council code (Container/Binding/Task/Moderator) 2026-04-17 03:24:36 +00:00
xiaoju b645205ea5 docs: add V2-SERIAL.md confirming council v2 serialization test passed
Made-with: Cursor
2026-04-17 03:04:11 +00:00
xiaoju 65ba278e86 chore: clean test artifacts 2026-04-17 03:03:15 +00:00
xiaoju 95d2e0679e fix(council-v2): serialize topicTicker to prevent fire-and-forget concurrency
executorLoop fire-and-forgets each effect execution. Multiple concurrent
execute() calls each invoke topicTicker(), causing concurrent tick() calls
that bypass Moore diff (both read same prevSnapshotJson before either updates).

Fix: chain tick() calls via promise serialization. Critical section
(read → diff → update baseline) is now guaranteed sequential.
2026-04-17 03:02:51 +00:00
xiaoju 4caac0b68c docs: add V2-FINAL.md confirming council v2 daemon is fully operational
Made-with: Cursor
2026-04-17 02:59:27 +00:00
xiaoju aaa144b877 feat(council-v2): role execution logging + SQLite busy_timeout
- store.ts: add PRAGMA busy_timeout = 5000 after WAL mode (both paths)
- topic-rule-adapter: accept optional logStore for role execution logs
  - role-started/completed/failed events written to logStore (not business store)
  - role errors caught gracefully, other actions continue
  - meta includes scope field for source identification
  - no logStore = no logging (graceful degradation)
- coding-task.ts: projection unchanged (role logs never enter business store)
- tests: 8 passing (echo+logStore, role-failed, no-logStore, Moore diff,
  baseline, coding lifecycle, rejection, log isolation)

小橘 🍊 (NEKO Team)
2026-04-17 02:55:28 +00:00
xiaoju e350bb371f docs: add V2-VERIFIED.md confirming council v2 daemon integration
Made-with: Cursor
2026-04-17 02:31:12 +00:00
xiaoju 888ad1a829 fix(council-v2): update baseline before execution + add concurrency test
Moore machine baseline must update BEFORE role execution starts,
not after. This prevents duplicate dispatch when tick() is called
again while a slow role (e.g. Cursor ~60s) is still running.

Added test: 'baseline updates before execution' verifies that a
concurrent tick sees snapshot === baseline and skips.
2026-04-17 02:29:01 +00:00
xiaoju 236849e08e fix(council-v2): Moore diff compares projected snapshot, not action keys
The Moore machine should fire outputs only when STATE changes,
not when ACTIONS change. Compare JSON-serialized snapshot baseline
to determine if a new tick needs to run moderator + roles.
2026-04-17 02:22:22 +00:00
xiaoju 325ef616f8 chore: clean up test artifacts 2026-04-17 02:16:37 +00:00
xiaoju ba1be4d3d2 fix(council-v2): add reentry guard to createTopicTicker 2026-04-17 02:16:06 +00:00
xiaoju 6342509bad feat: add hello-v2.md test file for Council v2 daemon
Made-with: Cursor
2026-04-17 02:10:54 +00:00
xiaoju 15d0d67198 feat(council-v2): createTopicTicker + export roles from index 2026-04-17 00:59:34 +00:00
xiaoju 8848333d1e feat(council-v2): extract reusable role implementations (architect/coder/reviewer) 2026-04-17 00:59:25 +00:00
xiaoju 40a5d55228 feat(council-v2): full live pipeline — architect(LLM) + coder(Cursor) + reviewer(Cursor) 2026-04-17 00:44:20 +00:00
xiaoju a1e869fc19 docs: add COUNCIL-V2.md overview of the Council v2 model
Covers TopicType interface (events, projection, roles, moderator),
Topic-as-Rule pattern, one-rule-per-type design, and Moore machine
diff-driven ticks with references to source files in topics/.

Made-with: Cursor
2026-04-17 00:43:13 +00:00
xiaoju 13a3203b86 feat(council-v2): demo --live --v2 wires architect to real LLM 2026-04-17 00:36:51 +00:00
xiaoju e0a6f7147c test(council-v2): E2E + demo --v2 support 2026-04-17 00:33:42 +00:00
xiaoju 5ad95357c6 feat(council-v2): TopicType interface + topic-rule-adapter + coding-task 2026-04-17 00:33:31 +00:00
xiaoju 79336ba6a5 feat(council): demo --keep and --db= flags for event DB persistence 2026-04-16 14:07:16 +00:00
xiaoju 8b30d6ebee fix(rules): task-rule diff-driven — only emit on state transitions (Moore machine) 2026-04-16 13:51:34 +00:00
xiaoju f07e3e61b3 feat(council): demo supports --live LLM mode (env: PULSE_LLM_BASE_URL/API_KEY/MODEL) 2026-04-16 13:36:05 +00:00
xiaoju e2b4e6113d feat(council): add full pipeline demo script 2026-04-16 13:33:25 +00:00
xiaoju d526f9dabd test(council): E2E full pipeline — task → code → review → close 2026-04-16 13:03:21 +00:00
xiaoju 0e5cd57843 feat(council): Phase 4 — Container registry + Persona×Container binding 2026-04-16 12:44:30 +00:00
xiaoju 179104245b feat(council): Phase 3 — Topic spawn + nested Council 2026-04-16 11:35:13 +00:00
xiaoju 131783144d feat(council): Phase 2 — TaskModerator + Council execution loop 2026-04-16 11:24:47 +00:00
xiaoju 60ecf0c08b fix(test): t5-migrate use integer id for AUTOINCREMENT schema 2026-04-16 11:05:39 +00:00
xiaoju 1b8f5e1296 feat(council): Phase 1 — Persona registry + dynamic broker 2026-04-16 10:56:37 +00:00
xingyue 95ef66a9fe Merge branch 'chore/cleanup-deprecated-24' into main
chore: remove deprecated code and stale files (closes #24)
2026-04-16 18:49:12 +08:00
xingyue e3b9ccdeb6 chore: remove deprecated code and stale files
closes #24

- Delete stale `hello` test file
- Remove deprecated type aliases: TaskExecutingMeta, TaskAckedMeta,
  TaskGivenUpMeta, ProjectPausedMeta, ProjectArchivedMeta (all `never`)
- Remove deprecated VitalRecord type alias (was just EventRecord)
- Remove deprecated AgentCapabilityStats interface and
  buildAgentCapabilityStats function (returned empty object)
- Remove agent-capability-stats from rebuildSnapshot
- Clean up re-exports in index.ts and upulse/store.ts
- All 355 tests pass, 0 lint errors
2026-04-16 18:45:41 +08:00
xiaoju f012ba7f6c revert(store): restore INTEGER AUTOINCREMENT for events.id 2026-04-16 10:08:52 +00:00
xiaoju 9882d86825 chore: lint fix 2026-04-16 09:48:12 +00:00
xiaoju e3c995728d fix(llm-client): scan all choices for tool_calls (copilot-api returns 2 choices) 2026-04-16 09:42:47 +00:00
xiaoju 184e18f0c1 fix(broker): remove tool_choice required (copilot-api 미지원) 2026-04-16 09:24:36 +00:00