A patch can look reasonable in isolation and still need a closer look. What else uses this function? Is the same logic copied elsewhere? Could this loop become expensive as the data grows?
These eight scenarios are illustrative, not current measurements or a promise that Roam finds every instance. Commands below produce real results for your project; replace the example symbols and paths. Read the scope and limitations before acting.
1. The clone the agent didn't notice
Scenario. The agent fixes
UserService.normalize_email(), but similar logic in
signup and admin code still has the bug.
Investigate. Refresh the index and saved clone scan before reviewing the patch:
roam index
roam --json clones --persist
roam --json critique --working-tree --intent "Fix email normalization"
Inspect unedited siblings and the saved scan's scope, caps, and freshness. Similar code is a lead, not proof that an identical repair belongs everywhere. Critique's severity depends on the actual finding.
2. The deletion that breaks a hidden caller
Scenario. A function looks unused in source but a dispatcher reaches it through a runtime string lookup.
roam --json impact resolve_legacy_token
roam --json safe-delete resolve_legacy_token
These checks use indexed static and supported bridge relationships.
A REVIEW result for unresolved use is not deletion clearance.
Inspect dynamic access, configuration, and external consumers; zero
indexed callers does not settle those questions.
3. The tidy loop that grows expensive
Scenario. A deduplication loop checks membership in a list on every iteration. It looks simple, but repeated searches can become costly as input grows.
roam --json math --confidence high
Roam looks for supported algorithmic patterns. Inspect the matched operation, loop placement, and assumptions. A set can help some membership tasks, but order, equality, and hashability still matter. Measure the proposed change with behavior-preserving controls.
4. The extra query on every row
Scenario. Rendering each order fetches its customer separately. A tiny test fixture hides the query growth.
roam --json n1
Inspect the reported database operation and its loop or call path. Framework support and receiver identity matter: a method name alone does not prove a database query. Confirm with actual query counts before choosing prefetching or batching.
5. The import that crosses a boundary
Scenario. A domain module imports an HTTP retry implementation directly, against the project's intended dependency rule.
roam --json layers
roam --json check-rules
Layers describe the indexed graph. check-rules evaluates
supported rules in .roam-rules.yml. Check which rule
actually ran and its matched imports. Critique is a separate clone,
impact, and intent check; it does not enforce this policy for you.
A missing rule is not a passed boundary check.
6. The branch no test exercises
Scenario. Tests pass through a pricing function, but none checks the branch the agent just changed.
roam --json affected-tests PricingEngine.discount_for_segment
roam --json test-gaps --changed
These commands suggest tests and gaps using indexed symbol relationships and test conventions. They do not measure executed lines or branches, so they cannot settle the scenario by themselves. Read the tests, add a regression for the changed behavior, and run the project's test and coverage tools.
7. The move with references outside the graph
Scenario. The agent moves EmailQueue,
updates imports, and misses a runtime registry containing its old path.
roam --json simulate move EmailQueue infrastructure/messaging/email_queue.py
roam --json plan-refactor EmailQueue --target-file infrastructure/messaging/email_queue.py
The simulation models a destination file in a copy of the graph and compares structural metrics without editing source. It does not discover every runtime string reference or prove that the build works. Inspect the plan, search configuration and dynamic imports separately, then run the real build and tests after the move.
8. The PR whose checks were not kept
Scenario. A reviewer asks what was checked before a merge. Green checkmarks alone do not explain the inputs or missing evidence.
roam attest --format json --sign --output change-attestation.json
attest collects a change record; its --sign
option adds a SHA-256 content hash, not a cosign signature or
authenticated signer identity. Inspect the actual checks and gaps.
For an in-toto CodeGraph statement and optional cosign signing, use the
separate roam cga emit and roam cga verify
commands with the intended key or verified keyless identity.
Keyless signing uses network services. A valid signature does not
establish test coverage or compliance.
Make one useful question part of the routine
Pick the scenario closest to your current work. Let the agent inspect the finding, read the source, and run the relevant tests. An incomplete scan is not a clean result, and static relationships are not runtime proof. Read the evidence limits.
Ordinary static analysis runs locally without model calls or automatic source upload. Installation, parser downloads, connected agents, and selected online features have their own network paths.
Set up your agent or follow the worked change-review demo to inspect a change and keep its review record.