Restructure: live UI, vendored C, single crate, flag-based CLI#3
Merged
Conversation
Three changes that work together: 1. Visualization is now a live HTTP server, not a static file. The `<meta http-equiv="refresh" content="10">` is gone — interactive state (filter selections, scroll, click highlights) survives across data updates. The `visualize` subcommand starts a tokio + axum server with GET / (page), GET /data (JSON), GET /events (SSE). A background task re-scans every --interval seconds and only emits a `data-changed` event when the new content hash differs from the previous one. The page subscribes to /events and reloads only on real change. 2. The C library is now vendored under crates/rayforce-sys/vendor/. build.rs compiles it via `cc::Build` on every fresh build — no external checkout, no submodule, no env var. RAYFORCE_DIR still works as an override for C-side development. 3. README rewritten as a product page (~100 lines). Drops the wall of `cargo run -q -p ... -- ...` commands and example outputs that made it look like an internal scratchpad. Leads with what raysense does, why it matters, and the three commands you actually need.
Layout becomes: - Cargo.toml one [package], all deps merged, single [[bin]] - build.rs moved from crates/rayforce-sys/ — vendor path adjusted - src/lib.rs module declarations + public re-exports - src/main.rs calls raysense::cli::run() - src/sys.rs was crates/rayforce-sys/src/lib.rs - src/scanner.rs, health.rs, facts.rs, graph.rs, profile.rs, simulate.rs, baseline.rs were under crates/raysense-core/src/ - src/memory.rs was crates/raysense-memory/src/lib.rs - src/cli.rs was crates/raysense-cli/src/lib.rs - src/mcp.rs was crates/raysense-cli/src/mcp.rs - vendor/rayforce was crates/rayforce-sys/vendor/rayforce Cross-module references rewritten (raysense_core::, raysense_memory::, raysense_cli::, rayforce_sys:: -> crate:: paths). Functions previously private under the cli sub-crate that mcp.rs reaches via super:: are now pub(crate). The duplicate [[bin]] declaration that warned on every build is gone. CI and publish workflows trimmed to a single crate path and no longer depend on an external rayforce checkout. Tests preserved: 123 inline tests, all green.
…flags Replaces the Command enum's 16 subcommands with a top-level Args struct that takes the scan path as an optional positional and exposes the common modes as flags: raysense . -> health report (default, was `health`) raysense . --json -> JSON of the health summary raysense . --check -> rule gate, was `check` raysense . --watch -> watch mode, was `watch` raysense . --ui [PORT] -> live UI server, was `visualize` raysense --mcp -> stdio MCP server, was `mcp` Advanced operations (baseline / plugin / policy / trend / whatif) stay as subcommands so their multi-arg shapes don't pollute the simple path. Drops `observe` / `health` (now default), `edges` / `memory` (rolled into the default report or accessible via baseline tables), `gate` (use `--check` plus `baseline diff`), `remediate` (out of scope here), and `rayforce-version` (use `--rayforce-version` flag or `--version`). README rewritten with the new shape: the user-facing surface is now six flags plus five power-user subcommands.
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
Three slices that simplify raysense for new users:
Live UI (
3f97531). Drops<meta http-equiv=\"refresh\">. Thevisualizecommand now starts a tokio + axum server with/,/data,/events(SSE). The page reloads only when the new scan's content hash differs from the previous, so interactive state survives idle periods. C library is vendored —cargo buildfrom a fresh clone just works, no external setup. README rewritten as a product page (~100 lines, down from 369).Single crate (
cbdbef7). Five crates → one. New layout:Cargo.toml,build.rs,src/{lib,main,sys,scanner,health,facts,graph,profile,simulate,baseline,memory,cli,mcp}.rs,vendor/rayforce/. Cross-module references rewritten. CI / publish workflows trimmed. The duplicate[[bin]]warning is gone. 123 tests preserved, all green.Flag-based CLI (
0235ae0). 16 subcommands → flags on a defaultraysense [PATH]invocation:Power-user subcommands kept:
baseline,plugin,policy,trend,whatif.Numbers
tokio,tokio-stream,axum,sha2,cc(build-dep).RAYFORCE_DIRrequirement.Test plan
cargo buildfrom clean — no external setup, no env vars.cargo test— all 123 tests pass.cargo run -q -- .— health report.cargo run -q -- . --json— JSON.cargo run -q -- . --check— rule gate, exit 0 if clean.cargo run -q -- . --uithen open http://localhost:7000 — interactive UI, no auto-reload, edges toggle works, EventSource visible in dev tools.cargo run -q -- --mcpover stdio —tools/listreturns the same 43 tools.cargo run -q -- baseline save .— subcommand path still works.