Commit Graph

217 Commits

Author SHA1 Message Date
xiaomo 25591e2c21 fix: D1 bind params must be spread, not chained (refs #5)
CI / test (push) Has been cancelled
2026-04-18 08:12:37 +00:00
xiaoju b533094792 fix: tester detects completion by quiescence, not __end__ event
CI / test (push) Has been cancelled
Adapter doesn't write __end__ events — moderator returns END and
tick produces executed=[]. Now tester checks: did at least one tick
execute, then quiesced = completed.
2026-04-18 08:11:06 +00:00
xiaomo 1ba77929e6 feat: pulseflare real tick logic — rules + snapshot + sigil executor (refs #5)
CI / test (push) Has been cancelled
- Implement real Pulse tick logic in durable-tick.ts
- Add snapshot rebuild from D1 collect events
- Add pulse() method with demo rules (CPU spike detection, heartbeat)
- Add adaptive tick logic (30s base, up to 5min backoff)
- Add /configure endpoint for senseKeys and configuration
- Add CAS object storage in store-d1.ts
- Update index.ts with /configure route
- Persist prev snapshot in DO storage
- Execute effects through Sigil with error handling
2026-04-18 08:09:04 +00:00
xiaoju 7168b68896 feat: tester e2e verification — dynamic import + tick lifecycle + commit/push
CI / test (push) Has been cancelled
Tester no longer duplicates build+test (that's coder's job).
Instead: dynamic-import workflows from engine dir, spin temp store,
tick to __end__, verify lifecycle completes. Workflow-agnostic.
2026-04-18 08:02:53 +00:00
xiaomo 70be73efde chore: update pulseflare D1 database_id (refs #5)
CI / test (push) Has been cancelled
2026-04-18 07:54:05 +00:00
xiaomo 272aa9728a feat: pulseflare package — CF Workers + D1 runtime (refs #5)
CI / test (push) Has been cancelled
2026-04-18 07:51:37 +00:00
xiaoju ad25161a8f refactor: merge promoter into tester — meta workflow now coder → tester → END
CI / test (push) Has been cancelled
2026-04-18 07:48:25 +00:00
xiaoju be2d9de6b1 fix: werewolf test async + e2e tick loop
CI / test (push) Has been cancelled
2026-04-18 07:06:40 +00:00
xiaoju 1afce01335 refactor: simplify meta workflow — coder → tester → promoter 2026-04-18 07:03:33 +00:00
xiaoju 2a17dcc892 feat(workflow): add werewolf game workflow
CI / test (push) Has been cancelled
2026-04-18 05:58:10 +00:00
xiaomo d9717ab941 fix: correct stale test assertion in cursor-agent.test.ts
CI / test (push) Has been cancelled
The test was checking for 'Bug Fix' but the mock data has title: 'Fix bug' and the prompt builder uses the title directly. Remove the incorrect assertion.

Made-with: Cursor
2026-04-18 03:21:36 +00:00
xiaomo 39d58f58c1 chore: remove stale test files for deleted modules (council, container)
council.test.ts and container.test.ts reference modules that were removed in a previous commit (b65e9d6). These files cannot run and cause test suite failures.

Made-with: Cursor
2026-04-18 03:19:07 +00:00
xiaomo 0b2f3073b5 style: apply biome formatting to test files
Made-with: Cursor
2026-04-18 03:16:27 +00:00
xiaomo 125aafaa12 fix: adapt test files for async PulseStore (refs #5)
CI / test (push) Has been cancelled
- Fixed await patterns in index.test.ts, objects.test.ts, scoped-store.test.ts
- Converted expect(await store.method()) patterns throughout test files
- Fixed rebuildSnapshot async calls in E2E tests
- Made test functions async where needed for store operations
- Reduced test failures from 35+ down to 6 (remaining are mostly unrelated)
2026-04-18 03:13:26 +00:00
xiaomo d56d0fd435 style: apply biome formatting to pulse-cursor
Made-with: Cursor
2026-04-18 03:08:29 +00:00
xiaomo 145be974f3 fix: adapt pulse-cursor package to async PulseStore API
Make resolveTask and resolveProject async and await their store.queryByKind calls

Made-with: Cursor
2026-04-18 03:08:12 +00:00
xiaomo 6062e692ac fix: adapt upulse package to async PulseStore API
Update upulse commands and UI server to await all async store methods. - Make CLI action callbacks async (workflow create, timeline, list, inspect events/object) - Make daemon status function async - Make all UI server handler functions async with awaited store calls - Fix Promise.all patterns for getObject calls in map functions - Fix scopedStore.close() calls to be awaited

Made-with: Cursor
2026-04-18 03:07:20 +00:00
xiaomo 3313f29954 fix: resolve lint errors in test files for async refactor
- Make non-async helper functions async (triggerCoding, triggerWorkflow, writeVitalAndRebuild, writeEffectEvent, cleanup, trigger) - Fix bad await placement in object literals (await hash: -> hash: await) - Fix await in non-async arrow callbacks and await data: object property - Convert expect(async).toThrow() to rejects.toThrow() for async functions - Fix Promise.all pattern for async getObject calls in map - Remove stray await before return statements - Fix db.close() (sync bun:sqlite API) wrongly awaited - Auto-fix formatting issues via biome

Made-with: Cursor
2026-04-18 03:01:24 +00:00
xiaomo 6f753ae68e test: await async store/defs calls in all test files
Update all *.test.ts files to properly await the async PulseStore, ScopedStore, and defs functions. Fix gc.test.ts timing issues for async GC trigger, fix bad await assignment targets, and correct .length access on Promise objects.

Made-with: Cursor
2026-04-18 02:57:30 +00:00
xiaomo ca3dd52e38 refactor!: async PulseStore interface for multi-runtime support (refs #5)
CI / test (push) Has been cancelled
- PulseStore/ScopedStore 接口方法返回 Promise<T>
- 所有 store 实现方法改为 async(bun:sqlite 同步调用外包 async)
- defs.ts, projection-engine.ts, gc.ts 公共函数异步化
- index.ts 中 store 调用加 await
- rules/health.ts rebuildHealth 函数异步化
- 核心异步化完成,支持 CF D1 等异步数据库运行时

Breaking Changes:
- All PulseStore methods now return Promise<T>
- Consumer code must add await for all store operations
- Tests need to be updated to use async/await patterns
2026-04-18 02:50:12 +00:00
xiaomo 80eeac03c2 docs: Pulseflare runtime analysis report (refs #5)
CI / test (push) Has been cancelled
2026-04-18 02:24:52 +00:00
xiaoju 0517007d40 chore: remove legacy broker code (pulse#6)
CI / test (push) Has been cancelled
2026-04-18 02:09:59 +00:00
xiaoju 5ccd50221c refactor(rollback): extract performRollback + add 6 tests
CI / test (push) Has been cancelled
- Extract core logic into testable performRollback(opts) function
- CLI action now delegates to performRollback and prints output
- Tests cover: dry-run, event export/delete, git checkout, missing
  commit error, noop when already at target, dump metadata
- All tests use tmpdir, no dependency on ~/.upulse
2026-04-18 01:39:22 +00:00
xiaoju 8754ff51cd feat(upulse): add rollback command — time-machine revert for engine
CI / test (push) Has been cancelled
- upulse rollback <commit> [--dry-run] [--engine <path>] [--events <path>]
- Exports events after cutoff to .pulse/rollbacks/rollback-<date>-<commit>.db
- Deletes those events from events.db
- Clears projection cache
- git checkout target commit in engine
- Also adds migrate.ts stub (missing file)

Ref: pulse#3
2026-04-18 01:34:26 +00:00
xiaoju 37e3331ccb feat(workflow): add in-memory checkpoint for incremental tick
CI / test (push) Has been cancelled
- WorkflowCheckpoint caches lastEventId, topic summaries, and per-topic events
- First tick: full read (getAfter(0)), subsequent ticks: incremental (getAfter(lastEventId))
- Newly written role events also update checkpoint in-place
- No interface changes, no new files
2026-04-18 01:30:01 +00:00
xiaomo 90f7ba5a62 feat: export new CursorCall interface and executeCursorTask function
CI / test (push) Has been cancelled
2026-04-17 15:28:29 +00:00
xiaomo 2c1ed1419e refactor: thin cursor executor + CursorCall schema (refs xiaoju/pulse#2)
CI / test (push) Has been cancelled
2026-04-17 15:27:59 +00:00
xiaoju e165d1a91d fix: update adapter tests for simplified workflow-rule-adapter
CI / test (push) Has been cancelled
- meta:null test: expect undefined instead of remainingRounds JSON
- maxRounds test: moderator self-counts via meta, no remainingRounds param
- maxTicksPerWindow test: replaced with multi-topic processing test
- Remove 4-arg createWorkflowRule calls (options removed in adaptive-tick refactor)

68 pass, 0 fail
2026-04-17 15:22:36 +00:00
xiaoju 041756117b feat: daemon adaptive tick — 5s active, backoff ×2 up to 5min idle
CI / test (push) Has been cancelled
Replaces fixed 30s setInterval with setTimeout-based adaptive loop.
Resets to 5s when new events detected, backs off to 5min when idle.
2026-04-17 15:03:14 +00:00
xiaomo b6a927cb58 feat: adaptive tick frequency with exponential backoff (closes xiaoju/pulse#1)
CI / test (push) Has been cancelled
2026-04-17 14:19:18 +00:00
xiaoju ee1c0cc9c0 refactor: meta workflow targets ~/.upulse/engine/ instead of pulse repo
CI / test (push) Has been cancelled
- ENGINE_DIR = ~/.upulse/engine for meta coder/reviewer/tester/promoter
- REPO_DIR still used for coding workflow
- Tester accepts buildCmd/testCmd opts, no longer hardcoded to monorepo paths
- Init engine dir with package.json + tsconfig.json + git repo
2026-04-17 14:12:47 +00:00
xiaoju f88d325db8 feat: cli.refactor workflow — auto-generated by meta-workflow
CI / test (push) Has been cancelled
2026-04-17 13:32:42 +00:00
xiaoju 3e30503c08 feat: upulse CLI refactor — 4 commands (init/inspect/workflow/status)
CI / test (push) Has been cancelled
Auto-generated by meta workflow (cli-cleanup topic).
Removed: daemon, deploy, dev, gc, list, tick, ui commands.
Added: status (systemd + db stats), updated inspect + workflow.
2026-04-17 13:30:17 +00:00
xiaoju 620c5a8323 fix: REPO_DIR resolve to pulse root, not repos root
CI / test (push) Has been cancelled
Tester was failing with ENOENT because cwd pointed to
/home/azureuser/repos/packages/pulse (nonexistent) instead of
/home/azureuser/repos/pulse/packages/pulse.
2026-04-17 13:29:54 +00:00
xingyue 6e8b2b7ba6 fix: use effect.kind as fallback for effect type display
CI / test (push) Has been cancelled
2026-04-17 21:26:48 +08:00
xiaoju ba31086c30 fix: daemon cooldownMs=0, add tick logging, systemd service + launcher
CI / test (push) Has been cancelled
- cooldownMs: 0 for both coding and meta workflow rules
- logTick wrapper prints timestamp + elapsed ms per tick
- start-daemon.sh loads secrets before starting bun
- pulse-workflow.service systemd unit (enabled + started)
2026-04-17 13:09:38 +00:00
xiaoju ce36c08e9c feat: restore coding-tdd workflow + barrel exports (lost in rebase)
CI / test (push) Has been cancelled
2026-04-17 13:03:17 +00:00
xiaoju 02847d9001 feat: workflow daemon + submit-task CLI
CI / test (push) Has been cancelled
2026-04-17 13:01:33 +00:00
xiaoju 04ced5b5f0 feat: coding-tdd workflow — auto-generated by meta-workflow 2026-04-17 13:01:33 +00:00
luming c703befcdc chore: remove obsolete binding and broker tests
CI / test (push) Has been cancelled
These tests reference modules (binding.js/broker.js) that no longer exist.

Signed-off-by: Xiaonuo <xiaonuo@git.shazhou.work>
2026-04-17 20:47:06 +08:00
luming 3cdd9aeba6 feat(ui): workflow dashboard — list, timeline, and overview card
CI / test (push) Has been cancelled
- Backend: GET /api/workflows, GET /api/workflows/:topicId/timeline
- Frontend: WorkflowsPage with list view + timeline detail
- Dashboard: workflow overview card (active/completed counts)
- Nav: Workflows entry with Workflow icon

— 小糯/Xiaonuo
2026-04-17 20:41:35 +08:00
xiaoju bf6de91c61 feat(coding): declare maxRounds + moderator remainingRounds awareness
CI / test (push) Has been cancelled
2026-04-17 12:25:17 +00:00
xiaoju a54c36f758 refactor: remainingRounds countdown in event meta, replace maxTicksPerTopic with workflow-declared maxRounds
CI / test (push) Has been cancelled
2026-04-17 11:51:57 +00:00
xiaoju e1a96fdc71 feat: cursor health check + workflow circuit breaker
CI / test (push) Has been cancelled
- 新增 Cursor Health Rule (cursor-health.ts):
  - 监控 ~/.cursor/ai-tracking/ai-code-tracking.db
  - 检查最近 15 分钟内调用次数,默认阈值 100
  - 支持自定义时间窗口、阈值、数据库路径
  - 完整测试覆盖,包括边界情况处理

- 增强 Workflow 保护机制 (workflow-rule-adapter.ts):
  - maxTicksPerTopic (默认20):同一 topic 超限强制写 __end__ 事件
  - maxTicksPerWindow (默认50):1小时内全局 tick 超限暂停所有执行
  - cooldownMs (默认60s):同一 topic 两次 tick 最小间隔
  - 完整事件日志记录,便于调试分析

防止 workflow 死循环空转事故,保护 Cursor Agent 额度不被恶意消耗。

小橘 🍊 (NEKO Team)
2026-04-17 11:37:46 +00:00
xiaoju 2e216c2f81 revert: restore --yolo flag for cursor agent
CI / test (push) Has been cancelled
--yolo = auto-approve permissions, needed for unattended runs.
2026-04-17 10:49:23 +00:00
xiaoju 3f1db4ed58 chore: cursor agent switch from --yolo to auto mode
CI / test (push) Has been cancelled
Save API quota — first day already used 31%.
2026-04-17 10:46:43 +00:00
xiaoju c2a0e8c96b feat: coding workflow — auto-generated by meta-workflow
CI / test (push) Has been cancelled
2026-04-17 10:44:41 +00:00
xiaoju 029417ce33 fix: meta-tester cwd path double-nesting bug
CI / test (push) Has been cancelled
tester was running 'cd packages/pulse && bun test packages/pulse/...'
which doubled the path. Fixed to cwd=packages/pulse + relative paths.
2026-04-17 10:39:40 +00:00
xiaoju 592a5566a5 feat: enhance coding workflow — structured architect design, reviewer retry with retryCount cap
- ArchitectMeta now includes targetFiles, changes (file→description), and verification criteria
- CoderMeta prepPrompt explicitly consumes architect.changes, architect.verification, and reviewer.rejectionReason on retry
- ReviewerMeta now outputs verdict, rejectionReason, and monotonic retryCount (starting from 0)
- Moderator enforces retryCount < 3 limit — forces closer when exceeded
- Updated mock implementations, role factories, and e2e to match new meta structures
- Added test for retry limit (retryCount >= 3 → closer)
2026-04-17 10:27:53 +00:00
xiaoju 4139f1d5d5 fix: tick() returns content+meta in executed roles
CI / test (push) Has been cancelled
- ExecutedRole: { topicId, role, content, meta }
- No more indirect event reading to get role results
- 28 tests pass
2026-04-17 10:14:44 +00:00