@rune-kit/rune 2.6.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -6
- package/compiler/__tests__/executive-dashboards.test.js +285 -0
- package/compiler/__tests__/inject.test.js +128 -0
- package/compiler/__tests__/orchestrators.test.js +151 -0
- package/compiler/__tests__/org-templates.test.js +447 -0
- package/compiler/__tests__/parser.test.js +201 -147
- package/compiler/__tests__/skill-index.test.js +218 -218
- package/compiler/__tests__/status.test.js +336 -0
- package/compiler/__tests__/templates.test.js +245 -0
- package/compiler/__tests__/visualizer.test.js +325 -0
- package/compiler/adapters/antigravity.js +71 -71
- package/compiler/bin/rune.js +444 -355
- package/compiler/doctor.js +272 -1
- package/compiler/emitter.js +939 -678
- package/compiler/parser.js +498 -267
- package/compiler/status.js +342 -0
- package/compiler/visualizer.js +622 -0
- package/package.json +1 -1
- package/skills/autopsy/SKILL.md +48 -1
- package/skills/completion-gate/SKILL.md +26 -1
- package/skills/context-engine/SKILL.md +93 -2
- package/skills/cook/SKILL.md +137 -4
- package/skills/debug/SKILL.md +16 -1
- package/skills/docs/SKILL.md +28 -3
- package/skills/fix/SKILL.md +2 -1
- package/skills/mcp-builder/SKILL.md +53 -1
- package/skills/onboard/SKILL.md +51 -1
- package/skills/perf/SKILL.md +34 -1
- package/skills/plan/SKILL.md +29 -1
- package/skills/preflight/SKILL.md +35 -1
- package/skills/retro/SKILL.md +95 -1
- package/skills/review/SKILL.md +45 -1
- package/skills/scope-guard/SKILL.md +1 -0
- package/skills/sentinel/SKILL.md +35 -1
- package/skills/sentinel/references/policy-driven-constraints.md +424 -0
- package/skills/session-bridge/SKILL.md +57 -2
- package/skills/session-bridge/references/evolutionary-memory-patterns.md +312 -0
- package/skills/team/SKILL.md +15 -1
package/skills/perf/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: perf
|
|
|
3
3
|
description: Performance regression gate. Detects N+1 queries, sync-in-async, missing indexes, memory leaks, and bundle bloat before they reach production.
|
|
4
4
|
metadata:
|
|
5
5
|
author: runedev
|
|
6
|
-
version: "0.
|
|
6
|
+
version: "0.3.0"
|
|
7
7
|
layer: L2
|
|
8
8
|
model: sonnet
|
|
9
9
|
group: quality
|
|
@@ -242,6 +242,39 @@ Emit structured report:
|
|
|
242
242
|
### Verdict: PASS | WARN | BLOCK
|
|
243
243
|
```
|
|
244
244
|
|
|
245
|
+
### Step 8.5 — Token Budget Tracking (AI-Powered Apps)
|
|
246
|
+
|
|
247
|
+
For projects that call AI APIs (detected via imports of `anthropic`, `openai`, `@anthropic-ai/sdk`, `@ai-sdk/core`, `langchain`, `llamaindex`, or `fastmcp`), audit token usage patterns per operation type.
|
|
248
|
+
|
|
249
|
+
**Scan for:**
|
|
250
|
+
|
|
251
|
+
| Pattern | Finding | Impact |
|
|
252
|
+
|---------|---------|--------|
|
|
253
|
+
| AI call inside a loop without batching | `TOKEN_LOOP — [file:line] — AI call in loop over [collection] — batch or parallelize` | Cost scales linearly with collection size |
|
|
254
|
+
| No token usage tracking | `NO_TOKEN_TRACKING — [file:line] — AI response usage not captured — add cost logging` | Invisible spend, no budget control |
|
|
255
|
+
| Expensive model for simple tasks | `MODEL_MISMATCH — [file:line] — using [opus/gpt-4] for [classification/extraction] — use [haiku/gpt-4.1-mini]` | 10-30x cost difference for same result |
|
|
256
|
+
| Missing max_tokens on open-ended prompts | `UNBOUNDED_TOKENS — [file:line] — no max_tokens on [call] — add limit to prevent runaway cost` | Single call can consume entire budget |
|
|
257
|
+
| Duplicate AI calls for same input | `DUPLICATE_AI_CALL — [file:line] — same prompt sent to [provider] without caching — add response cache` | Wasted tokens on redundant calls |
|
|
258
|
+
|
|
259
|
+
**Per-Operation Cost Awareness:**
|
|
260
|
+
|
|
261
|
+
When token tracking IS present, analyze the operation type breakdown:
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
Operation Type Avg Tokens Frequency Monthly Est.
|
|
265
|
+
─────────────────────────────────────────────────────────────
|
|
266
|
+
Chat (primary) 2,500 in/800 out high $X.XX
|
|
267
|
+
Background notes 500 in/200 out per-chat $X.XX
|
|
268
|
+
Summarization 1,500 in/300 out periodic $X.XX
|
|
269
|
+
Classification 200 in/50 out high $X.XX
|
|
270
|
+
─────────────────────────────────────────────────────────────
|
|
271
|
+
Total estimated monthly $X.XX
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
**Report this under a `### AI Token Budget` subsection** in the Perf Report. Only include when AI API usage detected — skip entirely for non-AI projects.
|
|
275
|
+
|
|
276
|
+
**Key insight**: The most impactful optimization is often **model selection per operation** — using a cheaper model for background tasks (summarization, classification, metadata extraction) while reserving expensive models for primary user-facing interactions. A 10x cost reduction on 60% of calls = 6x overall savings.
|
|
277
|
+
|
|
245
278
|
## Output Format
|
|
246
279
|
|
|
247
280
|
```
|
package/skills/plan/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: plan
|
|
|
3
3
|
description: Create structured implementation plans from requirements. Produces master plan + phase files for enterprise-scale project management. Master plan = overview (<80 lines). Phase files = execution detail (<150 lines each). Each session handles 1 phase. Uses opus for deep reasoning.
|
|
4
4
|
metadata:
|
|
5
5
|
author: runedev
|
|
6
|
-
version: "1.
|
|
6
|
+
version: "1.2.0"
|
|
7
7
|
layer: L2
|
|
8
8
|
model: opus
|
|
9
9
|
group: creation
|
|
@@ -260,6 +260,32 @@ After spec approved → transition to Implementation Mode.
|
|
|
260
260
|
|
|
261
261
|
Every plan output — master plan, phase file, or inline plan — MUST end with an **Outcome Block** containing: What Was Planned + Immediate Next Action (single action, imperative) + How to Measure table (at least one shell command).
|
|
262
262
|
|
|
263
|
+
## Change Stacking (Overlap Detection)
|
|
264
|
+
|
|
265
|
+
> From OpenSpec (Fission-AI/OpenSpec, 32.8k★): "Dependencies without metadata create phantom coupling."
|
|
266
|
+
|
|
267
|
+
When producing phase files with wave-based task grouping, every task MUST declare dependency metadata:
|
|
268
|
+
|
|
269
|
+
```markdown
|
|
270
|
+
### Task: Implement auth middleware
|
|
271
|
+
- **File**: `src/middleware/auth.ts` — new
|
|
272
|
+
- **touches**: [src/middleware/auth.ts, src/types/auth.d.ts]
|
|
273
|
+
- **provides**: [AuthMiddleware, verifyToken()]
|
|
274
|
+
- **requires**: [UserModel from Wave 1]
|
|
275
|
+
- **depends_on**: [task-1a]
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
**Pre-dispatch validation** (run after all tasks written, before presenting plan):
|
|
279
|
+
|
|
280
|
+
| Check | Detection | Action |
|
|
281
|
+
|-------|-----------|--------|
|
|
282
|
+
| **File overlap** | Same file in `touches[]` of 2+ tasks in same wave | BLOCK — move to sequential waves or merge tasks |
|
|
283
|
+
| **Missing dependency** | Task A's `requires[]` not in any prior task's `provides[]` | BLOCK — add missing task or fix dependency chain |
|
|
284
|
+
| **Cycle detection** | Task A `depends_on` B, B `depends_on` A | BLOCK — decompose into smaller tasks to break cycle |
|
|
285
|
+
| **Orphaned provides** | Task declares `provides[]` but no future task `requires[]` it | WARN — may indicate dead code or missing consumer task |
|
|
286
|
+
|
|
287
|
+
**Skip if**: Inline plan (trivial task), single-phase plan, or all tasks are strictly sequential.
|
|
288
|
+
|
|
263
289
|
## Constraints
|
|
264
290
|
|
|
265
291
|
1. MUST produce master plan + phase files for non-trivial tasks (3+ phases OR 5+ files OR 100+ LOC)
|
|
@@ -309,6 +335,8 @@ Every plan output — master plan, phase file, or inline plan — MUST end with
|
|
|
309
335
|
| Recommending shortcut approach without Completeness Score | MEDIUM | Step 5.5: every alternative needs X/10 Completeness score + dual effort estimate (human vs AI). "Saves 70 LOC" is not a reason when AI makes the delta cost minutes |
|
|
310
336
|
| Plan output missing Outcome Block | MEDIUM | Every plan output MUST end with Outcome Block (What Was Planned + Immediate Next Action + How to Measure) — executor drift when omitted |
|
|
311
337
|
| Outcome Block "Next Action" is a list, not one action | LOW | One action only — ambiguity about where to start causes re-analysis and lost context |
|
|
338
|
+
| Overlapping file ownership across parallel phases/streams | HIGH | Change Stacking: every task declares `touches[]` — overlap detection flags same file in 2+ tasks before execution |
|
|
339
|
+
| Missing dependency between tasks that share artifacts | HIGH | Every task declares `provides[]` and `requires[]` — cycle detection + missing dep check before dispatch |
|
|
312
340
|
|
|
313
341
|
## Self-Validation
|
|
314
342
|
|
|
@@ -3,7 +3,7 @@ name: preflight
|
|
|
3
3
|
description: Pre-commit quality gate that catches "almost right" code. Goes beyond linting — checks logic correctness, error handling, regressions, and completeness.
|
|
4
4
|
metadata:
|
|
5
5
|
author: runedev
|
|
6
|
-
version: "0.
|
|
6
|
+
version: "0.7.0"
|
|
7
7
|
layer: L2
|
|
8
8
|
model: sonnet
|
|
9
9
|
group: quality
|
|
@@ -237,6 +237,40 @@ When a domain pack is installed (e.g., `@rune-pro/finance`, `@rune-pro/legal`),
|
|
|
237
237
|
- `src/billing/invoice.ts:42` — WARN: price calculation uses `toFixed(2)` instead of `Intl.NumberFormat`
|
|
238
238
|
```
|
|
239
239
|
|
|
240
|
+
### Step 4.6 — Organization Approval Requirements (Business)
|
|
241
|
+
|
|
242
|
+
If `.rune/org/org.md` exists, load organization approval workflows and enforce them as additional quality gates.
|
|
243
|
+
|
|
244
|
+
1. `Read` `.rune/org/org.md` and extract `## Policies`, `## Approval Flows`, and `## Governance Level`
|
|
245
|
+
2. Apply organization-level quality requirements:
|
|
246
|
+
|
|
247
|
+
| Org Policy | Preflight Check | Severity |
|
|
248
|
+
|------------|----------------|----------|
|
|
249
|
+
| `minimum_reviewers` | Verify PR has required reviewer count before merge | WARN: "Org requires {N} reviewers" |
|
|
250
|
+
| `self-merge_allowed` | If "Never" or "No", flag self-merge attempts | BLOCK if org prohibits |
|
|
251
|
+
| `required_checks` | Verify all org-required checks (tests, security scan, type check, lint) are passing | BLOCK if missing |
|
|
252
|
+
| `staging_required` | If "Yes", verify staging deployment exists before production | WARN if no staging step |
|
|
253
|
+
| `feature_flags` | If "Required for user-facing changes", flag new UI without feature flag | WARN |
|
|
254
|
+
| `cross-domain_changes` | If changes span multiple team domains, require reviewer from each | WARN |
|
|
255
|
+
|
|
256
|
+
3. Load `## Approval Flows > ### Feature Launch` and display the required approval chain:
|
|
257
|
+
- Output: "Org approval chain: {flow}" so developer knows the full pipeline
|
|
258
|
+
- If governance level is "Maximum", flag any attempt to skip gates
|
|
259
|
+
|
|
260
|
+
4. Append org findings under `### Organization Requirements` section:
|
|
261
|
+
|
|
262
|
+
```
|
|
263
|
+
### Organization Requirements
|
|
264
|
+
- **Org template**: [startup|mid-size|enterprise]
|
|
265
|
+
- **Governance level**: [Minimal|Moderate|Maximum]
|
|
266
|
+
- **Minimum reviewers**: 2 (1 must be director+)
|
|
267
|
+
- **Required checks**: tests (≥80% coverage), security scan, type check, lint
|
|
268
|
+
- **Approval chain**: contributor proposes → lead reviews → vp approves → deploy
|
|
269
|
+
- WARN: Self-merge not allowed per org policy
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
If `.rune/org/org.md` does not exist, skip and log INFO: "no org config, organization requirements check skipped".
|
|
273
|
+
|
|
240
274
|
### Step 4.8 — Preflight Composite Score
|
|
241
275
|
|
|
242
276
|
After all domain hooks (Step 4.5) and completeness checks (Step 4) complete, compute a **Preflight Health Score** to make the verdict numeric and comparable across runs.
|
package/skills/retro/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: retro
|
|
|
3
3
|
description: Engineering retrospective. Analyzes commit history, work patterns, and code quality metrics with trend tracking. Per-person breakdowns, shipping streaks, and actionable improvements. Use when asked for "retro", "weekly review", "what did we ship", or "engineering retrospective".
|
|
4
4
|
metadata:
|
|
5
5
|
author: runedev
|
|
6
|
-
version: "0.
|
|
6
|
+
version: "0.3.0"
|
|
7
7
|
layer: L2
|
|
8
8
|
model: sonnet
|
|
9
9
|
group: knowledge
|
|
@@ -28,6 +28,7 @@ Retro is ENCOURAGING but CANDID. Every critique is anchored in specific commits,
|
|
|
28
28
|
- `/rune retro 14d` — sprint retro (2 weeks)
|
|
29
29
|
- `/rune retro 30d` — monthly review
|
|
30
30
|
- `/rune retro compare` — current vs previous period side-by-side
|
|
31
|
+
- `/rune retro --business` — cross-domain executive retrospective with HTML report (Business tier)
|
|
31
32
|
- Called by `audit` (L2) for engineering health dimension
|
|
32
33
|
- Auto-suggest: end of work week (Friday sessions)
|
|
33
34
|
|
|
@@ -226,6 +227,60 @@ Structure (~800-1500 words — concise, not a novel):
|
|
|
226
227
|
|
|
227
228
|
**Tone**: Encouraging but candid. Specific and concrete. Anchored in actual commits, not vague impressions. Every critique paired with a specific suggestion.
|
|
228
229
|
|
|
230
|
+
## Milestone Progressive Analysis
|
|
231
|
+
|
|
232
|
+
At specific project milestones, retro automatically generates a **deeper analysis** with a different focal point per milestone. This goes beyond the standard weekly retro — it's a reflective checkpoint on the project's evolution.
|
|
233
|
+
|
|
234
|
+
### Milestone Detection
|
|
235
|
+
|
|
236
|
+
Count total retro snapshots in `.rune/retros/` (each represents ~1 retro session). Trigger milestone analysis when count reaches:
|
|
237
|
+
|
|
238
|
+
| Milestone | Retro Count | Focal Point | Depth |
|
|
239
|
+
|-----------|------------|-------------|-------|
|
|
240
|
+
| First Month | 4 | **Foundations** — Are conventions solid? Is the architecture scaling? Are early decisions holding? | Standard + foundation review |
|
|
241
|
+
| Quarter | 12 | **Patterns** — What recurring themes emerged? Which areas churn most? Is technical debt growing or shrinking? | Standard + theme extraction |
|
|
242
|
+
| Half Year | 24 | **Growth** — How has the codebase evolved? Are the original architectural bets paying off? What would you do differently? | Standard + architecture review |
|
|
243
|
+
| One Year | 50 | **Maturity** — Full project health assessment. Velocity trends over time. Team growth patterns. Knowledge distribution. | Standard + full evolution timeline |
|
|
244
|
+
|
|
245
|
+
### Milestone Execution
|
|
246
|
+
|
|
247
|
+
When a milestone is detected (retro count matches a threshold for the first time):
|
|
248
|
+
|
|
249
|
+
1. **Announce**: `"🏁 Milestone: [name] ([count] retros). Generating deep analysis..."`
|
|
250
|
+
2. **Load history**: Read ALL `.rune/retros/*.json` snapshots (not just the most recent)
|
|
251
|
+
3. **Compute evolution metrics**: Plot key metrics over time (commits/week, test ratio, fix ratio, session depth)
|
|
252
|
+
4. **Focal analysis**: Generate the milestone-specific analysis based on the focal point column above
|
|
253
|
+
5. **Trend narrative**: Write a 300-500 word narrative on how the project has evolved, anchored in actual data
|
|
254
|
+
6. **Save**: Write milestone report to `.rune/retros/{YYYY-MM-DD}-milestone-{name}.md`
|
|
255
|
+
|
|
256
|
+
### Milestone Report Structure
|
|
257
|
+
|
|
258
|
+
```markdown
|
|
259
|
+
## Milestone: [name] — [date]
|
|
260
|
+
|
|
261
|
+
### Evolution Timeline
|
|
262
|
+
[ASCII chart or table showing key metrics across all retro snapshots]
|
|
263
|
+
|
|
264
|
+
### [Focal Point] Analysis
|
|
265
|
+
[300-500 words anchored in data — specific commits, files, metrics]
|
|
266
|
+
|
|
267
|
+
### What's Working
|
|
268
|
+
- [pattern that's improving, with evidence]
|
|
269
|
+
|
|
270
|
+
### What Needs Attention
|
|
271
|
+
- [pattern that's degrading, with evidence]
|
|
272
|
+
|
|
273
|
+
### Recommendations
|
|
274
|
+
- [1-3 concrete actions based on the focal analysis]
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Rules
|
|
278
|
+
|
|
279
|
+
- Milestone analysis is **additive** — it runs ON TOP of the standard retro, not instead of it
|
|
280
|
+
- Each milestone triggers ONCE — check if `.rune/retros/*-milestone-{name}.md` already exists before generating
|
|
281
|
+
- If retro history is sparse (gaps >30 days), note this in the report — trends may be unreliable
|
|
282
|
+
- Milestone analysis does NOT count toward the retro's normal output — it's a separate artifact
|
|
283
|
+
|
|
229
284
|
## Compare Mode
|
|
230
285
|
|
|
231
286
|
When invoked as `/rune retro compare`:
|
|
@@ -247,6 +302,45 @@ SELF-VALIDATION (run before emitting report):
|
|
|
247
302
|
- [ ] No code was modified — retro is read-only
|
|
248
303
|
```
|
|
249
304
|
|
|
305
|
+
## Business Mode (--business)
|
|
306
|
+
|
|
307
|
+
When invoked as `/rune retro --business`, generate a cross-domain executive retrospective with HTML output. Requires Business tier (`.rune/org/org.md` should exist).
|
|
308
|
+
|
|
309
|
+
### Business Data Sources
|
|
310
|
+
|
|
311
|
+
Pull from all installed domain packs:
|
|
312
|
+
- **Engineering**: git history (commits, velocity, test ratio, fix ratio, hotspots)
|
|
313
|
+
- **Revenue** (@rune-pro/sales): pipeline metrics, deal velocity, churn risk
|
|
314
|
+
- **Support** (@rune-pro/support): ticket volume, SLA compliance, CSAT
|
|
315
|
+
- **Finance** (@rune-business/finance): burn rate, runway, budget variance
|
|
316
|
+
- **Compliance** (@rune-business/legal): framework status, audit dates, open items
|
|
317
|
+
|
|
318
|
+
### Business Execution Steps
|
|
319
|
+
|
|
320
|
+
1. **Gather**: Run standard retro Steps 1-10 for engineering data
|
|
321
|
+
2. **Org Context**: Read `.rune/org/org.md` for team structure and governance level
|
|
322
|
+
3. **Cross-Domain KPIs**: Aggregate metrics from domain signal history (`.rune/signals/`)
|
|
323
|
+
4. **Team Health**: Score each team from org config on velocity, quality, morale
|
|
324
|
+
5. **Compliance**: Check compliance frameworks from org security policies
|
|
325
|
+
6. **HTML Render**: Load `report-templates/retro-business.html` from Business pack and populate all `{{placeholder}}` fields with computed data
|
|
326
|
+
7. **Save**: Write HTML to `.rune/retros/{YYYY-MM-DD}-business.html`
|
|
327
|
+
8. **Also save** JSON snapshot (same as standard retro) for trend tracking
|
|
328
|
+
|
|
329
|
+
### Business Output
|
|
330
|
+
|
|
331
|
+
```
|
|
332
|
+
.rune/retros/2026-03-30-business.html — Self-contained HTML report
|
|
333
|
+
.rune/retros/2026-03-30.json — Machine-readable metrics
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
The HTML report includes: KPI cards with trend deltas, domain performance bars (engineering, revenue, support, finance), team health table, compliance status, key insights (wins + risks), and is printable to PDF via Ctrl+P.
|
|
337
|
+
|
|
338
|
+
### Graceful Degradation
|
|
339
|
+
|
|
340
|
+
- If no Business pack installed: skip business mode, fall back to standard retro
|
|
341
|
+
- If domain data unavailable: show "No data" for that domain, don't fail
|
|
342
|
+
- If `.rune/org/org.md` missing: use generic team structure, WARN in report
|
|
343
|
+
|
|
250
344
|
## Constraints
|
|
251
345
|
|
|
252
346
|
1. MUST NOT modify any code — retro is read-only analysis
|
package/skills/review/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: review
|
|
|
3
3
|
description: Code quality review — patterns, security, performance, correctness. Finds bugs, suggests improvements, triggers fix for issues found. Escalates to opus for security-critical code.
|
|
4
4
|
metadata:
|
|
5
5
|
author: runedev
|
|
6
|
-
version: "0.
|
|
6
|
+
version: "0.6.0"
|
|
7
7
|
layer: L2
|
|
8
8
|
model: sonnet
|
|
9
9
|
group: development
|
|
@@ -252,6 +252,47 @@ Produce a structured severity-ranked report.
|
|
|
252
252
|
- Include a Positive Notes section (good patterns observed)
|
|
253
253
|
- Include a Verdict: APPROVE | REQUEST CHANGES | NEEDS DISCUSSION
|
|
254
254
|
|
|
255
|
+
### Step 6.5: Fix-First Triage
|
|
256
|
+
|
|
257
|
+
> From gstack (garrytan/gstack, 50.9k★): "Reviews that produce 20 findings and delegate all to the user waste everyone's time."
|
|
258
|
+
|
|
259
|
+
Classify each finding as **AUTO-FIX** or **ASK** before reporting:
|
|
260
|
+
|
|
261
|
+
| Category | Auto-Fix? | Examples |
|
|
262
|
+
|----------|-----------|---------|
|
|
263
|
+
| Dead imports, unused variables | AUTO-FIX | `import { foo } from './bar'` where foo is never used |
|
|
264
|
+
| Missing error handling on obvious paths | AUTO-FIX | `await fetch()` without try/catch in production code |
|
|
265
|
+
| Console.log in production code | AUTO-FIX | Remove `console.log` from non-CLI production files |
|
|
266
|
+
| Architectural concern, trade-off | ASK | "This bypasses the auth middleware — intentional?" |
|
|
267
|
+
| Ambiguous intent | ASK | "Is this fallback behavior correct for null users?" |
|
|
268
|
+
| Style/convention disagreement | ASK | "Project uses camelCase but this file uses snake_case" |
|
|
269
|
+
|
|
270
|
+
**After classification:**
|
|
271
|
+
- Apply AUTO-FIX findings directly via `rune:fix` — include all in a single batch
|
|
272
|
+
- Collect ASK findings into ONE `AskUserQuestion` — not 5 separate questions
|
|
273
|
+
- Report both: "Auto-fixed 4 issues. 2 findings need your input: [...]"
|
|
274
|
+
|
|
275
|
+
**Rationalization prevention**: "This looks fine" is NOT acceptable without evidence. If you can't cite a specific file:line or convention that justifies the code, flag it as UNVERIFIED — don't rationalize away uncertainty.
|
|
276
|
+
|
|
277
|
+
### Step 6.6: Scope Drift Detection
|
|
278
|
+
|
|
279
|
+
> From gstack (garrytan/gstack, 50.9k★): "Intent vs diff catches scope creep that plan-based guards miss."
|
|
280
|
+
|
|
281
|
+
After reviewing code, compare **stated intent** vs **actual diff**:
|
|
282
|
+
|
|
283
|
+
1. Read the originating source: TODO list, PR description, commit messages, or plan file
|
|
284
|
+
2. Extract stated intent: "what was this change supposed to do?"
|
|
285
|
+
3. Run `git diff --stat` to see actual file changes
|
|
286
|
+
4. Compare:
|
|
287
|
+
|
|
288
|
+
| Result | Meaning | Action |
|
|
289
|
+
|--------|---------|--------|
|
|
290
|
+
| **CLEAN** | All changed files serve the stated intent | Note in report |
|
|
291
|
+
| **DRIFT** | 1-2 files changed that don't relate to stated intent | WARN — "These files were modified but aren't mentioned in the task: [list]" |
|
|
292
|
+
| **REQUIREMENTS_MISSING** | Stated intent mentions files/features not in the diff | WARN — "Task mentions X but it's not in the diff" |
|
|
293
|
+
|
|
294
|
+
**This is informational, not blocking.** Scope drift is common and sometimes intentional — but making it visible prevents silent creep.
|
|
295
|
+
|
|
255
296
|
After reporting:
|
|
256
297
|
- If any CRITICAL findings: call `rune:fix` immediately with the finding details
|
|
257
298
|
- If any HIGH findings: call `rune:fix` with the finding details
|
|
@@ -476,6 +517,9 @@ When `cook` or `ship` checks review status: compare review commit hash with curr
|
|
|
476
517
|
| Suggesting "add X" without checking if X is used | MEDIUM | YAGNI pushback: grep codebase for the suggested feature → if uncalled anywhere → respond "Not called anywhere. Remove? (YAGNI)". Valid pushback, not laziness |
|
|
477
518
|
| Adding abstractions "for future flexibility" | MEDIUM | Three similar lines > premature abstraction. Only abstract when there are 3+ concrete callers today |
|
|
478
519
|
| Missing cross-phase integration check at phase boundary | MEDIUM | When reviewing a phase completion: check orphaned exports, uncalled routes, auth gaps, E2E flow continuity. Delegate to completion-gate Step 4.5 |
|
|
520
|
+
| Review loop exceeds 3 iterations without resolution | MEDIUM | Cap at 3 review loops. After 3rd iteration with unresolved findings → surface to user with "these findings persist after 3 fix attempts — needs human decision" |
|
|
521
|
+
| Auto-fixing something that should have been ASK | HIGH | When in doubt, ASK. AUTO-FIX only for mechanical issues (dead imports, console.log). Anything involving intent or trade-offs = ASK |
|
|
522
|
+
| Scope drift flagged on intentional refactoring | LOW | Scope drift is informational, not blocking. User can override with "intentional" — don't re-flag after override |
|
|
479
523
|
|
|
480
524
|
## Done When
|
|
481
525
|
|
|
@@ -136,6 +136,7 @@ Known failure modes for this skill. Check these before declaring done.
|
|
|
136
136
|
| Classifying lock file changes as out-of-scope | LOW | package-lock.json, yarn.lock, Cargo.lock are always IN_SCOPE |
|
|
137
137
|
| SIGNIFICANT CREEP threshold applied to 1-2 unplanned files | LOW | MINOR = 1-2 files, SIGNIFICANT = 3+ files — don't escalate prematurely |
|
|
138
138
|
| Plan not loadable (no TodoWrite, no progress.md) | MEDIUM | Ask calling skill for plan as text description before proceeding |
|
|
139
|
+
| Scope check against plan but not against stated intent | MEDIUM | Plan-based scope guard catches file drift; review Step 6.6 (Scope Drift Detection) catches intent drift. Both should run for full coverage |
|
|
139
140
|
|
|
140
141
|
## Done When
|
|
141
142
|
|
package/skills/sentinel/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: sentinel
|
|
|
3
3
|
description: Automated security gatekeeper. Blocks unsafe code before commit — secret scanning, OWASP top 10, dependency audit, permission checks. A GATE, not a suggestion.
|
|
4
4
|
metadata:
|
|
5
5
|
author: runedev
|
|
6
|
-
version: "0.
|
|
6
|
+
version: "0.9.0"
|
|
7
7
|
layer: L2
|
|
8
8
|
model: sonnet
|
|
9
9
|
group: quality
|
|
@@ -198,6 +198,40 @@ If `.rune/contract.md` exists, validate staged changes against project contract
|
|
|
198
198
|
|
|
199
199
|
If `.rune/contract.md` does not exist, skip and log INFO: "no project contract, contract validation skipped".
|
|
200
200
|
|
|
201
|
+
### Step 4.86 — Organization Policy Enforcement (Business)
|
|
202
|
+
|
|
203
|
+
If `.rune/org/org.md` exists, load organization security policies and enforce them as additional gates.
|
|
204
|
+
|
|
205
|
+
1. `Read` `.rune/org/org.md` and extract the `## Policies > ### Security` section
|
|
206
|
+
2. For each org security policy, validate staged changes:
|
|
207
|
+
|
|
208
|
+
| Org Policy | Check | Severity |
|
|
209
|
+
|------------|-------|----------|
|
|
210
|
+
| `dependency_audit_frequency` | Verify audit cadence matches org requirement | WARN if overdue |
|
|
211
|
+
| `secret_rotation` | Flag secrets older than org-defined rotation period | WARN |
|
|
212
|
+
| `compliance_frameworks` | Ensure listed frameworks (SOC2, GDPR, HIPAA, PCI-DSS) checks are active | WARN if missing |
|
|
213
|
+
| `penetration_testing` | Log when last pentest was conducted vs org schedule | INFO |
|
|
214
|
+
| `separation_of_duties` | Verify commit author ≠ PR approver when org requires it | BLOCK if violated |
|
|
215
|
+
|
|
216
|
+
3. Check `## Policies > ### Code Review` for minimum reviewer requirements:
|
|
217
|
+
- If org requires N reviewers, include in report: "Org policy requires {N} reviewer(s)"
|
|
218
|
+
- If org requires security reviewer for auth/data paths, flag auth-touching changes
|
|
219
|
+
|
|
220
|
+
4. Check `## Policies > ### Deployment` for deploy window and feature flag requirements:
|
|
221
|
+
- If org requires feature flags for user-facing changes, flag new UI code without feature flag wrapper
|
|
222
|
+
|
|
223
|
+
5. Append org policy findings to the sentinel report under `### Organization Policy` section
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
### Organization Policy
|
|
227
|
+
- **Org template**: [startup|mid-size|enterprise]
|
|
228
|
+
- **Governance level**: [Minimal|Moderate|Maximum]
|
|
229
|
+
- `auth/login.ts` — WARN: org requires security reviewer for auth paths (Policy: Code Review)
|
|
230
|
+
- Deploy window: Weekdays 09:00-16:00 (org policy)
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
If `.rune/org/org.md` does not exist, skip and log INFO: "no org config, organization policy check skipped".
|
|
234
|
+
|
|
201
235
|
### Step 4.9 — Six-Gate Finding Validation
|
|
202
236
|
|
|
203
237
|
Before reporting ANY finding as BLOCK or WARN, it MUST pass through these 6 gates. Any gate failure → downgrade to INFO or discard. This prevents hallucinated vulnerabilities from blocking real work.
|