Audit and publish project threads securely
Here's a summary of everything done:
Security Audit: Scanned all 51 new threads (31 from Dec/Jan + 20 from Feb) for leaked API keys, tokens, passwords, and secrets. Zero actual secrets found — all grep matches were false positives (references to "token" the editor name, .env in gitignore patterns, etc.).
Made Threads Public:
- 52 new threads → all set to
publicviaamp threads share --visibility public - 111 previously documented threads → confirmed/set to
public
Updated docs/BUILDING_WITH_AI.md:
- Thread count: 116 → 167+
- Added 10 new development phases to timeline (Perf & Find/Replace, File Dialogs, Markdown Preview, Mouse Refactor, Dock Panels, v0.3.15, Sema Language, Website v4, New Themes, Bracket Matching)
- Added 4 new notable thread writeups (Event Loop 7→60 FPS, Markdown Preview & Docked Panels, Mouse Event Handling Refactor, Bracket Matching & Auto-Surround)
- Added 52 new entries to the full thread reference table
Updated website/src/pages/built-with-ai.astro:
- Stats: 116+ → 167+ conversations, 17 → 20 languages
- Added 3 new timeline phases
- Added 3 new notable thread cards (Event Loop FPS fix, Markdown Preview, Mouse Refactor)
- Updated all copy referencing thread count
Committed. Two files staged and committed — only the docs and website changes from this task, no unrelated changes included.
Done. The highlighted terms now link to:
- Reference docs →
docs/EDITOR_UI_REFERENCE.mdon GitHub - Feature specs →
docs/archived/SELECTION_MULTICURSOR.mdon GitHub - Gap docs →
docs/archived/MULTI_CURSOR_SELECTION_GAPS.mdon GitHub - Librarian →
ampcode.com/manual#librarian - Oracle →
ampcode.com/manual#oracle
Done. Links now have no underline by default and only show it on hover.
Done. Published the scroll bugfix thread (T-019c7311) and the find modal thread (T-019c7304), then added the scroll bug as a notable thread on both the website and docs — including the Mermaid diagram that shows how the model "saw" 25 lines while the screen showed 45, making the root cause immediately obvious.
Here are my findings:
Terminal Feature: Current State & Effort Assessment
What the design doc says (Dec 2025)
The doc describes 8 phases, estimated at 27–35 days total: PTY spawning, VT100 parsing, terminal grid, panel UI, rendering, input handling, tabs, and polish.
What already exists in the codebase (good news)
The dock/panel infrastructure that the doc assumed didn't exist is now fully built:
| Doc Assumption | Current Reality |
|---|---|
| "No panel abstraction" | ✅ Full DockLayout with Left/Right/Bottom docks, PanelId enum, focus system, resize handles, hit testing |
| "Terminal needs Phase 4: Panel UI" | ✅ PanelId::Terminal already registered in bottom dock, Cmd+2 keybinding already wired, renders a PlaceholderPanel |
| "Need drag handle + resize" | ✅ Dock resize handles with mouse drag already work |
| "Need layout recalculation" | ✅ DockRects in geometry.rs computes editor area minus dock sizes |
| "Need focus management" | ✅ FocusTarget::Dock(DockPosition) exists (though sidebar still uses FocusTarget::Sidebar for compatibility) |
| "Need tab bar in panel" | ⚠️ Partially — dock has panel_ids and active_index, but no rendered tab bar inside the panel |
What's outdated in the doc
- "Current State" section — says "Has no terminal integration" and "Requires switching to external terminal." This is still true for the terminal itself, but the doc doesn't acknowledge the dock panel system exists.
- Phase 4 (Panel UI) — can be completely skipped, it's done.
- Module structure — suggests
src/terminal/but the existing pattern issrc/panels/for panel implementations +src/panel/for the dock abstraction. - Data structures —
TerminalPanelstruct duplicates fields already inDock(visible, height, resizing). The terminal-specific state should only hold terminal instances. - Dependencies section — suggests
portable-pty = "0.8"andvte = "0.13". Current versions are likely newer; also worth consideringalacritty_terminalas an all-in-one alternative.
Revised effort estimate
| Phase | Original | Revised | Notes |
|---|---|---|---|
| 1: PTY Foundation | 4-5 days | 3-4 days | Straightforward with portable-pty |
| 2: VT100 Parser | 5-6 days | 0 days | Use vte crate — don't hand-roll this |
| 3: Grid & Buffer | 3-4 days | 2-3 days | Or use alacritty_terminal which bundles grid+parser |
| 4: Panel UI | 3-4 days | 0 days | ✅ Already built |
| 5: Rendering | 4-5 days | 3-4 days | Main work — render grid cells with fontdue, colors, attributes |
| 6: Input Handling | 3-4 days | 2-3 days | Key→escape sequence translation, route when dock focused |
| 7: Tab Management | 2-3 days | 1-2 days | Dock already has multi-panel tab concept |
| 8: Polish | 3-4 days | 2-3 days | Scroll, selection, perf |
| Total | 27-35 days | 13-19 days | ~50% reduction thanks to existing infrastructure |
Key decision: vte + portable-pty vs. alacritty_terminal
alacritty_terminalgives you PTY + VT parser + grid + scrollback in one crate, but it's a heavier dependency and tightly coupled to Alacritty's architecturevte+portable-ptyis more modular and gives you full control over the grid/buffer, better fit for Token's custom rendering pipeline
Bottom line
The doc is structurally sound but outdated on infrastructure assumptions — Phase 4 is done, and the effort is roughly halved. The hardest remaining work is VT100 grid rendering (mapping terminal cells → fontdue glyphs with colors/attributes) and input translation. It's still an XXL feature but more like 2-3 focused weeks rather than 5-6.
Excellent, very thorough. Now let me update the design doc:
Now I have the full picture. Let me rewrite the design doc:
Done. Here's the summary:
Oracle confirmed the existing dock infrastructure eliminates ~40% of the original work. Key recommendations incorporated:
Use
alacritty_terminal+portable-pty— don't hand-roll a VT100 parser.alacritty_terminalgives parser + grid + scrollback battle-tested; Token only renders the cell grid.Effort: 27-35 days → 8-14 days across 4 phases:
- Phase 1 (3-4d): PTY spawning + terminal core integration
- Phase 2 (3-4d): Rendering grid cells in the dock panel
- Phase 3 (2-3d): Input routing (key→escape sequences)
- Phase 4 (2-3d): Scrollback + color polish
Structural changes:
TerminalPanelno longer duplicates dock fields. Terminal state only holds sessions + emulator core. Multiple tabs deferred to post-MVP.Architecture validated: PTY worker thread → mpsc →
Msg::Terminal(PtyOutput)→ update →Cmd::Redrawmatches existing patterns (syntax worker, fs watcher).