repositories / pi-ext
pi-ext
bugabingas pi extensions
owned by bugabinga
docs/super/roadmaps/2026-07-11-the-system-roadmap.html
Raw<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>The System implementation roadmap</title>
<style>
:root { color-scheme: light dark; --fg:#121212; --bg:#ededed; --panel:#dbdbdb; --accent:#ae2eae; --ui:#922792; }
@media (prefers-color-scheme:dark) { :root { --fg:#ededed; --bg:#121212; --panel:#242424; --accent:#d151d1; --ui:#d86dd8; } }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--fg); font:14px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace; }
article { width:min(100% - 2rem,980px); margin:1rem auto 3rem; border:3px solid var(--fg); box-shadow:9px 9px 0 var(--ui); }
header,section { padding:clamp(1rem,3vw,1.5rem); border-bottom:2px solid var(--fg); }
header { background:var(--panel); border-bottom-width:3px; }
h1 { margin:.2rem 0 0; font:900 clamp(1.8rem,6vw,3.5rem)/.95 system-ui; text-transform:uppercase; }
h2 { margin:0 0 1rem; color:var(--accent); font:900 1rem/1 system-ui; letter-spacing:.1em; text-transform:uppercase; }
h3 { margin:1rem 0 .4rem; font-size:.9rem; text-transform:uppercase; }
p,li { max-width:82ch; }
.phase { border-left:8px solid var(--ui); }
.phase strong { color:var(--accent); }
code { background:var(--panel); padding:.1rem .3rem; }
a { color:var(--accent); font-weight:900; }
@media(max-width:600px) { article { width:calc(100% - 1rem); margin:.5rem; box-shadow:5px 5px 0 var(--ui); } }
</style>
</head>
<body>
<article>
<header>
<p><strong>Implementation roadmap · 2026-07-11</strong></p>
<h1>The System</h1>
<p><a href="../specs/2026-07-11-the-system-design.html">Original design spec</a> · <a href="../specs/2026-07-15-the-system-rich-markdown-design.md">Rich Markdown design amendment</a></p>
<p>Ten independently green phases keep the hard rename, governance kernel, rich document migration, rendering, workflows, and final integration reviewable.</p>
<p>Phases 1–5 are complete. Phase 6 begins the approved replacement of their authored-HTML and shared-CSS assumptions without rewriting completed history.</p>
</header>
<main>
<section class="phase">
<h2>Phase 1 · Hard rename baseline</h2>
<p><strong>Outcome:</strong> all existing Super behavior ships under <code>the-system</code> only.</p>
<h3>Scope</h3>
<ul>
<li>Rename extension directory, package, branding, imports, tests, root resources, lockfile entries, static checks, TypeScript config, README rows, and current examples.</li>
<li>Preserve task branches, push-task, mockup, renderer, and existing skills without semantic changes.</li>
<li>Add a scoped static assertion rejecting live old paths while allowing historical <code>docs/super/**</code>.</li>
</ul>
<h3>Out of scope</h3>
<p>Governance, HTML documents, prompts, and new skills.</p>
<h3>Verification</h3>
<p>Renamed focused tests, real Pi harness loading, typecheck, static checks, and full CI.</p>
<h3>Boundary</h3>
<p>The repository remains functionally identical except for the intentional hard public rename.</p>
</section>
<section class="phase">
<h2>Phase 2 · Project and document kernel</h2>
<p><strong>Outcome:</strong> a dormant, pure, tested model understands project roots, config, IDs, metadata, document relationships, and the shared stylesheet.</p>
<h3>Scope</h3>
<ul>
<li>Add <code>documents.ts</code> with native JJ/Git worktree root discovery and conflict detection.</li>
<li>Add normalized governed-path containment.</li>
<li>Define strict config, prefix, ID, slug, filename, and metadata schemas.</li>
<li>Index authored documents and report stable diagnostics for duplicate IDs, filename mismatch, dangling references, and forbidden graph edges.</li>
<li>Validate the narrow authored HTML shell and obvious active-resource violations without executing content.</li>
<li>Add the approved versioned Nugu <code>assets/system.css</code>.</li>
</ul>
<h3>Out of scope</h3>
<p>Runtime hooks and filesystem mutation.</p>
<h3>Verification</h3>
<p>Table-driven unit tests for simple Git, Git worktrees, JJ, colocated/conflicting roots, no VCS, config, IDs, metadata, graph rules, HTML, and CSS tokens.</p>
<h3>Boundary</h3>
<p>New code is unused by runtime; existing extension behavior remains unchanged and CI-green.</p>
</section>
<section class="phase">
<h2>Phase 3 · Doctor vertical slice</h2>
<p><strong>Outcome:</strong> users can inspect any project system without mutation.</p>
<h3>Scope</h3>
<ul>
<li>Add deterministic read-only doctor script using the Phase 2 kernel.</li>
<li>Add <code>system-doctor</code> skill and thin <code>/system-doctor</code> prompt.</li>
<li>Add initial <code>system-documents</code> skill as the single document-authoring authority.</li>
<li>Export package prompts and update exact resource/static checks.</li>
</ul>
<h3>Out of scope</h3>
<p>Initialization, injection, and write gates.</p>
<h3>Verification</h3>
<p>Fixture-tree diagnostics, stable ordering, exit status, no-mutation proof, skill contracts, and real package resource discovery.</p>
<h3>Boundary</h3>
<p>Doctor is independently useful while all existing runtime behavior remains intact.</p>
</section>
<section class="phase">
<h2>Phase 4 · Guided initialization</h2>
<p><strong>Outcome:</strong> <code>/system-init</code> creates or upgrades a valid project system through explicit human decisions.</p>
<h3>Scope</h3>
<ul>
<li>Add thin prompt and <code>the-system-init</code> skill.</li>
<li>Inspect project context and grill one focused question at a time.</li>
<li>Draft and separately approve missing core Markdown files.</li>
<li>Create directories/config and copy bundled CSS.</li>
<li>Make reruns idempotent, core-preserving, and explicit about machine-asset upgrades.</li>
<li>Validate through doctor after writes.</li>
</ul>
<h3>Out of scope</h3>
<p>Automatic runtime injection or write interception.</p>
<h3>Verification</h3>
<p>Skill contract tests, config/CSS copy checks, missing/existing core behavior, prefix handling, and repeat-run fixtures.</p>
<h3>Boundary</h3>
<p>Initialization works as an on-demand agent workflow; the extension still does not alter normal turns.</p>
</section>
<section class="phase">
<h2>Phase 5 · Runtime governance</h2>
<p><strong>Outcome:</strong> initialized projects inject their laws and receive advisory ownership protection.</p>
<h3>Scope</h3>
<ul>
<li>Add <code>system.ts</code> runtime orchestration.</li>
<li>Resolve root per turn and inject bounded existing SYSTEM/MISSION/RULES in stable order.</li>
<li>Notify once per session when initialization or version refresh is needed.</li>
<li>Block edits to existing core files.</li>
<li>Allow new specs and mockups; require UI approval for edits to existing spec-owned files.</li>
<li>Preflight write/edit candidates with shared validation.</li>
<li>Conservatively guard recognizable shell mutations and state the advisory boundary.</li>
</ul>
<h3>Out of scope</h3>
<p>Workflow output migration.</p>
<h3>Verification</h3>
<p>Real event shapes, injection composition, root changes, UI approve/deny/cancel, no-UI failure, candidate validation, and retained task/mockup tests.</p>
<h3>Boundary</h3>
<p>Existing task workflows still function; initialized projects gain coherent governance without hidden repair.</p>
</section>
<section class="phase">
<h2>Phase 6 · Rich Markdown bundle kernel migration</h2>
<p><strong>Outcome:</strong> doctor, initialization, runtime governance, and shared validation understand Markdown document bundles instead of authored HTML files.</p>
<h3>Scope</h3>
<ul>
<li>Replace flat authored-HTML paths with typed <code><ID>-<slug>/index.md</code> bundle discovery and validation.</li>
<li>Add the required Markdown/frontmatter parsing dependencies and explicit rich-profile candidate checks.</li>
<li>Replace the <code>system-documents</code> authority's HTML contract with the canonical bundle and rich Markdown contract before downstream workflows delegate to it.</li>
<li>Preserve source-ordered arbitrary frontmatter while retaining strict known graph semantics.</li>
<li>Extend spec ownership approval to every existing file in a spec bundle while allowing validated new bundles and missing assets.</li>
<li>Guard recognizable shell mutation across complete spec bundles.</li>
<li>Stop creating project-local <code>system.css</code>; update config/schema versions and remove the obsolete machine-owned file only through approved initialization upgrade.</li>
<li>Update doctor, initialization, runtime notices, and tests around the new structure.</li>
</ul>
<h3>Out of scope</h3>
<p>Browser rendering and authoring workflow migration.</p>
<h3>Verification</h3>
<p>Bundle discovery, IDs, slugs, frontmatter order, graph diagnostics, ownership approve/deny/cancel, shell advisory coverage, initialization upgrades, source preservation, and retained runtime/task/mockup suites.</p>
<h3>Boundary</h3>
<p>The project has one coherent Markdown bundle model, doctor and runtime remain useful, and no browser or workflow depends on an unfinished renderer.</p>
</section>
<section class="phase">
<h2>Phase 7 · Shared renderer and unified command shell</h2>
<p><strong>Outcome:</strong> users get <code>/system</code> help, <code>/system view <path|id|slug></code>, and <code>/system book</code> through one rich Markdown article pipeline.</p>
<h3>Scope</h3>
<ul>
<li>Add one extension command named <code>system</code> with subcommand parsing and argument completions.</li>
<li>Implement no-argument help for lifecycle and non-lifecycle subcommands.</li>
<li>Add <code>view</code> with exactly one selector and <code>book</code> with no filters.</li>
<li>Add the unified/remark/rehype renderer for GFM, frontmatter, footnotes, definition lists, alerts, raw HTML, Mermaid, TeX, highlighting, anchors, and collapsed in-document contents.</li>
<li>Render every frontmatter field in source order through the accepted compact summary and collapsed ledger.</li>
<li>Copy complete bundle trees into temporary output and keep cross-document, slug, ID, and asset links working.</li>
<li>Add calm automatic Nugu light/dark styling inherited by every generated component.</li>
<li>Add single-document and book shells around identical article HTML.</li>
<li>Add graph references/backlinks, grouped navigation, previous/next movement, and generated full-text search.</li>
</ul>
<h3>Out of scope</h3>
<p>Lifecycle authoring, schema-v3 IDs, phase terminology migration, task removal, implementation execution, and issue handling.</p>
<h3>Verification</h3>
<p>Command completions, help output, selector rules, identical article output across modes, every rich syntax feature, nested metadata, raw HTML, local/remote/cross-bundle links, inline mockups, body-content search, source hashes, opener platforms, Chromium, and Firefox.</p>
<h3>Boundary</h3>
<p>Rendering is independently useful and read-only while existing authoring skills and task branch behavior remain unchanged.</p>
</section>
<section class="phase">
<h2>Phase 8 · Lifecycle schema and prompt migration</h2>
<p><strong>Outcome:</strong> The System owns stage documents through <code>/system research</code>, <code>/system spec</code>, <code>/system spec-verify</code>, <code>/system phase</code>, <code>/system plan</code>, and <code>/system issue</code> without shipping any System skills.</p>
<h3>Scope</h3>
<ul>
<li>Migrate document metadata to schema v3: token IDs, <code>phase</code> documents, minimal config, status fields, and validated ID-only frontmatter references.</li>
<li>Move internal lifecycle prompts into bundled files that are loaded by <code>/system <subcommand></code> and not exported as top-level Pi prompt templates.</li>
<li>Convert current lifecycle skills into stage prompts and shared internal prompt includes; keep no System skills.</li>
<li>Include the document contract exactly once in every <code>/system</code> subcommand and include the Markdown contract exactly once only for document-authoring or rendering subcommands.</li>
<li>Make every lifecycle subcommand accept zero or one instruction string; zero-argument calls ask focused questions or offer selection.</li>
<li>Make stage prompts recommend, but never automatically create, optional downstream stages.</li>
<li>Implement research, spec, phase, plan, and issue artifact creation with canonical bundles and copyable <code>View:</code> output.</li>
<li>Implement <code>spec-verify</code> as ephemeral experimental verification that proposes spec amendments and creates no canonical artifact.</li>
<li>Block invalid document create/edit attempts with actionable frontmatter, path, status, and reference errors.</li>
<li>Enforce immutable <code>done</code> phase and plan documents; create new superseding artifacts instead of editing finished ones.</li>
</ul>
<h3>Out of scope</h3>
<p>Code execution, branch finishing, and deletion of task commands.</p>
<h3>Verification</h3>
<p>Schema-v3 parsing, token collision checks, command prompt injection, include de-duplication, zero/one argument behavior, frontmatter fixtures, reference graph rules, done immutability, actionable validation errors, copyable view output, and migrated knowledge coverage against current skills.</p>
<h3>Boundary</h3>
<p>The document lifecycle is available through <code>/system</code>, but implementation still uses existing execution behavior until Phase 9.</p>
</section>
<section class="phase">
<h2>Phase 9 · Exec lifecycle and task removal</h2>
<p><strong>Outcome:</strong> <code>/system exec</code> produces tested code from approved System references, and the old <code>/start-task</code>/<code>/finish-task</code> dance is gone.</p>
<h3>Scope</h3>
<ul>
<li>Add <code>/system exec [instructions]</code> prompt injection.</li>
<li>Allow exec inputs of spec, spec plus phase, spec plus plan, spec plus phase plus plan, and optional issue context.</li>
<li>Require phase and plan inputs to be <code>status: done</code>; specs and issues remain validated by the document write gates.</li>
<li>Preserve high-value execution knowledge: plan review, blocker escalation, TDD, verification-before-completion, code-review intake, review report shape, and safe git completion.</li>
<li>Make issue-driven exec possible after the issue has created or amended any missing spec only when the issue exposes a spec gap.</li>
<li>Produce final logs with changed files, verification, and a plain copyable <code>View:</code> line.</li>
<li>Use narrative document-linked commit messages rather than technical file/test inventories.</li>
<li>Delete public task branch commands, <code>push-task</code>, <code>task-result</code> rendering, <code>/auto</code>, and their status plumbing after replacement coverage exists.</li>
</ul>
<h3>Out of scope</h3>
<p>Changing the generic <code>mockup</code> tool or renderer behavior.</p>
<h3>Verification</h3>
<p>Exec prompt resolution, accepted input combinations, rejected draft phase/plan refs, issue-spec-gap handling, final log shape, commit-message guidance, removed command/resource assertions, retained mockup tests, and full focused extension tests.</p>
<h3>Boundary</h3>
<p>The annoying branch-navigation workflow is removed only after <code>/system exec</code> covers its useful execution knowledge.</p>
</section>
<section class="phase">
<h2>Phase 10 · Integration hardening and final documentation</h2>
<p><strong>Outcome:</strong> the unified command, renderer, lifecycle prompts, validation gates, and execution path form one coherent System surface.</p>
<h3>Scope</h3>
<ul>
<li>Complete startup, doctor, graph, approval, rendering, resource discovery, rename, prompt injection, and package integration tests.</li>
<li>Update README, package metadata, changelog, and current command documentation around <code>/system</code>.</li>
<li>Remove remaining System skills from package resources after their knowledge is covered by internal prompt includes.</li>
<li>Ensure <code>init</code> handles schema upgrades and optional project-rule seeding by scanning likely docs and asking before writing.</li>
<li>Run final typecheck, focused suites, real extension loading, static checks, browser suites, and CI.</li>
</ul>
<h3>Out of scope</h3>
<p>Provider-specific research, Git sync, compatibility aliases, persistent publishing, browser editing, and automatic historical <code>docs/super/**</code> migration.</p>
<h3>Verification</h3>
<p>Complete behavioral-contract audit against both design specs, no live old lifecycle commands, no top-level lifecycle prompt leakage, no packaged System skills, no live old-path references outside the historical allowlist, and <code>mise run ci</code>.</p>
<h3>Boundary</h3>
<p>The full amended design is implemented under one public extension with no half-migration, duplicate command surface, or legacy task-branch workflow.</p>
</section>
</main>
</article>
</body>
</html>