Dashboard: fix 10 post-review bugs + Playwright regression harness + dedup finalization#3
Open
Dashboard: fix 10 post-review bugs + Playwright regression harness + dedup finalization#3
Conversation
ed06efd to
872f496
Compare
Layer A (prompts.rs): 6 tests for render_valid_links — empty stems, full paths, one-per-line, backslash normalization, integration with ingest_prompt. Layer B (ingest.rs): 9 tests for guard_stem_collisions — no collision pass-through, Create→Update auto-convert, ambiguous 2+ matches error, Update existing pass-through, Update retarget, within-plan duplicates, invalid path, path traversal. Layer C (stem.rs): 5 edge-case tests — empty path, dotfile, double extension, deeply nested index.md, mixed-case extension. Layer C (frontmatter.rs): 5 tests for check_duplicate_stems — no dupes clean, 2-way collision, 3-way collision, non-wiki exclusion, non-interference with duplicate_id rule. Also fixes 14 pre-existing clippy warnings (doc_markdown, too_many_args, is_multiple_of, map_unwrap_or, case_sensitive_file_extension, or_default, redundant_closure, stable_sort_primitive, too_many_lines, cast_possible_truncation, unnecessary_wraps).
…d add Playwright harness
- Replace /api/health handler: now returns Vec<CheckItem> merging check_session_hooks +
check_vault_hooks, wrapped in spawn_blocking for disk I/O.
- Add --settings, --hooks-dir, --vault CLI flags with --vault falling back to default registry.
- CheckStatus serde now uses rename_all="lowercase" (contract with dashboard.html:renderHealth).
- HooksSummary gains ingests_today (UTC rolling day count) and
wal_checkpoint_age_seconds (mtime of $DB-wal, Option<u64>).
- Commit Playwright QA harness: package.json + playwright.config.ts, globalSetup/Teardown
spawn dashboard with seeded JSONL, chromium-only. Scripts test:e2e, test:e2e:ui.
- First regression spec tests/dashboard-qa/health-tab.spec.ts passes end-to-end.
Breaking change: external consumers of /api/health must now parse Vec<CheckItem> instead
of {status, db_path, db_accessible}. T0 repo scan found zero consumers; safe for internal
dashboard.
Refs: dashboard-bugs-fix plan tasks T0-T6, T14
…loading overlay - Ingests Today card now shows rolling UTC-day count (data.ingests_today) independent of the window selector. - Replace hardcoded "SQLite Lag: Syncing" indicator with "WAL last checkpoint: Ns ago" computed from data.wal_checkpoint_age_seconds. Yellow dot >1h, red >1d. - Wire loading overlay: show on tab switch / manual refresh (silent=false), skip on auto-refresh so users don't see a flash every 10s. Remove unused `display: flex` from the `.loading-overlay` rule. - Per-tab inline .tab-error banner with .visible toggle. Shown on fetch failure via showTabError(tab, msg); cleared on next success via clearTabError(tab). - Three new Playwright specs cover the fixes. Refs: dashboard-bugs-fix plan tasks T9-T12, T15, T17, T18
…d schema field
- /api/events?since=... now returns 400 with JSON {"error":"invalid_since","detail":...}
when the value is not valid RFC3339. Previously silently fell back to since=None.
- Unit tests cover valid/invalid/missing since cases.
- Drop dead evt.timestamp fallback in dashboard.html renderEvents — HookEvent only
serializes `ts`.
- New Playwright spec: tests/dashboard-qa/since-param.spec.ts (API-only, 4 cases).
Refs: dashboard-bugs-fix plan tasks T7, T8, T16
- Replace every innerHTML mutation in dashboard.html with createElement + textContent. Four render functions touched: renderOverview, renderBarChart, renderEvents, renderHealth. Preserve all CSS classes, element IDs, and DOM structure. - Remove redundant drop(_verify) at dashboard.rs — clears clippy::used_underscore_binding. - Backtick SQLite in doc comment at dashboard.rs — clears clippy::doc_markdown. - New Playwright spec: tests/dashboard-qa/xss-safety.spec.ts — proves <script> payloads in session_id / signals render as literal text, no execution. - New Playwright spec: tests/dashboard-qa/full-smoke.spec.ts — end-to-end regression: navigates 3 tabs, verifies window-switch stability, WAL age label format. cargo clippy --features dashboard --all-targets -- -D warnings now passes clean. Refs: dashboard-bugs-fix plan tasks T5, T13, T19, T23 full-smoke authoring
…ertion in health-tab spec The 'Missing hooks_dir surfaces a fail item' test called page.evaluate(fetch(...)) without page.goto, which fails because Playwright's page context needs a page first. Switch to the `request` fixture (matching since-param.spec.ts pattern) — cleaner and correct for API-only assertions. Refs: dashboard-bugs-fix plan T24 surfaced this spec bug
… rename) The plan's Must-NOT-Have guardrail forbids renaming existing element IDs. T10 semantically renamed `lagText` → `walCheckpointText`, which F1 audit flagged. Revert the ID while preserving the T10 WAL-checkpoint content semantics. - dashboard.html: `<span id="lagText">` preserved; renderOverview updates via #lagText - overview-labels.spec.ts: selector updated to #lagText - full-smoke.spec.ts: selector updated to #lagText Refs: dashboard-bugs-fix plan F1 audit
872f496 to
e0b5249
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two groups of commits on this branch, both ready to land:
95a3866→ab08517dea9fb7→ed06efdDashboard Bugs Fix (primary)
Fixes 10 bugs in the feature-gated hooks dashboard identified in a post-review audit (
ef9cc1clanded a lot at once — this is the cleanup pass). Adds a Playwright regression harness./api/healthrewritten (breaking, isolated)Vec<CheckItem>mergingcheck_session_hooks+check_vault_hooks, wrapped intokio::task::spawn_blockingfor sync FS I/O.--settings,--hooks-dir,--vaultCLI flags with sensible defaults.CheckStatusserde contract locked withrename_all = "lowercase"+ round-trip test.HooksSummaryextendedingests_today: u64— UTC-rolling-day count viastrftime('%Y-%m-%dT00:00:00Z','now').wal_checkpoint_age_seconds: Option<u64>— mtime of$DB-walvs now./api/events?since=...strict RFC3339since→HTTP 400 + {"error":"invalid_since","detail":...}instead of silentNonefallback.Dashboard UI cleanup
data.ingests_today— stable across time-window selector.formatAgehelper (yellow > 1h, red > 1d)..tab-errorbanner withshowTabError/clearTabErrorhelpers.evt.timestampfallback removed.Safe DOM rendering (XSS fix)
innerHTML +=tocreateElement+textContent+classList.innerHTMLmutations remaining.xss-safety.spec.tsasserts<script>/<img onerror>payloads insession_id/signalsrender as literal text.Clippy cleanup
cargo clippy --features dashboard --all-targets -- -D warningsnow passes clean onscriptorium-cli.Test Coverage
Rust
cargo test --workspace --features dashboard→ 392 passed, 0 failed, 9 ignored (live-only).+11new unit tests.Playwright
npx playwright test→ 23/23 passed across 8 spec files (smoke + 6 per-bug + full-smoke). Harness useswebServerconfig, chromium-only, gitignored fixtures.Runtime
/,/api/health,/api/summary,/api/events,/api/errors) return HTTP 200.Dashboard Commits (6 atomic)
dea9fb75f93a16840f07d45909f9bdbed99ed06efdPrior Dedup Commits (5, already reviewed)
2d3a2c8,95a3866,c52652f,4fdb874,ab08517— previously-developed dedup defense-layer work that never landed via its own PR; shipping in this one.Verification
All plan compliance (Must Have 7/7, Must NOT 14/14) + 4 automated reviewers (oracle plan audit, code quality, scripted QA, scope fidelity) approve.
Full QA report at
.sisyphus/evidence/final-qa/report.md(local-only, not checked in).