feat: v0.8.0 — batch DB writes, WAL TUI reader, security hardening, provider fix#1
feat: v0.8.0 — batch DB writes, WAL TUI reader, security hardening, provider fix#1
Conversation
…rovider fix - Batch database writes: turns, tool calls, interaction events committed in a single transaction per file (100–1000× faster for large JSONL logs) - Atomic parse-result commit: file offset written in the same transaction (crash-safe — no partial-write state possible) - TUI refresh opens a read-only WAL connection, eliminating lock contention with the background file watcher - Security: shell hook paths single-quote-escaped; git hook hardened with set -eu and case-pattern trailer validation - Providers tab now shows per-provider session/turn counts instead of mixing all sessions under Claude Code - CLAUDE_CONFIG_DIR respected by scopeon init, onboard, and auto-detection - Context pressure 'turns remaining' clamped to 10 000 - NaN/Inf/negative costs skipped in budget aggregation - warn! emitted when JSONL lines are skipped (replaces silent data loss) - Docs reorganised: ARCHITECTURE, CHANGELOG, CONTRIBUTING → docs/; LICENSE files → docs/licenses/; CODE_OF_CONDUCT, SECURITY → .github/ Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
👋 Thanks for your first pull request to Scopeon! 🎉
Before we review, please make sure the CI checks below pass:
cargo fmt --all -- --check— formattingcargo clippy --workspace -- -D warnings— lintingcargo test --workspace— all 145 tests must be green
Or simply run make check locally to verify everything at once.
We review PRs in order of readiness (all CI green + filled-out description).
If you get stuck, feel free to ask for help in a comment — we are happy to
guide you through the process. Thank you for contributing! 🚀
There was a problem hiding this comment.
Pull request overview
v0.8.0 release work focusing on faster ingestion, better concurrent read paths, and security hardening for generated shell/git hooks.
Changes:
- Harden shell and git hook generation (quote-escaping paths;
set -eu+ trailer validation). - Batch DB writes per file in a single transaction and atomically persist file offsets.
- Improve dashboard/TUI behavior (read-only WAL connection; provider counts by provider; skip corrupt cost rows; clamp context-pressure predictions).
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/shell_hook.rs | Adds single-quote escaping for generated shell hook snippets. |
| src/serve.rs | Skips NaN/Inf/negative cost rows during snapshot aggregation. |
| src/onboarding.rs | Respects CLAUDE_CONFIG_DIR in provider detection. |
| src/main.rs | Respects CLAUDE_CONFIG_DIR for scopeon init and adds tests around MCP config JSON shape. |
| src/git_hook.rs | Hardens git commit-msg hook with set -eu and trailer format validation. |
| docs/changelog.md | Documents v0.8.0 changes and updates compare links. |
| crates/scopeon-tui/src/app.rs | Uses per-provider DB stats and opens a read-only DB connection for refresh. |
| crates/scopeon-mcp/src/server.rs | Clamps “turns remaining” predictions to a sane upper bound. |
| crates/scopeon-core/src/db.rs | Adds batch upsert/atomic commit APIs, provider stats query, fixes NaN sort panic, and changes interaction-event ordering. |
| crates/scopeon-collector/src/watcher.rs | Uses atomic commit API, logs skipped JSONL lines, and hardens mtime conversion. |
| crates/scopeon-collector/src/providers/generic_openai.rs | Hardens timestamp conversion against overflow. |
| crates/scopeon-collector/src/providers/gemini.rs | Hardens timestamp conversion against overflow. |
| crates/scopeon-collector/src/providers/aider.rs | Hardens timestamp conversion against overflow. |
| crates/scopeon-collector/src/parser.rs | Tracks count of skipped/unparseable JSONL lines. |
| Cargo.toml | Bumps workspace/package versions to 0.8.0. |
| Cargo.lock | Updates lockfile versions to 0.8.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- db: list_interaction_events_for_session now returns most-recent N events in ascending order via DESC+LIMIT subquery re-ordered ASC (was returning oldest N after the ASC change) - tui: fix provider stat keys — 'gemini' → 'gemini-cli', 'generic' → 'generic-openai' to match sessions.provider values in the DB - shell_hook: add shell_quote_fish() using double-quote escaping (\, ", $) for fish; POSIX single-quote escaping is invalid inside fish single quotes — fish_hook() now uses the correct quoting function - onboarding: derive Claude hint path from the same base used for detection so CLAUDE_CONFIG_DIR override is reflected in the UI hint - main: replace fake JSON-write tests with real cmd_init() calls using CLAUDE_CONFIG_DIR env override; now exercises atomic write, backup, JSON merge, and CLAUDE_CONFIG_DIR path selection Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
v0.8.0 Release
Security
$, backticks, or spacesset -euand acase-pattern trailer validatorPerformance
get_session_aggregatesinstead of loading all turns into memoryFixed
CLAUDE_CONFIG_DIRrespected byscopeon init,onboard, and auto-detectionChanged
ARCHITECTURE,CHANGELOG,CONTRIBUTING→docs/; licenses →docs/licenses/;CODE_OF_CONDUCT,SECURITY→.github/See docs/changelog.md for full details.