177 Commits

Author SHA1 Message Date
Dicklesworthstone 550a81f22a Add standard E2E logging to shell test scripts
Implement sources_sync.sh from scratch using e2e_log.sh (was empty).
Add e2e_log.sh sourcing and standard event emission to cli_flow.sh,
semantic_index.sh, and cass_daemon_e2e.sh while preserving their
existing custom JSONL logging (Option A compatibility layer).

All scripts now emit structured JSONL to test-results/e2e/ in addition
to their custom output locations. Remove sources_sync.sh from .gitignore
since it is no longer a stub.

Closes br-20bz.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 14:23:55 -06:00
Dicklesworthstone 923705e148 fix(scripts): Add fallback test discovery when git unavailable
Improve Rust E2E test discovery robustness:

1. Check if git command is available before using git ls-files
2. Fallback to find command if git unavailable or returns empty
3. Properly strip path prefixes (./, tests/) and .rs extension
4. Use while-read loop for safer handling of filenames

This fixes test discovery in environments where:
- Git is not installed
- Running from a non-git directory
- Sparse checkout excludes tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 10:48:37 -06:00
Dicklesworthstone ebc81fd8d5 fix(scripts): Improve Rust E2E test discovery and execution
Enhance run_all.sh to dynamically discover and run Rust E2E tests:

1. Use git ls-files to find tests/e2e_*.rs test files
2. Skip suite gracefully if no E2E tests found (yellow warning)
3. Build cargo test command with explicit --test flags per file
4. Enable E2E_LOG=1 for structured test output
5. Add --all-features and --verbose for comprehensive testing
6. Keep --nocapture for visible test output

Previous behavior used a glob pattern that might miss tests or include
non-E2E tests. New approach is explicit and handles empty test sets.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 10:45:44 -06:00
Dicklesworthstone a8df258b53 fix(e2e): Fix daemon E2E test to pass all phases
Two bugs were preventing the daemon E2E test from working:

1. Semantic indexing needed --full flag - incremental scan found no
   messages because the test data timestamps were considered "old"
2. Test data filename pattern was wrong - Codex connector expects
   rollout-*.jsonl, not daemon-e2e.jsonl

Also add scripts/e2e/daemon_fallback.sh wrapper so the daemon test
is included in the orchestrated E2E runner (run_all.sh picks up
scripts/e2e/*.sh).

Part of T7.3: E2E daemon fallback + health script

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 01:23:54 -06:00
Dicklesworthstone a1cc4cf797 feat: Add new E2E scripts and Playwright test suites
New E2E infrastructure and test suites:

scripts/e2e/multi_machine_sync.sh:
- Multi-machine sync E2E test script for T7.2
- Tests rsync over SSH workflow
- Validates provenance tracking across hosts

scripts/validate-e2e-jsonl.sh:
- JSONL log file validation script
- Checks schema compliance
- Validates event ordering and completeness

tests/e2e/accessibility/:
- aria-live.spec.ts: Live region announcements
- axe-core.spec.ts: Automated accessibility testing
- visual-preferences.spec.ts: Reduced motion, contrast

tests/e2e/mobile/:
- Touch navigation tests
- Responsive layout verification
- Virtual keyboard interaction
- Mobile performance benchmarks

tests/e2e/offline/:
- network-transitions.spec.ts: Online/offline transitions
- service-worker-cache.spec.ts: Cache validation

tests/reproduction_sync_oscillation.rs:
- Regression test for sync oscillation bug
- Validates stable remote source handling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 00:46:47 -06:00
Dicklesworthstone eeb32b58c7 feat(bench): Enhance benchmark regression detection script
Major improvements to the benchmark comparison script:

- Added statistical analysis with confidence intervals
- Improved baseline comparison logic
- Better outlier detection using IQR method
- Added support for multiple benchmark formats
- Enhanced human-readable output with color coding
- Added JSON output mode for CI integration
- Improved threshold configuration
- Added memory regression detection
- Better handling of missing baselines
- Added trend analysis for multi-run comparisons

The script now provides more accurate regression detection for CI
pipelines by using statistical methods rather than simple threshold
comparisons.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 00:46:15 -06:00
Dicklesworthstone e13fa59df7 T7.3: Add JSONL logging with phase markers to daemon E2E script
This commit enhances the daemon fallback E2E script (bead
coding_agent_session_search-yx9h) to emit structured JSONL logs following
the unified E2E logging schema defined in test-results/e2e/logging-audit.md.

New JSONL Event Functions:
- emit_run_start(): Captures environment metadata (git sha, branch, OS, arch)
- emit_phase_start(name, description): Marks logical phase boundaries
- emit_phase_end(name): Records phase duration in milliseconds
- emit_test_start(name, suite): Individual test start marker
- emit_test_end(name, status, duration_ms, error?): Test completion with pass/fail
- emit_metrics(name, key=value...): Performance metrics capture
- emit_run_end(exit_code): Final summary with test counts

New Test Coverage:
- Added test_status_command: Validates cass status --json health check
- Added test_daemon_fallback_unavailable: Tests fallback when daemon unavailable
- Both tests emit proper test_start/test_end events with timing

Phase Markers Added:
- build: Compile cass binary (when --no-build not specified)
- setup_sandbox: Prepare test fixtures and codex session data
- indexing: Build full-text and semantic indexes
- health_check: Validate cass status command
- daemon_fallback_test: Exercise daemon unavailable fallback path

Output Files:
- daemon_e2e.jsonl: Structured event log compatible with E2E aggregation
- report.json: Enhanced with test_summary (total/passed/failed) and jsonl path

CLI Options:
- Added --skip-health-check flag to bypass status validation
- Enhanced --help with full option descriptions

The JSONL events follow the schema:
  {"ts":"ISO8601","event":"phase_start|phase_end|test_start|test_end|metrics|run_start|run_end","run_id":"...","runner":"bash",...}

This enables unified E2E log aggregation across Rust, Playwright, and bash
test runners for CI observability.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 00:42:22 -06:00
Dicklesworthstone e4ec128d7f feat(e2e): Add unified JSONL logging infrastructure for E2E tests
Introduce a consistent structured logging schema across all E2E test
runners (Rust, Shell, Playwright) to enable unified log aggregation,
CI integration, and debugging.

New files:
- tests/util/e2e_log.rs: Rust E2E logger with typed event emission
- scripts/lib/e2e_log.sh: Shell E2E logging library (source-able)
- scripts/tests/run_all.sh: Orchestrated runner for all E2E suites
- tests/e2e/reporters/jsonl-reporter.ts: Playwright JSONL reporter

Event types in the unified schema:
- run_start: Test run begins with environment metadata
- test_start: Individual test begins (name, suite, file, line)
- test_end: Test completes (status, duration, error details)
- run_end: Summary statistics (total, passed, failed, skipped)
- log: General log messages with severity levels
- phase_start/phase_end: Multi-phase run tracking

Output locations:
- test-results/e2e/rust_*.jsonl - Rust E2E logs
- test-results/e2e/shell_*.jsonl - Shell script logs
- test-results/e2e/playwright_*.jsonl - Playwright logs
- test-results/e2e/combined.jsonl - Aggregated from all suites
- test-results/e2e/summary.md - Human-readable summary

Updated files:
- tests/util/mod.rs: Export e2e_log module
- tests/playwright.config.ts: Register JSONL reporter
- TESTING.md: Document the logging infrastructure and usage

Example Rust usage:
  let logger = E2eLogger::new("my_test", None)?;
  logger.test_start("test_name", "suite", Some("file.rs"), Some(42))?;
  logger.test_pass("test_name", "suite", duration_ms)?;

Example Shell usage:
  source scripts/lib/e2e_log.sh
  e2e_init "shell" "my_script"
  e2e_test_start "test_name" "suite"
  e2e_test_pass "test_name" "suite" "$duration_ms"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 13:54:31 -05:00
Dicklesworthstone d7a4e6050d feat(ci): Add real install E2E workflow and fix no-mock validation
- Create .github/workflows/install-test.yml for real install testing
  - Builds actual release binary on Linux and macOS
  - Runs install.sh with real rustc/cargo/sha256sum
  - Verifies installed binary works
  - Uploads structured logs as artifacts
  - Outputs repro command on failure

- Fix scripts/validate_ci.sh node_modules exclusion
  - Change glob from '!node_modules/**' to '!**/node_modules/**'
  - Now properly excludes tests/node_modules/ and other nested dirs

- Update test-results/no_mock_allowlist.json
  - Mark e2e_install_easy.rs:fake_bin as permanent (CI covers real testing)
  - Mark install.rs:mock_system_info as permanent (test fixture, not mock)
  - Mark install.rs:mock_resources as permanent (test fixture, not mock)

- Add documentation to tests/e2e_install_easy.rs
  - Explain relationship between local test and CI workflow
  - Reference allowlist status and rationale

Closes: bd-30qg (P6.14e)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 11:21:36 -05:00
Dicklesworthstone 5699489e92 ci: update workflows, validation scripts, and testing documentation
.github/workflows/:
- bench.yml: Updated benchmark workflow configuration
- browser-tests.yml: Updated browser test workflow

scripts/:
- validate_ci.sh: CI validation improvements
- daemon/cass_daemon_e2e.sh: Daemon E2E test script updates
- check_bench_regression.py: New benchmark regression checker

TESTING.md:
- Updated testing documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 03:31:26 -05:00
Dicklesworthstone 1da0bdbdc9 refactor: streamline connectors, encryption, and indexer modules
connectors/mod.rs:
- Code cleanup and improved error handling

html_export/encryption.rs:
- Simplified encryption logic by removing redundant code paths
- Maintains same security guarantees with cleaner implementation

indexer/mod.rs:
- Extended indexer capabilities for better session tracking
- Added support for additional metadata fields

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 03:30:34 -05:00
Dicklesworthstone 930c76e78a feat(bakeoff): Add validation documentation and daemon test infrastructure
Introduces comprehensive documentation for the bakeoff validation process
and adds integration testing for the daemon client. Includes shell scripts
for automated E2E validation of the cass bakeoff system.

- Add cass_bakeoff_validation.md documenting validation methodology
- Create bakeoff E2E validation shell script
- Add daemon directory with startup/management scripts
- Implement daemon client integration tests

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-25 23:30:38 -05:00
Dicklesworthstone 798e37638f chore: Add embedder e2e bakeoff script and update tracking
- Add cass_embedder_e2e.sh script for embedder comparison testing
- Update beads last-touched tracking

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-25 13:09:41 -05:00
Dicklesworthstone 98d5c7a33f Update from parallel agent work
Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-25 02:23:05 -05:00
Dicklesworthstone 4aa5085312 Enhance semantic search with reranker support and model management
Major improvements to the semantic search subsystem:

- Add fastembed-based reranker for improved result relevance
- Implement model manager for dynamic embedding model selection
- Expand indexer semantic capabilities with batch processing
- Enhance TUI with reranker-aware result presentation
- Add e2e test script for semantic indexing validation

The reranker module provides a secondary ranking pass that
significantly improves search result quality for ambiguous queries.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-25 01:01:16 -05:00
Dicklesworthstone 0b034d8539 Refactor page modules and add E2E testing
- Simplify summary page rendering
- Improve verify page error handling
- Clean up wizard page logic
- Add E2E test script for pages module
- Add integration tests for pages

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-21 14:20:28 -05:00
Dicklesworthstone 3ecbf19ca9 Add documentation testing infrastructure (P6.12)
- tests/docs/readme.rs: Tests for README.md generation accuracy
- tests/docs/help.rs: CLI help and generated HTML validation tests
- scripts/validate_docs.sh: Shell script for link and content validation
- docs/DOCUMENTATION_STYLE.md: Documentation style guide
- Cargo.toml: Added [[test]] entry for docs test crate

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 13:20:15 -05:00
Dicklesworthstone 46a3cbf077 test(pages): Add comprehensive E2E and performance testing infrastructure
End-to-end testing:
- scripts/e2e/cli_flow.sh: Full CLI workflow test coverage
- tests/pages_pipeline_e2e.rs: Rust integration tests for pages pipeline

Performance testing:
- cass-pages-perf-bundle binary for generating test bundles
- tests/performance/: Node.js-based perf harness with:
  - Lighthouse integration for bundle audits
  - Memory profiler tests
  - Decrypt timing measurements
  - Search latency benchmarks
- scripts/perf/run_pages_perf.sh: Unified perf orchestration

CI integration:
- .github/workflows/perf.yml: Manual dispatch workflow for perf regression
- lighthouse-budget.json: Performance budgets for bundle size/timing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 00:17:48 -05:00
Dicklesworthstone 75a21a9dd4 feat: CI/CD improvements and dependency updates 2026-01-10 17:42:20 -05:00
Cass Agent 53037796a8 fix(test-report): Use correct XPath for JUnit XML aggregate stats
The XPath //testsuite/@tests only returns the first testsuite's
stats, not the aggregate totals. Changed to /testsuites/@tests
which correctly reads from the root element where nextest puts
aggregate counts.

Before: showed 422 tests (first suite only)
After: shows 513 tests (actual total)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 19:50:44 -05:00
Cass Agent 05e92ef1d4 fix(ci): Use binary() filter for E2E test binaries in nextest
- Change `test(e2e_filters)` to `binary(e2e_filters)` - the test()
  filter matches test function names, not test binary names
- Fix E2E filter in CI workflow
- Fix --quick and --e2e filters in test-report.sh
- Add binary(~e2e) to exclude E2E binaries in quick mode

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 19:24:41 -05:00
Cass Agent 124f9d527e feat(ci): Add JUnit XML test reports with cargo-nextest (4fu5)
- Update CI workflow to use cargo-nextest with JUnit XML output
- Add test-reporter action for PR/commit test summaries
- Add scripts/test-report.sh for local test report generation
- Configure separate profiles for unit tests (ci) and E2E (e2e)

The existing .config/nextest.toml already had JUnit configuration;
this change integrates it into the CI pipeline and provides local tooling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 19:20:14 -05:00
Cass Agent 249bd45b56 feat(bench): Add memory tests and benchmark infrastructure
- Add memory_tests.rs for leak detection (repeated index/search ops)
- Add bench.yml workflow for CI benchmark tracking
- Add bench-report.sh for generating benchmark comparisons
- Fix benchmark documentation: "Concurrent Search" -> "Concurrent & Scaling"
- Replace broken thread-based search benchmark with rayon parallel indexing
  (SearchClient is !Send/!Sync, so thread::spawn can't work)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 18:22:10 -05:00
Cass Agent 9e6f846ff9 perf(coverage,bench): Optimize scripts and add concurrent benchmarks
- Fix coverage-uncovered.sh to run tests once (was running 2x)
- Add jq dependency check with warning
- Replace bc with portable awk for floating-point math
- Add concurrent search benchmarks to runtime_perf.rs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 18:16:24 -05:00
Cass Agent 278044df3e perf(coverage): Run tests once and generate reports from collected data
Optimization to coverage.sh:
- Run tests ONCE with --no-report flag
- Use 'cargo llvm-cov report' to generate LCOV, JSON, HTML from collected data
- Add jq dependency check with helpful install message

Previously the script would re-run tests for each report format.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 18:10:06 -05:00
Cass Agent 73cd0780d3 feat(ci): Add test coverage infrastructure with cargo-llvm-cov (hlz9)
Add comprehensive test coverage reporting infrastructure:

- scripts/coverage.sh: Generate HTML, LCOV, JSON coverage reports locally
  - Supports --quick (skip HTML), --open (view in browser)
  - Excludes test code from coverage metrics

- scripts/coverage-uncovered.sh: Identify untested code paths
  - Shows missing lines with context
  - Supports --fail mode with configurable threshold

- .github/workflows/coverage.yml: CI coverage integration
  - Runs on push/PR to main
  - Uploads to Codecov
  - Generates coverage summary in PR comments
  - 60% coverage warning threshold (soft gate)

- .cargo/config.toml: Cargo configuration
  - Coverage exclusion patterns
  - Cargo aliases: cov, cov-html, cov-json
  - Build optimization settings

Usage:
  ./scripts/coverage.sh --open    # Generate and view report
  ./scripts/coverage-uncovered.sh --fail --threshold=70  # CI gate

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 17:58:40 -05:00
Cass Agent 2d9a62ca92 chore(scripts): Add comprehensive test runner scripts
Add two test runner scripts for development workflow:

## test-quick.sh (129 lines)
Fast feedback loop for development - runs only essential tests.

Usage:
  ./scripts/test-quick.sh           # Run quick tests
  ./scripts/test-quick.sh --lib     # Only library unit tests
  ./scripts/test-quick.sh --cli     # Only CLI tests

Features:
- Auto-detects cargo-nextest for parallel execution
- Color output when running in terminal
- Focused test selection for rapid iteration

## test-all.sh (537 lines)
Comprehensive test runner with detailed logging.

Usage:
  ./scripts/test-all.sh           # Run all standard tests
  ./scripts/test-all.sh --all     # Include SSH and slow tests
  ./scripts/test-all.sh --help    # Show all options

Features:
- Timestamped log files in test-logs/
- JSONL structured output for CI parsing
- Separate test phases: unit, integration, doc, clippy
- Optional SSH and slow test inclusion
- Summary report with pass/fail counts
- Exit codes for CI integration
- Parallel execution support via nextest

Both scripts are self-contained with no external dependencies
beyond standard cargo tooling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 11:15:13 -05:00