:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
ReviewHog — glossary
Vocabulary settled while working on the product. Pure vocabulary — no spec, no implementation detail beyond what a term needs to be unambiguous.
- PostHog Review / Code review / ReviewHog — three names for one product. PostHog Review is the product name on every outward surface (GitHub, MCP, API docs, UI prose). Code review is the in-app page and nav name only. ReviewHog is the internal codename for code, logs, and developer docs. An
@posthog reviewcomment starts a review, and no label does. - Finding body — the reviewer's description of a problem (
Issue.issue, persisted asReviewIssueFinding.body). Dual-audience text: it is rendered verbatim in the published comment AND consumed by three downstream LLM stages (the validator'sISSUEpayload, dedup's fresh/prior finding payloads, and future turns' covered-findings block). - Validator argumentation — the validator's why-valid / why-dismissed reasoning (
IssueValidation.argumentation). For a valid finding it is presentation-only (humans + the copy-paste fix prompt); its only pipeline consumer is dedup'sprior_ruling, and only when the finding was dismissed. - Published copy — what humans read on GitHub (inline comment sections, report body) and in the Code review UI. Today it is byte-identical to the pipeline payload; nothing requires that.
- Pipeline payload — the same finding/verdict fields as consumed by downstream LLM stages (validator, dedup, covered-findings). The quality-critical audience.
- Structural conciseness vs compression — structural: the same information content reshaped into labeled bullets (claim / trigger / evidence / impact); compression: dropping information to save words. The no-quality-loss constraint rules out compression of pipeline payloads; it does not rule out restructuring.
- Verify, don't restate — the rule for validator argumentation: it is the verification delta (what was checked, what was found with file:line evidence, confirmed impact, priority rationale), never a restatement of the finding body's claim. Safe because the full body always travels with the argumentation — every consumer, human or LLM, receives both in the same comment or payload.
- Adopted skill — a review skill created by copying an existing team skill under a
review-hog-<kind>-prefixed name (the "Use an existing skill" flow), as opposed to one authored by the "Create your own" agent task. A fork, not a reference: edits to the source skill do not reach the copy, and the adopting user is the copy's author (see ADR 0002). - Report status (
active/idle/closed) — the report-level at-work flag:activewhile any run (a review turn or a resolution run) is working the report,idleat rest,closedretired. A publishing turn holdsactivethrough the GitHub publish, soidlealways implies the published state is final. The UI reads a row as in-progress fromactiveplus recent activity, so a crashed run ages out of view instead of reading as running forever. - Agent PR — a PR opened by a self-driving implementation of a Signals report, recognized by the report link present when the review report is created (only the inbox trigger passes one). An agent PR a person triggers by label or from the UI counts as a person's PR.
- Review tier — the routing bucket a report's reviewer arm is chosen from, decided once when the report is created:
humanfor a person's PR,agent_p0_p1/agent_p2/agent_p3_p4for an agent PR by its report's priority,agent_unprioritizedwhen that priority cannot be read. A tier names the bucket, not the arm: the table maps buckets to efforts and may change while the labels stay. Sticky for the report's life, with one exception: a person's trigger lifts a cheaper tier tohuman, never the reverse.
Resolution stage (the "implement the fixes" flow)
- Resolution stage — the ReviewHog-owned stage that runs after a review turn and drives the PR toward ready-to-merge: it loads the PR's posted comments and settles each one (implement / decline / escalate). It is part of the ReviewHog pipeline but independently startable on any in-scope PR — many PRs never get a review turn (too simple, StampHog-approved), so standalone mode is first-class, not a special case.
- Comments-as-input invariant — the stage's work-list is always the comments posted on the PR, never ReviewHog's in-memory findings. When chained after a review, ReviewHog's findings reach the stage the same way a human's do: as published comments. This keeps chained and standalone runs identical in shape.
- In-scope PR — the target set the resolution stage acts on: any non-fork PR in a repo the acting team's GitHub App installation can access, regardless of whether the PR's author is a person or a bot. Deliberately installation-relative, never org-specific: the stage is designed to work on any customer's project, so nothing in scope rules, prompts, or criteria may assume PostHog's own repos or internal docs — the session discovers the target repo's own conventions (CLAUDE.md / AGENTS.md / CONTRIBUTING, docs near the touched files) when present. Forks are excluded because we can't push commits to a branch we don't own and a fork head ref is attacker-influenced — the same fork guard ReviewHog already applies at fetch, now load-bearing because the resolution stage writes.
- Comment-loading policy — every comment on an in-scope PR is loaded regardless of who wrote it (human, ReviewHog, or any other bot). Author type never excludes a comment from consideration; it only feeds prioritization (see [[comment-source-rank]], to be settled under triage).
- Work-list — the unresolved review threads on the target PR, and nothing else. The unit of iteration is the thread (the whole conversation at one location), not the individual comment — the thing needing resolution is the thread's latest state. Outdated unresolved threads stay on the work-list (position drift usually means the code moved; "already addressed → reply + resolve" is a cheap, valuable outcome). Already-resolved threads are skipped. PR conversation comments and review bodies are context, not work items: the stage acts only on surfaces that can be both answered and resolved.
- Resolution session — the single warm, writable sandbox session per PR run: the PR head branch is checked out once, and the work-list is fed through it one thread per turn, in priority order. One session (not a per-thread fan-out) because the shared working tree is load-bearing — later turns see earlier turns' fixes, there is exactly one pusher (no push races), and priority order decides conflicts (the human's ask lands first).
- Resolution turn — one work-list thread processed in one session turn: investigate, judge worth/safe, implement + signed-commit when worth+safe, and return a structured verdict. Assessment and fix share a turn because they share the same repo investigation.
- Verdict-driven side effects — the sandbox agent never talks to GitHub's comment API; the driver (Temporal activity) posts replies and resolves threads server-side from the turn's structured verdict, mirroring ReviewHog's DB-driven publish. Code writes happen in-sandbox (signed commit to the PR branch); comment/resolve writes happen server-side from verdicts.
- Deterministic pre-filter — work-list trimming that needs no LLM call (e.g. a thread whose last reply is the stage's own with no activity since). Deterministic skips only; judgment stays in the session.
- Thread outcome — every work-list thread ends in exactly one of: FIXED (implemented + committed), WON'T FIX (deliberate decline with the reason), ALREADY FIXED / OBSOLETE (superseded — names the superseding change), or ESCALATE (worth doing but not safe unattended: reply, leave unresolved for a human). Taxonomy inherited from the interactive
triaging-pr-review-commentsskill; ESCALATE is the autonomous replacement for its ask-the-user gate. - Resolution criteria — the team-editable worth/safe bar, a single-active-per-user skill (
review-hog-resolution-*, validator pattern end-to-end: canonical on disk, lazy-seed sync, per-user selection via thereview_hog/resolutionconfig API and its Code review scene block, pinnedskill-getpull at run time). The hard floors stay in code; the skill may tighten the bar, never loosen it. - Safe to fix now vs needs e2e — the operational safety bar (inherited from the triage skill): a fix is safe when it is contained and provable in-session by unit tests/lint; asks touching LLM prompts, live external calls, or publish/workflow semantics need e2e verification → ESCALATE. Proportionality is part of the bar: a fix requiring new infrastructure (schema change, new abstraction, config knob) is a decision, not a mechanical fix → never auto-implemented.
- Pre-verdicted thread — a thread carrying a standing human verdict as a reply (e.g. SAFE TO FIX / E2E REQUIRED). The resolution stage honors these: SAFE TO FIX substitutes for the worth judgment when verification confirms it; E2E REQUIRED forces ESCALATE. This is the human override channel into an otherwise autonomous run.
- Inventory — the run's opening step: all unresolved threads fetched once and skimmed together before any turn, marking shared root causes. Turns stay strictly one-thread-each; a thread whose root cause an earlier turn already fixed closes as ALREADY FIXED pointing at that commit.
- Review cycle — one review turn plus its chained resolution, taken as a unit: the span from review start until the resolution stage finishes settling that review's comments. Two Temporal workflows implement it (see ADR 0001), but users reason about the cycle — "the PR is being worked on" — not the stages.
- Busy-guard — the explicit cross-stage check that refuses to start a new review while the PR's
resolve-prworkflow is running, and refuses to start a standalone resolution while itsreview-prworkflow is running (the chained hand-off is exempt: it fires only after publish). Needed because Temporal's same-id joining cannot see across the two workflows. - Resolution etiquette — triage and fixing logic is identical for every thread regardless of author; only the resolve action is author-gated. Human-authored threads: reply as the bot with the outcome (fix + commit link, or the decline/escalate reasoning), never resolve — the human keeps the final word on their own thread. Bot-authored threads: reply and resolve on terminal outcomes. ESCALATE never resolves, for any author. (Autonomous adaptation of the triage skill's "bot threads: reply + resolve; human threads: hand back" invariant — the bot now speaks as itself, but resolution of human threads still belongs to humans.)
- Entry points — the UI / MCP resolve-only action and the
run_resolutioncommand start a standalone run. Chained mode —ReviewPRWorkflowdispatching the stage after publish — is an internal dispatch, not an HTTP hop, and it is the default: reviewing includes resolving, gated by the PR owner'sresolve_commentsopt-in (off by default; snapshotted at acting-user resolution like the other gates; the owner is the mapped author, or the Inbox reviewer of a self-driving PR), with the workflow input as a per-run switch-off only the Code review scene uses (its split Review button offers "review without resolving", "resolve only", and "flash" — the Luna medium review that never resolves). Arun_resolutionmanagement command mirrorsrun_reviewfor dev/test. Deterministic skip gates run before any sandbox: closed/merged PR, fork (hard refuse — this stage writes), empty work-list after the pre-filter. One run per PR at a time via a deterministic workflow ID. - Writing mechanics — one signed commit per FIXED thread (a signed commit is inherently remote — the harness creates commits via the GitHub API, so commit cadence is push cadence), with that thread's reply/resolve posted right after its commit is visible. On a mid-run race (author pushed; signed commit refuses because the remote advanced): sync onto the new head once, re-verify, retry; if the branch moves again, yield gracefully — done threads keep their outcomes, the rest wait for the next run.
- CI boundary — the resolution stage handles review threads only; it never waits on, chases, or fixes PR checks. CI babysitting already exists (the Tasks CI follow-up loop). Known seam to close on the Tasks side:
_should_run_ci_follow_upalso fires on new unresolved threads andDEFAULT_CI_MESSAGEmandates comment-addressing — narrow that to checks-only (or skip its thread trigger) where the resolution stage is active, so two bots never fix the same comment. - Run budget — a run resolves at most 20 threads, priority-ordered; the binding constraint is the warm session's context window (every turn accumulates, and fix quality degrades as it fills), not just sandbox cost. Overflow is always named in the run summary ("handled 20, N remain") and the next run continues — never silent truncation. Session/turn timeouts are inherited from the Tasks runner. Fix size is deliberately not a numeric cap — proportionality in the criteria skill is the guard. Model/effort pinned by
RESOLUTION_*constants (validator's Claude default to start). - Per-thread watermark — idempotency lives per thread, not per report: a thread whose latest
thread_verdictstill matches its current state (no comments newer than the verdict) is skipped deterministically; any new reply re-opens triage for that thread, so pushback on a WON'T FIX gets a fresh assessment with the pushback in context. Persistence home is the livingReviewReport:thread_verdict(new content schema, latest-wins per thread) +commit/task_run/noteartefacts (their first writers).