Commit Graph

21 Commits

Author SHA1 Message Date
ruohki b81b893661 fix(terminal): switch to alternate screen buffer for clean exit
TUI frame was left in terminal after exit. Use EnterAlternateScreen/
LeaveAlternateScreen so exiting restores the original terminal content.
2026-02-28 21:35:01 +01:00
ruohki 240ae4aace test(01): complete UAT - 7 passed, 1 issue 2026-02-28 21:32:29 +01:00
ruohki 90dc4882ae docs(phase-1): complete phase execution 2026-02-28 21:24:04 +01:00
ruohki d9db04fb01 docs(01-03): complete app event loop and Phase 1 wiring plan
- 01-03-SUMMARY.md: documents App struct, event loop, double-Ctrl+C state machine, main.rs pipeline
- STATE.md: Phase 1 complete, 3/3 plans done, Phase 2 next, 01-03 decisions recorded
- ROADMAP.md: Phase 1 marked Complete (3 plans / 3 summaries)
- REQUIREMENTS.md: SHEL-01 marked complete
2026-02-28 21:20:02 +01:00
ruohki 771c9a8561 feat(01-03): wire complete startup-to-shutdown pipeline in main.rs
- All four modules declared: mod app, config, signals, terminal
- Pre-terminal phase: login shell detection, CLI parse, config load
- Terminal phase: panic hook installed first, then signals, then terminal init
- Event loop: App::new receives is_login_shell and app_config; run_event_loop runs
- Shutdown: restore_terminal() called before show_goodbye() in all exit paths
- BrokenPipe from event loop exits silently (LIFE-04)
- Unexpected I/O errors logged to stderr after terminal restore
2026-02-28 21:17:56 +01:00
ruohki bad8fba5aa feat(01-03): implement App struct and event loop with exit behavior
- App struct with is_login_shell, double-press Ctrl+C state machine, show_quit_prompt
- run_event_loop() polls SignalFlags first, then draws, then polls key events
- handle_key() suppresses 'q' in login shell mode; double Ctrl+C within 2s quits
- draw() renders Phase 1 placeholder TUI with title, welcome text, quit prompt
- show_goodbye() prints BBS-style goodbye with 500ms delay after terminal restore
- DOUBLE_PRESS_WINDOW const = 2 seconds
- mod app added to main.rs
2026-02-28 21:17:10 +01:00
ruohki d6209ba4c5 docs(01-02): complete terminal safety primitives plan 2026-02-28 21:14:44 +01:00
ruohki 966b47edbc feat(01-02): implement signal handling and logging stub
- SignalFlags struct wraps Arc<AtomicBool> for SIGHUP/SIGTERM
- register_signals() registers SIGHUP and SIGTERM only (not SIGINT)
- SIGINT deliberately excluded — handled via crossterm key events for double-press Ctrl+C
- should_terminate() polls flag with Ordering::Relaxed for event loop use
- init_logging() is a Phase 1 no-op stub with LIFE-03 documentation
2026-02-28 21:12:45 +01:00
ruohki 65313eac31 feat(01-01): add Phase 1 deps and implement config/CLI loading
- Add signal-hook 0.4.3, toml 1.0.3, serde 1.0, clap 4.5 to Cargo.toml
- Create src/config.rs with Config struct (deny_unknown_fields, serde defaults)
- Implement load_config() with vault_path resolution relative to config file dir
- Implement resolve_config_path() using binary-adjacent bbs.toml as default
- Implement print_config_error() with BBS-themed error messages
- Implement detect_login_shell() and parse_cli() with argv[0] dash stripping
- Create src/terminal.rs with init_terminal(), restore_terminal(), install_panic_hook()
- Wire early startup path in src/main.rs before terminal initialization
2026-02-28 21:12:29 +01:00
ruohki b258b6d262 feat(01-02): implement terminal init/restore and panic hook
- init_terminal() enables raw mode and clears main screen via Viewport::Fullscreen
- No alternate screen buffer used (deliberate BBS immersive approach)
- restore_terminal() disables raw mode and shows cursor using let _ for all calls
- install_panic_hook() restores terminal, prints BBS-themed message, delegates to original hook
- Use ratatui::crossterm re-export (crossterm is transitive dep only)
- All panic hook operations use let _ or eprintln! — no unwrap() or ? inside hook
2026-02-28 21:12:04 +01:00
ruohki c9a777ddbc docs(state): record phase 1 planning session 2026-02-28 21:09:14 +01:00
ruohki c97c149366 docs(01-safety-foundation): create phase plan 2026-02-28 21:05:46 +01:00
ruohki 88a93c16ed docs(01): research phase 1 safety foundation 2026-02-28 20:58:46 +01:00
ruohki 47815f2abf docs(state): record phase 1 context session 2026-02-28 20:49:58 +01:00
ruohki d537f04bf6 docs(01): capture phase context 2026-02-28 20:49:44 +01:00
ruohki 4f6c9bcdc9 docs: create roadmap (4 phases) 2026-02-28 20:35:13 +01:00
ruohki 05a301ae63 docs: define v1 requirements 2026-02-28 20:32:34 +01:00
ruohki b431e7bb1b docs: complete project research 2026-02-28 20:27:48 +01:00
ruohki 10028d3a8a chore: add project config 2026-02-28 20:20:16 +01:00
ruohki 1d5ad47411 docs: initialize project 2026-02-28 20:18:58 +01:00
ruohki 7f1a4ce1f1 docs: map existing codebase 2026-02-28 20:12:08 +01:00