Skip to content

Add: high-level design with Mermaid diagrams, linked from the README - #82

Merged
0xLeif merged 1 commit into
mainfrom
docs/hld-mermaid
Sep 26, 2026
Merged

0xLeif merged 1 commit into
mainfrom
docs/hld-mermaid

Conversation

@0xLeif

@0xLeif 0xLeif commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds docs/HLD.md, a high-level design of rune written against the code on main (1f3372d). It covers purpose, context, components, the three execution models (run, watch, session), key flows (dispatch, run, watch, session start, send and settle, read and list, attach, stop and archive), session internals (lifecycle, the supervisor's event loop, the PendingSend settle decision, the control protocol, transcript bounds), on-disk data, runtime and release, security and trust boundaries, failure modes with a timeouts table, decisions and a glossary.
  • 17 Mermaid diagrams: 8 flowcharts, 6 sequence diagrams, 2 state diagrams and 1 ER diagram. Each renders with mermaid-cli.
  • README: the existing "Architecture & Internals" section gets a short paragraph, one overview diagram and a link to the HLD. The existing bullets are unchanged.
  • The HLD links to the existing guides instead of repeating them: getting started, sessions, PTY architecture, releasing. It also links the specs, ROADMAP.md, CHANGELOG.md, the SpecSync change records and harnesses/.

Notes for review

  • Finding: the supervisor is not detached by setsid. start spawns the supervisor with pgroup: true. That makes it a process-group leader, so its own Process.setsid call is refused (EPERM, and the code rescues it). I measured this on macOS for this PR: I started a real rune session start -- sleep 120 from bash inside a PTY, then closed the PTY and sent SIGHUP to the shell. The supervisor kept the shell's session id, led its own process group, and survived. The HLD states this and marks Linux and other shells as Unknown. Two places describe setsid as the mechanism: the comment on Supervisor#detach_from_terminal and the AGENTS.md line "detached (Process.setsid)". No code is changed here.
  • No SpecSync change record. docs/ and README.md are not in meaningful_paths, and no active change lists README.md, so nothing goes stale. I deliberately left docs/sessions.md, ROADMAP.md, specs/ and docs/i18n/ alone, because they appear in accepted changes' affected paths.
  • Translations. The nine docs/i18n/README.*.md files do not get the new section. The README says the English file is authoritative.
  • hi. hi/ and INTENT.md already exist. hi check passes (155 criteria, 11 families), and no criteria changed.
  • Pages. The repo has no GitHub Pages site. GitHub renders the Mermaid fences natively.

Test Plan

  • All 17 HLD diagrams and the README diagram render with bunx -p @mermaid-js/mermaid-cli mmdc
  • Every relative link and anchor in docs/HLD.md and README.md resolves
  • fledge run docs-check passes
  • fledge lanes run verify passes (642 examples, 0 failures, spec coverage 100%)
  • fledge trust verify passes on the committed range
  • hi check passes
  • CI is green on this PR

🤖 Generated with Claude Code

https://claude.ai/code/session_01V3ZZAEiUP7xRJPozhZb6rL

docs/HLD.md maps how rune works end to end, true to the code on main:
components, the run/watch/session execution models, the session
supervisor's event loop, the settle decision, the control protocol, the
transcript and its bounds, on-disk state, release, security boundaries,
and timeouts and limits. 17 Mermaid diagrams (flowcharts, sequence,
state and ER), each validated with mermaid-cli. The README's existing
Architecture & Internals section gains one overview diagram and a link.

Docs only: no source, spec, spec-sync or translation files change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V3ZZAEiUP7xRJPozhZb6rL
@0xLeif
0xLeif merged commit 252702c into main Sep 26, 2026
12 checks passed
@0xLeif
0xLeif deleted the docs/hld-mermaid branch September 26, 2026 03:13
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