Skip to content

Commit f53cbb8

Browse files
committed
feat: add architecture parity controls
1 parent e6c1032 commit f53cbb8

10 files changed

Lines changed: 1479 additions & 53 deletions

File tree

README.md

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,24 @@ cargo run -q -p raysense-cli -- baseline diff ../rayforce
5050
Current Rayforce baseline:
5151

5252
```text
53-
score 96
53+
score 77
54+
quality_signal 7708
5455
coverage_score 100
55-
structural_score 92
56-
facts files=190 functions=2705 calls=25269 call_edges=15408 imports=1038
56+
structural_score 72
57+
facts files=190 functions=2662 calls=25704 call_edges=15492 imports=1039
5758
entry_points total=50 binaries=6 examples=4 tests=40
58-
imports local=656 external=0 system=382 unresolved=0
59-
graph resolved_edges=656 cycles=0
60-
coupling local_edges=656 cross_module_edges=240 cross_module_ratio=0.366
61-
calls total=25269 resolved_edges=15408 resolution_ratio=0.610 max_function_fan_in=2527 max_function_fan_out=293
62-
size max_file_lines=6329 max_function_lines=2334 large_files=63 long_functions=208
59+
imports local=657 external=0 system=382 unresolved=0
60+
graph resolved_edges=657 cycles=0
61+
coupling local_edges=657 cross_module_edges=240 cross_module_ratio=0.365
62+
calls total=25704 resolved_edges=15492 resolution_ratio=0.603 max_function_fan_in=2537 max_function_fan_out=293
63+
size max_file_lines=6329 max_function_lines=2334 large_files=63 long_functions=209
6364
test_gap production_files=150 test_files=40 files_without_nearby_tests=150
6465
dsm modules=5 module_edges=240
65-
evolution available=true commits_sampled=500 changed_files=186
66-
rules high_fan_in=2
66+
root_causes modularity=0.635 acyclicity=1.000 depth=1.000 equality=0.450 redundancy=0.952
67+
architecture depth=3 max_blast_radius=25 max_blast_radius_file=src/ops/query.c
68+
complexity max=131 avg=3.904 gini=0.550 dead_functions=50 duplicate_groups=20 redundancy_ratio=0.048
69+
evolution available=true commits_sampled=500 changed_files=190
70+
rules warnings=7 info=31
6771
```
6872

6973
## Commands
@@ -87,6 +91,13 @@ raysense observe <path> [--json] [--memory] [--config <path>]
8791
raysense health <path> [--json] [--config <path>]
8892
raysense edges <path> [--all] [--config <path>]
8993
raysense memory <path> [--config <path>]
94+
raysense check [path] [--json] [--config <path>]
95+
raysense gate [path] [--save] [--baseline <path>] [--json] [--config <path>]
96+
raysense watch [path] [--interval <seconds>] [--config <path>]
97+
raysense visualize [path] [--output <path>] [--config <path>]
98+
raysense plugin list [path] [--config <path>]
99+
raysense plugin add <name> <extensions...> [--path <path>] [--config <path>]
100+
raysense plugin init <name> <extension> [--path <path>] [--config <path>]
90101
raysense baseline save <path> [--output <path>] [--config <path>]
91102
raysense baseline diff <path> [--baseline <path>] [--config <path>] [--json]
92103
raysense baseline tables [--baseline <path>] [--json]
@@ -102,7 +113,10 @@ automatically. `--config` overrides that path.
102113
write config, run health, inspect scan facts, list dependency edges, read
103114
hotspots, read rule findings, read DSM module edges, and materialize memory
104115
table summaries. It can also save/diff baselines and query saved baseline
105-
tables with projection, filters, sorting, and pagination.
116+
tables with projection, filters, sorting, and pagination. Agent session tools
117+
can save an in-memory baseline, rescan, end the session, check rules, inspect
118+
evolution, inspect DSM data, inspect test gaps, and list configured language
119+
plugins.
106120

107121
Baselines are stored under `<path>/.raysense/baseline` by default. The manifest
108122
is JSON for fast agent diffs, and baseline tables are written under `tables/`
@@ -169,7 +183,18 @@ ignored_paths = ["target", "fixtures/generated"]
169183
enabled_languages = []
170184
disabled_languages = []
171185

186+
[[scan.plugins]]
187+
name = "foo"
188+
extensions = ["foo"]
189+
function_prefixes = ["function "]
190+
import_prefixes = ["load "]
191+
call_suffixes = ["("]
192+
172193
[rules]
194+
max_cycles = 0
195+
max_coupling_ratio = 1.0
196+
max_function_complexity = 15
197+
no_god_files = true
173198
high_file_fan_in = 50
174199
large_file_lines = 500
175200
max_large_file_findings = 20
@@ -183,6 +208,11 @@ no_tests_detected = true
183208
[[boundaries.forbidden_edges]]
184209
from = "src"
185210
to = "test"
211+
212+
[[boundaries.layers]]
213+
name = "core"
214+
path = "src/core/*"
215+
order = 0
186216
```
187217

188218
## Status
@@ -191,6 +221,8 @@ The first testable version focuses on Rust, C/C++, Python, and TypeScript
191221
codebases:
192222

193223
- Configurable scan filtering by ignored paths and enabled/disabled languages.
224+
- Generic configured language plugins by file extension with configurable
225+
function, import, and call token extraction.
194226
- Tree-sitter-backed Rust, C, C++, Python, and TypeScript function discovery
195227
with lightweight fallback extraction.
196228
- Tree-sitter-backed Rust `use`/`mod`, C/C++ include, Python import, and
@@ -204,17 +236,23 @@ codebases:
204236
- Entry point facts for binaries, examples, and tests.
205237
- Local, external, system, and unresolved import classification.
206238
- Graph metrics: resolved edges, cycles, fan-in, fan-out.
207-
- Health summary with score, import breakdown, hotspots, coupling, size,
208-
entry point, test-gap, DSM, and evolution-availability metrics.
239+
- Health summary with score, 0-10000 quality signal, root-cause scores,
240+
import breakdown, hotspots, coupling, size, entry point, test-gap, DSM,
241+
architecture, complexity, and evolution metrics.
209242
- Built-in rules for high fan-in, production dependencies on test paths,
210-
large-file/no-test findings, and call-resolution/function-call hotspots.
243+
large-file/no-test findings, call-resolution/function-call hotspots, max
244+
cycles, max coupling, max function complexity, god-file pressure, and ordered
245+
layer constraints.
211246
- Rule thresholds can be configured with TOML.
212247
- Forbidden top-level module dependencies can be configured with TOML.
213248
- Config read/write, health runs, scan facts, edges, hotspots, rule findings,
214-
module edges, memory summaries, and saved baseline table queries are exposed
215-
through the MCP interface.
249+
module edges, session start/end, rescans, rule checks, evolution, DSM, test
250+
gaps, plugin listing, memory summaries, and saved baseline table queries are
251+
exposed through the MCP interface.
216252
- Baseline save/diff is available through the CLI and MCP, with Rayforce
217253
splayed-table storage for baseline tables.
254+
- CLI quality gate, watch loop, plugin management, and generated local HTML
255+
architecture visualization are available.
218256
- Rayforce table materialization for scan facts, call facts, call edges,
219257
health summary, hotspots, rules, module edges, and changed-file evolution
220258
metrics.

0 commit comments

Comments
 (0)