You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(memory): trend history as splayed tables (Layer 3, v0.7.0)
Materialize the .raysense/trends/history.json time-series as three
splayed baseline tables (trend_health, trend_hotspots,
trend_violations). Schema bumped 3 -> 4. Older v3 baselines need
re-save; v1 trend samples remain readable but contribute zero rows
to the long tables.
history.json gains schema v2: top_hotspots (capped at 20 by
risk_score) and rule_breakdown per sample. Old v1 samples
deserialize via #[serde(default)] and roll forward on the next
baseline save.
raysense_trend MCP tool generalized: window (7d|30d|90d|all),
dimension (health|hotspots|violations|all), format
(summary|table|json), limit (now actually wired).
raysense_drift MCP tool added: ranks regressions across the window,
returning worsened dimensions, hotspots new or risen, and rules
newly tripped or with increased counts.
claude-plugin gains drift skill alongside bootstrap/impact/verify/
audit/query. Wraps rescan -> drift -> remediations.
Copy file name to clipboardExpand all lines: claude-plugin/.claude-plugin/plugin.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
{
2
2
"name": "raysense",
3
-
"version": "0.3.0",
4
-
"description": "Architectural telemetry for AI coding agents. Phase-scoped skills over the raysense MCP server: scan + baseline at session start, blast-radius before edits, regression diff after, on-demand architecture audits.",
3
+
"version": "0.4.0",
4
+
"description": "Architectural telemetry for AI coding agents. Phase-scoped skills over the raysense MCP server: scan + baseline at session start, blast-radius before edits, regression diff after, on-demand architecture audits, time-window drift detection.",
description: Use after a rescan to surface structural regressions across a time window. Diffs the latest scan against the saved baseline AND the trend history, ranking dimensions that worsened, files newly hot, and rules newly tripped. Configurable window (7d, 30d, 90d). Use periodically (daily, weekly, or pre-PR).
4
+
---
5
+
6
+
# Drift
7
+
8
+
`drift` answers one question: "what got worse since N days ago?"
9
+
It is heavier than `verify` (which only diffs against the saved
10
+
baseline) but lighter than `audit` (which sweeps the whole repo).
11
+
Run it when the question is shaped like "are we slowly losing
12
+
modularity?" or "did a bad pattern creep in over the last sprint?"
13
+
14
+
All tools take a `path` argument; pass the current repo root as an
15
+
absolute path.
16
+
17
+
## Steps
18
+
19
+
1.**Rescan**. Call `raysense_rescan` with `path: <cwd>` so the
20
+
active health is current.
21
+
2.**Drift summary**. Call `raysense_drift` with `path: <cwd>` and
22
+
`window: 30d` (the default). Returns:
23
+
-`worsened_dimensions`: the dimensions whose scores dropped
24
+
(or rule count rose) across the window.
25
+
-`hotspots_new_or_risen`: files that newly entered the top
26
+
hotspots or whose `risk_score` climbed.
27
+
-`rules_new_or_increased`: rule codes that newly tripped or
28
+
whose violation count grew.
29
+
3.**Trend context**. When `drift` reports `available: false`
30
+
(fewer than 2 samples in the window), call `raysense_trend` with
31
+
`window: all` so the user sees how short the history is. Suggest
32
+
they call `raysense_baseline_save` to seed a sample.
33
+
4.**Remediations on regression**. For each entry in
34
+
`rules_new_or_increased`, call `raysense_remediations` and
35
+
surface the suggestion alongside the regression.
36
+
37
+
## What to surface to the user
38
+
39
+
A good drift report leads with the worst regression, not the full
40
+
list. Three focused lines beat one wall of metrics:
41
+
42
+
- "Modularity dropped 0.92 to 0.78 (worst dimension this window)."
43
+
- "src/big.rs is the new top hotspot (risk_score 50 to 216)."
44
+
- "Rule `max_function_complexity` newly tripped (0 to 2)."
45
+
46
+
If `drift` returns nothing in any of the three categories, say so
47
+
plainly: "No drift detected in the last 30d." Do not pad with empty
48
+
sections.
49
+
50
+
## Window choice
51
+
52
+
-`7d`: catches regressions from the current week's edits.
53
+
-`30d`: default. Sees a typical sprint's worth of structural
54
+
movement.
55
+
-`90d`: quarterly review cadence. Often spans refactors that
56
+
haven't fully settled.
57
+
-`all`: every recorded sample. Use when you want the full arc.
58
+
59
+
Drift compares the *oldest* in-window sample to the *newest*
60
+
in-window sample. Wider windows give bigger deltas but blur acute
61
+
regressions.
62
+
63
+
## When to skip
64
+
65
+
- Fewer than 2 samples in the trend history. The skill will return
66
+
`available: false` and the report will be empty. Run
67
+
`raysense_baseline_save` first to seed history.json.
68
+
- The user asked "what's broken right now?" That is a `verify` or
69
+
`audit` question, not a drift question.
70
+
71
+
## See also
72
+
73
+
-`verify`: snapshot diff against the session baseline (no time
74
+
axis). Use after a focused chunk of edits.
75
+
-`audit`: whole-repo structural sweep, no time axis. Use when the
76
+
question is shape, not change.
77
+
-`raysense_baseline_query`: the `query` skill covers Rayfall
78
+
directly. The splayed `trend_health`, `trend_hotspots`, and
79
+
`trend_violations` tables are queryable from there for custom
0 commit comments