# Design Document See [RFC #44: Pulse — Agent 的自主神经系统](https://github.com/oc-xiaoju/ograph/issues/44) ## Summary ### Core Formula ``` f(prevSnapshot, currSnapshot) → (Effect[], tickMs) ``` ### Key Properties - **Moore Machine** — Effects determined by state, not events. Pulse polls projection values, not event streams. - **Path Dependent** — Sampling is lossy. A→B + B→C ≠ A→C at the effect level. Poll frequency = resolution of reality. - **S Combinator** — Single composition primitive. `pulse = S r3 . S r2 . S r1 $ dummy` - **Not Forced Pure** — Rules can be async/impure. Framework doesn't distinguish certain/uncertain. - **Agent Managed** — The rule repo is managed by the Agent. Types, rules, collectors, effectors — all TypeScript, all under `tsc` guard. - **Staging via git worktree** — Safe experimentation before promote to production. ### Packages | Package | Purpose | |---------|---------| | `@uncaged/pulse` | Core engine: `runPulse()` + `Rule` type + `executorLoop` + task projections. Generic, zero deps. | | `@uncaged/pulse-openclaw` | OpenClaw adapter: Gateway/LLM watchers + OC-specific rules + executors. | | `@uncaged/pulse-cursor` | Cursor Agent CLI executor adapter. | | `@uncaged/pulse-hermes` | Hermes Agent adapter. | | `@uncaged/upulse` | CLI: daemon lifecycle + test/staging/promote + embedded WebUI |