dotfiles
bugabingas dorkfiles
owned by bugabinga
pulse: cover timer trigger
d148426dcea0ba88eb1c007fb0e5f439e805999e
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (2)
pi/agent/extensions/pulse/README.md
Modified+28 / −2 text lines
4 4 Living documentation sync for Pi.
6 -Tracks docs and applies validated model-proposed updates when project files change.
6 +Tracks docs and applies validated model-proposed updates after workspace changes or periodic checks.
8 -Apply modes: `auto` (default), `confirm`, `review` in `.pi/pulse.json`.
10 +Load extension, then run:
13 +- `/pulse add <file> [note]`
14 +- `/pulse add-dir <dir> <glob> [note]`
15 +- `/pulse add-glob <glob> [note]`
23 + "documents": [{
"path":
"README.md" }],
29 +`apply`: `auto` (default), `confirm`, `review`.
36 +- `/pulse pause` / `/pulse resume`
pi/agent/extensions/pulse/__tests__/harness.test.ts
Modified+34 / −0 text lines
145 145 await t.session.extensionRunner.
emit({ type:
"session_shutdown", reason:
"quit" });
148 + it(
"runs periodic idle checks from the timer",
async ()
=> {
149 + const realSetInterval
= globalThis.setInterval;
150 + const realClearInterval
= globalThis.clearInterval;
151 + const realNow
= Date.now;
152 + let tick
: (()
=> void)
| undefined;
154 + globalThis.setInterval
= ((
fn: ()
=> void)
=> {
158 + globalThis.clearInterval
= (()
=> {})
as never;
159 + Date.
now = ()
=> now;
162 + t
= await createTestSession({ extensions: [
pulsePath()] });
163 + writeFileSync(path.
join(t.cwd,
"README.md"),
"old",
"utf8");
164 + writeConfig({ interval:
1, documents: [{ path:
"README.md" }] });
166 + await t.session.extensionRunner.
emit({ type:
"session_start", reason:
"startup" });
167 + expect(tick).
toBeDefined();
169 + now
= 6 * 60 * 1000;
171 + await new Promise((resolve)
=> realSetInterval(resolve,
10));
173 + expect(
notifyText().
some((m)
=> m.
startsWith(
"Pulse: missing auth"))).
toBe(
true);
174 + await t.session.extensionRunner.
emit({ type:
"session_shutdown", reason:
"quit" });
176 + globalThis.setInterval
= realSetInterval;
177 + globalThis.clearInterval
= realClearInterval;
178 + Date.now
= realNow;