Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

RFC: silent-fail on unrecognized CURRENT_STATE status keyword computes 0% coverage instead of erroring

Open waveman2020-sudo opened this issue 4 months ago • 1 comments

Environment

  • OS: Ubuntu 24.04.4 LTS, kernel 6.17.0-1025-oem, x86_64
  • Hardware: Lenovo ThinkPad (product name 21RXCTO1WW), AMD Ryzen AI 9 HX PRO 370 w/ Radeon 890M
  • Runtime: bun 1.3.11
  • LifeOS install: fresh install (a few days old at time of writing)

What happened

While manually migrating real content into USER/TELOS/CURRENT_STATE/HEALTH.md and INFRASTRUCTURE.md, I used status: populated for entries with real data (a reasonable-sounding synonym), instead of the literal status: have that TOOLS/UpdateLifeosState.ts's computeFromCurrent() actually parses:

const have    = (content.match(/\bstatus:\s*have\b/g)    || []).length;
const partial = (content.match(/\bstatus:\s*partial\b/g) || []).length;
const missing = (content.match(/\bstatus:\s*missing\b/g) || []).length;

Result: every entry I'd filled in with real content silently failed to match any of the three recognized keywords, so have=0, and the dimension reported 0% coverage on Pulse's dashboard despite 3 of 5 (health) / 2 of 4 (infrastructure) categories genuinely being populated. No error, warning, or log — it just silently computed as if the file were empty.

I found and fixed both instances locally (swapped populated → have), and confirmed the percentages then computed correctly (health 0%→60%, infrastructure 17%→50%).

Why this isn't just a one-off typo

I checked the shipped installer template (skills/LifeOS/install/USER/TELOS/CURRENT_STATE/{HEALTH,INFRASTRUCTURE}.md) to see if the template itself carried the bug. It doesn't — it ships safely with status: missing everywhere. But its own instructional comment only says:

Run /interview to replace missing with your real state.

It never states that have / partial / missing are the only three recognized values. A human filling this out by hand — or an AI doing the same, as I was — has no signal that "populated," "done," "yes," "complete," etc. will silently compute as zero credit rather than erroring. This is a trap for every future user filling this file out organically, not something specific to my install.

Request for change

  1. Add validation to UpdateLifeosState.ts's computeFromCurrent() — when a status: line's value doesn't match have|partial|missing (case-insensitive), warn (console + maybe a line in the generated JSON) rather than silently treating it as unmatched. A regex like /\bstatus:\s*(\S+)/g capturing the actual word, diffed against the three valid values, would catch this class of error immediately instead of silently reporting a wrong percentage.
  2. Document the exact vocabulary in the shipped template's instructional comment — e.g. "Replace missing with exactly have or partial — no other values are recognized" — so a first-time user (or an AI assisting one) doesn't have to read the generator's source to know the contract.

Both are small, low-risk changes. Happy to submit a PR for either/both if useful — flagging here first since I'm not sure which approach (validation vs. documentation vs. both) the maintainers would prefer.

waveman2020-sudo avatar Jul 16 '26 08:07 waveman2020-sudo

Fixed in source. UpdateLifeosState.ts now fails loud on any unrecognized status: keyword — it names the bad keyword, the file, and the valid set on stderr instead of silently computing wrong coverage. Your RFC framing was right: the silent degrade was the bug, not the typo. Ships in the next release.

Thanks for the clean, reproducible report — you're also in the new Credits section now.

danielmiessler avatar Jul 16 '26 21:07 danielmiessler