Skip to content

fix(pulse): auto-start user-index module on Pulse startup#1197

Closed
jonesy1234 wants to merge 1 commit into
danielmiessler:mainfrom
jonesy1234:fix/pulse-auto-start-user-index
Closed

fix(pulse): auto-start user-index module on Pulse startup#1197
jonesy1234 wants to merge 1 commit into
danielmiessler:mainfrom
jonesy1234:fix/pulse-auto-start-user-index

Conversation

@jonesy1234

Copy link
Copy Markdown

Summary

The user-index module (Pulse/modules/user-index.ts) exports a full
start() / stop() / health() lifecycle and is designed to be a
first-class Pulse module — it scans USER/, builds
Pulse/state/user-index.json, and sets up fs.watch for live
updates. However, pulse.ts never imports or starts it, so the index
is only built when a user manually runs
bun run Pulse/modules/user-index.ts.

Result on a fresh install: the Life Dashboard, /api/user-index, the
Daemon publish_feed, and the Interview skill's gap detection all read
a missing or stale index until the user discovers the manual command.

Reproduction

  1. Fresh PAI install, Pulse running
  2. Add or edit any file under USER/ (e.g. create USER/TELOS/Foo.md)
  3. Visit http://localhost:31337/life or hit /api/user-index
  4. Observe: new file does not appear; Pulse/state/user-index.json
    mtime is unchanged from install time

Fix

Wire modules/user-index into pulse.ts using the same always-load
pattern as modules/wiki:

  • Conditional import in loadModules() (try/catch — module is optional)
  • await userIndexModule.start() in the startup sequence so the
    initial scan + fs.watch daemon both run

Also documents the module in PULSE.toml.example.

Risk

Minimal. Module is opt-out via try/catch (matches wiki). The
start() function already exists, was already tested via the
standalone CLI, and writes to a path Pulse's own observability module
already serves. No new deps. No breaking changes.

Verification

  • Patched pulse.ts transpiles cleanly (bun build --no-bundle)
  • Edits match the existing always-load module pattern (wiki) line-for-line
  • No changes to module API surface — user-index.ts is unmodified

Maintainer testing recommended:

  • Pulse starts cleanly with the change applied
  • Pulse/state/user-index.json is written on first startup
  • Editing a USER/*.md file updates the index within ~250ms
    (existing debounce in user-index.ts)
  • bun run Pulse/modules/user-index.ts standalone CLI still works

The user-index module (Pulse/modules/user-index.ts) exports a full
start()/stop()/health() lifecycle and is designed to be a first-class
Pulse module — it scans USER/, builds Pulse/state/user-index.json,
and sets up fs.watch for live updates. However, pulse.ts never imports
or starts it, so the index is only built when a user manually runs
`bun run Pulse/modules/user-index.ts`.

Result on a fresh install: the Life Dashboard, /api/user-index, the
Daemon publish_feed, and the Interview skill's gap detection all read
a missing or stale index until the user discovers the manual command.

Wire modules/user-index into pulse.ts using the same always-load
pattern as modules/wiki: conditional import in loadModules() and
await userIndexModule.start() in the startup sequence so the initial
scan + fs.watch daemon both run. Also document the module in
PULSE.toml.example.

Module is opt-out via try/catch (matches wiki). No new deps.
No breaking changes.
@danielmiessler

Copy link
Copy Markdown
Owner

Hey @jonesy1234, thank you for the PR and the work that went into it.

We're changing how LifeOS ships: from a full ~/.claude directory you run as-is, to a skill installed by an agentic installer that has your own AI integrate the pieces into your setup. That reworks the parts of the codebase this change touches, so it won't apply cleanly to where we're headed.

We're closing it for that reason, not because the idea was wrong. If the need still stands against the new model, we'd love a fresh PR once it lands. Thanks again for contributing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants