Pulse: a TELOS goal cannot show KPI and Target on /telos and still appear correctly on /life
Version
LifeOS 7.40.4 / Pulse
What is broken
A TELOS goal cannot show its KPI and Target on /telos and also appear correctly on /life.
The goal cards and the goal modal on /telos print kpi ("where it is") and target ("aiming for"). handleTelosOverview fills them with pickBulletValue(g.body, "KPI") and pickBulletValue(g.body, "Target"), which need each key at the start of a line. For a goal in the shipped bullet form (- **G1:** text with indented children), pass 2 of parseIdEntries joins the children into one line, so kpi swallows the Target text and target stays empty.
Writing the goal as a ### G1: text heading keeps the lines apart and both fields come out right. But /api/life/goals and /api/life/home use parseGoals, which accepts only bullet lines, and whose prose fallback drops every paragraph that starts with #. The goal then disappears from /life, or comes back with a positional ID and the KPI line as its text.
So no way of writing a goal gives correct data on both pages. The shipped scaffold has no KPI or Target child, so the expected spelling is not shown anywhere either.
Where (file:line)
LIFEOS/PULSE/Observability/observability.ts:
:4228-4229:kpi:andtarget:viapickBulletValue:3313: pass 2 ofparseIdEntries,bulletCur.body.join(" "):3396: thepickBulletValueregex, anchored with^and themflag:2270-2289:parseGoals, the bullet filter and then the prose fallback that dropsp.startsWith("#")
Display: LIFEOS/PULSE/Observability/src/app/telos/_v7/modal.tsx:47-48 and why.tsx:46.
Repro on a clean tree
cd ~/.claude && F=LIFEOS/PULSE/Observability/observability.ts
{ sed -n '2270,2289p;3169,3171p;3280,3391p;3394,3399p' "$F"; cat <<'EOF'
const formats: Record<string, string> = {
"A bullet, indented children": "- **G1:** Reach 100 customers.\n - KPI: 12 customers\n - Target: 100 customers by June\n",
"B heading, children directly under": "### G1: Reach 100 customers.\n- KPI: 12 customers\n- Target: 100 customers by June\n",
"C heading, blank line, children": "### G1: Reach 100 customers.\n\n- KPI: 12 customers\n- Target: 100 customers by June\n",
};
for (const [name, text] of Object.entries(formats)) {
const g = parseIdEntries(text, "G")[0];
console.log(name, "\n /telos kpi:", JSON.stringify(pickBulletValue(g.body, "KPI")), "target:", JSON.stringify(pickBulletValue(g.body, "Target")),
"\n /life goals:", JSON.stringify(parseGoals(text)));
}
EOF
} > /tmp/goal-format-repro.ts && bun /tmp/goal-format-repro.ts
The script copies parseGoals, cleanInlineMarkdown, parseIdEntries and pickBulletValue out of the shipped file by line range and runs them on one goal written three ways.
Negative control
On unpatched 7.40.4:
A bullet, indented children
/telos kpi: "12 customers - Target: 100 customers by June" target: null
/life goals: [{"id":"G1","text":"** Reach 100 customers."}]
B heading, children directly under
/telos kpi: "12 customers" target: "100 customers by June"
/life goals: []
C heading, blank line, children
/telos kpi: "12 customers" target: "100 customers by June"
/life goals: [{"id":"G0","text":"KPI: 12 customers - Target: 100 customers by June"}]
Each format is wrong on one of the two pages. The ** in front of the text in format A is a separate defect, reported in #2277.
Suggested fix
Untested. In pass 2 of parseIdEntries, keep a bullet entry's continuation lines as separate lines instead of joining them with a space, so pickBulletValue can find KPI and Target in the shipped bullet form. Optionally let parseGoals accept ### G<n>: headings as well. A sample KPI and Target child in the scaffold would document the spelling.
Before submitting
- [x] I searched open and closed issues for this defect.
- [x] The repro runs against a clean tree of the version above, not against my modified install.
- [x] I removed personal data from the pasted output — real names, absolute home paths, tokens, my own content.
[!NOTE] 🤖 Kai (AI assistant) responding on behalf of Daniel Miessler
Thanks @rain77-work. The heading-form half of this was already fixed in v7.47.0, which accepts ### G<n>: headings. The bullet-form half was still broken. parseIdEntries joined the indented child lines with a space, so - KPI: … - Target: … became one line, the KPI field took the Target text, and Target and Progress came back wrong.
Fixed in source. Child lines are now joined with newlines, so each field is read from its own line. A test runs your three goal shapes and checks KPI, target and progress for each, and that parseGoals still returns the goals.
The scaffold template is unchanged. This ships in the next release.