sync: comprehensive audit fixes — PYTHONPATH, SQL injection, era mapper, test coverage#37
Conversation
- Replace hardcoded improvements list in run_source_archaeologist with _derive_improvements(): scores recommendations from flapping hotspots, todo/stub signals, decomposition momentum, and quality ratio - Add _approximate_sessions() fallback in agentic-workflow vector: groups commits via 2-hour inactivity gap when sessions table is absent - Fix modelTimeline in visualization template: was hardcoded to 7 eras, now derived from D.commit_eras — era scanner no longer flags stale entries Synced from DEV-ARCH 4cf5261
…fresh demo deliverable
…safe era_row access
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (28)
📝 WalkthroughWalkthroughThis PR hardens the devarch framework for robustness and flexibility while modernizing the demo visualization. Local inference endpoints migrate from IP addresses to localhost for better portability. The analysis engine now derives sessions and recommendations dynamically when database tables are missing. Date parsing becomes flexible across multiple formats. SQL queries use parameterization to prevent injection. Charts render dynamically from runtime data. The demo HTML gains a theme system, navigation scroll-spy, and semantic terminology updates from primary/other to liminal/other. A comprehensive CLI test suite validates all command paths. ChangesLocal Inference Endpoint Migration
Framework Robustness and Visualization
🎯 3 (Moderate) | ⏱️ ~20 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb8f858c6c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if prev_ts is None or (ts - prev_ts).total_seconds() > GAP_HOURS * 3600: | ||
| session_id = ts.strftime("%Y%m%d-%H%M%S") |
There was a problem hiding this comment.
Guard mixed timestamp types before computing session gaps
When a commit row has an unparsable date, prev_ts is set to a string (YYYY-MM-DD), but the next parseable row produces a datetime, and this subtraction path executes ts - prev_ts. That raises TypeError and aborts run_agentic_workflow for repositories without a sessions table but with mixed/dirty date rows (e.g., one blank or malformed date among normal commits). This turns the new fallback logic into a runtime crash instead of a graceful approximation.
Useful? React with 👍 / 👎.
| assert db_builder_calls, "db.builder was never invoked" | ||
| env = db_builder_calls[0]["env"] | ||
| assert "PYTHONPATH" in env | ||
| assert "archaeology" in env["PYTHONPATH"] or "DEV-ARCH" in env["PYTHONPATH"] |
There was a problem hiding this comment.
Remove repository-name assumptions from PYTHONPATH test
This assertion hardcodes path substrings ("archaeology" or "DEV-ARCH") that are unrelated to correctness, so the test fails in valid checkouts whose root path has a different name (for example, /workspace/devarch-framework). The command can propagate PYTHONPATH correctly and still fail this test, creating a false-negative CI failure.
Useful? React with 👍 / 👎.
Summary
Synced from DEV-ARCH after comprehensive audit pass (2026-05-26).
Fixes included
agent_benchmark.py, null-safe era_row accessbuild-dbcalls now propagate the package root so tests pass regardless of CWDload_erasnow handles2026-01-01 to 2026-01-02format alongside the originalJan 1 - Jan 5formatvisualizecommand — commit_eras data now included in inline PROJECT_DATA JS object (was silently empty)signalsUX — exits nonzero with clear message when DB missing; distinguishes 0-signal result from missing DBlocal_pipeline.py— addedtimeout=300to subprocess callservecommand — renamed dashboard server todashboardto stop silently overwriting the datasette serverTest coverage
tests/test_cli_coverage.py— 26 tests for 17 previously untested CLI commands (93 total, all passing)Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
Improvements
Tests