Skip to content

feat(telos): parse status/dims/work tokens in PROJECTS.md#1251

Open
brycemagera wants to merge 4 commits into
danielmiessler:mainfrom
brycemagera:feat/telos-projects-parser-tokens
Open

feat(telos): parse status/dims/work tokens in PROJECTS.md#1251
brycemagera wants to merge 4 commits into
danielmiessler:mainfrom
brycemagera:feat/telos-projects-parser-tokens

Conversation

@brycemagera
Copy link
Copy Markdown

Stacked on #1245 — that PR adds the parseTelosProjects() stub; this one fills it out so the dashboard's Projects and Work table actually renders all four columns. Will rebase to a single commit after #1245 lands.

Problem

what.tsx renders a 4-column Projects and Work table: Project / Strategy / Feeds / Work in flight. In #1245 parseTelosProjects() was added as a stub that returns only the title — strategy, dims, and work are hardcoded empty, and status is hardcoded amber. The result is 3 of 4 columns render empty for every project.

Change

Extends parseTelosProjects() to accept three additions in PROJECTS.md:

  1. Inline tokens on the project line: status:, dims: (pipe-delimited)
  2. Strategy already supported via the (ties Sx, Gy) syntax — first S-prefixed id becomes the strategy badge
  3. Work items as 2-space-indented sub-bullets with W\d+ ids and their own inline tokens

Example

```markdown

  • PR1: Project title — description | status:green | dims:money,freedom (ties S0, G2)
    • W1: Work item | strategy:S0 | eta:30d | status:amber | owner:Name
    • W2: Another item | strategy:S0 | eta:60d | status:red | owner:Name
      ```

Tokens

Field Values Default
status (project + work) green | amber | red amber
dims (project only) comma-list, validated against DIMENSIONS.md ids []
strategy (work only) any Sx; falls back to parent project's strategy parent's strategy
eta (work only) free-text \"\"
owner (work only) free-text \"\"

Compatibility

Format-incompatible PROJECTS.md files (no tokens, no sub-bullets) still parse correctly — projects get title only, with empty dims/work and amber status. This is the same shape #1245's stub produced.

Files

  • Releases/v5.0.0/.claude/PAI/PULSE/Observability/observability.tsparseTelosProjects() rewrite (+51 / -9)

Verification

  • API at /api/telos/overview returns the new shape for projects with inline tokens
  • Dashboard renders all four columns when PROJECTS.md uses the format
  • Old-format PROJECTS.md still parses (title only)

sections.tsx: missions[1] fallback → missions[0] + explicit null guard
horizon.tsx:  missions[1] fallback → missions[0]
app.tsx:      initial mission state "M1" → "M0"; useEffect to reset to
              first available id when live data loads

Complements danielmiessler#1147 (data plumbing). Crash affects any user with < 2
missions: TypeError: Cannot read properties of undefined (reading 'horizon').
The TELOS schema uses '- **ID:** text' bullet lists for missions,
problems, strategies, and challenges. handleTelosOverview previously
piped these through parseSections → parseSourceHeadings, which expects
'## ID: title' section headings — so all four fields returned [].

Fix: add parseBulletIds(content, prefix) — generalises the existing
parseGoals bullet regex to any prefix — and call it directly from
handleTelosOverview with the correct type shapes:
  - missions: {id, title, horizon: 'lifetime'}
  - problems:  {id, title, note, severity: 'med', affects: []}
  - strategies: {id, title, overcomes: [], implements: []}
  - challenges: {id, title, note, blocks: []}

goals continue to use the existing handleLifeGoals → parseGoals path
which already supports the bullet format.

Also wire up use-telos-data.ts: replace the FALLBACK-only stub with a
real useQuery fetch from /api/telos/overview, merged over FALLBACK so
unset fields degrade gracefully.

Rebuilt Observability/out/ to ship the updated static export.

Complements danielmiessler#1127 (standalone telos page) and danielmiessler#1147 (data plumbing).
Closes the remaining gap where the dashboard showed sample data despite
the endpoint and data plumbing being in place.
Extends the Telos v7 dashboard to populate fields that previously returned
null. Builds on the bullet-format parsing and crash guards in this branch.

## New parser functions (observability.ts)

- parseOwner() — reads PRINCIPAL_IDENTITY.md for display name + today's date
- parseDimensionsFile() — parses DIMENSIONS.md pipe-delimited bullets
- parseTelosMetrics() — parses METRICS.md id-prefixed bullets (MT/MH/MF etc.)
- parseTelosProjects() — parses PROJECTS.md via parseBulletIds (PR prefix)
- parseTelosTeam() — parses TEAM.md pipe-delimited bullets (T0, T1...)
- parseTelosBudget() — parses BUDGET.md pipe-delimited bullets (B0, B1...)
- parsePreferences() — reads USER/Books.md, Movies.md, Authors.md, Wisdom.md,
  Sparks.md with ★-filter for favorites; section headings for hobbies

## handleTelosOverview wired fields

owner, idealState, dimensions, metrics, projects, team, budget,
subtabs (derived from dimensions), preferences

Remaining null (needs sensor data or generation): snapshot, recommendations,
stranded, narrativeSeed

## use-telos-data.ts

Expanded LiveTelos interface with 11 new optional fields; added matching
conditional spreads to the telos merge object so live data overrides FALLBACK
field-by-field.

## Template files (new)

TELOS/DIMENSIONS.md — 6 life dimensions with cur/ideal/velo/color format
TELOS/METRICS.md   — starter KPI template
TELOS/TEAM.md      — team roster template (DA entry pre-populated)
TELOS/BUDGET.md    — resource budget template (money/time/attention)

Depends on: fix/pulse-telos-dashboard (bullet parsers + crash guards)
Extends parseTelosProjects() to populate the Strategy / Feeds / Work in
flight columns in the /telos dashboard. Previously the parser only read
the title and hardcoded the other fields, so 3 of 4 columns in what.tsx
rendered empty.

Inline-token format on the project bullet:

    - **PR1:** Title — description | status:green | dims:money,freedom (ties S0, G2)
      - **W1:** Work item | strategy:S0 | eta:30d | status:amber | owner:Name

Tokens supported on project lines:
  - status:green|amber|red (default amber)
  - dims:id1,id2,...     (validated against DIMENSIONS.md)
  - (ties Sx, Gy)        existing syntax; first S-id becomes strategy

Sub-bullets matching W\d+ become work items with their own status,
strategy, eta, and owner tokens. Strategy on a work item defaults to
the parent project's strategy when not specified.

Format-incompatible PROJECTS.md files (no tokens, no sub-bullets) still
parse as before — projects get title only, with empty dims/work and
amber status.
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.

1 participant