---
name: work-tracker
description: |
  Open the work tracking UI. Starts the local server and tells you to
  open it in the browser. Use to review areas, projects, actions, and
  plan progress visually. Use when: "work tracker", "show work",
  "open tracker", "show projects", "show actions", "/work-tracker".
related:
  - type: file
    path: scripts/work-tracker-server.mjs
    role: "Local HTTP server for work tracker UI"
  - type: file
    path: scripts/work-tracker-ui.html
    role: "Browser-based work tracking interface"
  - type: file
    path: scripts/pib-db.mjs
    role: "Data layer — containers (areas/projects) and actions in pib.db"
---

# /work-tracker — Work Tracking UI

## Purpose

Open the visual work tracker so the user can review containers and
actions in a browser rather than through conversation.

The board holds **two kinds of container with opposite completion
semantics**, and the UI renders the difference: an **area** (a standing
responsibility that never completes) shows a throughput figure — "N
open · M closed in 30d" — and no progress bar, because its health is
flow; a **project** (an outcome that completes) shows open/total, a
percent, and a progress bar. Both carry a small uppercase kind tag and
interleave in one "Areas & Projects" list. Kind is read from the tag,
never inferred from the `prj:` fid prefix (a stable namespace, not a
type claim). On a freshly migrated tracker every container is an area —
promoting one to a project is the operator's call, made one container
at a time.

Containers **nest one level**: an area holds projects, a project holds
actions, and a project may not contain another project. The board says
so in words rather than in structure — a project's header reads "in
Live Ops", an area's reads "3 projects", and the list stays flat with
no indentation. An area's header figures ROLL UP (its own actions plus
the actions of the projects inside it, with "(incl. N in projects)"
spelled out); the action rows under a card stay direct, so nothing is
printed twice, and a footer line names the projects holding the rest.
A project whose area was deleted reads "area deleted" — the link is
suspended, not cleared.

## Steps

1. **Check database exists:**
   ```bash
   ls pib.db
   ```
   If missing, initialize it:
   ```bash
   node scripts/pib-db.mjs init
   ```

2. **Start the server:**
   ```bash
   node scripts/work-tracker-server.mjs --port 3458
   ```
   Run this in the background. If port 3458 is taken, try 3459.

3. **Tell the user** to open `http://localhost:3458` in their browser.

4. **Stay available.** The user may come back with questions about what
   they see, or ask you to create/update containers and actions based
   on their review. Use the pib_* MCP tools (or `scripts/pib-db.mjs`)
   for any mutations they request — the same gates apply either way.

## Notes

- The server must keep running for the UI to work. If the user ends
  the conversation, the server stops.
- Tabs: **Areas & Projects** (both kinds, interleaved, kind-tagged),
  **Ready** (what can start now — dependency edges and trigger state
  respected), **Blocked**, **All Actions**, **Flagged**.
- Containers are filterable by status (active, paused, done, dropped,
  someday).
- Actions can be created, completed, and edited directly in the
  browser. The checkbox routes through the same completion gate as
  every other closure path — it requires a verification breadcrumb and
  refuses otherwise, with the message naming the proper close.
- The UI cannot complete an area (an area never completes — the write
  is refused) and cannot close a project over open children; the
  refusal points at `pib_complete_project`, the walk that dispositions
  each open child. Closed children carry their completion claim
  visibly: verified closes and "closed by parent outcome" render
  distinguishably.
- The board RENDERS containment; it does not edit it. Containers are
  created, reclassified, and re-filed under an area through the pib_*
  tools or the CLI (`--parent prj:X`, `--parent ""` to clear), where
  the containment gates teach — promoting an area that holds projects
  is refused, and demoting a project to an area is refused unless the
  same call clears its parent.
