Skip to content

feat(viz): read-only spec → epic → task graph UI (onecoder viz) - #3

Merged
olanigan merged 1 commit into
mainfrom
viz-ui
Oct 22, 2026
Merged

olanigan merged 1 commit into
mainfrom
viz-ui

Conversation

@olanigan

Copy link
Copy Markdown
Owner

Summary

Adds onecoder viz, a stdlib-only, read-only UI that shows a project as specification → epic → task → acceptance criterion.

  • Spec: specs/<name>.md with frontmatter id, title, status, epic: <sprint-id>. Kept in git.
  • Epic: sprint. Task: issue, or governance task (.onecoder/tasks/<id>). Criterion: AC-n lines in the governance task's brief.md.
  • onecoder viz --print-json prints the same graph for scripts and agents.

Storage

  • CSV stays the write path and the fallback.
  • .onecoder/track.db is a derived SQLite index. It is rebuilt when the CSV, spec, or governance files change, and it ignores itself via .onecoder/.gitignore.
  • If the index cannot be written, the page is served from CSV with a warning.

Security

  • Binds to loopback by default.
  • Strict CSP: default-src 'none', no external resources.
  • The page builds its DOM with textContent only. Tracker titles are never parsed as markup.

Bug fix

Issue and sprint IDs were millisecond timestamps modulo 1,000,000. Issues created in the same millisecond shared an ID, so updates hit all of them and the graph dropped duplicates. IDs are now random (uuid4). The change is in track/local.py.

Known gaps (not in this PR)

  • task new --issue accepts the flag but does not store it in state.json, so governance tasks don't nest under their issue yet.
  • No MCP tool for the graph yet.
  • Reads local data only, not the remote D1 backend.

Test plan

  • python3 -m unittest discover -s tests -p "test_*.py": 61 tests pass (49 existing, 12 new).
  • New tests cover hierarchy, index invalidation, CSV fallback, ignore rules, the HTTP surface and CSP, the CLI, and the ID-collision regression.
  • Manual: ran the server against a demo project and checked it in Chromium. The tree, detail panel, filter, and a 390px layout work, with no JavaScript errors.


Generated by Claude Code

Adds a stdlib-only UI over the tracking data and spec files.

- Graph: spec (specs/*.md) -> epic (sprint) -> task (issue) and governance
  task -> acceptance criterion (AC-n from brief.md). Unplanned work and
  governance tasks get group nodes. No dangling parents.
- Storage: CSV stays the write path and the fallback. `.onecoder/track.db`
  is a derived SQLite index, rebuilt when CSV, specs, or governance files
  change. It ignores itself via `.onecoder/.gitignore`. If the index can't
  be written, the page serves from CSV and shows a warning.
- Server: loopback by default, strict CSP, no external resources. The page
  builds the DOM with textContent only.
- `--print-json` prints the graph for scripts and agents.

Fix: issue and sprint ids were time-based (ms modulo 1e6). Issues created
in the same millisecond shared an id, so updates hit all of them and the
graph dropped the duplicates. Ids are now random.

Tests: 61 pass (49 existing, 12 new covering hierarchy, index invalidation,
CSV fallback, ignore rules, HTTP surface, CLI, and id collisions).

Claude-Session: https://claude.ai/code/session_01NGJmcc1EdTFt3e6CJfF3E9
@olanigan
olanigan merged commit 35c3022 into main Oct 22, 2026
4 checks passed
@olanigan
olanigan deleted the viz-ui branch October 22, 2026 00:23
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.

2 participants