OKF Impact Analysis
Goal
Given a concept ID/path (or a proposed change), return the full affected subgraph plus a practical update order.
Criticality is not a hardcoded type list in this plugin. Domain plugins declare x-impact: high|medium on their schemas. Isolated, every type is low.
Process
- Resolve the target concept (relative path, absolute path, title, or ID). Locate the bundle root (
.okf/, knowledge/, sample-okf/).
- Use deterministic tools first:
- Build both:
- Outbound closure — what the concept depends on / routes to
- Inbound closure — who cites / depends on / routes through it
- Direct typed edges —
direct_edges in impact JSON (routes_to, depends_on, …)
- Classify nodes by type and trust/lifecycle (
verified, status, stale_after) plus schema x-impact.
- Produce two outputs:
- Human report — ranked list (critical → low), with reasons and suggested actions
- Structured JSON (optional):
{ target, inbound, outbound, direct_edges, suggested_order }
Ranking heuristics
| Signal |
Effect on rank |
Schema x-impact: high (owning plugin) |
Higher impact |
verified: false on high-impact types |
Escalate one level (high → critical, medium → high) |
x-impact unset / low |
Never escalates |
status: deprecated |
Flag for cleanup, lower urgency for feature work |
| Shallow hop depth with many dependents |
Higher priority |
| Leaf knowledge nodes |
Usually lower |
Report template
# Impact: <title> (`<path>`)
## Summary
- Inbound dependents: N
- Outbound dependencies: M
- Critical / unverified highlights: ...
## Ranked dependents (update order)
1. **[Name](path)** — type, why it matters, suggested action
2. ...
## Outbound dependencies to review
- ...
## Recommended next steps
- [ ] ...
Rules
- Never invent links. Only report edges found by tools or careful Markdown crawl.
- If graph tools are unavailable, state the limitation and use link crawl.
- Prefer high-trust paths when ranking recommendations.
- After structural edits, re-run impact on the same target.
Related
- Progressive disclosure packs: use
okf-query / okf-graph.py pack
- Validation before big refactors:
okf-validate
1---2name: okf-impact3description: Compute the transitive impact (blast radius / ripple) of changing a concept in an OKF bundle. Use when the user asks what depends on a concept, what breaks if something changes, needs a ranked update list, or wants blast-radius / ripple analysis before editing knowledge nodes.4---56# OKF Impact Analysis78## Goal910Given a concept ID/path (or a proposed change), return the full affected subgraph plus a practical update order.1112Criticality is **not** a hardcoded type list in this plugin. Domain plugins declare `x-impact: high|medium` on their schemas. Isolated, every type is `low`.1314## Process15161. **Resolve** the target concept (relative path, absolute path, title, or ID). Locate the bundle root (`.okf/`, `knowledge/`, `sample-okf/`).172. **Use deterministic tools first:**18 - Prefer `okf graph <bundle>`, `okf backlinks`, or equivalent `okfcli` commands.19 - Fallback:20 ```bash21 python3 "${CLAUDE_PLUGIN_ROOT}/scripts/okf-graph.py" impact <bundle> <concept>22 python3 "${CLAUDE_PLUGIN_ROOT}/scripts/okf-graph.py" edges <bundle> --from <concept>23 ```243. Build both:25 - **Outbound** closure — what the concept depends on / routes to26 - **Inbound** closure — who cites / depends on / routes through it27 - **Direct typed edges** — `direct_edges` in impact JSON (`routes_to`, `depends_on`, …)284. **Classify** nodes by type and trust/lifecycle (`verified`, `status`, `stale_after`) plus schema `x-impact`.295. **Produce two outputs:**30 - **Human report** — ranked list (critical → low), with reasons and suggested actions31 - **Structured JSON** (optional): `{ target, inbound, outbound, direct_edges, suggested_order }`3233## Ranking heuristics3435| Signal | Effect on rank |36|--------|----------------|37| Schema `x-impact: high` (owning plugin) | Higher impact |38| `verified: false` on high-impact types | Escalate one level (`high` → `critical`, `medium` → `high`) |39| `x-impact` unset / low | Never escalates |40| `status: deprecated` | Flag for cleanup, lower urgency for feature work |41| Shallow hop depth with many dependents | Higher priority |42| Leaf knowledge nodes | Usually lower |4344## Report template4546```markdown47# Impact: <title> (`<path>`)4849## Summary50- Inbound dependents: N51- Outbound dependencies: M52- Critical / unverified highlights: ...5354## Ranked dependents (update order)551. **[Name](path)** — type, why it matters, suggested action562. ...5758## Outbound dependencies to review59- ...6061## Recommended next steps62- [ ] ...63```6465## Rules6667- Never invent links. Only report edges found by tools or careful Markdown crawl.68- If graph tools are unavailable, state the limitation and use link crawl.69- Prefer high-trust paths when ranking recommendations.70- After structural edits, re-run impact on the same target.7172## Related7374- Progressive disclosure packs: use `okf-query` / `okf-graph.py pack`75- Validation before big refactors: `okf-validate`