← Project Graph

PROJECT GRAPH FEATURE

Impact, Context, and Watch Mode

This is the shift from structural knowledge to structural safety: impact before edits, focused context instead of giant prompts, and graph freshness during long work sessions.

Feature Guide

A quick orientation block that answers the essential questions: what this feature does, how it works, why it matters, and the key concepts behind it.

What this does

Impact mode is where Project Graph becomes a change-safety tool. It estimates blast radius, groups affected modules by depth, and can package only the snippets and context that actually belong in a review or AI prompt.

How it works

Use `ai:review-graph:impact` on a class, file path, or node id, add `--context` when you want a focused context package, add `--prompt` when that package should be shaped for review or refactor work, and use `ai:review-graph:watch` when a long session would otherwise leave graph-backed answers stale.

Why it matters

This matters because risky work usually fails before the patch is done: teams underestimate blast radius, overfeed AI prompts, and keep editing while structural assumptions drift. Project Graph makes those failure modes explicit and reviewable.

Key concepts

ai:review-graph:impact
Analyzes downstream impact for a class, file path, or node id and groups affected nodes by depth and module.
--context
Packages focused source snippets and graph-backed context so review or AI work starts from the impacted structure instead of random file dumps.
--prompt
Formats the context package into a review-, refactor-, or test-oriented prompt scaffold.
ai:review-graph:watch
Keeps the stored graph fresh during active development so later graph-backed answers match the current codebase.

Change Safety Flow

Check the blast radius before you edit, then package only the context you actually need

This matters because the expensive mistakes usually happen before the final patch exists: the blast radius was guessed, the prompt was too broad, or the graph-backed answer was already stale. Impact mode puts those risks on the surface early.

Step 1

Analyze the impact radius

Point at a file path, FQCN, or node id and inspect affected modules and dependency depth before changing the target.

bin/semitexa ai:review-graph:impact Semitexa\\Demo\\Application\\Service\\DemoCatalogService
bin/semitexa ai:review-graph:impact packages/semitexa-demo/src/Application/Service/DemoCatalogService.php --json

Step 2

Package focused context for AI or review

Context output and prompt generation keep the AI input precise instead of dumping large random slices of the repository.

bin/semitexa ai:review-graph:impact Semitexa\\Demo\\Application\\Service\\DemoCatalogService --context
bin/semitexa ai:review-graph:impact Semitexa\\Demo\\Application\\Service\\DemoCatalogService --context --prompt=review

Step 3

Keep the graph current during active work

Watch mode is useful when a long editing or review-fix session would otherwise drift away from the graph that later impact answers depend on.

bin/semitexa ai:review-graph:watch --full-on-start
bin/semitexa ai:review-graph:watch --interval=2

Where The Profit Shows Up

  • Risky refactors become easier to scope before they start instead of after the first surprising breakage.
  • AI prompts become smaller and more defensible because context is selected from the impacted structure.
  • Review comments can be grounded in downstream effect instead of intuition alone.
  • Long work sessions stay safer because watch mode keeps graph-backed answers aligned with the changing repository.
ai:review-graph:impact --context --prompt ai:review-graph:watch

Verified against Semitexa Ultimate 2026.09.19.1020

Impact, Context, and Watch Mode

Project Graph is not only for inspection. It is also a practical safety layer for change planning.

Canonical flow

  1. Analyze the impact radius before editing.
  2. Package only the context needed for review or AI work.
  3. Keep the graph current during active changes when the session is long.

Commands

bin/semitexa ai:review-graph:impact Semitexa\\Demo\\Application\\Service\\DemoCatalogService
bin/semitexa ai:review-graph:impact Semitexa\\Demo\\Application\\Service\\DemoCatalogService --context
bin/semitexa ai:review-graph:impact Semitexa\\Demo\\Application\\Service\\DemoCatalogService --context --prompt=review
bin/semitexa ai:review-graph:watch --full-on-start

Why this matters

This is where the graph becomes engineering safety: clearer blast-radius decisions, smaller prompts, fewer accidental side effects, and safer refactors.

© Edsger W. Dijkstra: "Simplicity is prerequisite for reliability."

Impact Commands Implementation slice
bin/semitexa ai:review-graph:impact Semitexa\\Demo\\Application\\Service\\DemoCatalogServicebin/semitexa ai:review-graph:impact src/Application/Service/DemoCatalogService.php --jsonbin/semitexa ai:review-graph:impact Semitexa\\Demo\\Application\\Service\\DemoCatalogService --depth=5

Why It Matters

Impact and context packaging solve different but related problems

One feature estimates what a change could touch. The other controls how much of that reality you expose to AI or reviewers.

This is one of the package surfaces where humans and AI benefit from exactly the same discipline.

It turns “what might this break?” and “what context actually belongs here?” into explicit, reviewable commands instead of improvised judgment.

Problem Project Graph response Result
I do not know the blast radius yet Run `ai:review-graph:impact` on the target Change planning starts with affected modules and dependency depth.
My AI prompt is too broad Add `--context` or `--prompt` The prompt stays focused on impacted structure and snippets.
The graph may be stale while I edit Run `ai:review-graph:watch` Later graph-driven commands stay aligned with ongoing changes.

The deeper advantage is decision quality: clearer scope, smaller prompts, and fewer accidental side effects.

How it works

Use `ai:review-graph:impact` on a class, file path, or node id, add `--context` when you want a focused context package, add `--prompt` when that package should be shaped for review or refactor work, and use `ai:review-graph:watch` when a long session would otherwise leave graph-backed answers stale.

Why it matters

This matters because risky work usually fails before the patch is done: teams underestimate blast radius, overfeed AI prompts, and keep editing while structural assumptions drift. Project Graph makes those failure modes explicit and reviewable.

Key concepts

ai:review-graph:impact
Analyzes downstream impact for a class, file path, or node id and groups affected nodes by depth and module.
--context
Packages focused source snippets and graph-backed context so review or AI work starts from the impacted structure instead of random file dumps.
--prompt
Formats the context package into a review-, refactor-, or test-oriented prompt scaffold.
ai:review-graph:watch
Keeps the stored graph fresh during active development so later graph-backed answers match the current codebase.

Recommended Habit

A disciplined graph-first change workflow

Treat Project Graph as part of serious change preparation, not as an optional afterthought.

Refresh or verify the graph before substantial edits when impact results need to reflect the current repository state.

Run impact analysis before touching shared services, handlers, repositories, or framework infrastructure.

Prefer `--context` and prompt packaging over manually assembling giant AI prompts from arbitrary files.

Use watch mode during long-running refactors or review-fix sessions where the codebase changes repeatedly.

Support Semitexa
Built for developers who prefer control over magic. Your support helps keep it fast, open, and evolving.

Donate via PayPal