#2160·LifeOS

`bun Services.ts doc` does not reproduce the table in `BackgroundServices.md`: two registered services are missing from the doc, and three of its rows cannot be generated

Author: tzioupCreated Sep 19, 2026Updated Sep 29, 2026

Version

LifeOS 7.40.4. Verified against a --depth 1 clone of tag v7.40.4, SHA be9e8ef889f00a29f4fd677dee4772fdf32e07ce (git ls-remote --tags confirms the tag resolves there). The repro below clones the public repo itself and runs under env -i with a throwaway HOME, so it depends on nothing local to my machine and reads nothing from an existing install.

What is broken

LIFEOS/DOCUMENTATION/Services/BackgroundServices.md states in three places that its services table is machine-produced: frontmatter generator: LIFEOS/TOOLS/Services.ts (run bun Services.ts doc to regenerate the table) at line 6, a command in the prose at line 20, and an HTML marker directly above the table at line 39 reading generated by bun LIFEOS/TOOLS/Services.ts doc — do not hand-edit; update SERVICES in Services.ts. The section heading at line 37 is "The services (generated from live plists)", and the doc's opening line promises "Every recurring Mac service LifeOS runs, in one place".

Running that generator against the shipped payload produces a different table. It emits 22 rows; the committed table has 23. Twenty labels are shared. Three labels in the committed table are not emitted — com.lifeos.amberroute, com.lifeos.bookmark-watchdog, com.lifeos.backups — and two labels the generator does emit are absent from the committed table: com.lifeos.interviewdue and com.lifeos.pegwatch.

The omission is the half with a cost. Both missing services are ordinary entries in the shipped SERVICES registry with their installers in the payload, so on a fresh public install bun Services.ts install --all --yes stands up a daily Interview due-check job and a 16-minute PegWatch CPU/GPU sweep, neither of which is named anywhere in the file that claims to list every recurring service. grep -ci 'interviewdue\|pegwatch' over the whole doc returns 0, so there is no prose mention either.

The three extra rows are less severe: each one's Install cell already carries the generator's containment marker, "per-install private infrastructure — defined in LIFEOS/USER/CONFIG/services.json, NOT in the public release payload", so a reader is told those are not shipped. What they establish is that the committed table cannot be the output of the shipped generator on a public tree: loadUserServices() reads $HOME/.claude/LIFEOS/USER/CONFIG/services.json, and the payload ships USER/CONFIG/ without a services.json in it.

One cell's text has drifted independently of row membership. The generator prints s.purpose verbatim; the distill row's Purpose in the doc (line 50) reads "content ideas → work issues, improvements → Upgrades store, archive health report; stateful dedupe", while the registry string reads "content ideas, upgrades, archive health."

I am not claiming to know how this happened; the clone is single-commit and carries no history. The pattern is consistent with the table having been generated on an install that had a services.json and an older registry — frontmatter last_updated is 2026-07-08T00:00:00Z — but that is a guess, offered as one.

Where (file:line)

The doc and the registry disagree about the service list, and the doc names the registry as its own source.

  • Writer (the declared source of truth): LIFEOS/TOOLS/Services.ts:63 — export const SERVICES: Svc[], 22 entries. :109 is com.lifeos.interviewdue; :129 is com.lifeos.pegwatch. Neither amberroute nor bookmark-watchdog nor com.lifeos.backups appears in the file.
  • Generator: LIFEOS/TOOLS/Services.ts:311-323 — the doc branch, which iterates allServices() = SERVICES + loadUserServices() and prints one row each.
  • Per-instance source: LIFEOS/TOOLS/Services.ts:145 — USER_SERVICES_PATH = LIFEOS/USER/CONFIG/services.json. Absent from the payload, so loadUserServices() returns [] on any public install (the source comment at :139-145 says exactly this).
  • Reader (the committed table): LIFEOS/DOCUMENTATION/Services/BackgroundServices.md:43-65. The three non-generable rows are :63 (amberroute), :64 (bookmark-watchdog), :65 (backups). The drifted Purpose cell is :50.
  • The marker that says the table is generated: BackgroundServices.md:39; frontmatter generator: at :6.
  • No staleness check exists for this doc: LIFEOS/TOOLS/Services.ts:376 — the usage line is <status|install|uninstall|doc>; there is no check mode. Nothing in the payload invokes Services.ts doc outside the doc's own prose.

Two related lines, for context rather than as part of the claim. The doc's "Fresh install" paragraph at :69 still says DeployComponents.ts "currently covers ~9 components; wiring it to read Services.ts's registry so a single Setup step covers all 16 is the tracked follow-up" — that follow-up appears to be what #1872 closed in code for the next release, and the registry now holds 22 entries rather than 16. (The shipped directory is USER/CONFIG/; LIFEOS/USER is the symlink the installer creates at install time, which is why a plain payload copy has no LIFEOS/USER/CONFIG/ until then.)

skills/LifeOS/Tools/DeployComponents.ts:57-61 still lists the same three short labels at this tag; #1872 closed on 2026-08-17, three days after it was cut, so once that lands this doc becomes the only place in the payload naming them as services.

Repro on a clean tree

Self-contained, about twenty seconds. Save as repro-up18.sh and run bash repro-up18.sh. It clones the public repo at the tag, builds an isolated HOME from the payload, and reads nothing from an existing install. It installs nothing and never calls launchctl.

bash
#!/usr/bin/env bash
# UP-18 repro: does `Services.ts doc` reproduce the shipped BackgroundServices.md table?
set -u

WORK="$(mktemp -d)"
git clone --depth 1 --branch v7.40.4 https://github.com/danielmiessler/LifeOS.git "$WORK/repo" >/dev/null 2>&1
P="$WORK/repo/LifeOS/install"

# A clean HOME containing only the release payload: no ~/Library/LaunchAgents,
# no LIFEOS/USER/CONFIG/services.json. `env -i` so no ambient LIFEOS_* var leaks in.
mkdir -p "$WORK/home"
cp -R "$P" "$WORK/home/.claude"

env -i PATH="$PATH" HOME="$WORK/home" \
  bun "$WORK/home/.claude/LIFEOS/TOOLS/Services.ts" doc > "$WORK/generated.md"

# Compare the SET OF SERVICES, not whole rows: the Cadence column is read from
# live plists by design, so it is machine-dependent. The row set is not — it is
# SERVICES[] plus a USER-tree services.json that no public install has.
lbl() { grep '^| \*\*' "$1" | sed -E 's/^\| \*\*[^*]*\*\* `([^`]+)`.*/\1/' | sort; }
lbl "$P/LIFEOS/DOCUMENTATION/Services/BackgroundServices.md" > "$WORK/shipped.labels"
lbl "$WORK/generated.md"                                     > "$WORK/generated.labels"

echo "rows in shipped doc table : $(wc -l < "$WORK/shipped.labels" | tr -d ' ')"
echo "rows the generator emits  : $(wc -l < "$WORK/generated.labels" | tr -d ' ')"
echo
echo "in the shipped table, NOT emitted by the generator:"
comm -23 "$WORK/shipped.labels" "$WORK/generated.labels" | sed 's/^/  /'
echo "emitted by the generator, NOT in the shipped table:"
comm -13 "$WORK/shipped.labels" "$WORK/generated.labels" | sed 's/^/  /'
echo
if diff -q "$WORK/shipped.labels" "$WORK/generated.labels" >/dev/null; then
  echo "RESULT: match (nothing to report)"; exit 0
else
  echo "RESULT: mismatch"; exit 1
fi

Observed:

rows in shipped doc table : 23
rows the generator emits  : 22

in the shipped table, NOT emitted by the generator:
  com.lifeos.amberroute
  com.lifeos.backups
  com.lifeos.bookmark-watchdog
emitted by the generator, NOT in the shipped table:
  com.lifeos.interviewdue
  com.lifeos.pegwatch

RESULT: mismatch

Exit code 1.

Two static checks, same clone, that show the omitted pair is real and reachable:

bash
cd LifeOS/LifeOS/install

# registered, with installers in the payload
grep -n 'com.lifeos.interviewdue\|com.lifeos.pegwatch' LIFEOS/TOOLS/Services.ts
ls LIFEOS/TOOLS/InstallInterviewDue.ts LIFEOS/TOOLS/InstallPegWatch.ts

# and named nowhere in the doc that lists every service
grep -ci 'interviewdue\|interview due\|pegwatch' LIFEOS/DOCUMENTATION/Services/BackgroundServices.md

Observed:

109:  { label: "com.lifeos.interviewdue", title: "Interview due-check", category: "maintenance", optIn: true,
129:  { label: "com.lifeos.pegwatch", title: "PegWatch (CPU/GPU peg detector)", category: "sweep", optIn: true,
LIFEOS/TOOLS/InstallInterviewDue.ts
LIFEOS/TOOLS/InstallPegWatch.ts
0

And what the installer would actually do. install without --yes is the dry preview: the code prints its targets and process.exit(0) before reaching any launchctl call, so this writes nothing and loads no job.

bash
env -i PATH="$PATH" HOME="$WORK/home" \
  bun "$WORK/home/.claude/LIFEOS/TOOLS/Services.ts" install --all

Observed (20 lines; the two the doc never names are marked):

Installing 20 service(s):
  (dry preview — re-run with --yes to execute)
  com.lifeos.pulse: bash ~/.claude/LIFEOS/PULSE/manage.sh install
  ...
  com.lifeos.interviewdue: bun ~/.claude/LIFEOS/TOOLS/InstallInterviewDue.ts    <-- absent from the doc
  ...
  com.lifeos.pegwatch: bun ~/.claude/LIFEOS/TOOLS/InstallPegWatch.ts            <-- absent from the doc
  com.lifeos.bunkermonitor: bun ~/.claude/LIFEOS/TOOLS/InstallBunkerMonitor.ts

(20 rather than 22 because synthesis and distill carry #-prefixed non-runnable install notes and are filtered out at Services.ts:326.)

Negative control

The control is the generator's own output against the committed file, which is why the repro is one script rather than a reading of the diff: the check is the thing the doc's marker asserts will pass.

On unpatched v7.40.4 the script exits 1, with three labels on one side and two on the other. If the committed table were what the shipped generator produces from the shipped registry, comm would print nothing on either side and the script would exit 0 with RESULT: match (nothing to report). That is the same script, the same clone, the same command — only the contents of the two files decide which branch it takes. Nothing needs to be edited to move it, and nothing in the script knows what the answer should be.

Three further controls in the same run:

  • The comparison is payload-only. The row set is SERVICES[] plus loadUserServices(), and the latter's source file is not in the payload (find for services.json under the copied tree returns nothing; LIFEOS/USER/CONFIG/ does not exist). So the 22 is fixed by the release, not by the machine running it.
  • The two columns that are machine-dependent are deliberately excluded. Cadence is parsed from live plists (cadenceOfDarwin, Services.ts:246-256) and renders — on a tree with none installed; and for #-prefixed entries the Install cell skips the HOME → ~ substitution the other branch applies (:322). Comparing whole rows would go red for those reasons too, which would be noise. Comparing labels isolates the claim.
  • Services.ts status was not used and is not quoted anywhere here. It calls launchctl list (:173), which reports the state of the machine running it rather than anything about the release. doc and the install dry preview call neither launchctl nor systemctl.

Suggested fix (options, none of them tested)

  1. Regenerate and commit the table, plus the three prose mentions — but not by pasting generator output as-is. The generated distill row carries the regenerating machine's absolute home path: :322 applies a HOME → ~ substitution on the normal branch, while the # branch is s.install.slice(1).trim() with no substitution at all. I hit this on my own run, where the row came back containing the full path of the scratch tree. That is the leak the comment at :317-319 says the per-instance branch exists to prevent, so regenerating into a public doc needs that cell checked by hand until the substitution covers both branches. The doc's body also names the non-shipped services outside the table — :18-19 uses amberroute as the --only example, :32 refers to "the bookmark watchdog", :35 to "backups" — so regenerating alone leaves the prose behind. bun LIFEOS/TOOLS/Services.ts doc on a tree without a private services.json, pasted between the marker at :39 and the end of the table. That alone makes the file match its marker and puts interviewdue and pegwatch in front of readers.
  2. Add a check mode and wire it to release. ArchitectureSummaryGenerator.ts in the same payload already has the shape — its header reads check Check if summary is stale (exit 1 if stale, 0 if fresh), and hooks/handlers/RebuildArchSummary.ts:37 invokes the generator. A Services.ts doc --check comparing emitted rows to the committed block, run at release time, would make this class of drift fail loudly rather than ship.
  3. Decide what the doc should say about per-instance services. If the three USER-tree rows are meant to be visible to public readers, they need a source the payload has; if they are not, the containment branch at :320-322 could skip perInstance entries entirely when generating a doc destined for the release, so a regeneration on a maintainer's machine produces the same table as on a clean one. Option 2 does not fix this on its own — a check run on a machine that has services.json would go green on a table a public reader cannot reproduce.

#1812 is the precedent, and this file is the evidence for what that remedy amounts to. Its close says marker-stamping means the doc and the manifest "can no longer drift apart silently" — and this document carries that same generated-by marker at this tag while having drifted. A marker records a claim; it does not check one. At this tag HookSystem.md's regenerated blocks carry a date-stamp comment (:72, :114, :153, :241, :319: "regenerated from settings.json 2026-08-10") and nothing verifies it. The one generated doc with a real check-and-rebuild is ARCHITECTURE_SUMMARY.md, whose check runs from hooks/DocIntegrity.hook.ts:45 via handlers/RebuildArchSummary.ts. So the remedy has landed per document rather than as a check covering every marker-stamped file, and DocIntegrity.hook.ts is the natural host for a Services.ts doc --check.

Scope — what I did not verify

  • Why the table diverged. Single-commit clone, no history inspected, no claim made. The mechanism in "What is broken" is marked as a guess.
  • Whether InstallInterviewDue.ts and InstallPegWatch.ts succeed. I read them into the dry-preview target list and confirmed both files ship. I did not execute either, and installed, loaded and started no launchd job at any point.
  • Any runtime consequence. None measured. The cost I can show is that a doc promising a complete list is missing two entries that install --all will create, and carries three a public install cannot have.
  • Linux. Everything above ran on macOS. Services.ts branches on process.platform for cadence and discovery, but the row set is platform-independent, so I expect the same result on Linux — untested.
  • skills/LifeOS/Workflows/Setup.md:49. I looked at this as a possible second instance and concluded it is not one. Its pulse | optional is in a table headed Default, describing the à-la-carte enhancements menu run by DeployComponents.ts, where every row but hooks reads optional. The doc's core is the Opt-in column reporting optIn: false on the registry entry, meaning Services.ts install with no flags includes it. Different installers, different questions; both are true. Mentioned only so it does not get filed as a follow-up.

Confirmations

  • Searched open and closed issues before filing. #2036 (CLOSED, mine) already tabled the com.lifeos.backups row at BackgroundServices.md:65 as inert for want of services.json, and its close says a template now exists in source — which is why this report does not lead with the three per-instance rows and claims nothing about backups beyond "not generable from this payload". Other prior art: #1872 (CLOSED) names the same three orphan labels but fixes DeployComponents.ts's own list, not this doc, and does not mention interviewdue or pegwatch; #1812 (CLOSED) is the same shape on HookSystem.md and is cited above as the precedent rather than a duplicate; #1926 (CLOSED) is a stale hand-maintained inventory table in MemorySystem.md. Queries included BackgroundServices, Services.ts, backups service, launchd, service registry, generated doc drift, amberroute, bookmark-watchdog, pegwatch, interviewdue, doc drift, regenerate table, services.json, do not hand-edit. pegwatch and interviewdue return zero results across the full issue history.
  • Repro runs on a clean tree. The script clones the public repo at v7.40.4 itself, builds an isolated HOME under mktemp -d, and runs under env -i; it reads nothing from an existing install and installs nothing.
  • Personal data removed. No home paths, usernames, hostnames, or install-specific values appear above; every path is either a repo-relative payload path or a $WORK/~ placeholder.