| name | pr-comment-fact-check |
| description | STOP and fact-check PR review comments before applying or dismissing reviewer or bot feedback. Use on CodeRabbit, Copilot, Cursor bot, dependabot, or human reviewer comments. |
PR comment fact-check
STOP before applying or dismissing any PR comment. Each comment is a claim โ verify against the actual code and this repo's authoritative sources (.agents/, docs/architecture.md, JSDoc, tests) before acting. Workflow: WORKFLOW.md.
| Verdict | Default action |
|---|
| โ
Correct | Apply + resolve |
| โ ๏ธ Partial | Apply salvageable part + explain nuance |
| โ Hallucinated | Push back with evidence; resolve-on-merge-gate exception in WORKFLOW |
| ๐ Outdated | Point at fix commit + resolve |
| ๐ญ Style | Apply if cheap, else defer |
Hallucination catalog (scrutinize harder)
Common LLM-reviewer patterns on this repo:
- "This isn't tested" without checking siblings โ core contracts are pinned across
packages/core/src/layerStack.test.ts (open/dismiss/scope/gcTime/loadFn cancel, transitions enteringDelay/exitingDelay/settle, blockers addBlocker/dismissing/async veto, dismissAll modes); each framework adapter has co-located tests under packages/<fw>/src/; real-renderer paths span packages/*/tests-dom/** (vitest, rerender/detach โ e.g. React confirm.test.tsx, blocker.test.tsx, transition.test.tsx). Import isolation is enforced by package manifests, sherif, and workspace-aware knip, not an itImportsOnlyFromCore test. Verify coverage before accepting.
- Type-safety alarms โ if
bun run typecheck passes, the claim is almost always wrong, or about runtime behavior the type system can't see (then the reviewer must justify with the runtime case).
- Generic "best practice" claims unsupported by our rules โ "always destructure", "prefer interfaces over types", "add
useMemo/useCallback" โ stylistic; we either have a rule or we don't. Grep .agents/ for the convention.
- Convention citations that don't exist โ "this breaks the library's API conventions" โ grep
.agents/ + docs/architecture.md. If not codified, it's preference, not rule.
- Memory-leak / race-condition claims with no concrete trigger โ "this could leak" without a scenario is speculation; ask for the path. Real candidates here:
notifyManager.batch flushing, AbortController cancel on dismiss, gcTime cache teardown, useSyncExternalStore unmount-detach, the scope queue draining on dismissAll โ demand the specific path.
- Wrong API for our seam โ bot suggests reaching into
LayerStack internals from an adapter when the seam is subscribe/getSnapshot; suggests a per-adapter core fork when the core/adapter seam is meant to keep one engine across all frameworks.
- Public-API suggestions that leak internals โ
createCallContext is public and intentionally generic; Layer's #state and LayerStack's #layers / #snapshot / #queuedSnapshot / #scopeQueue / #gcCache / #blockers are deliberately private. Push back on "export this helper" / "tighten this to the internal type".
Anti-patterns
- โ Applying every suggestion to clear the queue.
- โ Replying "fixed!" without verifying.
- โ Dismissing without evidence.
- โ Resolving a thread you rejected as hallucinated (the reviewer needs to see the receipts).
Reference
verify-after-each-step โ run after applying a fix.
harden-pr โ optional full pass on the branch once comments are triaged.
docs/architecture.md โ seam model, public-surface policy, test matrix (authoritative for "is this the right seam / is this tested" claims).